@floating-ui/react
Advanced tools
Comparing version 0.26.17 to 0.26.18
@@ -16,2 +16,3 @@ import { AlignedPlacement } from '@floating-ui/react-dom'; | ||
import { Coords } from '@floating-ui/react-dom'; | ||
import { Derivable } from '@floating-ui/react-dom'; | ||
import { detectOverflow } from '@floating-ui/react-dom'; | ||
@@ -104,3 +105,3 @@ import { DetectOverflowOptions } from '@floating-ui/react-dom'; | ||
declare interface CompositeItemProps { | ||
export declare interface CompositeItemProps { | ||
/** | ||
@@ -117,3 +118,3 @@ * Determines the element to render. | ||
declare interface CompositeProps { | ||
export declare interface CompositeProps { | ||
/** | ||
@@ -425,6 +426,8 @@ * Determines the element to render. | ||
*/ | ||
export declare function FloatingNode(props: { | ||
export declare function FloatingNode(props: FloatingNodeProps): JSX.Element; | ||
export declare interface FloatingNodeProps { | ||
children?: React.ReactNode; | ||
id: string; | ||
}): JSX.Element; | ||
} | ||
@@ -463,3 +466,3 @@ export declare interface FloatingNodeType<RT extends ReferenceType = ReferenceType> { | ||
declare interface FloatingPortalProps { | ||
export declare interface FloatingPortalProps { | ||
children?: React.ReactNode; | ||
@@ -509,5 +512,7 @@ /** | ||
*/ | ||
export declare function FloatingTree(props: { | ||
export declare function FloatingTree(props: FloatingTreeProps): JSX.Element; | ||
export declare interface FloatingTreeProps { | ||
children?: React.ReactNode; | ||
}): JSX.Element; | ||
} | ||
@@ -556,9 +561,9 @@ export declare interface FloatingTreeType<RT extends ReferenceType = ReferenceType> { | ||
/** | ||
* Positions the floating element such that an inner element inside | ||
* of it is anchored to the reference element. | ||
* Positions the floating element such that an inner element inside of it is | ||
* anchored to the reference element. | ||
* @see https://floating-ui.com/docs/inner | ||
*/ | ||
export declare const inner: (props: InnerProps & Partial<DetectOverflowOptions>) => Middleware; | ||
export declare const inner: (props: InnerProps | Derivable<InnerProps>) => Middleware; | ||
export declare interface InnerProps { | ||
export declare interface InnerProps extends DetectOverflowOptions { | ||
/** | ||
@@ -659,3 +664,3 @@ * A ref which contains an array of HTML elements. | ||
declare interface SafePolygonOptions { | ||
export declare interface SafePolygonOptions { | ||
buffer?: number; | ||
@@ -680,6 +685,6 @@ blockPointerEvents?: boolean; | ||
declare type Status = 'unmounted' | 'initial' | 'open' | 'close'; | ||
export { Strategy } | ||
declare type TransitionStatus = 'unmounted' | 'initial' | 'open' | 'close'; | ||
/** | ||
@@ -901,6 +906,8 @@ * Opens or closes the floating element when clicking the reference element. | ||
*/ | ||
export declare function useFloatingPortalNode(props?: { | ||
export declare function useFloatingPortalNode(props?: UseFloatingPortalNodeProps): HTMLElement | null; | ||
export declare interface UseFloatingPortalNodeProps { | ||
id?: string; | ||
root?: HTMLElement | null | React.MutableRefObject<HTMLElement | null>; | ||
}): HTMLElement | null; | ||
} | ||
@@ -993,6 +1000,6 @@ export declare type UseFloatingReturn<RT extends ReferenceType = ReferenceType> = Prettify<UseFloatingReturn_2 & { | ||
*/ | ||
delay?: number | Partial<{ | ||
open: number; | ||
close: number; | ||
}>; | ||
delay?: number | { | ||
open?: number; | ||
close?: number; | ||
}; | ||
/** | ||
@@ -1255,3 +1262,3 @@ * Whether the logic only runs for mouse input, ignoring touch input. | ||
isMounted: boolean; | ||
status: Status; | ||
status: TransitionStatus; | ||
}; | ||
@@ -1264,6 +1271,6 @@ | ||
*/ | ||
duration?: number | Partial<{ | ||
open: number; | ||
close: number; | ||
}>; | ||
duration?: number | { | ||
open?: number; | ||
close?: number; | ||
}; | ||
} | ||
@@ -1270,0 +1277,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@floating-ui/react-dom"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","@floating-ui/react-dom","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIReact={},e.React,e.FloatingUIReactDOM,e.ReactDOM)}(this,(function(e,t,n,r){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=o(t);function i(e){return u.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}),e)}const c={...u},l=c.useInsertionEffect||(e=>e());function s(e){const t=u.useRef((()=>{}));return l((()=>{t.current=e})),u.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function a(e){return d(e)?(e.nodeName||"").toLowerCase():"#document"}function f(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function d(e){return e instanceof Node||e instanceof f(e).Node}function v(e){return e instanceof Element||e instanceof f(e).Element}function m(e){return e instanceof HTMLElement||e instanceof f(e).HTMLElement}function p(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof f(e).ShadowRoot)}function g(e){return["html","body","#document"].includes(a(e))}function h(e){if("html"===a(e))return e;const t=e.assignedSlot||e.parentNode||p(e)&&e.host||function(e){var t;return null==(t=(d(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}(e);return p(t)?t.host:t}function y(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function b(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&p(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function w(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function E(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function x(e){return!(0!==e.mozInputSource||!e.isTrusted)||(k()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function R(e){return!E().includes("jsdom/")&&(!k()&&0===e.width&&0===e.height||k()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function I(){return/apple/i.test(navigator.vendor)}function k(){const e=/android/i;return e.test(w())||e.test(E())}function O(){return w().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function C(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function M(e){return(null==e?void 0:e.ownerDocument)||document}function T(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function P(e){return"composedPath"in e?e.composedPath()[0]:e.target}const S="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function L(e){return m(e)&&e.matches(S)}function A(e){e.preventDefault(),e.stopPropagation()}function N(e){return!!e&&("combobox"===e.getAttribute("role")&&L(e))}const D=Math.floor,F="ArrowUp",j="ArrowDown",K="ArrowLeft",H="ArrowRight";function q(e,t,n){return Math.floor(e/t)!==n}function _(e,t){return t<0||t>=e.current.length}function B(e,t){return U(e,{disabledIndices:t})}function W(e,t){return U(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function U(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const i=e.current;let c=n;do{c+=r?-u:u}while(c>=0&&c<=i.length-1&&G(i,c,o));return c}function z(e,t){let{event:n,orientation:r,loop:o,cols:u,disabledIndices:i,minIndex:c,maxIndex:l,prevIndex:s,stopEvent:a=!1}=t,f=s;if(n.key===F){if(a&&A(n),-1===s)f=l;else if(f=U(e,{startingIndex:f,amount:u,decrement:!0,disabledIndices:i}),o&&(s-u<c||f<0)){const e=s%u,t=l%u,n=l-(t-e);f=t===e?l:t>e?n:n-u}_(e,f)&&(f=s)}if(n.key===j&&(a&&A(n),-1===s?f=c:(f=U(e,{startingIndex:s,amount:u,disabledIndices:i}),o&&s+u>l&&(f=U(e,{startingIndex:s%u-u,amount:u,disabledIndices:i}))),_(e,f)&&(f=s)),"both"===r){const t=D(s/u);n.key===H&&(a&&A(n),s%u!=u-1?(f=U(e,{startingIndex:s,disabledIndices:i}),o&&q(f,u,t)&&(f=U(e,{startingIndex:s-s%u-1,disabledIndices:i}))):o&&(f=U(e,{startingIndex:s-s%u-1,disabledIndices:i})),q(f,u,t)&&(f=s)),n.key===K&&(a&&A(n),s%u!=0?(f=U(e,{startingIndex:s,decrement:!0,disabledIndices:i}),o&&q(f,u,t)&&(f=U(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i}))):o&&(f=U(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i})),q(f,u,t)&&(f=s));const r=D(l/u)===t;_(e,f)&&(f=o&&r?n.key===K?l:U(e,{startingIndex:s-s%u-1,disabledIndices:i}):s)}return f}function X(e,t,n){const r=[];let o=0;return e.forEach(((e,u)=>{let{width:i,height:c}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;n<i;n++)for(let r=0;r<c;r++)e.push(o+n+r*t);o%t+i<=t&&e.every((e=>null==r[e]))?(e.forEach((e=>{r[e]=u})),l=!0):o++}})),[...r]}function Y(e,t,n,r,o){if(-1===e)return-1;const u=n.indexOf(e),i=t[e];switch(o){case"tl":return u;case"tr":return i?u+i.width-1:u;case"bl":return i?u+(i.height-1)*r:u;case"br":return n.lastIndexOf(e)}}function V(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function G(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}let Z=0;function $(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Z);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():Z=requestAnimationFrame(u)}var Q="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function J(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const ee=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function te(e){const{children:t,elementsRef:n,labelsRef:r}=e,[o,i]=u.useState((()=>new Map)),c=u.useCallback((e=>{i((t=>new Map(t).set(e,null)))}),[]),l=u.useCallback((e=>{i((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return Q((()=>{const e=new Map(o);Array.from(e.keys()).sort(J).forEach(((t,n)=>{e.set(t,n)})),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(o,e)||i(e)}),[o]),u.createElement(ee.Provider,{value:u.useMemo((()=>({register:c,unregister:l,map:o,elementsRef:n,labelsRef:r})),[c,l,o,n,r])},t)}function ne(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:i,labelsRef:c}=u.useContext(ee),[l,s]=u.useState(null),a=u.useRef(null),f=u.useCallback((e=>{if(a.current=e,null!==l&&(i.current[l]=e,c)){var n;const r=void 0!==t;c.current[l]=r?t:null!=(n=null==e?void 0:e.textContent)?n:null}}),[l,i,c,t]);return Q((()=>{const e=a.current;if(e)return n(e),()=>{r(e)}}),[n,r]),Q((()=>{const e=a.current?o.get(a.current):null;null!=e&&s(e)}),[o]),u.useMemo((()=>({ref:f,index:null==l?-1:l})),[l,f])}function re(e,t){return"function"==typeof e?e(t):e?u.cloneElement(e,t):u.createElement("div",t)}const oe=u.createContext({activeIndex:0,onNavigate:()=>{}}),ue=[K,H],ie=[F,j],ce=[...ue,...ie],le=u.forwardRef((function(e,t){const{render:n,orientation:r="both",loop:o=!0,cols:i=1,disabledIndices:c,activeIndex:l,onNavigate:a,itemSizes:f,dense:d=!1,...v}=e,[m,p]=u.useState(0),g=null!=l?l:m,h=s(null!=a?a:p),y=u.useRef([]),b=n&&"function"!=typeof n?n.props:{},w=u.useMemo((()=>({activeIndex:g,onNavigate:h})),[g,h]),E=i>1;const x={...v,...b,ref:t,"aria-orientation":"both"===r?void 0:r,onKeyDown(e){null==v.onKeyDown||v.onKeyDown(e),null==b.onKeyDown||b.onKeyDown(e),function(e){if(!ce.includes(e.key))return;let t=g;const n=B(y,c),u=W(y,c);if(E){const l=f||Array.from({length:y.current.length},(()=>({width:1,height:1}))),s=X(l,i,d),a=s.findIndex((e=>null!=e&&!G(y.current,e,c))),v=s.reduce(((e,t,n)=>null==t||G(y.current,t,c)?e:n),-1);t=s[z({current:s.map((e=>e?y.current[e]:null))},{event:e,orientation:r,loop:o,cols:i,disabledIndices:V([...c||y.current.map(((e,t)=>G(y.current,t)?t:void 0)),void 0],s),minIndex:a,maxIndex:v,prevIndex:Y(g>u?n:g,l,s,i,e.key===j?"bl":e.key===H?"tr":"tl")})]}const l={horizontal:[H],vertical:[j],both:[H,j]}[r],s={horizontal:[K],vertical:[F],both:[K,F]}[r],a=E?ce:{horizontal:ue,vertical:ie,both:ce}[r];t===g&&[...l,...s].includes(e.key)&&(t=o&&t===u&&l.includes(e.key)?n:o&&t===n&&s.includes(e.key)?u:U(y,{startingIndex:t,decrement:s.includes(e.key),disabledIndices:c})),t===g||_(y,t)||(e.stopPropagation(),a.includes(e.key)&&e.preventDefault(),h(t),queueMicrotask((()=>{$(y.current[t])})))}(e)}};return u.createElement(oe.Provider,{value:w},u.createElement(te,{elementsRef:y},re(n,x)))})),se=u.forwardRef((function(e,t){const{render:n,...r}=e,o=n&&"function"!=typeof n?n.props:{},{activeIndex:c,onNavigate:l}=u.useContext(oe),{ref:s,index:a}=ne(),f=i([s,t,o.ref]),d=c===a;return re(n,{...r,...o,ref:f,tabIndex:d?0:-1,"data-active":d?"":void 0,onFocus(e){null==r.onFocus||r.onFocus(e),null==o.onFocus||o.onFocus(e),l(a)}})}));function ae(){return ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ae.apply(this,arguments)}let fe=!1,de=0;const ve=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+de++;const me=c.useId||function(){const[e,t]=u.useState((()=>fe?ve():void 0));return Q((()=>{null==e&&t(ve())}),[]),u.useEffect((()=>{fe=!0}),[]),e},pe=u.forwardRef((function(e,t){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i}},width:c=14,height:l=7,tipRadius:s=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:v,style:{transform:m,...p}={},...g}=e,h=me();if(!o)return null;const y=2*a,b=y/2,w=c/2*(s/-8+1),E=l/2*s/4,[x,R]=r.split("-"),I=n.platform.isRTL(o),k=!!v,O="top"===x||"bottom"===x,C=f&&"end"===R?"bottom":"top";let M=f&&"end"===R?"right":"left";f&&I&&(M="end"===R?"left":"right");const T=null!=(null==i?void 0:i.x)?f||i.x:"",P=null!=(null==i?void 0:i.y)?f||i.y:"",S=v||"M0,0 H"+c+" L"+(c-w)+","+(l-E)+" Q"+c/2+","+l+" "+w+","+(l-E)+" Z",L={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[x];return u.createElement("svg",ae({},g,{"aria-hidden":!0,ref:t,width:k?c:c+y,height:c,viewBox:"0 0 "+c+" "+(l>c?l:c),style:{position:"absolute",pointerEvents:"none",[M]:T,[C]:P,[x]:O||k?"100%":"calc(100% - "+y/2+"px)",transform:""+L+(null!=m?m:""),...p}}),y>0&&u.createElement("path",{clipPath:"url(#"+h+")",fill:"none",stroke:d,strokeWidth:y+(v?0:1),d:S}),u.createElement("path",{stroke:y&&!v?g.fill:"none",d:S}),u.createElement("clipPath",{id:h},u.createElement("rect",{x:-b,y:b*(k?-1:1),width:c+y,height:c})))}));function ge(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}const he=u.createContext(null),ye=u.createContext(null),be=()=>{var e;return(null==(e=u.useContext(he))?void 0:e.id)||null},we=()=>u.useContext(ye);function Ee(e){return"data-floating-ui-"+e}function xe(e){const n=t.useRef(e);return Q((()=>{n.current=e})),n}const Re=Ee("safe-polygon");function Ie(e,t,n){return n&&!C(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}const ke=()=>{},Oe=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:ke,setState:ke,isInstantPhase:!1}),Ce=()=>u.useContext(Oe); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom"),require("@floating-ui/react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","@floating-ui/react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIReact={},e.React,e.ReactDOM,e.FloatingUIReactDOM)}(this,(function(e,t,n,r){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=o(t),i=o(n);function c(e){return u.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}),e)}const l={...u},s=l.useInsertionEffect||(e=>e());function a(e){const t=u.useRef((()=>{}));return s((()=>{t.current=e})),u.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function f(e){return m(e)?(e.nodeName||"").toLowerCase():"#document"}function d(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function m(e){return e instanceof Node||e instanceof d(e).Node}function v(e){return e instanceof Element||e instanceof d(e).Element}function p(e){return e instanceof HTMLElement||e instanceof d(e).HTMLElement}function g(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof d(e).ShadowRoot)}function h(e){return["html","body","#document"].includes(f(e))}function y(e){return d(e).getComputedStyle(e)}function b(e){if("html"===f(e))return e;const t=e.assignedSlot||e.parentNode||g(e)&&e.host||function(e){var t;return null==(t=(m(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}(e);return g(t)?t.host:t}function w(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function E(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&g(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function R(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function x(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function I(e){return!(0!==e.mozInputSource||!e.isTrusted)||(O()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function k(e){return!x().includes("jsdom/")&&(!O()&&0===e.width&&0===e.height||O()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function M(){return/apple/i.test(navigator.vendor)}function O(){const e=/android/i;return e.test(R())||e.test(x())}function C(){return R().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function T(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function S(e){return(null==e?void 0:e.ownerDocument)||document}function P(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function L(e){return"composedPath"in e?e.composedPath()[0]:e.target}const A="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function N(e){return p(e)&&e.matches(A)}function D(e){e.preventDefault(),e.stopPropagation()}function F(e){return!!e&&("combobox"===e.getAttribute("role")&&N(e))}const j=Math.floor;const K="ArrowUp",H="ArrowDown",q="ArrowLeft",_="ArrowRight";function B(e,t,n){return Math.floor(e/t)!==n}function W(e,t){return t<0||t>=e.current.length}function U(e,t){return X(e,{disabledIndices:t})}function z(e,t){return X(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function X(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const i=e.current;let c=n;do{c+=r?-u:u}while(c>=0&&c<=i.length-1&&$(i,c,o));return c}function Y(e,t){let{event:n,orientation:r,loop:o,cols:u,disabledIndices:i,minIndex:c,maxIndex:l,prevIndex:s,stopEvent:a=!1}=t,f=s;if(n.key===K){if(a&&D(n),-1===s)f=l;else if(f=X(e,{startingIndex:f,amount:u,decrement:!0,disabledIndices:i}),o&&(s-u<c||f<0)){const e=s%u,t=l%u,n=l-(t-e);f=t===e?l:t>e?n:n-u}W(e,f)&&(f=s)}if(n.key===H&&(a&&D(n),-1===s?f=c:(f=X(e,{startingIndex:s,amount:u,disabledIndices:i}),o&&s+u>l&&(f=X(e,{startingIndex:s%u-u,amount:u,disabledIndices:i}))),W(e,f)&&(f=s)),"both"===r){const t=j(s/u);n.key===_&&(a&&D(n),s%u!=u-1?(f=X(e,{startingIndex:s,disabledIndices:i}),o&&B(f,u,t)&&(f=X(e,{startingIndex:s-s%u-1,disabledIndices:i}))):o&&(f=X(e,{startingIndex:s-s%u-1,disabledIndices:i})),B(f,u,t)&&(f=s)),n.key===q&&(a&&D(n),s%u!=0?(f=X(e,{startingIndex:s,decrement:!0,disabledIndices:i}),o&&B(f,u,t)&&(f=X(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i}))):o&&(f=X(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i})),B(f,u,t)&&(f=s));const r=j(l/u)===t;W(e,f)&&(f=o&&r?n.key===q?l:X(e,{startingIndex:s-s%u-1,disabledIndices:i}):s)}return f}function V(e,t,n){const r=[];let o=0;return e.forEach(((e,u)=>{let{width:i,height:c}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;n<i;n++)for(let r=0;r<c;r++)e.push(o+n+r*t);o%t+i<=t&&e.every((e=>null==r[e]))?(e.forEach((e=>{r[e]=u})),l=!0):o++}})),[...r]}function G(e,t,n,r,o){if(-1===e)return-1;const u=n.indexOf(e),i=t[e];switch(o){case"tl":return u;case"tr":return i?u+i.width-1:u;case"bl":return i?u+(i.height-1)*r:u;case"br":return n.lastIndexOf(e)}}function Z(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function $(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}let Q=0;function J(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Q);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():Q=requestAnimationFrame(u)}var ee="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function te(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const ne=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function re(e){const{children:t,elementsRef:n,labelsRef:r}=e,[o,i]=u.useState((()=>new Map)),c=u.useCallback((e=>{i((t=>new Map(t).set(e,null)))}),[]),l=u.useCallback((e=>{i((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return ee((()=>{const e=new Map(o);Array.from(e.keys()).sort(te).forEach(((t,n)=>{e.set(t,n)})),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(o,e)||i(e)}),[o]),u.createElement(ne.Provider,{value:u.useMemo((()=>({register:c,unregister:l,map:o,elementsRef:n,labelsRef:r})),[c,l,o,n,r])},t)}function oe(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:i,labelsRef:c}=u.useContext(ne),[l,s]=u.useState(null),a=u.useRef(null),f=u.useCallback((e=>{if(a.current=e,null!==l&&(i.current[l]=e,c)){var n;const r=void 0!==t;c.current[l]=r?t:null!=(n=null==e?void 0:e.textContent)?n:null}}),[l,i,c,t]);return ee((()=>{const e=a.current;if(e)return n(e),()=>{r(e)}}),[n,r]),ee((()=>{const e=a.current?o.get(a.current):null;null!=e&&s(e)}),[o]),u.useMemo((()=>({ref:f,index:null==l?-1:l})),[l,f])}function ue(e,t){return"function"==typeof e?e(t):e?u.cloneElement(e,t):u.createElement("div",t)}const ie=u.createContext({activeIndex:0,onNavigate:()=>{}}),ce=[q,_],le=[K,H],se=[...ce,...le],ae=u.forwardRef((function(e,t){const{render:n,orientation:r="both",loop:o=!0,cols:i=1,disabledIndices:c,activeIndex:l,onNavigate:s,itemSizes:f,dense:d=!1,...m}=e,[v,p]=u.useState(0),g=null!=l?l:v,h=a(null!=s?s:p),y=u.useRef([]),b=n&&"function"!=typeof n?n.props:{},w=u.useMemo((()=>({activeIndex:g,onNavigate:h})),[g,h]),E=i>1;const R={...m,...b,ref:t,"aria-orientation":"both"===r?void 0:r,onKeyDown(e){null==m.onKeyDown||m.onKeyDown(e),null==b.onKeyDown||b.onKeyDown(e),function(e){if(!se.includes(e.key))return;let t=g;const n=U(y,c),u=z(y,c);if(E){const l=f||Array.from({length:y.current.length},(()=>({width:1,height:1}))),s=V(l,i,d),a=s.findIndex((e=>null!=e&&!$(y.current,e,c))),m=s.reduce(((e,t,n)=>null==t||$(y.current,t,c)?e:n),-1);t=s[Y({current:s.map((e=>e?y.current[e]:null))},{event:e,orientation:r,loop:o,cols:i,disabledIndices:Z([...c||y.current.map(((e,t)=>$(y.current,t)?t:void 0)),void 0],s),minIndex:a,maxIndex:m,prevIndex:G(g>u?n:g,l,s,i,e.key===H?"bl":e.key===_?"tr":"tl")})]}const l={horizontal:[_],vertical:[H],both:[_,H]}[r],s={horizontal:[q],vertical:[K],both:[q,K]}[r],a=E?se:{horizontal:ce,vertical:le,both:se}[r];t===g&&[...l,...s].includes(e.key)&&(t=o&&t===u&&l.includes(e.key)?n:o&&t===n&&s.includes(e.key)?u:X(y,{startingIndex:t,decrement:s.includes(e.key),disabledIndices:c})),t===g||W(y,t)||(e.stopPropagation(),a.includes(e.key)&&e.preventDefault(),h(t),queueMicrotask((()=>{J(y.current[t])})))}(e)}};return u.createElement(ie.Provider,{value:w},u.createElement(re,{elementsRef:y},ue(n,R)))})),fe=u.forwardRef((function(e,t){const{render:n,...r}=e,o=n&&"function"!=typeof n?n.props:{},{activeIndex:i,onNavigate:l}=u.useContext(ie),{ref:s,index:a}=oe(),f=c([s,t,o.ref]),d=i===a;return ue(n,{...r,...o,ref:f,tabIndex:d?0:-1,"data-active":d?"":void 0,onFocus(e){null==r.onFocus||r.onFocus(e),null==o.onFocus||o.onFocus(e),l(a)}})}));function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},de.apply(this,arguments)}let me=!1,ve=0;const pe=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ve++;const ge=l.useId||function(){const[e,t]=u.useState((()=>me?pe():void 0));return ee((()=>{null==e&&t(pe())}),[]),u.useEffect((()=>{me=!0}),[]),e},he=u.forwardRef((function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:o}},width:i=14,height:c=7,tipRadius:l=0,strokeWidth:s=0,staticOffset:a,stroke:f,d:d,style:{transform:m,...v}={},...p}=e,g=ge(),[h,b]=u.useState(!1);if(ee((()=>{if(!r)return;"rtl"===y(r).direction&&b(!0)}),[r]),!r)return null;const w=2*s,E=w/2,R=i/2*(l/-8+1),x=c/2*l/4,[I,k]=n.split("-"),M=!!d,O="top"===I||"bottom"===I,C=a&&"end"===k?"bottom":"top";let T=a&&"end"===k?"right":"left";a&&h&&(T="end"===k?"left":"right");const S=null!=(null==o?void 0:o.x)?a||o.x:"",P=null!=(null==o?void 0:o.y)?a||o.y:"",L=d||"M0,0 H"+i+" L"+(i-R)+","+(c-x)+" Q"+i/2+","+c+" "+R+","+(c-x)+" Z",A={top:M?"rotate(180deg)":"",left:M?"rotate(90deg)":"rotate(-90deg)",bottom:M?"":"rotate(180deg)",right:M?"rotate(-90deg)":"rotate(90deg)"}[I];return u.createElement("svg",de({},p,{"aria-hidden":!0,ref:t,width:M?i:i+w,height:i,viewBox:"0 0 "+i+" "+(c>i?c:i),style:{position:"absolute",pointerEvents:"none",[T]:S,[C]:P,[I]:O||M?"100%":"calc(100% - "+w/2+"px)",transform:""+A+(null!=m?m:""),...v}}),w>0&&u.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:f,strokeWidth:w+(d?0:1),d:L}),u.createElement("path",{stroke:w&&!d?p.fill:"none",d:L}),u.createElement("clipPath",{id:g},u.createElement("rect",{x:-E,y:E*(M?-1:1),width:i+w,height:i})))}));function ye(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}const be=u.createContext(null),we=u.createContext(null),Ee=()=>{var e;return(null==(e=u.useContext(be))?void 0:e.id)||null},Re=()=>u.useContext(we);function xe(e){return"data-floating-ui-"+e}function Ie(e){const n=t.useRef(e);return ee((()=>{n.current=e})),n}const ke=xe("safe-polygon");function Me(e,t,n){return n&&!T(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}const Oe=()=>{},Ce=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Oe,setState:Oe,isInstantPhase:!1}),Te=()=>u.useContext(Ce); | ||
/*! | ||
@@ -6,2 +6,2 @@ * tabbable 6.2.0 | ||
*/ | ||
var Me=["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])"].join(","),Te="undefined"==typeof Element,Pe=Te?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Se=!Te&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Le=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Ae=function e(t,n,r){for(var o=[],u=Array.from(t);u.length;){var i=u.shift();if(!Le(i,!1))if("SLOT"===i.tagName){var c=i.assignedElements(),l=e(c.length?c:i.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{Pe.call(i,Me)&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),a=!Le(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(s&&a){var f=e(!0===s?i.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else u.unshift.apply(u,i.children)}}return o},Ne=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},De=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Ne(e)?0:e.tabIndex},Fe=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},je=function(e){return"INPUT"===e.tagName},Ke=function(e){return function(e){return je(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Se(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){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",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},He=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},qe=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Pe.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Pe.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return He(e)}else{if("function"==typeof r){for(var u=e;e;){var i=e.parentElement,c=Se(e);if(i&&!i.shadowRoot&&!0===r(i))return He(e);e=e.assignedSlot?e.assignedSlot:i||c===e.ownerDocument?i:c.host}e=u}if(function(e){var t,n,r,o,u=e&&Se(e),i=null===(t=u)||void 0===t?void 0:t.host,c=!1;if(u&&u!==e)for(c=!!(null!==(n=i)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(i)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&i;){var l,s,a;c=!(null===(s=i=null===(l=u=Se(i))||void 0===l?void 0:l.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(i))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},_e=function(e,t){return!(t.disabled||Le(t)||function(e){return je(e)&&"hidden"===e.type}(t)||qe(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Pe.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Be=function(e,t){return!(Ke(t)||De(t)<0||!_e(e,t))},We=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ue=function e(t){var n=[],r=[];return t.forEach((function(t,o){var u=!!t.scopeParent,i=u?t.scopeParent:t,c=function(e,t){var n=De(e);return n<0&&t&&!Ne(e)?0:n}(i,u),l=u?e(t.candidates):i;0===c?u?n.push.apply(n,l):n.push(i):r.push({documentOrder:o,tabIndex:c,item:t,isScope:u,content:l})})),r.sort(Fe).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ze=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Ae([e],t.includeContainer,{filter:Be.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:We}):function(e,t,n){if(Le(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Me));return t&&Pe.call(e,Me)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Be.bind(null,t)),Ue(n)},Xe=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Pe.call(e,Me)&&Be(t,e)};function Ye(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let Ve=new WeakMap,Ge=new WeakSet,Ze={},$e=0;const Qe=e=>e&&(e.host||Qe(e.parentNode)),Je=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=Qe(t);return e.contains(n)?n:null})).filter((e=>null!=e));function et(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=M(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",u=r?"inert":n?"aria-hidden":null,i=Je(t,e),c=new Set,l=new Set(i),s=[];Ze[o]||(Ze[o]=new WeakMap);const f=Ze[o];return i.forEach((function e(t){t&&!c.has(t)&&(c.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!l.has(t)&&[].forEach.call(t.children,(t=>{if("script"!==a(t))if(c.has(t))e(t);else{const e=u?t.getAttribute(u):null,n=null!==e&&"false"!==e,r=(Ve.get(t)||0)+1,i=(f.get(t)||0)+1;Ve.set(t,r),f.set(t,i),s.push(t),1===r&&n&&Ge.add(t),1===i&&t.setAttribute(o,""),!n&&u&&t.setAttribute(u,"true")}}))}(t),c.clear(),$e++,()=>{s.forEach((e=>{const t=(Ve.get(e)||0)-1,n=(f.get(e)||0)-1;Ve.set(e,t),f.set(e,n),t||(!Ge.has(e)&&u&&e.removeAttribute(u),Ge.delete(e)),n||e.removeAttribute(o)})),$e--,$e||(Ve=new WeakMap,Ve=new WeakMap,Ge=new WeakSet,Ze={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const tt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function nt(e,t){const n=ze(e,tt());"prev"===t&&n.reverse();const r=n.indexOf(y(M(e)));return n.slice(r+1)[0]}function rt(){return nt(document.body,"next")}function ot(){return nt(document.body,"prev")}function ut(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!b(n,r)}function it(e){ze(e,tt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function ct(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const lt={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};function st(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const at=u.forwardRef((function(e,t){const[n,r]=u.useState();Q((()=>(I()&&r("button"),document.addEventListener("keydown",st),()=>{document.removeEventListener("keydown",st)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Ee("focus-guard")]:"",style:lt};return u.createElement("span",ae({},e,o))})),ft=u.createContext(null),dt=Ee("portal");function vt(e){void 0===e&&(e={});const{id:t,root:n}=e,r=me(),o=mt(),[i,c]=u.useState(null),l=u.useRef(null);return Q((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{l.current=null}))}),[i]),Q((()=>{if(!r)return;if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(dt,""),e.appendChild(n),l.current=n,c(n)}),[t,r]),Q((()=>{if(!r)return;if(l.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!v(e)&&(e=e.current),e=e||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,e.appendChild(u));const i=document.createElement("div");i.id=r,i.setAttribute(dt,""),e=u||e,e.appendChild(i),l.current=i,c(i)}),[t,n,r,o]),i}const mt=()=>u.useContext(ft),pt=20;let gt=[];function ht(e){gt=gt.filter((e=>e.isConnected));let t=e;if(t&&"body"!==a(t)){if(!Xe(t,tt())){const e=ze(t,tt())[0];e&&(t=e)}gt.push(t),gt.length>pt&&(gt=gt.slice(-pt))}}function yt(){return gt.slice().reverse().find((e=>e.isConnected))}const bt=u.forwardRef((function(e,t){return u.createElement("button",ae({},e,{type:"button",ref:t,tabIndex:-1,style:lt}))}));const wt=new Set,Et=u.forwardRef((function(e,t){const{lockScroll:n=!1,...r}=e,o=me();return Q((()=>{if(!n)return;wt.add(o);const e=/iP(hone|ad|od)|iOS/.test(w()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,i=t.left?parseFloat(t.left):window.pageXOffset,c=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",u&&(t[r]=u+"px"),e){var l,s;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(c-Math.floor(n))+"px",left:-(i-Math.floor(e))+"px",right:"0"})}return()=>{wt.delete(o),0===wt.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(i,c)))}}),[o,n]),u.createElement("div",ae({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function xt(e){return m(e.target)&&"BUTTON"===e.target.tagName}function Rt(e){return L(e)}function It(e){return null!=e&&null!=e.clientX}const kt={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ot={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ct=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Mt(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=me(),i=u.useRef({}),[c]=u.useState((()=>ge())),l=null!=be(),[a,f]=u.useState(r.reference),d=s(((e,t,r)=>{i.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)})),v=u.useMemo((()=>({setPositionReference:f})),[]),m=u.useMemo((()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference})),[a,r.reference,r.floating]);return u.useMemo((()=>({dataRef:i,open:t,onOpenChange:d,elements:m,events:c,floatingId:o,refs:v})),[t,d,m,c,o,v])}const Tt="active",Pt="selected";function St(e,t,n){const r=new Map,o="item"===n;let u=e;if(o&&e){const{[Tt]:t,[Pt]:n,...r}=e;u=r}return{..."floating"===n&&{tabIndex:-1},...u,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,u]=t;var i;o&&[Tt,Pt].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof u&&(null==(i=r.get(n))||i.push(u),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=u)})),e):e),{})}}let Lt=!1;function At(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Nt(e,t){return At(t,e===F||e===j,e===K||e===H)}function Dt(e,t,n){return At(t,e===j,n?e===K:e===H)||"Enter"===e||" "===e||""===e}function Ft(e,t,n){return At(t,n?e===H:e===K,e===F)}const jt=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const Kt=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Ht(e,t){return"function"==typeof e?e(t):e}function qt(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[c,l]=u.useState("unmounted"),s=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e&&n){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,n,t]),n}(n,i);return s||"close"!==c||l("unmounted"),Q((()=>{if(r){if(n){l("initial");const e=requestAnimationFrame((()=>{l("open")}));return()=>{cancelAnimationFrame(e)}}l("close")}}),[n,r]),{isMounted:s,status:c}}function _t(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function Bt(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let e=0,i=u-1;e<u;i=e++){const[u,c]=t[e]||[0,0],[l,s]=t[i]||[0,0];c>=r!=s>=r&&n<=(l-u)*(r-c)/(s-c)+u&&(o=!o)}return o}Object.defineProperty(e,"arrow",{enumerable:!0,get:function(){return n.arrow}}),Object.defineProperty(e,"autoPlacement",{enumerable:!0,get:function(){return n.autoPlacement}}),Object.defineProperty(e,"autoUpdate",{enumerable:!0,get:function(){return n.autoUpdate}}),Object.defineProperty(e,"computePosition",{enumerable:!0,get:function(){return n.computePosition}}),Object.defineProperty(e,"detectOverflow",{enumerable:!0,get:function(){return n.detectOverflow}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return n.flip}}),Object.defineProperty(e,"getOverflowAncestors",{enumerable:!0,get:function(){return n.getOverflowAncestors}}),Object.defineProperty(e,"hide",{enumerable:!0,get:function(){return n.hide}}),Object.defineProperty(e,"inline",{enumerable:!0,get:function(){return n.inline}}),Object.defineProperty(e,"limitShift",{enumerable:!0,get:function(){return n.limitShift}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return n.offset}}),Object.defineProperty(e,"platform",{enumerable:!0,get:function(){return n.platform}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return n.shift}}),Object.defineProperty(e,"size",{enumerable:!0,get:function(){return n.size}}),e.Composite=le,e.CompositeItem=se,e.FloatingArrow=pe,e.FloatingDelayGroup=function(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,i]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=u.useRef(null),l=u.useCallback((e=>{i({currentId:e})}),[]);return Q((()=>{o.currentId?null===c.current?c.current=o.currentId:o.isInstantPhase||i({isInstantPhase:!0}):(o.isInstantPhase&&i({isInstantPhase:!1}),c.current=null)}),[o.currentId,o.isInstantPhase]),u.createElement(Oe.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:l})),[o,l])},t)},e.FloatingFocusManager=function(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:c=0,returnFocus:l=!0,restoreFocus:a=!1,modal:f=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:v=!0}=e,{open:p,refs:g,nodeId:h,onOpenChange:w,events:E,dataRef:I,floatingId:k,elements:{domReference:O,floating:C}}=t,T="number"==typeof c&&c<0,S=N(O)&&T,L="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||i,D=xe(o),F=xe(c),j=xe(l),K=we(),H=mt(),q=u.useRef(null),_=u.useRef(null),B=u.useRef(!1),W=u.useRef(!1),U=u.useRef(-1),z=null!=H,X=null==C?void 0:C.firstElementChild,Y=(null==X?void 0:X.id)===k?X:C,V=s((function(e){return void 0===e&&(e=Y),e?ze(e,tt()):[]})),G=s((e=>{const t=V(e);return D.current.map((e=>O&&"reference"===e?O:Y&&"floating"===e?Y:t)).filter(Boolean).flat()}));function Z(e){return!r&&d&&f?u.createElement(bt,{ref:"start"===e?q:_,onClick:e=>w(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}u.useEffect((()=>{if(r)return;if(!f)return;function e(e){if("Tab"===e.key){b(Y,y(M(Y)))&&0===V().length&&!S&&A(e);const t=G(),n=P(e);"reference"===D.current[0]&&n===O&&(A(e),e.shiftKey?$(t[t.length-1]):$(t[1])),"floating"===D.current[1]&&n===Y&&e.shiftKey&&(A(e),$(t[0]))}}const t=M(Y);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,O,Y,f,D,S,V,G]),u.useEffect((()=>{if(!r&&C)return C.addEventListener("focusin",e),()=>{C.removeEventListener("focusin",e)};function e(e){const t=P(e),n=V().indexOf(t);-1!==n&&(U.current=n)}}),[r,C,V]),u.useEffect((()=>{if(!r&&v)return C&&m(O)?(O.addEventListener("focusout",t),O.addEventListener("pointerdown",e),C.addEventListener("focusout",t),()=>{O.removeEventListener("focusout",t),O.removeEventListener("pointerdown",e),C.removeEventListener("focusout",t)}):void 0;function e(){W.current=!0,setTimeout((()=>{W.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(b(O,t)||b(C,t)||b(t,C)||b(null==H?void 0:H.portalNode,t)||null!=t&&t.hasAttribute(Ee("focus-guard"))||K&&(Ye(K.nodesRef.current,h).find((e=>{var n,r;return b(null==(n=e.context)?void 0:n.elements.floating,t)||b(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(K.nodesRef.current,h).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));if(a&&n&&y(M(Y))===M(Y).body){m(Y)&&(null==Y||Y.focus());const e=U.current,t=V(),n=t[e]||t[t.length-1]||Y;m(n)&&n.focus()}!f&&t&&n&&!W.current&&t!==yt()&&(B.current=!0,w(!1,e))}))}}),[r,O,C,Y,f,h,K,H,w,v,a,V]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==H||null==(e=H.portalNode)?void 0:e.querySelectorAll("["+Ee("portal")+"]"))||[]);if(C){const e=[C,...t,q.current,_.current,D.current.includes("reference")||S?O:null].filter((e=>null!=e)),n=f||S?et(e,L,!L):et(e);return()=>{n()}}}),[r,O,C,f,D,H,S,L]),Q((()=>{if(r||!m(Y))return;const e=y(M(Y));queueMicrotask((()=>{const t=G(Y),n=F.current,r=("number"==typeof n?t[n]:n.current)||Y,o=b(Y,e);T||o||!p||$(r,{preventScroll:r===Y})}))}),[r,p,Y,T,G,F]),Q((()=>{if(r||!Y)return;let e=!1;const t=M(Y),n=y(t);let o=I.current.openEvent;function u(t){let{open:n,reason:r,event:u,nested:i}=t;n&&(o=u),"escape-key"===r&&g.domReference.current&&ht(g.domReference.current),"hover"===r&&"mouseleave"===u.type&&(B.current=!0),"outside-press"===r&&(i?(B.current=!1,e=!0):B.current=!(x(u)||R(u)))}return ht(n),E.on("openchange",u),()=>{E.off("openchange",u);const n=y(t),r=b(C,n)||K&&Ye(K.nodesRef.current,h).some((e=>{var t;return b(null==(t=e.context)?void 0:t.elements.floating,n)}));(r||o&&["click","mousedown"].includes(o.type))&&g.domReference.current&&ht(g.domReference.current);const i=yt();j.current&&!B.current&&m(i)&&(i===n||n===t.body||r)&&$(i,{cancelPrevious:!1,preventScroll:e})}}),[r,C,Y,j,I,g,E,K,h]),Q((()=>{if(!r&&H)return H.setFocusManagerState({modal:f,closeOnFocusOut:v,open:p,onOpenChange:w,refs:g}),()=>{H.setFocusManagerState(null)}}),[r,H,f,p,w,g,v]),Q((()=>{if(r)return;if(!Y)return;if("function"!=typeof MutationObserver)return;if(T)return;const e=()=>{const e=Y.getAttribute("tabindex"),t=V(),n=y(M(C)),r=t.indexOf(n);-1!==r&&(U.current=r),D.current.includes("floating")||n!==g.domReference.current&&0===t.length?"0"!==e&&Y.setAttribute("tabindex","0"):"-1"!==e&&Y.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(Y,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,C,Y,g,D,V,T]);const J=!r&&L&&(z||f);return u.createElement(u.Fragment,null,J&&u.createElement(at,{"data-type":"inside",ref:null==H?void 0:H.beforeInsideRef,onFocus:e=>{if(f){const e=G();$("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=H&&H.preserveTabOrder&&H.portalNode)if(B.current=!1,ut(e,H.portalNode)){const e=rt()||O;null==e||e.focus()}else{var t;null==(t=H.beforeOutsideRef.current)||t.focus()}}}),!S&&Z("start"),n,Z("end"),J&&u.createElement(at,{"data-type":"inside",ref:null==H?void 0:H.afterInsideRef,onFocus:e=>{if(f)$(G()[0]);else if(null!=H&&H.preserveTabOrder&&H.portalNode)if(v&&(B.current=!0),ut(e,H.portalNode)){const e=ot()||O;null==e||e.focus()}else{var t;null==(t=H.afterOutsideRef.current)||t.focus()}}}))},e.FloatingList=te,e.FloatingNode=function(e){const{children:t,id:n}=e,r=be();return u.createElement(he.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=Et,e.FloatingPortal=function(e){const{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e,c=vt({id:n,root:o}),[l,s]=u.useState(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),v=u.useRef(null),m=!!l&&!l.modal&&l.open&&i&&!(!o&&!c);return u.useEffect((()=>{if(c&&i&&(null==l||!l.modal))return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&ut(e)){("focusin"===e.type?ct:it)(c)}}}),[c,i,null==l?void 0:l.modal]),u.createElement(ft.Provider,{value:u.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:v,portalNode:c,setFocusManagerState:s})),[i,c])},m&&c&&u.createElement(at,{"data-type":"outside",ref:a,onFocus:e=>{if(ut(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=ot()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),m&&c&&u.createElement("span",{"aria-owns":c.id,style:lt}),c&&r.createPortal(t,c),m&&c&&u.createElement(at,{"data-type":"outside",ref:f,onFocus:e=>{if(ut(e,c)){var t;null==(t=v.current)||t.focus()}else{const t=rt()||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))},e.FloatingTree=function(e){const{children:t}=e,n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),i=u.useState((()=>ge()))[0];return u.createElement(ye.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:i})),[r,o,i])},t)},e.inner=e=>({name:"inner",options:e,async fn(t){const{listRef:o,overflowRef:u,onFallbackChange:i,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:v,elements:{floating:m}}=t,p=o.current[l];if(!p)return{};const g={...t,...await n.offset(-p.offsetTop-m.clientTop-v.reference.height/2-p.offsetHeight/2-c).fn(t)},h=(null==f?void 0:f.current)||m,y=await n.detectOverflow(_t(g,h.scrollHeight),d),b=await n.detectOverflow(g,{...d,elementContext:"reference"}),w=Math.max(0,y.top),E=g.y+w,x=Math.max(0,h.scrollHeight-w-Math.max(0,y.bottom));return h.style.maxHeight=x+"px",h.scrollTop=w,i&&(h.offsetHeight<p.offsetHeight*Math.min(s,o.current.length-1)-1||b.top>=-a||b.bottom>=-a?r.flushSync((()=>i(!0))):r.flushSync((()=>i(!1)))),u&&(u.current=await n.detectOverflow(_t({...g,y:E},h.offsetHeight),d)),{y:E}}}),e.safePolygon=function(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,u=!1,i=null,c=null,l=performance.now();const s=e=>{let{x:n,y:s,placement:a,elements:f,onClose:d,nodeId:m,tree:p}=e;return function(e){function g(){clearTimeout(o),d()}if(clearTimeout(o),!f.domReference||!f.floating||null==a||null==n||null==s)return;const{clientX:h,clientY:y}=e,w=[h,y],E=P(e),x="mouseleave"===e.type,R=b(f.floating,E),I=b(f.domReference,E),k=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),C=a.split("-")[0],M=n>O.right-O.width/2,T=s>O.bottom-O.height/2,S=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(w,k),L=O.width>k.width,A=O.height>k.height,N=(L?k:O).left,D=(L?k:O).right,F=(A?k:O).top,j=(A?k:O).bottom;if(R&&(u=!0,!x))return;if(I&&(u=!1),I&&!x)return void(u=!0);if(x&&v(e.relatedTarget)&&b(f.floating,e.relatedTarget))return;if(p&&Ye(p.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===C&&s>=k.bottom-1||"bottom"===C&&s<=k.top+1||"left"===C&&n>=k.right-1||"right"===C&&n<=k.left+1)return g();let K=[];switch(C){case"top":K=[[N,k.top+1],[N,O.bottom-1],[D,O.bottom-1],[D,k.top+1]];break;case"bottom":K=[[N,O.top+1],[N,k.bottom-1],[D,k.bottom-1],[D,O.top+1]];break;case"left":K=[[O.right-1,j],[O.right-1,F],[k.left+1,F],[k.left+1,j]];break;case"right":K=[[k.right-1,j],[k.right-1,F],[O.left+1,F],[O.left+1,j]]}if(!Bt([h,y],K)){if(u&&!S)return g();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===i||null===c||0===r)return i=e,c=t,l=n,null;const o=e-i,u=t-c,s=Math.sqrt(o*o+u*u);return i=e,c=t,l=n,s/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return g()}Bt([h,y],function(e){let[n,r]=e;switch(C){case"top":return[[L?n+t/2:M?n+4*t:n-4*t,r+t+1],[L?n-t/2:M?n+4*t:n-4*t,r+t+1],...[[O.left,M||L?O.bottom-t:O.top],[O.right,M?L?O.bottom-t:O.top:O.bottom-t]]];case"bottom":return[[L?n+t/2:M?n+4*t:n-4*t,r-t],[L?n-t/2:M?n+4*t:n-4*t,r-t],...[[O.left,M||L?O.top+t:O.bottom],[O.right,M?L?O.top+t:O.bottom:O.top+t]]];case"left":{const e=[n+t+1,A?r+t/2:T?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:T?r+4*t:r-4*t];return[...[[T||A?O.right-t:O.left,O.top],[T?A?O.right-t:O.left:O.right-t,O.bottom]],e,o]}case"right":return[[n-t,A?r+t/2:T?r+4*t:r-4*t],[n-t,A?r-t/2:T?r+4*t:r-4*t],...[[T||A?O.left+t:O.right,O.top],[T?A?O.left+t:O.right:O.left+t,O.bottom]]]}}([n,s]))?!u&&r&&(o=window.setTimeout(g,40)):g()}}};return s.__options={blockPointerEvents:n},s},e.useClick=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:c=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=t,d=u.useRef(),v=u.useRef(!1);return u.useMemo((()=>c?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(C(d.current,!0)&&a||"click"!==l&&(!n||!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:C(d.current,!0)&&a||(!n||!s||o.current.openEvent&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||xt(e)||(" "!==e.key||Rt(i)||(e.preventDefault(),v.current=!0),"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!f||xt(e)||Rt(i)||" "===e.key&&v.current&&(v.current=!1,r(!n||!s,e.nativeEvent,"click"))}}}:{}),[c,o,l,a,f,i,s,n,r])},e.useClientPoint=function(e,t){void 0===t&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:i},refs:c}=e,{enabled:l=!0,axis:a="both",x:d=null,y:v=null}=t,m=u.useRef(!1),p=u.useRef(null),[g,h]=u.useState(),[y,w]=u.useState([]),E=s(((e,t)=>{m.current||r.current.openEvent&&!It(r.current.openEvent)||c.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var u;const i=(null==e?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},c="x"===t.axis||"both"===t.axis,l="y"===t.axis||"both"===t.axis,s=["mouseenter","mousemove"].includes((null==(u=t.dataRef.current.openEvent)?void 0:u.type)||"")&&"touch"!==t.pointerType;let a=i.width,f=i.height,d=i.x,v=i.y;return null==n&&t.x&&c&&(n=i.x-t.x),null==r&&t.y&&l&&(r=i.y-t.y),d-=n||0,v-=r||0,a=0,f=0,!o||s?(a="y"===t.axis?i.width:0,f="x"===t.axis?i.height:0,d=c&&null!=t.x?t.x:d,v=l&&null!=t.y?t.y:v):o&&!s&&(f="x"===t.axis?i.height:f,a="y"===t.axis?i.width:a),o=!0,{width:a,height:f,x:d,y:v,top:v,right:d+a,bottom:v+f,left:d}}}}(i,{x:e,y:t,axis:a,dataRef:r,pointerType:g}))})),x=s((e=>{null==d&&null==v&&(n?p.current||w([]):E(e.clientX,e.clientY))})),R=C(g)?o:n,I=u.useCallback((()=>{if(!R||!l||null!=d||null!=v)return;const e=f(o);function t(n){const r=P(n);b(o,r)?(e.removeEventListener("mousemove",t),p.current=null):E(n.clientX,n.clientY)}if(!r.current.openEvent||It(r.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),p.current=null};return p.current=n,n}c.setPositionReference(i)}),[R,l,d,v,o,r,c,i,E]);return u.useEffect((()=>I()),[I,y]),u.useEffect((()=>{l&&!o&&(m.current=!1)}),[l,o]),u.useEffect((()=>{!l&&n&&(m.current=!0)}),[l,n]),Q((()=>{!l||null==d&&null==v||(m.current=!1,E(d,v))}),[l,d,v,E]),u.useMemo((()=>{if(!l)return{};function e(e){let{pointerType:t}=e;h(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:x,onMouseEnter:x}}}),[l,x])},e.useDelayGroup=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:u}=t,i=null!=u?u:o,c=Ce(),{currentId:l,setCurrentId:s,initialDelay:a,setState:f,timeoutMs:d}=c;return Q((()=>{l&&(f({delay:{open:1,close:Ie(a,"close")}}),l!==i&&r(!1))}),[i,r,f,l,a]),Q((()=>{function e(){r(!1),f({delay:a,currentId:null})}if(l&&!n&&l===i){if(d){const t=window.setTimeout(e,d);return()=>{clearTimeout(t)}}e()}}),[n,f,l,i,r,a,d]),Q((()=>{s!==ke&&n&&s(i)}),[n,s,i]),c},e.useDelayGroupContext=Ce,e.useDismiss=function(e,t){void 0===t&&(t={});const{open:r,onOpenChange:o,elements:{reference:i,domReference:c,floating:l},dataRef:a}=e,{enabled:d=!0,escapeKey:p=!0,outsidePress:y=!0,outsidePressEvent:w="pointerdown",referencePress:E=!1,referencePressEvent:x="pointerdown",ancestorScroll:R=!1,bubbles:I,capture:k}=t,O=we(),C=s("function"==typeof y?y:()=>!1),S="function"==typeof y?C:y,L=u.useRef(!1),A=u.useRef(!1),{escapeKey:N,outsidePress:D}=Ct(I),{escapeKey:F,outsidePress:j}=Ct(k),K=s((e=>{var t;if(!r||!d||!p||"Escape"!==e.key)return;const n=null==(t=a.current.floatingContext)?void 0:t.nodeId,u=O?Ye(O.nodesRef.current,n):[];if(!N&&(e.stopPropagation(),u.length>0)){let e=!0;if(u.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),H=s((e=>{var t;const n=()=>{var t;K(e),null==(t=P(e))||t.removeEventListener("keydown",n)};null==(t=P(e))||t.addEventListener("keydown",n)})),q=s((e=>{var t;const n=L.current;L.current=!1;const r=A.current;if(A.current=!1,"click"===w&&r)return;if(n)return;if("function"==typeof S&&!S(e))return;const u=P(e),i="["+Ee("inert")+"]",s=M(l).querySelectorAll(i);let d=v(u)?u:null;for(;d&&!g(d);){const e=h(d);if(g(e)||!v(e))break;d=e}if(s.length&&v(u)&&!u.matches("html,body")&&!b(u,l)&&Array.from(s).every((e=>!b(d,e))))return;if(m(u)&&l){const t=u.clientWidth>0&&u.scrollWidth>u.clientWidth,n=u.clientHeight>0&&u.scrollHeight>u.clientHeight;let r=n&&e.offsetX>u.clientWidth;if(n){const t="rtl"===function(e){return f(e).getComputedStyle(e)}(u).direction;t&&(r=e.offsetX<=u.offsetWidth-u.clientWidth)}if(r||t&&e.offsetY>u.clientHeight)return}const p=null==(t=a.current.floatingContext)?void 0:t.nodeId,y=O&&Ye(O.nodesRef.current,p).some((t=>{var n;return T(e,null==(n=t.context)?void 0:n.elements.floating)}));if(T(e,l)||T(e,c)||y)return;const E=O?Ye(O.nodesRef.current,p):[];if(E.length>0){let e=!0;if(E.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),_=s((e=>{var t;const n=()=>{var t;q(e),null==(t=P(e))||t.removeEventListener(w,n)};null==(t=P(e))||t.addEventListener(w,n)}));return u.useEffect((()=>{if(!r||!d)return;function e(e){o(!1,e,"ancestor-scroll")}a.current.__escapeKeyBubbles=N,a.current.__outsidePressBubbles=D;const t=M(l);p&&t.addEventListener("keydown",F?H:K,F),S&&t.addEventListener(w,j?_:q,j);let u=[];return R&&(v(c)&&(u=n.getOverflowAncestors(c)),v(l)&&(u=u.concat(n.getOverflowAncestors(l))),!v(i)&&i&&i.contextElement&&(u=u.concat(n.getOverflowAncestors(i.contextElement)))),u=u.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{p&&t.removeEventListener("keydown",F?H:K,F),S&&t.removeEventListener(w,j?_:q,j),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[a,l,c,i,p,S,w,r,o,R,d,N,D,K,F,H,q,j,_]),u.useEffect((()=>{L.current=!1}),[S,w]),u.useMemo((()=>d?{reference:{onKeyDown:K,[kt[x]]:e=>{E&&o(!1,e.nativeEvent,"reference-press")}},floating:{onKeyDown:K,onMouseDown(){A.current=!0},onMouseUp(){A.current=!0},[Ot[w]]:()=>{L.current=!0}}}:{}),[d,E,w,x,o,K])},e.useFloating=function(e){void 0===e&&(e={});const{nodeId:t}=e,r=Mt({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||r,i=o.elements,[c,l]=u.useState(null),[s,a]=u.useState(null),f=(null==i?void 0:i.reference)||c,d=u.useRef(null),m=we();Q((()=>{f&&(d.current=f)}),[f]);const p=n.useFloating({...e,elements:{...i,...s&&{reference:s}}}),g=u.useCallback((e=>{const t=v(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),p.refs.setReference(t)}),[p.refs]),h=u.useCallback((e=>{(v(e)||null===e)&&(d.current=e,l(e)),(v(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!v(e))&&p.refs.setReference(e)}),[p.refs]),y=u.useMemo((()=>({...p.refs,setReference:h,setPositionReference:g,domReference:d})),[p.refs,h,g]),b=u.useMemo((()=>({...p.elements,domReference:f})),[p.elements,f]),w=u.useMemo((()=>({...p,...o,refs:y,elements:b,nodeId:t})),[p,y,b,t,o]);return Q((()=>{o.dataRef.current.floatingContext=w;const e=null==m?void 0:m.nodesRef.current.find((e=>e.id===t));e&&(e.context=w)})),u.useMemo((()=>({...p,context:w,refs:y,elements:b})),[p,y,b,w])},e.useFloatingNodeId=function(e){const t=me(),n=we(),r=be(),o=e||r;return Q((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t},e.useFloatingParentNodeId=be,e.useFloatingPortalNode=vt,e.useFloatingRootContext=Mt,e.useFloatingTree=we,e.useFocus=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:{domReference:c}}=e,{enabled:l=!0,visibleOnly:s=!0}=t,a=u.useRef(!1),d=u.useRef(),p=u.useRef(!0);return u.useEffect((()=>{if(!l)return;const e=f(c);function t(){!n&&m(c)&&c===y(M(c))&&(a.current=!0)}function r(){p.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[c,n,l]),u.useEffect((()=>{if(l)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(a.current=!0)}}),[o,l]),u.useEffect((()=>()=>{clearTimeout(d.current)}),[]),u.useMemo((()=>l?{reference:{onPointerDown(e){R(e.nativeEvent)||(p.current=!1)},onMouseLeave(){a.current=!1},onFocus(e){if(a.current)return;const t=P(e.nativeEvent);if(s&&v(t))try{if(I()&&O())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!p.current&&!L(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){a.current=!1;const t=e.relatedTarget,n=v(t)&&t.hasAttribute(Ee("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout((()=>{var o;const u=y(c?c.ownerDocument:document);(t||u!==c)&&(b(null==(o=i.current.floatingContext)?void 0:o.refs.floating.current,u)||b(c,u)||n||r(!1,e.nativeEvent,"focus"))}))}}}:{}),[l,s,i,c,r])},e.useHover=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:c,floating:l}}=e,{enabled:a=!0,delay:f=0,handleClose:d=null,mouseOnly:m=!1,restMs:p=0,move:g=!0}=t,h=we(),y=be(),w=xe(d),E=xe(f),x=u.useRef(),R=u.useRef(-1),I=u.useRef(),k=u.useRef(-1),O=u.useRef(!0),T=u.useRef(!1),P=u.useRef((()=>{})),S=u.useCallback((()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[o]);u.useEffect((()=>{if(a)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(R.current),clearTimeout(k.current),O.current=!0)}}),[a,i]),u.useEffect((()=>{if(!a||!w.current||!n)return;function e(e){S()&&r(!1,e,"hover")}const t=M(l).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[l,n,r,a,w,S]);const L=u.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Ie(E.current,"close",x.current);o&&!I.current?(clearTimeout(R.current),R.current=window.setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(R.current),r(!1,e,n))}),[E,r]),A=s((()=>{P.current(),I.current=void 0})),N=s((()=>{if(T.current){const e=M(l).body;e.style.pointerEvents="",e.removeAttribute(Re),T.current=!1}}));return u.useEffect((()=>{if(a&&v(c)){const e=c;return n&&e.addEventListener("mouseleave",i),null==l||l.addEventListener("mouseleave",i),g&&e.addEventListener("mousemove",t,{once:!0}),e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",u),()=>{n&&e.removeEventListener("mouseleave",i),null==l||l.removeEventListener("mouseleave",i),g&&e.removeEventListener("mousemove",t),e.removeEventListener("mouseenter",t),e.removeEventListener("mouseleave",u)}}function e(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function t(e){if(clearTimeout(R.current),O.current=!1,m&&!C(x.current)||p>0&&!Ie(E.current,"open"))return;const t=Ie(E.current,"open",x.current);t?R.current=window.setTimeout((()=>{r(!0,e,"hover")}),t):r(!0,e,"hover")}function u(t){if(e())return;P.current();const r=M(l);if(clearTimeout(k.current),w.current&&o.current.floatingContext){n||clearTimeout(R.current),I.current=w.current({...o.current.floatingContext,tree:h,x:t.clientX,y:t.clientY,onClose(){N(),A(),L(t,!0,"safe-polygon")}});const e=I.current;return r.addEventListener("mousemove",e),void(P.current=()=>{r.removeEventListener("mousemove",e)})}("touch"!==x.current||!b(l,t.relatedTarget))&&L(t)}function i(t){e()||o.current.floatingContext&&(null==w.current||w.current({...o.current.floatingContext,tree:h,x:t.clientX,y:t.clientY,onClose(){N(),A(),L(t)}})(t))}}),[c,l,a,e,m,p,g,L,A,N,r,n,h,E,w,o]),Q((()=>{var e;if(a&&n&&null!=(e=w.current)&&e.__options.blockPointerEvents&&S()){const e=M(l).body;if(e.setAttribute(Re,""),e.style.pointerEvents="none",T.current=!0,v(c)&&l){var t;const e=c,n=null==h||null==(t=h.nodesRef.current.find((e=>e.id===y)))||null==(t=t.context)?void 0:t.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{e.style.pointerEvents="",l.style.pointerEvents=""}}}}),[a,n,y,l,c,h,w,S]),Q((()=>{n||(x.current=void 0,A(),N())}),[n,A,N]),u.useEffect((()=>()=>{A(),clearTimeout(R.current),clearTimeout(k.current),N()}),[a,c,A,N]),u.useMemo((()=>{if(!a)return{};function e(e){x.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){O.current||r(!0,t,"hover")}m&&!C(x.current)||n||0===p||(clearTimeout(k.current),"touch"===x.current?o():k.current=window.setTimeout(o,p))}},floating:{onMouseEnter(){clearTimeout(R.current)},onMouseLeave(e){L(e.nativeEvent,!1)}}}}),[a,m,n,p,r,L])},e.useId=me,e.useInnerOffset=function(e,t){const{open:n,elements:o}=e,{enabled:i=!0,overflowRef:c,scrollRef:l,onChange:a}=t,f=s(a),d=u.useRef(!1),v=u.useRef(null),m=u.useRef(null);return u.useEffect((()=>{if(!i)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;const n=e.deltaY,o=c.current.top>=-.5,u=c.current.bottom>=-.5,i=t.scrollHeight-t.clientHeight,l=n<0?-1:1,s=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!o&&n>0||!u&&n<0?(e.preventDefault(),r.flushSync((()=>{f((e=>e+Math[s](n,i*l)))}))):/firefox/i.test(E())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||o.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{v.current=t.scrollTop,null!=c.current&&(m.current={...c.current})})),()=>{v.current=null,m.current=null,t.removeEventListener("wheel",e)}):void 0}),[i,n,o.floating,c,l,f]),u.useMemo((()=>i?{floating:{onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const e=(null==l?void 0:l.current)||o.floating;if(c.current&&e&&d.current){if(null!==v.current){const t=e.scrollTop-v.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&r.flushSync((()=>f((e=>e+t))))}requestAnimationFrame((()=>{v.current=e.scrollTop}))}}}}:{}),[i,c,o.floating,l,f])},e.useInteractions=function(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>St(t,e,"reference")),t),r=u.useCallback((t=>St(t,e,"floating")),t),o=u.useCallback((t=>St(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return u.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])},e.useListItem=ne,e.useListNavigation=function(e,t){const{open:n,onOpenChange:r,elements:{domReference:o,floating:i}}=e,{listRef:c,activeIndex:l,onNavigate:a=(()=>{}),enabled:f=!0,selectedIndex:d=null,allowEscape:v=!1,loop:p=!1,nested:g=!1,rtl:h=!1,virtual:w=!1,focusItemOnOpen:E="auto",focusItemOnHover:k=!0,openOnArrowKeyDown:C=!0,disabledIndices:T,orientation:P="vertical",cols:S=1,scrollItemIntoView:L=!0,virtualItemRef:D,itemSizes:F,dense:q=!1}=t,Z=be(),J=we(),ee=s(a),te=u.useRef(E),ne=u.useRef(null!=d?d:-1),re=u.useRef(null),oe=u.useRef(!0),ue=u.useRef(ee),ie=u.useRef(!!i),ce=u.useRef(!1),le=u.useRef(!1),se=xe(T),ae=xe(n),fe=xe(L),de=xe(i),ve=xe(d),[me,pe]=u.useState(),[ge,he]=u.useState(),ye=s((function(e,t,n){function r(e){w?(pe(e.id),null==J||J.events.emit("virtualfocus",e),D&&(D.current=e)):$(e,{preventScroll:!0,sync:!(!O()||!I())&&(Lt||ce.current)})}void 0===n&&(n=!1);const o=e.current[t.current];o&&r(o),requestAnimationFrame((()=>{const u=e.current[t.current]||o;if(!u)return;o||r(u);const i=fe.current;i&&Re&&(n||!oe.current)&&(null==u.scrollIntoView||u.scrollIntoView("boolean"==typeof i?{block:"nearest",inline:"nearest"}:i))}))}));Q((()=>{document.createElement("div").focus({get preventScroll(){return Lt=!0,!1}})}),[]),Q((()=>{f&&(n&&i?te.current&&null!=d&&(le.current=!0,ne.current=d,ee(d)):ie.current&&(ne.current=-1,ue.current(null)))}),[f,n,i,d,ee]),Q((()=>{if(f&&n&&i)if(null==l){if(ce.current=!1,null!=ve.current)return;if(ie.current&&(ne.current=-1,ye(c,ne)),!ie.current&&te.current&&(null!=re.current||!0===te.current&&null==re.current)){let e=0;const t=()=>{if(null==c.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else ne.current=null==re.current||Dt(re.current,P,h)||g?B(c,se.current):W(c,se.current),re.current=null,ee(ne.current)};t()}}else _(c,l)||(ne.current=l,ye(c,ne,le.current),le.current=!1)}),[f,n,i,l,ve,g,c,P,h,ee,ye,se]),Q((()=>{var e;if(!f||i||!J||w||!ie.current)return;const t=J.nodesRef.current,n=null==(e=t.find((e=>e.id===Z)))||null==(e=e.context)?void 0:e.elements.floating,r=y(M(i)),o=t.some((e=>e.context&&b(e.context.elements.floating,r)));n&&!o&&oe.current&&n.focus({preventScroll:!0})}),[f,i,J,Z,w]),Q((()=>{if(f&&J&&w&&!Z)return J.events.on("virtualfocus",e),()=>{J.events.off("virtualfocus",e)};function e(e){he(e.id),D&&(D.current=e)}}),[f,J,w,Z,D]),Q((()=>{ue.current=ee,ie.current=!!i})),Q((()=>{n||(re.current=null)}),[n]);const Ee=null!=l,Re=u.useMemo((()=>{function e(e){if(!n)return;const t=c.current.indexOf(e);-1!==t&&ee(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...k&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;oe.current&&"touch"!==t&&(ne.current=-1,ye(c,ne),ee(null),w||$(de.current,{preventScroll:!0}))}}}}),[n,de,ye,k,c,ee,w]);return u.useMemo((()=>{if(!f)return{};const e=se.current;function t(t){if(oe.current=!1,ce.current=!0,!ae.current&&t.currentTarget===de.current)return;if(g&&Ft(t.key,P,h))return A(t),r(!1,t.nativeEvent,"list-navigation"),void(m(o)&&!w&&o.focus());const u=ne.current,i=B(c,e),l=W(c,e);if("Home"===t.key&&(A(t),ne.current=i,ee(ne.current)),"End"===t.key&&(A(t),ne.current=l,ee(ne.current)),S>1){const n=F||Array.from({length:c.current.length},(()=>({width:1,height:1}))),r=X(n,S,q),o=r.findIndex((t=>null!=t&&!G(c.current,t,e))),u=r.reduce(((t,n,r)=>null==n||G(c.current,n,e)?t:r),-1);if(ne.current=r[z({current:r.map((e=>null!=e?c.current[e]:null))},{event:t,orientation:P,loop:p,cols:S,disabledIndices:V([...e||c.current.map(((e,t)=>G(c.current,t)?t:void 0)),void 0],r),minIndex:o,maxIndex:u,prevIndex:Y(ne.current>l?i:ne.current,n,r,S,t.key===j?"bl":t.key===H?"tr":"tl"),stopEvent:!0})],ee(ne.current),"both"===P)return}if(Nt(t.key,P)){if(A(t),n&&!w&&y(t.currentTarget.ownerDocument)===t.currentTarget)return ne.current=Dt(t.key,P,h)?i:l,void ee(ne.current);Dt(t.key,P,h)?ne.current=p?u>=l?v&&u!==c.current.length?-1:i:U(c,{startingIndex:u,disabledIndices:e}):Math.min(l,U(c,{startingIndex:u,disabledIndices:e})):ne.current=p?u<=i?v&&-1!==u?c.current.length:l:U(c,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(i,U(c,{startingIndex:u,decrement:!0,disabledIndices:e})),_(c,ne.current)?ee(null):ee(ne.current)}}function u(e){"auto"===E&&x(e.nativeEvent)&&(te.current=!0)}const i=w&&n&&Ee&&{"aria-activedescendant":ge||me},l=c.current.find((e=>(null==e?void 0:e.id)===me));return{reference:{...i,onKeyDown(o){oe.current=!1;const u=0===o.key.indexOf("Arrow"),i=function(e,t,n){return At(t,n?e===K:e===H,e===j)}(o.key,P,h),s=Ft(o.key,P,h),a=Nt(o.key,P),f=(g?i:a)||"Enter"===o.key||""===o.key.trim();if(w&&n){const e=null==J?void 0:J.nodesRef.current.find((e=>null==e.parentId)),n=J&&e?function(e,t){let n,r=-1;return function t(o,u){u>r&&(n=o,r=u),Ye(e,o).forEach((e=>{t(e.id,u+1)}))}(t,0),e.find((e=>e.id===n))}(J.nodesRef.current,e.id):null;if(u&&n&&D){const e=new KeyboardEvent("keydown",{key:o.key,bubbles:!0});if(i||s){var v,m;const t=(null==(v=n.context)?void 0:v.elements.domReference)===o.currentTarget,r=s&&!t?null==(m=n.context)?void 0:m.elements.domReference:i?l:null;r&&(A(o),r.dispatchEvent(e),he(void 0))}var p;if(a&&n.context)if(n.context.open&&n.parentId&&o.currentTarget!==n.context.elements.domReference)return A(o),void(null==(p=n.context.elements.domReference)||p.dispatchEvent(e))}return t(o)}(n||C||!u)&&(f&&(re.current=g&&a?null:o.key),g?i&&(A(o),n?(ne.current=B(c,e),ee(ne.current)):r(!0,o.nativeEvent,"list-navigation")):a&&(null!=d&&(ne.current=d),A(o),!n&&C?r(!0,o.nativeEvent,"list-navigation"):t(o),n&&ee(ne.current)))},onFocus(){n&&!w&&ee(null)},onPointerDown:function(e){te.current=E,"auto"===E&&R(e.nativeEvent)&&(te.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===P?void 0:P,...!N(o)&&i,onKeyDown:t,onPointerMove(){oe.current=!0}},item:Re}}),[o,de,me,ge,se,ae,c,f,P,h,w,n,Ee,g,d,C,v,S,p,E,ee,r,Re,J,D,F,q])},e.useMergeRefs=i,e.useRole=function(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:c="dialog"}=t,l=null!=(n=jt.get(c))?n:c,s=me(),a=null!=be();return u.useMemo((()=>{if(!i)return{};const e={id:o,...l&&{role:l}};return"tooltip"===l||"label"===c?{reference:{["aria-"+("label"===c?"labelledby":"describedby")]:r?o:void 0},floating:e}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":r?o:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:s},..."menu"===l&&a&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}},floating:{...e,..."menu"===l&&{"aria-labelledby":s}},item(e){let{active:t,selected:n}=e;const r={role:"option",...t&&{id:o+"-option"}};switch(c){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}}}),[i,c,l,r,o,s,a])},e.useTransitionStatus=qt,e.useTransitionStyles=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:c=250}=t,l=e.placement,s=l.split("-")[0],a=u.useMemo((()=>({side:s,placement:l})),[s,l]),f="number"==typeof c,d=(f?c:c.open)||0,v=(f?c:c.close)||0,[m,p]=u.useState((()=>({...Ht(i,a),...Ht(n,a)}))),{isMounted:g,status:h}=qt(e,{duration:c}),y=xe(n),b=xe(r),w=xe(o),E=xe(i);return Q((()=>{const e=Ht(y.current,a),t=Ht(w.current,a),n=Ht(E.current,a),r=Ht(b.current,a)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===h&&p((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===h&&p({transitionProperty:Object.keys(r).map(Kt).join(","),transitionDuration:d+"ms",...n,...r}),"close"===h){const r=t||e;p({transitionProperty:Object.keys(r).map(Kt).join(","),transitionDuration:v+"ms",...n,...r})}}),[v,w,y,b,E,d,h,a]),{isMounted:g,styles:m}},e.useTypeahead=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:c,onMatch:l,onTypingChange:a,enabled:f=!0,findMatch:d=null,resetMs:v=750,ignoreKeys:m=[],selectedIndex:p=null}=t,g=u.useRef(),h=u.useRef(""),y=u.useRef(null!=(n=null!=p?p:c)?n:-1),b=u.useRef(null),w=s(l),E=s(a),x=xe(d),R=xe(m);return Q((()=>{r&&(clearTimeout(g.current),b.current=null,h.current="")}),[r]),Q((()=>{var e;r&&""===h.current&&(y.current=null!=(e=null!=p?p:c)?e:-1)}),[r,p,c]),u.useMemo((()=>{if(!f)return{};function e(e){e?o.current.typing||(o.current.typing=e,E(e)):o.current.typing&&(o.current.typing=e,E(e))}function t(e,t,n){const r=x.current?x.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}function n(n){const o=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(o,o,h.current)?e(!1):" "===n.key&&A(n)),null==o||R.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(A(n),e(!0));o.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.current===n.key&&(h.current="",y.current=b.current),h.current+=n.key,clearTimeout(g.current),g.current=setTimeout((()=>{h.current="",y.current=b.current,e(!1)}),v);const u=y.current,c=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],h.current);-1!==c?(w(c),b.current=c):" "!==n.key&&(h.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[f,r,o,i,v,R,x,w,E])}})); | ||
var Se=["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])"].join(","),Pe="undefined"==typeof Element,Le=Pe?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ae=!Pe&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Ne=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},De=function e(t,n,r){for(var o=[],u=Array.from(t);u.length;){var i=u.shift();if(!Ne(i,!1))if("SLOT"===i.tagName){var c=i.assignedElements(),l=e(c.length?c:i.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{Le.call(i,Se)&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),a=!Ne(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(s&&a){var f=e(!0===s?i.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else u.unshift.apply(u,i.children)}}return o},Fe=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},je=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Fe(e)?0:e.tabIndex},Ke=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},He=function(e){return"INPUT"===e.tagName},qe=function(e){return function(e){return He(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Ae(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){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",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},_e=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Be=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Le.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Le.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return _e(e)}else{if("function"==typeof r){for(var u=e;e;){var i=e.parentElement,c=Ae(e);if(i&&!i.shadowRoot&&!0===r(i))return _e(e);e=e.assignedSlot?e.assignedSlot:i||c===e.ownerDocument?i:c.host}e=u}if(function(e){var t,n,r,o,u=e&&Ae(e),i=null===(t=u)||void 0===t?void 0:t.host,c=!1;if(u&&u!==e)for(c=!!(null!==(n=i)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(i)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&i;){var l,s,a;c=!(null===(s=i=null===(l=u=Ae(i))||void 0===l?void 0:l.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(i))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},We=function(e,t){return!(t.disabled||Ne(t)||function(e){return He(e)&&"hidden"===e.type}(t)||Be(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Le.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ue=function(e,t){return!(qe(t)||je(t)<0||!We(e,t))},ze=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Xe=function e(t){var n=[],r=[];return t.forEach((function(t,o){var u=!!t.scopeParent,i=u?t.scopeParent:t,c=function(e,t){var n=je(e);return n<0&&t&&!Fe(e)?0:n}(i,u),l=u?e(t.candidates):i;0===c?u?n.push.apply(n,l):n.push(i):r.push({documentOrder:o,tabIndex:c,item:t,isScope:u,content:l})})),r.sort(Ke).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Ye=function(e,t){var n;return n=(t=t||{}).getShadowRoot?De([e],t.includeContainer,{filter:Ue.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ze}):function(e,t,n){if(Ne(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Se));return t&&Le.call(e,Se)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Ue.bind(null,t)),Xe(n)},Ve=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Le.call(e,Se)&&Ue(t,e)};function Ge(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let Ze=new WeakMap,$e=new WeakSet,Qe={},Je=0;const et=e=>e&&(e.host||et(e.parentNode)),tt=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=et(t);return e.contains(n)?n:null})).filter((e=>null!=e));function nt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=S(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",u=r?"inert":n?"aria-hidden":null,i=tt(t,e),c=new Set,l=new Set(i),s=[];Qe[o]||(Qe[o]=new WeakMap);const a=Qe[o];return i.forEach((function e(t){t&&!c.has(t)&&(c.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!l.has(t)&&[].forEach.call(t.children,(t=>{if("script"!==f(t))if(c.has(t))e(t);else{const e=u?t.getAttribute(u):null,n=null!==e&&"false"!==e,r=(Ze.get(t)||0)+1,i=(a.get(t)||0)+1;Ze.set(t,r),a.set(t,i),s.push(t),1===r&&n&&$e.add(t),1===i&&t.setAttribute(o,""),!n&&u&&t.setAttribute(u,"true")}}))}(t),c.clear(),Je++,()=>{s.forEach((e=>{const t=(Ze.get(e)||0)-1,n=(a.get(e)||0)-1;Ze.set(e,t),a.set(e,n),t||(!$e.has(e)&&u&&e.removeAttribute(u),$e.delete(e)),n||e.removeAttribute(o)})),Je--,Je||(Ze=new WeakMap,Ze=new WeakMap,$e=new WeakSet,Qe={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const rt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ot(e,t){const n=Ye(e,rt());"prev"===t&&n.reverse();const r=n.indexOf(w(S(e)));return n.slice(r+1)[0]}function ut(){return ot(document.body,"next")}function it(){return ot(document.body,"prev")}function ct(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!E(n,r)}function lt(e){Ye(e,rt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function st(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const at={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};function ft(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const dt=u.forwardRef((function(e,t){const[n,r]=u.useState();ee((()=>(M()&&r("button"),document.addEventListener("keydown",ft),()=>{document.removeEventListener("keydown",ft)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[xe("focus-guard")]:"",style:at};return u.createElement("span",de({},e,o))})),mt=u.createContext(null),vt=xe("portal");function pt(e){void 0===e&&(e={});const{id:t,root:n}=e,r=ge(),o=gt(),[i,c]=u.useState(null),l=u.useRef(null);return ee((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{l.current=null}))}),[i]),ee((()=>{if(!r)return;if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(vt,""),e.appendChild(n),l.current=n,c(n)}),[t,r]),ee((()=>{if(!r)return;if(l.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!v(e)&&(e=e.current),e=e||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,e.appendChild(u));const i=document.createElement("div");i.id=r,i.setAttribute(vt,""),e=u||e,e.appendChild(i),l.current=i,c(i)}),[t,n,r,o]),i}const gt=()=>u.useContext(mt),ht=20;let yt=[];function bt(e){yt=yt.filter((e=>e.isConnected));let t=e;if(t&&"body"!==f(t)){if(!Ve(t,rt())){const e=Ye(t,rt())[0];e&&(t=e)}yt.push(t),yt.length>ht&&(yt=yt.slice(-ht))}}function wt(){return yt.slice().reverse().find((e=>e.isConnected))}const Et=u.forwardRef((function(e,t){return u.createElement("button",de({},e,{type:"button",ref:t,tabIndex:-1,style:at}))}));const Rt=new Set,xt=u.forwardRef((function(e,t){const{lockScroll:n=!1,...r}=e,o=ge();return ee((()=>{if(!n)return;Rt.add(o);const e=/iP(hone|ad|od)|iOS/.test(R()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,i=t.left?parseFloat(t.left):window.pageXOffset,c=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",u&&(t[r]=u+"px"),e){var l,s;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(c-Math.floor(n))+"px",left:-(i-Math.floor(e))+"px",right:"0"})}return()=>{Rt.delete(o),0===Rt.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(i,c)))}}),[o,n]),u.createElement("div",de({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function It(e){return p(e.target)&&"BUTTON"===e.target.tagName}function kt(e){return N(e)}function Mt(e){return null!=e&&null!=e.clientX}const Ot={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ct={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Tt=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function St(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=ge(),i=u.useRef({}),[c]=u.useState((()=>ye())),l=null!=Ee(),[s,f]=u.useState(r.reference),d=a(((e,t,r)=>{i.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)})),m=u.useMemo((()=>({setPositionReference:f})),[]),v=u.useMemo((()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference})),[s,r.reference,r.floating]);return u.useMemo((()=>({dataRef:i,open:t,onOpenChange:d,elements:v,events:c,floatingId:o,refs:m})),[t,d,v,c,o,m])}const Pt="active",Lt="selected";function At(e,t,n){const r=new Map,o="item"===n;let u=e;if(o&&e){const{[Pt]:t,[Lt]:n,...r}=e;u=r}return{..."floating"===n&&{tabIndex:-1},...u,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,u]=t;var i;o&&[Pt,Lt].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof u&&(null==(i=r.get(n))||i.push(u),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=u)})),e):e),{})}}let Nt=!1;function Dt(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ft(e,t){return Dt(t,e===K||e===H,e===q||e===_)}function jt(e,t,n){return Dt(t,e===H,n?e===q:e===_)||"Enter"===e||" "===e||""===e}function Kt(e,t,n){return Dt(t,n?e===_:e===q,e===K)}const Ht=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const qt=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function _t(e,t){return"function"==typeof e?e(t):e}function Bt(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[c,l]=u.useState("unmounted"),s=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e&&n){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,n,t]),n}(n,i);return s||"close"!==c||l("unmounted"),ee((()=>{if(r){if(n){l("initial");const e=requestAnimationFrame((()=>{l("open")}));return()=>{cancelAnimationFrame(e)}}l("close")}}),[n,r]),{isMounted:s,status:c}}function Wt(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function Ut(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let e=0,i=u-1;e<u;i=e++){const[u,c]=t[e]||[0,0],[l,s]=t[i]||[0,0];c>=r!=s>=r&&n<=(l-u)*(r-c)/(s-c)+u&&(o=!o)}return o}Object.defineProperty(e,"arrow",{enumerable:!0,get:function(){return r.arrow}}),Object.defineProperty(e,"autoPlacement",{enumerable:!0,get:function(){return r.autoPlacement}}),Object.defineProperty(e,"autoUpdate",{enumerable:!0,get:function(){return r.autoUpdate}}),Object.defineProperty(e,"computePosition",{enumerable:!0,get:function(){return r.computePosition}}),Object.defineProperty(e,"detectOverflow",{enumerable:!0,get:function(){return r.detectOverflow}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return r.flip}}),Object.defineProperty(e,"getOverflowAncestors",{enumerable:!0,get:function(){return r.getOverflowAncestors}}),Object.defineProperty(e,"hide",{enumerable:!0,get:function(){return r.hide}}),Object.defineProperty(e,"inline",{enumerable:!0,get:function(){return r.inline}}),Object.defineProperty(e,"limitShift",{enumerable:!0,get:function(){return r.limitShift}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return r.offset}}),Object.defineProperty(e,"platform",{enumerable:!0,get:function(){return r.platform}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return r.shift}}),Object.defineProperty(e,"size",{enumerable:!0,get:function(){return r.size}}),e.Composite=ae,e.CompositeItem=fe,e.FloatingArrow=he,e.FloatingDelayGroup=function(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,i]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=u.useRef(null),l=u.useCallback((e=>{i({currentId:e})}),[]);return ee((()=>{o.currentId?null===c.current?c.current=o.currentId:o.isInstantPhase||i({isInstantPhase:!0}):(o.isInstantPhase&&i({isInstantPhase:!1}),c.current=null)}),[o.currentId,o.isInstantPhase]),u.createElement(Ce.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:l})),[o,l])},t)},e.FloatingFocusManager=function(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:c=0,returnFocus:l=!0,restoreFocus:s=!1,modal:f=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:m=!0}=e,{open:v,refs:g,nodeId:h,onOpenChange:y,events:b,dataRef:R,floatingId:x,elements:{domReference:M,floating:O}}=t,C="number"==typeof c&&c<0,T=F(M)&&C,P="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||i,A=Ie(o),N=Ie(c),j=Ie(l),K=Re(),H=gt(),q=u.useRef(null),_=u.useRef(null),B=u.useRef(!1),W=u.useRef(!1),U=u.useRef(-1),z=null!=H,X=null==O?void 0:O.firstElementChild,Y=(null==X?void 0:X.id)===x?X:O,V=a((function(e){return void 0===e&&(e=Y),e?Ye(e,rt()):[]})),G=a((e=>{const t=V(e);return A.current.map((e=>M&&"reference"===e?M:Y&&"floating"===e?Y:t)).filter(Boolean).flat()}));function Z(e){return!r&&d&&f?u.createElement(Et,{ref:"start"===e?q:_,onClick:e=>y(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}u.useEffect((()=>{if(r)return;if(!f)return;function e(e){if("Tab"===e.key){E(Y,w(S(Y)))&&0===V().length&&!T&&D(e);const t=G(),n=L(e);"reference"===A.current[0]&&n===M&&(D(e),e.shiftKey?J(t[t.length-1]):J(t[1])),"floating"===A.current[1]&&n===Y&&e.shiftKey&&(D(e),J(t[0]))}}const t=S(Y);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,M,Y,f,A,T,V,G]),u.useEffect((()=>{if(!r&&O)return O.addEventListener("focusin",e),()=>{O.removeEventListener("focusin",e)};function e(e){const t=L(e),n=V().indexOf(t);-1!==n&&(U.current=n)}}),[r,O,V]),u.useEffect((()=>{if(!r&&m)return O&&p(M)?(M.addEventListener("focusout",t),M.addEventListener("pointerdown",e),O.addEventListener("focusout",t),()=>{M.removeEventListener("focusout",t),M.removeEventListener("pointerdown",e),O.removeEventListener("focusout",t)}):void 0;function e(){W.current=!0,setTimeout((()=>{W.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(E(M,t)||E(O,t)||E(t,O)||E(null==H?void 0:H.portalNode,t)||null!=t&&t.hasAttribute(xe("focus-guard"))||K&&(Ge(K.nodesRef.current,h).find((e=>{var n,r;return E(null==(n=e.context)?void 0:n.elements.floating,t)||E(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(K.nodesRef.current,h).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));if(s&&n&&w(S(Y))===S(Y).body){p(Y)&&(null==Y||Y.focus());const e=U.current,t=V(),n=t[e]||t[t.length-1]||Y;p(n)&&n.focus()}!T&&f||!t||!n||W.current||t===wt()||(B.current=!0,y(!1,e))}))}}),[r,M,O,Y,f,h,K,H,y,m,s,V,T]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==H||null==(e=H.portalNode)?void 0:e.querySelectorAll("["+xe("portal")+"]"))||[]);if(O){const e=[O,...t,q.current,_.current,A.current.includes("reference")||T?M:null].filter((e=>null!=e)),n=f||T?nt(e,P,!P):nt(e);return()=>{n()}}}),[r,M,O,f,A,H,T,P]),ee((()=>{if(r||!p(Y))return;const e=w(S(Y));queueMicrotask((()=>{const t=G(Y),n=N.current,r=("number"==typeof n?t[n]:n.current)||Y,o=E(Y,e);C||o||!v||J(r,{preventScroll:r===Y})}))}),[r,v,Y,C,G,N]),ee((()=>{if(r||!Y)return;let e=!1;const t=S(Y),n=w(t);let o=R.current.openEvent;function u(t){let{open:n,reason:r,event:u,nested:i}=t;n&&(o=u),"escape-key"===r&&g.domReference.current&&bt(g.domReference.current),"hover"===r&&"mouseleave"===u.type&&(B.current=!0),"outside-press"===r&&(i?(B.current=!1,e=!0):B.current=!(I(u)||k(u)))}return bt(n),b.on("openchange",u),()=>{b.off("openchange",u);const n=w(t),r=E(O,n)||K&&Ge(K.nodesRef.current,h).some((e=>{var t;return E(null==(t=e.context)?void 0:t.elements.floating,n)}));(r||o&&["click","mousedown"].includes(o.type))&&g.domReference.current&&bt(g.domReference.current);const i=wt();j.current&&!B.current&&p(i)&&(i===n||n===t.body||r)&&J(i,{cancelPrevious:!1,preventScroll:e})}}),[r,O,Y,j,R,g,b,K,h]),ee((()=>{if(!r&&H)return H.setFocusManagerState({modal:f,closeOnFocusOut:m,open:v,onOpenChange:y,refs:g}),()=>{H.setFocusManagerState(null)}}),[r,H,f,v,y,g,m]),ee((()=>{if(r)return;if(!Y)return;if("function"!=typeof MutationObserver)return;if(C)return;const e=()=>{const e=Y.getAttribute("tabindex"),t=V(),n=w(S(O)),r=t.indexOf(n);-1!==r&&(U.current=r),A.current.includes("floating")||n!==g.domReference.current&&0===t.length?"0"!==e&&Y.setAttribute("tabindex","0"):"-1"!==e&&Y.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(Y,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,O,Y,g,A,V,C]);const $=!r&&P&&(!f||!T)&&(z||f);return u.createElement(u.Fragment,null,$&&u.createElement(dt,{"data-type":"inside",ref:null==H?void 0:H.beforeInsideRef,onFocus:e=>{if(f){const e=G();J("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=H&&H.preserveTabOrder&&H.portalNode)if(B.current=!1,ct(e,H.portalNode)){const e=ut()||M;null==e||e.focus()}else{var t;null==(t=H.beforeOutsideRef.current)||t.focus()}}}),!T&&Z("start"),n,Z("end"),$&&u.createElement(dt,{"data-type":"inside",ref:null==H?void 0:H.afterInsideRef,onFocus:e=>{if(f)J(G()[0]);else if(null!=H&&H.preserveTabOrder&&H.portalNode)if(m&&(B.current=!0),ct(e,H.portalNode)){const e=it()||M;null==e||e.focus()}else{var t;null==(t=H.afterOutsideRef.current)||t.focus()}}}))},e.FloatingList=re,e.FloatingNode=function(e){const{children:t,id:n}=e,r=Ee();return u.createElement(be.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=xt,e.FloatingPortal=function(e){const{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e,c=pt({id:n,root:r}),[l,s]=u.useState(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),m=u.useRef(null),v=!!l&&!l.modal&&l.open&&o&&!(!r&&!c);return u.useEffect((()=>{if(c&&o&&(null==l||!l.modal))return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&ct(e)){("focusin"===e.type?st:lt)(c)}}}),[c,o,null==l?void 0:l.modal]),u.createElement(mt.Provider,{value:u.useMemo((()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:m,portalNode:c,setFocusManagerState:s})),[o,c])},v&&c&&u.createElement(dt,{"data-type":"outside",ref:a,onFocus:e=>{if(ct(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=it()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),v&&c&&u.createElement("span",{"aria-owns":c.id,style:at}),c&&i.createPortal(t,c),v&&c&&u.createElement(dt,{"data-type":"outside",ref:f,onFocus:e=>{if(ct(e,c)){var t;null==(t=m.current)||t.focus()}else{const t=ut()||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))},e.FloatingTree=function(e){const{children:t}=e,n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),i=u.useState((()=>ye()))[0];return u.createElement(we.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:i})),[r,o,i])},t)},e.inner=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:o,onFallbackChange:u,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=(v=t,"function"==typeof(m=e)?m(v):m);var m,v;const{rects:p,elements:{floating:g}}=t,h=n.current[l];if(!h)return{};const y={...t,...await r.offset(-h.offsetTop-g.clientTop-p.reference.height/2-h.offsetHeight/2-c).fn(t)},b=(null==f?void 0:f.current)||g,w=await r.detectOverflow(Wt(y,b.scrollHeight),d),E=await r.detectOverflow(y,{...d,elementContext:"reference"}),R=Math.max(0,w.top),x=y.y+R,I=Math.max(0,b.scrollHeight-R-Math.max(0,w.bottom));return b.style.maxHeight=I+"px",b.scrollTop=R,u&&(b.offsetHeight<h.offsetHeight*Math.min(s,n.current.length-1)-1||E.top>=-a||E.bottom>=-a?i.flushSync((()=>u(!0))):i.flushSync((()=>u(!1)))),o&&(o.current=await r.detectOverflow(Wt({...y,y:x},b.offsetHeight),d)),{y:x}}}),e.safePolygon=function(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,u=!1,i=null,c=null,l=performance.now();const s=e=>{let{x:n,y:s,placement:a,elements:f,onClose:d,nodeId:m,tree:p}=e;return function(e){function g(){clearTimeout(o),d()}if(clearTimeout(o),!f.domReference||!f.floating||null==a||null==n||null==s)return;const{clientX:h,clientY:y}=e,b=[h,y],w=L(e),R="mouseleave"===e.type,x=E(f.floating,w),I=E(f.domReference,w),k=f.domReference.getBoundingClientRect(),M=f.floating.getBoundingClientRect(),O=a.split("-")[0],C=n>M.right-M.width/2,T=s>M.bottom-M.height/2,S=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(b,k),P=M.width>k.width,A=M.height>k.height,N=(P?k:M).left,D=(P?k:M).right,F=(A?k:M).top,j=(A?k:M).bottom;if(x&&(u=!0,!R))return;if(I&&(u=!1),I&&!R)return void(u=!0);if(R&&v(e.relatedTarget)&&E(f.floating,e.relatedTarget))return;if(p&&Ge(p.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===O&&s>=k.bottom-1||"bottom"===O&&s<=k.top+1||"left"===O&&n>=k.right-1||"right"===O&&n<=k.left+1)return g();let K=[];switch(O){case"top":K=[[N,k.top+1],[N,M.bottom-1],[D,M.bottom-1],[D,k.top+1]];break;case"bottom":K=[[N,M.top+1],[N,k.bottom-1],[D,k.bottom-1],[D,M.top+1]];break;case"left":K=[[M.right-1,j],[M.right-1,F],[k.left+1,F],[k.left+1,j]];break;case"right":K=[[k.right-1,j],[k.right-1,F],[M.left+1,F],[M.left+1,j]]}if(!Ut([h,y],K)){if(u&&!S)return g();if(!R&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===i||null===c||0===r)return i=e,c=t,l=n,null;const o=e-i,u=t-c,s=Math.sqrt(o*o+u*u);return i=e,c=t,l=n,s/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return g()}Ut([h,y],function(e){let[n,r]=e;switch(O){case"top":return[[P?n+t/2:C?n+4*t:n-4*t,r+t+1],[P?n-t/2:C?n+4*t:n-4*t,r+t+1],...[[M.left,C||P?M.bottom-t:M.top],[M.right,C?P?M.bottom-t:M.top:M.bottom-t]]];case"bottom":return[[P?n+t/2:C?n+4*t:n-4*t,r-t],[P?n-t/2:C?n+4*t:n-4*t,r-t],...[[M.left,C||P?M.top+t:M.bottom],[M.right,C?P?M.top+t:M.bottom:M.top+t]]];case"left":{const e=[n+t+1,A?r+t/2:T?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:T?r+4*t:r-4*t];return[...[[T||A?M.right-t:M.left,M.top],[T?A?M.right-t:M.left:M.right-t,M.bottom]],e,o]}case"right":return[[n-t,A?r+t/2:T?r+4*t:r-4*t],[n-t,A?r-t/2:T?r+4*t:r-4*t],...[[T||A?M.left+t:M.right,M.top],[T?A?M.left+t:M.right:M.left+t,M.bottom]]]}}([n,s]))?!u&&r&&(o=window.setTimeout(g,40)):g()}}};return s.__options={blockPointerEvents:n},s},e.useClick=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:c=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=t,d=u.useRef(),m=u.useRef(!1),v=u.useMemo((()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){const t=d.current;0===e.button&&"click"!==l&&(T(t,!0)&&a||(!n||!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=d.current;"mousedown"===l&&d.current?d.current=void 0:T(t,!0)&&a||(!n||!s||o.current.openEvent&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||It(e)||(" "!==e.key||kt(i)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!f||It(e)||kt(i)||" "===e.key&&m.current&&(m.current=!1,r(!n||!s,e.nativeEvent,"click"))}})),[o,i,l,a,f,r,n,s]);return u.useMemo((()=>c?{reference:v}:{}),[c,v])},e.useClientPoint=function(e,t){void 0===t&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:i},refs:c}=e,{enabled:l=!0,axis:s="both",x:f=null,y:m=null}=t,v=u.useRef(!1),p=u.useRef(null),[g,h]=u.useState(),[y,b]=u.useState([]),w=a(((e,t)=>{v.current||r.current.openEvent&&!Mt(r.current.openEvent)||c.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var u;const i=(null==e?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},c="x"===t.axis||"both"===t.axis,l="y"===t.axis||"both"===t.axis,s=["mouseenter","mousemove"].includes((null==(u=t.dataRef.current.openEvent)?void 0:u.type)||"")&&"touch"!==t.pointerType;let a=i.width,f=i.height,d=i.x,m=i.y;return null==n&&t.x&&c&&(n=i.x-t.x),null==r&&t.y&&l&&(r=i.y-t.y),d-=n||0,m-=r||0,a=0,f=0,!o||s?(a="y"===t.axis?i.width:0,f="x"===t.axis?i.height:0,d=c&&null!=t.x?t.x:d,m=l&&null!=t.y?t.y:m):o&&!s&&(f="x"===t.axis?i.height:f,a="y"===t.axis?i.width:a),o=!0,{width:a,height:f,x:d,y:m,top:m,right:d+a,bottom:m+f,left:d}}}}(i,{x:e,y:t,axis:s,dataRef:r,pointerType:g}))})),R=a((e=>{null==f&&null==m&&(n?p.current||b([]):w(e.clientX,e.clientY))})),x=T(g)?o:n,I=u.useCallback((()=>{if(!x||!l||null!=f||null!=m)return;const e=d(o);function t(n){const r=L(n);E(o,r)?(e.removeEventListener("mousemove",t),p.current=null):w(n.clientX,n.clientY)}if(!r.current.openEvent||Mt(r.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),p.current=null};return p.current=n,n}c.setPositionReference(i)}),[x,l,f,m,o,r,c,i,w]);u.useEffect((()=>I()),[I,y]),u.useEffect((()=>{l&&!o&&(v.current=!1)}),[l,o]),u.useEffect((()=>{!l&&n&&(v.current=!0)}),[l,n]),ee((()=>{!l||null==f&&null==m||(v.current=!1,w(f,m))}),[l,f,m,w]);const k=u.useMemo((()=>{function e(e){let{pointerType:t}=e;h(t)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:R,onMouseEnter:R}}),[R]);return u.useMemo((()=>l?{reference:k}:{}),[l,k])},e.useDelayGroup=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:u}=t,i=null!=u?u:o,c=Te(),{currentId:l,setCurrentId:s,initialDelay:a,setState:f,timeoutMs:d}=c;return ee((()=>{l&&(f({delay:{open:1,close:Me(a,"close")}}),l!==i&&r(!1))}),[i,r,f,l,a]),ee((()=>{function e(){r(!1),f({delay:a,currentId:null})}if(l&&!n&&l===i){if(d){const t=window.setTimeout(e,d);return()=>{clearTimeout(t)}}e()}}),[n,f,l,i,r,a,d]),ee((()=>{s!==Oe&&n&&s(i)}),[n,s,i]),c},e.useDelayGroupContext=Te,e.useDismiss=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,elements:i,dataRef:c}=e,{enabled:l=!0,escapeKey:s=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:g="pointerdown",ancestorScroll:w=!1,bubbles:R,capture:x}=t,I=Re(),k=a("function"==typeof f?f:()=>!1),M="function"==typeof f?k:f,O=u.useRef(!1),C=u.useRef(!1),{escapeKey:T,outsidePress:A}=Tt(R),{escapeKey:N,outsidePress:D}=Tt(x),F=a((e=>{var t;if(!n||!l||!s||"Escape"!==e.key)return;const r=null==(t=c.current.floatingContext)?void 0:t.nodeId,u=I?Ge(I.nodesRef.current,r):[];if(!T&&(e.stopPropagation(),u.length>0)){let e=!0;if(u.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),j=a((e=>{var t;const n=()=>{var t;F(e),null==(t=L(e))||t.removeEventListener("keydown",n)};null==(t=L(e))||t.addEventListener("keydown",n)})),K=a((e=>{var t;const n=O.current;O.current=!1;const r=C.current;if(C.current=!1,"click"===d&&r)return;if(n)return;if("function"==typeof M&&!M(e))return;const u=L(e),l="["+xe("inert")+"]",s=S(i.floating).querySelectorAll(l);let a=v(u)?u:null;for(;a&&!h(a);){const e=b(a);if(h(e)||!v(e))break;a=e}if(s.length&&v(u)&&!u.matches("html,body")&&!E(u,i.floating)&&Array.from(s).every((e=>!E(a,e))))return;if(p(u)&&_){const t=u.clientWidth>0&&u.scrollWidth>u.clientWidth,n=u.clientHeight>0&&u.scrollHeight>u.clientHeight;let r=n&&e.offsetX>u.clientWidth;if(n){"rtl"===y(u).direction&&(r=e.offsetX<=u.offsetWidth-u.clientWidth)}if(r||t&&e.offsetY>u.clientHeight)return}const f=null==(t=c.current.floatingContext)?void 0:t.nodeId,m=I&&Ge(I.nodesRef.current,f).some((t=>{var n;return P(e,null==(n=t.context)?void 0:n.elements.floating)}));if(P(e,i.floating)||P(e,i.domReference)||m)return;const g=I?Ge(I.nodesRef.current,f):[];if(g.length>0){let e=!0;if(g.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),H=a((e=>{var t;const n=()=>{var t;K(e),null==(t=L(e))||t.removeEventListener(d,n)};null==(t=L(e))||t.addEventListener(d,n)}));u.useEffect((()=>{if(!n||!l)return;function e(e){o(!1,e,"ancestor-scroll")}c.current.__escapeKeyBubbles=T,c.current.__outsidePressBubbles=A;const t=S(i.floating);s&&t.addEventListener("keydown",N?j:F,N),M&&t.addEventListener(d,D?H:K,D);let u=[];return w&&(v(i.domReference)&&(u=r.getOverflowAncestors(i.domReference)),v(i.floating)&&(u=u.concat(r.getOverflowAncestors(i.floating))),!v(i.reference)&&i.reference&&i.reference.contextElement&&(u=u.concat(r.getOverflowAncestors(i.reference.contextElement)))),u=u.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{s&&t.removeEventListener("keydown",N?j:F,N),M&&t.removeEventListener(d,D?H:K,D),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[c,i,s,M,d,n,o,w,l,T,A,F,N,j,K,D,H]),u.useEffect((()=>{O.current=!1}),[M,d]);const q=u.useMemo((()=>({onKeyDown:F,[Ot[g]]:e=>{m&&o(!1,e.nativeEvent,"reference-press")}})),[F,o,m,g]),_=u.useMemo((()=>({onKeyDown:F,onMouseDown(){C.current=!0},onMouseUp(){C.current=!0},[Ct[d]]:()=>{O.current=!0}})),[F,d]);return u.useMemo((()=>l?{reference:q,floating:_}:{}),[l,q,_])},e.useFloating=function(e){void 0===e&&(e={});const{nodeId:t}=e,n=St({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,i=o.elements,[c,l]=u.useState(null),[s,a]=u.useState(null),f=(null==i?void 0:i.reference)||c,d=u.useRef(null),m=Re();ee((()=>{f&&(d.current=f)}),[f]);const p=r.useFloating({...e,elements:{...i,...s&&{reference:s}}}),g=u.useCallback((e=>{const t=v(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),p.refs.setReference(t)}),[p.refs]),h=u.useCallback((e=>{(v(e)||null===e)&&(d.current=e,l(e)),(v(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!v(e))&&p.refs.setReference(e)}),[p.refs]),y=u.useMemo((()=>({...p.refs,setReference:h,setPositionReference:g,domReference:d})),[p.refs,h,g]),b=u.useMemo((()=>({...p.elements,domReference:f})),[p.elements,f]),w=u.useMemo((()=>({...p,...o,refs:y,elements:b,nodeId:t})),[p,y,b,t,o]);return ee((()=>{o.dataRef.current.floatingContext=w;const e=null==m?void 0:m.nodesRef.current.find((e=>e.id===t));e&&(e.context=w)})),u.useMemo((()=>({...p,context:w,refs:y,elements:b})),[p,y,b,w])},e.useFloatingNodeId=function(e){const t=ge(),n=Re(),r=Ee(),o=e||r;return ee((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t},e.useFloatingParentNodeId=Ee,e.useFloatingPortalNode=pt,e.useFloatingRootContext=St,e.useFloatingTree=Re,e.useFocus=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:c}=e,{enabled:l=!0,visibleOnly:s=!0}=t,a=u.useRef(!1),f=u.useRef(),m=u.useRef(!0);u.useEffect((()=>{if(!l)return;const e=d(c.domReference);function t(){!n&&p(c.domReference)&&c.domReference===w(S(c.domReference))&&(a.current=!0)}function r(){m.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[c.domReference,n,l]),u.useEffect((()=>{if(l)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(a.current=!0)}}),[o,l]),u.useEffect((()=>()=>{clearTimeout(f.current)}),[]);const g=u.useMemo((()=>({onPointerDown(e){k(e.nativeEvent)||(m.current=!1)},onMouseLeave(){a.current=!1},onFocus(e){if(a.current)return;const t=L(e.nativeEvent);if(s&&v(t))try{if(M()&&C())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!m.current&&!N(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){a.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=v(t)&&t.hasAttribute(xe("focus-guard"))&&"outside"===t.getAttribute("data-type");f.current=window.setTimeout((()=>{var e;const u=w(c.domReference?c.domReference.ownerDocument:document);(t||u!==c.domReference)&&(E(null==(e=i.current.floatingContext)?void 0:e.refs.floating.current,u)||E(c.domReference,u)||o||r(!1,n,"focus"))}))}})),[i,c.domReference,r,s]);return u.useMemo((()=>l?{reference:g}:{}),[l,g])},e.useHover=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:c}=e,{enabled:l=!0,delay:s=0,handleClose:f=null,mouseOnly:d=!1,restMs:m=0,move:p=!0}=t,g=Re(),h=Ee(),y=Ie(f),b=Ie(s),w=Ie(n),R=u.useRef(),x=u.useRef(-1),I=u.useRef(),k=u.useRef(-1),M=u.useRef(!0),O=u.useRef(!1),C=u.useRef((()=>{})),P=u.useCallback((()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[o]);u.useEffect((()=>{if(l)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(k.current),M.current=!0)}}),[l,i]),u.useEffect((()=>{if(!l)return;if(!y.current)return;if(!n)return;function e(e){P()&&r(!1,e,"hover")}const t=S(c.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[c.floating,n,r,l,y,P]);const L=u.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Me(b.current,"close",R.current);o&&!I.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(x.current),r(!1,e,n))}),[b,r]),A=a((()=>{C.current(),I.current=void 0})),N=a((()=>{if(O.current){const e=S(c.floating).body;e.style.pointerEvents="",e.removeAttribute(ke),O.current=!1}}));u.useEffect((()=>{if(l&&v(c.domReference)){var e;const t=c.domReference;return n&&t.addEventListener("mouseleave",s),null==(e=c.floating)||e.addEventListener("mouseleave",s),p&&t.addEventListener("mousemove",u,{once:!0}),t.addEventListener("mouseenter",u),t.addEventListener("mouseleave",i),()=>{var e;n&&t.removeEventListener("mouseleave",s),null==(e=c.floating)||e.removeEventListener("mouseleave",s),p&&t.removeEventListener("mousemove",u),t.removeEventListener("mouseenter",u),t.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(x.current),M.current=!1,d&&!T(R.current)||m>0&&!Me(b.current,"open"))return;const t=Me(b.current,"open",R.current);t?x.current=window.setTimeout((()=>{w.current||r(!0,e,"hover")}),t):r(!0,e,"hover")}function i(e){if(t())return;C.current();const r=S(c.floating);if(clearTimeout(k.current),y.current&&o.current.floatingContext){n||clearTimeout(x.current),I.current=y.current({...o.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){N(),A(),L(e,!0,"safe-polygon")}});const t=I.current;return r.addEventListener("mousemove",t),void(C.current=()=>{r.removeEventListener("mousemove",t)})}("touch"!==R.current||!E(c.floating,e.relatedTarget))&&L(e)}function s(e){t()||o.current.floatingContext&&(null==y.current||y.current({...o.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){N(),A(),L(e)}})(e))}}),[c,l,e,d,m,p,L,A,N,r,n,w,g,b,y,o]),ee((()=>{var e;if(l&&n&&null!=(e=y.current)&&e.__options.blockPointerEvents&&P()){const e=S(c.floating).body;e.setAttribute(ke,""),e.style.pointerEvents="none",O.current=!0;const n=c.floating;if(v(c.domReference)&&n){var t;const e=c.domReference,r=null==g||null==(t=g.nodesRef.current.find((e=>e.id===h)))||null==(t=t.context)?void 0:t.elements.floating;return r&&(r.style.pointerEvents=""),e.style.pointerEvents="auto",n.style.pointerEvents="auto",()=>{e.style.pointerEvents="",n.style.pointerEvents=""}}}}),[l,n,h,c,g,y,P]),ee((()=>{n||(R.current=void 0,A(),N())}),[n,A,N]),u.useEffect((()=>()=>{A(),clearTimeout(x.current),clearTimeout(k.current),N()}),[l,c.domReference,A,N]);const D=u.useMemo((()=>{function e(e){R.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){M.current||w.current||r(!0,t,"hover")}d&&!T(R.current)||n||0===m||(clearTimeout(k.current),"touch"===R.current?o():k.current=window.setTimeout(o,m))}}}),[d,r,n,w,m]),F=u.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){L(e.nativeEvent,!1)}})),[L]);return u.useMemo((()=>l?{reference:D,floating:F}:{}),[l,D,F])},e.useId=ge,e.useInnerOffset=function(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:c,scrollRef:l,onChange:s}=t,f=a(s),d=u.useRef(!1),m=u.useRef(null),v=u.useRef(null);u.useEffect((()=>{if(!o)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;const n=e.deltaY,r=c.current.top>=-.5,o=c.current.bottom>=-.5,u=t.scrollHeight-t.clientHeight,l=n<0?-1:1,s=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&n>0||!o&&n<0?(e.preventDefault(),i.flushSync((()=>{f((e=>e+Math[s](n,u*l)))}))):/firefox/i.test(x())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||r.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{m.current=t.scrollTop,null!=c.current&&(v.current={...c.current})})),()=>{m.current=null,v.current=null,t.removeEventListener("wheel",e)}):void 0}),[o,n,r.floating,c,l,f]);const p=u.useMemo((()=>({onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const e=(null==l?void 0:l.current)||r.floating;if(c.current&&e&&d.current){if(null!==m.current){const t=e.scrollTop-m.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&i.flushSync((()=>f((e=>e+t))))}requestAnimationFrame((()=>{m.current=e.scrollTop}))}}})),[r.floating,f,c,l]);return u.useMemo((()=>o?{floating:p}:{}),[o,p])},e.useInteractions=function(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),o=u.useCallback((t=>At(t,e,"reference")),t),i=u.useCallback((t=>At(t,e,"floating")),n),c=u.useCallback((t=>At(t,e,"item")),r);return u.useMemo((()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:c})),[o,i,c])},e.useListItem=oe,e.useListNavigation=function(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:i,activeIndex:c,onNavigate:l=(()=>{}),enabled:s=!0,selectedIndex:f=null,allowEscape:d=!1,loop:m=!1,nested:v=!1,rtl:g=!1,virtual:h=!1,focusItemOnOpen:y="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:R=!0,disabledIndices:x,orientation:O="vertical",cols:T=1,scrollItemIntoView:P=!0,virtualItemRef:L,itemSizes:A,dense:N=!1}=t,j=Ee(),K=Re(),B=a(l),Q=u.useRef(y),te=u.useRef(null!=f?f:-1),ne=u.useRef(null),re=u.useRef(!0),oe=u.useRef(B),ue=u.useRef(!!o.floating),ie=u.useRef(!1),ce=u.useRef(!1),le=Ie(x),se=Ie(n),ae=Ie(P),fe=Ie(o.floating),de=Ie(f),[me,ve]=u.useState(),[pe,ge]=u.useState(),he=a((function(e,t,n){function r(e){h?(ve(e.id),null==K||K.events.emit("virtualfocus",e),L&&(L.current=e)):J(e,{preventScroll:!0,sync:!(!C()||!M())&&(Nt||ie.current)})}void 0===n&&(n=!1);const o=e.current[t.current];o&&r(o),requestAnimationFrame((()=>{const u=e.current[t.current]||o;if(!u)return;o||r(u);const i=ae.current;i&&be&&(n||!re.current)&&(null==u.scrollIntoView||u.scrollIntoView("boolean"==typeof i?{block:"nearest",inline:"nearest"}:i))}))}));ee((()=>{document.createElement("div").focus({get preventScroll(){return Nt=!0,!1}})}),[]),ee((()=>{s&&(n&&o.floating?Q.current&&null!=f&&(ce.current=!0,te.current=f,B(f)):ue.current&&(te.current=-1,oe.current(null)))}),[s,n,o.floating,f,B]),ee((()=>{if(s&&n&&o.floating)if(null==c){if(ie.current=!1,null!=de.current)return;if(ue.current&&(te.current=-1,he(i,te)),!ue.current&&Q.current&&(null!=ne.current||!0===Q.current&&null==ne.current)){let e=0;const t=()=>{if(null==i.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else te.current=null==ne.current||jt(ne.current,O,g)||v?U(i,le.current):z(i,le.current),ne.current=null,B(te.current)};t()}}else W(i,c)||(te.current=c,he(i,te,ce.current),ce.current=!1)}),[s,n,o.floating,c,de,v,i,O,g,B,he,le]),ee((()=>{var e;if(!s||o.floating||!K||h||!ue.current)return;const t=K.nodesRef.current,n=null==(e=t.find((e=>e.id===j)))||null==(e=e.context)?void 0:e.elements.floating,r=w(S(o.floating)),u=t.some((e=>e.context&&E(e.context.elements.floating,r)));n&&!u&&re.current&&n.focus({preventScroll:!0})}),[s,o.floating,K,j,h]),ee((()=>{if(s&&K&&h&&!j)return K.events.on("virtualfocus",e),()=>{K.events.off("virtualfocus",e)};function e(e){ge(e.id),L&&(L.current=e)}}),[s,K,h,j,L]),ee((()=>{oe.current=B,ue.current=!!o.floating})),ee((()=>{n||(ne.current=null)}),[n]);const ye=null!=c,be=u.useMemo((()=>{function e(e){if(!n)return;const t=i.current.indexOf(e);-1!==t&&B(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...b&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;re.current&&"touch"!==t&&(te.current=-1,he(i,te),B(null),h||J(fe.current,{preventScroll:!0}))}}}}),[n,fe,he,b,i,B,h]),we=a((e=>{if(re.current=!1,ie.current=!0,!se.current&&e.currentTarget===fe.current)return;if(v&&Kt(e.key,O,g))return D(e),r(!1,e.nativeEvent,"list-navigation"),void(p(o.domReference)&&!h&&o.domReference.focus());const t=te.current,u=U(i,x),c=z(i,x);if("Home"===e.key&&(D(e),te.current=u,B(te.current)),"End"===e.key&&(D(e),te.current=c,B(te.current)),T>1){const t=A||Array.from({length:i.current.length},(()=>({width:1,height:1}))),n=V(t,T,N),r=n.findIndex((e=>null!=e&&!$(i.current,e,x))),o=n.reduce(((e,t,n)=>null==t||$(i.current,t,x)?e:n),-1);if(te.current=n[Y({current:n.map((e=>null!=e?i.current[e]:null))},{event:e,orientation:O,loop:m,cols:T,disabledIndices:Z([...x||i.current.map(((e,t)=>$(i.current,t)?t:void 0)),void 0],n),minIndex:r,maxIndex:o,prevIndex:G(te.current>c?u:te.current,t,n,T,e.key===H?"bl":e.key===_?"tr":"tl"),stopEvent:!0})],B(te.current),"both"===O)return}if(Ft(e.key,O)){if(D(e),n&&!h&&w(e.currentTarget.ownerDocument)===e.currentTarget)return te.current=jt(e.key,O,g)?u:c,void B(te.current);jt(e.key,O,g)?te.current=m?t>=c?d&&t!==i.current.length?-1:u:X(i,{startingIndex:t,disabledIndices:x}):Math.min(c,X(i,{startingIndex:t,disabledIndices:x})):te.current=m?t<=u?d&&-1!==t?i.current.length:c:X(i,{startingIndex:t,decrement:!0,disabledIndices:x}):Math.max(u,X(i,{startingIndex:t,decrement:!0,disabledIndices:x})),W(i,te.current)?B(null):B(te.current)}})),xe=u.useMemo((()=>h&&n&&ye&&{"aria-activedescendant":pe||me}),[h,n,ye,pe,me]),ke=u.useMemo((()=>({"aria-orientation":"both"===O?void 0:O,...!F(o.domReference)&&xe,onKeyDown:we,onPointerMove(){re.current=!0}})),[xe,we,o.domReference,O]),Me=u.useMemo((()=>{const e=le.current,t=i.current.find((e=>(null==e?void 0:e.id)===me));function o(e){"auto"===y&&I(e.nativeEvent)&&(Q.current=!0)}return{...xe,onKeyDown(o){re.current=!1;const u=0===o.key.indexOf("Arrow"),c=function(e,t,n){return Dt(t,n?e===q:e===_,e===H)}(o.key,O,g),l=Kt(o.key,O,g),s=Ft(o.key,O),a=(v?c:s)||"Enter"===o.key||""===o.key.trim();if(h&&n){const e=null==K?void 0:K.nodesRef.current.find((e=>null==e.parentId)),n=K&&e?function(e,t){let n,r=-1;return function t(o,u){u>r&&(n=o,r=u),Ge(e,o).forEach((e=>{t(e.id,u+1)}))}(t,0),e.find((e=>e.id===n))}(K.nodesRef.current,e.id):null;if(u&&n&&L){const e=new KeyboardEvent("keydown",{key:o.key,bubbles:!0});if(c||l){var d,m;const r=(null==(d=n.context)?void 0:d.elements.domReference)===o.currentTarget,u=l&&!r?null==(m=n.context)?void 0:m.elements.domReference:c?t:null;u&&(D(o),u.dispatchEvent(e),ge(void 0))}var p;if(s&&n.context)if(n.context.open&&n.parentId&&o.currentTarget!==n.context.elements.domReference)return D(o),void(null==(p=n.context.elements.domReference)||p.dispatchEvent(e))}return we(o)}(n||R||!u)&&(a&&(ne.current=v&&s?null:o.key),v?c&&(D(o),n?(te.current=U(i,e),B(te.current)):r(!0,o.nativeEvent,"list-navigation")):s&&(null!=f&&(te.current=f),D(o),!n&&R?r(!0,o.nativeEvent,"list-navigation"):we(o),n&&B(te.current)))},onFocus(){n&&!h&&B(null)},onPointerDown:function(e){Q.current=y,"auto"===y&&k(e.nativeEvent)&&(Q.current=!0)},onMouseDown:o,onClick:o}}),[me,xe,we,le,y,i,v,B,r,n,R,O,g,f,K,h,L]);return u.useMemo((()=>s?{reference:Me,floating:ke,item:be}:{}),[s,Me,ke,be])},e.useMergeRefs=c,e.useRole=function(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:c="dialog"}=t,l=null!=(n=Ht.get(c))?n:c,s=ge(),a=null!=Ee(),f=u.useMemo((()=>"tooltip"===l||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":r?o:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:s},..."menu"===l&&a&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}}),[l,o,a,r,s,c]),d=u.useMemo((()=>{const e={id:o,...l&&{role:l}};return"tooltip"===l||"label"===c?e:{...e,..."menu"===l&&{"aria-labelledby":s}}}),[l,o,s,c]),m=u.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:o+"-option"}};switch(c){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[o,c]);return u.useMemo((()=>i?{reference:f,floating:d,item:m}:{}),[i,f,d,m])},e.useTransitionStatus=Bt,e.useTransitionStyles=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:c=250}=t,l=e.placement,s=l.split("-")[0],a=u.useMemo((()=>({side:s,placement:l})),[s,l]),f="number"==typeof c,d=(f?c:c.open)||0,m=(f?c:c.close)||0,[v,p]=u.useState((()=>({..._t(i,a),..._t(n,a)}))),{isMounted:g,status:h}=Bt(e,{duration:c}),y=Ie(n),b=Ie(r),w=Ie(o),E=Ie(i);return ee((()=>{const e=_t(y.current,a),t=_t(w.current,a),n=_t(E.current,a),r=_t(b.current,a)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===h&&p((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===h&&p({transitionProperty:Object.keys(r).map(qt).join(","),transitionDuration:d+"ms",...n,...r}),"close"===h){const r=t||e;p({transitionProperty:Object.keys(r).map(qt).join(","),transitionDuration:m+"ms",...n,...r})}}),[m,w,y,b,E,d,h,a]),{isMounted:g,styles:v}},e.useTypeahead=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:c,onMatch:l,onTypingChange:s,enabled:f=!0,findMatch:d=null,resetMs:m=750,ignoreKeys:v=[],selectedIndex:p=null}=t,g=u.useRef(),h=u.useRef(""),y=u.useRef(null!=(n=null!=p?p:c)?n:-1),b=u.useRef(null),w=a(l),E=a(s),R=Ie(d),x=Ie(v);ee((()=>{r&&(clearTimeout(g.current),b.current=null,h.current="")}),[r]),ee((()=>{var e;r&&""===h.current&&(y.current=null!=(e=null!=p?p:c)?e:-1)}),[r,p,c]);const I=a((e=>{e?o.current.typing||(o.current.typing=e,E(e)):o.current.typing&&(o.current.typing=e,E(e))})),k=a((e=>{function t(e,t,n){const r=R.current?R.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}const n=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(n,n,h.current)?I(!1):" "===e.key&&D(e)),null==n||x.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(D(e),I(!0));n.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.current===e.key&&(h.current="",y.current=b.current),h.current+=e.key,clearTimeout(g.current),g.current=setTimeout((()=>{h.current="",y.current=b.current,I(!1)}),m);const o=y.current,u=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],h.current);-1!==u?(w(u),b.current=u):" "!==e.key&&(h.current="",I(!1))})),M=u.useMemo((()=>({onKeyDown:k})),[k]),O=u.useMemo((()=>({onKeyDown:k,onKeyUp(e){" "===e.key&&I(!1)}})),[k,I]);return u.useMemo((()=>f?{reference:M,floating:O}:{}),[f,M,O])}})); |
{ | ||
"name": "@floating-ui/react", | ||
"version": "0.26.17", | ||
"version": "0.26.18", | ||
"description": "Floating UI for React", | ||
@@ -63,4 +63,4 @@ "publishConfig": { | ||
"@floating-ui/react-dom": "^2.1.0", | ||
"@floating-ui/utils": "^0.2.0", | ||
"tabbable": "^6.0.0" | ||
"tabbable": "^6.0.0", | ||
"@floating-ui/utils": "^0.2.3" | ||
}, | ||
@@ -67,0 +67,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
723464
16213
Updated@floating-ui/utils@^0.2.3