@txnlab/use-wallet-ui-react 1.0.0 → 1.1.0
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/README.md +20 -0
- package/dist/cjs/chunks/floating-ui.react-Hg8yTXAw.cjs +5 -0
- package/dist/cjs/chunks/floating-ui.react-Hg8yTXAw.cjs.map +1 -0
- package/dist/cjs/index.cjs +15 -18
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/plugins/export-key.cjs +9 -0
- package/dist/cjs/plugins/export-key.cjs.map +1 -0
- package/dist/esm/chunks/floating-ui.react-BBJf3vGf.js +2599 -0
- package/dist/esm/chunks/floating-ui.react-BBJf3vGf.js.map +1 -0
- package/dist/esm/index.js +4780 -7744
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/plugins/export-key.js +3030 -0
- package/dist/esm/plugins/export-key.js.map +1 -0
- package/dist/style.css +112 -1
- package/dist/types/components/AlgoSymbol.d.ts +11 -0
- package/dist/types/components/AlgoSymbol.d.ts.map +1 -0
- package/dist/types/components/ConnectWalletButton.d.ts +9 -0
- package/dist/types/components/ConnectWalletButton.d.ts.map +1 -0
- package/dist/types/components/ConnectWalletMenu.d.ts +10 -0
- package/dist/types/components/ConnectWalletMenu.d.ts.map +1 -0
- package/dist/types/components/ConnectedWalletButton.d.ts +9 -0
- package/dist/types/components/ConnectedWalletButton.d.ts.map +1 -0
- package/dist/types/components/ConnectedWalletMenu.d.ts +10 -0
- package/dist/types/components/ConnectedWalletMenu.d.ts.map +1 -0
- package/dist/types/components/NfdAvatar.d.ts +24 -0
- package/dist/types/components/NfdAvatar.d.ts.map +1 -0
- package/dist/types/components/WalletButton.d.ts +12 -0
- package/dist/types/components/WalletButton.d.ts.map +1 -0
- package/dist/types/components/WalletList.d.ts +7 -0
- package/dist/types/components/WalletList.d.ts.map +1 -0
- package/dist/types/hooks/useAccountInfo.d.ts +12 -0
- package/dist/types/hooks/useAccountInfo.d.ts.map +1 -0
- package/dist/types/hooks/useNfd.d.ts +32 -0
- package/dist/types/hooks/useNfd.d.ts.map +1 -0
- package/dist/types/hooks/useResolvedTheme.d.ts +11 -0
- package/dist/types/hooks/useResolvedTheme.d.ts.map +1 -0
- package/dist/types/index.d.cts +17 -197
- package/dist/types/index.d.ts +17 -197
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/plugins/PluginContext.d.ts +29 -0
- package/dist/types/plugins/PluginContext.d.ts.map +1 -0
- package/dist/types/plugins/PluginDialogRenderer.d.ts +10 -0
- package/dist/types/plugins/PluginDialogRenderer.d.ts.map +1 -0
- package/dist/types/plugins/PluginLifecycleManager.d.ts +9 -0
- package/dist/types/plugins/PluginLifecycleManager.d.ts.map +1 -0
- package/dist/types/plugins/PluginSlot.d.ts +10 -0
- package/dist/types/plugins/PluginSlot.d.ts.map +1 -0
- package/dist/types/plugins/export-key/ExportKeyDialog.d.ts +6 -0
- package/dist/types/plugins/export-key/ExportKeyDialog.d.ts.map +1 -0
- package/dist/types/plugins/export-key/ExportKeyMenuButton.d.ts +5 -0
- package/dist/types/plugins/export-key/ExportKeyMenuButton.d.ts.map +1 -0
- package/dist/types/plugins/export-key/constants.d.ts +2 -0
- package/dist/types/plugins/export-key/constants.d.ts.map +1 -0
- package/dist/types/plugins/export-key/index.d.cts +12 -0
- package/dist/types/plugins/export-key/index.d.ts +12 -0
- package/dist/types/plugins/export-key/index.d.ts.map +1 -0
- package/dist/types/plugins/index.d.ts +6 -0
- package/dist/types/plugins/index.d.ts.map +1 -0
- package/dist/types/plugins/types.d.ts +109 -0
- package/dist/types/plugins/types.d.ts.map +1 -0
- package/dist/types/providers/WalletUIProvider.d.ts +58 -0
- package/dist/types/providers/WalletUIProvider.d.ts.map +1 -0
- package/dist/types/test/setup.d.ts +2 -0
- package/dist/types/test/setup.d.ts.map +1 -0
- package/dist/types/utils/cn.d.ts +16 -0
- package/dist/types/utils/cn.d.ts.map +1 -0
- package/dist/types/utils/fontLoader.d.ts +8 -0
- package/dist/types/utils/fontLoader.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/ipfs.d.ts +10 -0
- package/dist/types/utils/ipfs.d.ts.map +1 -0
- package/dist/types/utils/ipfs.test.d.ts +2 -0
- package/dist/types/utils/ipfs.test.d.ts.map +1 -0
- package/package.json +21 -11
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ Ready-to-use React UI components for Algorand wallet integration, built as a com
|
|
|
17
17
|
- [Components](#components)
|
|
18
18
|
- [Hooks](#hooks)
|
|
19
19
|
- [Tanstack Query Integration](#tanstack-query-integration)
|
|
20
|
+
- [Plugins](#plugins)
|
|
20
21
|
- [Migration from v0.x](#migration-from-v0x)
|
|
21
22
|
- [License](#license)
|
|
22
23
|
|
|
@@ -551,6 +552,25 @@ v1.0 introduces a redesigned CSS architecture. Here's what changed:
|
|
|
551
552
|
|
|
552
553
|
3. Test dark mode behavior - it should work more reliably with Tailwind's `.dark` class
|
|
553
554
|
|
|
555
|
+
## Plugins
|
|
556
|
+
|
|
557
|
+
The library includes a plugin system for extending the wallet UI without modifying core components. Plugins can inject menu items, register full-panel views, open dialogs, respond to wallet lifecycle events, and provide React context.
|
|
558
|
+
|
|
559
|
+
```tsx
|
|
560
|
+
import { WalletUIProvider } from '@txnlab/use-wallet-ui-react'
|
|
561
|
+
import { exportKeyPlugin } from '@txnlab/use-wallet-ui-react/plugins/export-key'
|
|
562
|
+
|
|
563
|
+
function App() {
|
|
564
|
+
return (
|
|
565
|
+
<WalletUIProvider plugins={[exportKeyPlugin()]}>
|
|
566
|
+
{/* ... */}
|
|
567
|
+
</WalletUIProvider>
|
|
568
|
+
)
|
|
569
|
+
}
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
See the [Plugin Architecture Guide](PLUGINS.md) for full documentation.
|
|
573
|
+
|
|
554
574
|
## License
|
|
555
575
|
|
|
556
576
|
MIT
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";const Et=require("react"),te=require("react/jsx-runtime"),Wn=require("react-dom");function ln(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 g=ln(Et),an=ln(Wn);function Qe(){return typeof window<"u"}function xe(e){return St(e)?(e.nodeName||"").toLowerCase():"#document"}function J(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function le(e){var t;return(t=(St(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function St(e){return Qe()?e instanceof Node||e instanceof J(e).Node:!1}function B(e){return Qe()?e instanceof Element||e instanceof J(e).Element:!1}function q(e){return Qe()?e instanceof HTMLElement||e instanceof J(e).HTMLElement:!1}function pt(e){return!Qe()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof J(e).ShadowRoot}const Vn=new Set(["inline","contents"]);function Ne(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ne(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Vn.has(o)}const jn=new Set(["table","td","th"]);function Hn(e){return jn.has(xe(e))}const qn=[":popover-open",":modal"];function et(e){return qn.some(t=>{try{return e.matches(t)}catch{return!1}})}const Kn=["transform","translate","scale","rotate","perspective"],Un=["transform","translate","scale","rotate","perspective","filter"],Xn=["paint","layout","strict","content"];function Tt(e){const t=tt(),n=B(e)?ne(e):e;return Kn.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)||Un.some(r=>(n.willChange||"").includes(r))||Xn.some(r=>(n.contain||"").includes(r))}function Yn(e){let t=me(e);for(;q(t)&&!de(t);){if(Tt(t))return t;if(et(t))return null;t=me(t)}return null}function tt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const zn=new Set(["html","body","#document"]);function de(e){return zn.has(xe(e))}function ne(e){return J(e).getComputedStyle(e)}function nt(e){return B(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function me(e){if(xe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||pt(e)&&e.host||le(e);return pt(t)?t.host:t}function un(e){const t=me(e);return de(t)?e.ownerDocument?e.ownerDocument.body:e.body:q(t)&&Ne(t)?t:un(t)}function ye(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=un(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=J(o);if(i){const c=ht(s);return t.concat(s,s.visualViewport||[],Ne(o)?o:[],c&&n?ye(c):[])}return t.concat(o,ye(o,[],n))}function ht(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Ee=Math.min,Y=Math.max,Fe=Math.round,Ve=Math.floor,ce=e=>({x:e,y:e}),Gn={left:"right",right:"left",bottom:"top",top:"bottom"},Zn={start:"end",end:"start"};function Pt(e,t,n){return Y(e,Ee(t,n))}function De(e,t){return typeof e=="function"?e(t):e}function we(e){return e.split("-")[0]}function _e(e){return e.split("-")[1]}function fn(e){return e==="x"?"y":"x"}function dn(e){return e==="y"?"height":"width"}const Jn=new Set(["top","bottom"]);function fe(e){return Jn.has(we(e))?"y":"x"}function mn(e){return fn(fe(e))}function Qn(e,t,n){n===void 0&&(n=!1);const r=_e(e),o=mn(e),i=dn(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ue(s)),[s,Ue(s)]}function er(e){const t=Ue(e);return[bt(e),t,bt(t)]}function bt(e){return e.replace(/start|end/g,t=>Zn[t])}const Dt=["left","right"],kt=["right","left"],tr=["top","bottom"],nr=["bottom","top"];function rr(e,t,n){switch(e){case"top":case"bottom":return n?t?kt:Dt:t?Dt:kt;case"left":case"right":return t?tr:nr;default:return[]}}function or(e,t,n,r){const o=_e(e);let i=rr(we(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(bt)))),i}function Ue(e){return e.replace(/left|right|bottom|top/g,t=>Gn[t])}function ir(e){return{top:0,right:0,bottom:0,left:0,...e}}function sr(e){return typeof e!="number"?ir(e):{top:e,right:e,bottom:e,left:e}}function Xe(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}}/*!
|
|
2
|
+
* tabbable 6.2.0
|
|
3
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
4
|
+
*/var cr=["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])"],Ye=cr.join(","),gn=typeof Element>"u",Pe=gn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ze=!gn&&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},Ge=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",s=i||n&&t&&e(t.parentNode);return s},lr=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},pn=function(t,n,r){if(Ge(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Ye));return n&&Pe.call(t,Ye)&&o.unshift(t),o=o.filter(r),o},hn=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!Ge(s,!1))if(s.tagName==="SLOT"){var c=s.assignedElements(),l=c.length?c:s.children,a=e(l,!0,r);r.flatten?o.push.apply(o,a):o.push({scopeParent:s,candidates:a})}else{var u=Pe.call(s,Ye);u&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var d=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),p=!Ge(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(d&&p){var f=e(d===!0?s.children:d.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:s,candidates:f})}else i.unshift.apply(i,s.children)}}return o},bn=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},vn=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||lr(t))&&!bn(t)?0:t.tabIndex},ar=function(t,n){var r=vn(t);return r<0&&n&&!bn(t)?0:r},ur=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},yn=function(t){return t.tagName==="INPUT"},fr=function(t){return yn(t)&&t.type==="hidden"},dr=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},mr=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},gr=function(t){if(!t.name)return!0;var n=t.form||ze(t),r=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(s){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",s.message),!1}var i=mr(o,t.form);return!i||i===t},pr=function(t){return yn(t)&&t.type==="radio"},hr=function(t){return pr(t)&&!gr(t)},br=function(t){var n,r=t&&ze(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,c,l;for(i=!!((s=o)!==null&&s!==void 0&&(c=s.ownerDocument)!==null&&c!==void 0&&c.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&o;){var a,u,d;r=ze(o),o=(a=r)===null||a===void 0?void 0:a.host,i=!!((u=o)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return i},Ft=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},vr=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=Pe.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(Pe.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var c=t;t;){var l=t.parentElement,a=ze(t);if(l&&!l.shadowRoot&&o(l)===!0)return Ft(t);t.assignedSlot?t=t.assignedSlot:!l&&a!==t.ownerDocument?t=a.host:t=l}t=c}if(br(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Ft(t);return!1},yr=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 Pe.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},vt=function(t,n){return!(n.disabled||Ge(n)||fr(n)||vr(n,t)||dr(n)||yr(n))},yt=function(t,n){return!(hr(n)||vn(n)<0||!vt(t,n))},wr=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},xr=function e(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,c=s?o.scopeParent:o,l=ar(c,s),a=s?e(o.candidates):c;l===0?s?n.push.apply(n,a):n.push(c):r.push({documentOrder:i,tabIndex:l,item:o,isScope:s,content:a})}),r.sort(ur).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},rt=function(t,n){n=n||{};var r;return n.getShadowRoot?r=hn([t],n.includeContainer,{filter:yt.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:wr}):r=pn(t,n.includeContainer,yt.bind(null,n)),xr(r)},Rr=function(t,n){n=n||{};var r;return n.getShadowRoot?r=hn([t],n.includeContainer,{filter:vt.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=pn(t,n.includeContainer,vt.bind(null,n)),r},wn=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Pe.call(t,Ye)===!1?!1:yt(n,t)};function xn(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Rn(){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 Er(){return/apple/i.test(navigator.vendor)}function wt(){const e=/android/i;return e.test(xn())||e.test(Rn())}function Sr(){return Rn().includes("jsdom/")}const Lt="data-floating-ui-focusable",Tr="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Ae(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 G(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&pt(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function be(e){return"composedPath"in e?e.composedPath()[0]:e.target}function lt(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 Cr(e){return e.matches("html,body")}function oe(e){return(e==null?void 0:e.ownerDocument)||document}function En(e){return q(e)&&e.matches(Tr)}function Nt(e){return e?e.getAttribute("role")==="combobox"&&En(e):!1}function xt(e){return e?e.hasAttribute(Lt)?e:e.querySelector("["+Lt+"]")||e:null}function Oe(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,...Oe(e,o.id,n)])}function _t(e,t){var n;let r=[],o=(n=e.find(i=>i.id===t))==null?void 0:n.parentId;for(;o;){const i=e.find(s=>s.id===o);o=i==null?void 0:i.parentId,i&&(r=r.concat(i))}return r}function at(e){e.preventDefault(),e.stopPropagation()}function Ar(e){return"nativeEvent"in e}function Or(e){return e.mozInputSource===0&&e.isTrusted?!0:wt()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ir(e){return Sr()?!1:!wt()&&e.width===0&&e.height===0||wt()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function $t(e,t){return["mouse","pen"].includes(e)}var Mr=typeof document<"u",Pr=function(){},Z=Mr?Et.useLayoutEffect:Pr;const Dr={...g};function ut(e){const t=g.useRef(e);return Z(()=>{t.current=e}),t}const kr=Dr.useInsertionEffect,Fr=kr||(e=>e());function se(e){const t=g.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Fr(()=>{t.current=e}),g.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 $e=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Sn(e,t){const n=rt(e,$e()),r=n.length;if(r===0)return;const o=Ae(oe(e)),i=n.indexOf(o),s=i===-1?t===1?0:r-1:i+t;return n[s]}function Tn(e){return Sn(oe(e).body,1)||e}function Cn(e){return Sn(oe(e).body,-1)||e}function ke(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!G(n,r)}function Lr(e){rt(e,$e()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Bt(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Wt(e,t,n){let{reference:r,floating:o}=e;const i=fe(t),s=mn(t),c=dn(s),l=we(t),a=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[c]/2-o[c]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,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(_e(t)){case"start":f[s]-=p*(n&&a?-1:1);break;case"end":f[s]+=p*(n&&a?-1:1);break}return f}async function An(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:c,strategy:l}=e,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=De(t,e),h=sr(f),x=c[p?d==="floating"?"reference":"floating":d],y=Xe(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:u,strategy:l})),b=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),S=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},A=Xe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:v,strategy:l}):b);return{top:(y.top-A.top+h.top)/S.y,bottom:(A.bottom-y.bottom+h.bottom)/S.y,left:(y.left-A.left+h.left)/S.x,right:(A.right-y.right+h.right)/S.x}}const Nr=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,c=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let a=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Wt(a,r,l),p=r,f={},h=0;for(let x=0;x<c.length;x++){var m;const{name:y,fn:b}=c[x],{x:v,y:S,data:A,reset:O}=await b({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:a,platform:{...s,detectOverflow:(m=s.detectOverflow)!=null?m:An},elements:{reference:e,floating:t}});u=v??u,d=S??d,f={...f,[y]:{...f[y],...A}},O&&h<=50&&(h++,typeof O=="object"&&(O.placement&&(p=O.placement),O.rects&&(a=O.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):O.rects),{x:u,y:d}=Wt(a,p,l)),x=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:f}},_r=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:c,platform:l,elements:a}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...x}=De(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=we(o),b=fe(c),v=we(c)===c,S=await(l.isRTL==null?void 0:l.isRTL(a.floating)),A=p||(v||!m?[Ue(c)]:er(c)),O=h!=="none";!p&&O&&A.push(...or(c,m,h,S));const M=[c,...A],_=await l.detectOverflow(t,x),K=[];let W=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&K.push(_[y]),d){const R=Qn(o,s,S);K.push(_[R[0]],_[R[1]])}if(W=[...W,{placement:o,overflows:K}],!K.every(R=>R<=0)){var $,X;const R=((($=i.flip)==null?void 0:$.index)||0)+1,E=M[R];if(E&&(!(d==="alignment"?b!==fe(E):!1)||W.every(w=>fe(w.placement)===b?w.overflows[0]>0:!0)))return{data:{index:R,overflows:W},reset:{placement:E}};let k=(X=W.filter(L=>L.overflows[0]<=0).sort((L,w)=>L.overflows[1]-w.overflows[1])[0])==null?void 0:X.placement;if(!k)switch(f){case"bestFit":{var j;const L=(j=W.filter(w=>{if(O){const I=fe(w.placement);return I===b||I==="y"}return!0}).map(w=>[w.placement,w.overflows.filter(I=>I>0).reduce((I,N)=>I+N,0)]).sort((w,I)=>w[1]-I[1])[0])==null?void 0:j[0];L&&(k=L);break}case"initialPlacement":k=c;break}if(o!==k)return{reset:{placement:k}}}return{}}}},$r=new Set(["left","top"]);async function Br(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=we(n),c=_e(n),l=fe(n)==="y",a=$r.has(s)?-1:1,u=i&&l?-1:1,d=De(t,e);let{mainAxis:p,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 c&&typeof h=="number"&&(f=c==="end"?h*-1:h),l?{x:f*u,y:p*a}:{x:p*a,y:f*u}}const Wr=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:c}=t,l=await Br(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Vr=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:y=>{let{x:b,y:v}=y;return{x:b,y:v}}},...a}=De(e,t),u={x:n,y:r},d=await i.detectOverflow(t,a),p=fe(we(o)),f=fn(p);let h=u[f],m=u[p];if(s){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",v=h+d[y],S=h-d[b];h=Pt(v,h,S)}if(c){const y=p==="y"?"top":"left",b=p==="y"?"bottom":"right",v=m+d[y],S=m-d[b];m=Pt(v,m,S)}const x=l.fn({...t,[f]:h,[p]:m});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[f]:s,[p]:c}}}}}},jr=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:c}=t,{apply:l=()=>{},...a}=De(e,t),u=await s.detectOverflow(t,a),d=we(o),p=_e(o),f=fe(o)==="y",{width:h,height:m}=i.floating;let x,y;d==="top"||d==="bottom"?(x=d,y=p===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(y=d,x=p==="end"?"top":"bottom");const b=m-u.top-u.bottom,v=h-u.left-u.right,S=Ee(m-u[x],b),A=Ee(h-u[y],v),O=!t.middlewareData.shift;let M=S,_=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=b),O&&!p){const W=Y(u.left,0),$=Y(u.right,0),X=Y(u.top,0),j=Y(u.bottom,0);f?_=h-2*(W!==0||$!==0?W+$:Y(u.left,u.right)):M=m-2*(X!==0||j!==0?X+j:Y(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:M});const K=await s.getDimensions(c.floating);return h!==K.width||m!==K.height?{reset:{rects:!0}}:{}}}};function On(e){const t=ne(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=q(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,c=Fe(n)!==i||Fe(r)!==s;return c&&(n=i,r=s),{width:n,height:r,$:c}}function Ct(e){return B(e)?e:e.contextElement}function Ie(e){const t=Ct(e);if(!q(t))return ce(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=On(t);let s=(i?Fe(n.width):n.width)/r,c=(i?Fe(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const Hr=ce(0);function In(e){const t=J(e);return!tt()||!t.visualViewport?Hr:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qr(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==J(e)?!1:t}function Se(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ct(e);let s=ce(1);t&&(r?B(r)&&(s=Ie(r)):s=Ie(e));const c=qr(i,n,r)?In(i):ce(0);let l=(o.left+c.x)/s.x,a=(o.top+c.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const p=J(i),f=r&&B(r)?J(r):r;let h=p,m=ht(h);for(;m&&r&&f!==h;){const x=Ie(m),y=m.getBoundingClientRect(),b=ne(m),v=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*x.x,S=y.top+(m.clientTop+parseFloat(b.paddingTop))*x.y;l*=x.x,a*=x.y,u*=x.x,d*=x.y,l+=v,a+=S,h=J(m),m=ht(h)}}return Xe({width:u,height:d,x:l,y:a})}function ot(e,t){const n=nt(e).scrollLeft;return t?t.left+n:Se(le(e)).left+n}function Mn(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ot(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Kr(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=le(r),c=t?et(t.floating):!1;if(r===s||c&&i)return n;let l={scrollLeft:0,scrollTop:0},a=ce(1);const u=ce(0),d=q(r);if((d||!d&&!i)&&((xe(r)!=="body"||Ne(s))&&(l=nt(r)),q(r))){const f=Se(r);a=Ie(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}const p=s&&!d&&!i?Mn(s,l):ce(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+u.x+p.x,y:n.y*a.y-l.scrollTop*a.y+u.y+p.y}}function Ur(e){return Array.from(e.getClientRects())}function Xr(e){const t=le(e),n=nt(e),r=e.ownerDocument.body,o=Y(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Y(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ot(e);const c=-n.scrollTop;return ne(r).direction==="rtl"&&(s+=Y(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:c}}const Vt=25;function Yr(e,t){const n=J(e),r=le(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,c=0,l=0;if(o){i=o.width,s=o.height;const u=tt();(!u||u&&t==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}const a=ot(r);if(a<=0){const u=r.ownerDocument,d=u.body,p=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,h=Math.abs(r.clientWidth-d.clientWidth-f);h<=Vt&&(i-=h)}else a<=Vt&&(i+=a);return{width:i,height:s,x:c,y:l}}const zr=new Set(["absolute","fixed"]);function Gr(e,t){const n=Se(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=q(e)?Ie(e):ce(1),s=e.clientWidth*i.x,c=e.clientHeight*i.y,l=o*i.x,a=r*i.y;return{width:s,height:c,x:l,y:a}}function jt(e,t,n){let r;if(t==="viewport")r=Yr(e,n);else if(t==="document")r=Xr(le(e));else if(B(t))r=Gr(t,n);else{const o=In(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Xe(r)}function Pn(e,t){const n=me(e);return n===t||!B(n)||de(n)?!1:ne(n).position==="fixed"||Pn(n,t)}function Zr(e,t){const n=t.get(e);if(n)return n;let r=ye(e,[],!1).filter(c=>B(c)&&xe(c)!=="body"),o=null;const i=ne(e).position==="fixed";let s=i?me(e):e;for(;B(s)&&!de(s);){const c=ne(s),l=Tt(s);!l&&c.position==="fixed"&&(o=null),(i?!l&&!o:!l&&c.position==="static"&&!!o&&zr.has(o.position)||Ne(s)&&!l&&Pn(e,s))?r=r.filter(u=>u!==s):o=c,s=me(s)}return t.set(e,r),r}function Jr(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?et(t)?[]:Zr(t,this._c):[].concat(n),r],c=s[0],l=s.reduce((a,u)=>{const d=jt(t,u,o);return a.top=Y(d.top,a.top),a.right=Ee(d.right,a.right),a.bottom=Ee(d.bottom,a.bottom),a.left=Y(d.left,a.left),a},jt(t,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Qr(e){const{width:t,height:n}=On(e);return{width:t,height:n}}function eo(e,t,n){const r=q(t),o=le(t),i=n==="fixed",s=Se(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const l=ce(0);function a(){l.x=ot(o)}if(r||!r&&!i)if((xe(t)!=="body"||Ne(o))&&(c=nt(t)),r){const f=Se(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&a();i&&!r&&o&&a();const u=o&&!r&&!i?Mn(o,c):ce(0),d=s.left+c.scrollLeft-l.x-u.x,p=s.top+c.scrollTop-l.y-u.y;return{x:d,y:p,width:s.width,height:s.height}}function ft(e){return ne(e).position==="static"}function Ht(e,t){if(!q(e)||ne(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return le(e)===n&&(n=n.ownerDocument.body),n}function Dn(e,t){const n=J(e);if(et(e))return n;if(!q(e)){let o=me(e);for(;o&&!de(o);){if(B(o)&&!ft(o))return o;o=me(o)}return n}let r=Ht(e,t);for(;r&&Hn(r)&&ft(r);)r=Ht(r,t);return r&&de(r)&&ft(r)&&!Tt(r)?n:r||Yn(e)||n}const to=async function(e){const t=this.getOffsetParent||Dn,n=this.getDimensions,r=await n(e.floating);return{reference:eo(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function no(e){return ne(e).direction==="rtl"}const ro={convertOffsetParentRelativeRectToViewportRelativeRect:Kr,getDocumentElement:le,getClippingRect:Jr,getOffsetParent:Dn,getElementRects:to,getClientRects:Ur,getDimensions:Qr,getScale:Ie,isElement:B,isRTL:no};function kn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oo(e,t){let n=null,r;const o=le(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function s(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),i();const a=e.getBoundingClientRect(),{left:u,top:d,width:p,height:f}=a;if(c||t(),!p||!f)return;const h=Ve(d),m=Ve(o.clientWidth-(u+p)),x=Ve(o.clientHeight-(d+f)),y=Ve(u),v={rootMargin:-h+"px "+-m+"px "+-x+"px "+-y+"px",threshold:Y(0,Ee(1,l))||1};let S=!0;function A(O){const M=O[0].intersectionRatio;if(M!==l){if(!S)return s();M?s(!1,M):r=setTimeout(()=>{s(!1,1e-7)},1e3)}M===1&&!kn(a,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(A,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(A,v)}n.observe(e)}return s(!0),i}function io(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,a=Ct(e),u=o||i?[...a?ye(a):[],...ye(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=a&&c?oo(a,n):null;let p=-1,f=null;s&&(f=new ResizeObserver(y=>{let[b]=y;b&&b.target===a&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var v;(v=f)==null||v.observe(t)})),n()}),a&&!l&&f.observe(a),f.observe(t));let h,m=l?Se(e):null;l&&x();function x(){const y=Se(e);m&&!kn(m,y)&&n(),m=y,h=requestAnimationFrame(x)}return n(),()=>{var y;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d==null||d(),(y=f)==null||y.disconnect(),f=null,l&&cancelAnimationFrame(h)}}const so=An,co=Wr,lo=Vr,ao=_r,uo=jr,fo=(e,t,n)=>{const r=new Map,o={platform:ro,...n},i={...o.platform,_c:r};return Nr(e,t,{...o,platform:i})};var mo=typeof document<"u",go=function(){},Ke=mo?Et.useLayoutEffect:go;function Ze(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(!Ze(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)&&!Ze(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Fn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qt(e,t){const n=Fn(e);return Math.round(t*n)/n}function dt(e){const t=g.useRef(e);return Ke(()=>{t.current=e}),t}function Ln(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:l,open:a}=e,[u,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=g.useState(r);Ze(p,r)||f(r);const[h,m]=g.useState(null),[x,y]=g.useState(null),b=g.useCallback(w=>{w!==O.current&&(O.current=w,m(w))},[]),v=g.useCallback(w=>{w!==M.current&&(M.current=w,y(w))},[]),S=i||h,A=s||x,O=g.useRef(null),M=g.useRef(null),_=g.useRef(u),K=l!=null,W=dt(l),$=dt(o),X=dt(a),j=g.useCallback(()=>{if(!O.current||!M.current)return;const w={placement:t,strategy:n,middleware:p};$.current&&(w.platform=$.current),fo(O.current,M.current,w).then(I=>{const N={...I,isPositioned:X.current!==!1};R.current&&!Ze(_.current,N)&&(_.current=N,an.flushSync(()=>{d(N)}))})},[p,t,n,$,X]);Ke(()=>{a===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,d(w=>({...w,isPositioned:!1})))},[a]);const R=g.useRef(!1);Ke(()=>(R.current=!0,()=>{R.current=!1}),[]),Ke(()=>{if(S&&(O.current=S),A&&(M.current=A),S&&A){if(W.current)return W.current(S,A,j);j()}},[S,A,j,W,K]);const E=g.useMemo(()=>({reference:O,floating:M,setReference:b,setFloating:v}),[b,v]),k=g.useMemo(()=>({reference:S,floating:A}),[S,A]),L=g.useMemo(()=>{const w={position:n,left:0,top:0};if(!k.floating)return w;const I=qt(k.floating,u.x),N=qt(k.floating,u.y);return c?{...w,transform:"translate("+I+"px, "+N+"px)",...Fn(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:N}},[n,c,k.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:j,refs:E,elements:k,floatingStyles:L}),[u,j,E,k,L])}const po=(e,t)=>({...co(e),options:[e,t]}),ho=(e,t)=>({...lo(e),options:[e,t]}),bo=(e,t)=>({...ao(e),options:[e,t]}),vo=(e,t)=>({...uo(e),options:[e,t]});function yo(e){const t=g.useRef(void 0),n=g.useCallback(r=>{const o=e.map(i=>{if(i!=null){if(typeof i=="function"){const s=i,c=s(r);return typeof c=="function"?c:()=>{s(null)}}return i.current=r,()=>{i.current=null}}});return()=>{o.forEach(i=>i==null?void 0:i())}},e);return g.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const wo="data-floating-ui-focusable",Kt="active",Ut="selected",xo={...g};let Xt=!1,Ro=0;const Yt=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Ro++;function Eo(){const[e,t]=g.useState(()=>Xt?Yt():void 0);return Z(()=>{e==null&&t(Yt())},[]),g.useEffect(()=>{Xt=!0},[]),e}const So=xo.useId,it=So||Eo;let Rt;process.env.NODE_ENV!=="production"&&(Rt=new Set);function To(){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=Rt)!=null&&e.has(o))){var i;(i=Rt)==null||i.add(o),console.error(o)}}function Co(){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 Ao=g.createContext(null),Oo=g.createContext(null),Nn=()=>{var e;return((e=g.useContext(Ao))==null?void 0:e.id)||null},At=()=>g.useContext(Oo);function Le(e){return"data-floating-ui-"+e}function Io(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}let zt=0;function Ce(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(zt);const i=()=>e==null?void 0:e.focus({preventScroll:n});o?i():zt=requestAnimationFrame(i)}function Mo(e){return(e==null?void 0:e.ownerDocument)||document}const Me={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Gt(e){return e==="inert"?Me.inert:e==="aria-hidden"?Me["aria-hidden"]:Me.none}let je=new WeakSet,He={},mt=0;const Po=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,_n=e=>e&&(e.host||_n(e.parentNode)),Do=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=_n(n);return e.contains(r)?r:null}).filter(n=>n!=null);function ko(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,s=Do(t,e),c=new Set,l=new Set(s),a=[];He[o]||(He[o]=new WeakMap);const u=He[o];s.forEach(d),p(t),c.clear();function d(f){!f||c.has(f)||(c.add(f),f.parentNode&&d(f.parentNode))}function p(f){!f||l.has(f)||[].forEach.call(f.children,h=>{if(xe(h)!=="script")if(c.has(h))p(h);else{const m=i?h.getAttribute(i):null,x=m!==null&&m!=="false",y=Gt(i),b=(y.get(h)||0)+1,v=(u.get(h)||0)+1;y.set(h,b),u.set(h,v),a.push(h),b===1&&x&&je.add(h),v===1&&h.setAttribute(o,""),!x&&i&&h.setAttribute(i,i==="inert"?"":"true")}})}return mt++,()=>{a.forEach(f=>{const h=Gt(i),x=(h.get(f)||0)-1,y=(u.get(f)||0)-1;h.set(f,x),u.set(f,y),x||(!je.has(f)&&i&&f.removeAttribute(i),je.delete(f)),y||f.removeAttribute(o)}),mt--,mt||(Me.inert=new WeakMap,Me["aria-hidden"]=new WeakMap,Me.none=new WeakMap,je=new WeakSet,He={})}}function Zt(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Mo(e[0]).body;return ko(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const Ot={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},Je=g.forwardRef(function(t,n){const[r,o]=g.useState();Z(()=>{Er()&&o("button")},[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Le("focus-guard")]:"",style:Ot};return te.jsx("span",{...t,...i})}),Fo={clipPath:"inset(50%)",position:"fixed",top:0,left:0},$n=g.createContext(null),Jt=Le("portal");function Lo(e){e===void 0&&(e={});const{id:t,root:n}=e,r=it(),o=Bn(),[i,s]=g.useState(null),c=g.useRef(null);return Z(()=>()=>{i==null||i.remove(),queueMicrotask(()=>{c.current=null})},[i]),Z(()=>{if(!r||c.current)return;const l=t?document.getElementById(t):null;if(!l)return;const a=document.createElement("div");a.id=r,a.setAttribute(Jt,""),l.appendChild(a),c.current=a,s(a)},[t,r]),Z(()=>{if(n===null||!r||c.current)return;let l=n||(o==null?void 0:o.portalNode);l&&!St(l)&&(l=l.current),l=l||document.body;let a=null;t&&(a=document.createElement("div"),a.id=t,l.appendChild(a));const u=document.createElement("div");u.id=r,u.setAttribute(Jt,""),l=a||l,l.appendChild(u),c.current=u,s(u)},[t,n,r,o]),i}function No(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,i=Lo({id:n,root:r}),[s,c]=g.useState(null),l=g.useRef(null),a=g.useRef(null),u=g.useRef(null),d=g.useRef(null),p=s==null?void 0:s.modal,f=s==null?void 0:s.open,h=!!s&&!s.modal&&s.open&&o&&!!(r||i);return g.useEffect(()=>{if(!i||!o||p)return;function m(x){i&&ke(x)&&(x.type==="focusin"?Bt:Lr)(i)}return i.addEventListener("focusin",m,!0),i.addEventListener("focusout",m,!0),()=>{i.removeEventListener("focusin",m,!0),i.removeEventListener("focusout",m,!0)}},[i,o,p]),g.useEffect(()=>{i&&(f||Bt(i))},[f,i]),te.jsxs($n.Provider,{value:g.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:a,beforeInsideRef:u,afterInsideRef:d,portalNode:i,setFocusManagerState:c}),[o,i]),children:[h&&i&&te.jsx(Je,{"data-type":"outside",ref:l,onFocus:m=>{if(ke(m,i)){var x;(x=u.current)==null||x.focus()}else{const y=s?s.domReference:null,b=Cn(y);b==null||b.focus()}}}),h&&i&&te.jsx("span",{"aria-owns":i.id,style:Fo}),i&&an.createPortal(t,i),h&&i&&te.jsx(Je,{"data-type":"outside",ref:a,onFocus:m=>{if(ke(m,i)){var x;(x=d.current)==null||x.focus()}else{const y=s?s.domReference:null,b=Tn(y);b==null||b.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,m.nativeEvent,"focus-out"))}}})]})}const Bn=()=>g.useContext($n);function Qt(e){return g.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const _o=20;let ve=[];function It(){ve=ve.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function $o(e){It(),e&&xe(e)!=="body"&&(ve.push(new WeakRef(e)),ve.length>_o&&(ve=ve.slice(-20)))}function en(){It();const e=ve[ve.length-1];return e==null?void 0:e.deref()}function Bo(e){const t=$e();return wn(e,t)?e:rt(e,t)[0]||e}function tn(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const r=$e(),i=Rr(e,r).filter(c=>{const l=c.getAttribute("data-tabindex")||"";return wn(c,r)||c.hasAttribute("data-tabindex")&&!l.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||i.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const Wo=g.forwardRef(function(t,n){return te.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:Ot})});function Vo(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:s=0,returnFocus:c=!0,restoreFocus:l=!1,modal:a=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0,outsideElementsInert:p=!1,getInsideElements:f=()=>[]}=e,{open:h,onOpenChange:m,events:x,dataRef:y,elements:{domReference:b,floating:v}}=t,S=se(()=>{var T;return(T=y.current.floatingContext)==null?void 0:T.nodeId}),A=se(f),O=typeof s=="number"&&s<0,M=Nt(b)&&O,_=Po(),K=_?i:!0,W=!K||_&&p,$=ut(o),X=ut(s),j=ut(c),R=At(),E=Bn(),k=g.useRef(null),L=g.useRef(null),w=g.useRef(!1),I=g.useRef(!1),N=g.useRef(-1),re=g.useRef(-1),Te=E!=null,P=xt(v),ie=se(function(T){return T===void 0&&(T=P),T?rt(T,$e()):[]}),H=se(T=>{const D=ie(T);return $.current.map(C=>b&&C==="reference"?b:P&&C==="floating"?P:D).filter(Boolean).flat()});g.useEffect(()=>{if(r||!a)return;function T(C){if(C.key==="Tab"){G(P,Ae(oe(P)))&&ie().length===0&&!M&&at(C);const V=H(),U=be(C);$.current[0]==="reference"&&U===b&&(at(C),C.shiftKey?Ce(V[V.length-1]):Ce(V[1])),$.current[1]==="floating"&&U===P&&C.shiftKey&&(at(C),Ce(V[0]))}}const D=oe(P);return D.addEventListener("keydown",T),()=>{D.removeEventListener("keydown",T)}},[r,b,P,a,$,M,ie,H]),g.useEffect(()=>{if(r||!v)return;function T(D){const C=be(D),U=ie().indexOf(C);U!==-1&&(N.current=U)}return v.addEventListener("focusin",T),()=>{v.removeEventListener("focusin",T)}},[r,v,ie]),g.useEffect(()=>{if(r||!d)return;function T(){I.current=!0,setTimeout(()=>{I.current=!1})}function D(U){const F=U.relatedTarget,ae=U.currentTarget,ee=be(U);queueMicrotask(()=>{const z=S(),Re=!(G(b,F)||G(v,F)||G(F,v)||G(E==null?void 0:E.portalNode,F)||F!=null&&F.hasAttribute(Le("focus-guard"))||R&&(Oe(R.nodesRef.current,z).find(pe=>{var ue,he;return G((ue=pe.context)==null?void 0:ue.elements.floating,F)||G((he=pe.context)==null?void 0:he.elements.domReference,F)})||_t(R.nodesRef.current,z).find(pe=>{var ue,he,Mt;return[(ue=pe.context)==null?void 0:ue.elements.floating,xt((he=pe.context)==null?void 0:he.elements.floating)].includes(F)||((Mt=pe.context)==null?void 0:Mt.elements.domReference)===F})));if(ae===b&&P&&tn(P,$),l&&ae!==b&&!(ee!=null&&ee.isConnected)&&Ae(oe(P))===oe(P).body){q(P)&&P.focus();const pe=N.current,ue=ie(),he=ue[pe]||ue[ue.length-1]||P;q(he)&&he.focus()}if(y.current.insideReactTree){y.current.insideReactTree=!1;return}(M||!a)&&F&&Re&&!I.current&&F!==en()&&(w.current=!0,m(!1,U,"focus-out"))})}const C=!!(!R&&E);function V(){Io(re),y.current.insideReactTree=!0,re.current=window.setTimeout(()=>{y.current.insideReactTree=!1})}if(v&&q(b))return b.addEventListener("focusout",D),b.addEventListener("pointerdown",T),v.addEventListener("focusout",D),C&&v.addEventListener("focusout",V,!0),()=>{b.removeEventListener("focusout",D),b.removeEventListener("pointerdown",T),v.removeEventListener("focusout",D),C&&v.removeEventListener("focusout",V,!0)}},[r,b,v,P,a,R,E,m,d,l,ie,M,S,$,y]);const Q=g.useRef(null),ge=g.useRef(null),st=Qt([Q,E==null?void 0:E.beforeInsideRef]),ct=Qt([ge,E==null?void 0:E.afterInsideRef]);g.useEffect(()=>{var T,D;if(r||!v)return;const C=Array.from((E==null||(T=E.portalNode)==null?void 0:T.querySelectorAll("["+Le("portal")+"]"))||[]),U=(D=(R?_t(R.nodesRef.current,S()):[]).find(ee=>{var z;return Nt(((z=ee.context)==null?void 0:z.elements.domReference)||null)}))==null||(D=D.context)==null?void 0:D.elements.domReference,F=[v,U,...C,...A(),k.current,L.current,Q.current,ge.current,E==null?void 0:E.beforeOutsideRef.current,E==null?void 0:E.afterOutsideRef.current,$.current.includes("reference")||M?b:null].filter(ee=>ee!=null),ae=a||M?Zt(F,!W,W):Zt(F);return()=>{ae()}},[r,b,v,a,$,E,M,K,W,R,S,A]),Z(()=>{if(r||!q(P))return;const T=oe(P),D=Ae(T);queueMicrotask(()=>{const C=H(P),V=X.current,U=(typeof V=="number"?C[V]:V.current)||P,F=G(P,D);!O&&!F&&h&&Ce(U,{preventScroll:U===P})})},[r,h,P,O,H,X]),Z(()=>{if(r||!P)return;const T=oe(P),D=Ae(T);$o(D);function C(F){let{reason:ae,event:ee,nested:z}=F;if(["hover","safe-polygon"].includes(ae)&&ee.type==="mouseleave"&&(w.current=!0),ae==="outside-press")if(z)w.current=!1;else if(Or(ee)||Ir(ee))w.current=!1;else{let Re=!1;document.createElement("div").focus({get preventScroll(){return Re=!0,!1}}),Re?w.current=!1:w.current=!0}}x.on("openchange",C);const V=T.createElement("span");V.setAttribute("tabindex","-1"),V.setAttribute("aria-hidden","true"),Object.assign(V.style,Ot),Te&&b&&b.insertAdjacentElement("afterend",V);function U(){if(typeof j.current=="boolean"){const F=b||en();return F&&F.isConnected?F:V}return j.current.current||V}return()=>{x.off("openchange",C);const F=Ae(T),ae=G(v,F)||R&&Oe(R.nodesRef.current,S(),!1).some(z=>{var Re;return G((Re=z.context)==null?void 0:Re.elements.floating,F)}),ee=U();queueMicrotask(()=>{const z=Bo(ee);j.current&&!w.current&&q(z)&&(!(z!==F&&F!==T.body)||ae)&&z.focus({preventScroll:!0}),V.remove()})}},[r,v,P,j,y,x,R,Te,b,S]),g.useEffect(()=>(queueMicrotask(()=>{w.current=!1}),()=>{queueMicrotask(It)}),[r]),Z(()=>{if(!r&&E)return E.setFocusManagerState({modal:a,closeOnFocusOut:d,open:h,onOpenChange:m,domReference:b}),()=>{E.setFocusManagerState(null)}},[r,E,a,h,m,d,b]),Z(()=>{r||P&&tn(P,$)},[r,P,$]);function Be(T){return r||!u||!a?null:te.jsx(Wo,{ref:T==="start"?k:L,onClick:D=>m(!1,D.nativeEvent),children:typeof u=="string"?u:"Dismiss"})}const We=!r&&K&&(a?!M:!0)&&(Te||a);return te.jsxs(te.Fragment,{children:[We&&te.jsx(Je,{"data-type":"inside",ref:st,onFocus:T=>{if(a){const C=H();Ce(o[0]==="reference"?C[0]:C[C.length-1])}else if(E!=null&&E.preserveTabOrder&&E.portalNode)if(w.current=!1,ke(T,E.portalNode)){const C=Tn(b);C==null||C.focus()}else{var D;(D=E.beforeOutsideRef.current)==null||D.focus()}}}),!M&&Be("start"),n,Be("end"),We&&te.jsx(Je,{"data-type":"inside",ref:ct,onFocus:T=>{if(a)Ce(H()[0]);else if(E!=null&&E.preserveTabOrder&&E.portalNode)if(d&&(w.current=!0),ke(T,E.portalNode)){const C=Cn(b);C==null||C.focus()}else{var D;(D=E.afterOutsideRef.current)==null||D.focus()}}})]})}let qe=0;const nn="--floating-ui-scrollbar-width";function jo(){const e=xn(),t=/iP(hone|ad|od)|iOS/.test(e)||e==="MacIntel"&&navigator.maxTouchPoints>1,n=document.body.style,o=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",i=window.innerWidth-document.documentElement.clientWidth,s=n.left?parseFloat(n.left):window.scrollX,c=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(nn,i+"px"),i&&(n[o]=i+"px"),t){var l,a;const u=((l=window.visualViewport)==null?void 0:l.offsetLeft)||0,d=((a=window.visualViewport)==null?void 0:a.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(c-Math.floor(d))+"px",left:-(s-Math.floor(u))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[o]:""}),n.removeProperty(nn),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(s,c))}}let rn=()=>{};const Ho=g.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t;return Z(()=>{if(r)return qe++,qe===1&&(rn=jo()),()=>{qe--,qe===0&&rn()}},[r]),te.jsx("div",{ref:n,...o,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}})});function on(e){return q(e.target)&&e.target.tagName==="BUTTON"}function qo(e){return q(e.target)&&e.target.tagName==="A"}function sn(e){return En(e)}function Ko(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:c="click",toggle:l=!0,ignoreMouse:a=!1,keyboardHandlers:u=!0,stickIfOpen:d=!0}=t,p=g.useRef(),f=g.useRef(!1),h=g.useMemo(()=>({onPointerDown(m){p.current=m.pointerType},onMouseDown(m){const x=p.current;m.button===0&&c!=="click"&&($t(x)&&a||(n&&l&&(!(o.current.openEvent&&d)||o.current.openEvent.type==="mousedown")?r(!1,m.nativeEvent,"click"):(m.preventDefault(),r(!0,m.nativeEvent,"click"))))},onClick(m){const x=p.current;if(c==="mousedown"&&p.current){p.current=void 0;return}$t(x)&&a||(n&&l&&(!(o.current.openEvent&&d)||o.current.openEvent.type==="click")?r(!1,m.nativeEvent,"click"):r(!0,m.nativeEvent,"click"))},onKeyDown(m){p.current=void 0,!(m.defaultPrevented||!u||on(m))&&(m.key===" "&&!sn(i)&&(m.preventDefault(),f.current=!0),!qo(m)&&m.key==="Enter"&&r(!(n&&l),m.nativeEvent,"click"))},onKeyUp(m){m.defaultPrevented||!u||on(m)||sn(i)||m.key===" "&&f.current&&(f.current=!1,r(!(n&&l),m.nativeEvent,"click"))}}),[o,i,c,a,u,r,n,d,l]);return g.useMemo(()=>s?{reference:h}:{},[s,h])}const Uo={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Xo={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},cn=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 Yo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:c=!0,outsidePress:l=!0,outsidePressEvent:a="pointerdown",referencePress:u=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:f,capture:h}=t,m=At(),x=se(typeof l=="function"?l:()=>!1),y=typeof l=="function"?x:l,b=g.useRef(!1),{escapeKey:v,outsidePress:S}=cn(f),{escapeKey:A,outsidePress:O}=cn(h),M=g.useRef(!1),_=se(R=>{var E;if(!n||!s||!c||R.key!=="Escape"||M.current)return;const k=(E=i.current.floatingContext)==null?void 0:E.nodeId,L=m?Oe(m.nodesRef.current,k):[];if(!v&&(R.stopPropagation(),L.length>0)){let w=!0;if(L.forEach(I=>{var N;if((N=I.context)!=null&&N.open&&!I.context.dataRef.current.__escapeKeyBubbles){w=!1;return}}),!w)return}r(!1,Ar(R)?R.nativeEvent:R,"escape-key")}),K=se(R=>{var E;const k=()=>{var L;_(R),(L=be(R))==null||L.removeEventListener("keydown",k)};(E=be(R))==null||E.addEventListener("keydown",k)}),W=se(R=>{var E;const k=i.current.insideReactTree;i.current.insideReactTree=!1;const L=b.current;if(b.current=!1,a==="click"&&L||k||typeof y=="function"&&!y(R))return;const w=be(R),I="["+Le("inert")+"]",N=oe(o.floating).querySelectorAll(I);let re=B(w)?w:null;for(;re&&!de(re);){const H=me(re);if(de(H)||!B(H))break;re=H}if(N.length&&B(w)&&!Cr(w)&&!G(w,o.floating)&&Array.from(N).every(H=>!G(re,H)))return;if(q(w)&&j){const H=de(w),Q=ne(w),ge=/auto|scroll/,st=H||ge.test(Q.overflowX),ct=H||ge.test(Q.overflowY),Be=st&&w.clientWidth>0&&w.scrollWidth>w.clientWidth,We=ct&&w.clientHeight>0&&w.scrollHeight>w.clientHeight,T=Q.direction==="rtl",D=We&&(T?R.offsetX<=w.offsetWidth-w.clientWidth:R.offsetX>w.clientWidth),C=Be&&R.offsetY>w.clientHeight;if(D||C)return}const Te=(E=i.current.floatingContext)==null?void 0:E.nodeId,P=m&&Oe(m.nodesRef.current,Te).some(H=>{var Q;return lt(R,(Q=H.context)==null?void 0:Q.elements.floating)});if(lt(R,o.floating)||lt(R,o.domReference)||P)return;const ie=m?Oe(m.nodesRef.current,Te):[];if(ie.length>0){let H=!0;if(ie.forEach(Q=>{var ge;if((ge=Q.context)!=null&&ge.open&&!Q.context.dataRef.current.__outsidePressBubbles){H=!1;return}}),!H)return}r(!1,R,"outside-press")}),$=se(R=>{var E;const k=()=>{var L;W(R),(L=be(R))==null||L.removeEventListener(a,k)};(E=be(R))==null||E.addEventListener(a,k)});g.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=v,i.current.__outsidePressBubbles=S;let R=-1;function E(N){r(!1,N,"ancestor-scroll")}function k(){window.clearTimeout(R),M.current=!0}function L(){R=window.setTimeout(()=>{M.current=!1},tt()?5:0)}const w=oe(o.floating);c&&(w.addEventListener("keydown",A?K:_,A),w.addEventListener("compositionstart",k),w.addEventListener("compositionend",L)),y&&w.addEventListener(a,O?$:W,O);let I=[];return p&&(B(o.domReference)&&(I=ye(o.domReference)),B(o.floating)&&(I=I.concat(ye(o.floating))),!B(o.reference)&&o.reference&&o.reference.contextElement&&(I=I.concat(ye(o.reference.contextElement)))),I=I.filter(N=>{var re;return N!==((re=w.defaultView)==null?void 0:re.visualViewport)}),I.forEach(N=>{N.addEventListener("scroll",E,{passive:!0})}),()=>{c&&(w.removeEventListener("keydown",A?K:_,A),w.removeEventListener("compositionstart",k),w.removeEventListener("compositionend",L)),y&&w.removeEventListener(a,O?$:W,O),I.forEach(N=>{N.removeEventListener("scroll",E)}),window.clearTimeout(R)}},[i,o,c,y,a,n,r,p,s,v,S,_,A,K,W,O,$]),g.useEffect(()=>{i.current.insideReactTree=!1},[i,y,a]);const X=g.useMemo(()=>({onKeyDown:_,...u&&{[Uo[d]]:R=>{r(!1,R.nativeEvent,"reference-press")},...d!=="click"&&{onClick(R){r(!1,R.nativeEvent,"reference-press")}}}}),[_,r,u,d]),j=g.useMemo(()=>({onKeyDown:_,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[Xo[a]]:()=>{i.current.insideReactTree=!0}}),[_,a,i]);return g.useMemo(()=>s?{reference:X,floating:j}:{},[s,X,j])}function zo(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=it(),i=g.useRef({}),[s]=g.useState(()=>Co()),c=Nn()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!B(f)&&To("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,a]=g.useState(r.reference),u=se((f,h,m)=>{i.current.openEvent=f?h:void 0,s.emit("openchange",{open:f,event:h,reason:m,nested:c}),n==null||n(f,h,m)}),d=g.useMemo(()=>({setPositionReference:a}),[]),p=g.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return g.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:p,events:s,floatingId:o,refs:d}),[t,u,p,s,o,d])}function Go(e){e===void 0&&(e={});const{nodeId:t}=e,n=zo({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=g.useState(null),[c,l]=g.useState(null),u=(o==null?void 0:o.domReference)||i,d=g.useRef(null),p=At();Z(()=>{u&&(d.current=u)},[u]);const f=Ln({...e,elements:{...o,...c&&{reference:c}}}),h=g.useCallback(v=>{const S=B(v)?{getBoundingClientRect:()=>v.getBoundingClientRect(),getClientRects:()=>v.getClientRects(),contextElement:v}:v;l(S),f.refs.setReference(S)},[f.refs]),m=g.useCallback(v=>{(B(v)||v===null)&&(d.current=v,s(v)),(B(f.refs.reference.current)||f.refs.reference.current===null||v!==null&&!B(v))&&f.refs.setReference(v)},[f.refs]),x=g.useMemo(()=>({...f.refs,setReference:m,setPositionReference:h,domReference:d}),[f.refs,m,h]),y=g.useMemo(()=>({...f.elements,domReference:u}),[f.elements,u]),b=g.useMemo(()=>({...f,...r,refs:x,elements:y,nodeId:t}),[f,x,y,t,r]);return Z(()=>{r.dataRef.current.floatingContext=b;const v=p==null?void 0:p.nodesRef.current.find(S=>S.id===t);v&&(v.context=b)}),g.useMemo(()=>({...f,context:b,refs:x,elements:y}),[f,x,y,b])}function gt(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[Kt]:s,[Ut]:c,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[wo]:""},...i,...t.map(s=>{const c=s?s[n]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((s,c)=>(c&&Object.entries(c).forEach(l=>{let[a,u]=l;if(!(o&&[Kt,Ut].includes(a)))if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof u=="function"){var d;(d=r.get(a))==null||d.push(u),s[a]=function(){for(var p,f=arguments.length,h=new Array(f),m=0;m<f;m++)h[m]=arguments[m];return(p=r.get(a))==null?void 0:p.map(x=>x(...h)).find(x=>x!==void 0)}}}else s[a]=u}),s),{})}}function Zo(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),o=g.useCallback(c=>gt(c,e,"reference"),t),i=g.useCallback(c=>gt(c,e,"floating"),n),s=g.useCallback(c=>gt(c,e,"item"),r);return g.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}const Jo=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Qo(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:i,floatingId:s}=e,{enabled:c=!0,role:l="dialog"}=t,a=it(),u=((n=i.domReference)==null?void 0:n.id)||a,d=g.useMemo(()=>{var b;return((b=xt(i.floating))==null?void 0:b.id)||s},[i.floating,s]),p=(r=Jo.get(l))!=null?r:l,h=Nn()!=null,m=g.useMemo(()=>p==="tooltip"||l==="label"?{["aria-"+(l==="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:u},...p==="menu"&&h&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[p,d,h,o,u,l]),x=g.useMemo(()=>{const b={id:d,...p&&{role:p}};return p==="tooltip"||l==="label"?b:{...b,...p==="menu"&&{"aria-labelledby":u}}},[p,d,u,l]),y=g.useCallback(b=>{let{active:v,selected:S}=b;const A={role:"option",...v&&{id:d+"-fui-option"}};switch(l){case"select":case"combobox":return{...A,"aria-selected":S}}return{}},[d,l]);return g.useMemo(()=>c?{reference:m,floating:x,item:y}:{},[c,m,x,y])}exports.FloatingFocusManager=Vo;exports.FloatingOverlay=Ho;exports.FloatingPortal=No;exports.autoUpdate=io;exports.detectOverflow=so;exports.evaluate=De;exports.flip=bo;exports.isElement=B;exports.max=Y;exports.min=Ee;exports.offset=po;exports.round=Fe;exports.shift=ho;exports.size=vo;exports.useClick=Ko;exports.useDismiss=Yo;exports.useFloating=Go;exports.useFloating$1=Ln;exports.useId=it;exports.useInteractions=Zo;exports.useMergeRefs=yo;exports.useRole=Qo;
|
|
5
|
+
//# sourceMappingURL=floating-ui.react-Hg8yTXAw.cjs.map
|