@edgex-web/components 0.1.0-beta.3 → 0.1.0-beta.30
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/components/Deposit/index.d.ts +4 -6
- package/dist/components/Deposit/index.d.ts.map +1 -1
- package/dist/components/Deposit/src/DepositManager.d.ts +2 -0
- package/dist/components/Deposit/src/DepositManager.d.ts.map +1 -1
- package/dist/components/Deposit/src/{EVMWalletView.d.ts → evm/WalletView.d.ts} +4 -3
- package/dist/components/Deposit/src/evm/WalletView.d.ts.map +1 -0
- package/dist/components/Deposit/src/evm/index.d.ts +33 -0
- package/dist/components/Deposit/src/evm/index.d.ts.map +1 -0
- package/dist/components/Deposit/src/hooks/useMulticallBalance.d.ts +69 -0
- package/dist/components/Deposit/src/hooks/useMulticallBalance.d.ts.map +1 -0
- package/dist/components/Deposit/src/index.d.ts.map +1 -1
- package/dist/components/Deposit/src/{MPCWalletView.d.ts → mpc/WalletView.d.ts} +3 -4
- package/dist/components/Deposit/src/mpc/WalletView.d.ts.map +1 -0
- package/dist/components/Deposit/src/mpc/index.d.ts +23 -0
- package/dist/components/Deposit/src/mpc/index.d.ts.map +1 -0
- package/dist/components/Deposit/src/selector/Asset.d.ts +19 -0
- package/dist/components/Deposit/src/selector/Asset.d.ts.map +1 -0
- package/dist/components/Deposit/src/selector/Chain.d.ts +16 -0
- package/dist/components/Deposit/src/selector/Chain.d.ts.map +1 -0
- package/dist/components/Deposit/src/selector/index.d.ts +14 -0
- package/dist/components/Deposit/src/selector/index.d.ts.map +1 -0
- package/dist/components/Deposit/src/utils.d.ts +62 -1
- package/dist/components/Deposit/src/utils.d.ts.map +1 -1
- package/dist/components/Deposit/src/walletAdapters.d.ts.map +1 -1
- package/dist/components/Deposit/test-arbitrum-token-limits.d.ts +5 -0
- package/dist/components/Deposit/test-arbitrum-token-limits.d.ts.map +1 -0
- package/dist/components/Deposit/test-arbitrum-unlimited.d.ts +5 -0
- package/dist/components/Deposit/test-arbitrum-unlimited.d.ts.map +1 -0
- package/dist/components/Deposit/types/index.d.ts +63 -49
- package/dist/components/Deposit/types/index.d.ts.map +1 -1
- package/dist/components/Deposit/utils/migrateDepositData.d.ts +42 -0
- package/dist/components/Deposit/utils/migrateDepositData.d.ts.map +1 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +19 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts.map +1 -0
- package/dist/components/LoadingSpinner/index.d.ts +4 -0
- package/dist/components/LoadingSpinner/index.d.ts.map +1 -0
- package/dist/components/Provider/index.d.ts +6 -1
- package/dist/components/Provider/index.d.ts.map +1 -1
- package/dist/components/Tooltip/index.d.ts +3 -0
- package/dist/components/Tooltip/index.d.ts.map +1 -0
- package/dist/components/Tooltip/src/Tooltip.d.ts +5 -0
- package/dist/components/Tooltip/src/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/src/TooltipArrow.d.ts +5 -0
- package/dist/components/Tooltip/src/TooltipArrow.d.ts.map +1 -0
- package/dist/components/Tooltip/src/index.d.ts +3 -0
- package/dist/components/Tooltip/src/index.d.ts.map +1 -0
- package/dist/components/Tooltip/types/index.d.ts +52 -0
- package/dist/components/Tooltip/types/index.d.ts.map +1 -0
- package/dist/components/Withdraw/constants/index.d.ts +7 -0
- package/dist/components/Withdraw/constants/index.d.ts.map +1 -0
- package/dist/components/Withdraw/index.d.ts +6 -10
- package/dist/components/Withdraw/index.d.ts.map +1 -1
- package/dist/components/Withdraw/src/Speed.d.ts +10 -0
- package/dist/components/Withdraw/src/Speed.d.ts.map +1 -0
- package/dist/components/Withdraw/src/WithdrawManager.d.ts +12 -0
- package/dist/components/Withdraw/src/WithdrawManager.d.ts.map +1 -0
- package/dist/components/Withdraw/src/constants.d.ts +24 -0
- package/dist/components/Withdraw/src/constants.d.ts.map +1 -0
- package/dist/components/Withdraw/src/evm/WalletView.d.ts +22 -0
- package/dist/components/Withdraw/src/evm/WalletView.d.ts.map +1 -0
- package/dist/components/Withdraw/src/evm/index.d.ts +34 -0
- package/dist/components/Withdraw/src/evm/index.d.ts.map +1 -0
- package/dist/components/Withdraw/src/index.d.ts +5 -0
- package/dist/components/Withdraw/src/index.d.ts.map +1 -0
- package/dist/components/Withdraw/types/index.d.ts +83 -0
- package/dist/components/Withdraw/types/index.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useTranslation.d.ts +131 -0
- package/dist/hooks/useTranslation.d.ts.map +1 -0
- package/dist/index.d.ts +11 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +9132 -6292
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +57 -60
- package/dist/index.umd.js.map +1 -1
- package/dist/locales/en-US.d.ts +48 -0
- package/dist/locales/en-US.d.ts.map +1 -0
- package/dist/locales/index.d.ts +16 -0
- package/dist/locales/index.d.ts.map +1 -0
- package/dist/locales/ja-JP.d.ts +48 -0
- package/dist/locales/ja-JP.d.ts.map +1 -0
- package/dist/locales/ru-RU.d.ts +48 -0
- package/dist/locales/ru-RU.d.ts.map +1 -0
- package/dist/locales/zh-CN.d.ts +49 -0
- package/dist/locales/zh-CN.d.ts.map +1 -0
- package/dist/locales/zh-TW.d.ts +48 -0
- package/dist/locales/zh-TW.d.ts.map +1 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +22 -11
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/index.d.ts +14 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +10 -4
- package/dist/components/Deposit/src/ChainSelector.d.ts +0 -35
- package/dist/components/Deposit/src/ChainSelector.d.ts.map +0 -1
- package/dist/components/Deposit/src/ChainTokenSelector.d.ts +0 -25
- package/dist/components/Deposit/src/ChainTokenSelector.d.ts.map +0 -1
- package/dist/components/Deposit/src/Deposit.d.ts +0 -17
- package/dist/components/Deposit/src/Deposit.d.ts.map +0 -1
- package/dist/components/Deposit/src/EVMWalletView.d.ts.map +0 -1
- package/dist/components/Deposit/src/MPCWalletView.d.ts.map +0 -1
- package/dist/components/Deposit/src/components.d.ts +0 -89
- package/dist/components/Deposit/src/components.d.ts.map +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Z,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],m):(Z=typeof globalThis<"u"?globalThis:Z||self,m(Z.EdgeXComponents={},Z.React,Z.ReactDOM))})(this,function(Z,m,Se){"use strict";var yh=Object.defineProperty;var xh=(Z,m,Se)=>m in Z?yh(Z,m,{enumerable:!0,configurable:!0,writable:!0,value:Se}):Z[m]=Se;var Ie=(Z,m,Se)=>xh(Z,typeof m!="symbol"?m+"":m,Se);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(Se);function sa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zn={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
|
|
9
|
+
*/var Ao;function la(){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={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,56 +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
|
|
18
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),pe=te.length-1,me=
|
|
21
|
-
`+te[pe].replace(" at new "," at ");return
|
|
17
|
+
*/var Mo;function aa(){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(A){if(A===null||typeof A!="object")return null;var U=g&&A[g]||A[v];return typeof U=="function"?U:null}var M=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(A){{for(var U=arguments.length,K=new Array(U>1?U-1:0),X=1;X<U;X++)K[X-1]=arguments[X];N("error",A,K)}}function N(A,U,K){{var X=M.ReactDebugCurrentFrame,ie=X.getStackAddendum();ie!==""&&(U+="%s",K=K.concat([ie]));var ae=K.map(function(re){return String(re)});ae.unshift("Warning: "+U),Function.prototype.apply.call(console[A],console,ae)}}var F=!1,j=!1,k=!1,B=!1,h=!1,b;b=Symbol.for("react.module.reference");function y(A){return!!(typeof A=="string"||typeof A=="function"||A===r||A===i||h||A===o||A===a||A===c||B||A===f||F||j||k||typeof A=="object"&&A!==null&&(A.$$typeof===p||A.$$typeof===d||A.$$typeof===l||A.$$typeof===u||A.$$typeof===s||A.$$typeof===b||A.getModuleId!==void 0))}function $(A,U,K){var X=A.displayName;if(X)return X;var ie=U.displayName||U.name||"";return ie!==""?K+"("+ie+")":K}function D(A){return A.displayName||"Context"}function L(A){if(A==null)return null;if(typeof A.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof A=="function")return A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){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 A=="object")switch(A.$$typeof){case u:var U=A;return D(U)+".Consumer";case l:var K=A;return D(K._context)+".Provider";case s:return $(A,A.render,"ForwardRef");case d:var X=A.displayName||null;return X!==null?X:L(A.type)||"Memo";case p:{var ie=A,ae=ie._payload,re=ie._init;try{return L(re(ae))}catch{return null}}}return null}var C=Object.assign,O=0,T,P,x,I,_,V,W;function Y(){}Y.__reactDisabledLog=!0;function q(){{if(O===0){T=console.log,P=console.info,x=console.warn,I=console.error,_=console.group,V=console.groupCollapsed,W=console.groupEnd;var A={configurable:!0,enumerable:!0,value:Y,writable:!0};Object.defineProperties(console,{info:A,log:A,warn:A,error:A,group:A,groupCollapsed:A,groupEnd:A})}O++}}function G(){{if(O--,O===0){var A={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:C({},A,{value:T}),info:C({},A,{value:P}),warn:C({},A,{value:x}),error:C({},A,{value:I}),group:C({},A,{value:_}),groupCollapsed:C({},A,{value:V}),groupEnd:C({},A,{value:W})})}O<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var H=M.ReactCurrentDispatcher,z;function J(A,U,K){{if(z===void 0)try{throw Error()}catch(ie){var X=ie.stack.trim().match(/\n( *(at )?)/);z=X&&X[1]||""}return`
|
|
18
|
+
`+z+A}}var se=!1,he;{var $e=typeof WeakMap=="function"?WeakMap:Map;he=new $e}function it(A,U){if(!A||se)return"";{var K=he.get(A);if(K!==void 0)return K}var X;se=!0;var ie=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ae;ae=H.current,H.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(Ae){X=Ae}Reflect.construct(A,[],re)}else{try{re.call()}catch(Ae){X=Ae}A.call(re.prototype)}}else{try{throw Error()}catch(Ae){X=Ae}A()}}catch(Ae){if(Ae&&X&&typeof Ae.stack=="string"){for(var te=Ae.stack.split(`
|
|
19
|
+
`),Oe=X.stack.split(`
|
|
20
|
+
`),pe=te.length-1,me=Oe.length-1;pe>=1&&me>=0&&te[pe]!==Oe[me];)me--;for(;pe>=1&&me>=0;pe--,me--)if(te[pe]!==Oe[me]){if(pe!==1||me!==1)do if(pe--,me--,me<0||te[pe]!==Oe[me]){var He=`
|
|
21
|
+
`+te[pe].replace(" at new "," at ");return A.displayName&&He.includes("<anonymous>")&&(He=He.replace("<anonymous>",A.displayName)),typeof A=="function"&&he.set(A,He),He}while(pe>=1&&me>=0);break}}}finally{se=!1,H.current=ae,G(),Error.prepareStackTrace=ie}var Ut=A?A.displayName||A.name:"",Dt=Ut?J(Ut):"";return typeof A=="function"&&he.set(A,Dt),Dt}function Ee(A,U,K){return it(A,!1)}function ge(A){var U=A.prototype;return!!(U&&U.isReactComponent)}function le(A,U,K){if(A==null)return"";if(typeof A=="function")return it(A,ge(A));if(typeof A=="string")return J(A);switch(A){case a:return J("Suspense");case c:return J("SuspenseList")}if(typeof A=="object")switch(A.$$typeof){case s:return Ee(A.render);case d:return le(A.type,U,K);case p:{var X=A,ie=X._payload,ae=X._init;try{return le(ae(ie),U,K)}catch{}}}return""}var an=Object.prototype.hasOwnProperty,Hl={},Gl=M.ReactDebugCurrentFrame;function Qn(A){if(A){var U=A._owner,K=le(A.type,A._source,U?U.type:null);Gl.setExtraStackFrame(K)}else Gl.setExtraStackFrame(null)}function Qm(A,U,K,X,ie){{var ae=Function.call.bind(an);for(var re in A)if(ae(A,re)){var te=void 0;try{if(typeof A[re]!="function"){var Oe=Error((X||"React class")+": "+K+" type `"+re+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof A[re]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Oe.name="Invariant Violation",Oe}te=A[re](U,re,X,K,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",K,re,typeof te),Qn(null)),te instanceof Error&&!(te.message in Hl)&&(Hl[te.message]=!0,Qn(ie),w("Failed %s type: %s",K,te.message),Qn(null))}}}var Zm=Array.isArray;function To(A){return Zm(A)}function Jm(A){{var U=typeof Symbol=="function"&&Symbol.toStringTag,K=U&&A[Symbol.toStringTag]||A.constructor.name||"Object";return K}}function eh(A){try{return Yl(A),!1}catch{return!0}}function Yl(A){return""+A}function Kl(A){if(eh(A))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Jm(A)),Yl(A)}var ql=M.ReactCurrentOwner,th={key:!0,ref:!0,__self:!0,__source:!0},Xl,Ql;function nh(A){if(an.call(A,"ref")){var U=Object.getOwnPropertyDescriptor(A,"ref").get;if(U&&U.isReactWarning)return!1}return A.ref!==void 0}function rh(A){if(an.call(A,"key")){var U=Object.getOwnPropertyDescriptor(A,"key").get;if(U&&U.isReactWarning)return!1}return A.key!==void 0}function oh(A,U){typeof A.ref=="string"&&ql.current}function ih(A,U){{var K=function(){Xl||(Xl=!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))};K.isReactWarning=!0,Object.defineProperty(A,"key",{get:K,configurable:!0})}}function sh(A,U){{var K=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))};K.isReactWarning=!0,Object.defineProperty(A,"ref",{get:K,configurable:!0})}}var lh=function(A,U,K,X,ie,ae,re){var te={$$typeof:t,type:A,key:U,ref:K,props:re,_owner:ae};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 ah(A,U,K,X,ie){{var ae,re={},te=null,Oe=null;K!==void 0&&(Kl(K),te=""+K),rh(U)&&(Kl(U.key),te=""+U.key),nh(U)&&(Oe=U.ref,oh(U,ie));for(ae in U)an.call(U,ae)&&!th.hasOwnProperty(ae)&&(re[ae]=U[ae]);if(A&&A.defaultProps){var pe=A.defaultProps;for(ae in pe)re[ae]===void 0&&(re[ae]=pe[ae])}if(te||Oe){var me=typeof A=="function"?A.displayName||A.name||"Unknown":A;te&&ih(re,me),Oe&&sh(re,me)}return lh(A,te,Oe,ie,X,ql.current,re)}}var No=M.ReactCurrentOwner,Zl=M.ReactDebugCurrentFrame;function Wt(A){if(A){var U=A._owner,K=le(A.type,A._source,U?U.type:null);Zl.setExtraStackFrame(K)}else Zl.setExtraStackFrame(null)}var Lo;Lo=!1;function Po(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function Jl(){{if(No.current){var A=L(No.current.type);if(A)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+
|
|
23
|
+
Check the render method of \``+A+"`."}return""}}function uh(A){return""}var ea={};function ch(A){{var U=Jl();if(!U){var K=typeof A=="string"?A:A.displayName||A.name;K&&(U=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+
|
|
25
|
+
Check the top-level render call using <`+K+">.")}return U}}function ta(A,U){{if(!A._store||A._store.validated||A.key!=null)return;A._store.validated=!0;var K=ch(U);if(ea[K])return;ea[K]=!0;var X="";A&&A._owner&&A._owner!==No.current&&(X=" It was passed a child from "+L(A._owner.type)+"."),Wt(A),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',K,X),Wt(null)}}function na(A,U){{if(typeof A!="object")return;if(To(A))for(var K=0;K<A.length;K++){var X=A[K];Po(X)&&ta(X,U)}else if(Po(A))A._store&&(A._store.validated=!0);else if(A){var ie=E(A);if(typeof ie=="function"&&ie!==A.entries)for(var ae=ie.call(A),re;!(re=ae.next()).done;)Po(re.value)&&ta(re.value,U)}}}function fh(A){{var U=A.type;if(U==null||typeof U=="string")return;var K;if(typeof U=="function")K=U.propTypes;else if(typeof U=="object"&&(U.$$typeof===s||U.$$typeof===d))K=U.propTypes;else return;if(K){var X=L(U);Qm(K,A.props,"prop",X,A)}else if(U.PropTypes!==void 0&&!Lo){Lo=!0;var ie=L(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 dh(A){{for(var U=Object.keys(A.props),K=0;K<U.length;K++){var X=U[K];if(X!=="children"&&X!=="key"){Wt(A),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",X),Wt(null);break}}A.ref!==null&&(Wt(A),w("Invalid attribute `ref` supplied to `React.Fragment`."),Wt(null))}}var ra={};function oa(A,U,K,X,ie,ae){{var re=y(A);if(!re){var te="";(A===void 0||typeof A=="object"&&A!==null&&Object.keys(A).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 Oe=uh();Oe?te+=Oe:te+=Jl();var pe;A===null?pe="null":To(A)?pe="array":A!==void 0&&A.$$typeof===t?(pe="<"+(L(A.type)||"Unknown")+" />",te=" Did you accidentally export a JSX literal instead of a component?"):pe=typeof A,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=ah(A,U,K,ie,ae);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++)na(He[Ut],A);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 na(He,A)}if(an.call(U,"key")){var Dt=L(A),Ae=Object.keys(U).filter(function(bh){return bh!=="key"}),Do=Ae.length>0?"{key: someKey, "+Ae.join(": ..., ")+": ...}":"{key: someKey}";if(!ra[Dt+Do]){var vh=Ae.length>0?"{"+Ae.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} />`,
|
|
30
|
+
<%s key={someKey} {...props} />`,Do,Dt,vh,Dt),ra[Dt+Do]=!0}}return A===r?dh(me):fh(me),me}}function ph(A,U,K){return oa(A,U,K,!0)}function mh(A,U,K){return oa(A,U,K,!1)}var hh=mh,gh=ph;Ht.Fragment=r,Ht.jsx=hh,Ht.jsxs=gh}()),Ht}process.env.NODE_ENV==="production"?Zn.exports=la():Zn.exports=aa();var S=Zn.exports;const ua={deposit:{title:"充值",chain:"链",asset:"资产",amount:"数量",available:"可用",equity:"总资产",confirmDeposit:"充值确认",switchNetwork:"切换网络",max:"最大",arrivalTime:"到账时间",minDeposit:"最小充值金额",minDepositParsed:"最少充值 {{amount}} {{token}}",maxDeposit:"最大充值金额",depositTipFor25w:"单笔充值金额上限为 200,000。若充值金额大于200,000,请使用Ethereum链充值。",depositAllTip:`仅支持发送 {{coin}} ({{v}}) 资产到此地址。
|
|
31
|
+
充值金额大于 200,000 时,到账时间存在一定延迟,请耐心等待。`,enableSystemProWithToken:"在{{network}}上启用{{token}}",enableTokenDesc:"您首次在{{network}}上存款时必须启用{{token}}。",enableWithToken:"启用 {{token}}",arrivaltimeTooltip1:"您可以在约 {{v}} 分钟 (达到 {{v1}} 个区块确认后) 提走已到账的资金",arrivaltimeTooltip2:"预计时间是根据历史数据计算所得,仅供参考。网络拥堵可能会导致实际到账时间变长。",arrivalEstimated:"≈ {{v}}分钟",availableDesc:"您可以提取的最大金额。当 available 为0或负数时,不允许提现。",noPrivateKeyWalletWarning:"暂不支持无私钥钱包充值。若您是无私钥钱包,请勿进行充值。",layerZeroDepositTip:"系统会根据充值资金实际情况,将您的充值通过LayerZero完成。",layerZeroDepositButton:"使用LayerZero充值"},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:"接收地址不合法"}},ca={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 200,000. If your deposit exceeds 200,000, please use the Ethereum chain.",depositAllTip:`Only {{coin}} ({{v}}) is supported for deposits to this address.
|
|
32
|
+
If the deposit amount exceeds 200,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.",layerZeroDepositTip:"The system will complete your deposit via LayerZero based on the actual deposit conditions.",layerZeroDepositButton:"Deposit with LayerZero"},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"}},fa={deposit:{title:"入金",chain:"チェーン",asset:"資産",amount:"数量",available:"利用可能",equity:"総資産",confirmDeposit:"入金確認",switchNetwork:"ネットワークを切り替え",max:"最大",arrivalTime:"着金予定時間",minDeposit:"最低入金額",minDepositParsed:"最低入金額 {{amount}} {{token}}",maxDeposit:"最大入金額",depositTipFor25w:"1回の入金上限額は200,000です。200,000を超える場合は、Ethereumチェーンでの入金をご利用ください。",depositAllTip:`このアドレスは{{coin}}({{v}})専用です。他通貨は送金しないでください。
|
|
33
|
+
入金金額が 200,000 を超える場合、反映までに時間がかかることがあります。しばらくお待ちください。`,enableSystemProWithToken:"{{network}} 上で {{token}} を有効化",enableTokenDesc:"初めて {{network}} に入金する際は、{{token}} の有効化が必要です。",enableWithToken:"{{token}} を有効化",arrivaltimeTooltip1:"{{v1}} ブロック確認後、おおよそ {{v}} 分以内に引き出し可能となります",arrivaltimeTooltip2:"着金時間は過去データに基づいた目安であり、ネットワーク状況により遅延する場合があります。",arrivalEstimated:"≈ {{v}}分",availableDesc:"出金可能な最大金額です。 available が0またはマイナスの場合、出金は行えません。",noPrivateKeyWalletWarning:"現在、秘密鍵のないウォレットからの入金はサポートされていません。該当ウォレットをご利用の場合は、入金しないでください。",layerZeroDepositTip:"システムは入金資金の実際の状況に基づき、LayerZeroを通じて入金を完了します。",layerZeroDepositButton:"LayerZeroで入金"},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:"無効な受け取りアドレス"}},da={deposit:{title:"Депозит",chain:"Сеть",asset:"Актив",amount:"Сумма",available:"Доступно",equity:"Капитал",confirmDeposit:"Подтвердить депозит",switchNetwork:"Сменить сеть",max:"Максимум",arrivalTime:"Время поступления",minDeposit:"Минимальная сумма депозита",minDepositParsed:"Мин. депозит {{amount}} {{token}}",maxDeposit:"Максимальная сумма депозита",depositTipFor25w:"Максимальная сумма одного пополнения — 200 000. Если сумма превышает 200 000, пожалуйста, используйте сеть Ethereum для пополнения.",depositAllTip:`На этот адрес можно внести только {{coin}} ({{v}}).
|
|
34
|
+
Если сумма депозита превышает 200 000, время поступления может быть увеличено. Пожалуйста, ожидайте.`,enableSystemProWithToken:"Включить {{token}} в сети {{network}}",enableTokenDesc:"При первом депозите в сети {{network}} необходимо включить {{token}}.",enableWithToken:"Включить {{token}}",arrivaltimeTooltip1:"Вы сможете вывести поступившие средства примерно через {{v}} минут (после {{v1}} подтверждений в блокчейне)",arrivaltimeTooltip2:"Оценка времени основана на истории и дана только для справки. Задержки сети могут увеличить фактическое время поступления.",arrivalEstimated:"≈ {{v}} минут",availableDesc:"Максимальная сумма для вывода. Если доступная сумма равна 0 или меньше, вывод невозможен.",noPrivateKeyWalletWarning:"В настоящее время пополнение кошельков без приватных ключей не поддерживается. Если у вас такой кошелёк, пожалуйста, не выполняйте пополнение.",layerZeroDepositTip:"Система завершит ваше пополнение через LayerZero в зависимости от фактических условий депозита.",layerZeroDepositButton:"Пополнение через LayerZero"},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:"Неверный адрес получателя"}},pa={deposit:{title:"充值",chain:"鏈",asset:"資產",amount:"數量",available:"可用",equity:"總資產",confirmDeposit:"充值確認",switchNetwork:"切換網絡",max:"最大",arrivalTime:"到帳時間",minDeposit:"最小儲值金額",minDepositParsed:"最少充值 {{amount}} {{token}}",maxDeposit:"最大儲值金額",depositTipFor25w:"單筆充值金額上限為 200,000。若充值金額大於 200,000,請使用 Ethereum 鏈充值。",depositAllTip:`僅支援發送 {{coin}} ({{v}}) 資產到此位址。
|
|
35
|
+
充值金額大於 200,000 時,到账時間可能會有延遲,請耐心等待。`,enableSystemProWithToken:"在{{network}}上啓用{{token}}",enableTokenDesc:"您首次在{{network}}上存款時必須啓用{{token}}。",enableWithToken:"啓用 {{token}}",arrivaltimeTooltip1:"您可以在約 {{v}} 分鐘 (達到 {{v1}} 個區塊確認後) 提走已到帳的資金",arrivaltimeTooltip2:"預計時間是根據歷史資料計算所得,僅供參考。網路壅塞可能會導致實際到帳時間變長。",arrivalEstimated:"≈ {{v}}分鐘",availableDesc:"您可以提取的最大金額。當 available 爲0或負數時,不允許提現。",noPrivateKeyWalletWarning:"暫不支援無私鑰錢包充值。若您使用的是無私鑰錢包,請勿進行充值。",layerZeroDepositTip:"系統會根據充值資金的實際情況,通過 LayerZero 完成您的充值。",layerZeroDepositButton:"使用LayerZero充值"},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":ca,"ja-JP":fa,"ru-RU":da,"zh-CN":ua,"zh-TW":pa},un="en-US",ma={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語","ru-RU":"Русский"},ha=e=>Jn.includes(e)?Io[e]:Io[un],ga=e=>Jn.includes(e),jo=m.createContext(null),va=({config:e,children:t})=>{const n=m.useMemo(()=>{const r=e.locale||un,o=ga(r)?r:un,i=ha(o);return{...e,currentLocale:o,translations:i}},[e]);return S.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 ba=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,er=Math.ceil,je=Math.floor,Te="[BigNumber Error] ",Ro=Te+"Number primitive has more than 15 significant digits: ",Ge=1e14,Q=14,tr=9007199254740991,nr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ht=1e7,ve=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 y,$,D,L,C,O,T,P,x=this;if(!(x instanceof w))return new w(h,b);if(b==null){if(h&&h._isBigNumber===!0){x.s=h.s,!h.c||h.e>d?x.c=x.e=null:h.e<c?x.c=[x.e=0]:(x.e=h.e,x.c=h.c.slice());return}if((O=typeof h=="number")&&h*0==0){if(x.s=1/h<0?(h=-h,-1):1,h===~~h){for(L=0,C=h;C>=10;C/=10,L++);L>d?x.c=x.e=null:(x.e=L,x.c=[h]);return}P=String(h)}else{if(!ba.test(P=String(h)))return r(x,P,O);x.s=P.charCodeAt(0)==45?(P=P.slice(1),-1):1}(L=P.indexOf("."))>-1&&(P=P.replace(".","")),(C=P.search(/e/i))>0?(L<0&&(L=C),L+=+P.slice(C+1),P=P.substring(0,C)):L<0&&(L=P.length)}else{if(ce(b,2,E.length,"Base"),b==10&&M)return x=new w(h),k(x,l+x.e+1,u);if(P=String(h),O=typeof h=="number"){if(h*0!=0)return r(x,P,O,b);if(x.s=1/h<0?(P=P.slice(1),-1):1,w.DEBUG&&P.replace(/^0\.0*|\./,"").length>15)throw Error(Ro+h)}else x.s=P.charCodeAt(0)===45?(P=P.slice(1),-1):1;for(y=E.slice(0,b),L=C=0,T=P.length;C<T;C++)if(y.indexOf($=P.charAt(C))<0){if($=="."){if(C>L){L=T;continue}}else if(!D&&(P==P.toUpperCase()&&(P=P.toLowerCase())||P==P.toLowerCase()&&(P=P.toUpperCase()))){D=!0,C=-1,L=0;continue}return r(x,String(h),O,b)}O=!1,P=n(P,b,10,x.s),(L=P.indexOf("."))>-1?P=P.replace(".",""):L=P.length}for(C=0;P.charCodeAt(C)===48;C++);for(T=P.length;P.charCodeAt(--T)===48;);if(P=P.slice(C,++T)){if(T-=C,O&&w.DEBUG&&T>15&&(h>tr||h!==je(h)))throw Error(Ro+x.s*h);if((L=L-C-1)>d)x.c=x.e=null;else if(L<c)x.c=[x.e=0];else{if(x.e=L,x.c=[],C=(L+1)%Q,L<0&&(C+=Q),C<T){for(C&&x.c.push(+P.slice(0,C)),T-=Q;C<T;)x.c.push(+P.slice(C,C+=Q));C=Q-(P=P.slice(C)).length}else C-=T;for(;C--;P+="0");x.c.push(+P)}}else x.c=[x.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,y;if(h!=null)if(typeof h=="object"){if(h.hasOwnProperty(b="DECIMAL_PLACES")&&(y=h[b],ce(y,0,ve,b),l=y),h.hasOwnProperty(b="ROUNDING_MODE")&&(y=h[b],ce(y,0,8,b),u=y),h.hasOwnProperty(b="EXPONENTIAL_AT")&&(y=h[b],y&&y.pop?(ce(y[0],-ve,0,b),ce(y[1],0,ve,b),s=y[0],a=y[1]):(ce(y,-ve,ve,b),s=-(a=y<0?-y:y))),h.hasOwnProperty(b="RANGE"))if(y=h[b],y&&y.pop)ce(y[0],-ve,-1,b),ce(y[1],1,ve,b),c=y[0],d=y[1];else if(ce(y,-ve,ve,b),y)c=-(d=y<0?-y:y);else throw Error(Te+b+" cannot be zero: "+y);if(h.hasOwnProperty(b="CRYPTO"))if(y=h[b],y===!!y)if(y)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))p=y;else throw p=!y,Error(Te+"crypto unavailable");else p=y;else throw Error(Te+b+" not true or false: "+y);if(h.hasOwnProperty(b="MODULO_MODE")&&(y=h[b],ce(y,0,9,b),f=y),h.hasOwnProperty(b="POW_PRECISION")&&(y=h[b],ce(y,0,ve,b),g=y),h.hasOwnProperty(b="FORMAT"))if(y=h[b],typeof y=="object")v=y;else throw Error(Te+b+" not an object: "+y);if(h.hasOwnProperty(b="ALPHABET"))if(y=h[b],typeof y=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(y))M=y.slice(0,10)=="0123456789",E=y;else throw Error(Te+b+" invalid: "+y)}else throw Error(Te+"Object expected: "+h);return{DECIMAL_PLACES:l,ROUNDING_MODE:u,EXPONENTIAL_AT:[s,a],RANGE:[c,d],CRYPTO:p,MODULO_MODE:f,POW_PRECISION:g,FORMAT:v,ALPHABET:E}},w.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var b,y,$=h.c,D=h.e,L=h.s;e:if({}.toString.call($)=="[object Array]"){if((L===1||L===-1)&&D>=-ve&&D<=ve&&D===je(D)){if($[0]===0){if(D===0&&$.length===1)return!0;break e}if(b=(D+1)%Q,b<1&&(b+=Q),String($[0]).length==b){for(b=0;b<$.length;b++)if(y=$[b],y<0||y>=Ge||y!==je(y))break e;if(y!==0)return!0}}}else if($===null&&D===null&&(L===null||L===1||L===-1))return!0;throw Error(Te+"Invalid BigNumber: "+h)},w.maximum=w.max=function(){return F(arguments,-1)},w.minimum=w.min=function(){return F(arguments,1)},w.random=function(){var h=9007199254740992,b=Math.random()*h&2097151?function(){return je(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(y){var $,D,L,C,O,T=0,P=[],x=new w(i);if(y==null?y=l:ce(y,0,ve),C=er(y/Q),p)if(crypto.getRandomValues){for($=crypto.getRandomValues(new Uint32Array(C*=2));T<C;)O=$[T]*131072+($[T+1]>>>11),O>=9e15?(D=crypto.getRandomValues(new Uint32Array(2)),$[T]=D[0],$[T+1]=D[1]):(P.push(O%1e14),T+=2);T=C/2}else if(crypto.randomBytes){for($=crypto.randomBytes(C*=7);T<C;)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):(P.push(O%1e14),T+=7);T=C/7}else throw p=!1,Error(Te+"crypto unavailable");if(!p)for(;T<C;)O=b(),O<9e15&&(P[T++]=O%1e14);for(C=P[--T],y%=Q,C&&y&&(O=nr[Q-y],P[T]=je(C/O)*O);P[T]===0;P.pop(),T--);if(T<0)P=[L=0];else{for(L=-1;P[0]===0;P.splice(0,1),L-=Q);for(T=1,O=P[0];O>=10;O/=10,T++);T<Q&&(L-=Q-T)}return x.e=L,x.c=P,x}}(),w.sum=function(){for(var h=1,b=arguments,y=new w(b[0]);h<b.length;)y=y.plus(b[h++]);return y},n=function(){var h="0123456789";function b(y,$,D,L){for(var C,O=[0],T,P=0,x=y.length;P<x;){for(T=O.length;T--;O[T]*=$);for(O[0]+=L.indexOf(y.charAt(P++)),C=0;C<O.length;C++)O[C]>D-1&&(O[C+1]==null&&(O[C+1]=0),O[C+1]+=O[C]/D|0,O[C]%=D)}return O.reverse()}return function(y,$,D,L,C){var O,T,P,x,I,_,V,W,Y=y.indexOf("."),q=l,G=u;for(Y>=0&&(x=g,g=0,y=y.replace(".",""),W=new w($),_=W.pow(y.length-Y),g=x,W.c=b(st(Re(_.c),_.e,"0"),10,D,h),W.e=W.c.length),V=b(y,$,D,C?(O=E,h):(O=h,E)),P=x=V.length;V[--x]==0;V.pop());if(!V[0])return O.charAt(0);if(Y<0?--P:(_.c=V,_.e=P,_.s=L,_=t(_,W,q,G,D),V=_.c,I=_.r,P=_.e),T=P+q+1,Y=V[T],x=D/2,I=I||T<0||V[T+1]!=null,I=G<4?(Y!=null||I)&&(G==0||G==(_.s<0?3:2)):Y>x||Y==x&&(G==4||I||G==6&&V[T-1]&1||G==(_.s<0?8:7)),T<1||!V[0])y=I?st(O.charAt(1),-q,O.charAt(0)):O.charAt(0);else{if(V.length=T,I)for(--D;++V[--T]>D;)V[T]=0,T||(++P,V=[1].concat(V));for(x=V.length;!V[--x];);for(Y=0,y="";Y<=x;y+=O.charAt(V[Y++]));y=st(y,P,O.charAt(0))}return y}}(),t=function(){function h($,D,L){var C,O,T,P,x=0,I=$.length,_=D%ht,V=D/ht|0;for($=$.slice();I--;)T=$[I]%ht,P=$[I]/ht|0,C=V*T+P*_,O=_*T+C%ht*ht+x,x=(O/L|0)+(C/ht|0)+V*P,$[I]=O%L;return x&&($=[x].concat($)),$}function b($,D,L,C){var O,T;if(L!=C)T=L>C?1:-1;else for(O=T=0;O<L;O++)if($[O]!=D[O]){T=$[O]>D[O]?1:-1;break}return T}function y($,D,L,C){for(var O=0;L--;)$[L]-=O,O=$[L]<D[L]?1:0,$[L]=O*C+$[L]-D[L];for(;!$[0]&&$.length>1;$.splice(0,1));}return function($,D,L,C,O){var T,P,x,I,_,V,W,Y,q,G,H,z,J,se,he,$e,it,Ee=$.s==D.s?1:-1,ge=$.c,le=D.c;if(!ge||!ge[0]||!le||!le[0])return new w(!$.s||!D.s||(ge?le&&ge[0]==le[0]:!le)?NaN:ge&&ge[0]==0||!le?Ee*0:Ee/0);for(Y=new w(Ee),q=Y.c=[],P=$.e-D.e,Ee=L+P+1,O||(O=Ge,P=Fe($.e/Q)-Fe(D.e/Q),Ee=Ee/Q|0),x=0;le[x]==(ge[x]||0);x++);if(le[x]>(ge[x]||0)&&P--,Ee<0)q.push(1),I=!0;else{for(se=ge.length,$e=le.length,x=0,Ee+=2,_=je(O/(le[0]+1)),_>1&&(le=h(le,_,O),ge=h(ge,_,O),$e=le.length,se=ge.length),J=$e,G=ge.slice(0,$e),H=G.length;H<$e;G[H++]=0);it=le.slice(),it=[0].concat(it),he=le[0],le[1]>=O/2&&he++;do{if(_=0,T=b(le,G,$e,H),T<0){if(z=G[0],$e!=H&&(z=z*O+(G[1]||0)),_=je(z/he),_>1)for(_>=O&&(_=O-1),V=h(le,_,O),W=V.length,H=G.length;b(V,G,W,H)==1;)_--,y(V,$e<W?it:le,W,O),W=V.length,T=1;else _==0&&(T=_=1),V=le.slice(),W=V.length;if(W<H&&(V=[0].concat(V)),y(G,V,H,O),H=G.length,T==-1)for(;b(le,G,$e,H)<1;)_++,y(G,$e<H?it:le,H,O),H=G.length}else T===0&&(_++,G=[0]);q[x++]=_,G[0]?G[H++]=ge[J]||0:(G=[ge[J]],H=1)}while((J++<se||G[0]!=null)&&Ee--);I=G[0]!=null,q[0]||q.splice(0,1)}if(O==Ge){for(x=1,Ee=q[0];Ee>=10;Ee/=10,x++);k(Y,L+(Y.e=x+P*Q-1)+1,C,I)}else Y.e=P,Y.r=+I;return Y}}();function N(h,b,y,$){var D,L,C,O,T;if(y==null?y=u:ce(y,0,8),!h.c)return h.toString();if(D=h.c[0],C=h.e,b==null)T=Re(h.c),T=$==1||$==2&&(C<=s||C>=a)?fn(T,C):st(T,C,"0");else if(h=k(new w(h),b,y),L=h.e,T=Re(h.c),O=T.length,$==1||$==2&&(b<=L||L<=s)){for(;O<b;T+="0",O++);T=fn(T,L)}else if(b-=C+($===2&&L>C),T=st(T,L,"0"),L+1>O){if(--b>0)for(T+=".";b--;T+="0");}else if(b+=L-O,b>0)for(L+1==O&&(T+=".");b--;T+="0");return h.s<0&&D?"-"+T:T}function F(h,b){for(var y,$,D=1,L=new w(h[0]);D<h.length;D++)$=new w(h[D]),(!$.s||(y=Et(L,$))===b||y===0&&L.s===b)&&(L=$);return L}function j(h,b,y){for(var $=1,D=b.length;!b[--D];b.pop());for(D=b[0];D>=10;D/=10,$++);return(y=$+y*Q-1)>d?h.c=h.e=null:y<c?h.c=[h.e=0]:(h.e=y,h.c=b),h}r=function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,b=/^([^.]+)\.$/,y=/^\.([^.]+)$/,$=/^-?(Infinity|NaN)$/,D=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(L,C,O,T){var P,x=O?C:C.replace(D,"");if($.test(x))L.s=isNaN(x)?null:x<0?-1:1;else{if(!O&&(x=x.replace(h,function(I,_,V){return P=(V=V.toLowerCase())=="x"?16:V=="b"?2:8,!T||T==P?_:I}),T&&(P=T,x=x.replace(b,"$1").replace(y,"0.$1")),C!=x))return new w(x,P);if(w.DEBUG)throw Error(Te+"Not a"+(T?" base "+T:"")+" number: "+C);L.s=null}L.c=L.e=null}}();function k(h,b,y,$){var D,L,C,O,T,P,x,I=h.c,_=nr;if(I){e:{for(D=1,O=I[0];O>=10;O/=10,D++);if(L=b-D,L<0)L+=Q,C=b,T=I[P=0],x=je(T/_[D-C-1]%10);else if(P=er((L+1)/Q),P>=I.length)if($){for(;I.length<=P;I.push(0));T=x=0,D=1,L%=Q,C=L-Q+1}else break e;else{for(T=O=I[P],D=1;O>=10;O/=10,D++);L%=Q,C=L-Q+D,x=C<0?0:je(T/_[D-C-1]%10)}if($=$||b<0||I[P+1]!=null||(C<0?T:T%_[D-C-1]),$=y<4?(x||$)&&(y==0||y==(h.s<0?3:2)):x>5||x==5&&(y==4||$||y==6&&(L>0?C>0?T/_[D-C]:0:I[P-1])%10&1||y==(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(L==0?(I.length=P,O=1,P--):(I.length=P+1,O=_[Q-L],I[P]=C>0?je(T/_[D-C]%_[C])*O:0),$)for(;;)if(P==0){for(L=1,C=I[0];C>=10;C/=10,L++);for(C=I[0]+=O,O=1;C>=10;C/=10,O++);L!=O&&(h.e++,I[0]==Ge&&(I[0]=1));break}else{if(I[P]+=O,I[P]!=Ge)break;I[P--]=0,O=1}for(L=I.length;I[--L]===0;I.pop());}h.e>d?h.c=h.e=null:h.e<c&&(h.c=[h.e=0])}return h}function B(h){var b,y=h.e;return y===null?h.toString():(b=Re(h.c),b=y<=s||y>=a?fn(b,y):st(b,y,"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 y,$,D,L=this;if(h!=null)return ce(h,0,ve),b==null?b=u:ce(b,0,8),k(new w(L),h+L.e+1,b);if(!(y=L.c))return null;if($=((D=y.length-1)-Fe(this.e/Q))*Q,D=y[D])for(;D%10==0;D/=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 y,$,D,L,C,O,T,P,x,I=this;if(h=new w(h),h.c&&!h.isInteger())throw Error(Te+"Exponent not an integer: "+B(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 x=new w(Math.pow(+B(I),O?h.s*(2-cn(h)):+B(h))),b?x.mod(b):x;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 L=I.s<0&&cn(h)?-0:0,I.e>-1&&(L=1/L),new w(T?1/L:L);g&&(L=er(g/Q+2))}for(O?(y=new w(.5),T&&(h.s=1),P=cn(h)):(D=Math.abs(+B(h)),P=D%2),x=new w(i);;){if(P){if(x=x.times(I),!x.c)break;L?x.c.length>L&&(x.c.length=L):$&&(x=x.mod(b))}if(D){if(D=je(D/2),D===0)break;P=D%2}else if(h=h.times(y),k(h,h.e+1,1),h.e>14)P=cn(h);else{if(D=+B(h),D===0)break;P=D%2}I=I.times(I),L?I.c&&I.c.length>L&&(I.c.length=L):$&&(I=I.mod(b))}return $?x:(T&&(x=i.div(x)),b?x.mod(b):L?k(x,g,u,C):x)},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 y,$,D,L,C=this,O=C.s;if(h=new w(h,b),b=h.s,!O||!b)return new w(NaN);if(O!=b)return h.s=-b,C.plus(h);var T=C.e/Q,P=h.e/Q,x=C.c,I=h.c;if(!T||!P){if(!x||!I)return x?(h.s=-b,h):new w(I?C:NaN);if(!x[0]||!I[0])return I[0]?(h.s=-b,h):new w(x[0]?C:u==3?-0:0)}if(T=Fe(T),P=Fe(P),x=x.slice(),O=T-P){for((L=O<0)?(O=-O,D=x):(P=T,D=I),D.reverse(),b=O;b--;D.push(0));D.reverse()}else for($=(L=(O=x.length)<(b=I.length))?O:b,O=b=0;b<$;b++)if(x[b]!=I[b]){L=x[b]<I[b];break}if(L&&(D=x,x=I,I=D,h.s=-h.s),b=($=I.length)-(y=x.length),b>0)for(;b--;x[y++]=0);for(b=Ge-1;$>O;){if(x[--$]<I[$]){for(y=$;y&&!x[--y];x[y]=b);--x[y],x[$]+=Ge}x[$]-=I[$]}for(;x[0]==0;x.splice(0,1),--P);return x[0]?j(h,x,P):(h.s=u==3?-1:1,h.c=[h.e=0],h)},o.modulo=o.mod=function(h,b){var y,$,D=this;return h=new w(h,b),!D.c||!h.s||h.c&&!h.c[0]?new w(NaN):!h.c||D.c&&!D.c[0]?new w(D):(f==9?($=h.s,h.s=1,y=t(D,h,0,3),h.s=$,y.s*=$):y=t(D,h,0,f),h=D.minus(y.times(h)),!h.c[0]&&f==1&&(h.s=D.s),h)},o.multipliedBy=o.times=function(h,b){var y,$,D,L,C,O,T,P,x,I,_,V,W,Y,q,G=this,H=G.c,z=(h=new w(h,b)).c;if(!H||!z||!H[0]||!z[0])return!G.s||!h.s||H&&!H[0]&&!z||z&&!z[0]&&!H?h.c=h.e=h.s=null:(h.s*=G.s,!H||!z?h.c=h.e=null:(h.c=[0],h.e=0)),h;for($=Fe(G.e/Q)+Fe(h.e/Q),h.s*=G.s,T=H.length,I=z.length,T<I&&(W=H,H=z,z=W,D=T,T=I,I=D),D=T+I,W=[];D--;W.push(0));for(Y=Ge,q=ht,D=I;--D>=0;){for(y=0,_=z[D]%q,V=z[D]/q|0,C=T,L=D+C;L>D;)P=H[--C]%q,x=H[C]/q|0,O=V*P+x*_,P=_*P+O%q*q+W[L]+y,y=(P/Y|0)+(O/q|0)+V*x,W[L--]=P%Y;W[L]=y}return y?++$:W.splice(0,1),j(h,W,$)},o.negated=function(){var h=new w(this);return h.s=-h.s||null,h},o.plus=function(h,b){var y,$=this,D=$.s;if(h=new w(h,b),b=h.s,!D||!b)return new w(NaN);if(D!=b)return h.s=-b,$.minus(h);var L=$.e/Q,C=h.e/Q,O=$.c,T=h.c;if(!L||!C){if(!O||!T)return new w(D/0);if(!O[0]||!T[0])return T[0]?h:new w(O[0]?$:D*0)}if(L=Fe(L),C=Fe(C),O=O.slice(),D=L-C){for(D>0?(C=L,y=T):(D=-D,y=O),y.reverse();D--;y.push(0));y.reverse()}for(D=O.length,b=T.length,D-b<0&&(y=T,T=O,O=y,b=D),D=0;b;)D=(O[--b]=O[b]+T[b]+D)/Ge|0,O[b]=Ge===O[b]?0:O[b]%Ge;return D&&(O=[D].concat(O),++C),j(h,O,C)},o.precision=o.sd=function(h,b){var y,$,D,L=this;if(h!=null&&h!==!!h)return ce(h,1,ve),b==null?b=u:ce(b,0,8),k(new w(L),h,b);if(!(y=L.c))return null;if(D=y.length-1,$=D*Q+1,D=y[D]){for(;D%10==0;D/=10,$--);for(D=y[0];D>=10;D/=10,$++);}return h&&L.e+1>$&&($=L.e+1),$},o.shiftedBy=function(h){return ce(h,-tr,tr),this.times("1e"+h)},o.squareRoot=o.sqrt=function(){var h,b,y,$,D,L=this,C=L.c,O=L.s,T=L.e,P=l+4,x=new w("0.5");if(O!==1||!C||!C[0])return new w(!O||O<0&&(!C||C[0])?NaN:C?L:1/0);if(O=Math.sqrt(+B(L)),O==0||O==1/0?(b=Re(C),(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),y=new w(b)):y=new w(O+""),y.c[0]){for(T=y.e,O=T+P,O<3&&(O=0);;)if(D=y,y=x.times(D.plus(t(L,D,P,1))),Re(D.c).slice(0,O)===(b=Re(y.c)).slice(0,O))if(y.e<T&&--O,b=b.slice(O-3,O+1),b=="9999"||!$&&b=="4999"){if(!$&&(k(D,D.e+l+2,0),D.times(D).eq(L))){y=D;break}P+=4,O+=4,$=1}else{(!+b||!+b.slice(1)&&b.charAt(0)=="5")&&(k(y,y.e+l+2,1),h=!y.times(y).eq(L));break}}return k(y,y.e+l+1,u,h)},o.toExponential=function(h,b){return h!=null&&(ce(h,0,ve),h++),N(this,h,b,1)},o.toFixed=function(h,b){return h!=null&&(ce(h,0,ve),h=h+this.e+1),N(this,h,b)},o.toFormat=function(h,b,y){var $,D=this;if(y==null)h!=null&&b&&typeof b=="object"?(y=b,b=null):h&&typeof h=="object"?(y=h,h=b=null):y=v;else if(typeof y!="object")throw Error(Te+"Argument not an object: "+y);if($=D.toFixed(h,b),D.c){var L,C=$.split("."),O=+y.groupSize,T=+y.secondaryGroupSize,P=y.groupSeparator||"",x=C[0],I=C[1],_=D.s<0,V=_?x.slice(1):x,W=V.length;if(T&&(L=O,O=T,T=L,W-=L),O>0&&W>0){for(L=W%O||O,x=V.substr(0,L);L<W;L+=O)x+=P+V.substr(L,O);T>0&&(x+=P+V.slice(L)),_&&(x="-"+x)}$=I?x+(y.decimalSeparator||"")+((T=+y.fractionGroupSize)?I.replace(new RegExp("\\d{"+T+"}\\B","g"),"$&"+(y.fractionGroupSeparator||"")):I):x}return(y.prefix||"")+$+(y.suffix||"")},o.toFraction=function(h){var b,y,$,D,L,C,O,T,P,x,I,_,V=this,W=V.c;if(h!=null&&(O=new w(h),!O.isInteger()&&(O.c||O.s!==1)||O.lt(i)))throw Error(Te+"Argument "+(O.isInteger()?"out of range: ":"not an integer: ")+B(O));if(!W)return new w(V);for(b=new w(i),P=y=new w(i),$=T=new w(i),_=Re(W),L=b.e=_.length-V.e-1,b.c[0]=nr[(C=L%Q)<0?Q+C:C],h=!h||O.comparedTo(b)>0?L>0?b:P:O,C=d,d=1/0,O=new w(_),T.c[0]=0;x=t(O,b,0,1),D=y.plus(x.times($)),D.comparedTo(h)!=1;)y=$,$=D,P=T.plus(x.times(D=P)),T=D,b=O.minus(x.times(D=b)),O=D;return D=t(h.minus(y),$,0,1),T=T.plus(D.times(P)),y=y.plus(D.times($)),T.s=P.s=V.s,L=L*2,I=t(P,$,L,u).minus(V).abs().comparedTo(t(T,y,L,u).minus(V).abs())<1?[P,$]:[T,y],d=C,I},o.toNumber=function(){return+B(this)},o.toPrecision=function(h,b){return h!=null&&ce(h,1,ve),N(this,h,b,2)},o.toString=function(h){var b,y=this,$=y.s,D=y.e;return D===null?$?(b="Infinity",$<0&&(b="-"+b)):b="NaN":(h==null?b=D<=s||D>=a?fn(Re(y.c),D):st(Re(y.c),D,"0"):h===10&&M?(y=k(new w(y),l+D+1,u),b=st(Re(y.c),y.e,"0")):(ce(h,2,E.length,"Base"),b=n(st(Re(y.c),D,"0"),10,h,$,!0)),$<0&&y.c[0]&&(b="-"+b)),b},o.valueOf=o.toJSON=function(){return B(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(Te+(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 xe=ko();const ya=(e,t=6)=>{try{const n=new xe(e||"0");if(n.isNaN())return"0";const r=n.decimalPlaces(t,xe.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=>{},[])}),wa=()=>({openWithdraw:m.useCallback(t=>{},[])});/**
|
|
31
36
|
* @license lucide-react v0.540.0 - ISC
|
|
32
37
|
*
|
|
33
38
|
* This source code is licensed under the ISC license.
|
|
34
39
|
* See the LICENSE file in the root directory of this source tree.
|
|
35
|
-
*/const
|
|
40
|
+
*/const Ea=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Sa=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),_o=e=>{const t=Sa(e);return t.charAt(0).toUpperCase()+t.slice(1)},Bo=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Ca=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
36
41
|
* @license lucide-react v0.540.0 - ISC
|
|
37
42
|
*
|
|
38
43
|
* This source code is licensed under the ISC license.
|
|
39
44
|
* See the LICENSE file in the root directory of this source tree.
|
|
40
|
-
*/var
|
|
45
|
+
*/var Oa={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"};/**
|
|
41
46
|
* @license lucide-react v0.540.0 - ISC
|
|
42
47
|
*
|
|
43
48
|
* This source code is licensed under the ISC license.
|
|
44
49
|
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/const
|
|
50
|
+
*/const Ta=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,...Oa,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Bo("lucide",o),...!i&&!Ca(u)&&{"aria-hidden":"true"},...u},[...l.map(([a,c])=>m.createElement(a,c)),...Array.isArray(i)?i:[i]]));/**
|
|
46
51
|
* @license lucide-react v0.540.0 - ISC
|
|
47
52
|
*
|
|
48
53
|
* This source code is licensed under the ISC license.
|
|
49
54
|
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
-
*/const
|
|
55
|
+
*/const Na=(e,t)=>{const n=m.forwardRef(({className:r,...o},i)=>m.createElement(Ta,{ref:i,iconNode:t,className:Bo(`lucide-${Ea(_o(e))}`,`lucide-${e}`,r),...o}));return n.displayName=_o(e),n};/**
|
|
51
56
|
* @license lucide-react v0.540.0 - ISC
|
|
52
57
|
*
|
|
53
58
|
* This source code is licensed under the ISC license.
|
|
54
59
|
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
-
*/const Is=Ns("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);class Mr{constructor(){Ye(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 js extends Mr{constructor(n,r){super();Ye(this,"smartWallet");Ye(this,"currentActiveAccount");this.smartWallet=n,this.currentActiveAccount=r}getWalletType(){return"mpc"}getDisplayAddress(){var n,r;return((n=this.smartWallet)==null?void 0:n.address)||((r=this.currentActiveAccount)==null?void 0:r.ethAddress)||""}isApprovalRequired(){return!1}getApprovalStatus(){return!0}async connect(){this.setState({isLoading:!0,error:null});try{console.log("Connecting MPC wallet..."),this.setState({isLoading:!1})}catch(n){throw this.setState({isLoading:!1,error:n instanceof Error?n.message:"Connection failed"}),n}}async disconnect(){console.log("Disconnecting MPC wallet...")}async switchChain(n){console.log(`MPC wallet switching to chain ${n}`)}async getBalance(n){return console.log(`Getting MPC wallet balance for token ${n}`),"0"}async approve(n,r){return console.log(`MPC wallet approve not needed for ${n}`),""}async deposit(n,r){this.setState({isDepositing:!0,error:null});try{console.log(`MPC deposit ${n} of ${r} to ${this.getDisplayAddress()}`);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 console.log(`MPC signing message: ${n}`),`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 ks extends Mr{constructor(n,r,o,s="0",c="0"){super();Ye(this,"currentActiveAccount");Ye(this,"approved");Ye(this,"chainId");Ye(this,"balance");Ye(this,"allowance");this.currentActiveAccount=n,this.approved=r,this.chainId=o,this.balance=s,this.allowance=c}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{console.log("Connecting EVM wallet..."),this.setState({isLoading:!1})}catch(n){throw this.setState({isLoading:!1,error:n instanceof Error?n.message:"Connection failed"}),n}}async disconnect(){console.log("Disconnecting EVM wallet...")}async switchChain(n){this.setState({isLoading:!0,error:null});try{console.log(`Switching EVM wallet to chain ${n}`),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 console.log(`Getting EVM wallet balance for token ${n}`),this.balance}async approve(n,r){this.setState({isApproving:!0,error:null});try{console.log(`Approving ${r} of ${n}`);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");console.log(`EVM deposit ${n} of ${r}`);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 console.log(`EVM signing message: ${n}`),`evm_signature_${Date.now()}`}updateApprovalStatus(n){this.approved=n}updateBalance(n){this.balance=n}updateAllowance(n){this.allowance=n}}function Rs(e,t,n,r,o,s){switch(e==null?void 0:e.wallet){case"mpc":return new js(t,e);default:return new ks(e,n||!1,r||1,o,s)}}var Ws=Object.defineProperty,It=Object.getOwnPropertySymbols,Ar=Object.prototype.hasOwnProperty,Dr=Object.prototype.propertyIsEnumerable,_r=(e,t,n)=>t in e?Ws(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hn=(e,t)=>{for(var n in t||(t={}))Ar.call(t,n)&&_r(e,n,t[n]);if(It)for(var n of It(t))Dr.call(t,n)&&_r(e,n,t[n]);return e},gn=(e,t)=>{var n={};for(var r in e)Ar.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&It)for(var r of It(e))t.indexOf(r)<0&&Dr.call(e,r)&&(n[r]=e[r]);return n};/**
|
|
56
|
-
|
|
57
|
-
* Copyright (c) Project Nayuki.
|
|
58
|
-
* SPDX-License-Identifier: MIT
|
|
59
|
-
*/var Ze;(e=>{const t=class ee{constructor(i,l,a,d){if(this.version=i,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],i<ee.MIN_VERSION||i>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=i*4+17;let m=[];for(let h=0;h<this.size;h++)m.push(!1);for(let h=0;h<this.size;h++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();const f=this.addEccAndInterleave(a);if(this.drawCodewords(f),d==-1){let h=1e9;for(let v=0;v<8;v++){this.applyMask(v),this.drawFormatBits(v);const b=this.getPenaltyScore();b<h&&(d=v,h=b),this.applyMask(v)}}o(0<=d&&d<=7),this.mask=d,this.applyMask(d),this.drawFormatBits(d),this.isFunction=[]}static encodeText(i,l){const a=e.QrSegment.makeSegments(i);return ee.encodeSegments(a,l)}static encodeBinary(i,l){const a=e.QrSegment.makeBytes(i);return ee.encodeSegments([a],l)}static encodeSegments(i,l,a=1,d=40,m=-1,f=!0){if(!(ee.MIN_VERSION<=a&&a<=d&&d<=ee.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let h,v;for(h=a;;h++){const y=ee.getNumDataCodewords(h,l)*8,O=c.getTotalBits(i,h);if(O<=y){v=O;break}if(h>=d)throw new RangeError("Data too long")}for(const y of[ee.Ecc.MEDIUM,ee.Ecc.QUARTILE,ee.Ecc.HIGH])f&&v<=ee.getNumDataCodewords(h,y)*8&&(l=y);let b=[];for(const y of i){n(y.mode.modeBits,4,b),n(y.numChars,y.mode.numCharCountBits(h),b);for(const O of y.getData())b.push(O)}o(b.length==v);const C=ee.getNumDataCodewords(h,l)*8;o(b.length<=C),n(0,Math.min(4,C-b.length),b),n(0,(8-b.length%8)%8,b),o(b.length%8==0);for(let y=236;b.length<C;y^=253)n(y,8,b);let E=[];for(;E.length*8<b.length;)E.push(0);return b.forEach((y,O)=>E[O>>>3]|=y<<7-(O&7)),new ee(h,l,E,m)}getModule(i,l){return 0<=i&&i<this.size&&0<=l&&l<this.size&&this.modules[l][i]}getModules(){return this.modules}drawFunctionPatterns(){for(let a=0;a<this.size;a++)this.setFunctionModule(6,a,a%2==0),this.setFunctionModule(a,6,a%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const i=this.getAlignmentPatternPositions(),l=i.length;for(let a=0;a<l;a++)for(let d=0;d<l;d++)a==0&&d==0||a==0&&d==l-1||a==l-1&&d==0||this.drawAlignmentPattern(i[a],i[d]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(i){const l=this.errorCorrectionLevel.formatBits<<3|i;let a=l;for(let m=0;m<10;m++)a=a<<1^(a>>>9)*1335;const d=(l<<10|a)^21522;o(d>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,r(d,m));this.setFunctionModule(8,7,r(d,6)),this.setFunctionModule(8,8,r(d,7)),this.setFunctionModule(7,8,r(d,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,r(d,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,r(d,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,r(d,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let i=this.version;for(let a=0;a<12;a++)i=i<<1^(i>>>11)*7973;const l=this.version<<12|i;o(l>>>18==0);for(let a=0;a<18;a++){const d=r(l,a),m=this.size-11+a%3,f=Math.floor(a/3);this.setFunctionModule(m,f,d),this.setFunctionModule(f,m,d)}}drawFinderPattern(i,l){for(let a=-4;a<=4;a++)for(let d=-4;d<=4;d++){const m=Math.max(Math.abs(d),Math.abs(a)),f=i+d,h=l+a;0<=f&&f<this.size&&0<=h&&h<this.size&&this.setFunctionModule(f,h,m!=2&&m!=4)}}drawAlignmentPattern(i,l){for(let a=-2;a<=2;a++)for(let d=-2;d<=2;d++)this.setFunctionModule(i+d,l+a,Math.max(Math.abs(d),Math.abs(a))!=1)}setFunctionModule(i,l,a){this.modules[l][i]=a,this.isFunction[l][i]=!0}addEccAndInterleave(i){const l=this.version,a=this.errorCorrectionLevel;if(i.length!=ee.getNumDataCodewords(l,a))throw new RangeError("Invalid argument");const d=ee.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][l],m=ee.ECC_CODEWORDS_PER_BLOCK[a.ordinal][l],f=Math.floor(ee.getNumRawDataModules(l)/8),h=d-f%d,v=Math.floor(f/d);let b=[];const C=ee.reedSolomonComputeDivisor(m);for(let y=0,O=0;y<d;y++){let w=i.slice(O,O+v-m+(y<h?0:1));O+=w.length;const F=ee.reedSolomonComputeRemainder(w,C);y<h&&w.push(0),b.push(w.concat(F))}let E=[];for(let y=0;y<b[0].length;y++)b.forEach((O,w)=>{(y!=v-m||w>=h)&&E.push(O[y])});return o(E.length==f),E}drawCodewords(i){if(i.length!=Math.floor(ee.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let a=this.size-1;a>=1;a-=2){a==6&&(a=5);for(let d=0;d<this.size;d++)for(let m=0;m<2;m++){const f=a-m,v=(a+1&2)==0?this.size-1-d:d;!this.isFunction[v][f]&&l<i.length*8&&(this.modules[v][f]=r(i[l>>>3],7-(l&7)),l++)}}o(l==i.length*8)}applyMask(i){if(i<0||i>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let a=0;a<this.size;a++){let d;switch(i){case 0:d=(a+l)%2==0;break;case 1:d=l%2==0;break;case 2:d=a%3==0;break;case 3:d=(a+l)%3==0;break;case 4:d=(Math.floor(a/3)+Math.floor(l/2))%2==0;break;case 5:d=a*l%2+a*l%3==0;break;case 6:d=(a*l%2+a*l%3)%2==0;break;case 7:d=((a+l)%2+a*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][a]&&d&&(this.modules[l][a]=!this.modules[l][a])}}getPenaltyScore(){let i=0;for(let m=0;m<this.size;m++){let f=!1,h=0,v=[0,0,0,0,0,0,0];for(let b=0;b<this.size;b++)this.modules[m][b]==f?(h++,h==5?i+=ee.PENALTY_N1:h>5&&i++):(this.finderPenaltyAddHistory(h,v),f||(i+=this.finderPenaltyCountPatterns(v)*ee.PENALTY_N3),f=this.modules[m][b],h=1);i+=this.finderPenaltyTerminateAndCount(f,h,v)*ee.PENALTY_N3}for(let m=0;m<this.size;m++){let f=!1,h=0,v=[0,0,0,0,0,0,0];for(let b=0;b<this.size;b++)this.modules[b][m]==f?(h++,h==5?i+=ee.PENALTY_N1:h>5&&i++):(this.finderPenaltyAddHistory(h,v),f||(i+=this.finderPenaltyCountPatterns(v)*ee.PENALTY_N3),f=this.modules[b][m],h=1);i+=this.finderPenaltyTerminateAndCount(f,h,v)*ee.PENALTY_N3}for(let m=0;m<this.size-1;m++)for(let f=0;f<this.size-1;f++){const h=this.modules[m][f];h==this.modules[m][f+1]&&h==this.modules[m+1][f]&&h==this.modules[m+1][f+1]&&(i+=ee.PENALTY_N2)}let l=0;for(const m of this.modules)l=m.reduce((f,h)=>f+(h?1:0),l);const a=this.size*this.size,d=Math.ceil(Math.abs(l*20-a*10)/a)-1;return o(0<=d&&d<=9),i+=d*ee.PENALTY_N4,o(0<=i&&i<=2568888),i}getAlignmentPatternPositions(){if(this.version==1)return[];{const i=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(i*2-2))*2;let a=[6];for(let d=this.size-7;a.length<i;d-=l)a.splice(1,0,d);return a}}static getNumRawDataModules(i){if(i<ee.MIN_VERSION||i>ee.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*i+128)*i+64;if(i>=2){const a=Math.floor(i/7)+2;l-=(25*a-10)*a-55,i>=7&&(l-=36)}return o(208<=l&&l<=29648),l}static getNumDataCodewords(i,l){return Math.floor(ee.getNumRawDataModules(i)/8)-ee.ECC_CODEWORDS_PER_BLOCK[l.ordinal][i]*ee.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][i]}static reedSolomonComputeDivisor(i){if(i<1||i>255)throw new RangeError("Degree out of range");let l=[];for(let d=0;d<i-1;d++)l.push(0);l.push(1);let a=1;for(let d=0;d<i;d++){for(let m=0;m<l.length;m++)l[m]=ee.reedSolomonMultiply(l[m],a),m+1<l.length&&(l[m]^=l[m+1]);a=ee.reedSolomonMultiply(a,2)}return l}static reedSolomonComputeRemainder(i,l){let a=l.map(d=>0);for(const d of i){const m=d^a.shift();a.push(0),l.forEach((f,h)=>a[h]^=ee.reedSolomonMultiply(f,m))}return a}static reedSolomonMultiply(i,l){if(i>>>8||l>>>8)throw new RangeError("Byte out of range");let a=0;for(let d=7;d>=0;d--)a=a<<1^(a>>>7)*285,a^=(l>>>d&1)*i;return o(a>>>8==0),a}finderPenaltyCountPatterns(i){const l=i[1];o(l<=this.size*3);const a=l>0&&i[2]==l&&i[3]==l*3&&i[4]==l&&i[5]==l;return(a&&i[0]>=l*4&&i[6]>=l?1:0)+(a&&i[6]>=l*4&&i[0]>=l?1:0)}finderPenaltyTerminateAndCount(i,l,a){return i&&(this.finderPenaltyAddHistory(l,a),l=0),l+=this.size,this.finderPenaltyAddHistory(l,a),this.finderPenaltyCountPatterns(a)}finderPenaltyAddHistory(i,l){l[0]==0&&(i+=this.size),l.pop(),l.unshift(i)}};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,i,l){if(i<0||i>31||u>>>i)throw new RangeError("Value out of range");for(let a=i-1;a>=0;a--)l.push(u>>>a&1)}function r(u,i){return(u>>>i&1)!=0}function o(u){if(!u)throw new Error("Assertion error")}const s=class de{constructor(i,l,a){if(this.mode=i,this.numChars=l,this.bitData=a,l<0)throw new RangeError("Invalid argument");this.bitData=a.slice()}static makeBytes(i){let l=[];for(const a of i)n(a,8,l);return new de(de.Mode.BYTE,i.length,l)}static makeNumeric(i){if(!de.isNumeric(i))throw new RangeError("String contains non-numeric characters");let l=[];for(let a=0;a<i.length;){const d=Math.min(i.length-a,3);n(parseInt(i.substring(a,a+d),10),d*3+1,l),a+=d}return new de(de.Mode.NUMERIC,i.length,l)}static makeAlphanumeric(i){if(!de.isAlphanumeric(i))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],a;for(a=0;a+2<=i.length;a+=2){let d=de.ALPHANUMERIC_CHARSET.indexOf(i.charAt(a))*45;d+=de.ALPHANUMERIC_CHARSET.indexOf(i.charAt(a+1)),n(d,11,l)}return a<i.length&&n(de.ALPHANUMERIC_CHARSET.indexOf(i.charAt(a)),6,l),new de(de.Mode.ALPHANUMERIC,i.length,l)}static makeSegments(i){return i==""?[]:de.isNumeric(i)?[de.makeNumeric(i)]:de.isAlphanumeric(i)?[de.makeAlphanumeric(i)]:[de.makeBytes(de.toUtf8ByteArray(i))]}static makeEci(i){let l=[];if(i<0)throw new RangeError("ECI assignment value out of range");if(i<128)n(i,8,l);else if(i<16384)n(2,2,l),n(i,14,l);else if(i<1e6)n(6,3,l),n(i,21,l);else throw new RangeError("ECI assignment value out of range");return new de(de.Mode.ECI,0,l)}static isNumeric(i){return de.NUMERIC_REGEX.test(i)}static isAlphanumeric(i){return de.ALPHANUMERIC_REGEX.test(i)}getData(){return this.bitData.slice()}static getTotalBits(i,l){let a=0;for(const d of i){const m=d.mode.numCharCountBits(l);if(d.numChars>=1<<m)return 1/0;a+=4+m+d.bitData.length}return a}static toUtf8ByteArray(i){i=encodeURI(i);let l=[];for(let a=0;a<i.length;a++)i.charAt(a)!="%"?l.push(i.charCodeAt(a)):(l.push(parseInt(i.substring(a+1,a+3),16)),a+=2);return l}};s.NUMERIC_REGEX=/^[0-9]*$/,s.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,s.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let c=s;e.QrSegment=s})(Ze||(Ze={})),(e=>{(t=>{const n=class{constructor(o,s){this.ordinal=o,this.formatBits=s}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(Ze||(Ze={})),(e=>{(t=>{const n=class{constructor(o,s){this.modeBits=o,this.numBitsCharCount=s}numCharCountBits(o){return this.numBitsCharCount[Math.floor((o+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(Ze||(Ze={}));var at=Ze;/**
|
|
60
|
-
* @license qrcode.react
|
|
61
|
-
* Copyright (c) Paul O'Shannessy
|
|
62
|
-
* SPDX-License-Identifier: ISC
|
|
63
|
-
*/var Bs={L:at.QrCode.Ecc.LOW,M:at.QrCode.Ecc.MEDIUM,Q:at.QrCode.Ecc.QUARTILE,H:at.QrCode.Ecc.HIGH},Fr=128,Lr="L",Nr="#FFFFFF",Ir="#000000",jr=!1,kr=1,Hs=4,Us=0,Vs=.1;function Rr(e,t=0){const n=[];return e.forEach(function(r,o){let s=null;r.forEach(function(c,u){if(!c&&s!==null){n.push(`M${s+t} ${o+t}h${u-s}v1H${s+t}z`),s=null;return}if(u===r.length-1){if(!c)return;s===null?n.push(`M${u+t},${o+t} h1v1H${u+t}z`):n.push(`M${s+t},${o+t} h${u+1-s}v1H${s+t}z`);return}c&&s===null&&(s=u)})}),n.join("")}function Wr(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((o,s)=>s<t.x||s>=t.x+t.w?o:!1))}function zs(e,t,n,r){if(r==null)return null;const o=e.length+n*2,s=Math.floor(t*Vs),c=o/t,u=(r.width||s)*c,i=(r.height||s)*c,l=r.x==null?e.length/2-u/2:r.x*c,a=r.y==null?e.length/2-i/2:r.y*c,d=r.opacity==null?1:r.opacity;let m=null;if(r.excavate){let h=Math.floor(l),v=Math.floor(a),b=Math.ceil(u+l-h),C=Math.ceil(i+a-v);m={x:h,y:v,w:b,h:C}}const f=r.crossOrigin;return{x:l,y:a,h:i,w:u,excavation:m,opacity:d,crossOrigin:f}}function Ys(e,t){return t!=null?Math.max(Math.floor(t),0):e?Hs:Us}function Br({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:s,size:c,boostLevel:u}){let i=p.useMemo(()=>{const h=(Array.isArray(e)?e:[e]).reduce((v,b)=>(v.push(...at.QrSegment.makeSegments(b)),v),[]);return at.QrCode.encodeSegments(h,Bs[t],n,void 0,void 0,u)},[e,t,n,u]);const{cells:l,margin:a,numCells:d,calculatedImageSettings:m}=p.useMemo(()=>{let f=i.getModules();const h=Ys(r,o),v=f.length+h*2,b=zs(f,c,h,s);return{cells:f,margin:h,numCells:v,calculatedImageSettings:b}},[i,c,s,r,o]);return{qrcode:i,margin:a,cells:l,numCells:d,calculatedImageSettings:m}}var Gs=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),qs=p.forwardRef(function(t,n){const r=t,{value:o,size:s=Fr,level:c=Lr,bgColor:u=Nr,fgColor:i=Ir,includeMargin:l=jr,minVersion:a=kr,boostLevel:d,marginSize:m,imageSettings:f}=r,v=gn(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:b}=v,C=gn(v,["style"]),E=f==null?void 0:f.src,y=p.useRef(null),O=p.useRef(null),w=p.useCallback(R=>{y.current=R,typeof n=="function"?n(R):n&&(n.current=R)},[n]),[F,_]=p.useState(!1),{margin:B,cells:K,numCells:A,calculatedImageSettings:j}=Br({value:o,level:c,minVersion:a,boostLevel:d,includeMargin:l,marginSize:m,imageSettings:f,size:s});p.useEffect(()=>{if(y.current!=null){const R=y.current,X=R.getContext("2d");if(!X)return;let G=K;const Q=O.current,T=j!=null&&Q!==null&&Q.complete&&Q.naturalHeight!==0&&Q.naturalWidth!==0;T&&j.excavation!=null&&(G=Wr(K,j.excavation));const H=window.devicePixelRatio||1;R.height=R.width=s*H;const S=s/A*H;X.scale(S,S),X.fillStyle=u,X.fillRect(0,0,A,A),X.fillStyle=i,Gs?X.fill(new Path2D(Rr(G,B))):K.forEach(function(M,k){M.forEach(function(I,V){I&&X.fillRect(V+B,k+B,1,1)})}),j&&(X.globalAlpha=j.opacity),T&&X.drawImage(Q,j.x+B,j.y+B,j.w,j.h)}}),p.useEffect(()=>{_(!1)},[E]);const re=hn({height:s,width:s},b);let U=null;return E!=null&&(U=p.createElement("img",{src:E,key:E,style:{display:"none"},onLoad:()=>{_(!0)},ref:O,crossOrigin:j==null?void 0:j.crossOrigin})),p.createElement(p.Fragment,null,p.createElement("canvas",hn({style:re,height:s,width:s,ref:w,role:"img"},C)),U)});qs.displayName="QRCodeCanvas";var Hr=p.forwardRef(function(t,n){const r=t,{value:o,size:s=Fr,level:c=Lr,bgColor:u=Nr,fgColor:i=Ir,includeMargin:l=jr,minVersion:a=kr,boostLevel:d,title:m,marginSize:f,imageSettings:h}=r,v=gn(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:b,cells:C,numCells:E,calculatedImageSettings:y}=Br({value:o,level:c,minVersion:a,boostLevel:d,includeMargin:l,marginSize:f,imageSettings:h,size:s});let O=C,w=null;h!=null&&y!=null&&(y.excavation!=null&&(O=Wr(C,y.excavation)),w=p.createElement("image",{href:h.src,height:y.h,width:y.w,x:y.x+b,y:y.y+b,preserveAspectRatio:"none",opacity:y.opacity,crossOrigin:y.crossOrigin}));const F=Rr(O,b);return p.createElement("svg",hn({height:s,width:s,viewBox:`0 0 ${E} ${E}`,ref:n,role:"img"},v),!!m&&p.createElement("title",null,m),p.createElement("path",{fill:u,d:`M0,0 h${E}v${E}H0z`,shapeRendering:"crispEdges"}),p.createElement("path",{fill:i,d:F,shapeRendering:"crispEdges"}),w)});Hr.displayName="QRCodeSVG";const Ks=({value:e,size:t,level:n,bgColor:r,fgColor:o,includeMargin:s=!0})=>x.jsx(Hr,{value:e,size:t,level:n,bgColor:r,fgColor:o,marginSize:s?4:0}),Xs=({text:e,onCopy:t,children:n})=>x.jsx("div",{onClick:()=>{navigator.clipboard.writeText(e).then(t)},style:{cursor:"pointer"},children:n}),Qs=(...e)=>e.filter(Boolean).join(" "),Ur=typeof document<"u"?p.useLayoutEffect:()=>{};var vn;const Js=(vn=p.useInsertionEffect)!==null&&vn!==void 0?vn:Ur;function Zs(e){const t=p.useRef(null);return Js(()=>{t.current=e},[e]),p.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Ge=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},et=e=>e&&"window"in e&&e.window===e?e:Ge(e).defaultView||window;function el(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function tl(e){return el(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let nl=!1;function bn(){return nl}function Vr(e,t){if(!bn())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:tl(n)?n=n.host:n=n.parentNode}return!1}const yn=(e=document)=>{var t;if(!bn())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 zr(e){return bn()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function jt(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 wn(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 Ue(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const En=Ue(function(){return wn(/^Mac/i)}),rl=Ue(function(){return wn(/^iPhone/i)}),ol=Ue(function(){return wn(/^iPad/i)||En()&&navigator.maxTouchPoints>1}),il=Ue(function(){return rl()||ol()});Ue(function(){return En()||il()}),Ue(function(){return jt(/AppleWebKit/i)&&!sl()});const sl=Ue(function(){return jt(/Chrome/i)}),ll=Ue(function(){return jt(/Android/i)});Ue(function(){return jt(/Firefox/i)});function Yr(){let e=p.useRef(new Map),t=p.useCallback((o,s,c,u)=>{let i=u!=null&&u.once?(...l)=>{e.current.delete(c),c(...l)}:c;e.current.set(c,{type:s,eventTarget:o,fn:i,options:u}),o.addEventListener(s,i,u)},[]),n=p.useCallback((o,s,c,u)=>{var i;let l=((i=e.current.get(c))===null||i===void 0?void 0:i.fn)||c;o.removeEventListener(s,l,u),e.current.delete(c)},[]),r=p.useCallback(()=>{e.current.forEach((o,s)=>{n(o.eventTarget,o.type,s,o.options)})},[n]);return p.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function al(e){return e.mozInputSource===0&&e.isTrusted?!0:ll()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Gr(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function ul(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function qr(e){let t=p.useRef({isFocused:!1,observer:null});Ur(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Zs(r=>{e==null||e(r)});return p.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,s=c=>{if(t.current.isFocused=!1,o.disabled){let u=Gr(c);n(u)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var c;(c=t.current.observer)===null||c===void 0||c.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 cl=!1,xt=null,xn=new Set,Ct=new Map,tt=!1,Cn=!1;const fl={Tab:!0,Escape:!0};function Sn(e,t){for(let n of xn)n(e,t)}function dl(e){return!(e.metaKey||!En()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function kt(e){tt=!0,dl(e)&&(xt="keyboard",Sn("keyboard",e))}function Te(e){xt="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(tt=!0,Sn("pointer",e))}function Kr(e){al(e)&&(tt=!0,xt="virtual")}function Xr(e){e.target===window||e.target===document||cl||!e.isTrusted||(!tt&&!Cn&&(xt="virtual",Sn("virtual",e)),tt=!1,Cn=!1)}function Qr(){tt=!1,Cn=!0}function On(e){if(typeof window>"u"||typeof document>"u"||Ct.get(et(e)))return;const t=et(e),n=Ge(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){tt=!0,r.apply(this,arguments)},n.addEventListener("keydown",kt,!0),n.addEventListener("keyup",kt,!0),n.addEventListener("click",Kr,!0),t.addEventListener("focus",Xr,!0),t.addEventListener("blur",Qr,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Te,!0),n.addEventListener("pointermove",Te,!0),n.addEventListener("pointerup",Te,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",Te,!0),n.addEventListener("mousemove",Te,!0),n.addEventListener("mouseup",Te,!0)),t.addEventListener("beforeunload",()=>{Jr(e)},{once:!0}),Ct.set(t,{focus:r})}const Jr=(e,t)=>{const n=et(e),r=Ge(e);t&&r.removeEventListener("DOMContentLoaded",t),Ct.has(n)&&(n.HTMLElement.prototype.focus=Ct.get(n).focus,r.removeEventListener("keydown",kt,!0),r.removeEventListener("keyup",kt,!0),r.removeEventListener("click",Kr,!0),n.removeEventListener("focus",Xr,!0),n.removeEventListener("blur",Qr,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Te,!0),r.removeEventListener("pointermove",Te,!0),r.removeEventListener("pointerup",Te,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",Te,!0),r.removeEventListener("mousemove",Te,!0),r.removeEventListener("mouseup",Te,!0)),Ct.delete(n))};function pl(e){const t=Ge(e);let n;return t.readyState!=="loading"?On(e):(n=()=>{On(e)},t.addEventListener("DOMContentLoaded",n)),()=>Jr(e,n)}typeof document<"u"&&pl();function Zr(){return xt!=="pointer"}const ml=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function hl(e,t,n){let r=Ge(n==null?void 0:n.target);const o=typeof window<"u"?et(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?et(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,c=typeof window<"u"?et(n==null?void 0:n.target).HTMLElement:HTMLElement,u=typeof window<"u"?et(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!ml.has(r.activeElement.type)||r.activeElement instanceof s||r.activeElement instanceof c&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof u&&!fl[n.key])}function gl(e,t,n){On(),p.useEffect(()=>{let r=(o,s)=>{hl(!!(n!=null&&n.isTextInput),o,s)&&e(Zr())};return xn.add(r),()=>{xn.delete(r)}},t)}function vl(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const s=p.useCallback(i=>{if(i.target===i.currentTarget)return r&&r(i),o&&o(!1),!0},[r,o]),c=qr(s),u=p.useCallback(i=>{const l=Ge(i.target),a=l?yn(l):yn();i.target===i.currentTarget&&a===zr(i.nativeEvent)&&(n&&n(i),o&&o(!0),c(i))},[o,n,c]);return{focusProps:{onFocus:!t&&(n||o||r)?u:void 0,onBlur:!t&&(r||o)?s:void 0}}}function bl(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,s=p.useRef({isFocusWithin:!1}),{addGlobalListener:c,removeAllGlobalListeners:u}=Yr(),i=p.useCallback(d=>{d.currentTarget.contains(d.target)&&s.current.isFocusWithin&&!d.currentTarget.contains(d.relatedTarget)&&(s.current.isFocusWithin=!1,u(),n&&n(d),o&&o(!1))},[n,o,s,u]),l=qr(i),a=p.useCallback(d=>{if(!d.currentTarget.contains(d.target))return;const m=Ge(d.target),f=yn(m);if(!s.current.isFocusWithin&&f===zr(d.nativeEvent)){r&&r(d),o&&o(!0),s.current.isFocusWithin=!0,l(d);let h=d.currentTarget;c(m,"focus",v=>{if(s.current.isFocusWithin&&!Vr(h,v.target)){let b=new m.defaultView.FocusEvent("blur",{relatedTarget:v.target});ul(b,h);let C=Gr(b);i(C)}},{capture:!0})}},[r,o,l,c,i]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:a,onBlur:i}}}let Rt=!1,Wt=0;function Tn(){Rt=!0,setTimeout(()=>{Rt=!1},50)}function eo(e){e.pointerType==="touch"&&Tn()}function yl(){if(!(typeof document>"u"))return Wt===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",eo):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Tn)),Wt++,()=>{Wt--,!(Wt>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",eo):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Tn))}}function wl(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[s,c]=p.useState(!1),u=p.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;p.useEffect(yl,[]);let{addGlobalListener:i,removeAllGlobalListeners:l}=Yr(),{hoverProps:a,triggerHoverEnd:d}=p.useMemo(()=>{let m=(v,b)=>{if(u.pointerType=b,o||b==="touch"||u.isHovered||!v.currentTarget.contains(v.target))return;u.isHovered=!0;let C=v.currentTarget;u.target=C,i(Ge(v.target),"pointerover",E=>{u.isHovered&&u.target&&!Vr(u.target,E.target)&&f(E,E.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:C,pointerType:b}),n&&n(!0),c(!0)},f=(v,b)=>{let C=u.target;u.pointerType="",u.target=null,!(b==="touch"||!u.isHovered||!C)&&(u.isHovered=!1,l(),r&&r({type:"hoverend",target:C,pointerType:b}),n&&n(!1),c(!1))},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=v=>{Rt&&v.pointerType==="mouse"||m(v,v.pointerType)},h.onPointerLeave=v=>{!o&&v.currentTarget.contains(v.target)&&f(v,v.pointerType)}):process.env.NODE_ENV==="test"&&(h.onTouchStart=()=>{u.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=v=>{!u.ignoreEmulatedMouseEvents&&!Rt&&m(v,"mouse"),u.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=v=>{!o&&v.currentTarget.contains(v.target)&&f(v,"mouse")}),{hoverProps:h,triggerHoverEnd:f}},[t,n,r,o,u,i,l]);return p.useEffect(()=>{o&&d({currentTarget:u.target},u.pointerType)},[o]),{hoverProps:a,isHovered:s}}function El(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=p.useRef({isFocused:!1,isFocusVisible:t||Zr()}),[s,c]=p.useState(!1),[u,i]=p.useState(()=>o.current.isFocused&&o.current.isFocusVisible),l=p.useCallback(()=>i(o.current.isFocused&&o.current.isFocusVisible),[]),a=p.useCallback(f=>{o.current.isFocused=f,c(f),l()},[l]);gl(f=>{o.current.isFocusVisible=f,l()},[],{isTextInput:n});let{focusProps:d}=vl({isDisabled:r,onFocusChange:a}),{focusWithinProps:m}=bl({isDisabled:!r,onFocusWithinChange:a});return{isFocused:s,isFocusVisible:u,focusProps:r?m:d}}var xl=Object.defineProperty,Cl=(e,t,n)=>t in e?xl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$n=(e,t,n)=>(Cl(e,typeof t!="symbol"?t+"":t,n),n);let Sl=class{constructor(){$n(this,"current",this.detect()),$n(this,"handoffState","pending"),$n(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"}},Ie=new Sl;function St(e){var t,n;return Ie.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 to(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Fe(){let e=[],t={addEventListener(n,r,o,s){return n.addEventListener(r,o,s),t.add(()=>n.removeEventListener(r,o,s))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return to(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=Fe();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 ut(){let[e]=p.useState(Fe);return p.useEffect(()=>()=>e.dispose(),[e]),e}let ue=(e,t)=>{Ie.isServer?p.useEffect(e,t):p.useLayoutEffect(e,t)};function nt(e){let t=p.useRef(e);return ue(()=>{t.current=e},[e]),t}let ne=function(e){let t=nt(e);return p.useCallback((...n)=>t.current(...n),[t])};function Ol(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 Tl(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function $l({disabled:e=!1}={}){let t=p.useRef(null),[n,r]=p.useState(!1),o=ut(),s=ne(()=>{t.current=null,r(!1),o.dispose()}),c=ne(u=>{if(o.dispose(),t.current===null){t.current=u.currentTarget,r(!0);{let i=St(u.currentTarget);o.addEventListener(i,"pointerup",s,!1),o.addEventListener(i,"pointermove",l=>{if(t.current){let a=Ol(l);r(Tl(a,t.current.getBoundingClientRect()))}},!1),o.addEventListener(i,"pointercancel",s,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:c,onPointerUp:s,onClick:s}}}let Pl=p.createContext(void 0);function Pn(){return p.useContext(Pl)}function Mn(...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 Bt=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Bt||{}),qe=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(qe||{});function Se(){let e=Al();return p.useCallback(t=>Ml({mergeRefs:e,...t}),[e])}function Ml({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:s=!0,name:c,mergeRefs:u}){u=u??Dl;let i=no(t,e);if(s)return Ht(i,n,r,c,u);let l=o??0;if(l&2){let{static:a=!1,...d}=i;if(a)return Ht(d,n,r,c,u)}if(l&1){let{unmount:a=!0,...d}=i;return $e(a?0:1,{0(){return null},1(){return Ht({...d,hidden:!0,style:{display:"none"}},n,r,c,u)}})}return Ht(i,n,r,c,u)}function Ht(e,t={},n,r,o){let{as:s=n,children:c,refName:u="ref",...i}=An(e,["unmount","static"]),l=e.ref!==void 0?{[u]:e.ref}:{},a=typeof c=="function"?c(t):c;"className"in i&&i.className&&typeof i.className=="function"&&(i.className=i.className(t)),i["aria-labelledby"]&&i["aria-labelledby"]===i.id&&(i["aria-labelledby"]=void 0);let d={};if(t){let m=!1,f=[];for(let[h,v]of Object.entries(t))typeof v=="boolean"&&(m=!0),v===!0&&f.push(h.replace(/([A-Z])/g,b=>`-${b.toLowerCase()}`));if(m){d["data-headlessui-state"]=f.join(" ");for(let h of f)d[`data-${h}`]=""}}if(s===p.Fragment&&(Object.keys(Ke(i)).length>0||Object.keys(Ke(d)).length>0))if(!p.isValidElement(a)||Array.isArray(a)&&a.length>1){if(Object.keys(Ke(i)).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(Ke(i)).concat(Object.keys(Ke(d))).map(m=>` - ${m}`).join(`
|
|
64
|
-
`),"","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(m=>` - ${m}`).join(`
|
|
60
|
+
*/const Wo=Na("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 La 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 La(t,e);default:return new Pa(e,!1,r||1,o,i)}}const zo=typeof document<"u"?m.useLayoutEffect:()=>{};var rr;const Da=(rr=m.useInsertionEffect)!==null&&rr!==void 0?rr:zo;function $a(e){const t=m.useRef(null);return Da(()=>{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 Ma(e){return Aa(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Ia=!1;function or(){return Ia}function Ho(e,t){if(!or())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:Ma(n)?n=n.host:n=n.parentNode}return!1}const ir=(e=document)=>{var t;if(!or())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 or()&&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 sr(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 lr=lt(function(){return sr(/^Mac/i)}),ja=lt(function(){return sr(/^iPhone/i)}),Fa=lt(function(){return sr(/^iPad/i)||lr()&&navigator.maxTouchPoints>1}),Ra=lt(function(){return ja()||Fa()});lt(function(){return lr()||Ra()}),lt(function(){return dn(/AppleWebKit/i)&&!ka()});const ka=lt(function(){return dn(/Chrome/i)}),_a=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 Ba(e){return e.mozInputSource===0&&e.isTrusted?!0:_a()&&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=$a(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 Ua=!1,Gt=null,ar=new Set,Yt=new Map,Ct=!1,ur=!1;const Va={Tab:!0,Escape:!0};function cr(e,t){for(let n of ar)n(e,t)}function za(e){return!(e.metaKey||!lr()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function pn(e){Ct=!0,za(e)&&(Gt="keyboard",cr("keyboard",e))}function ke(e){Gt="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Ct=!0,cr("pointer",e))}function Xo(e){Ba(e)&&(Ct=!0,Gt="virtual")}function Qo(e){e.target===window||e.target===document||Ua||!e.isTrusted||(!Ct&&!ur&&(Gt="virtual",cr("virtual",e)),Ct=!1,ur=!1)}function Zo(){Ct=!1,ur=!0}function fr(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",Zo,!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",()=>{Jo(e)},{once:!0}),Yt.set(t,{focus:r})}const Jo=(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",Zo,!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 Ha(e){const t=gt(e);let n;return t.readyState!=="loading"?fr(e):(n=()=>{fr(e)},t.addEventListener("DOMContentLoaded",n)),()=>Jo(e,n)}typeof document<"u"&&Ha();function ei(){return Gt!=="pointer"}const Ga=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ya(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&&!Ga.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof l&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof u&&!Va[n.key])}function Ka(e,t,n){fr(),m.useEffect(()=>{let r=(o,i)=>{Ya(!!(n!=null&&n.isTextInput),o,i)&&e(ei())};return ar.add(r),()=>{ar.delete(r)}},t)}function qa(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?ir(a):ir();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 Xa(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=ir(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 dr(){mn=!0,setTimeout(()=>{mn=!1},50)}function ti(e){e.pointerType==="touch"&&dr()}function Qa(){if(!(typeof document>"u"))return hn===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",ti):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",dr)),hn++,()=>{hn--,!(hn>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",ti):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",dr))}}function Za(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,l]=m.useState(!1),u=m.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;m.useEffect(Qa,[]);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]);Ka(f=>{o.current.isFocusVisible=f,a()},[],{isTextInput:n});let{focusProps:d}=qa({isDisabled:r,onFocusChange:c}),{focusWithinProps:p}=Xa({isDisabled:!r,onFocusWithinChange:c});return{isFocused:i,isFocusVisible:u,focusProps:r?p:d}}var eu=Object.defineProperty,tu=(e,t,n)=>t in e?eu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pr=(e,t,n)=>(tu(e,typeof t!="symbol"?t+"":t,n),n);let nu=class{constructor(){pr(this,"current",this.detect()),pr(this,"handoffState","pending"),pr(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 nu;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 ru(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 ou(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function iu({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=ru(a);r(ou(c,t.current.getBoundingClientRect()))}},!1),o.addEventListener(s,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:l,onPointerUp:i,onClick:i}}}let su=m.createContext(void 0);function mr(){return m.useContext(su)}function hr(...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=au();return m.useCallback(t=>lu({mergeRefs:e,...t}),[e])}function lu({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l,mergeRefs:u}){u=u??uu;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}=gr(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
|
+
`),"","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(`
|
|
65
62
|
`)].join(`
|
|
66
|
-
`))}else{let m=a.props,f=m==null?void 0:m.className,h=typeof f=="function"?(...C)=>Mn(f(...C),i.className):Mn(f,i.className),v=h?{className:h}:{},b=no(a.props,Ke(An(i,["ref"])));for(let C in d)C in b&&delete d[C];return p.cloneElement(a,Object.assign({},b,d,l,{ref:o(_l(a),l.ref)},v))}return p.createElement(s,Object.assign({},An(i,["ref"]),s!==p.Fragment&&l,s!==p.Fragment&&d),a)}function Al(){let e=p.useRef([]),t=p.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 Dl(...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 no(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var s;return(s=o==null?void 0:o.preventDefault)==null?void 0:s.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...s){let c=n[r];for(let u of c){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;u(o,...s)}}});return t}function ro(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let s=n[r];for(let c of s)c==null||c(...o)}});return t}function xe(e){var t;return Object.assign(p.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Ke(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function An(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function _l(e){return p.version.split(".")[0]>="19"?e.props.ref:e.ref}function Fl(e,t,n){let[r,o]=p.useState(n),s=e!==void 0,c=p.useRef(s),u=p.useRef(!1),i=p.useRef(!1);return s&&!c.current&&!u.current?(u.current=!0,c.current=s,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!s&&c.current&&!i.current&&(i.current=!0,c.current=s,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[s?e:r,ne(l=>(s||o(l),t==null?void 0:t(l)))]}function Ll(e){let[t]=p.useState(e);return t}function oo(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))so(n,io(t,r),o);return n}function io(e,t){return e?e+"["+t+"]":t}function so(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())so(e,io(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,""]):oo(n,t,e)}function Nl(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 Il="span";var Dn=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Dn||{});function jl(e,t){var n;let{features:r=1,...o}=e,s={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Se()({ourProps:s,theirProps:o,slot:{},defaultTag:Il,name:"Hidden"})}let lo=xe(jl),kl=p.createContext(null);function Rl({children:e}){let t=p.useContext(kl);if(!t)return p.createElement(p.Fragment,null,e);let{target:n}=t;return n?Ee.createPortal(p.createElement(p.Fragment,null,e),n):null}function Wl({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[s,c]=p.useState(null),u=ut();return p.useEffect(()=>{if(r&&s)return u.addEventListener(s,"reset",r)},[s,t,r]),p.createElement(Rl,null,p.createElement(Bl,{setForm:c,formId:t}),oo(e).map(([i,l])=>p.createElement(lo,{features:Dn.Hidden,...Ke({key:i,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:i,value:l,...o})})))}function Bl({setForm:e,formId:t}){return p.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:p.createElement(lo,{features:Dn.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let Hl=p.createContext(void 0);function ao(){return p.useContext(Hl)}function _n(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function Ut(e){return _n(e)&&"tagName"in e}function Ve(e){return Ut(e)&&"accessKey"in e}function ct(e){return Ut(e)&&"tabIndex"in e}function Ul(e){return Ut(e)&&"style"in e}function Vl(e){return Ve(e)&&e.nodeName==="IFRAME"}function uo(e){return Ve(e)&&e.nodeName==="INPUT"}function co(e){return Ve(e)&&e.nodeName==="LABEL"}function zl(e){return Ve(e)&&e.nodeName==="FIELDSET"}function fo(e){return Ve(e)&&e.nodeName==="LEGEND"}function Yl(e){return Ut(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function Gl(e){let t=e.parentElement,n=null;for(;t&&!zl(t);)fo(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&ql(n)?!1:r}function ql(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(fo(t))return!1;t=t.previousElementSibling}return!0}let po=Symbol();function Kl(e,t=!0){return Object.assign(e,{[po]:t})}function Pe(...e){let t=p.useRef(e);p.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[po]))?void 0:n}let Fn=p.createContext(null);Fn.displayName="DescriptionContext";function mo(){let e=p.useContext(Fn);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,mo),t}return e}function Xl(){var e,t;return(t=(e=p.useContext(Fn))==null?void 0:e.value)!=null?t:void 0}let Ql="p";function Jl(e,t){let n=p.useId(),r=Pn(),{id:o=`headlessui-description-${n}`,...s}=e,c=mo(),u=Pe(t);ue(()=>c.register(o),[o,c.register]);let i=r||!1,l=p.useMemo(()=>({...c.slot,disabled:i}),[c.slot,i]),a={ref:u,...c.props,id:o};return Se()({ourProps:a,theirProps:s,slot:l,defaultTag:Ql,name:c.name||"Description"})}let Zl=xe(Jl);Object.assign(Zl,{});var he=(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))(he||{});let Vt=p.createContext(null);Vt.displayName="LabelContext";function ho(){let e=p.useContext(Vt);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,ho),t}return e}function go(e){var t,n,r;let o=(n=(t=p.useContext(Vt))==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 ea({inherit:e=!1}={}){let t=go(),[n,r]=p.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,p.useMemo(()=>function(s){let c=ne(i=>(r(l=>[...l,i]),()=>r(l=>{let a=l.slice(),d=a.indexOf(i);return d!==-1&&a.splice(d,1),a}))),u=p.useMemo(()=>({register:c,slot:s.slot,name:s.name,props:s.props,value:s.value}),[c,s.slot,s.name,s.props,s.value]);return p.createElement(Vt.Provider,{value:u},s.children)},[r])]}let ta="label";function na(e,t){var n;let r=p.useId(),o=ho(),s=ao(),c=Pn(),{id:u=`headlessui-label-${r}`,htmlFor:i=s??((n=o.props)==null?void 0:n.htmlFor),passive:l=!1,...a}=e,d=Pe(t);ue(()=>o.register(u),[u,o.register]);let m=ne(b=>{let C=b.currentTarget;if(!(b.target!==b.currentTarget&&Yl(b.target))&&(co(C)&&b.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(b),co(C))){let E=document.getElementById(C.htmlFor);if(E){let y=E.getAttribute("disabled");if(y==="true"||y==="")return;let O=E.getAttribute("aria-disabled");if(O==="true"||O==="")return;(uo(E)&&(E.type==="file"||E.type==="radio"||E.type==="checkbox")||E.role==="radio"||E.role==="checkbox"||E.role==="switch")&&E.click(),E.focus({preventScroll:!0})}}}),f=c||!1,h=p.useMemo(()=>({...o.slot,disabled:f}),[o.slot,f]),v={ref:d,...o.props,id:u,htmlFor:i,onClick:m};return l&&("onClick"in v&&(delete v.htmlFor,delete v.onClick),"onClick"in a&&delete a.onClick),Se()({ourProps:v,theirProps:a,slot:h,defaultTag:i?ta:"div",name:o.name||"Label"})}let ra=xe(na),oa=Object.assign(ra,{});function ia(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 sa(e=ia){return p.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 la(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function aa(e,t=!1){let[n,r]=p.useReducer(()=>({}),{}),o=p.useMemo(()=>la(e),[e,n]);return ue(()=>{if(!e)return;let s=new ResizeObserver(r);return s.observe(e),()=>{s.disconnect()}},[e]),t?{width:`${o.width}px`,height:`${o.height}px`}:o}let vo=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 ua=Object.defineProperty,ca=(e,t,n)=>t in e?ua(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fa=(e,t,n)=>(ca(e,t+"",n),n),bo=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Me=(e,t,n)=>(bo(e,t,"read from private field"),n?n.call(e):t.get(e)),Ln=(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)},yo=(e,t,n,r)=>(bo(e,t,"write to private field"),t.set(e,n),n),je,Ot,Tt;let wo=class{constructor(t){Ln(this,je,{}),Ln(this,Ot,new vo(()=>new Set)),Ln(this,Tt,new Set),fa(this,"disposables",Fe()),yo(this,je,t),Ie.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Me(this,je)}subscribe(t,n){if(Ie.isServer)return()=>{};let r={selector:t,callback:n,current:t(Me(this,je))};return Me(this,Tt).add(r),this.disposables.add(()=>{Me(this,Tt).delete(r)})}on(t,n){return Ie.isServer?()=>{}:(Me(this,Ot).get(t).add(n),this.disposables.add(()=>{Me(this,Ot).get(t).delete(n)}))}send(t){let n=this.reduce(Me(this,je),t);if(n!==Me(this,je)){yo(this,je,n);for(let r of Me(this,Tt)){let o=r.selector(Me(this,je));Eo(r.current,o)||(r.current=o,r.callback(o))}for(let r of Me(this,Ot).get(t.type))r(Me(this,je),t)}}};je=new WeakMap,Ot=new WeakMap,Tt=new WeakMap;function Eo(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:Nn(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Nn(e.entries(),t.entries()):xo(e)&&xo(t)?Nn(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Nn(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 xo(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function In(e){let[t,n]=e(),r=Fe();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var da=Object.defineProperty,pa=(e,t,n)=>t in e?da(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Co=(e,t,n)=>(pa(e,typeof t!="symbol"?t+"":t,n),n),So=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(So||{});let ma={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let s=e.stack.slice();return s.splice(o,1),s.push(n),r=s,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},ha=class xs extends wo{constructor(){super(...arguments),Co(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),Co(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new xs({stack:[]})}reduce(t,n){return $e(n.type,ma,t,n)}};const jn=new vo(()=>ha.new());var kn={exports:{}},Rn={};/**
|
|
63
|
+
`))}else{let p=c.props,f=p==null?void 0:p.className,g=typeof f=="function"?(...M)=>hr(f(...M),s.className):hr(f,s.className),v=g?{className:g}:{},E=ri(c.props,bt(gr(s,["ref"])));for(let M in d)M in E&&delete d[M];return m.cloneElement(c,Object.assign({},E,d,a,{ref:o(cu(c),a.ref)},v))}return m.createElement(i,Object.assign({},gr(s,["ref"]),i!==m.Fragment&&a,i!==m.Fragment&&d),c)}function au(){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 uu(...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 Ne(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 gr(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function cu(e){return m.version.split(".")[0]>="19"?e.props.ref:e.ref}function fu(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 du(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 pu(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 mu="span";var vr=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(vr||{});function hu(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:mu,name:"Hidden"})}let ai=Ne(hu),gu=m.createContext(null);function vu({children:e}){let t=m.useContext(gu);if(!t)return m.createElement(m.Fragment,null,e);let{target:n}=t;return n?Se.createPortal(m.createElement(m.Fragment,null,e),n):null}function bu({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(vu,null,m.createElement(yu,{setForm:l,formId:t}),ii(e).map(([s,a])=>m.createElement(ai,{features:vr.Hidden,...bt({key:s,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:s,value:a,...o})})))}function yu({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:vr.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 br(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function bn(e){return br(e)&&"tagName"in e}function at(e){return bn(e)&&"accessKey"in e}function At(e){return bn(e)&&"tabIndex"in e}function wu(e){return bn(e)&&"style"in e}function Eu(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 Su(e){return at(e)&&e.nodeName==="FIELDSET"}function di(e){return at(e)&&e.nodeName==="LEGEND"}function Cu(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 Ou(e){let t=e.parentElement,n=null;for(;t&&!Su(t);)di(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Tu(n)?!1:r}function Tu(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 Nu(e,t=!0){return Object.assign(e,{[pi]:t})}function Be(...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 yr=m.createContext(null);yr.displayName="DescriptionContext";function mi(){let e=m.useContext(yr);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 Lu(){var e,t;return(t=(e=m.useContext(yr))==null?void 0:e.value)!=null?t:void 0}let Pu="p";function Du(e,t){let n=m.useId(),r=mr(),{id:o=`headlessui-description-${n}`,...i}=e,l=mi(),u=Be(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 $u=Ne(Du);Object.assign($u,{});var be=(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))(be||{});let yn=m.createContext(null);yn.displayName="LabelContext";function hi(){let e=m.useContext(yn);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(yn))==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=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(yn.Provider,{value:u},i.children)},[r])]}let Mu="label";function Iu(e,t){var n;let r=m.useId(),o=hi(),i=ui(),l=mr(),{id:u=`headlessui-label-${r}`,htmlFor:s=i??((n=o.props)==null?void 0:n.htmlFor),passive:a=!1,...c}=e,d=Be(t);ue(()=>o.register(u),[u,o.register]);let p=ne(E=>{let M=E.currentTarget;if(!(E.target!==E.currentTarget&&Cu(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 F=w.getAttribute("aria-disabled");if(F==="true"||F==="")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?Mu:"div",name:o.name||"Label"})}let ju=Ne(Iu),Fu=Object.assign(ju,{});function Ru(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 ku(e=Ru){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 _u(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Bu(e,t=!1){let[n,r]=m.useReducer(()=>({}),{}),o=m.useMemo(()=>_u(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,Uu=(e,t,n)=>t in e?Wu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vu=(e,t,n)=>(Uu(e,t+"",n),n),bi=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},We=(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)},yi=(e,t,n,r)=>(bi(e,t,"write to private field"),t.set(e,n),n),Ze,qt,Xt;let xi=class{constructor(t){xr(this,Ze,{}),xr(this,qt,new vi(()=>new Set)),xr(this,Xt,new Set),Vu(this,"disposables",Ke()),yi(this,Ze,t),Qe.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return We(this,Ze)}subscribe(t,n){if(Qe.isServer)return()=>{};let r={selector:t,callback:n,current:t(We(this,Ze))};return We(this,Xt).add(r),this.disposables.add(()=>{We(this,Xt).delete(r)})}on(t,n){return Qe.isServer?()=>{}:(We(this,qt).get(t).add(n),this.disposables.add(()=>{We(this,qt).get(t).delete(n)}))}send(t){let n=this.reduce(We(this,Ze),t);if(n!==We(this,Ze)){yi(this,Ze,n);for(let r of We(this,Xt)){let o=r.selector(We(this,Ze));wi(r.current,o)||(r.current=o,r.callback(o))}for(let r of We(this,qt).get(t.type))r(We(this,Ze),t)}}};Ze=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:wr(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:wr(e.entries(),t.entries()):Ei(e)&&Ei(t)?wr(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function wr(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 Er(e){let[t,n]=e(),r=Ke();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var zu=Object.defineProperty,Hu=(e,t,n)=>t in e?zu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Si=(e,t,n)=>(Hu(e,typeof t!="symbol"?t+"":t,n),n),Ci=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Ci||{});let Gu={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}}},Yu=class ia extends xi{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 ia({stack:[]})}reduce(t,n){return _e(n.type,Gu,t,n)}};const Sr=new vi(()=>Yu.new());var Cr={exports:{}},Or={};/**
|
|
67
64
|
* @license React
|
|
68
65
|
* use-sync-external-store-with-selector.production.js
|
|
69
66
|
*
|
|
@@ -71,7 +68,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
71
68
|
*
|
|
72
69
|
* This source code is licensed under the MIT license found in the
|
|
73
70
|
* LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/var
|
|
71
|
+
*/var Oi;function Ku(){if(Oi)return Or;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 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(j){if(!M){if(M=!0,w=j,j=d(j),p!==void 0&&g.hasValue){var k=g.value;if(p(k,j))return N=k}return N=j}if(k=N,n(w,j))return k;var B=d(j);return p!==void 0&&p(k,B)?(w=j,k):(w=j,N=B)}var M=!1,w,N,F=c===void 0?null:c;return[function(){return E(a())},F===null?void 0:function(){return E(F())}]},[a,c,d,p]);var v=r(s,f[0],f[1]);return i(function(){g.hasValue=!0,g.value=v},[v]),u(v),v},Or}var Tr={};/**
|
|
75
72
|
* @license React
|
|
76
73
|
* use-sync-external-store-with-selector.development.js
|
|
77
74
|
*
|
|
@@ -79,45 +76,45 @@ React keys must be passed directly to JSX without using spread:
|
|
|
79
76
|
*
|
|
80
77
|
* This source code is licensed under the MIT license found in the
|
|
81
78
|
* LICENSE file in the root directory of this source tree.
|
|
82
|
-
*/var To;function va(){return To||(To=1,process.env.NODE_ENV!=="production"&&function(){function e(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=p,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,u=t.useDebugValue;Wn.useSyncExternalStoreWithSelector=function(i,l,a,d,m){var f=o(null);if(f.current===null){var h={hasValue:!1,value:null};f.current=h}else h=f.current;f=c(function(){function b(w){if(!C){if(C=!0,E=w,w=d(w),m!==void 0&&h.hasValue){var F=h.value;if(m(F,w))return y=F}return y=w}if(F=y,n(E,w))return F;var _=d(w);return m!==void 0&&m(F,_)?(E=w,F):(E=w,y=_)}var C=!1,E,y,O=a===void 0?null:a;return[function(){return b(l())},O===null?void 0:function(){return b(O())}]},[l,a,d,m]);var v=r(i,f[0],f[1]);return s(function(){h.hasValue=!0,h.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())}()),Wn}process.env.NODE_ENV==="production"?kn.exports=ga():kn.exports=va();var ba=kn.exports;function Ae(e,t,n=Eo){return ba.useSyncExternalStoreWithSelector(ne(r=>e.subscribe(ya,r)),ne(()=>e.state),ne(()=>e.state),ne(t),n)}function ya(e){return e}function $o(e,t){let n=p.useId(),r=jn.get(t),[o,s]=Ae(r,p.useCallback(c=>[r.selectors.isTop(c,n),r.selectors.inStack(c,n)],[r,n]));return ue(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?s?o:!0:!1}let Bn=new Map,$t=new Map;function Po(e){var t;let n=(t=$t.get(e))!=null?t:0;return $t.set(e,n+1),n!==0?()=>Mo(e):(Bn.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Mo(e))}function Mo(e){var t;let n=(t=$t.get(e))!=null?t:1;if(n===1?$t.delete(e):$t.set(e,n-1),n!==1)return;let r=Bn.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Bn.delete(e))}function wa(e,{allowed:t,disallowed:n}={}){let r=$o(e,"inert-others");ue(()=>{var o,s;if(!r)return;let c=Fe();for(let i of(o=n==null?void 0:n())!=null?o:[])i&&c.add(Po(i));let u=(s=t==null?void 0:t())!=null?s:[];for(let i of u){if(!i)continue;let l=St(i);if(!l)continue;let a=i.parentElement;for(;a&&a!==l.body;){for(let d of a.children)u.some(m=>d.contains(m))||c.add(Po(d));a=a.parentElement}}return c.dispose},[r,t,n])}function Ea(e,t,n){let r=nt(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});p.useEffect(()=>{if(!e)return;let o=t===null?null:Ve(t)?t:t.current;if(!o)return;let s=Fe();if(typeof ResizeObserver<"u"){let c=new ResizeObserver(()=>r.current(o));c.observe(o),s.add(()=>c.disconnect())}if(typeof IntersectionObserver<"u"){let c=new IntersectionObserver(()=>r.current(o));c.observe(o),s.add(()=>c.disconnect())}return()=>s.dispose()},[t,r,e])}let Hn=["[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(","),xa=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Un=(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))(Un||{}),Ca=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Ca||{}),Sa=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Sa||{});function Ao(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Hn)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Oa(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(xa)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Vn=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Vn||{});function Do(e,t=0){var n;return e===((n=St(e))==null?void 0:n.body)?!1:$e(t,{0(){return e.matches(Hn)},1(){let r=e;for(;r!==null;){if(r.matches(Hn))return!0;r=r.parentElement}return!1}})}var Ta=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Ta||{});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 $a=["textarea","input"].join(",");function Pa(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,$a))!=null?n:!1}function _o(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),s=t(r);if(o===null||s===null)return 0;let c=o.compareDocumentPosition(s);return c&Node.DOCUMENT_POSITION_FOLLOWING?-1:c&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Ma(e,t){return Aa(Ao(),t,{relativeTo:e})}function Aa(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,c=Array.isArray(e)?n?_o(e):e:t&64?Oa(e):Ao(e);o.length>0&&c.length>1&&(c=c.filter(f=>!o.some(h=>h!=null&&"current"in h?(h==null?void 0:h.current)===f:h===f))),r=r??s.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")})(),i=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,c.indexOf(r))-1;if(t&4)return Math.max(0,c.indexOf(r))+1;if(t&8)return c.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=t&32?{preventScroll:!0}:{},a=0,d=c.length,m;do{if(a>=d||a+d<=0)return 0;let f=i+a;if(t&16)f=(f+d)%d;else{if(f<0)return 3;if(f>=d)return 1}m=c[f],m==null||m.focus(l),a+=u}while(m!==s.activeElement);return t&6&&Pa(m)&&m.select(),2}function Fo(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Da(){return/Android/gi.test(window.navigator.userAgent)}function Lo(){return Fo()||Da()}function ft(e,t,n,r){let o=nt(n);p.useEffect(()=>{if(!e)return;function s(c){o.current(c)}return document.addEventListener(t,s,r),()=>document.removeEventListener(t,s,r)},[e,t,r])}function _a(e,t,n,r){let o=nt(n);p.useEffect(()=>{if(!e)return;function s(c){o.current(c)}return window.addEventListener(t,s,r),()=>window.removeEventListener(t,s,r)},[e,t,r])}const No=30;function Fa(e,t,n){let r=nt(n),o=p.useCallback(function(u,i){if(u.defaultPrevented)return;let l=i(u);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let a=function d(m){return typeof m=="function"?d(m()):Array.isArray(m)||m instanceof Set?m:[m]}(t);for(let d of a)if(d!==null&&(d.contains(l)||u.composed&&u.composedPath().includes(d)))return;return!Do(l,Vn.Loose)&&l.tabIndex!==-1&&u.preventDefault(),r.current(u,l)},[r,t]),s=p.useRef(null);ft(e,"pointerdown",u=>{var i,l;Lo()||(s.current=((l=(i=u.composedPath)==null?void 0:i.call(u))==null?void 0:l[0])||u.target)},!0),ft(e,"pointerup",u=>{if(Lo()||!s.current)return;let i=s.current;return s.current=null,o(u,()=>i)},!0);let c=p.useRef({x:0,y:0});ft(e,"touchstart",u=>{c.current.x=u.touches[0].clientX,c.current.y=u.touches[0].clientY},!0),ft(e,"touchend",u=>{let i={x:u.changedTouches[0].clientX,y:u.changedTouches[0].clientY};if(!(Math.abs(i.x-c.current.x)>=No||Math.abs(i.y-c.current.y)>=No))return o(u,()=>ct(u.target)?u.target:null)},!0),_a(e,"blur",u=>o(u,()=>Vl(window.document.activeElement)?window.document.activeElement:null),!0)}function zn(...e){return p.useMemo(()=>St(...e),[...e])}var La=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(La||{});const zt={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},Na=200,Io=5;function Ia(e,{trigger:t,action:n,close:r,select:o}){let s=p.useRef(null),c=p.useRef(null),u=p.useRef(null);ft(e&&t!==null,"pointerdown",i=>{_n(i==null?void 0:i.target)&&t!=null&&t.contains(i.target)&&(c.current=i.x,u.current=i.y,s.current=i.timeStamp)}),ft(e&&t!==null,"pointerup",i=>{var l,a;let d=s.current;if(d===null||(s.current=null,!ct(i.target))||Math.abs(i.x-((l=c.current)!=null?l:i.x))<Io&&Math.abs(i.y-((a=u.current)!=null?a:i.y))<Io)return;let m=n(i);switch(m.kind){case 0:return;case 1:{i.timeStamp-d>Na&&(o(m.target),r());break}case 2:{r();break}}},{capture:!0})}function ja(e,t){return p.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 ka(e){return p.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Ra(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...s){let c=t[o].call(n,...s);c&&(n=c,r.forEach(u=>u()))}}}function Wa(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,e-o);n.style(r,"paddingRight",`${s}px`)}}}function Ba(){return Fo()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(s=>s()).some(s=>s.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let u=Fe();u.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>u.dispose()))}let s=(o=window.scrollY)!=null?o:window.pageYOffset,c=null;t.addEventListener(e,"click",u=>{if(ct(u.target))try{let i=u.target.closest("a");if(!i)return;let{hash:l}=new URL(i.href),a=e.querySelector(l);ct(a)&&!r(a)&&(c=a)}catch{}},!0),t.addEventListener(e,"touchstart",u=>{if(ct(u.target)&&Ul(u.target))if(r(u.target)){let i=u.target;for(;i.parentElement&&r(i.parentElement);)i=i.parentElement;t.style(i,"overscrollBehavior","contain")}else t.style(u.target,"touchAction","none")}),t.addEventListener(e,"touchmove",u=>{if(ct(u.target)){if(uo(u.target))return;if(r(u.target)){let i=u.target;for(;i.parentElement&&i.dataset.headlessuiPortal!==""&&!(i.scrollHeight>i.clientHeight||i.scrollWidth>i.clientWidth);)i=i.parentElement;i.dataset.headlessuiPortal===""&&u.preventDefault()}else u.preventDefault()}},{passive:!1}),t.add(()=>{var u;let i=(u=window.scrollY)!=null?u:window.pageYOffset;s!==i&&window.scrollTo(0,s),c&&c.isConnected&&(c.scrollIntoView({block:"nearest"}),c=null)})})}}:{}}function Ha(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Ua(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let rt=Ra(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:Fe(),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:Ua(n)},o=[Ba(),Wa(),Ha()];o.forEach(({before:s})=>s==null?void 0:s(r)),o.forEach(({after:s})=>s==null?void 0:s(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});rt.subscribe(()=>{let e=rt.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)&&rt.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&rt.dispatch("TEARDOWN",n)}});function Va(e,t,n=()=>({containers:[]})){let r=ka(rt),o=t?r.get(t):void 0,s=o?o.count>0:!1;return ue(()=>{if(!(!t||!e))return rt.dispatch("PUSH",t,n),()=>rt.dispatch("POP",t,n)},[e,t]),s}function za(e,t,n=()=>[document.body]){let r=$o(e,"scroll-lock");Va(r,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],n]}})}function jo(e){return[e.screenX,e.screenY]}function Ya(){let e=p.useRef([-1,-1]);return{wasMoved(t){let n=jo(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=jo(t)}}}function Ga(e=0){let[t,n]=p.useState(e),r=p.useCallback(i=>n(i),[t]),o=p.useCallback(i=>n(l=>l|i),[t]),s=p.useCallback(i=>(t&i)===i,[t]),c=p.useCallback(i=>n(l=>l&~i),[n]),u=p.useCallback(i=>n(l=>l^i),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:s,removeFlag:c,toggleFlag:u}}var ko,Ro;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((ko=process==null?void 0:process.env)==null?void 0:ko.NODE_ENV)==="test"&&typeof((Ro=Element==null?void 0:Element.prototype)==null?void 0:Ro.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(`
|
|
83
|
-
`)),[]});var qa=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(qa||{});function Wo(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Bo(e,t,n,r){let[o,s]=p.useState(n),{hasFlag:c,addFlag:u,removeFlag:i}=Ga(e&&o?3:0),l=p.useRef(!1),a=p.useRef(!1),d=ut();return ue(()=>{var m;if(e){if(n&&s(!0),!t){n&&u(3);return}return(m=r==null?void 0:r.start)==null||m.call(r,n),Ka(t,{inFlight:l,prepare(){a.current?a.current=!1:a.current=l.current,l.current=!0,!a.current&&(n?(u(3),i(4)):(u(4),i(2)))},run(){a.current?n?(i(3),u(4)):(i(4),u(3)):n?i(1):u(1)},done(){var f;a.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(l.current=!1,i(7),n||s(!1),(f=r==null?void 0:r.end)==null||f.call(r,n))}})}},[e,n,t,d]),e?[o,{closed:c(1),enter:c(2),leave:c(4),transition:c(2)||c(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Ka(e,{prepare:t,run:n,done:r,inFlight:o}){let s=Fe();return Qa(e,{prepare:t,inFlight:o}),s.nextFrame(()=>{n(),s.requestAnimationFrame(()=>{s.add(Xa(e,r))})}),s.dispose}function Xa(e,t){var n,r;let o=Fe();if(!e)return o.dispose;let s=!1;o.add(()=>{s=!0});let c=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(u=>u instanceof CSSTransition))!=null?r:[];return c.length===0?(t(),o.dispose):(Promise.allSettled(c.map(u=>u.finished)).then(()=>{s||t()}),o.dispose)}function Qa(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 Yt(){return typeof window<"u"}function dt(e){return Ho(e)?(e.nodeName||"").toLowerCase():"#document"}function Oe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ke(e){var t;return(t=(Ho(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ho(e){return Yt()?e instanceof Node||e instanceof Oe(e).Node:!1}function ve(e){return Yt()?e instanceof Element||e instanceof Oe(e).Element:!1}function Re(e){return Yt()?e instanceof HTMLElement||e instanceof Oe(e).HTMLElement:!1}function Uo(e){return!Yt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Oe(e).ShadowRoot}const Ja=new Set(["inline","contents"]);function Pt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Le(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Ja.has(o)}const Za=new Set(["table","td","th"]);function eu(e){return Za.has(dt(e))}const tu=[":popover-open",":modal"];function Gt(e){return tu.some(t=>{try{return e.matches(t)}catch{return!1}})}const nu=["transform","translate","scale","rotate","perspective"],ru=["transform","translate","scale","rotate","perspective","filter"],ou=["paint","layout","strict","content"];function Yn(e){const t=Gn(),n=ve(e)?Le(e):e;return nu.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)||ru.some(r=>(n.willChange||"").includes(r))||ou.some(r=>(n.contain||"").includes(r))}function iu(e){let t=Xe(e);for(;Re(t)&&!pt(t);){if(Yn(t))return t;if(Gt(t))return null;t=Xe(t)}return null}function Gn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const su=new Set(["html","body","#document"]);function pt(e){return su.has(dt(e))}function Le(e){return Oe(e).getComputedStyle(e)}function qt(e){return ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xe(e){if(dt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Uo(e)&&e.host||ke(e);return Uo(t)?t.host:t}function Vo(e){const t=Xe(e);return pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Re(t)&&Pt(t)?t:Vo(t)}function Mt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Vo(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),c=Oe(o);if(s){const u=qn(c);return t.concat(c,c.visualViewport||[],Pt(o)?o:[],u&&n?Mt(u):[])}return t.concat(o,Mt(o,[],n))}function qn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lu(){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 ot=Math.min,be=Math.max,At=Math.round,Kt=Math.floor,We=e=>({x:e,y:e}),au={left:"right",right:"left",bottom:"top",top:"bottom"},uu={start:"end",end:"start"};function zo(e,t,n){return be(e,ot(t,n))}function mt(e,t){return typeof e=="function"?e(t):e}function Qe(e){return e.split("-")[0]}function Dt(e){return e.split("-")[1]}function Yo(e){return e==="x"?"y":"x"}function Go(e){return e==="y"?"height":"width"}const cu=new Set(["top","bottom"]);function ze(e){return cu.has(Qe(e))?"y":"x"}function qo(e){return Yo(ze(e))}function fu(e,t,n){n===void 0&&(n=!1);const r=Dt(e),o=qo(e),s=Go(o);let c=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=Xt(c)),[c,Xt(c)]}function du(e){const t=Xt(e);return[Kn(e),t,Kn(t)]}function Kn(e){return e.replace(/start|end/g,t=>uu[t])}const Ko=["left","right"],Xo=["right","left"],pu=["top","bottom"],mu=["bottom","top"];function hu(e,t,n){switch(e){case"top":case"bottom":return n?t?Xo:Ko:t?Ko:Xo;case"left":case"right":return t?pu:mu;default:return[]}}function gu(e,t,n,r){const o=Dt(e);let s=hu(Qe(e),n==="start",r);return o&&(s=s.map(c=>c+"-"+o),t&&(s=s.concat(s.map(Kn)))),s}function Xt(e){return e.replace(/left|right|bottom|top/g,t=>au[t])}function vu(e){return{top:0,right:0,bottom:0,left:0,...e}}function bu(e){return typeof e!="number"?vu(e):{top:e,right:e,bottom:e,left:e}}function Qt(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}}function Qo(e,t,n){let{reference:r,floating:o}=e;const s=ze(t),c=qo(t),u=Go(c),i=Qe(t),l=s==="y",a=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,m=r[u]/2-o[u]/2;let f;switch(i){case"top":f={x:a,y:r.y-o.height};break;case"bottom":f={x:a,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(Dt(t)){case"start":f[c]-=m*(n&&l?-1:1);break;case"end":f[c]+=m*(n&&l?-1:1);break}return f}const yu=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:c}=n,u=s.filter(Boolean),i=await(c.isRTL==null?void 0:c.isRTL(t));let l=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:d}=Qo(l,r,i),m=r,f={},h=0;for(let v=0;v<u.length;v++){const{name:b,fn:C}=u[v],{x:E,y,data:O,reset:w}=await C({x:a,y:d,initialPlacement:r,placement:m,strategy:o,middlewareData:f,rects:l,platform:c,elements:{reference:e,floating:t}});a=E??a,d=y??d,f={...f,[b]:{...f[b],...O}},w&&h<=50&&(h++,typeof w=="object"&&(w.placement&&(m=w.placement),w.rects&&(l=w.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:a,y:d}=Qo(l,m,i)),v=-1)}return{x:a,y:d,placement:m,strategy:o,middlewareData:f}};async function Jt(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:c,elements:u,strategy:i}=e,{boundary:l="clippingAncestors",rootBoundary:a="viewport",elementContext:d="floating",altBoundary:m=!1,padding:f=0}=mt(t,e),h=bu(f),b=u[m?d==="floating"?"reference":"floating":d],C=Qt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:l,rootBoundary:a,strategy:i})),E=d==="floating"?{x:r,y:o,width:c.floating.width,height:c.floating.height}:c.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),O=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},w=Qt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:E,offsetParent:y,strategy:i}):E);return{top:(C.top-w.top+h.top)/O.y,bottom:(w.bottom-C.bottom+h.bottom)/O.y,left:(C.left-w.left+h.left)/O.x,right:(w.right-C.right+h.right)/O.x}}const wu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:c,initialPlacement:u,platform:i,elements:l}=t,{mainAxis:a=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...b}=mt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const C=Qe(o),E=ze(u),y=Qe(u)===u,O=await(i.isRTL==null?void 0:i.isRTL(l.floating)),w=m||(y||!v?[Xt(u)]:du(u)),F=h!=="none";!m&&F&&w.push(...gu(u,v,h,O));const _=[u,...w],B=await Jt(t,b),K=[];let A=((r=s.flip)==null?void 0:r.overflows)||[];if(a&&K.push(B[C]),d){const R=fu(o,c,O);K.push(B[R[0]],B[R[1]])}if(A=[...A,{placement:o,overflows:K}],!K.every(R=>R<=0)){var j,re;const R=(((j=s.flip)==null?void 0:j.index)||0)+1,X=_[R];if(X&&(!(d==="alignment"?E!==ze(X):!1)||A.every(T=>ze(T.placement)===E?T.overflows[0]>0:!0)))return{data:{index:R,overflows:A},reset:{placement:X}};let G=(re=A.filter(Q=>Q.overflows[0]<=0).sort((Q,T)=>Q.overflows[1]-T.overflows[1])[0])==null?void 0:re.placement;if(!G)switch(f){case"bestFit":{var U;const Q=(U=A.filter(T=>{if(F){const H=ze(T.placement);return H===E||H==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(H=>H>0).reduce((H,S)=>H+S,0)]).sort((T,H)=>T[1]-H[1])[0])==null?void 0:U[0];Q&&(G=Q);break}case"initialPlacement":G=u;break}if(o!==G)return{reset:{placement:G}}}return{}}}},Eu=new Set(["left","top"]);async function xu(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=Qe(n),u=Dt(n),i=ze(n)==="y",l=Eu.has(c)?-1:1,a=s&&i?-1:1,d=mt(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return u&&typeof h=="number"&&(f=u==="end"?h*-1:h),i?{x:f*a,y:m*l}:{x:m*l,y:f*a}}const Cu=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:c,middlewareData:u}=t,i=await xu(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:o+i.x,y:s+i.y,data:{...i,placement:c}}}}},Su=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:u={fn:b=>{let{x:C,y:E}=b;return{x:C,y:E}}},...i}=mt(e,t),l={x:n,y:r},a=await Jt(t,i),d=ze(Qe(o)),m=Yo(d);let f=l[m],h=l[d];if(s){const b=m==="y"?"top":"left",C=m==="y"?"bottom":"right",E=f+a[b],y=f-a[C];f=zo(E,f,y)}if(c){const b=d==="y"?"top":"left",C=d==="y"?"bottom":"right",E=h+a[b],y=h-a[C];h=zo(E,h,y)}const v=u.fn({...t,[m]:f,[d]:h});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[m]:s,[d]:c}}}}}},Ou=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:c,elements:u}=t,{apply:i=()=>{},...l}=mt(e,t),a=await Jt(t,l),d=Qe(o),m=Dt(o),f=ze(o)==="y",{width:h,height:v}=s.floating;let b,C;d==="top"||d==="bottom"?(b=d,C=m===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(C=d,b=m==="end"?"top":"bottom");const E=v-a.top-a.bottom,y=h-a.left-a.right,O=ot(v-a[b],E),w=ot(h-a[C],y),F=!t.middlewareData.shift;let _=O,B=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(B=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=E),F&&!m){const A=be(a.left,0),j=be(a.right,0),re=be(a.top,0),U=be(a.bottom,0);f?B=h-2*(A!==0||j!==0?A+j:be(a.left,a.right)):_=v-2*(re!==0||U!==0?re+U:be(a.top,a.bottom))}await i({...t,availableWidth:B,availableHeight:_});const K=await c.getDimensions(u.floating);return h!==K.width||v!==K.height?{reset:{rects:!0}}:{}}}};function Jo(e){const t=Le(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Re(e),s=o?e.offsetWidth:n,c=o?e.offsetHeight:r,u=At(n)!==s||At(r)!==c;return u&&(n=s,r=c),{width:n,height:r,$:u}}function Xn(e){return ve(e)?e:e.contextElement}function ht(e){const t=Xn(e);if(!Re(t))return We(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Jo(t);let c=(s?At(n.width):n.width)/r,u=(s?At(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const Tu=We(0);function Zo(e){const t=Oe(e);return!Gn()||!t.visualViewport?Tu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $u(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Oe(e)?!1:t}function it(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Xn(e);let c=We(1);t&&(r?ve(r)&&(c=ht(r)):c=ht(e));const u=$u(s,n,r)?Zo(s):We(0);let i=(o.left+u.x)/c.x,l=(o.top+u.y)/c.y,a=o.width/c.x,d=o.height/c.y;if(s){const m=Oe(s),f=r&&ve(r)?Oe(r):r;let h=m,v=qn(h);for(;v&&r&&f!==h;){const b=ht(v),C=v.getBoundingClientRect(),E=Le(v),y=C.left+(v.clientLeft+parseFloat(E.paddingLeft))*b.x,O=C.top+(v.clientTop+parseFloat(E.paddingTop))*b.y;i*=b.x,l*=b.y,a*=b.x,d*=b.y,i+=y,l+=O,h=Oe(v),v=qn(h)}}return Qt({width:a,height:d,x:i,y:l})}function Zt(e,t){const n=qt(e).scrollLeft;return t?t.left+n:it(ke(e)).left+n}function ei(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Zt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Pu(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",c=ke(r),u=t?Gt(t.floating):!1;if(r===c||u&&s)return n;let i={scrollLeft:0,scrollTop:0},l=We(1);const a=We(0),d=Re(r);if((d||!d&&!s)&&((dt(r)!=="body"||Pt(c))&&(i=qt(r)),Re(r))){const f=it(r);l=ht(r),a.x=f.x+r.clientLeft,a.y=f.y+r.clientTop}const m=c&&!d&&!s?ei(c,i):We(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-i.scrollLeft*l.x+a.x+m.x,y:n.y*l.y-i.scrollTop*l.y+a.y+m.y}}function Mu(e){return Array.from(e.getClientRects())}function Au(e){const t=ke(e),n=qt(e),r=e.ownerDocument.body,o=be(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=be(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+Zt(e);const u=-n.scrollTop;return Le(r).direction==="rtl"&&(c+=be(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:c,y:u}}const ti=25;function Du(e,t){const n=Oe(e),r=ke(e),o=n.visualViewport;let s=r.clientWidth,c=r.clientHeight,u=0,i=0;if(o){s=o.width,c=o.height;const a=Gn();(!a||a&&t==="fixed")&&(u=o.offsetLeft,i=o.offsetTop)}const l=Zt(r);if(l<=0){const a=r.ownerDocument,d=a.body,m=getComputedStyle(d),f=a.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(r.clientWidth-d.clientWidth-f);h<=ti&&(s-=h)}else l<=ti&&(s+=l);return{width:s,height:c,x:u,y:i}}const _u=new Set(["absolute","fixed"]);function Fu(e,t){const n=it(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Re(e)?ht(e):We(1),c=e.clientWidth*s.x,u=e.clientHeight*s.y,i=o*s.x,l=r*s.y;return{width:c,height:u,x:i,y:l}}function ni(e,t,n){let r;if(t==="viewport")r=Du(e,n);else if(t==="document")r=Au(ke(e));else if(ve(t))r=Fu(t,n);else{const o=Zo(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Qt(r)}function ri(e,t){const n=Xe(e);return n===t||!ve(n)||pt(n)?!1:Le(n).position==="fixed"||ri(n,t)}function Lu(e,t){const n=t.get(e);if(n)return n;let r=Mt(e,[],!1).filter(u=>ve(u)&&dt(u)!=="body"),o=null;const s=Le(e).position==="fixed";let c=s?Xe(e):e;for(;ve(c)&&!pt(c);){const u=Le(c),i=Yn(c);!i&&u.position==="fixed"&&(o=null),(s?!i&&!o:!i&&u.position==="static"&&!!o&&_u.has(o.position)||Pt(c)&&!i&&ri(e,c))?r=r.filter(a=>a!==c):o=u,c=Xe(c)}return t.set(e,r),r}function Nu(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const c=[...n==="clippingAncestors"?Gt(t)?[]:Lu(t,this._c):[].concat(n),r],u=c[0],i=c.reduce((l,a)=>{const d=ni(t,a,o);return l.top=be(d.top,l.top),l.right=ot(d.right,l.right),l.bottom=ot(d.bottom,l.bottom),l.left=be(d.left,l.left),l},ni(t,u,o));return{width:i.right-i.left,height:i.bottom-i.top,x:i.left,y:i.top}}function Iu(e){const{width:t,height:n}=Jo(e);return{width:t,height:n}}function ju(e,t,n){const r=Re(t),o=ke(t),s=n==="fixed",c=it(e,!0,s,t);let u={scrollLeft:0,scrollTop:0};const i=We(0);function l(){i.x=Zt(o)}if(r||!r&&!s)if((dt(t)!=="body"||Pt(o))&&(u=qt(t)),r){const f=it(t,!0,s,t);i.x=f.x+t.clientLeft,i.y=f.y+t.clientTop}else o&&l();s&&!r&&o&&l();const a=o&&!r&&!s?ei(o,u):We(0),d=c.left+u.scrollLeft-i.x-a.x,m=c.top+u.scrollTop-i.y-a.y;return{x:d,y:m,width:c.width,height:c.height}}function Qn(e){return Le(e).position==="static"}function oi(e,t){if(!Re(e)||Le(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ke(e)===n&&(n=n.ownerDocument.body),n}function ii(e,t){const n=Oe(e);if(Gt(e))return n;if(!Re(e)){let o=Xe(e);for(;o&&!pt(o);){if(ve(o)&&!Qn(o))return o;o=Xe(o)}return n}let r=oi(e,t);for(;r&&eu(r)&&Qn(r);)r=oi(r,t);return r&&pt(r)&&Qn(r)&&!Yn(r)?n:r||iu(e)||n}const ku=async function(e){const t=this.getOffsetParent||ii,n=this.getDimensions,r=await n(e.floating);return{reference:ju(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ru(e){return Le(e).direction==="rtl"}const Wu={convertOffsetParentRelativeRectToViewportRelativeRect:Pu,getDocumentElement:ke,getClippingRect:Nu,getOffsetParent:ii,getElementRects:ku,getClientRects:Mu,getDimensions:Iu,getScale:ht,isElement:ve,isRTL:Ru};function si(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bu(e,t){let n=null,r;const o=ke(e);function s(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function c(u,i){u===void 0&&(u=!1),i===void 0&&(i=1),s();const l=e.getBoundingClientRect(),{left:a,top:d,width:m,height:f}=l;if(u||t(),!m||!f)return;const h=Kt(d),v=Kt(o.clientWidth-(a+m)),b=Kt(o.clientHeight-(d+f)),C=Kt(a),y={rootMargin:-h+"px "+-v+"px "+-b+"px "+-C+"px",threshold:be(0,ot(1,i))||1};let O=!0;function w(F){const _=F[0].intersectionRatio;if(_!==i){if(!O)return c();_?c(!1,_):r=setTimeout(()=>{c(!1,1e-7)},1e3)}_===1&&!si(l,e.getBoundingClientRect())&&c(),O=!1}try{n=new IntersectionObserver(w,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(w,y)}n.observe(e)}return c(!0),s}function Hu(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:i=!1}=r,l=Xn(e),a=o||s?[...l?Mt(l):[],...Mt(t)]:[];a.forEach(C=>{o&&C.addEventListener("scroll",n,{passive:!0}),s&&C.addEventListener("resize",n)});const d=l&&u?Bu(l,n):null;let m=-1,f=null;c&&(f=new ResizeObserver(C=>{let[E]=C;E&&E.target===l&&f&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var y;(y=f)==null||y.observe(t)})),n()}),l&&!i&&f.observe(l),f.observe(t));let h,v=i?it(e):null;i&&b();function b(){const C=it(e);v&&!si(v,C)&&n(),v=C,h=requestAnimationFrame(b)}return n(),()=>{var C;a.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),d==null||d(),(C=f)==null||C.disconnect(),f=null,i&&cancelAnimationFrame(h)}}const Jn=Jt,Uu=Cu,Vu=Su,zu=wu,Yu=Ou,Gu=(e,t,n)=>{const r=new Map,o={platform:Wu,...n},s={...o.platform,_c:r};return yu(e,t,{...o,platform:s})};var qu=typeof document<"u",Ku=function(){},en=qu?p.useLayoutEffect:Ku;function tn(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(!tn(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!tn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function li(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ai(e,t){const n=li(e);return Math.round(t*n)/n}function Zn(e){const t=N.useRef(e);return en(()=>{t.current=e}),t}function Xu(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:c}={},transform:u=!0,whileElementsMounted:i,open:l}=e,[a,d]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,f]=N.useState(r);tn(m,r)||f(r);const[h,v]=N.useState(null),[b,C]=N.useState(null),E=N.useCallback(T=>{T!==F.current&&(F.current=T,v(T))},[]),y=N.useCallback(T=>{T!==_.current&&(_.current=T,C(T))},[]),O=s||h,w=c||b,F=N.useRef(null),_=N.useRef(null),B=N.useRef(a),K=i!=null,A=Zn(i),j=Zn(o),re=Zn(l),U=N.useCallback(()=>{if(!F.current||!_.current)return;const T={placement:t,strategy:n,middleware:m};j.current&&(T.platform=j.current),Gu(F.current,_.current,T).then(H=>{const S={...H,isPositioned:re.current!==!1};R.current&&!tn(B.current,S)&&(B.current=S,Nt.flushSync(()=>{d(S)}))})},[m,t,n,j,re]);en(()=>{l===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,d(T=>({...T,isPositioned:!1})))},[l]);const R=N.useRef(!1);en(()=>(R.current=!0,()=>{R.current=!1}),[]),en(()=>{if(O&&(F.current=O),w&&(_.current=w),O&&w){if(A.current)return A.current(O,w,U);U()}},[O,w,U,A,K]);const X=N.useMemo(()=>({reference:F,floating:_,setReference:E,setFloating:y}),[E,y]),G=N.useMemo(()=>({reference:O,floating:w}),[O,w]),Q=N.useMemo(()=>{const T={position:n,left:0,top:0};if(!G.floating)return T;const H=ai(G.floating,a.x),S=ai(G.floating,a.y);return u?{...T,transform:"translate("+H+"px, "+S+"px)",...li(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:S}},[n,u,G.floating,a.x,a.y]);return N.useMemo(()=>({...a,update:U,refs:X,elements:G,floatingStyles:Q}),[a,U,X,G,Q])}const ui=(e,t)=>({...Uu(e),options:[e,t]}),Qu=(e,t)=>({...Vu(e),options:[e,t]}),Ju=(e,t)=>({...zu(e),options:[e,t]}),Zu=(e,t)=>({...Yu(e),options:[e,t]}),ci={...N},ec=ci.useInsertionEffect||(e=>e());function fi(e){const t=N.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return ec(()=>{t.current=e}),N.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 er=typeof document<"u"?p.useLayoutEffect:p.useEffect;let di=!1,tc=0;const pi=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+tc++;function nc(){const[e,t]=N.useState(()=>di?pi():void 0);return er(()=>{e==null&&t(pi())},[]),N.useEffect(()=>{di=!0},[]),e}const rc=ci.useId||nc;let _t;process.env.NODE_ENV!=="production"&&(_t=new Set);function oc(){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=_t)!=null&&e.has(o))){var s;(s=_t)==null||s.add(o),console.warn(o)}}function ic(){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=_t)!=null&&e.has(o))){var s;(s=_t)==null||s.add(o),console.error(o)}}function sc(){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 lc=N.createContext(null),ac=N.createContext(null),uc=()=>{var e;return((e=N.useContext(lc))==null?void 0:e.id)||null},cc=()=>N.useContext(ac),fc="data-floating-ui-focusable";function dc(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=rc(),s=N.useRef({}),[c]=N.useState(()=>sc()),u=uc()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!ve(f)&&ic("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[i,l]=N.useState(r.reference),a=fi((f,h,v)=>{s.current.openEvent=f?h:void 0,c.emit("openchange",{open:f,event:h,reason:v,nested:u}),n==null||n(f,h,v)}),d=N.useMemo(()=>({setPositionReference:l}),[]),m=N.useMemo(()=>({reference:i||r.reference||null,floating:r.floating||null,domReference:r.reference}),[i,r.reference,r.floating]);return N.useMemo(()=>({dataRef:s,open:t,onOpenChange:a,elements:m,events:c,floatingId:o,refs:d}),[t,a,m,c,o,d])}function pc(e){e===void 0&&(e={});const{nodeId:t}=e,n=dc({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,c]=N.useState(null),[u,i]=N.useState(null),a=(o==null?void 0:o.domReference)||s,d=N.useRef(null),m=cc();er(()=>{a&&(d.current=a)},[a]);const f=Xu({...e,elements:{...o,...u&&{reference:u}}}),h=N.useCallback(y=>{const O=ve(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;i(O),f.refs.setReference(O)},[f.refs]),v=N.useCallback(y=>{(ve(y)||y===null)&&(d.current=y,c(y)),(ve(f.refs.reference.current)||f.refs.reference.current===null||y!==null&&!ve(y))&&f.refs.setReference(y)},[f.refs]),b=N.useMemo(()=>({...f.refs,setReference:v,setPositionReference:h,domReference:d}),[f.refs,v,h]),C=N.useMemo(()=>({...f.elements,domReference:a}),[f.elements,a]),E=N.useMemo(()=>({...f,...r,refs:b,elements:C,nodeId:t}),[f,b,C,t,r]);return er(()=>{r.dataRef.current.floatingContext=E;const y=m==null?void 0:m.nodesRef.current.find(O=>O.id===t);y&&(y.context=E)}),N.useMemo(()=>({...f,context:E,refs:b,elements:C}),[f,b,C,E])}const mi="active",hi="selected";function tr(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[mi]:c,[hi]:u,...i}=e;s=i}return{...n==="floating"&&{tabIndex:-1,[fc]:""},...s,...t.map(c=>{const u=c?c[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((c,u)=>(u&&Object.entries(u).forEach(i=>{let[l,a]=i;if(!(o&&[mi,hi].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof a=="function"){var d;(d=r.get(l))==null||d.push(a),c[l]=function(){for(var m,f=arguments.length,h=new Array(f),v=0;v<f;v++)h[v]=arguments[v];return(m=r.get(l))==null?void 0:m.map(b=>b(...h)).find(b=>b!==void 0)}}}else c[l]=a}),c),{})}}function mc(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=N.useCallback(u=>tr(u,e,"reference"),t),s=N.useCallback(u=>tr(u,e,"floating"),n),c=N.useCallback(u=>tr(u,e,"item"),r);return N.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:c}),[o,s,c])}function gi(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const hc=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:s=0,index:c=0,minItemsVisible:u=4,referenceOverflowThreshold:i=0,scrollRef:l,...a}=mt(e,t),{rects:d,elements:{floating:m}}=t,f=n.current[c],h=(l==null?void 0:l.current)||m,v=m.clientTop||h.clientTop,b=m.clientTop!==0,C=h.clientTop!==0,E=m===h;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||oc('`placement` side must be "bottom" when using the `inner`',"middleware.")),!f)return{};const y={...t,...await ui(-f.offsetTop-m.clientTop-d.reference.height/2-f.offsetHeight/2-s).fn(t)},O=await Jn(gi(y,h.scrollHeight+v+m.clientTop),a),w=await Jn(y,{...a,elementContext:"reference"}),F=be(0,O.top),_=y.y+F,A=(h.scrollHeight>h.clientHeight?j=>j:At)(be(0,h.scrollHeight+(b&&E||C?v*2:0)-F-be(0,O.bottom)));if(h.style.maxHeight=A+"px",h.scrollTop=F,o){const j=h.offsetHeight<f.offsetHeight*ot(u,n.current.length)-1||w.top>=-i||w.bottom>=-i;Nt.flushSync(()=>o(j))}return r&&(r.current=await Jn(gi({...y,y:_},h.offsetHeight+v+m.clientTop),a)),{y:_}}});function gc(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:s,scrollRef:c,onChange:u}=t,i=fi(u),l=N.useRef(!1),a=N.useRef(null),d=N.useRef(null);N.useEffect(()=>{if(!o)return;function f(v){if(v.ctrlKey||!h||s.current==null)return;const b=v.deltaY,C=s.current.top>=-.5,E=s.current.bottom>=-.5,y=h.scrollHeight-h.clientHeight,O=b<0?-1:1,w=b<0?"max":"min";h.scrollHeight<=h.clientHeight||(!C&&b>0||!E&&b<0?(v.preventDefault(),Nt.flushSync(()=>{i(F=>F+Math[w](b,y*O))})):/firefox/i.test(lu())&&(h.scrollTop+=b))}const h=(c==null?void 0:c.current)||r.floating;if(n&&h)return h.addEventListener("wheel",f),requestAnimationFrame(()=>{a.current=h.scrollTop,s.current!=null&&(d.current={...s.current})}),()=>{a.current=null,d.current=null,h.removeEventListener("wheel",f)}},[o,n,r.floating,s,c,i]);const m=N.useMemo(()=>({onKeyDown(){l.current=!0},onWheel(){l.current=!1},onPointerMove(){l.current=!1},onScroll(){const f=(c==null?void 0:c.current)||r.floating;if(!(!s.current||!f||!l.current)){if(a.current!==null){const h=f.scrollTop-a.current;(s.current.bottom<-.5&&h<-1||s.current.top<-.5&&h>1)&&Nt.flushSync(()=>i(v=>v+h))}requestAnimationFrame(()=>{a.current=f.scrollTop})}}}),[r.floating,i,s,c]);return N.useMemo(()=>o?{floating:m}:{},[o,m])}let gt=p.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});gt.displayName="FloatingContext";let nr=p.createContext(null);nr.displayName="PlacementContext";function vc(e){return p.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function bc(){return p.useContext(gt).setReference}function yc(){return p.useContext(gt).getReferenceProps}function wc(){let{getFloatingProps:e,slot:t}=p.useContext(gt);return p.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function Ec(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=p.useContext(nr),n=p.useMemo(()=>e,[JSON.stringify(e,(o,s)=>{var c;return(c=s==null?void 0:s.outerHTML)!=null?c:s})]);ue(()=>{t==null||t(n??null)},[t,n]);let r=p.useContext(gt);return p.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let vi=4;function xc({children:e,enabled:t=!0}){let[n,r]=p.useState(null),[o,s]=p.useState(0),c=p.useRef(null),[u,i]=p.useState(null);Cc(u);let l=t&&n!==null&&u!==null,{to:a="bottom",gap:d=0,offset:m=0,padding:f=0,inner:h}=Sc(n,u),[v,b="center"]=a.split(" ");ue(()=>{l&&s(0)},[l]);let{refs:C,floatingStyles:E,context:y}=pc({open:l,placement:v==="selection"?b==="center"?"bottom":`bottom-${b}`:b==="center"?`${v}`:`${v}-${b}`,strategy:"absolute",transform:!1,middleware:[ui({mainAxis:v==="selection"?0:d,crossAxis:m}),Qu({padding:f}),v!=="selection"&&Ju({padding:f}),v==="selection"&&h?hc({...h,padding:f,overflowRef:c,offset:o,minItemsVisible:vi,referenceOverflowThreshold:f,onFallbackChange(j){var re,U;if(!j)return;let R=y.elements.floating;if(!R)return;let X=parseFloat(getComputedStyle(R).scrollPaddingBottom)||0,G=Math.min(vi,R.childElementCount),Q=0,T=0;for(let H of(U=(re=y.elements.floating)==null?void 0:re.childNodes)!=null?U:[])if(Ve(H)){let S=H.offsetTop,M=S+H.clientHeight+X,k=R.scrollTop,I=k+R.clientHeight;if(S>=k&&M<=I)G--;else{T=Math.max(0,Math.min(M,I)-Math.max(S,k)),Q=H.clientHeight;break}}G>=1&&s(H=>{let S=Q*G-T+X;return H>=S?H:S})}}):null,Zu({padding:f,apply({availableWidth:j,availableHeight:re,elements:U}){Object.assign(U.floating.style,{overflow:"auto",maxWidth:`${j}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${re}px)`})}})].filter(Boolean),whileElementsMounted:Hu}),[O=v,w=b]=y.placement.split("-");v==="selection"&&(O="selection");let F=p.useMemo(()=>({anchor:[O,w].filter(Boolean).join(" ")}),[O,w]),_=gc(y,{overflowRef:c,onChange:s}),{getReferenceProps:B,getFloatingProps:K}=mc([_]),A=ne(j=>{i(j),C.setFloating(j)});return N.createElement(nr.Provider,{value:r},N.createElement(gt.Provider,{value:{setFloating:A,setReference:C.setReference,styles:E,getReferenceProps:B,getFloatingProps:K,slot:F}},e))}function Cc(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 Sc(e,t){var n,r,o;let s=rr((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),c=rr((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),u=rr((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:c,padding:u}}function rr(e,t,n=void 0){let r=ut(),o=ne((i,l)=>{if(i==null)return[n,null];if(typeof i=="number")return[i,null];if(typeof i=="string"){if(!l)return[n,null];let a=yi(i,l);return[a,d=>{let m=bi(i);{let f=m.map(h=>window.getComputedStyle(l).getPropertyValue(h));r.requestAnimationFrame(function h(){r.nextFrame(h);let v=!1;for(let[C,E]of m.entries()){let y=window.getComputedStyle(l).getPropertyValue(E);if(f[C]!==y){f[C]=y,v=!0;break}}if(!v)return;let b=yi(i,l);a!==b&&(d(b),a=b)})}return r.dispose}]}return[n,null]}),s=p.useMemo(()=>o(e,t)[0],[e,t]),[c=s,u]=p.useState();return ue(()=>{let[i,l]=o(e,t);if(u(i),!!l)return l(u)},[e,t]),c}function bi(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,...bi(o)]:[r]}return[]}function yi(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 Oc(e,t){let[n,r]=p.useState(t);return!e&&n!==t&&r(t),e?n:t}let or=p.createContext(null);or.displayName="OpenClosedContext";var Ne=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Ne||{});function ir(){return p.useContext(or)}function wi({value:e,children:t}){return p.createElement(or.Provider,{value:e},t)}function Tc(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 nn(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let s=0;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 1:{o===-1&&(o=n.length);for(let s=o-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 2:{for(let s=o+1;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 3:{for(let s=n.length-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 4:{for(let s=0;s<n.length;++s)if(t.resolveId(n[s],s,n)===e.id)return s;return r}case 5:return null;default:Tc(e)}}var Ei=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Ei||{});function xi(e){let t=ne(e),n=p.useRef(!1);p.useEffect(()=>(n.current=!1,()=>{n.current=!0,to(()=>{n.current&&t()})}),[t])}function $c(){let e=typeof document>"u";return"useSyncExternalStore"in N?(t=>t.useSyncExternalStore)(N)(()=>()=>{},()=>!1,()=>!e):!1}function sr(){let e=$c(),[t,n]=N.useState(Ie.isHandoffComplete);return t&&Ie.isHandoffComplete===!1&&n(!1),N.useEffect(()=>{t!==!0&&n(!0)},[t]),N.useEffect(()=>Ie.handoff(),[]),e?!1:t}let Pc=p.createContext(!1);function Mc(){return p.useContext(Pc)}function Ac(e){let t=Mc(),n=p.useContext(Si),[r,o]=p.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(Ie.isServer)return null;let c=e==null?void 0:e.getElementById("headlessui-portal-root");if(c)return c;if(e===null)return null;let u=e.createElement("div");return u.setAttribute("id","headlessui-portal-root"),e.body.appendChild(u)});return p.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),p.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let Ci=p.Fragment,Dc=xe(function(e,t){let{ownerDocument:n=null,...r}=e,o=p.useRef(null),s=Pe(Kl(f=>{o.current=f}),t),c=zn(o),u=n??c,i=Ac(u),[l]=p.useState(()=>{var f;return Ie.isServer?null:(f=u==null?void 0:u.createElement("div"))!=null?f:null}),a=p.useContext(Nc),d=sr();ue(()=>{!i||!l||i.contains(l)||(l.setAttribute("data-headlessui-portal",""),i.appendChild(l))},[i,l]),ue(()=>{if(l&&a)return a.register(l)},[a,l]),xi(()=>{var f;!i||!l||(_n(l)&&i.contains(l)&&i.removeChild(l),i.childNodes.length<=0&&((f=i.parentElement)==null||f.removeChild(i)))});let m=Se();return d?!i||!l?null:Ee.createPortal(m({ourProps:{ref:s},theirProps:r,slot:{},defaultTag:Ci,name:"Portal"}),l):null});function _c(e,t){let n=Pe(t),{enabled:r=!0,ownerDocument:o,...s}=e,c=Se();return r?p.createElement(Dc,{...s,ownerDocument:o,ref:n}):c({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:Ci,name:"Portal"})}let Fc=p.Fragment,Si=p.createContext(null);function Lc(e,t){let{target:n,...r}=e,o={ref:Pe(t)},s=Se();return p.createElement(Si.Provider,{value:n},s({ourProps:o,theirProps:r,defaultTag:Fc,name:"Popover.Group"}))}let Nc=p.createContext(null),Ic=xe(_c),jc=xe(Lc),kc=Object.assign(Ic,{Group:jc});function Rc(){let e=p.useRef(!1);return ue(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Oi(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:$i)!==p.Fragment||p.Children.count(e.children)===1}let rn=p.createContext(null);rn.displayName="TransitionContext";var Wc=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Wc||{});function Bc(){let e=p.useContext(rn);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Hc(){let e=p.useContext(on);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let on=p.createContext(null);on.displayName="NestingContext";function sn(e){return"children"in e?sn(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Ti(e,t){let n=nt(e),r=p.useRef([]),o=Rc(),s=ut(),c=ne((f,h=qe.Hidden)=>{let v=r.current.findIndex(({el:b})=>b===f);v!==-1&&($e(h,{[qe.Unmount](){r.current.splice(v,1)},[qe.Hidden](){r.current[v].state="hidden"}}),s.microTask(()=>{var b;!sn(r)&&o.current&&((b=n.current)==null||b.call(n))}))}),u=ne(f=>{let h=r.current.find(({el:v})=>v===f);return h?h.state!=="visible"&&(h.state="visible"):r.current.push({el:f,state:"visible"}),()=>c(f,qe.Unmount)}),i=p.useRef([]),l=p.useRef(Promise.resolve()),a=p.useRef({enter:[],leave:[]}),d=ne((f,h,v)=>{i.current.splice(0),t&&(t.chains.current[h]=t.chains.current[h].filter(([b])=>b!==f)),t==null||t.chains.current[h].push([f,new Promise(b=>{i.current.push(b)})]),t==null||t.chains.current[h].push([f,new Promise(b=>{Promise.all(a.current[h].map(([C,E])=>E)).then(()=>b())})]),h==="enter"?l.current=l.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(h)):v(h)}),m=ne((f,h,v)=>{Promise.all(a.current[h].splice(0).map(([b,C])=>C)).then(()=>{var b;(b=i.current.shift())==null||b()}).then(()=>v(h))});return p.useMemo(()=>({children:r,register:u,unregister:c,onStart:d,onStop:m,wait:l,chains:a}),[u,c,r,d,m,a,l])}let $i=p.Fragment,Pi=Bt.RenderStrategy;function Uc(e,t){var n,r;let{transition:o=!0,beforeEnter:s,afterEnter:c,beforeLeave:u,afterLeave:i,enter:l,enterFrom:a,enterTo:d,entered:m,leave:f,leaveFrom:h,leaveTo:v,...b}=e,[C,E]=p.useState(null),y=p.useRef(null),O=Oi(e),w=Pe(...O?[y,t,E]:t===null?[]:[t]),F=(n=b.unmount)==null||n?qe.Unmount:qe.Hidden,{show:_,appear:B,initial:K}=Bc(),[A,j]=p.useState(_?"visible":"hidden"),re=Hc(),{register:U,unregister:R}=re;ue(()=>U(y),[U,y]),ue(()=>{if(F===qe.Hidden&&y.current){if(_&&A!=="visible"){j("visible");return}return $e(A,{hidden:()=>R(y),visible:()=>U(y)})}},[A,y,U,R,_,F]);let X=sr();ue(()=>{if(O&&X&&A==="visible"&&y.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[y,A,X,O]);let G=K&&!B,Q=B&&_&&K,T=p.useRef(!1),H=Ti(()=>{T.current||(j("hidden"),R(y))},re),S=ne(P=>{T.current=!0;let W=P?"enter":"leave";H.onStart(y,W,z=>{z==="enter"?s==null||s():z==="leave"&&(u==null||u())})}),M=ne(P=>{let W=P?"enter":"leave";T.current=!1,H.onStop(y,W,z=>{z==="enter"?c==null||c():z==="leave"&&(i==null||i())}),W==="leave"&&!sn(H)&&(j("hidden"),R(y))});p.useEffect(()=>{O&&o||(S(_),M(_))},[_,O,o]);let k=!(!o||!O||!X||G),[,I]=Bo(k,C,_,{start:S,end:M}),V=Ke({ref:w,className:((r=Mn(b.className,Q&&l,Q&&a,I.enter&&l,I.enter&&I.closed&&a,I.enter&&!I.closed&&d,I.leave&&f,I.leave&&!I.closed&&h,I.leave&&I.closed&&v,!I.transition&&_&&m))==null?void 0:r.trim())||void 0,...Wo(I)}),J=0;A==="visible"&&(J|=Ne.Open),A==="hidden"&&(J|=Ne.Closed),_&&A==="hidden"&&(J|=Ne.Opening),!_&&A==="visible"&&(J|=Ne.Closing);let q=Se();return p.createElement(on.Provider,{value:H},p.createElement(wi,{value:J},q({ourProps:V,theirProps:b,defaultTag:$i,features:Pi,visible:A==="visible",name:"Transition.Child"})))}function Vc(e,t){let{show:n,appear:r=!1,unmount:o=!0,...s}=e,c=p.useRef(null),u=Oi(e),i=Pe(...u?[c,t]:t===null?[]:[t]);sr();let l=ir();if(n===void 0&&l!==null&&(n=(l&Ne.Open)===Ne.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[a,d]=p.useState(n?"visible":"hidden"),m=Ti(()=>{n||d("hidden")}),[f,h]=p.useState(!0),v=p.useRef([n]);ue(()=>{f!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),h(!1))},[v,n]);let b=p.useMemo(()=>({show:n,appear:r,initial:f}),[n,r,f]);ue(()=>{n?d("visible"):!sn(m)&&c.current!==null&&d("hidden")},[n,m]);let C={unmount:o},E=ne(()=>{var w;f&&h(!1),(w=e.beforeEnter)==null||w.call(e)}),y=ne(()=>{var w;f&&h(!1),(w=e.beforeLeave)==null||w.call(e)}),O=Se();return p.createElement(on.Provider,{value:m},p.createElement(rn.Provider,{value:b},O({ourProps:{...C,as:p.Fragment,children:p.createElement(Mi,{ref:i,...C,...s,beforeEnter:E,beforeLeave:y})},theirProps:{},defaultTag:p.Fragment,features:Pi,visible:a==="visible",name:"Transition"})))}function zc(e,t){let n=p.useContext(rn)!==null,r=ir()!==null;return p.createElement(p.Fragment,null,!n&&r?p.createElement(lr,{ref:t,...e}):p.createElement(Mi,{ref:t,...e}))}let lr=xe(Vc),Mi=xe(Uc),Yc=xe(zc),Ai=Object.assign(lr,{Child:Yc,Root:lr});function Gc(e,t){let n=p.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 Di=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function _i(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!Ve(o))return r;let s=!1;for(let u of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))u.remove(),s=!0;let c=s?(n=o.innerText)!=null?n:"":r;return Di.test(c)&&(c=c.replace(Di,"")),c}function qc(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(o=>{let s=document.getElementById(o);if(s){let c=s.getAttribute("aria-label");return typeof c=="string"?c.trim():_i(s).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return _i(e).trim()}function Kc(e){let t=p.useRef(""),n=p.useRef("");return ne(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let s=qc(r).trim().toLowerCase();return t.current=o,n.current=s,s})}var Xc=Object.defineProperty,Qc=(e,t,n)=>t in e?Xc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fi=(e,t,n)=>(Qc(e,typeof t!="symbol"?t+"":t,n),n),ge=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ge||{}),Be=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Be||{}),ln=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(ln||{}),Li=(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))(Li||{});function Ni(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=_o(t(e.options.slice()),s=>s.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let Jc={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(s=>r(s.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,s,c;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(a=>a.id===t.id)};if(t.focus===fe.Previous){let a=e.activeOptionIndex;if(a!==null){let d=e.options[a].dataRef.current.domRef,m=nn(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(m!==null){let f=e.options[m].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:m}}}}else if(t.focus===fe.Next){let a=e.activeOptionIndex;if(a!==null){let d=e.options[a].dataRef.current.domRef,m=nn(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(m!==null){let f=e.options[m].dataRef.current.domRef;if(((s=d.current)==null?void 0:s.nextElementSibling)===f.current||((c=f.current)==null?void 0:c.nextElementSibling)===null)return{...u,activeOptionIndex:m}}}}let i=Ni(e),l=nn(t,{resolveItems:()=>i.options,resolveActiveIndex:()=>i.activeOptionIndex,resolveId:a=>a.id,resolveDisabled:a=>a.dataRef.current.disabled});return{...u,...i,activeOptionIndex:l}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(c=>{var u;return!c.dataRef.current.disabled&&((u=c.dataRef.current.textValue)==null?void 0:u.startsWith(r))}),s=o?e.options.indexOf(o):-1;return s===-1||s===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:s,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,t)=>{let n=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==fe.Nothing&&(r=nn(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let s=n.findIndex(c=>o==null?void 0:o(c.dataRef.current.value));s!==-1&&(r=s)}}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[s,c]of n.entries())if(o.has(c.id)&&(r.push(s),o.delete(c.id),o.size===0))break;if(r.length>0){n=n.slice();for(let s of r.reverse())n.splice(s,1)}return{...e,options:n,activationTrigger:1}},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,...Ni(e),pendingShouldSort:!1}:e};class ar extends wo{constructor(t){super(t),Fi(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:s,value:c}=this.state.dataRef.current;return $e(s,{0:()=>r==null?void 0:r(n),1:()=>{let u=c.slice(),i=u.findIndex(l=>o(l,n));return i===-1?u.push(n):u.splice(i,1),r==null?void 0:r(u)}})},registerOption:In(()=>{let n=[],r=new Set;return[(o,s)=>{r.has(s)||(r.add(s),n.push({id:o,dataRef:s}))},()=>(r.clear(),this.send({type:5,options:n.splice(0)}))]}),unregisterOption:In(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:6,options:n.splice(0)})}]}),goToOption:In(()=>{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})}}),Fi(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,s=n.options;return o===null||(r=s[o])==null?void 0:r.id},isActive(n,r){var o;let s=n.activeOptionIndex,c=n.options;return s!==null?((o=c[s])==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=jn.get(null);this.disposables.add(r.on(So.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 ar({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,Jc,t,n)}}const Ii=p.createContext(null);function ur(e){let t=p.useContext(Ii);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ji),n}return t}function ji({id:e,__demoMode:t=!1}){let n=p.useMemo(()=>ar.new({id:e,__demoMode:t}),[]);return xi(()=>n.dispose()),n}let an=p.createContext(null);an.displayName="ListboxDataContext";function Ft(e){let t=p.useContext(an);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ft),n}return t}let Zc=p.Fragment;function ef(e,t){let n=p.useId(),r=Pn(),{value:o,defaultValue:s,form:c,name:u,onChange:i,by:l,invalid:a=!1,disabled:d=r||!1,horizontal:m=!1,multiple:f=!1,__demoMode:h=!1,...v}=e;const b=m?"horizontal":"vertical";let C=Pe(t),E=Ll(s),[y=f?[]:void 0,O]=Fl(o,i,E),w=ji({id:n,__demoMode:h}),F=p.useRef({static:!1,hold:!1}),_=p.useRef(new Map),B=sa(l),K=p.useCallback(k=>$e(A.mode,{[Be.Multi]:()=>y.some(I=>B(I,k)),[Be.Single]:()=>B(y,k)}),[y]),A=p.useMemo(()=>({value:y,disabled:d,invalid:a,mode:f?Be.Multi:Be.Single,orientation:b,onChange:O,compare:B,isSelected:K,optionsPropsRef:F,listRef:_}),[y,d,a,f,b,O,B,K,F,_]);ue(()=>{w.state.dataRef.current=A},[A]);let j=Ae(w,k=>k.listboxState),re=jn.get(null),U=Ae(re,p.useCallback(k=>re.selectors.isTop(k,n),[re,n])),[R,X]=Ae(w,k=>[k.buttonElement,k.optionsElement]);Fa(U,[R,X],(k,I)=>{w.send({type:Li.CloseListbox}),Do(I,Vn.Loose)||(k.preventDefault(),R==null||R.focus())});let G=p.useMemo(()=>({open:j===ge.Open,disabled:d,invalid:a,value:y}),[j,d,a,y]),[Q,T]=ea({inherit:!0}),H={ref:C},S=p.useCallback(()=>{if(E!==void 0)return O==null?void 0:O(E)},[O,E]),M=Se();return p.createElement(T,{value:Q,props:{htmlFor:R==null?void 0:R.id},slot:{open:j===ge.Open,disabled:d}},p.createElement(xc,null,p.createElement(Ii.Provider,{value:w},p.createElement(an.Provider,{value:A},p.createElement(wi,{value:$e(j,{[ge.Open]:Ne.Open,[ge.Closed]:Ne.Closed})},u!=null&&y!=null&&p.createElement(Wl,{disabled:d,data:{[u]:y},form:c,onReset:S}),M({ourProps:H,theirProps:v,slot:G,defaultTag:Zc,name:"Listbox"}))))))}let tf="button";function nf(e,t){let n=p.useId(),r=ao(),o=Ft("Listbox.Button"),s=ur("Listbox.Button"),{id:c=r||`headlessui-listbox-button-${n}`,disabled:u=o.disabled||!1,autoFocus:i=!1,...l}=e,a=Pe(t,bc(),s.actions.setButtonElement),d=yc(),[m,f,h]=Ae(s,T=>[T.listboxState,T.buttonElement,T.optionsElement]),v=m===ge.Open;Ia(v,{trigger:f,action:p.useCallback(T=>{if(f!=null&&f.contains(T.target))return zt.Ignore;let H=T.target.closest('[role="option"]:not([data-disabled])');return Ve(H)?zt.Select(H):h!=null&&h.contains(T.target)?zt.Ignore:zt.Close},[f,h]),close:s.actions.closeListbox,select:s.actions.selectActiveOption});let b=ne(T=>{switch(T.key){case he.Enter:Nl(T.currentTarget);break;case he.Space:case he.ArrowDown:T.preventDefault(),s.actions.openListbox({focus:o.value?fe.Nothing:fe.First});break;case he.ArrowUp:T.preventDefault(),s.actions.openListbox({focus:o.value?fe.Nothing:fe.Last});break}}),C=ne(T=>{switch(T.key){case he.Space:T.preventDefault();break}}),E=ne(T=>{var H;if(T.button===Ei.Left){if(Gl(T.currentTarget))return T.preventDefault();s.state.listboxState===ge.Open?(Ee.flushSync(()=>s.actions.closeListbox()),(H=s.state.buttonElement)==null||H.focus({preventScroll:!0})):(T.preventDefault(),s.actions.openListbox({focus:fe.Nothing}))}}),y=p.useRef(null),O=ne(T=>{y.current=T.pointerType,T.pointerType==="mouse"&&E(T)}),w=ne(T=>{y.current!=="mouse"&&E(T)}),F=ne(T=>T.preventDefault()),_=go([c]),B=Xl(),{isFocusVisible:K,focusProps:A}=El({autoFocus:i}),{isHovered:j,hoverProps:re}=wl({isDisabled:u}),{pressed:U,pressProps:R}=$l({disabled:u}),X=p.useMemo(()=>({open:m===ge.Open,active:U||m===ge.Open,disabled:u,invalid:o.invalid,value:o.value,hover:j,focus:K,autofocus:i}),[m,o.value,u,j,K,U,o.invalid,i]),G=Ae(s,T=>T.listboxState===ge.Open),Q=ro(d(),{ref:a,id:c,type:ja(e,f),"aria-haspopup":"listbox","aria-controls":h==null?void 0:h.id,"aria-expanded":G,"aria-labelledby":_,"aria-describedby":B,disabled:u||void 0,autoFocus:i,onKeyDown:b,onKeyUp:C,onKeyPress:F,onPointerDown:O,onClick:w},A,re,R);return Se()({ourProps:Q,theirProps:l,slot:X,defaultTag:tf,name:"Listbox.Button"})}let ki=p.createContext(!1),rf="div",of=Bt.RenderStrategy|Bt.Static;function sf(e,t){let n=p.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:s=!1,modal:c=!0,transition:u=!1,...i}=e,l=vc(o),[a,d]=p.useState(null);l&&(s=!0);let m=Ft("Listbox.Options"),f=ur("Listbox.Options"),[h,v,b,C]=Ae(f,P=>[P.listboxState,P.buttonElement,P.optionsElement,P.__demoMode]),E=zn(v),y=zn(b),O=ir(),[w,F]=Bo(u,a,O!==null?(O&Ne.Open)===Ne.Open:h===ge.Open);Ea(w,v,f.actions.closeListbox);let _=C?!1:c&&h===ge.Open;za(_,y);let B=C?!1:c&&h===ge.Open;wa(B,{allowed:p.useCallback(()=>[v,b],[v,b])});let K=h!==ge.Open,A=Gc(K,v)?!1:w,j=w&&h===ge.Closed,re=Oc(j,m.value),U=ne(P=>m.compare(re,P)),R=Ae(f,P=>{var W;if(l==null||!((W=l==null?void 0:l.to)!=null&&W.includes("selection")))return null;let z=P.options.findIndex(Z=>U(Z.dataRef.current.value));return z===-1&&(z=0),z}),X=(()=>{if(l==null)return;if(R===null)return{...l,inner:void 0};let P=Array.from(m.listRef.current.values());return{...l,inner:{listRef:{current:P},index:R}}})(),[G,Q]=Ec(X),T=wc(),H=Pe(t,l?G:null,f.actions.setOptionsElement,d),S=ut();p.useEffect(()=>{var P;let W=b;W&&h===ge.Open&&W!==((P=St(W))==null?void 0:P.activeElement)&&(W==null||W.focus({preventScroll:!0}))},[h,b]);let M=ne(P=>{var W,z;switch(S.dispose(),P.key){case he.Space:if(f.state.searchQuery!=="")return P.preventDefault(),P.stopPropagation(),f.actions.search(P.key);case he.Enter:if(P.preventDefault(),P.stopPropagation(),f.state.activeOptionIndex!==null){let{dataRef:Z}=f.state.options[f.state.activeOptionIndex];f.actions.onChange(Z.current.value)}m.mode===Be.Single&&(Ee.flushSync(()=>f.actions.closeListbox()),(W=f.state.buttonElement)==null||W.focus({preventScroll:!0}));break;case $e(m.orientation,{vertical:he.ArrowDown,horizontal:he.ArrowRight}):return P.preventDefault(),P.stopPropagation(),f.actions.goToOption({focus:fe.Next});case $e(m.orientation,{vertical:he.ArrowUp,horizontal:he.ArrowLeft}):return P.preventDefault(),P.stopPropagation(),f.actions.goToOption({focus:fe.Previous});case he.Home:case he.PageUp:return P.preventDefault(),P.stopPropagation(),f.actions.goToOption({focus:fe.First});case he.End:case he.PageDown:return P.preventDefault(),P.stopPropagation(),f.actions.goToOption({focus:fe.Last});case he.Escape:P.preventDefault(),P.stopPropagation(),Ee.flushSync(()=>f.actions.closeListbox()),(z=f.state.buttonElement)==null||z.focus({preventScroll:!0});return;case he.Tab:P.preventDefault(),P.stopPropagation(),Ee.flushSync(()=>f.actions.closeListbox()),Ma(f.state.buttonElement,P.shiftKey?Un.Previous:Un.Next);break;default:P.key.length===1&&(f.actions.search(P.key),S.setTimeout(()=>f.actions.clearSearch(),350));break}}),k=Ae(f,P=>{var W;return(W=P.buttonElement)==null?void 0:W.id}),I=p.useMemo(()=>({open:h===ge.Open}),[h]),V=ro(l?T():{},{id:r,ref:H,"aria-activedescendant":Ae(f,f.selectors.activeDescendantId),"aria-multiselectable":m.mode===Be.Multi?!0:void 0,"aria-labelledby":k,"aria-orientation":m.orientation,onKeyDown:M,role:"listbox",tabIndex:h===ge.Open?0:void 0,style:{...i.style,...Q,"--button-width":aa(v,!0).width},...Wo(F)}),J=Se(),q=p.useMemo(()=>m.mode===Be.Multi?m:{...m,isSelected:U},[m,U]);return p.createElement(kc,{enabled:s?e.static||w:!1,ownerDocument:E},p.createElement(an.Provider,{value:q},J({ourProps:V,theirProps:i,slot:I,defaultTag:rf,features:of,visible:A,name:"Listbox.Options"})))}let lf="div";function af(e,t){let n=p.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:s,...c}=e,u=p.useContext(ki)===!0,i=Ft("Listbox.Option"),l=ur("Listbox.Option"),a=Ae(l,A=>l.selectors.isActive(A,r)),d=i.isSelected(s),m=p.useRef(null),f=Kc(m),h=nt({disabled:o,value:s,domRef:m,get textValue(){return f()}}),v=Pe(t,m,A=>{A?i.listRef.current.set(r,A):i.listRef.current.delete(r)}),b=Ae(l,A=>l.selectors.shouldScrollIntoView(A,r));ue(()=>{if(b)return Fe().requestAnimationFrame(()=>{var A,j;(j=(A=m.current)==null?void 0:A.scrollIntoView)==null||j.call(A,{block:"nearest"})})},[b,m]),ue(()=>{if(!u)return l.actions.registerOption(r,h),()=>l.actions.unregisterOption(r)},[h,r,u]);let C=ne(A=>{var j;if(o)return A.preventDefault();l.actions.onChange(s),i.mode===Be.Single&&(Ee.flushSync(()=>l.actions.closeListbox()),(j=l.state.buttonElement)==null||j.focus({preventScroll:!0}))}),E=ne(()=>{if(o)return l.actions.goToOption({focus:fe.Nothing});l.actions.goToOption({focus:fe.Specific,id:r})}),y=Ya(),O=ne(A=>y.update(A)),w=ne(A=>{y.wasMoved(A)&&(o||a&&l.state.activationTrigger===ln.Pointer||l.actions.goToOption({focus:fe.Specific,id:r},ln.Pointer))}),F=ne(A=>{y.wasMoved(A)&&(o||a&&l.state.activationTrigger===ln.Pointer&&l.actions.goToOption({focus:fe.Nothing}))}),_=p.useMemo(()=>({active:a,focus:a,selected:d,disabled:o,selectedOption:d&&u}),[a,d,o,u]),B=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:C,onFocus:E,onPointerEnter:O,onMouseEnter:O,onPointerMove:w,onMouseMove:w,onPointerLeave:F,onMouseLeave:F},K=Se();return!d&&u?null:K({ourProps:B,theirProps:c,slot:_,defaultTag:lf,name:"Listbox.Option"})}let uf=p.Fragment;function cf(e,t){let{options:n,placeholder:r,...o}=e,s={ref:Pe(t)},c=Ft("ListboxSelectedOption"),u=p.useMemo(()=>({}),[]),i=c.value===void 0||c.value===null||c.mode===Be.Multi&&Array.isArray(c.value)&&c.value.length===0,l=Se();return p.createElement(ki.Provider,{value:!0},l({ourProps:s,theirProps:{...o,children:p.createElement(p.Fragment,null,r&&i?r:n)},slot:u,defaultTag:uf,name:"ListboxSelectedOption"}))}let ff=xe(ef),df=xe(nf),pf=oa,mf=xe(sf),hf=xe(af),gf=xe(cf),Je=Object.assign(ff,{Button:df,Label:pf,Options:mf,Option:hf,SelectedOption:gf});function vf({title:e,titleId:t,...n},r){return N.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?N.createElement("title",{id:t},e):null,N.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 Ri=N.forwardRef(vf);function bf({title:e,titleId:t,...n},r){return N.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?N.createElement("title",{id:t},e):null,N.createElement("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const Wi=N.forwardRef(bf),Bi=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o=""})=>(p.useEffect(()=>{console.log("🔗 ChainSelector: selectedChain updated",t)},[t]),x.jsx("div",{className:`relative ${o}`,children:x.jsx(Je,{value:t,onChange:n,disabled:r,children:({open:s})=>x.jsxs(x.Fragment,{children:[x.jsxs(Je.Button,{className:`
|
|
79
|
+
*/var Ti;function qu(){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;Tr.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(j){if(!M){if(M=!0,w=j,j=d(j),p!==void 0&&g.hasValue){var k=g.value;if(p(k,j))return N=k}return N=j}if(k=N,n(w,j))return k;var B=d(j);return p!==void 0&&p(k,B)?(w=j,k):(w=j,N=B)}var M=!1,w,N,F=c===void 0?null:c;return[function(){return E(a())},F===null?void 0:function(){return E(F())}]},[a,c,d,p]);var v=r(s,f[0],f[1]);return i(function(){g.hasValue=!0,g.value=v},[v]),u(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Tr}process.env.NODE_ENV==="production"?Cr.exports=Ku():Cr.exports=qu();var Xu=Cr.exports;function Ue(e,t,n=wi){return Xu.useSyncExternalStoreWithSelector(ne(r=>e.subscribe(Qu,r)),ne(()=>e.state),ne(()=>e.state),ne(t),n)}function Qu(e){return e}function Ni(e,t){let n=m.useId(),r=Sr.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 Nr=new Map,Qt=new Map;function Li(e){var t;let n=(t=Qt.get(e))!=null?t:0;return Qt.set(e,n+1),n!==0?()=>Pi(e):(Nr.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Pi(e))}function Pi(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=Nr.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Nr.delete(e))}function Zu(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(Li(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(Li(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 Lr=["[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(","),ec=["[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||{}),tc=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(tc||{}),nc=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(nc||{});function Di(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Lr)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function rc(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(ec)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Dr=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Dr||{});function $i(e,t=0){var n;return e===((n=Kt(e))==null?void 0:n.body)?!1:_e(t,{0(){return e.matches(Lr)},1(){let r=e;for(;r!==null;){if(r.matches(Lr))return!0;r=r.parentElement}return!1}})}var oc=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(oc||{});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 ic=["textarea","input"].join(",");function sc(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,ic))!=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 lc(e,t){return ac(Di(),t,{relativeTo:e})}function ac(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?rc(e):Di(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&&sc(p)&&p.select(),2}function Mi(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function uc(){return/Android/gi.test(window.navigator.userAgent)}function Ii(){return Mi()||uc()}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 cc(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 fc(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,Dr.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,()=>At(u.target)?u.target:null)},!0),cc(e,"blur",u=>o(u,()=>Eu(window.document.activeElement)?window.document.activeElement:null),!0)}function $r(...e){return m.useMemo(()=>Kt(...e),[...e])}var dc=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(dc||{});const xn={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},pc=200,Fi=5;function mc(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=>{br(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,!At(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>pc&&(o(p.target),r());break}case 2:{r();break}}},{capture:!0})}function hc(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 gc(e){return m.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function vc(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 bc(){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 yc(){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(At(u.target))try{let s=u.target.closest("a");if(!s)return;let{hash:a}=new URL(s.href),c=e.querySelector(a);At(c)&&!r(c)&&(l=c)}catch{}},!0),t.addEventListener(e,"touchstart",u=>{if(At(u.target)&&wu(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(At(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 wc(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Tt=vc(()=>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:wc(n)},o=[yc(),bc(),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 Ec(e,t,n=()=>({containers:[]})){let r=gc(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 Sc(e,t,n=()=>[document.body]){let r=Ni(e,"scroll-lock");Ec(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function Ri(e){return[e.screenX,e.screenY]}function Cc(){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 Oc(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 Tc=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Tc||{});function Bi(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Wi(e,t,n,r){let[o,i]=m.useState(n),{hasFlag:l,addFlag:u,removeFlag:s}=Oc(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),Nc(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 Nc(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(Lc(e,r))})}),i.dispose}function Lc(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 Ar(e)?(e.nodeName||"").toLowerCase():"#document"}function Le(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Je(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 Le(e).Node:!1}function oe(e){return wn()?e instanceof Element||e instanceof Le(e).Element:!1}function Ce(e){return wn()?e instanceof HTMLElement||e instanceof Le(e).HTMLElement:!1}function Mr(e){return!wn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Le(e).ShadowRoot}const Dc=new Set(["inline","contents"]);function Zt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ve(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Dc.has(o)}const $c=new Set(["table","td","th"]);function Ac(e){return $c.has(It(e))}const Mc=[":popover-open",":modal"];function En(e){return Mc.some(t=>{try{return e.matches(t)}catch{return!1}})}const Ic=["transform","translate","scale","rotate","perspective"],jc=["transform","translate","scale","rotate","perspective","filter"],Fc=["paint","layout","strict","content"];function Ir(e){const t=Sn(),n=oe(e)?Ve(e):e;return Ic.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)||jc.some(r=>(n.willChange||"").includes(r))||Fc.some(r=>(n.contain||"").includes(r))}function Rc(e){let t=ct(e);for(;Ce(t)&&!ut(t);){if(Ir(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 kc=new Set(["html","body","#document"]);function ut(e){return kc.has(It(e))}function Ve(e){return Le(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||Mr(e)&&e.host||Je(e);return Mr(t)?t.host:t}function Ui(e){const t=ct(e);return ut(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ce(t)&&Zt(t)?t:Ui(t)}function yt(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=Le(o);if(i){const u=jr(l);return t.concat(l,l.visualViewport||[],Zt(o)?o:[],u&&n?yt(u):[])}return t.concat(o,yt(o,[],n))}function jr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _c(){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,we=Math.max,Jt=Math.round,On=Math.floor,et=e=>({x:e,y:e}),Bc={left:"right",right:"left",bottom:"top",top:"bottom"},Wc={start:"end",end:"start"};function Fr(e,t,n){return we(e,ft(t,n))}function Nt(e,t){return typeof e=="function"?e(t):e}function xt(e){return e.split("-")[0]}function jt(e){return e.split("-")[1]}function Vi(e){return e==="x"?"y":"x"}function Rr(e){return e==="y"?"height":"width"}const Uc=new Set(["top","bottom"]);function dt(e){return Uc.has(xt(e))?"y":"x"}function kr(e){return Vi(dt(e))}function Vc(e,t,n){n===void 0&&(n=!1);const r=jt(e),o=kr(e),i=Rr(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 zc(e){const t=Tn(e);return[_r(e),t,_r(t)]}function _r(e){return e.replace(/start|end/g,t=>Wc[t])}const zi=["left","right"],Hi=["right","left"],Hc=["top","bottom"],Gc=["bottom","top"];function Yc(e,t,n){switch(e){case"top":case"bottom":return n?t?Hi:zi:t?zi:Hi;case"left":case"right":return t?Hc:Gc;default:return[]}}function Kc(e,t,n,r){const o=jt(e);let i=Yc(xt(e),n==="start",r);return o&&(i=i.map(l=>l+"-"+o),t&&(i=i.concat(i.map(_r)))),i}function Tn(e){return e.replace(/left|right|bottom|top/g,t=>Bc[t])}function qc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Gi(e){return typeof e!="number"?qc(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
|
+
* tabbable 6.2.0
|
|
82
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
83
|
+
*/var Xc=["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])"],Br=Xc.join(","),Yi=typeof Element>"u",en=Yi?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ln=!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},Pn=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"},Zc=function(t,n,r){if(Pn(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Br));return n&&en.call(t,Br)&&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(!Pn(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,Br);c&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var d=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),p=!Pn(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)||Qc(t))&&!Ki(t)?0:t.tabIndex},ef=function(t,n){var r=qi(t);return r<0&&n&&!Ki(t)?0:r},tf=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Xi=function(t){return t.tagName==="INPUT"},nf=function(t){return Xi(t)&&t.type==="hidden"},rf=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},of=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},sf=function(t){if(!t.name)return!0;var n=t.form||Ln(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=of(o,t.form);return!i||i===t},lf=function(t){return Xi(t)&&t.type==="radio"},af=function(t){return lf(t)&&!sf(t)},uf=function(t){var n,r=t&&Ln(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=Ln(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},cf=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=Ln(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(uf(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Qi(t);return!1},ff=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},df=function(t,n){return!(n.disabled||Pn(n)||nf(n)||cf(n,t)||rf(n)||ff(n))},Zi=function(t,n){return!(af(n)||qi(n)<0||!df(t,n))},pf=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},mf=function e(t){var n=[],r=[];return t.forEach(function(o,i){var l=!!o.scopeParent,u=l?o.scopeParent:o,s=ef(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(tf).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Ji=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Jc([t],n.includeContainer,{filter:Zi.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:pf}):r=Zc(t,n.includeContainer,Zi.bind(null,n)),mf(r)};function es(e,t,n){let{reference:r,floating:o}=e;const i=dt(t),l=kr(t),u=Rr(l),s=xt(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 hf=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:F,reset:j}=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],...F}},j&&g<=50&&(g++,typeof j=="object"&&(j.placement&&(p=j.placement),j.rects&&(a=j.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:c,y:d}=es(a,p,s)),v=-1)}return{x:c,y:d,placement:p,strategy:o,middlewareData:f}};async function Dn(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)),F=await(i.isElement==null?void 0:i.isElement(N))?await(i.getScale==null?void 0:i.getScale(N))||{x:1,y:1}:{x:1,y:1},j=Nn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:w,offsetParent:N,strategy:s}):w);return{top:(M.top-j.top+g.top)/F.y,bottom:(j.bottom-M.bottom+g.bottom)/F.y,left:(M.left-j.left+g.left)/F.x,right:(j.right-M.right+g.right)/F.x}}const gf=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=kr(o),g=Rr(f),v=await l.getDimensions(a),E=f==="y",M=E?"top":"left",w=E?"bottom":"right",N=E?"clientHeight":"clientWidth",F=i.reference[g]+i.reference[f]-p[f]-i.floating[g],j=p[f]-i.reference[f],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(a));let B=k?k[N]:0;(!B||!await(l.isElement==null?void 0:l.isElement(k)))&&(B=u.floating[N]||i.floating[g]);const h=F/2-j/2,b=B/2-v[g]/2-1,y=ft(d[M],b),$=ft(d[w],b),D=y,L=B-v[g]-$,C=B/2-v[g]/2+h,O=Fr(D,C,L),T=!s.arrow&&jt(o)!=null&&C!==O&&i.reference[g]/2-(C<D?y:$)-v[g]/2<0,P=T?C<D?C-D:C-L:0;return{[f]:p[f]+P,data:{[f]:O,centerOffset:C-O-P,...T&&{alignmentOffset:P}},reset:T}}}),vf=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=xt(o),w=dt(u),N=xt(u)===u,F=await(s.isRTL==null?void 0:s.isRTL(a.floating)),j=p||(N||!v?[Tn(u)]:zc(u)),k=g!=="none";!p&&k&&j.push(...Kc(u,v,g,F));const B=[u,...j],h=await Dn(t,E),b=[];let y=((r=i.flip)==null?void 0:r.overflows)||[];if(c&&b.push(h[M]),d){const C=Vc(o,l,F);b.push(h[C[0]],h[C[1]])}if(y=[...y,{placement:o,overflows:b}],!b.every(C=>C<=0)){var $,D;const C=((($=i.flip)==null?void 0:$.index)||0)+1,O=B[C];if(O&&(!(d==="alignment"?w!==dt(O):!1)||y.every(x=>dt(x.placement)===w?x.overflows[0]>0:!0)))return{data:{index:C,overflows:y},reset:{placement:O}};let T=(D=y.filter(P=>P.overflows[0]<=0).sort((P,x)=>P.overflows[1]-x.overflows[1])[0])==null?void 0:D.placement;if(!T)switch(f){case"bestFit":{var L;const P=(L=y.filter(x=>{if(k){const I=dt(x.placement);return I===w||I==="y"}return!0}).map(x=>[x.placement,x.overflows.filter(I=>I>0).reduce((I,_)=>I+_,0)]).sort((x,I)=>x[1]-I[1])[0])==null?void 0:L[0];P&&(T=P);break}case"initialPlacement":T=u;break}if(o!==T)return{reset:{placement:T}}}return{}}}},bf=new Set(["left","top"]);async function yf(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=xt(n),u=jt(n),s=dt(n)==="y",a=bf.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 yf(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}}}}},wf=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 Dn(t,s),d=dt(xt(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=Fr(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=Fr(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}}}}}},Ef=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 Dn(t,a),d=xt(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,F=ft(v-c[E],w),j=ft(g-c[M],N),k=!t.middlewareData.shift;let B=F,h=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(h=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(B=w),k&&!p){const y=we(c.left,0),$=we(c.right,0),D=we(c.top,0),L=we(c.bottom,0);f?h=g-2*(y!==0||$!==0?y+$:we(c.left,c.right)):B=v-2*(D!==0||L!==0?D+L:we(c.top,c.bottom))}await s({...t,availableWidth:h,availableHeight:B});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=Ce(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,u=Jt(n)!==i||Jt(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Wr(e){return oe(e)?e:e.contextElement}function Ft(e){const t=Wr(e);if(!Ce(t))return et(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ts(t);let l=(i?Jt(n.width):n.width)/r,u=(i?Jt(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const Sf=et(0);function ns(e){const t=Le(e);return!Sn()||!t.visualViewport?Sf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Cf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Le(e)?!1:t}function Lt(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=Cf(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=Le(i),f=r&&oe(r)?Le(r):r;let g=p,v=jr(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,F=M.top+(v.clientTop+parseFloat(w.paddingTop))*E.y;s*=E.x,a*=E.y,c*=E.x,d*=E.y,s+=N,a+=F,g=Le(v),v=jr(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:Lt(Je(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 Of(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",l=Je(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=Ce(r);if((d||!d&&!i)&&((It(r)!=="body"||Zt(l))&&(s=Cn(r)),Ce(r))){const f=Lt(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 Tf(e){return Array.from(e.getClientRects())}function Nf(e){const t=Je(e),n=Cn(e),r=e.ownerDocument.body,o=we(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=we(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+$n(e);const u=-n.scrollTop;return Ve(r).direction==="rtl"&&(l+=we(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:u}}const os=25;function Lf(e,t){const n=Le(e),r=Je(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 Df(e,t){const n=Lt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ce(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=Lf(e,n);else if(t==="document")r=Nf(Je(e));else if(oe(t))r=Df(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 $f(e,t){const n=t.get(e);if(n)return n;let r=yt(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=Ir(l);!s&&u.position==="fixed"&&(o=null),(i?!s&&!o:!s&&u.position==="static"&&!!o&&Pf.has(o.position)||Zt(l)&&!s&&ss(e,l))?r=r.filter(c=>c!==l):o=u,l=ct(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)?[]:$f(t,this._c):[].concat(n),r],u=l[0],s=l.reduce((a,c)=>{const d=is(t,c,o);return a.top=we(d.top,a.top),a.right=ft(d.right,a.right),a.bottom=ft(d.bottom,a.bottom),a.left=we(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 Mf(e){const{width:t,height:n}=ts(e);return{width:t,height:n}}function If(e,t,n){const r=Ce(t),o=Je(t),i=n==="fixed",l=Lt(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"||Zt(o))&&(u=Cn(t)),r){const f=Lt(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 Ur(e){return Ve(e).position==="static"}function ls(e,t){if(!Ce(e)||Ve(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Je(e)===n&&(n=n.ownerDocument.body),n}function as(e,t){const n=Le(e);if(En(e))return n;if(!Ce(e)){let o=ct(e);for(;o&&!ut(o);){if(oe(o)&&!Ur(o))return o;o=ct(o)}return n}let r=ls(e,t);for(;r&&Ac(r)&&Ur(r);)r=ls(r,t);return r&&ut(r)&&Ur(r)&&!Ir(r)?n:r||Rc(e)||n}const jf=async function(e){const t=this.getOffsetParent||as,n=this.getDimensions,r=await n(e.floating);return{reference:If(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ff(e){return Ve(e).direction==="rtl"}const Rf={convertOffsetParentRelativeRectToViewportRelativeRect:Of,getDocumentElement:Je,getClippingRect:Af,getOffsetParent:as,getElementRects:jf,getClientRects:Tf,getDimensions:Mf,getScale:Ft,isElement:oe,isRTL:Ff};function us(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function kf(e,t){let n=null,r;const o=Je(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:we(0,ft(1,s))||1};let F=!0;function j(k){const B=k[0].intersectionRatio;if(B!==s){if(!F)return l();B?l(!1,B):r=setTimeout(()=>{l(!1,1e-7)},1e3)}B===1&&!us(a,e.getBoundingClientRect())&&l(),F=!1}try{n=new IntersectionObserver(j,{...N,root:o.ownerDocument})}catch{n=new IntersectionObserver(j,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?yt(a):[],...yt(t)]:[];c.forEach(M=>{o&&M.addEventListener("scroll",n,{passive:!0}),i&&M.addEventListener("resize",n)});const d=a&&u?kf(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?Lt(e):null;s&&E();function E(){const M=Lt(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 Vr=Dn,_f=xf,Bf=wf,Wf=vf,Uf=Ef,fs=gf,Vf=(e,t,n)=>{const r=new Map,o={platform:Rf,...n},i={...o.platform,_c:r};return hf(e,t,{...o,platform:i})};var zf=typeof document<"u",Hf=function(){},An=zf?m.useLayoutEffect:Hf;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 zr(e){const t=R.useRef(e);return An(()=>{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(x=>{x!==k.current&&(k.current=x,v(x))},[]),N=R.useCallback(x=>{x!==B.current&&(B.current=x,M(x))},[]),F=i||g,j=l||E,k=R.useRef(null),B=R.useRef(null),h=R.useRef(c),b=s!=null,y=zr(s),$=zr(o),D=zr(a),L=R.useCallback(()=>{if(!k.current||!B.current)return;const x={placement:t,strategy:n,middleware:p};$.current&&(x.platform=$.current),Vf(k.current,B.current,x).then(I=>{const _={...I,isPositioned:D.current!==!1};C.current&&!Mn(h.current,_)&&(h.current=_,Vt.flushSync(()=>{d(_)}))})},[p,t,n,$,D]);An(()=>{a===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,d(x=>({...x,isPositioned:!1})))},[a]);const C=R.useRef(!1);An(()=>(C.current=!0,()=>{C.current=!1}),[]),An(()=>{if(F&&(k.current=F),j&&(B.current=j),F&&j){if(y.current)return y.current(F,j,L);L()}},[F,j,L,y,b]);const O=R.useMemo(()=>({reference:k,floating:B,setReference:w,setFloating:N}),[w,N]),T=R.useMemo(()=>({reference:F,floating:j}),[F,j]),P=R.useMemo(()=>{const x={position:n,left:0,top:0};if(!T.floating)return x;const I=ps(T.floating,c.x),_=ps(T.floating,c.y);return u?{...x,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:L,refs:O,elements:T,floatingStyles:P}),[c,L,O,T,P])}const Gf=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):{}}}},Hr=(e,t)=>({..._f(e),options:[e,t]}),hs=(e,t)=>({...Bf(e),options:[e,t]}),gs=(e,t)=>({...Wf(e),options:[e,t]}),Yf=(e,t)=>({...Uf(e),options:[e,t]}),Kf=(e,t)=>({...Gf(e),options:[e,t]}),vs={...R},qf=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 qf(()=>{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 Gr=typeof document<"u"?m.useLayoutEffect:m.useEffect;let ys=!1,Xf=0;const xs=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Xf++;function Qf(){const[e,t]=R.useState(()=>ys?xs():void 0);return Gr(()=>{e==null&&t(xs())},[]),R.useEffect(()=>{ys=!0},[]),e}const Zf=vs.useId||Qf;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 ed(){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 td(){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 nd=R.createContext(null),rd=R.createContext(null),od=()=>{var e;return((e=R.useContext(nd))==null?void 0:e.id)||null},id=()=>R.useContext(rd),sd="data-floating-ui-focusable";function ld(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Zf(),i=R.useRef({}),[l]=R.useState(()=>td()),u=od()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!oe(f)&&ed("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 ad(e){e===void 0&&(e={});const{nodeId:t}=e,n=ld({...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=id();Gr(()=>{c&&(d.current=c)},[c]);const f=ms({...e,elements:{...o,...u&&{reference:u}}}),g=R.useCallback(N=>{const F=oe(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),contextElement:N}:N;s(F),f.refs.setReference(F)},[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 Gr(()=>{r.dataRef.current.floatingContext=w;const N=p==null?void 0:p.nodesRef.current.find(F=>F.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 Yr(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,[sd]:""},...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 ud(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=>Yr(u,e,"reference"),t),i=R.useCallback(u=>Yr(u,e,"floating"),n),l=R.useCallback(u=>Yr(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 cd=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 Hr(-f.offsetTop-p.clientTop-d.reference.height/2-f.offsetHeight/2-i).fn(t)},F=await Vr(Ss(N,g.scrollHeight+v+p.clientTop),c),j=await Vr(N,{...c,elementContext:"reference"}),k=we(0,F.top),B=N.y+k,y=(g.scrollHeight>g.clientHeight?$=>$:Jt)(we(0,g.scrollHeight+(E&&w||M?v*2:0)-k-we(0,F.bottom)));if(g.style.maxHeight=y+"px",g.scrollTop=k,o){const $=g.offsetHeight<f.offsetHeight*ft(u,n.current.length)-1||j.top>=-s||j.bottom>=-s;Vt.flushSync(()=>o($))}return r&&(r.current=await Vr(Ss({...N,y:B},g.offsetHeight+v+p.clientTop),c)),{y:B}}});function fd(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,F=E<0?-1:1,j=E<0?"max":"min";g.scrollHeight<=g.clientHeight||(!M&&E>0||!w&&E<0?(v.preventDefault(),Vt.flushSync(()=>{s(k=>k+Math[j](E,N*F))})):/firefox/i.test(_c())&&(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 Kr=m.createContext(null);Kr.displayName="PlacementContext";function dd(e){return m.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function pd(){return m.useContext(Rt).setReference}function md(){return m.useContext(Rt).getReferenceProps}function hd(){let{getFloatingProps:e,slot:t}=m.useContext(Rt);return m.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function gd(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=m.useContext(Kr),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 vd({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);bd(u);let a=t&&n!==null&&u!==null,{to:c="bottom",gap:d=0,offset:p=0,padding:f=0,inner:g}=yd(n,u),[v,E="center"]=c.split(" ");ue(()=>{a&&i(0)},[a]);let{refs:M,floatingStyles:w,context:N}=ad({open:a,placement:v==="selection"?E==="center"?"bottom":`bottom-${E}`:E==="center"?`${v}`:`${v}-${E}`,strategy:"absolute",transform:!1,middleware:[Hr({mainAxis:v==="selection"?0:d,crossAxis:p}),hs({padding:f}),v!=="selection"&&gs({padding:f}),v==="selection"&&g?cd({...g,padding:f,overflowRef:l,offset:o,minItemsVisible:Cs,referenceOverflowThreshold:f,onFallbackChange($){var D,L;if(!$)return;let C=N.elements.floating;if(!C)return;let O=parseFloat(getComputedStyle(C).scrollPaddingBottom)||0,T=Math.min(Cs,C.childElementCount),P=0,x=0;for(let I of(L=(D=N.elements.floating)==null?void 0:D.childNodes)!=null?L:[])if(at(I)){let _=I.offsetTop,V=_+I.clientHeight+O,W=C.scrollTop,Y=W+C.clientHeight;if(_>=W&&V<=Y)T--;else{x=Math.max(0,Math.min(V,Y)-Math.max(_,W)),P=I.clientHeight;break}}T>=1&&i(I=>{let _=P*T-x+O;return I>=_?I:_})}}):null,Yf({padding:f,apply({availableWidth:$,availableHeight:D,elements:L}){Object.assign(L.floating.style,{overflow:"auto",maxWidth:`${$}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${D}px)`})}})].filter(Boolean),whileElementsMounted:cs}),[F=v,j=E]=N.placement.split("-");v==="selection"&&(F="selection");let k=m.useMemo(()=>({anchor:[F,j].filter(Boolean).join(" ")}),[F,j]),B=fd(N,{overflowRef:l,onChange:i}),{getReferenceProps:h,getFloatingProps:b}=ud([B]),y=ne($=>{s($),M.setFloating($)});return R.createElement(Kr.Provider,{value:r},R.createElement(Rt.Provider,{value:{setFloating:y,setReference:M.setReference,styles:w,getReferenceProps:h,getFloatingProps:b,slot:k}},e))}function bd(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 yd(e,t){var n,r,o;let i=qr((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),l=qr((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),u=qr((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:l,padding:u}}function qr(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 Xr=m.createContext(null);Xr.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 Qr(){return m.useContext(Xr)}function Ns({value:e,children:t}){return m.createElement(Xr.Provider,{value:e},t)}function wd(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:wd(e)}}var Ls=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Ls||{});function Ps(e){let t=ne(e),n=m.useRef(!1);m.useEffect(()=>(n.current=!1,()=>{n.current=!0,ni(()=>{n.current&&t()})}),[t])}function Ed(){let e=typeof document>"u";return"useSyncExternalStore"in R?(t=>t.useSyncExternalStore)(R)(()=>()=>{},()=>!1,()=>!e):!1}function Zr(){let e=Ed(),[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 Sd=m.createContext(!1);function Cd(){return m.useContext(Sd)}function Od(e){let t=Cd(),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 Ds=m.Fragment,Td=Ne(function(e,t){let{ownerDocument:n=null,...r}=e,o=m.useRef(null),i=Be(Nu(f=>{o.current=f}),t),l=$r(o),u=n??l,s=Od(u),[a]=m.useState(()=>{var f;return Qe.isServer?null:(f=u==null?void 0:u.createElement("div"))!=null?f:null}),c=m.useContext(Dd),d=Zr();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]),Ps(()=>{var f;!s||!a||(br(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:Se.createPortal(p({ourProps:{ref:i},theirProps:r,slot:{},defaultTag:Ds,name:"Portal"}),a):null});function Nd(e,t){let n=Be(t),{enabled:r=!0,ownerDocument:o,...i}=e,l=Me();return r?m.createElement(Td,{...i,ownerDocument:o,ref:n}):l({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:Ds,name:"Portal"})}let Ld=m.Fragment,$s=m.createContext(null);function Pd(e,t){let{target:n,...r}=e,o={ref:Be(t)},i=Me();return m.createElement($s.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:Ld,name:"Popover.Group"}))}let Dd=m.createContext(null),$d=Ne(Nd),Ad=Ne(Pd),Md=Object.assign($d,{Group:Ad});function Id(){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:Is)!==m.Fragment||m.Children.count(e.children)===1}let jn=m.createContext(null);jn.displayName="TransitionContext";var jd=(e=>(e.Visible="visible",e.Hidden="hidden",e))(jd||{});function Fd(){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 Rd(){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=Id(),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 kd(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),F=As(e),j=Be(...F?[N,t,w]:t===null?[]:[t]),k=(n=E.unmount)==null||n?vt.Unmount:vt.Hidden,{show:B,appear:h,initial:b}=Fd(),[y,$]=m.useState(B?"visible":"hidden"),D=Rd(),{register:L,unregister:C}=D;ue(()=>L(N),[L,N]),ue(()=>{if(k===vt.Hidden&&N.current){if(B&&y!=="visible"){$("visible");return}return _e(y,{hidden:()=>C(N),visible:()=>L(N)})}},[y,N,L,C,B,k]);let O=Zr();ue(()=>{if(F&&O&&y==="visible"&&N.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[N,y,O,F]);let T=b&&!h,P=h&&B&&b,x=m.useRef(!1),I=Ms(()=>{x.current||($("hidden"),C(N))},D),_=ne(z=>{x.current=!0;let J=z?"enter":"leave";I.onStart(N,J,se=>{se==="enter"?i==null||i():se==="leave"&&(u==null||u())})}),V=ne(z=>{let J=z?"enter":"leave";x.current=!1,I.onStop(N,J,se=>{se==="enter"?l==null||l():se==="leave"&&(s==null||s())}),J==="leave"&&!Rn(I)&&($("hidden"),C(N))});m.useEffect(()=>{F&&o||(_(B),V(B))},[B,F,o]);let W=!(!o||!F||!O||T),[,Y]=Wi(W,M,B,{start:_,end:V}),q=bt({ref:j,className:((r=hr(E.className,P&&a,P&&c,Y.enter&&a,Y.enter&&Y.closed&&c,Y.enter&&!Y.closed&&d,Y.leave&&f,Y.leave&&!Y.closed&&g,Y.leave&&Y.closed&&v,!Y.transition&&B&&p))==null?void 0:r.trim())||void 0,...Bi(Y)}),G=0;y==="visible"&&(G|=qe.Open),y==="hidden"&&(G|=qe.Closed),B&&y==="hidden"&&(G|=qe.Opening),!B&&y==="visible"&&(G|=qe.Closing);let H=Me();return m.createElement(Fn.Provider,{value:I},m.createElement(Ns,{value:G},H({ourProps:q,theirProps:E,defaultTag:Is,features:js,visible:y==="visible",name:"Transition.Child"})))}function _d(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,l=m.useRef(null),u=As(e),s=Be(...u?[l,t]:t===null?[]:[t]);Zr();let a=Qr();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 j;f&&g(!1),(j=e.beforeEnter)==null||j.call(e)}),N=ne(()=>{var j;f&&g(!1),(j=e.beforeLeave)==null||j.call(e)}),F=Me();return m.createElement(Fn.Provider,{value:p},m.createElement(jn.Provider,{value:E},F({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 Bd(e,t){let n=m.useContext(jn)!==null,r=Qr()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(Jr,{ref:t,...e}):m.createElement(Fs,{ref:t,...e}))}let Jr=Ne(_d),Fs=Ne(kd),Wd=Ne(Bd),Rs=Object.assign(Jr,{Child:Wd,Root:Jr});function Ud(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 Vd(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 zd(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=Vd(r).trim().toLowerCase();return t.current=o,n.current=i,i})}var Hd=Object.defineProperty,Gd=(e,t,n)=>t in e?Hd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bs=(e,t,n)=>(Gd(e,typeof t!="symbol"?t+"":t,n),n),ye=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ye||{}),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||{}),Ws=(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))(Ws||{});function Us(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 Yd={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 eo extends xi{constructor(t){super(t),Bs(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:Er(()=>{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:Er(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:6,options:n.splice(0)})}]}),goToOption:Er(()=>{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})}}),Bs(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=Sr.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 eo({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,Yd,t,n)}}const Vs=m.createContext(null);function to(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(()=>eo.new({id:e,__demoMode:t}),[]);return Ps(()=>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 Kd=m.Fragment;function qd(e,t){let n=m.useId(),r=mr(),{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=Be(t),w=du(i),[N=f?[]:void 0,F]=fu(o,s,w),j=zs({id:n,__demoMode:g}),k=m.useRef({static:!1,hold:!1}),B=m.useRef(new Map),h=ku(a),b=m.useCallback(W=>_e(y.mode,{[tt.Multi]:()=>N.some(Y=>h(Y,W)),[tt.Single]:()=>h(N,W)}),[N]),y=m.useMemo(()=>({value:N,disabled:d,invalid:c,mode:f?tt.Multi:tt.Single,orientation:E,onChange:F,compare:h,isSelected:b,optionsPropsRef:k,listRef:B}),[N,d,c,f,E,F,h,b,k,B]);ue(()=>{j.state.dataRef.current=y},[y]);let $=Ue(j,W=>W.listboxState),D=Sr.get(null),L=Ue(D,m.useCallback(W=>D.selectors.isTop(W,n),[D,n])),[C,O]=Ue(j,W=>[W.buttonElement,W.optionsElement]);fc(L,[C,O],(W,Y)=>{j.send({type:Ws.CloseListbox}),$i(Y,Dr.Loose)||(W.preventDefault(),C==null||C.focus())});let T=m.useMemo(()=>({open:$===ye.Open,disabled:d,invalid:c,value:N}),[$,d,c,N]),[P,x]=Au({inherit:!0}),I={ref:M},_=m.useCallback(()=>{if(w!==void 0)return F==null?void 0:F(w)},[F,w]),V=Me();return m.createElement(x,{value:P,props:{htmlFor:C==null?void 0:C.id},slot:{open:$===ye.Open,disabled:d}},m.createElement(vd,null,m.createElement(Vs.Provider,{value:j},m.createElement(_n.Provider,{value:y},m.createElement(Ns,{value:_e($,{[ye.Open]:qe.Open,[ye.Closed]:qe.Closed})},u!=null&&N!=null&&m.createElement(bu,{disabled:d,data:{[u]:N},form:l,onReset:_}),V({ourProps:I,theirProps:v,slot:T,defaultTag:Kd,name:"Listbox"}))))))}let Xd="button";function Qd(e,t){let n=m.useId(),r=ui(),o=nn("Listbox.Button"),i=to("Listbox.Button"),{id:l=r||`headlessui-listbox-button-${n}`,disabled:u=o.disabled||!1,autoFocus:s=!1,...a}=e,c=Be(t,pd(),i.actions.setButtonElement),d=md(),[p,f,g]=Ue(i,x=>[x.listboxState,x.buttonElement,x.optionsElement]),v=p===ye.Open;mc(v,{trigger:f,action:m.useCallback(x=>{if(f!=null&&f.contains(x.target))return xn.Ignore;let I=x.target.closest('[role="option"]:not([data-disabled])');return at(I)?xn.Select(I):g!=null&&g.contains(x.target)?xn.Ignore:xn.Close},[f,g]),close:i.actions.closeListbox,select:i.actions.selectActiveOption});let E=ne(x=>{switch(x.key){case be.Enter:pu(x.currentTarget);break;case be.Space:case be.ArrowDown:x.preventDefault(),i.actions.openListbox({focus:o.value?fe.Nothing:fe.First});break;case be.ArrowUp:x.preventDefault(),i.actions.openListbox({focus:o.value?fe.Nothing:fe.Last});break}}),M=ne(x=>{switch(x.key){case be.Space:x.preventDefault();break}}),w=ne(x=>{var I;if(x.button===Ls.Left){if(Ou(x.currentTarget))return x.preventDefault();i.state.listboxState===ye.Open?(Se.flushSync(()=>i.actions.closeListbox()),(I=i.state.buttonElement)==null||I.focus({preventScroll:!0})):(x.preventDefault(),i.actions.openListbox({focus:fe.Nothing}))}}),N=m.useRef(null),F=ne(x=>{N.current=x.pointerType,x.pointerType==="mouse"&&w(x)}),j=ne(x=>{N.current!=="mouse"&&w(x)}),k=ne(x=>x.preventDefault()),B=gi([l]),h=Lu(),{isFocusVisible:b,focusProps:y}=Ja({autoFocus:s}),{isHovered:$,hoverProps:D}=Za({isDisabled:u}),{pressed:L,pressProps:C}=iu({disabled:u}),O=m.useMemo(()=>({open:p===ye.Open,active:L||p===ye.Open,disabled:u,invalid:o.invalid,value:o.value,hover:$,focus:b,autofocus:s}),[p,o.value,u,$,b,L,o.invalid,s]),T=Ue(i,x=>x.listboxState===ye.Open),P=oi(d(),{ref:c,id:l,type:hc(e,f),"aria-haspopup":"listbox","aria-controls":g==null?void 0:g.id,"aria-expanded":T,"aria-labelledby":B,"aria-describedby":h,disabled:u||void 0,autoFocus:s,onKeyDown:E,onKeyUp:M,onKeyPress:k,onPointerDown:F,onClick:j},y,D,C);return Me()({ourProps:P,theirProps:a,slot:O,defaultTag:Xd,name:"Listbox.Button"})}let Hs=m.createContext(!1),Zd="div",Jd=gn.RenderStrategy|gn.Static;function ep(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=dd(o),[c,d]=m.useState(null);a&&(i=!0);let p=nn("Listbox.Options"),f=to("Listbox.Options"),[g,v,E,M]=Ue(f,z=>[z.listboxState,z.buttonElement,z.optionsElement,z.__demoMode]),w=$r(v),N=$r(E),F=Qr(),[j,k]=Wi(u,c,F!==null?(F&qe.Open)===qe.Open:g===ye.Open);Ju(j,v,f.actions.closeListbox);let B=M?!1:l&&g===ye.Open;Sc(B,N);let h=M?!1:l&&g===ye.Open;Zu(h,{allowed:m.useCallback(()=>[v,E],[v,E])});let b=g!==ye.Open,y=Ud(b,v)?!1:j,$=j&&g===ye.Closed,D=xd($,p.value),L=ne(z=>p.compare(D,z)),C=Ue(f,z=>{var J;if(a==null||!((J=a==null?void 0:a.to)!=null&&J.includes("selection")))return null;let se=z.options.findIndex(he=>L(he.dataRef.current.value));return se===-1&&(se=0),se}),O=(()=>{if(a==null)return;if(C===null)return{...a,inner:void 0};let z=Array.from(p.listRef.current.values());return{...a,inner:{listRef:{current:z},index:C}}})(),[T,P]=gd(O),x=hd(),I=Be(t,a?T:null,f.actions.setOptionsElement,d),_=$t();m.useEffect(()=>{var z;let J=E;J&&g===ye.Open&&J!==((z=Kt(J))==null?void 0:z.activeElement)&&(J==null||J.focus({preventScroll:!0}))},[g,E]);let V=ne(z=>{var J,se;switch(_.dispose(),z.key){case be.Space:if(f.state.searchQuery!=="")return z.preventDefault(),z.stopPropagation(),f.actions.search(z.key);case be.Enter:if(z.preventDefault(),z.stopPropagation(),f.state.activeOptionIndex!==null){let{dataRef:he}=f.state.options[f.state.activeOptionIndex];f.actions.onChange(he.current.value)}p.mode===tt.Single&&(Se.flushSync(()=>f.actions.closeListbox()),(J=f.state.buttonElement)==null||J.focus({preventScroll:!0}));break;case _e(p.orientation,{vertical:be.ArrowDown,horizontal:be.ArrowRight}):return z.preventDefault(),z.stopPropagation(),f.actions.goToOption({focus:fe.Next});case _e(p.orientation,{vertical:be.ArrowUp,horizontal:be.ArrowLeft}):return z.preventDefault(),z.stopPropagation(),f.actions.goToOption({focus:fe.Previous});case be.Home:case be.PageUp:return z.preventDefault(),z.stopPropagation(),f.actions.goToOption({focus:fe.First});case be.End:case be.PageDown:return z.preventDefault(),z.stopPropagation(),f.actions.goToOption({focus:fe.Last});case be.Escape:z.preventDefault(),z.stopPropagation(),Se.flushSync(()=>f.actions.closeListbox()),(se=f.state.buttonElement)==null||se.focus({preventScroll:!0});return;case be.Tab:z.preventDefault(),z.stopPropagation(),Se.flushSync(()=>f.actions.closeListbox()),lc(f.state.buttonElement,z.shiftKey?Pr.Previous:Pr.Next);break;default:z.key.length===1&&(f.actions.search(z.key),_.setTimeout(()=>f.actions.clearSearch(),350));break}}),W=Ue(f,z=>{var J;return(J=z.buttonElement)==null?void 0:J.id}),Y=m.useMemo(()=>({open:g===ye.Open}),[g]),q=oi(a?x():{},{id:r,ref:I,"aria-activedescendant":Ue(f,f.selectors.activeDescendantId),"aria-multiselectable":p.mode===tt.Multi?!0:void 0,"aria-labelledby":W,"aria-orientation":p.orientation,onKeyDown:V,role:"listbox",tabIndex:g===ye.Open?0:void 0,style:{...s.style,...P,"--button-width":Bu(v,!0).width},...Bi(k)}),G=Me(),H=m.useMemo(()=>p.mode===tt.Multi?p:{...p,isSelected:L},[p,L]);return m.createElement(Md,{enabled:i?e.static||j:!1,ownerDocument:w},m.createElement(_n.Provider,{value:H},G({ourProps:q,theirProps:s,slot:Y,defaultTag:Zd,features:Jd,visible:y,name:"Listbox.Options"})))}let tp="div";function np(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=to("Listbox.Option"),c=Ue(a,y=>a.selectors.isActive(y,r)),d=s.isSelected(i),p=m.useRef(null),f=zd(p),g=Ot({disabled:o,value:i,domRef:p,get textValue(){return f()}}),v=Be(t,p,y=>{y?s.listRef.current.set(r,y):s.listRef.current.delete(r)}),E=Ue(a,y=>a.selectors.shouldScrollIntoView(y,r));ue(()=>{if(E)return Ke().requestAnimationFrame(()=>{var y,$;($=(y=p.current)==null?void 0:y.scrollIntoView)==null||$.call(y,{block:"nearest"})})},[E,p]),ue(()=>{if(!u)return a.actions.registerOption(r,g),()=>a.actions.unregisterOption(r)},[g,r,u]);let M=ne(y=>{var $;if(o)return y.preventDefault();a.actions.onChange(i),s.mode===tt.Single&&(Se.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=Cc(),F=ne(y=>N.update(y)),j=ne(y=>{N.wasMoved(y)&&(o||c&&a.state.activationTrigger===kn.Pointer||a.actions.goToOption({focus:fe.Specific,id:r},kn.Pointer))}),k=ne(y=>{N.wasMoved(y)&&(o||c&&a.state.activationTrigger===kn.Pointer&&a.actions.goToOption({focus:fe.Nothing}))}),B=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:F,onMouseEnter:F,onPointerMove:j,onMouseMove:j,onPointerLeave:k,onMouseLeave:k},b=Me();return!d&&u?null:b({ourProps:h,theirProps:l,slot:B,defaultTag:tp,name:"Listbox.Option"})}let rp=m.Fragment;function op(e,t){let{options:n,placeholder:r,...o}=e,i={ref:Be(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:rp,name:"ListboxSelectedOption"}))}let ip=Ne(qd),sp=Ne(Qd),lp=Fu,ap=Ne(ep),up=Ne(np),cp=Ne(op),wt=Object.assign(ip,{Button:sp,Label:lp,Options:ap,Option:up,SelectedOption:cp});function fp({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(fp),dp=({tokens:e,selectedToken:t,onTokenChange:n,disabled:r=!1,className:o=""})=>{const{t:i}=Ye();return S.jsx("div",{className:`relative ${o}`,children:S.jsx(wt,{value:t,onChange:n,disabled:r,children:({open:l})=>S.jsxs(S.Fragment,{children:[S.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
|
-
focus:outline-none
|
|
87
|
-
${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-
|
|
88
|
-
${
|
|
89
|
-
`,children:[
|
|
86
|
+
focus:outline-none
|
|
87
|
+
${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
|
|
88
|
+
${l?"ring-1 ring-white":""}
|
|
89
|
+
`,children:[S.jsx("span",{className:"text-sm leading-[18px] font-medium",children:i("deposit.asset")}),S.jsxs("div",{className:"flex items-center",children:[t.iconUrl?S.jsx("img",{src:t.iconUrl,alt:t.token,className:"w-4 h-4 rounded-full"}):S.jsx("div",{className:"w-4 h-4 rounded-full bg-green-500 flex items-center justify-center",children:S.jsx("span",{className:"text-xs text-white font-bold",children:t.token.charAt(0)})}),S.jsx("span",{className:"text-sm text-white ml-1",children:t.symbol||t.token}),S.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:[S.jsx("g",{clipPath:"url(#clip0_12919_27745)",children:S.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"})}),S.jsx("defs",{children:S.jsx("clipPath",{id:"clip0_12919_27745",children:S.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),S.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:S.jsx(wt.Options,{className:`
|
|
90
90
|
absolute z-50 mt-1 w-full max-h-60 overflow-auto rounded-lg
|
|
91
|
-
bg-
|
|
91
|
+
bg-fill-input-primary border border-line-divider-secondary shadow-lg
|
|
92
92
|
focus:outline-none
|
|
93
|
-
`,children:e.map(
|
|
94
|
-
relative w-full h-9 text-text-primary bg-fill-input-primary
|
|
93
|
+
`,children:e.map(u=>S.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})=>S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs("div",{className:"flex items-center space-x-3",children:[u.iconUrl?S.jsx("img",{src:u.iconUrl,alt:u.token,className:"w-5 h-5 rounded-full"}):S.jsx("div",{className:"w-5 h-5 rounded-full bg-green-500 flex items-center justify-center",children:S.jsx("span",{className:"text-xs text-white font-bold",children:u.token.charAt(0)})}),S.jsx("div",{className:"flex flex-col",children:S.jsx("span",{className:`text-sm font-medium ${s||a?"text-text-primary":"text-text-tertiary"}`,children:u.symbol||u.token})})]}),s&&S.jsx(Gs,{className:"w-4 h-4 text-blue-400"})]})},u.tokenAddress))})})]})})})},pp=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o="",walletType:i="mpc"})=>{const{t:l}=Ye();return S.jsx("div",{className:`relative ${o}`,children:S.jsx(wt,{value:t,onChange:n,disabled:r,children:({open:u})=>S.jsxs(S.Fragment,{children:[S.jsxs(wt.Button,{className:`
|
|
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
|
-
focus:outline-none
|
|
97
|
-
${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-
|
|
98
|
-
${
|
|
99
|
-
`,children:[
|
|
96
|
+
focus:outline-none
|
|
97
|
+
${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
|
|
98
|
+
${u?"ring-1 ring-white":""}
|
|
99
|
+
`,children:[S.jsx("span",{className:"text-sm leading-[18px] font-medium",children:l("deposit.chain")}),S.jsxs("div",{className:"flex items-center space-x-2",children:[t.chainIconUrl?S.jsx("img",{src:t.chainIconUrl,alt:t.chain,className:"w-4 h-4 rounded-full"}):S.jsx("div",{className:"w-4 h-4 rounded-full bg-blue-500 flex items-center justify-center",children:S.jsx("span",{className:"text-xs text-white font-bold",children:t.chain.charAt(0)})}),S.jsx("span",{className:"text-sm text-white ml-1",children:t.chain}),S.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:[S.jsx("g",{clipPath:"url(#clip0_12919_27745)",children:S.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"})}),S.jsx("defs",{children:S.jsx("clipPath",{id:"clip0_12919_27745",children:S.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),S.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:S.jsx(wt.Options,{className:`
|
|
100
100
|
absolute z-50 mt-1 w-full max-h-60 overflow-auto rounded-lg
|
|
101
|
-
bg-
|
|
101
|
+
bg-fill-input-primary border border-line-divider-secondary shadow-lg
|
|
102
102
|
focus:outline-none
|
|
103
|
-
`,children:e.map(c=>x.jsx(Je.Option,{value:c,className:({active:u,selected:i})=>`relative cursor-pointer select-none py-3 px-3 ${u?"bg-gray-700":""} ${i?"bg-gray-700":""}`,children:({selected:u})=>x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("div",{className:"flex items-center space-x-3",children:[c.iconUrl?x.jsx("img",{src:c.iconUrl,alt:c.token,className:"w-5 h-5 rounded-full"}):x.jsx("div",{className:"w-5 h-5 rounded-full bg-green-500 flex items-center justify-center",children:x.jsx("span",{className:"text-xs text-white font-bold",children:c.token.charAt(0)})}),x.jsxs("div",{className:"flex flex-col",children:[x.jsx("span",{className:`text-sm font-medium ${u?"text-white":"text-gray-200"}`,children:c.symbol||c.token}),x.jsxs("span",{className:"text-xs text-gray-400",children:[c.decimals," decimals"]})]})]}),u&&x.jsx(Ri,{className:"w-4 h-4 text-blue-400"})]})},c.tokenAddress))})})]})})}),yf=({currentActiveChain:e,chains:t,onChainChange:n,curSelectToken:r,tokens:o,onTokenChange:s,t:c})=>{p.useEffect(()=>{console.log("🔍 ChainTokenSelector: Props updated",{curSelectToken:r,currentActiveChain:e==null?void 0:e.chain})},[r,e]);const u=o.find(a=>a.token===r||a.symbol===r)||o[0],i=a=>{console.log("🔗 ChainTokenSelector: Chain change triggered",a),n(a.chainId)},l=a=>{s(a.symbol||a.token)};return x.jsxs("div",{className:"space-y-4",children:[x.jsx(Bi,{chains:t,selectedChain:e,onChainChange:i,className:"w-full"}),x.jsx(Hi,{tokens:o,selectedToken:u,onTokenChange:l,className:"w-full"})]})},wf=({currentActiveChain:e,chainList:t,onChainChange:n,curSelectToken:r,onTokenChange:o,t:s})=>{p.useEffect(()=>{var f;console.log("🔍 MPCChainTokenSelector: Props updated",{curSelectToken:r,currentActiveChain:e==null?void 0:e.chain,availableTokens:((f=e==null?void 0:e.tokenList)==null?void 0:f.length)||0})},[r,e]);const c=p.useMemo(()=>(e==null?void 0:e.tokenList)||[],[e]),u=p.useMemo(()=>c.find(h=>h.token===r||h.symbol===r)||c[0],[c,r]),i=f=>{var h;if(console.log("🔗 MPCChainTokenSelector: Chain change triggered",{chain:f.chain,availableTokens:((h=f.tokenList)==null?void 0:h.length)||0}),n(f.chainId),f.tokenList&&f.tokenList.length>0&&!f.tokenList.some(b=>b.token===r||b.symbol===r)){const b=f.tokenList[0];console.log("🔄 MPCChainTokenSelector: Auto-selecting first token",b.token),o(b.symbol||b.token)}},l=f=>{console.log("🔄 MPCChainTokenSelector: Token change triggered",f.token),o(f.symbol||f.token)},a=p.useMemo(()=>t.map(f=>({chainId:f.chainId,chain:f.chain,chainIconUrl:f.chainIconUrl,allowDeposit:f.allowDeposit,blockTime:f.blockTime,txConfirm:f.txConfirm})),[t]),d=p.useMemo(()=>({chainId:e.chainId,chain:e.chain,chainIconUrl:e.chainIconUrl,allowDeposit:e.allowDeposit,blockTime:e.blockTime,txConfirm:e.txConfirm}),[e]),m=p.useMemo(()=>c.map(f=>({token:f.token,symbol:f.symbol,iconUrl:f.iconUrl,decimals:f.decimals,tokenAddress:f.tokenAddress})),[c]);return x.jsxs("div",{className:"space-y-4",children:[x.jsx(Bi,{chains:a,selectedChain:d,onChainChange:f=>{const h=t.find(v=>v.chainId===f.chainId);h&&i(h)},className:"w-full"}),x.jsx(Hi,{tokens:m,selectedToken:u?{token:u.token,symbol:u.symbol,iconUrl:u.iconUrl,decimals:u.decimals,tokenAddress:u.tokenAddress}:m[0],onTokenChange:l,className:"w-full"}),typeof window<"u"&&window.location.hostname==="localhost"&&x.jsxs("div",{className:"text-xs text-gray-500 p-2 bg-gray-800 rounded",children:[x.jsxs("div",{children:["Chain: ",e.chain]}),x.jsxs("div",{children:["Available tokens: ",c.length]}),x.jsxs("div",{children:["Selected token: ",(u==null?void 0:u.token)||"None"]})]})]})},Ef=({walletAdapter:e,curSelectToken:t,currentActiveChain:n,metadata:r,t:o,showToast:s})=>{var c;return x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"flex justify-center mt-4 mb-3",children:x.jsx("div",{className:"bg-white rounded-lg",children:x.jsx(Ks,{value:(e==null?void 0:e.getDisplayAddress())||"",size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",includeMargin:!1})})}),x.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[x.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:e==null?void 0:e.getDisplayAddress()}),x.jsx(Xs,{text:(e==null?void 0:e.getDisplayAddress())||"",onCopy:()=>s("Copied!"),children:x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[x.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),x.jsx("path",{d:"M5.85547 2.07861H11.415C12.7957 2.07861 13.915 3.1979 13.915 4.57861V10.0786",stroke:"#F9F9F9",strokeLinecap:"round"})]})})]}),x.jsxs("div",{className:"flex items-start",children:[x.jsx("div",{className:"w-5",children:x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:x.jsx("path",{d:"M8.00016 14.6667C11.6821 14.6667 14.6668 11.6819 14.6668 8C14.6668 4.31809 11.6821 1.33333 8.00016 1.33333C4.31826 1.33333 1.3335 4.31809 1.3335 8C1.3335 11.6819 4.31826 14.6667 8.00016 14.6667Z",fill:"#FF8F34",stroke:"#FF8F34",strokeWidth:"1.33333",strokeLinejoin:"round"})})}),x.jsxs("div",{className:"flex-1",children:[x.jsxs("p",{className:"text-xs text-functional-orange-1",children:["Only ",t," (",n==null?void 0:n.chain,") is supported for deposits to this address."]}),x.jsx("div",{className:"pt-2 h-[1px] border-b border-dashed border-line-divider-secondary"})]})]}),x.jsx("div",{className:"flex items-start pl-5 pt-2 text-[#FF8E34] text-xs",children:"When the deposit amount exceeds 250,000, there may be a delay in arrival. It is recommended to use the Ethereum network for deposits."}),x.jsx("div",{className:"pt-4 h-[1px] border-b border-dashed border-line-divider-secondary"}),x.jsxs("div",{className:"text-sm",children:[x.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[x.jsx("span",{className:"text-text-tertiary",children:"Arrival Time"}),x.jsxs("span",{className:"text-text-primary font-medium text-right underline decoration-dotted underline-offset-1",children:["≈"," ",Math.ceil(((n==null?void 0:n.blockTime)||12)*((n==null?void 0:n.txConfirm)||12)/60)," ","minutes"]})]}),x.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[x.jsx("span",{className:"text-text-tertiary",children:"Minimum Deposit Amount"}),x.jsxs("span",{className:"text-text-primary font-medium text-right",children:[((c=r==null?void 0:r.multiChain)==null?void 0:c.minDeposit)||10," ",t]})]}),x.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[x.jsx("span",{className:"text-text-tertiary",children:"Maximum Deposit Amount"}),x.jsxs("span",{className:"text-text-primary font-medium text-right",children:["250,000 ",t]})]})]})]})},un=(e,t)=>Number(e)>Number(t),xf=(e,t)=>Number(e)<Number(t),Cf=()=>(e,t)=>{let r={Deposit:"Deposit",From:"From",Asset:"Asset",Amount:"Amount",Available:"Available",MAX:"MAX","Deposit.details":"Deposit Details","Deposit.address":"Deposit Address",copySuccess:"Copied successfully",important:"Important",depositAllTip:"Please ensure you are depositing {coin} on {v} network","Deposit.Arrivaltime":"Arrival Time","Deposit.minDeposit":"Min Deposit","Deposit.block.txConfirm":"Block Confirmations","Deposit.Arrival.Estimated":"~{v} minutes",enableSystemProWithToken:"Enable {token} for {network}",enableTokenDesc:"You need to enable {token} to deposit on {network}",enableWithToken:"Enable {token}",confirmDeposit:"Confirm Deposit",switchNetwork:"Switch Network",minDeposit:"Min deposit: {amount} {token}",Equity:"Equity",availableDesc:"Available balance for trading"}[e]||e;return t&&Object.keys(t).forEach(o=>{r=r.replace(new RegExp(`{${o}}`,"g"),t[o])}),r},Sf=()=>({show:(e,t)=>{console.log("Toast:",e,t)}}),cn=[{token:"USDT",iconUrl:"/icons/usdt.svg",decimals:6,tokenAddress:"0xdAC17F958D2ee523a2206206994597C13D831ec7"},{token:"USDC",iconUrl:"/icons/usdc.svg",decimals:6,tokenAddress:"0xA0b86a33E6441b8435b662f0E2d0B8A0E6E6E6E6"}],fn=[{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}],Ui={wallet:"mpc",ethAddress:"0x1234567890123456789012345678901234567890",accountId:"123",l2Key:"0x123"},Vi={address:"0x1234567890123456789012345678901234567890"},zi={balance:{formatted:"1000.0"},allowance:{formatted:"0"}},Yi={multiChain:{minDeposit:10}},Of=({depositAmount:e,curSelectToken:t,curSelectTokenData:n,approved:r,currentActiveChain:o,currentEquity:s,amount:c,decimals:u,t:i,onDepositAmountChange:l,onApprove:a})=>{var d;return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"space-y-2",children:[x.jsx("label",{className:"text-sm font-medium text-gray-300",children:"Amount"}),x.jsxs("div",{className:"relative",children:[x.jsx("input",{type:"number",placeholder:"0",value:e,onChange:m=>l(m.target.value),className:"w-full bg-gray-800 border border-gray-600 rounded-lg px-4 py-3 text-white text-right pr-16 focus:outline-none focus:border-blue-500"}),x.jsx("button",{onClick:()=>{var f;const m=((f=n==null?void 0:n.balance)==null?void 0:f.formatted)||"0";l(m)},className:"absolute right-4 top-1/2 transform -translate-y-1/2 text-green-400 text-sm font-medium hover:text-green-300",children:"MAX"})]}),x.jsxs("div",{className:"flex justify-between items-center text-sm",children:[x.jsx("span",{className:"text-gray-400",children:"Available"}),x.jsxs("span",{className:"text-white",children:[((d=n==null?void 0:n.balance)==null?void 0:d.formatted)||"278.37"," ",t]})]})]}),!r&&un(e||"0",0)&&x.jsxs("div",{className:"bg-gray-800 border border-gray-600 rounded-lg p-4 space-y-3",children:[x.jsxs("h3",{className:"text-sm font-medium text-white",children:["Enable ",t," on ",o==null?void 0:o.chain]}),x.jsxs("p",{className:"text-xs text-gray-400",children:["You must enable ",t," first before you can deposit on"," ",o==null?void 0:o.chain,"."]}),x.jsxs("button",{className:"w-full bg-white hover:bg-gray-100 text-gray-900 px-4 py-2 rounded-lg text-sm font-medium transition-colors",onClick:a,children:["Enable ",t]})]}),x.jsx("div",{className:"space-y-3 text-sm",children:x.jsxs("div",{className:"flex justify-between items-center",children:[x.jsx("span",{className:"text-gray-400",children:"总资产"}),x.jsx("span",{className:"text-white font-medium",children:e?`0.00 → ${(parseFloat(e)||0).toFixed(2)} ${t}`:`0.00 ${t}`})]})})]})},Gi=({isOpen:e,onClose:t,config:n,isWalletConnected:r=!0,currentActiveAccount:o=Ui,smartWallet:s=Vi,tokens:c=cn,chains:u=fn,currentActiveChain:i=fn[0],approved:l=!1,depositAmount:a="",curSelectToken:d=(w=>(w=cn[0])==null?void 0:w.token)()||"",curSelectTokenData:m=zi,metadata:f=Yi,currentEquity:h=5e3,amount:v="1",onDepositAmountChange:b=()=>{},onTokenChange:C=()=>{},onChainChange:E=()=>{},onApprove:y=async()=>{},onDeposit:O=async()=>{}})=>{var R,X,G,Q;p.useEffect(()=>{console.log("🔍 Deposit: Props updated",{curSelectToken:d,currentActiveChain:i==null?void 0:i.chain,depositAmount:a})},[d,i,a]);const F=Cf(),{show:_}=Sf(),B=p.useMemo(()=>{var T,H;return o?Rs(o,s,l,i==null?void 0:i.chainId,(T=m==null?void 0:m.balance)==null?void 0:T.formatted,(H=m==null?void 0:m.allowance)==null?void 0:H.formatted):null},[o,s,l,i==null?void 0:i.chainId,m]),K=(B==null?void 0:B.getWalletType())==="evm",A=(B==null?void 0:B.getWalletType())==="mpc",j=Math.min(6,parseInt(((X=(R=c.find(T=>T.token===d))==null?void 0:R.decimals)==null?void 0:X.toString())||"6",10)),re=p.useCallback(async()=>{if(!B){console.error("Wallet adapter not available"),_("Wallet not connected");return}if(!r||!(o!=null&&o.ethAddress)){console.error("Wallet not connected"),_("Please connect your wallet first");return}try{A||await O(),t()}catch(T){console.error("Deposit error:",T),T instanceof Error&&(T.message.includes("ConnectorNotConnectedError")||T.message.includes("Connector not connected")?_("Wallet connection lost. Please reconnect your wallet."):_(`Deposit failed: ${T.message}`))}},[B,A,O,t,o,_,r]),U=p.useCallback(async()=>{if(!(!B||!K)){if(!r||!(o!=null&&o.ethAddress)){console.error("Wallet not connected"),_("Please connect your wallet first");return}try{await y()}catch(T){console.error("Approval error:",T),T instanceof Error&&(T.message.includes("ConnectorNotConnectedError")||T.message.includes("Connector not connected")?_("Wallet connection lost. Please reconnect your wallet."):_(`Approval failed: ${T.message}`))}}},[B,K,y,o,_,r]);return e?Ee.createPortal(x.jsxs("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-[999] w-screen h-screen",style:{zIndex:999},children:[x.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0",style:{backgroundColor:"#000",opacity:.6},onClick:t,"aria-hidden":"true"}),x.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center",children:x.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",children:[x.jsxs("div",{className:"flex items-center justify-between mb-4",children:[x.jsx("h2",{className:"text-lg font-semibold text-white",children:"Deposit [DEV MODE]"}),x.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:t,"aria-label":"Close",children:x.jsx(Is,{className:"h-4 w-4"})})]}),x.jsxs("div",{className:"",children:[x.jsx(yf,{currentActiveChain:i,chains:u,onChainChange:E,curSelectToken:d,tokens:c,onTokenChange:C,t:F}),A&&x.jsx(Ef,{walletAdapter:B,curSelectToken:d,currentActiveChain:i,metadata:f,t:F,showToast:_}),K&&x.jsx(Of,{depositAmount:a,curSelectToken:d,curSelectTokenData:m,approved:l,currentActiveChain:i,currentEquity:h,amount:v,decimals:j,t:F,onDepositAmountChange:b,onApprove:U})]}),x.jsx("div",{className:"mt-4",children:x.jsx("button",{className:Qs("w-full bg-white hover:bg-gray-100 text-gray-900 py-3 px-4 rounded-xl font-medium transition-colors",!l&&K&&un(a||"0",0)?"opacity-50 cursor-not-allowed":""),onClick:re,disabled:!l&&K&&un(a||"0",0),children:A?"Deposit":!l&&un(a||"0",0)?`Enable ${d}`:xf(a||"0",((G=f==null?void 0:f.multiChain)==null?void 0:G.minDeposit)||0)?`Min ${(Q=f==null?void 0:f.multiChain)==null?void 0:Q.minDeposit} ${d}`:"Confirm Deposit"})})]})})]}),document.body):null};var cr={exports:{}},dn={exports:{}},ie={};/** @license React v16.13.1
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
|
|
111
|
-
* react-is.development.js
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
(c) Sindre Sorhus
|
|
120
|
-
@license MIT
|
|
121
|
-
*/var fr,Ji;function Pf(){if(Ji)return fr;Ji=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var c={},u=0;u<10;u++)c["_"+String.fromCharCode(u)]=u;var i=Object.getOwnPropertyNames(c).map(function(a){return c[a]});if(i.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(a){l[a]=a}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return fr=o()?Object.assign:function(s,c){for(var u,i=r(s),l,a=1;a<arguments.length;a++){u=Object(arguments[a]);for(var d in u)t.call(u,d)&&(i[d]=u[d]);if(e){l=e(u);for(var m=0;m<l.length;m++)n.call(u,l[m])&&(i[l[m]]=u[l[m]])}}return i},fr}var dr,Zi;function pr(){if(Zi)return dr;Zi=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return dr=e,dr}var mr,es;function ts(){return es||(es=1,mr=Function.call.bind(Object.prototype.hasOwnProperty)),mr}var hr,ns;function Mf(){if(ns)return hr;ns=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=pr(),n={},r=ts();e=function(s){var c="Warning: "+s;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}}}function o(s,c,u,i,l){if(process.env.NODE_ENV!=="production"){for(var a in s)if(r(s,a)){var d;try{if(typeof s[a]!="function"){var m=Error((i||"React class")+": "+u+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw m.name="Invariant Violation",m}d=s[a](c,a,i,u,null,t)}catch(h){d=h}if(d&&!(d instanceof Error)&&e((i||"React class")+": type specification of "+u+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var f=l?l():"";e("Failed "+u+" type: "+d.message+(f??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},hr=o,hr}var gr,rs;function Af(){if(rs)return gr;rs=1;var e=Qi(),t=Pf(),n=pr(),r=ts(),o=Mf(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(u){var i="Warning: "+u;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}});function c(){return null}return gr=function(u,i){var l=typeof Symbol=="function"&&Symbol.iterator,a="@@iterator";function d(S){var M=S&&(l&&S[l]||S[a]);if(typeof M=="function")return M}var m="<<anonymous>>",f={array:C("array"),bigint:C("bigint"),bool:C("boolean"),func:C("function"),number:C("number"),object:C("object"),string:C("string"),symbol:C("symbol"),any:E(),arrayOf:y,element:O(),elementType:w(),instanceOf:F,node:A(),objectOf:B,oneOf:_,oneOfType:K,shape:re,exact:U};function h(S,M){return S===M?S!==0||1/S===1/M:S!==S&&M!==M}function v(S,M){this.message=S,this.data=M&&typeof M=="object"?M:{},this.stack=""}v.prototype=Error.prototype;function b(S){if(process.env.NODE_ENV!=="production")var M={},k=0;function I(J,q,P,W,z,Z,ye){if(W=W||m,Z=Z||P,ye!==n){if(i){var D=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw D.name="Invariant Violation",D}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var De=W+":"+P;!M[De]&&k<3&&(s("You are manually calling a React.PropTypes validation function for the `"+Z+"` prop on `"+W+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),M[De]=!0,k++)}}return q[P]==null?J?q[P]===null?new v("The "+z+" `"+Z+"` is marked as required "+("in `"+W+"`, but its value is `null`.")):new v("The "+z+" `"+Z+"` is marked as required in "+("`"+W+"`, but its value is `undefined`.")):null:S(q,P,W,z,Z)}var V=I.bind(null,!1);return V.isRequired=I.bind(null,!0),V}function C(S){function M(k,I,V,J,q,P){var W=k[I],z=G(W);if(z!==S){var Z=Q(W);return new v("Invalid "+J+" `"+q+"` of type "+("`"+Z+"` supplied to `"+V+"`, expected ")+("`"+S+"`."),{expectedType:S})}return null}return b(M)}function E(){return b(c)}function y(S){function M(k,I,V,J,q){if(typeof S!="function")return new v("Property `"+q+"` of component `"+V+"` has invalid PropType notation inside arrayOf.");var P=k[I];if(!Array.isArray(P)){var W=G(P);return new v("Invalid "+J+" `"+q+"` of type "+("`"+W+"` supplied to `"+V+"`, expected an array."))}for(var z=0;z<P.length;z++){var Z=S(P,z,V,J,q+"["+z+"]",n);if(Z instanceof Error)return Z}return null}return b(M)}function O(){function S(M,k,I,V,J){var q=M[k];if(!u(q)){var P=G(q);return new v("Invalid "+V+" `"+J+"` of type "+("`"+P+"` supplied to `"+I+"`, expected a single ReactElement."))}return null}return b(S)}function w(){function S(M,k,I,V,J){var q=M[k];if(!e.isValidElementType(q)){var P=G(q);return new v("Invalid "+V+" `"+J+"` of type "+("`"+P+"` supplied to `"+I+"`, expected a single ReactElement type."))}return null}return b(S)}function F(S){function M(k,I,V,J,q){if(!(k[I]instanceof S)){var P=S.name||m,W=H(k[I]);return new v("Invalid "+J+" `"+q+"` of type "+("`"+W+"` supplied to `"+V+"`, expected ")+("instance of `"+P+"`."))}return null}return b(M)}function _(S){if(!Array.isArray(S))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),c;function M(k,I,V,J,q){for(var P=k[I],W=0;W<S.length;W++)if(h(P,S[W]))return null;var z=JSON.stringify(S,function(ye,D){var De=Q(D);return De==="symbol"?String(D):D});return new v("Invalid "+J+" `"+q+"` of value `"+String(P)+"` "+("supplied to `"+V+"`, expected one of "+z+"."))}return b(M)}function B(S){function M(k,I,V,J,q){if(typeof S!="function")return new v("Property `"+q+"` of component `"+V+"` has invalid PropType notation inside objectOf.");var P=k[I],W=G(P);if(W!=="object")return new v("Invalid "+J+" `"+q+"` of type "+("`"+W+"` supplied to `"+V+"`, expected an object."));for(var z in P)if(r(P,z)){var Z=S(P,z,V,J,q+"."+z,n);if(Z instanceof Error)return Z}return null}return b(M)}function K(S){if(!Array.isArray(S))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),c;for(var M=0;M<S.length;M++){var k=S[M];if(typeof k!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+T(k)+" at index "+M+"."),c}function I(V,J,q,P,W){for(var z=[],Z=0;Z<S.length;Z++){var ye=S[Z],D=ye(V,J,q,P,W,n);if(D==null)return null;D.data&&r(D.data,"expectedType")&&z.push(D.data.expectedType)}var De=z.length>0?", expected one of type ["+z.join(", ")+"]":"";return new v("Invalid "+P+" `"+W+"` supplied to "+("`"+q+"`"+De+"."))}return b(I)}function A(){function S(M,k,I,V,J){return R(M[k])?null:new v("Invalid "+V+" `"+J+"` supplied to "+("`"+I+"`, expected a ReactNode."))}return b(S)}function j(S,M,k,I,V){return new v((S||"React class")+": "+M+" type `"+k+"."+I+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+V+"`.")}function re(S){function M(k,I,V,J,q){var P=k[I],W=G(P);if(W!=="object")return new v("Invalid "+J+" `"+q+"` of type `"+W+"` "+("supplied to `"+V+"`, expected `object`."));for(var z in S){var Z=S[z];if(typeof Z!="function")return j(V,J,q,z,Q(Z));var ye=Z(P,z,V,J,q+"."+z,n);if(ye)return ye}return null}return b(M)}function U(S){function M(k,I,V,J,q){var P=k[I],W=G(P);if(W!=="object")return new v("Invalid "+J+" `"+q+"` of type `"+W+"` "+("supplied to `"+V+"`, expected `object`."));var z=t({},k[I],S);for(var Z in z){var ye=S[Z];if(r(S,Z)&&typeof ye!="function")return j(V,J,q,Z,Q(ye));if(!ye)return new v("Invalid "+J+" `"+q+"` key `"+Z+"` supplied to `"+V+"`.\nBad object: "+JSON.stringify(k[I],null," ")+`
|
|
122
|
-
Valid keys: `+JSON.stringify(Object.keys(S),null," "));var D=ye(P,Z,V,J,q+"."+Z,n);if(D)return D}return null}return b(M)}function R(S){switch(typeof S){case"number":case"string":case"undefined":return!0;case"boolean":return!S;case"object":if(Array.isArray(S))return S.every(R);if(S===null||u(S))return!0;var M=d(S);if(M){var k=M.call(S),I;if(M!==S.entries){for(;!(I=k.next()).done;)if(!R(I.value))return!1}else for(;!(I=k.next()).done;){var V=I.value;if(V&&!R(V[1]))return!1}}else return!1;return!0;default:return!1}}function X(S,M){return S==="symbol"?!0:M?M["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&M instanceof Symbol:!1}function G(S){var M=typeof S;return Array.isArray(S)?"array":S instanceof RegExp?"object":X(M,S)?"symbol":M}function Q(S){if(typeof S>"u"||S===null)return""+S;var M=G(S);if(M==="object"){if(S instanceof Date)return"date";if(S instanceof RegExp)return"regexp"}return M}function T(S){var M=Q(S);switch(M){case"array":case"object":return"an "+M;case"boolean":case"date":case"regexp":return"a "+M;default:return M}}function H(S){return!S.constructor||!S.constructor.name?m:S.constructor.name}return f.checkPropTypes=o,f.resetWarningCache=o.resetWarningCache,f.PropTypes=f,f},gr}var vr,os;function Df(){if(os)return vr;os=1;var e=pr();function t(){}function n(){}return n.resetWarningCache=t,vr=function(){function r(c,u,i,l,a,d){if(d!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}r.isRequired=r;function o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},vr}if(process.env.NODE_ENV!=="production"){var _f=Qi(),Ff=!0;cr.exports=Af()(_f.isElement,Ff)}else cr.exports=Df()();var Lf=cr.exports;const Nf=Cs(Lf);let He=null;const If={symbol:"USDT"},is=p.forwardRef((e,t)=>{var f;const[n,r]=p.useState(!1),[o,s]=p.useState({}),c=p.useCallback((h={})=>{s(h),r(!0)},[]),u=p.useCallback(h=>{console.log("🔄 DepositManager: Updating options",h),s(v=>{const b={...v,...h};return console.log("🔄 DepositManager: New options state",b),b})},[]),i=p.useCallback(()=>{r(!1),o.onClose&&o.onClose()},[o.onClose]),l=p.useCallback(()=>n,[n]);p.useImperativeHandle(t,()=>({openDeposit:c,closeDeposit:i,updateDepositOptions:u,isOpen:l}),[c,i,u,l]),p.useEffect(()=>(He={openDeposit:c,closeDeposit:i,updateDepositOptions:u,isOpen:l},()=>{He=null}),[c,i,u,l]);const a=p.useCallback(h=>{console.log("🔄 DepositManager: Token change triggered",h),s(v=>{const b={...v,curSelectToken:h};return console.log("🔄 DepositManager: Updated internal state",b),b}),o.onTokenChange&&o.onTokenChange(h)},[o.onTokenChange]),d=p.useCallback(h=>{console.log("🔄 DepositManager: Chain change triggered",h),o.onChainChange&&(console.log("🔄 DepositManager: Calling parent onChainChange",h),o.onChainChange(h))},[o.onChainChange]),m=p.useCallback(h=>{console.log("🔄 DepositManager: Amount change triggered",h),s(v=>{const b={...v,depositAmount:h};return console.log("🔄 DepositManager: Updated internal state",b),b}),o.onDepositAmountChange&&o.onDepositAmountChange(h)},[o.onDepositAmountChange]);return p.useEffect(()=>{console.log("🔍 DepositManager: Current options",{curSelectToken:o.curSelectToken,currentActiveChain:o.currentActiveChain,depositAmount:o.depositAmount})},[o.curSelectToken,o.currentActiveChain,o.depositAmount]),x.jsx(Gi,{isOpen:n,onClose:i,config:o.config||If,isWalletConnected:o.isWalletConnected??!0,currentActiveAccount:o.currentActiveAccount||Ui,smartWallet:o.smartWallet||Vi,tokens:o.tokens||cn,chains:o.chains||fn,currentActiveChain:o.currentActiveChain||fn[0],approved:o.approved??!1,depositAmount:o.depositAmount||"",curSelectToken:o.curSelectToken||((f=cn[0])==null?void 0:f.token)||"",curSelectTokenData:o.curSelectTokenData||zi,metadata:o.metadata||Yi,currentEquity:o.currentEquity??5e3,amount:o.amount||"1",onDepositAmountChange:m,onTokenChange:a,onChainChange:d,onApprove:o.onApprove||(async()=>{}),onDeposit:o.onDeposit||(async()=>{})})});is.displayName="DepositManager";const ss=e=>{if(!He){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}He.openDeposit(e)},ls=()=>{if(!He){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}He.closeDeposit()},jf=e=>{if(console.log("🌍 Global updateDepositOptions called with:",e),!He){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}console.log("🌍 Global updateDepositOptions: calling instance method"),He.updateDepositOptions(e)},kf=()=>He?He.isOpen():!1,Rf=()=>({openDeposit:ss,closeDeposit:ls,updateDepositOptions:jf,isOpen:kf});Nf.node,p.createContext(null);const Wf=({isOpen:e,onClose:t,config:n})=>e?x.jsx("div",{className:"withdraw-modal",children:x.jsx("div",{className:"modal-overlay",onClick:t,children:x.jsxs("div",{className:"modal-content",onClick:r=>r.stopPropagation(),children:[x.jsxs("h2",{children:["Withdraw ",n.symbol]}),x.jsxs("p",{children:["Symbol: ",n.symbol]}),x.jsx("button",{onClick:t,children:"Close"})]})})}):null;ce.ComponentProvider=$s,ce.Deposit=Gi,ce.DepositManager=is,ce.MPCChainTokenSelector=wf,ce.Withdraw=Wf,ce.closeDeposit=ls,ce.openDeposit=ss,ce.useDeposit=Ps,ce.useDepositManager=Rf,ce.useWithdraw=Ms,Object.defineProperty(ce,Symbol.toStringTag,{value:"Module"})});
|
|
103
|
+
`,children:e.filter(s=>s[i==="mpc"?"allowAaDeposit":"allowDeposit"]!==!1).map(s=>S.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})=>S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs("div",{className:"flex items-center space-x-3",children:[s.chainIconUrl?S.jsx("img",{src:s.chainIconUrl,alt:s.chain,className:"w-5 h-5 rounded-full"}):S.jsx("div",{className:"w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center",children:S.jsx("span",{className:"text-xs text-white font-bold",children:s.chain.charAt(0)})}),S.jsx("div",{className:"flex flex-col",children:S.jsx("span",{className:`text-sm font-medium ${a||c?"text-text-primary":"text-text-tertiary"}`,children:s.chain})})]}),a&&S.jsx(Gs,{className:"w-4 h-4 text-blue-400"})]})},s.chainId))})})]})})})},no=({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 S.jsxs("div",{className:"space-y-4",children:[S.jsx(pp,{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&&S.jsx(dp,{tokens:d,selectedToken:p,onTokenChange:s,className:"w-full"}):S.jsx("div",{className:"w-full h-9 bg-fill-input-primary rounded-lg flex items-center justify-center",children:S.jsx("span",{className:"text-sm text-gray-400",children:"No tokens available"})})]})},mp=(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"},ro=(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 ro(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}},hp=(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)},Bn={ETHEREUM:1,ARBITRUM:42161,ARBITRUM_SEPOLIA:421614,SEPOLIA:11155111},gp=[Bn.ETHEREUM,Bn.SEPOLIA,Bn.ARBITRUM,Bn.ARBITRUM_SEPOLIA],vp=e=>{if(e.chainId!==void 0){const t=typeof e.chainId=="string"?parseInt(e.chainId,10):e.chainId;return!gp.includes(t)}return!0},Ys=(e,t,n)=>{const r=typeof e=="string"?parseInt(e,10):e,o=r===42161||r===421614,i=(t==null?void 0:t.toUpperCase())==="USDT";if(!o||!i)return!1;try{const l=new xe(n||"0"),u=new xe("200000");return l.isNaN()||u.isNaN()?!1:l.gte(u)}catch{return!1}},bp=[{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}],oo={wallet:"mpc",ethAddress:"",accountId:"",l2Key:""},io={address:""},so={multiChain:{minDeposit:10}};var Wn={},yp=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=yp,Ks={"text/plain":"Text","text/html":"Url",default:"Text"},wp="Copy to clipboard: #{key}, Enter";function Ep(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function Sp(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=Ks[t.format]||Ks.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=Ep("message"in t?t.message:wp),window.prompt(r,e)}}finally{l&&(typeof l.removeRange=="function"?l.removeRange(i):l.removeAllRanges()),u&&document.body.removeChild(u),o()}return s}var Cp=Sp;function lo(e){"@babel/helpers - typeof";return lo=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},lo(e)}Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.CopyToClipboard=void 0;var Un=qs(m),Op=qs(Cp),Tp=["text","onCopy","options","children"];function qs(e){return e&&e.__esModule?e:{default:e}}function Xs(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?Xs(Object(n),!0).forEach(function(r){uo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xs(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Np(e,t){if(e==null)return{};var n=Lp(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 Lp(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 Dp(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 $p(e,t,n){return t&&Dp(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&&ao(e,t)}function ao(e,t){return ao=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},ao(e,t)}function Mp(e){var t=jp();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 Ip(this,o)}}function Ip(e,t){if(t&&(lo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zs(e)}function Zs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jp(){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 uo(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){Ap(n,e);var t=Mp(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)),uo(Zs(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,Op.default)(a,p);c&&c(a,g),f&&f.props&&typeof f.props.onClick=="function"&&f.props.onClick(u)}),r}return $p(n,[{key:"render",value:function(){var o=this.props;o.text,o.onCopy,o.options;var i=o.children,l=Np(o,Tp),u=Un.default.Children.only(i);return Un.default.cloneElement(u,Qs(Qs({},l),{},{onClick:this.onClick}))}}]),n}(Un.default.PureComponent);Wn.CopyToClipboard=Js,uo(Js,"defaultProps",{onCopy:void 0,options:void 0});var Fp=Wn,co=Fp.CopyToClipboard;co.CopyToClipboard=co;var Rp=co;const kp=sa(Rp);var _p=Object.defineProperty,zn=Object.getOwnPropertySymbols,el=Object.prototype.hasOwnProperty,tl=Object.prototype.propertyIsEnumerable,nl=(e,t,n)=>t in e?_p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fo=(e,t)=>{for(var n in t||(t={}))el.call(t,n)&&nl(e,n,t[n]);if(zn)for(var n of zn(t))tl.call(t,n)&&nl(e,n,t[n]);return e},po=(e,t)=>{var n={};for(var r in e)el.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&&tl.call(e,r)&&(n[r]=e[r]);return n};/**
|
|
104
|
+
* @license QR Code generator library (TypeScript)
|
|
105
|
+
* Copyright (c) Project Nayuki.
|
|
106
|
+
* SPDX-License-Identifier: MIT
|
|
107
|
+
*/var Pt;(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,F=l.getTotalBits(s,g);if(F<=N){v=F;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 F of N.getData())E.push(F)}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,F)=>w[F>>>3]|=N<<7-(F&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,F=0;N<d;N++){let j=s.slice(F,F+v-p+(N<g?0:1));F+=j.length;const k=ee.reedSolomonComputeRemainder(j,M);N<g&&j.push(0),E.push(j.concat(k))}let w=[];for(let N=0;N<E[0].length;N++)E.forEach((F,j)=>{(N!=v-p||j>=g)&&w.push(F[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})(Pt||(Pt={})),(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={}))})(Pt||(Pt={})),(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={}))})(Pt||(Pt={}));var kt=Pt;/**
|
|
108
|
+
* @license qrcode.react
|
|
109
|
+
* Copyright (c) Paul O'Shannessy
|
|
110
|
+
* SPDX-License-Identifier: ISC
|
|
111
|
+
*/var Bp={L:kt.QrCode.Ecc.LOW,M:kt.QrCode.Ecc.MEDIUM,Q:kt.QrCode.Ecc.QUARTILE,H:kt.QrCode.Ecc.HIGH},rl=128,ol="L",il="#FFFFFF",sl="#000000",ll=!1,al=1,Wp=4,Up=0,Vp=.1;function ul(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 cl(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 zp(e,t,n,r){if(r==null)return null;const o=e.length+n*2,i=Math.floor(t*Vp),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 Hp(e,t){return t!=null?Math.max(Math.floor(t),0):e?Wp:Up}function fl({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,Bp[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=Hp(r,o),v=f.length+g*2,E=zp(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 Gp=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),Yp=m.forwardRef(function(t,n){const r=t,{value:o,size:i=rl,level:l=ol,bgColor:u=il,fgColor:s=sl,includeMargin:a=ll,minVersion:c=al,boostLevel:d,marginSize:p,imageSettings:f}=r,v=po(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:E}=v,M=po(v,["style"]),w=f==null?void 0:f.src,N=m.useRef(null),F=m.useRef(null),j=m.useCallback(C=>{N.current=C,typeof n=="function"?n(C):n&&(n.current=C)},[n]),[k,B]=m.useState(!1),{margin:h,cells:b,numCells:y,calculatedImageSettings:$}=fl({value:o,level:l,minVersion:c,boostLevel:d,includeMargin:a,marginSize:p,imageSettings:f,size:i});m.useEffect(()=>{if(N.current!=null){const C=N.current,O=C.getContext("2d");if(!O)return;let T=b;const P=F.current,x=$!=null&&P!==null&&P.complete&&P.naturalHeight!==0&&P.naturalWidth!==0;x&&$.excavation!=null&&(T=cl(b,$.excavation));const I=window.devicePixelRatio||1;C.height=C.width=i*I;const _=i/y*I;O.scale(_,_),O.fillStyle=u,O.fillRect(0,0,y,y),O.fillStyle=s,Gp?O.fill(new Path2D(ul(T,h))):b.forEach(function(V,W){V.forEach(function(Y,q){Y&&O.fillRect(q+h,W+h,1,1)})}),$&&(O.globalAlpha=$.opacity),x&&O.drawImage(P,$.x+h,$.y+h,$.w,$.h)}}),m.useEffect(()=>{B(!1)},[w]);const D=fo({height:i,width:i},E);let L=null;return w!=null&&(L=m.createElement("img",{src:w,key:w,style:{display:"none"},onLoad:()=>{B(!0)},ref:F,crossOrigin:$==null?void 0:$.crossOrigin})),m.createElement(m.Fragment,null,m.createElement("canvas",fo({style:D,height:i,width:i,ref:j,role:"img"},M)),L)});Yp.displayName="QRCodeCanvas";var dl=m.forwardRef(function(t,n){const r=t,{value:o,size:i=rl,level:l=ol,bgColor:u=il,fgColor:s=sl,includeMargin:a=ll,minVersion:c=al,boostLevel:d,title:p,marginSize:f,imageSettings:g}=r,v=po(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:E,cells:M,numCells:w,calculatedImageSettings:N}=fl({value:o,level:l,minVersion:c,boostLevel:d,includeMargin:a,marginSize:f,imageSettings:g,size:i});let F=M,j=null;g!=null&&N!=null&&(N.excavation!=null&&(F=cl(M,N.excavation)),j=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=ul(F,E);return m.createElement("svg",fo({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"}),j)});dl.displayName="QRCodeSVG";function Kp(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function qp(){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 pl(){return/apple/i.test(navigator.vendor)}function Xp(){return Kp().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Qp(){return qp().includes("jsdom/")}const ml="data-floating-ui-focusable",Zp="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function mo(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&&Mr(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Bt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ho(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 hl(e){return Ce(e)&&e.matches(Zp)}function em(e){if(!e||Qp())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function tm(e){return e?e.hasAttribute(ml)?e:e.querySelector("["+ml+"]")||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 nm(e){return"nativeEvent"in e}function rn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var rm=typeof document<"u",om=function(){},rt=rm?m.useLayoutEffect:om;const im={...R};function Gn(e){const t=R.useRef(e);return rt(()=>{t.current=e}),t}const sm=im.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 sm(()=>{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 gl=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function vl(e,t){const n=Ji(e,gl()),r=n.length;if(r===0)return;const o=mo(nt(e)),i=n.indexOf(o),l=i===-1?t===1?0:r-1:i+t;return n[l]}function lm(e){return vl(nt(e).body,1)||e}function am(e){return vl(nt(e).body,-1)||e}function go(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!_t(n,r)}function um(e){Ji(e,gl()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function bl(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 cm="data-floating-ui-focusable",yl="active",xl="selected",fm={...R};let wl=!1,dm=0;const El=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+dm++;function pm(){const[e,t]=R.useState(()=>wl?El():void 0);return rt(()=>{e==null&&t(El())},[]),R.useEffect(()=>{wl=!0},[]),e}const vo=fm.useId||pm;let bo;process.env.NODE_ENV!=="production"&&(bo=new Set);function mm(){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=bo)!=null&&e.has(o))){var i;(i=bo)==null||i.add(o),console.error(o)}}function hm(){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 gm=R.createContext(null),vm=R.createContext(null),yo=()=>{var e;return((e=R.useContext(gm))==null?void 0:e.id)||null},xo=()=>R.useContext(vm);function on(e){return"data-floating-ui-"+e}function ze(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Sl=on("safe-polygon");function wo(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 Eo(e){return typeof e=="function"?e():e}function bm(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=yo(),v=Gn(a),E=Gn(s),M=Gn(n),w=Gn(d),N=R.useRef(),F=R.useRef(-1),j=R.useRef(),k=R.useRef(-1),B=R.useRef(!0),h=R.useRef(!1),b=R.useRef(()=>{}),y=R.useRef(!1),$=ot(()=>{var P;const x=(P=o.current.openEvent)==null?void 0:P.type;return(x==null?void 0:x.includes("mouse"))&&x!=="mousedown"});R.useEffect(()=>{if(!u)return;function P(x){let{open:I}=x;I||(ze(F),ze(k),B.current=!0,y.current=!1)}return i.on("openchange",P),()=>{i.off("openchange",P)}},[u,i]),R.useEffect(()=>{if(!u||!v.current||!n)return;function P(I){$()&&r(!1,I,"hover")}const x=nt(l.floating).documentElement;return x.addEventListener("mouseleave",P),()=>{x.removeEventListener("mouseleave",P)}},[l.floating,n,r,u,v,$]);const D=R.useCallback(function(P,x,I){x===void 0&&(x=!0),I===void 0&&(I="hover");const _=wo(E.current,"close",N.current);_&&!j.current?(ze(F),F.current=window.setTimeout(()=>r(!1,P,I),_)):x&&(ze(F),r(!1,P,I))},[E,r]),L=ot(()=>{b.current(),j.current=void 0}),C=ot(()=>{if(h.current){const P=nt(l.floating).body;P.style.pointerEvents="",P.removeAttribute(Sl),h.current=!1}}),O=ot(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);R.useEffect(()=>{if(!u)return;function P(W){if(ze(F),B.current=!1,c&&!rn(N.current)||Eo(w.current)>0&&!wo(E.current,"open"))return;const Y=wo(E.current,"open",N.current);Y?F.current=window.setTimeout(()=>{M.current||r(!0,W,"hover")},Y):n||r(!0,W,"hover")}function x(W){if(O()){C();return}b.current();const Y=nt(l.floating);if(ze(k),y.current=!1,v.current&&o.current.floatingContext){n||ze(F),j.current=v.current({...o.current.floatingContext,tree:f,x:W.clientX,y:W.clientY,onClose(){C(),L(),O()||D(W,!0,"safe-polygon")}});const G=j.current;Y.addEventListener("mousemove",G),b.current=()=>{Y.removeEventListener("mousemove",G)};return}(N.current==="touch"?!_t(l.floating,W.relatedTarget):!0)&&D(W)}function I(W){O()||o.current.floatingContext&&(v.current==null||v.current({...o.current.floatingContext,tree:f,x:W.clientX,y:W.clientY,onClose(){C(),L(),O()||D(W)}})(W))}function _(){ze(F)}function V(W){O()||D(W,!1)}if(oe(l.domReference)){const W=l.domReference,Y=l.floating;return n&&W.addEventListener("mouseleave",I),p&&W.addEventListener("mousemove",P,{once:!0}),W.addEventListener("mouseenter",P),W.addEventListener("mouseleave",x),Y&&(Y.addEventListener("mouseleave",I),Y.addEventListener("mouseenter",_),Y.addEventListener("mouseleave",V)),()=>{n&&W.removeEventListener("mouseleave",I),p&&W.removeEventListener("mousemove",P),W.removeEventListener("mouseenter",P),W.removeEventListener("mouseleave",x),Y&&(Y.removeEventListener("mouseleave",I),Y.removeEventListener("mouseenter",_),Y.removeEventListener("mouseleave",V))}}},[l,u,e,c,p,D,L,C,r,n,M,f,E,v,o,O,w]),rt(()=>{var P;if(u&&n&&(P=v.current)!=null&&(P=P.__options)!=null&&P.blockPointerEvents&&$()){h.current=!0;const I=l.floating;if(oe(l.domReference)&&I){var x;const _=nt(l.floating).body;_.setAttribute(Sl,"");const V=l.domReference,W=f==null||(x=f.nodesRef.current.find(Y=>Y.id===g))==null||(x=x.context)==null?void 0:x.elements.floating;return W&&(W.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,y.current=!1,L(),C())},[n,L,C]),R.useEffect(()=>()=>{L(),ze(F),ze(k),C()},[u,l.domReference,L,C]);const T=R.useMemo(()=>{function P(x){N.current=x.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(x){const{nativeEvent:I}=x;function _(){!B.current&&!M.current&&r(!0,I,"hover")}c&&!rn(N.current)||n||Eo(w.current)===0||y.current&&x.movementX**2+x.movementY**2<2||(ze(k),N.current==="touch"?_():(y.current=!0,k.current=window.setTimeout(_,Eo(w.current))))}}},[c,r,n,M,w]);return R.useMemo(()=>u?{reference:T}:{},[u,T])}const Cl={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},Ol=R.forwardRef(function(t,n){const[r,o]=R.useState();rt(()=>{pl()&&o("button")},[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[on("focus-guard")]:"",style:Cl};return S.jsx("span",{...t,...i})}),Tl=R.createContext(null),Nl=on("portal");function ym(e){e===void 0&&(e={});const{id:t,root:n}=e,r=vo(),o=wm(),[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(Nl,""),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&&!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(Nl,""),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=ym({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&&go(E)&&(E.type==="focusin"?bl:um)(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||bl(i))},[f,i]),S.jsxs(Tl.Provider,{value:R.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:a,beforeInsideRef:c,afterInsideRef:d,portalNode:i,setFocusManagerState:u}),[o,i]),children:[g&&i&&S.jsx(Ol,{"data-type":"outside",ref:s,onFocus:v=>{if(go(v,i)){var E;(E=c.current)==null||E.focus()}else{const M=l?l.domReference:null,w=am(M);w==null||w.focus()}}}),g&&i&&S.jsx("span",{"aria-owns":i.id,style:Cl}),i&&Vt.createPortal(t,i),g&&i&&S.jsx(Ol,{"data-type":"outside",ref:a,onFocus:v=>{if(go(v,i)){var E;(E=d.current)==null||E.focus()}else{const M=l?l.domReference:null,w=lm(M);w==null||w.focus(),l!=null&&l.closeOnFocusOut&&(l==null||l.onOpenChange(!1,v.nativeEvent,"focus-out"))}}})]})}const wm=()=>R.useContext(Tl);function Ll(e){return Ce(e.target)&&e.target.tagName==="BUTTON"}function Em(e){return Ce(e.target)&&e.target.tagName==="A"}function Pl(e){return hl(e)}function Sm(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||Ll(v))&&(v.key===" "&&!Pl(i)&&(v.preventDefault(),f.current=!0),!Em(v)&&v.key==="Enter"&&r(!(n&&s),v.nativeEvent,"click"))},onKeyUp(v){v.defaultPrevented||!c||Ll(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 Cm={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Om={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Dl=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 Tm(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:F}=Dl(f),{escapeKey:j,outsidePress:k}=Dl(g),B=R.useRef(!1),h=ot(C=>{var O;if(!n||!l||!u||C.key!=="Escape"||B.current)return;const T=(O=i.current.floatingContext)==null?void 0:O.nodeId,P=v?Hn(v.nodesRef.current,T):[];if(!N&&(C.stopPropagation(),P.length>0)){let x=!0;if(P.forEach(I=>{var _;if((_=I.context)!=null&&_.open&&!I.context.dataRef.current.__escapeKeyBubbles){x=!1;return}}),!x)return}r(!1,nm(C)?C.nativeEvent:C,"escape-key")}),b=ot(C=>{var O;const T=()=>{var P;h(C),(P=Bt(C))==null||P.removeEventListener("keydown",T)};(O=Bt(C))==null||O.addEventListener("keydown",T)}),y=ot(C=>{var O;const T=i.current.insideReactTree;i.current.insideReactTree=!1;const P=w.current;if(w.current=!1,a==="click"&&P||T||typeof M=="function"&&!M(C))return;const x=Bt(C),I="["+on("inert")+"]",_=nt(o.floating).querySelectorAll(I);let V=oe(x)?x:null;for(;V&&!ut(V);){const G=ct(V);if(ut(G)||!oe(G))break;V=G}if(_.length&&oe(x)&&!Jp(x)&&!_t(x,o.floating)&&Array.from(_).every(G=>!_t(V,G)))return;if(Ce(x)&&L){const G=ut(x),H=Ve(x),z=/auto|scroll/,J=G||z.test(H.overflowX),se=G||z.test(H.overflowY),he=J&&x.clientWidth>0&&x.scrollWidth>x.clientWidth,$e=se&&x.clientHeight>0&&x.scrollHeight>x.clientHeight,it=H.direction==="rtl",Ee=$e&&(it?C.offsetX<=x.offsetWidth-x.clientWidth:C.offsetX>x.clientWidth),ge=he&&C.offsetY>x.clientHeight;if(Ee||ge)return}const W=(O=i.current.floatingContext)==null?void 0:O.nodeId,Y=v&&Hn(v.nodesRef.current,W).some(G=>{var H;return ho(C,(H=G.context)==null?void 0:H.elements.floating)});if(ho(C,o.floating)||ho(C,o.domReference)||Y)return;const q=v?Hn(v.nodesRef.current,W):[];if(q.length>0){let G=!0;if(q.forEach(H=>{var z;if((z=H.context)!=null&&z.open&&!H.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}r(!1,C,"outside-press")}),$=ot(C=>{var O;const T=()=>{var P;y(C),(P=Bt(C))==null||P.removeEventListener(a,T)};(O=Bt(C))==null||O.addEventListener(a,T)});R.useEffect(()=>{if(!n||!l)return;i.current.__escapeKeyBubbles=N,i.current.__outsidePressBubbles=F;let C=-1;function O(_){r(!1,_,"ancestor-scroll")}function T(){window.clearTimeout(C),B.current=!0}function P(){C=window.setTimeout(()=>{B.current=!1},Sn()?5:0)}const x=nt(o.floating);u&&(x.addEventListener("keydown",j?b:h,j),x.addEventListener("compositionstart",T),x.addEventListener("compositionend",P)),M&&x.addEventListener(a,k?$:y,k);let I=[];return p&&(oe(o.domReference)&&(I=yt(o.domReference)),oe(o.floating)&&(I=I.concat(yt(o.floating))),!oe(o.reference)&&o.reference&&o.reference.contextElement&&(I=I.concat(yt(o.reference.contextElement)))),I=I.filter(_=>{var V;return _!==((V=x.defaultView)==null?void 0:V.visualViewport)}),I.forEach(_=>{_.addEventListener("scroll",O,{passive:!0})}),()=>{u&&(x.removeEventListener("keydown",j?b:h,j),x.removeEventListener("compositionstart",T),x.removeEventListener("compositionend",P)),M&&x.removeEventListener(a,k?$:y,k),I.forEach(_=>{_.removeEventListener("scroll",O)}),window.clearTimeout(C)}},[i,o,u,M,a,n,r,p,l,N,F,h,j,b,y,k,$]),R.useEffect(()=>{i.current.insideReactTree=!1},[i,M,a]);const D=R.useMemo(()=>({onKeyDown:h,...c&&{[Cm[d]]:C=>{r(!1,C.nativeEvent,"reference-press")},...d!=="click"&&{onClick(C){r(!1,C.nativeEvent,"reference-press")}}}}),[h,r,c,d]),L=R.useMemo(()=>({onKeyDown:h,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[Om[a]]:()=>{i.current.insideReactTree=!0}}),[h,a,i]);return R.useMemo(()=>l?{reference:D,floating:L}:{},[l,D,L])}function Nm(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=vo(),i=R.useRef({}),[l]=R.useState(()=>hm()),u=yo()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!oe(f)&&mm("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 Lm(e){e===void 0&&(e={});const{nodeId:t}=e,n=Nm({...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 F=oe(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),getClientRects:()=>N.getClientRects(),contextElement:N}:N;s(F),f.refs.setReference(F)},[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(F=>F.id===t);N&&(N.context=w)}),R.useMemo(()=>({...f,context:w,refs:E,elements:M}),[f,E,M,w])}function So(){return Xp()&&pl()}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=Le(l.domReference);function g(){!n&&Ce(l.domReference)&&l.domReference===mo(nt(l.domReference))&&(a.current=!0)}function v(){d.current=!0}function E(){d.current=!1}return f.addEventListener("blur",g),So()&&(f.addEventListener("keydown",v,!0),f.addEventListener("pointerdown",E,!0)),()=>{f.removeEventListener("blur",g),So()&&(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=Bt(f.nativeEvent);if(s&&oe(g)){if(So()&&!f.relatedTarget){if(!d.current&&!hl(g))return}else if(!em(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=mo(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 Co(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[yl]:l,[xl]:u,...s}=e;i=s}return{...n==="floating"&&{tabIndex:-1,[cm]:""},...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&&[yl,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 Dm(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=>Co(u,e,"reference"),t),i=R.useCallback(u=>Co(u,e,"floating"),n),l=R.useCallback(u=>Co(u,e,"item"),r);return R.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l}),[o,i,l])}const $m=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=vo(),c=((n=i.domReference)==null?void 0:n.id)||a,d=R.useMemo(()=>{var w;return((w=tm(i.floating))==null?void 0:w.id)||l},[i.floating,l]),p=(r=$m.get(s))!=null?r:s,g=yo()!=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:F}=w;const j={role:"option",...N&&{id:d+"-fui-option"}};switch(s){case"select":case"combobox":return{...j,"aria-selected":F}}return{}},[d,s]);return R.useMemo(()=>u?{reference:v,floating:E,item:M}:{},[u,v,E,M])}const $l=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 S.jsx("div",{ref:n,className:`absolute w-0 h-0 ${t}`,style:o})});$l.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}=Lm({open:a&&!l,onOpenChange:c,placement:n,whileElementsMounted:cs,middleware:[Hr(o?12:8),gs({fallbackAxisSideDirection:"start",padding:8}),hs({padding:8}),...o?[Kf({element:d})]:[]]}),v=bm(g,{enabled:s.includes("hover"),delay:{open:r,close:150}}),E=Pm(g,{enabled:s.includes("focus")}),M=Sm(g,{enabled:s.includes("click")}),w=Tm(g),N=Am(g,{role:"tooltip"}),{getReferenceProps:F,getFloatingProps:j}=Dm([v,E,M,w,N]);return l?S.jsx(S.Fragment,{children:e}):S.jsxs(S.Fragment,{children:[S.jsx("div",{ref:p.setReference,...F(),children:e}),a&&S.jsx(xm,{children:S.jsxs("div",{ref:p.setFloating,...j(),style:f,className:`
|
|
112
|
+
z-50 px-3 py-2
|
|
113
|
+
bg-fill-page-secondary
|
|
114
|
+
text-text-primary text-sm font-medium
|
|
115
|
+
rounded-lg shadow-lg
|
|
116
|
+
relative
|
|
117
|
+
${u}
|
|
118
|
+
${i}
|
|
119
|
+
`,children:[t,o&&S.jsx($l,{ref:d,placement:g.placement||n})]})})]})},Yn="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=",Mm=({walletAdapter:e,curSelectToken:t,currentActiveChain:n,metadata:r,onCopy:o})=>{var u;const{t:i}=Ye(),l=m.useMemo(()=>vp(n||{}),[n]);return S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"flex justify-center mt-4 mb-3",children:(e==null?void 0:e.getDisplayAddress())&&S.jsx("div",{className:"bg-white rounded-lg",children:S.jsx(dl,{value:(e==null?void 0:e.getDisplayAddress())||"",size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),(e==null?void 0:e.getDisplayAddress())&&S.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[S.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:e==null?void 0:e.getDisplayAddress()}),S.jsx(kp,{onCopy:()=>{const s=(e==null?void 0:e.getDisplayAddress())||"";o&&o(s)},text:e==null?void 0:e.getDisplayAddress(),children:S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[S.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),S.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")]}),S.jsxs("div",{className:"border-b border-dashed border-line-divider-secondary pb-4",children:[S.jsxs("div",{className:"flex items-start",children:[S.jsx("div",{className:"w-5",children:S.jsx("img",{src:Yn,className:"w-4 h-4",alt:"Warning"})}),S.jsx("div",{className:"flex-1",children:S.jsx("p",{className:"text-xs text-functional-orange-1",children:i("deposit.depositAllTip",{coin:t,v:n==null?void 0:n.chain})})})]}),l&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),S.jsx("div",{className:"flex items-start pl-5 text-functional-orange-1 text-xs",children:i("deposit.depositTipFor25w")})]})]}),S.jsxs("div",{className:"text-sm",children:[S.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[S.jsx("span",{className:"text-text-tertiary",children:i("deposit.arrivalTime")}),S.jsx(sn,{content:S.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[S.jsx("p",{children:i("deposit.arrivaltimeTooltip1",{v:(n==null?void 0:n.blockTime)*n.txConfirm/60,v1:n==null?void 0:n.txConfirm})}),S.jsx("p",{children:i("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:S.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})})})]}),S.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[S.jsx("span",{className:"text-text-tertiary",children:i("deposit.minDeposit")}),S.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]})]}),S.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[S.jsx("span",{className:"text-text-tertiary",children:i("deposit.maxDeposit")}),S.jsxs("span",{className:"text-text-primary font-medium text-right",children:["200,000 ",t]})]})]})]})},Im=({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(F=>F.chainId===E);if(!M||!M.tokenList||M.tokenList.length===0)return"";const w=M.tokenList.find(F=>F.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?S.jsx("div",{className:"text-center py-8",children:S.jsx("p",{className:"text-gray-400",children:"No chains available"})}):f?S.jsxs(S.Fragment,{children:[S.jsx(no,{currentActiveChain:f,chainList:e,onChainChange:c,curSelectToken:d,onTokenChange:p,walletType:"mpc"}),S.jsx(Mm,{walletAdapter:r,curSelectToken:d,currentActiveChain:f,metadata:o,onCopy:l}),S.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")})]}):S.jsx("div",{className:"text-center py-8",children:S.jsx("p",{className:"text-gray-400",children:"Loading..."})})},jm=Object.values({MAINNET:1,SEPOLIA:11155111}),pt=e=>{const t=typeof e=="string"?parseInt(e,10):e;return jm.includes(t)},Fm={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:!Fm[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 S.jsx("span",{className:`loading loading-${e} loading-spinner ${i} ${l} ${n}`.trim(),"aria-label":r,role:"status","aria-live":"polite"})},Rm=({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 k=new xe(j),B=new xe("200000");k.gt(B)&&(j="200000")}catch(k){console.warn("Error calculating max amount limit:",k)}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 xe(e||"0"),k=new xe("200000");return j.isNaN()||k.isNaN()?!1:j.gte(k)}catch{return!1}},[o,e,t]);m.useMemo(()=>{if(!Oo(o==null?void 0:o.chainId,t))return!1;try{const j=new xe(s||"0"),k=new xe("200000");return j.gt(k)}catch{return!1}},[o==null?void 0:o.chainId,s,t]);const w=m.useMemo(()=>Ys(o==null?void 0:o.chainId,t,e),[o==null?void 0:o.chainId,t,e]),N=j=>{const k=j.target.value,B=E(),h=ro(k,B);if(h.isValid)c(h.formattedValue),h.errorType;else return h.errorType==="exceed_balance",void 0},F=()=>{const j=parseFloat(s||"0"),k=parseFloat(e||"0");if(k>0){const B=j-k,h=Xe(Math.max(0,B).toString());return S.jsxs("span",{className:"flex items-center gap-1",children:[Xe(s||"0"),S.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),h," ",t]})}return`${Xe(s||"0")} ${t}`};return S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[S.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[S.jsx("input",{type:"text",placeholder:p("deposit.amount"),value:e,onChange:N,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"}),S.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")})]}),S.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),S.jsxs("div",{className:"flex justify-between items-center",children:[S.jsx(sn,{content:p("deposit.availableDesc"),children:S.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:p("deposit.available")})}),S.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:F()})]})]}),!r&&mp(e||"0",0)&&S.jsxs("div",{className:"flex justify-center flex-col items-center",children:[S.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})}),S.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})}),S.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?S.jsx(ln,{size:"xs",inline:!0}):p("deposit.enableWithToken",{token:t})})]}),w&&S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"flex mb-4",children:[S.jsx("div",{className:"w-5",children:S.jsx("img",{src:Yn,className:"w-4 h-4",alt:"Warning"})}),S.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.layerZeroDepositTip")})]}),S.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"})]}),M&&S.jsxs("div",{className:"flex mb-4",children:[S.jsx("div",{className:"w-5",children:S.jsx("img",{src:Yn,className:"w-4 h-4",alt:"Warning"})}),S.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.depositTipFor25w")})]}),M&&S.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),S.jsxs("div",{className:"flex mb-4",children:[S.jsx("div",{className:"w-5",children:!(M||w)&&S.jsx("img",{src:Yn,className:"w-4 h-4",alt:"Warning"})}),S.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.noPrivateKeyWalletWarning")})]}),S.jsx("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:S.jsxs("div",{className:"flex justify-between items-center",children:[S.jsx("span",{className:"text-sm leading-[18px] text-text-tertiary",children:p("deposit.equity")}),S.jsx("span",{className:"text-sm leading-[18px] text-text-primary font-medium",children:e?S.jsxs("span",{className:"flex items-center gap-1",children:[Xe(a),S.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}`})]})})]})},km=({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(km,{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 F=l[N.tokenAddress],j=F==null?void 0:F.balance,k=j==null?void 0:j.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 F=l[N.tokenAddress],j=F==null?void 0:F.allowance,k=j==null?void 0:j.data,B=BigInt(k?k.toString():0);return{address:N.tokenAddress,value:B,formatted:(B/BigInt(10)**BigInt(N.decimals)).toString(),decimals:N.decimals}}).filter(N=>N.address),w=E.reduce((N,F)=>{const j=M.find(k=>k.address===F.address);return{...N,[F.address]:{balance:F,allowance:j||{address:F.address,value:BigInt(0),formatted:"0",decimals:F.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 _m={symbol:"USDT"},Ml=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]),S.jsx(kl,{isOpen:n,isLoading:o,onClose:c,config:l.config||_m,currentActiveAccount:l.currentActiveAccount||oo,smartWallet:l.smartWallet||io,chains:l.chains||bp,defaultChainId:l.defaultChainId,defaultTokenAddress:l.defaultTokenAddress,defaultAmount:l.defaultAmount,metadata:l.metadata||so,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})});Ml.displayName="DepositManager";const Il=e=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.openDeposit(e||{chains:[]})},jl=()=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.closeDeposit()},Fl=e=>{Pe&&Pe.updateDepositOptions(e)},Kn=e=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.setDepositLoading(e)},Bm=()=>Pe?Pe.isOpen():!1,Rl=()=>Pe?Pe.isLoading():!1,Wm=()=>({openDeposit:Il,closeDeposit:jl,updateDepositOptions:Fl,setDepositLoading:Kn,isOpen:Bm,isLoading:Rl}),Um=({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 G;const{t:E}=Ye(),M=a==null?void 0:a.useAccount(),[w,N]=m.useState(()=>{var H;return!e||e.length===0?1:t||((H=e[0])==null?void 0:H.chainId)||1}),[F,j]=m.useState(()=>{var se;if(!e||e.length===0)return"";const H=t||((se=e[0])==null?void 0:se.chainId),z=e.find(he=>he.chainId===H);if(!z||!z.tokenList||z.tokenList.length===0)return"";const J=z.tokenList.find(he=>he.tokenAddress===n)||z.tokenList[0];return(J==null?void 0:J.token)||""}),[k,B]=m.useState(r),h=m.useCallback(H=>{N(H),g==null||g(H)},[g]),b=m.useCallback(H=>{j(H),v==null||v(H)},[v]),y=m.useRef(!0),$=m.useRef(F),D=m.useRef(w);m.useEffect(()=>{if(y.current){y.current=!1,$.current=F,D.current=w;return}($.current!==F||D.current!==w)&&(B(""),$.current=F,D.current=w)},[F,w]);const L=e&&e.length>0?e.find(H=>H.chainId===w)||e[0]:null,C=(G=L==null?void 0:L.tokenList)==null?void 0:G.find(H=>H.token===F),O=o==null?void 0:o.getDisplayAddress(),{multicallResult:T,queryComponents:P}=Al({account:O,chainId:w,contractAddress:void 0,tokens:(L==null?void 0:L.tokenList)||[],wagmiHooks:a}),x=m.useMemo(()=>{var z;if(!C)return;if(!C.tokenAddress||C.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return T.baseTokenBalance.formatted;const H=T.combinedData[C.tokenAddress];return((z=H==null?void 0:H.balance)==null?void 0:z.formatted)||"0"},[C,T]),I=c??!1,_=m.useMemo(()=>+M.chainId!=+w,[M.chainId,w]),V=m.useMemo(()=>Ys(w,F,k),[w,F,k]),W=m.useMemo(()=>{if(_)return{text:E("deposit.switchNetwork"),disabled:!1,isNetworkSwitch:!0};const H=parseFloat(k||"0"),z=10,se=hp(k,x||"0",I);return!k||H===0||!I?{text:E(V?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!0,isNetworkSwitch:!1}:H<z?{text:E("deposit.minDepositParsed",{amount:z,token:F}),disabled:!0,isNetworkSwitch:!1}:{text:E(V?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!se,isNetworkSwitch:!1}},[k,F,x,I,_,V,E]),Y=m.useCallback(async()=>{h&&h(w)},[h,w]),q=m.useCallback(async()=>{Kn(!0);try{p&&p({amount:k,chainId:w,tokenAddress:(C==null?void 0:C.tokenAddress)||"",tokenSymbol:F})}catch(H){console.error("Deposit error:",H),Kn(!1)}},[p,k,w,C==null?void 0:C.tokenAddress,F]);return!(a!=null&&a.useBalance)||!(a!=null&&a.useReadContract)||!(a!=null&&a.useAccount)?S.jsxs("div",{className:"p-6 text-center",children:[S.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),S.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?S.jsx("div",{className:"text-center py-8",children:S.jsx("p",{className:"text-gray-400",children:"No chains available"})}):L?S.jsxs(S.Fragment,{children:[P,S.jsx(no,{currentActiveChain:L,chainList:e,onChainChange:h,curSelectToken:F,onTokenChange:b,walletType:"evm"}),S.jsx(Rm,{depositAmount:k,curSelectToken:F,curSelectTokenData:{balance:C==null?void 0:C.balance,allowance:C==null?void 0:C.allowance},approved:I,currentActiveChain:L,currentEquity:l||0,amount:k,decimals:(C==null?void 0:C.decimals)||6,tokenBalance:x,platformBalance:u,onDepositAmountChange:B,onApproved:async()=>{d&&await d()}}),S.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${W.disabled||s?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:W.isNetworkSwitch?Y:q,disabled:W.disabled||s,children:[s&&S.jsx(ln,{size:"xs"}),W.text]})]}):S.jsx("div",{className:"text-center py-8",children:S.jsx("p",{className:"text-gray-400",children:"Loading..."})})},kl=({isOpen:e,isLoading:t=!1,onClose:n,config:r,currentActiveAccount:o=oo,smartWallet:i=io,chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a="",metadata:c=so,currentEquity:d=5e3,platformBalance:p="0",wagmiHooks:f,approved:g,onApproved:v,onDeposit:E,onCopy:M,onChainChange:w,onTokenChange:N})=>{const{t:F}=Ye(),j=m.useMemo(()=>{var B;return o?Vo(o,i,!1,(B=l[0])==null?void 0:B.chainId,"0","0"):null},[o,i,l]),k=(j==null?void 0:j.getWalletType())==="mpc";return e?Se.createPortal(S.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:S.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:S.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:B=>{B.stopPropagation()},children:[S.jsxs("div",{className:"flex items-center justify-between mb-4",children:[S.jsx("h2",{className:"text-lg font-semibold text-white",children:F("deposit.title")}),S.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:S.jsx(Wo,{className:"h-4 w-4"})})]}),k?S.jsx(Im,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:j,metadata:c,currentEquity:d,onDeposit:E,onCopy:M,onClose:n}):S.jsx(Um,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:j,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 Vm=()=>S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",children:[S.jsx("g",{clipPath:"url(#clip0_active)",children:S.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"})}),S.jsx("defs",{children:S.jsx("clipPath",{id:"clip0_active",children:S.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),zm=()=>S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",children:[S.jsx("g",{clipPath:"url(#clip0_inactive)",children:S.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"})}),S.jsx("defs",{children:S.jsx("clipPath",{id:"clip0_inactive",children:S.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),qn=({selectedLevel:e,maxLevel:t,className:n=""})=>{const r=Array.from({length:t},(o,i)=>i+1);return S.jsx("div",{className:`flex items-center ${n}`,children:r.map(o=>S.jsx("div",{className:"flex items-center justify-center",children:o<=e?S.jsx(Vm,{}):S.jsx(zm,{})},o))})};class mt{}Ie(mt,"FAST",3),Ie(mt,"Medium",2),Ie(mt,"SLOW",1),Ie(mt,"NONE",0);const Hm=({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 xe(e||"0").minus(o||"0").decimalPlaces(2,xe.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=ro(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 S.jsxs("span",{className:"flex items-center gap-1",children:[Xe(r||"0"),S.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 S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[S.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[S.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"}),S.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")})]}),S.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),S.jsxs("div",{className:"flex justify-between items-center",children:[S.jsx(sn,{content:c("deposit.availableDesc"),children:S.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:c("deposit.available")})}),S.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:v()})]})]}),i==="mpc"&&!pt(n==null?void 0:n.chainId)&&S.jsx("div",{className:"bg-fill-input-primary rounded-lg my-4 h-9 flex items-center px-3",children:S.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"})}),S.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:pt(n==null?void 0:n.chainId)?S.jsxs(S.Fragment,{children:[S.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:c("withdraw.noticeDesc")}),S.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")})]}):S.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:c("withdraw.crossChainTips")})}),S.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("span",{className:"text-text-tertiary text-xs",children:c("withdraw.speed")}),S.jsx("div",{className:"flex items-center",children:S.jsx(sn,{content:S.jsxs("div",{children:[S.jsx("div",{children:c("withdraw.speedNote")}),S.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[S.jsx(qn,{selectedLevel:mt.FAST,maxLevel:3}),S.jsx("span",{children:c("withdraw.speedNoteSpeed1")})]}),S.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[S.jsx(qn,{selectedLevel:mt.Medium,maxLevel:3}),S.jsx("span",{children:c("withdraw.speedNoteSpeed2")})]}),S.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[S.jsx(qn,{selectedLevel:mt.SLOW,maxLevel:3}),S.jsx("span",{children:c("withdraw.speedNoteSpeed3")})]})]}),children:S.jsx(qn,{selectedLevel:pt(n==null?void 0:n.chainId)?mt.SLOW:mt.FAST,maxLevel:3})})})]}),!pt(n==null?void 0:n.chainId)&&S.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[S.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:c("withdraw.fee")}),S.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[o," ",t]})]}),S.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[S.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:c(pt(n==null?void 0:n.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),S.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[Xe(d)," ",t]})]})]})]})},Gm=[],Ym={};let De=null;const _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||{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(()=>(De={openWithdraw:s,closeWithdraw:c,updateWithdrawOptions:a,setWithdrawLoading:d,isOpen:p,isLoading:f},()=>{De=null}),[s,c,a,d,p,f]),S.jsx(zl,{isOpen:n,isLoading:o,onClose:c,config:l.config||{symbol:"USDT"},currentActiveAccount:l.currentActiveAccount,smartWallet:l.smartWallet,chains:l.chains||Gm,defaultChainId:l.defaultChainId,defaultTokenAddress:l.defaultTokenAddress,defaultAmount:l.defaultAmount,metadata:l.metadata||Ym,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})});_l.displayName="WithdrawManager";const Bl=e=>{if(!De){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}De.openWithdraw(e||{chains:[]})},Wl=()=>{if(!De){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}De.closeWithdraw()},Ul=e=>{if(!De){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}De.updateWithdrawOptions(e)},Xn=e=>{if(!De){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}De.setWithdrawLoading(e)},Km=()=>De?De.isOpen():!1,Vl=()=>De?De.isLoading():!1,qm=()=>({openWithdraw:Bl,closeWithdraw:Wl,updateWithdrawOptions:Ul,setWithdrawLoading:Xn,isOpen:Km,isLoading:Vl}),Xm=({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 Y;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,F]=m.useState(()=>{var z;if(!e||e.length===0)return"";const q=t||((z=e[0])==null?void 0:z.chainId),G=e.find(J=>J.chainId===q);if(!G||!G.tokenList||G.tokenList.length===0)return"";const H=G.tokenList.find(J=>J.tokenAddress===n)||G.tokenList[0];return(H==null?void 0:H.token)||""}),[j,k]=m.useState(r),[B,h]=m.useState(""),b=(o==null?void 0:o.getWalletType())||"evm",y=m.useCallback(q=>{w(q),f==null||f(q)},[f]),$=m.useCallback(q=>{F(q),g==null||g(q)},[g]),D=m.useRef(!0),L=m.useRef(N),C=m.useRef(M);m.useEffect(()=>{if(D.current){D.current=!1,L.current=N,C.current=M;return}(L.current!==N||C.current!==M)&&(k(""),L.current=N,C.current=M)},[N,M]);const O=e&&e.length>0?e.find(q=>q.chainId===M)||e[0]:null,T=(Y=O==null?void 0:O.tokenList)==null?void 0:Y.find(q=>q.token===N),P=o==null?void 0:o.getDisplayAddress(),{multicallResult:x,queryComponents:I}=Al({account:P,chainId:M,contractAddress:void 0,tokens:(O==null?void 0:O.tokenList)||[],wagmiHooks:c}),_=m.useMemo(()=>{var G;if(!T)return;if(!T.tokenAddress||T.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return x.baseTokenBalance.formatted;const q=x.combinedData[T.tokenAddress];return((G=q==null?void 0:q.balance)==null?void 0:G.formatted)||"0"},[T,x]),V=m.useMemo(()=>{const q=new xe(j||"0"),G=new xe(s||"0"),H=pt(M);return!j||q.isZero()||!H&&q.isLessThan(G)?{text:E("withdraw.confirmWithdraw"),disabled:!0}:b==="mpc"&&!H&&!B.trim()?{text:E("withdraw.invalidReceiverAddress"),disabled:!0}:{text:E("withdraw.confirmWithdraw"),disabled:!1}},[E,M,j,b,B,s]),W=m.useCallback(async()=>{Xn(!0);try{if(d){const q=new xe(j||"0"),G=new xe(s||"0"),z={amount:(pt(M)?q:q.minus(G)).toString(),chainId:M,tokenAddress:(T==null?void 0:T.tokenAddress)||"",tokenSymbol:N};b==="mpc"&&!pt(M)&&(z.receiverAddress=B),d(z)}}catch{Xn(!1)}},[d,j,s,M,T==null?void 0:T.tokenAddress,N,b,B]);return!(c!=null&&c.useBalance)||!(c!=null&&c.useReadContract)||!(c!=null&&c.useAccount)?S.jsxs("div",{className:"p-6 text-center",children:[S.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),S.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?S.jsx("div",{className:"text-center py-8",children:S.jsx("p",{className:"text-gray-400",children:"No chains available"})}):O?S.jsxs(S.Fragment,{children:[I,S.jsx(no,{currentActiveChain:O,chainList:e,onChainChange:y,curSelectToken:N,onTokenChange:$,walletType:"evm"}),S.jsx(Hm,{withdrawAmount:j,curSelectToken:N,curSelectTokenData:{balance:T==null?void 0:T.balance,allowance:T==null?void 0:T.allowance},currentActiveChain:O,currentEquity:l||0,amount:j,decimals:(T==null?void 0:T.decimals)||6,tokenBalance:_,platformBalance:u,fee:s,walletType:b,receiverAddress:B,onWithdrawAmountChange:k,onReceiverAddressChange:h,onAmountChanged:v}),S.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:W,disabled:V.disabled||a,children:[a&&S.jsx(ln,{size:"xs"}),V.text]})]}):S.jsx("div",{className:"text-center py-8",children:S.jsx("p",{className:"text-gray-400",children:"Loading..."})})},zl=({isOpen:e,isLoading:t=!1,onClose:n,config:r,currentActiveAccount:o=oo,smartWallet:i=io,chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a="",metadata:c=so,currentEquity:d=5e3,platformBalance:p="0",fee:f,wagmiHooks:g,onWithdraw:v,onChainChange:E,onTokenChange:M,onAmountChanged:w})=>{const{t:N}=Ye(),F=m.useMemo(()=>{var j;return o?Vo(o,i,!1,(j=l[0])==null?void 0:j.chainId,"0","0"):null},[o,i,l]);return e?Se.createPortal(S.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:S.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:S.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:j=>{j.stopPropagation()},children:[S.jsxs("div",{className:"flex items-center justify-between mb-4",children:[S.jsx("h2",{className:"text-lg font-semibold text-white",children:N("withdraw.withdraw")}),S.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:S.jsx(Wo,{className:"h-4 w-4"})})]}),S.jsx(Xm,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:F,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};Z.ChromeLoader=ln,Z.ComponentProvider=va,Z.DEFAULT_LOCALE=un,Z.Deposit=kl,Z.DepositManager=Ml,Z.LOCALE_NAMES=ma,Z.LoadingSpinner=ln,Z.SUPPORTED_LOCALES=Jn,Z.Tooltip=sn,Z.Withdraw=zl,Z.WithdrawManager=_l,Z.closeDeposit=jl,Z.closeWithdraw=Wl,Z.formatThousands=ya,Z.isDepositLoading=Rl,Z.isWithdrawLoading=Vl,Z.openDeposit=Il,Z.openWithdraw=Bl,Z.setDepositLoading=Kn,Z.setWithdrawLoading=Xn,Z.updateDepositOptions=Fl,Z.updateWithdrawOptions=Ul,Z.useComponentConfig=Fo,Z.useDeposit=xa,Z.useDepositManager=Wm,Z.useTranslation=Ye,Z.useWithdraw=wa,Z.useWithdrawManager=qm,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})});
|
|
123
120
|
//# sourceMappingURL=index.umd.js.map
|