Socket
Socket
Sign inDemoInstall

@floating-ui/react

Package Overview
Dependencies
10
Maintainers
2
Versions
49
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.26.6 to 0.26.7

558

dist/floating-ui.react.d.ts

@@ -87,15 +87,68 @@ import { AlignedPlacement } from '@floating-ui/react-dom';

/**
* Creates a single tab stop whose items are navigated by arrow keys, which
* provides list navigation outside of floating element contexts.
*
* This is useful to enable navigation of a list of items that aren’t part of a
* floating element. A menubar is an example of a composite, with each reference
* element being an item.
* @see https://floating-ui.com/docs/Composite
*/
export declare const Composite: React_2.ForwardRefExoticComponent<Omit<React_2.HTMLProps<HTMLElement> & CompositeProps, "ref"> & React_2.RefAttributes<HTMLElement>>;
export declare const CompositeItem: React_2.ForwardRefExoticComponent<Omit<React_2.HTMLProps<HTMLElement> & {
render?: RenderProp | undefined;
}, "ref"> & React_2.RefAttributes<HTMLElement>>;
/**
* @see https://floating-ui.com/docs/Composite
*/
export declare const CompositeItem: React_2.ForwardRefExoticComponent<Omit<React_2.HTMLProps<HTMLElement> & CompositeItemProps, "ref"> & React_2.RefAttributes<HTMLElement>>;
declare interface CompositeItemProps {
/**
* Determines the element to render.
* @example
* ```jsx
* <CompositeItem render={<li />} />
* <CompositeItem render={(htmlProps) => <li {...htmlProps} />} />
* ```
*/
render?: RenderProp;
}
declare interface CompositeProps {
/**
* Determines the element to render.
* @example
* ```jsx
* <Composite render={<ul />} />
* <Composite render={(htmlProps) => <ul {...htmlProps} />} />
* ```
*/
render?: RenderProp;
/**
* Determines the orientation of the composite.
*/
orientation?: 'horizontal' | 'vertical' | 'both';
/**
* Determines whether focus should loop around when navigating past the first
* or last item.
*/
loop?: boolean;
/**
* Determines the number of columns there are in the composite
* (i.e. it’s a grid).
*/
cols?: number;
/**
* Determines which items are disabled. The `disabled` or `aria-disabled`
* attributes are used by default.
*/
disabledIndices?: number[];
/**
* Determines which item is active. Used to externally control the active
* item.
*/
activeIndex?: number;
/**
* Called when the user navigates to a new item. Used to externally control
* the active item.
*/
onNavigate?(index: number): void;

@@ -247,3 +300,12 @@ /**

children?: React_2.ReactNode;
/**
* The delay to use for the group.
*/
delay: Delay;
/**
* An optional explicit timeout to use for the group, which represents when
* grouping logic will no longer be active after the close delay completes.
* This is useful if you want grouping to “last” longer than the close delay,
* for example if there is no close delay at all.
*/
timeoutMs?: number;

@@ -267,11 +329,62 @@ }

export declare interface FloatingFocusManagerProps<RT extends ReferenceType = ReferenceType> {
children: JSX.Element;
/**
* The floating context returned from `useFloating`.
*/
context: FloatingContext<RT>;
children: JSX.Element;
/**
* Whether or not the focus manager should be disabled. Useful to delay focus
* management until after a transition completes or some other conditional
* state.
* @default false
*/
disabled?: boolean;
/**
* The order in which focus cycles.
* @default ['content']
*/
order?: Array<'reference' | 'floating' | 'content'>;
/**
* Which element to initially focus. Can be either a number (tabbable index as
* specified by the `order`) or a ref.
* @default 0
*/
initialFocus?: number | React_2.MutableRefObject<HTMLElement | null>;
/**
* Determines if the focus guards are rendered. If not, focus can escape into
* the address bar/console/browser UI, like in native dialogs.
* @default true
*/
guards?: boolean;
/**
* Determines if focus should be returned to the reference element once the
* floating element closes/unmounts (or if that is not available, the
* previously focused element). This prop is ignored if the floating element
* lost focus.
* @default true
*/
returnFocus?: boolean;
/**
* Determines if focus is “modal”, meaning focus is fully trapped inside the
* floating element and outside content cannot be accessed. This includes
* screen reader virtual cursors.
* @default true
*/
modal?: boolean;
/**
* If your focus management is modal and there is no explicit close button
* available, you can use this prop to render a visually-hidden dismiss
* button at the start and end of the floating element. This allows
* touch-based screen readers to escape the floating element due to lack of
* an `esc` key.
* @default undefined
*/
visuallyHiddenDismiss?: boolean | string;
/**
* Determines whether `focusout` event listeners that control whether the
* floating element should be closed if the focus moves outside of it are
* attached to the reference and floating elements. This affects non-modal
* focus management.
* @default true
*/
closeOnFocusOut?: boolean;

@@ -288,3 +401,11 @@ }

children: React_2.ReactNode;
/**
* A ref to the list of HTML elements, ordered by their index.
* `useListNavigation`'s `listRef` prop.
*/
elementsRef: React_2.MutableRefObject<Array<HTMLElement | null>>;
/**
* A ref to the list of element labels, ordered by their index.
* `useTypeahead`'s `listRef` prop.
*/
labelsRef?: React_2.MutableRefObject<Array<string | null>>;

@@ -314,9 +435,18 @@ }

*/
export declare const FloatingOverlay: React_2.ForwardRefExoticComponent<Omit<React_2.HTMLProps<HTMLDivElement> & {
lockScroll?: boolean | undefined;
}, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
export declare const FloatingOverlay: React_2.ForwardRefExoticComponent<Omit<React_2.HTMLProps<HTMLDivElement> & FloatingOverlayProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
declare interface FloatingOverlayProps {
/**
* Whether the overlay should lock scrolling on the document body.
* @default false
*/
lockScroll?: boolean;
}
/**
* Portals the floating element into a given container element — by default,
* outside of the app root and into the body.
* This is necessary to ensure the floating element can appear outside any
* potential parent containers that cause clipping (such as `overflow: hidden`),
* while retaining its location in the React tree.
* @see https://floating-ui.com/docs/FloatingPortal

@@ -328,4 +458,16 @@ */

children?: React_2.ReactNode;
/**
* Optionally selects the node with the id if it exists, or create it and
* append it to the specified `root` (by default `document.body`).
*/
id?: string;
/**
* Specifies the root node the portal container will be appended to.
*/
root?: HTMLElement | null | React_2.MutableRefObject<HTMLElement | null>;
/**
* When using non-modal focus management using `FloatingFocusManager`, this
* will preserve the tab order context based on the React tree instead of the
* DOM tree.
*/
preserveTabOrder?: boolean;

@@ -336,4 +478,8 @@ }

* Provides context for nested floating elements when they are not children of
* each other on the DOM (i.e. portalled to a common node, rather than their
* respective parent).
* each other on the DOM.
* This is not necessary in all cases, except when there must be explicit communication between parent and child floating elements. It is necessary for:
* - The `bubbles` option in the `useDismiss()` Hook
* - Nested virtual list navigation
* - Nested floating elements that each open on hover
* - Custom communication between parent and child floating elements
* @see https://floating-ui.com/docs/FloatingTree

@@ -394,9 +540,41 @@ */

export declare interface InnerProps {
/**
* A ref which contains an array of HTML elements.
* @default empty list
*/
listRef: React_2.MutableRefObject<Array<HTMLElement | null>>;
/**
* The index of the active (focused or highlighted) item in the list.
* @default 0
*/
index: number;
/**
* Callback invoked when the fallback state changes.
*/
onFallbackChange?: null | ((fallback: boolean) => void);
/**
* The offset to apply to the floating element.
* @default 0
*/
offset?: number;
/**
* A ref which contains the overflow of the floating element.
*/
overflowRef?: React_2.MutableRefObject<SideObject | null>;
/**
* An optional ref containing an HTMLElement. This may be used as the
* scrolling container instead of the floating element — for instance,
* to position inner elements as direct children without being interfered by
* scrolling layout.
*/
scrollRef?: React_2.MutableRefObject<HTMLElement | null>;
/**
* The minimum number of items that should be visible in the list.
* @default 4
*/
minItemsVisible?: number;
/**
* The threshold for the reference element's overflow in pixels.
* @default 0
*/
referenceOverflowThreshold?: number;

@@ -454,3 +632,3 @@ }

* floating element once leaving the reference element.
* @see https://floating-ui.com/docs/useHover#safePolygon
* @see https://floating-ui.com/docs/useHover#safepolygon
*/

@@ -490,6 +668,34 @@ export declare function safePolygon<RT extends ReferenceType = ReferenceType>(options?: Partial<SafePolygonOptions>): HandleCloseFn<RT>;

export declare interface UseClickProps {
/**
* Whether the Hook is enabled, including all internal Effects and event
* handlers.
* @default true
*/
enabled?: boolean;
/**
* The type of event to use to determine a “click” with mouse input.
* Keyboard clicks work as normal.
* @default 'click'
*/
event?: 'click' | 'mousedown';
/**
* Whether to toggle the open state with repeated clicks.
* @default true
*/
toggle?: boolean;
/**
* Whether to ignore the logic for mouse input (for example, if `useHover()`
* is also being used).
* When `useHover()` and `useClick()` are used together, clicking the
* reference element after hovering it will keep the floating element open
* even once the cursor leaves. This may be not be desirable in some cases.
* @default false
*/
ignoreMouse?: boolean;
/**
* Whether to add keyboard handlers (Enter and Space key functionality) for
* non-button elements (to open/close the floating element via keyboard
* “click”).
* @default true
*/
keyboardHandlers?: boolean;

@@ -506,8 +712,32 @@ }

export declare interface UseClientPointProps {
/**
* Whether the Hook is enabled, including all internal Effects and event
* handlers.
* @default true
*/
enabled?: boolean;
/**
* Whether to restrict the client point to an axis and use the reference
* element (if it exists) as the other axis. This can be useful if the
* floating element is also interactive.
* @default 'both'
*/
axis?: 'x' | 'y' | 'both';
/**
* An explicitly defined `x` client coordinate.
* @default null
*/
x?: number | null;
/**
* An explicitly defined `y` client coordinate.
* @default null
*/
y?: number | null;
}
/**
* Enables grouping when called inside a component that's a child of a
* `FloatingDelayGroup`.
* @see https://floating-ui.com/docs/FloatingDelayGroup
*/
export declare const useDelayGroup: ({ open, onOpenChange }: FloatingContext, { id }: UseGroupOptions) => void;

@@ -525,9 +755,60 @@

export declare interface UseDismissProps {
/**
* Whether the Hook is enabled, including all internal Effects and event
* handlers.
* @default true
*/
enabled?: boolean;
/**
* Whether to dismiss the floating element upon pressing the `esc` key.
* @default true
*/
escapeKey?: boolean;
/**
* Whether to dismiss the floating element upon pressing the reference
* element. You likely want to ensure the `move` option in the `useHover()`
* Hook has been disabled when this is in use.
* @default false
*/
referencePress?: boolean;
/**
* The type of event to use to determine a “press”.
* - `pointerdown` is eager on both mouse + touch input.
* - `mousedown` is eager on mouse input, but lazy on touch input.
* - `click` is lazy on both mouse + touch input.
* @default 'pointerdown'
*/
referencePressEvent?: 'pointerdown' | 'mousedown' | 'click';
/**
* Whether to dismiss the floating element upon pressing outside of the
* floating element.
* If you have another element, like a toast, that is rendered outside the
* floating element’s React tree and don’t want the floating element to close
* when pressing it, you can guard the check like so:
* ```jsx
* useDismiss(context, {
* outsidePress: (event) => !event.target.closest('.toast'),
* });
* ```
* @default true
*/
outsidePress?: boolean | ((event: MouseEvent) => boolean);
/**
* The type of event to use to determine an outside “press”.
* - `pointerdown` is eager on both mouse + touch input.
* - `mousedown` is eager on mouse input, but lazy on touch input.
* - `click` is lazy on both mouse + touch input.
* @default 'pointerdown'
*/
outsidePressEvent?: 'pointerdown' | 'mousedown' | 'click';
/**
* Whether to dismiss the floating element upon scrolling an overflow
* ancestor.
* @default false
*/
ancestorScroll?: boolean;
/**
* Determines whether event listeners bubble upwards through a tree of
* floating elements.
*/
bubbles?: boolean | {

@@ -537,2 +818,5 @@ escapeKey?: boolean;

};
/**
* Determines whether to use capture phase event listeners.
*/
capture?: boolean | {

@@ -553,3 +837,4 @@ escapeKey?: boolean;

/**
* Registers a node into the floating tree, returning its id.
* Registers a node into the `FloatingTree`, returning its id.
* @see https://floating-ui.com/docs/FloatingTree
*/

@@ -583,4 +868,11 @@ export declare function useFloatingNodeId(customParentId?: string): string;

/**
* Returns the parent node id for nested floating elements, if available.
* Returns `null` for top-level floating elements.
*/
export declare const useFloatingParentNodeId: () => string | null;
/**
* @see https://floating-ui.com/docs/FloatingPortal#usefloatingportalnode
*/
export declare function useFloatingPortalNode({ id, root, }?: {

@@ -593,2 +885,5 @@ id?: string;

context: Prettify<FloatingContext<RT>>;
/**
* Object containing the reference and floating refs and reactive setters.
*/
refs: ExtendedRefs<RT>;

@@ -598,2 +893,5 @@ elements: ExtendedElements<RT>;

/**
* Returns the nearest floating tree context, if available.
*/
export declare const useFloatingTree: <RT extends ReferenceType = ReferenceType>() => FloatingTreeType<RT> | null;

@@ -609,3 +907,13 @@

export declare interface UseFocusProps {
/**
* Whether the Hook is enabled, including all internal Effects and event
* handlers.
* @default true
*/
enabled?: boolean;
/**
* Whether the open state only changes if the focus event is considered
* visible (`:focus-visible` CSS selector).
* @default true
*/
visibleOnly?: boolean;

@@ -626,5 +934,26 @@ }

export declare interface UseHoverProps<RT extends ReferenceType = ReferenceType> {
/**
* Whether the Hook is enabled, including all internal Effects and event
* handlers.
* @default true
*/
enabled?: boolean;
/**
* Instead of closing the floating element when the cursor leaves its
* reference, we can leave it open until a certain condition is satisfied,
* e.g. to let them traverse into the floating element.
* @default null
*/
handleClose?: HandleCloseFn<RT> | null;
/**
* Waits until the user’s cursor is at “rest” over the reference element
* before changing the `open` state.
* @default 0
*/
restMs?: number;
/**
* Waits for the specified time when the event listener runs before changing
* the `open` state.
* @default 0
*/
delay?: number | Partial<{

@@ -634,3 +963,13 @@ open: number;

}>;
/**
* Whether the logic only runs for mouse input, ignoring touch input.
* Note: due to a bug with Linux Chrome, "pen" inputs are considered "mouse".
* @default false
*/
mouseOnly?: boolean;
/**
* Whether moving the cursor over the floating element will open it, without a
* regular hover event required.
* @default true
*/
move?: boolean;

@@ -643,3 +982,3 @@ }

* earlier React versions.
* @see https://floating-ui.com/docs/useId
* @see https://floating-ui.com/docs/react-utils#useid
*/

@@ -656,5 +995,22 @@ export declare const useId: () => string;

export declare interface UseInnerOffsetProps {
/**
* Whether the Hook is enabled, including all internal Effects and event
* handlers.
* @default true
*/
enabled?: boolean;
/**
* A ref which contains the overflow of the floating element.
*/
overflowRef: React_2.MutableRefObject<SideObject | null>;
/**
* An optional ref containing an HTMLElement. This may be used as the
* scrolling container instead of the floating element — for instance,
* to position inner elements as direct children without being interfered by
* scrolling layout.
*/
scrollRef?: React_2.MutableRefObject<HTMLElement | null>;
/**
* Callback invoked when the offset changes.
*/
onChange: (offset: number | ((offset: number) => number)) => void;

@@ -675,2 +1031,7 @@ }

/**
* Used to register a list item and its index (DOM position) in the
* `FloatingList`.
* @see https://floating-ui.com/docs/FloatingList#uselistitem
*/
export declare function useListItem({ label }?: UseListItemProps): {

@@ -693,19 +1054,122 @@ ref: (node: HTMLElement | null) => void;

export declare interface UseListNavigationProps {
/**
* A ref that holds an array of list items.
* @default empty list
*/
listRef: React_2.MutableRefObject<Array<HTMLElement | null>>;
/**
* The index of the currently active (focused or highlighted) item, which may
* or may not be selected.
* @default null
*/
activeIndex: number | null;
onNavigate?: (index: number | null) => void;
/**
* A callback that is called when the user navigates to a new active item,
* passed in a new `activeIndex`.
*/
onNavigate?: (activeIndex: number | null) => void;
/**
* Whether the Hook is enabled, including all internal Effects and event
* handlers.
* @default true
*/
enabled?: boolean;
/**
* The currently selected item index, which may or may not be active.
* @default null
*/
selectedIndex?: number | null;
/**
* Whether to focus the item upon opening the floating element. 'auto' infers
* what to do based on the input type (keyboard vs. pointer), while a boolean
* value will force the value.
* @default 'auto'
*/
focusItemOnOpen?: boolean | 'auto';
/**
* Whether hovering an item synchronizes the focus.
* @default true
*/
focusItemOnHover?: boolean;
/**
* Whether pressing an arrow key on the navigation’s main axis opens the
* floating element.
* @default true
*/
openOnArrowKeyDown?: boolean;
/**
* By default elements with either a `disabled` or `aria-disabled` attribute
* are skipped in the list navigation — however, this requires the items to
* be rendered.
* This prop allows you to manually specify indices which should be disabled,
* overriding the default logic.
* For Windows-style select menus, where the menu does not open when
* navigating via arrow keys, specify an empty array.
* @default undefined
*/
disabledIndices?: Array<number>;
/**
* Determines whether focus can escape the list, such that nothing is selected
* after navigating beyond the boundary of the list. In some
* autocomplete/combobox components, this may be desired, as screen
* readers will return to the input.
* `loop` must be `true`.
* @default false
*/
allowEscape?: boolean;
/**
* Determines whether focus should loop around when navigating past the first
* or last item.
* @default false
*/
loop?: boolean;
/**
* If the list is nested within another one (e.g. a nested submenu), the
* navigation semantics change.
* @default false
*/
nested?: boolean;
/**
* Whether the direction of the floating element’s navigation is in RTL
* layout.
* @default false
*/
rtl?: boolean;
/**
* Whether the focus is virtual (using `aria-activedescendant`).
* Use this if you need focus to remain on the reference element
* (such as an input), but allow arrow keys to navigate list items.
* This is common in autocomplete listbox components.
* Your virtually-focused list items must have a unique `id` set on them.
* If you’re using a component role with the `useRole()` Hook, then an `id` is
* generated automatically.
* @default false
*/
virtual?: boolean;
/**
* The orientation in which navigation occurs.
* @default 'vertical'
*/
orientation?: 'vertical' | 'horizontal' | 'both';
/**
* Specifies how many columns the list has (i.e., it’s a grid). Use an
* orientation of 'horizontal' (e.g. for an emoji picker/date picker, where
* pressing ArrowRight or ArrowLeft can change rows), or 'both' (where the
* current row cannot be escaped with ArrowRight or ArrowLeft, only ArrowUp
* and ArrowDown).
* @default 1
*/
cols?: number;
/**
* Whether to scroll the active item into view when navigating. The default
* value uses nearest options.
*/
scrollItemIntoView?: boolean | ScrollIntoViewOptions;
/**
* When using virtual focus management, this holds a ref to the
* virtually-focused item. This allows nested virtual navigation to be
* enabled, and lets you know when a nested element is virtually focused from
* the root reference handling the events. Requires `FloatingTree` to be
* setup.
*/
virtualItemRef?: React_2.MutableRefObject<HTMLElement | null>;

@@ -719,3 +1183,4 @@ /**

* Only relevant for `cols > 1` and items with different sizes, specify if
* the grid is dense (as defined in the CSS spec for grid-auto-flow).
* the grid is dense (as defined in the CSS spec for `grid-auto-flow`).
* @default false
*/

@@ -727,3 +1192,3 @@ dense?: boolean;

* Merges an array of refs into a single memoized callback ref or `null`.
* @see https://floating-ui.com/docs/useMergeRefs
* @see https://floating-ui.com/docs/react-utils#usemergerefs
*/

@@ -740,3 +1205,12 @@ export declare function useMergeRefs<Instance>(refs: Array<React_2.Ref<Instance> | undefined>): React_2.RefCallback<Instance> | null;

export declare interface UseRoleProps {
/**
* Whether the Hook is enabled, including all internal Effects and event
* handlers.
* @default true
*/
enabled?: boolean;
/**
* The role of the floating element.
* @default 'dialog'
*/
role?: AriaRole | ComponentRole;

@@ -756,2 +1230,6 @@ }

export declare interface UseTransitionStatusProps {
/**
* The duration of the transition in milliseconds, or an object containing
* `open` and `close` keys for different durations.
*/
duration?: number | Partial<{

@@ -774,5 +1252,19 @@ open: number;

export declare interface UseTransitionStylesProps extends UseTransitionStatusProps {
/**
* The styles to apply when the floating element is initially mounted.
*/
initial?: CSSStylesProperty;
/**
* The styles to apply when the floating element is transitioning to the
* `open` state.
*/
open?: CSSStylesProperty;
/**
* The styles to apply when the floating element is transitioning to the
* `close` state.
*/
close?: CSSStylesProperty;
/**
* The styles to apply to all states.
*/
common?: CSSStylesProperty;

@@ -789,10 +1281,46 @@ }

export declare interface UseTypeaheadProps {
/**
* A ref which contains an array of strings whose indices match the HTML
* elements of the list.
* @default empty list
*/
listRef: React_2.MutableRefObject<Array<string | null>>;
/**
* The index of the active (focused or highlighted) item in the list.
* @default null
*/
activeIndex: number | null;
/**
* Callback invoked with the matching index if found as the user types.
*/
onMatch?: (index: number) => void;
/**
* Callback invoked with the typing state as the user types.
*/
onTypingChange?: (isTyping: boolean) => void;
/**
* Whether the Hook is enabled, including all internal Effects and event
* handlers.
* @default true
*/
enabled?: boolean;
/**
* A function that returns the matching string from the list.
* @default lowercase-finder
*/
findMatch?: null | ((list: Array<string | null>, typedString: string) => string | null | undefined);
/**
* The number of milliseconds to wait before resetting the typed string.
* @default 750
*/
resetMs?: number;
/**
* An array of keys to ignore when typing.
* @default []
*/
ignoreKeys?: Array<string>;
/**
* The index of the selected item in the list, if available.
* @default null
*/
selectedIndex?: number | null;

@@ -799,0 +1327,0 @@ }

4

dist/floating-ui.react.umd.min.js

@@ -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 l=u["useInsertionEffect".toString()]||(e=>e());function c(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 s(e){return f(e)?(e.nodeName||"").toLowerCase():"#document"}function a(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function f(e){return e instanceof Node||e instanceof a(e).Node}function d(e){return e instanceof Element||e instanceof a(e).Element}function v(e){return e instanceof HTMLElement||e instanceof a(e).HTMLElement}function m(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof a(e).ShadowRoot)}function p(e){return["html","body","#document"].includes(s(e))}function g(e){if("html"===s(e))return e;const t=e.assignedSlot||e.parentNode||m(e)&&e.host||function(e){var t;return null==(t=(f(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}(e);return m(t)?t.host:t}function h(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 y(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&m(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function b(){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 w(e){return!(0!==e.mozInputSource||!e.isTrusted)||(I()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function x(e){return!E().includes("jsdom/")&&(!I()&&0===e.width&&0===e.height||I()&&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 R(){return/apple/i.test(navigator.vendor)}function I(){const e=/android/i;return e.test(b())||e.test(E())}function k(){return b().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function O(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function C(e){return(null==e?void 0:e.ownerDocument)||document}function M(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 T(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 P(e){return v(e)&&e.matches(S)}function L(e){e.preventDefault(),e.stopPropagation()}function A(e){return!!e&&("combobox"===e.getAttribute("role")&&P(e))}const D=Math.floor,N="ArrowUp",F="ArrowDown",j="ArrowLeft",K="ArrowRight";function H(e,t,n){return Math.floor(e/t)!==n}function q(e,t){return t<0||t>=e.current.length}function _(e,t){return W(e,{disabledIndices:t})}function B(e,t){return W(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function W(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const i=e.current,l=o?e=>o.includes(e):e=>{const t=i[e];return null==t||t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled")};let c=n;do{c+=r?-u:u}while(c>=0&&c<=i.length-1&&l(c));return c}function U(e,t){let{event:n,orientation:r,loop:o,cols:u,disabledIndices:i,minIndex:l,maxIndex:c,prevIndex:s,stopEvent:a=!1}=t,f=s;if(n.key===N){if(a&&L(n),-1===s)f=c;else if(f=W(e,{startingIndex:f,amount:u,decrement:!0,disabledIndices:i}),o&&(s-u<l||f<0)){const e=s%u,t=c%u,n=c-(t-e);f=t===e?c:t>e?n:n-u}q(e,f)&&(f=s)}if(n.key===F&&(a&&L(n),-1===s?f=l:(f=W(e,{startingIndex:s,amount:u,disabledIndices:i}),o&&s+u>c&&(f=W(e,{startingIndex:s%u-u,amount:u,disabledIndices:i}))),q(e,f)&&(f=s)),"both"===r){const t=D(s/u);n.key===K&&(a&&L(n),s%u!=u-1?(f=W(e,{startingIndex:s,disabledIndices:i}),o&&H(f,u,t)&&(f=W(e,{startingIndex:s-s%u-1,disabledIndices:i}))):o&&(f=W(e,{startingIndex:s-s%u-1,disabledIndices:i})),H(f,u,t)&&(f=s)),n.key===j&&(a&&L(n),s%u!=0?(f=W(e,{startingIndex:s,disabledIndices:i,decrement:!0}),o&&H(f,u,t)&&(f=W(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i}))):o&&(f=W(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i})),H(f,u,t)&&(f=s));const r=D(c/u)===t;q(e,f)&&(f=o&&r?n.key===j?c:W(e,{startingIndex:s-s%u-1,disabledIndices:i}):s)}return f}function z(e,t,n){const r=[];let o=0;return e.forEach(((e,u)=>{let{width:i,height:l}=e,c=!1;for(n&&(o=0);!c;){const e=[];for(let n=0;n<i;n++)for(let r=0;r<l;r++)e.push(o+n+r*t);o%t+i<=t&&e.every((e=>null==r[e]))?(e.forEach((e=>{r[e]=u})),c=!0):o++}})),[...r]}function X(e,t,n,r,o){if(-1===e)return-1;const u=n.indexOf(e);switch(o){case"tl":return u;case"tr":return u+t[e].width-1;case"bl":return u+(t[e].height-1)*r;case"br":return n.lastIndexOf(e)}}function Y(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}let V=0;function G(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(V);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():V=requestAnimationFrame(u)}var Z="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function $(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 Q=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function J(e){let{children:t,elementsRef:n,labelsRef:r}=e;const[o,i]=u.useState((()=>new Map)),l=u.useCallback((e=>{i((t=>new Map(t).set(e,null)))}),[]),c=u.useCallback((e=>{i((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return Z((()=>{const e=new Map(o);Array.from(e.keys()).sort($).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(Q.Provider,{value:u.useMemo((()=>({register:l,unregister:c,map:o,elementsRef:n,labelsRef:r})),[l,c,o,n,r])},t)}function ee(e){let{label:t}=void 0===e?{}:e;const[n,r]=u.useState(null),o=u.useRef(null),{register:i,unregister:l,map:c,elementsRef:s,labelsRef:a}=u.useContext(Q),f=u.useCallback((e=>{if(o.current=e,null!==n&&(s.current[n]=e,a)){var r;const o=void 0!==t;a.current[n]=o?t:null!=(r=null==e?void 0:e.textContent)?r:null}}),[n,s,a,t]);return Z((()=>{const e=o.current;if(e)return i(e),()=>{l(e)}}),[i,l]),Z((()=>{const e=o.current?c.get(o.current):null;null!=e&&r(e)}),[c]),u.useMemo((()=>({ref:f,index:null==n?-1:n})),[n,f])}function te(e,t){return"function"==typeof e?e(t):e?u.cloneElement(e,t):u.createElement("div",t)}const ne=u.createContext({activeIndex:0,onNavigate:()=>{}}),re=[j,K],oe=[N,F],ue=[...re,...oe],ie=u.forwardRef((function(e,t){let{render:n,orientation:r="both",loop:o=!0,cols:i=1,disabledIndices:l=[],activeIndex:s,onNavigate:a,itemSizes:f,dense:d=!1,...v}=e;const[m,p]=u.useState(0),g=null!=s?s:m,h=c(null!=a?a:p),y=u.useRef([]),b=n&&"function"!=typeof n?n.props:{},E=u.useMemo((()=>({activeIndex:g,onNavigate:h})),[g,h]),w=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(!ue.includes(e.key))return;let t=g;if(w){const n=null!=f?f:Array.from(Array(y.current.length),(()=>({width:1,height:1}))),u=z(n,i,d),c=u.findIndex((e=>null!=e&&!l.includes(e))),s=u.reduce(((e,t,n)=>null==t||null!=l&&l.includes(t)?e:n),-1);t=u[U({current:u.map((e=>e?y.current[e]:null))},{event:e,orientation:r,loop:o,cols:i,disabledIndices:Y([...l,void 0],u),minIndex:c,maxIndex:s,prevIndex:X(g,n,u,i,e.key===F?"bl":e.key===K?"tr":"tl")})]}const n=_(y,l),u=B(y,l),c={horizontal:[K],vertical:[F],both:[K,F]}[r],s={horizontal:[j],vertical:[N],both:[j,N]}[r],a=w?ue:{horizontal:re,vertical:oe,both:ue}[r];t===g&&[...c,...s].includes(e.key)&&(t=o&&t===u&&c.includes(e.key)?n:o&&t===n&&s.includes(e.key)?u:W(y,{startingIndex:t,decrement:s.includes(e.key),disabledIndices:l})),t===g||q(y,t)||(e.stopPropagation(),a.includes(e.key)&&e.preventDefault(),h(t),queueMicrotask((()=>{G(y.current[t])})))}(e)}};return u.createElement(ne.Provider,{value:E},u.createElement(J,{elementsRef:y},te(n,x)))})),le=u.forwardRef((function(e,t){let{render:n,...r}=e;const o=n&&"function"!=typeof n?n.props:{},{activeIndex:l,onNavigate:c}=u.useContext(ne),{ref:s,index:a}=ee(),f=i([s,t,o.ref]),d=l===a;return te(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),c(a)}})}));function ce(){return ce=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},ce.apply(this,arguments)}let se=!1,ae=0;const fe=()=>"floating-ui-"+ae++;const de=u["useId".toString()]||function(){const[e,t]=u.useState((()=>se?fe():void 0));return Z((()=>{null==e&&t(fe())}),[]),u.useEffect((()=>{se||(se=!0)}),[]),e},ve=u.forwardRef((function(e,t){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i}},width:l=14,height:c=7,tipRadius:s=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:v,style:{transform:m,...p}={},...g}=e;const h=de();if(!o)return null;a*=2;const y=a/2,b=l/2*(s/-8+1),E=c/2*s/4,[w,x]=r.split("-"),R=n.platform.isRTL(o),I=!!v,k="top"===w||"bottom"===w,O=f&&"end"===x?"bottom":"top";let C=f&&"end"===x?"right":"left";f&&R&&(C="end"===x?"left":"right");const M=null!=(null==i?void 0:i.x)?f||i.x:"",T=null!=(null==i?void 0:i.y)?f||i.y:"",S=v||"M0,0 H"+l+" L"+(l-b)+","+(c-E)+" Q"+l/2+","+c+" "+b+","+(c-E)+" Z",P={top:I?"rotate(180deg)":"",left:I?"rotate(90deg)":"rotate(-90deg)",bottom:I?"":"rotate(180deg)",right:I?"rotate(-90deg)":"rotate(90deg)"}[w];return u.createElement("svg",ce({},g,{"aria-hidden":!0,ref:t,width:I?l:l+a,height:l,viewBox:"0 0 "+l+" "+(c>l?c:l),style:{position:"absolute",pointerEvents:"none",[C]:M,[O]:T,[w]:k||I?"100%":"calc(100% - "+a/2+"px)",transform:""+P+(null!=m?m:""),...p}}),a>0&&u.createElement("path",{clipPath:"url(#"+h+")",fill:"none",stroke:d,strokeWidth:a+(v?0:1),d:S}),u.createElement("path",{stroke:a&&!v?g.fill:"none",d:S}),u.createElement("clipPath",{id:h},u.createElement("rect",{x:-y,y:y*(I?-1:1),width:l+a,height:l})))}));function me(){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 pe=u.createContext(null),ge=u.createContext(null),he=()=>{var e;return(null==(e=u.useContext(pe))?void 0:e.id)||null},ye=()=>u.useContext(ge);function be(e){return"data-floating-ui-"+e}function Ee(e){const n=t.useRef(e);return Z((()=>{n.current=e})),n}const we=be("safe-polygon");function xe(e,t,n){return n&&!O(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}const Re=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),Ie=()=>u.useContext(Re);
!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["useInsertionEffect".toString()]||(e=>e());function l(e){const t=u.useRef((()=>{}));return c((()=>{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 s(e){return f(e)?(e.nodeName||"").toLowerCase():"#document"}function a(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function f(e){return e instanceof Node||e instanceof a(e).Node}function d(e){return e instanceof Element||e instanceof a(e).Element}function v(e){return e instanceof HTMLElement||e instanceof a(e).HTMLElement}function m(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof a(e).ShadowRoot)}function p(e){return["html","body","#document"].includes(s(e))}function g(e){if("html"===s(e))return e;const t=e.assignedSlot||e.parentNode||m(e)&&e.host||function(e){var t;return null==(t=(f(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}(e);return m(t)?t.host:t}function h(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 y(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&m(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function b(){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 w(e){return!(0!==e.mozInputSource||!e.isTrusted)||(I()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function x(e){return!E().includes("jsdom/")&&(!I()&&0===e.width&&0===e.height||I()&&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 R(){return/apple/i.test(navigator.vendor)}function I(){const e=/android/i;return e.test(b())||e.test(E())}function k(){return b().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function O(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function C(e){return(null==e?void 0:e.ownerDocument)||document}function M(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 T(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 P(e){return v(e)&&e.matches(S)}function L(e){e.preventDefault(),e.stopPropagation()}function A(e){return!!e&&("combobox"===e.getAttribute("role")&&P(e))}const D=Math.floor,N="ArrowUp",F="ArrowDown",j="ArrowLeft",K="ArrowRight";function H(e,t,n){return Math.floor(e/t)!==n}function q(e,t){return t<0||t>=e.current.length}function _(e,t){return W(e,{disabledIndices:t})}function B(e,t){return W(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function W(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const i=e.current,c=o?e=>o.includes(e):e=>{const t=i[e];return null==t||t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled")};let l=n;do{l+=r?-u:u}while(l>=0&&l<=i.length-1&&c(l));return l}function U(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===N){if(a&&L(n),-1===s)f=l;else if(f=W(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}q(e,f)&&(f=s)}if(n.key===F&&(a&&L(n),-1===s?f=c:(f=W(e,{startingIndex:s,amount:u,disabledIndices:i}),o&&s+u>l&&(f=W(e,{startingIndex:s%u-u,amount:u,disabledIndices:i}))),q(e,f)&&(f=s)),"both"===r){const t=D(s/u);n.key===K&&(a&&L(n),s%u!=u-1?(f=W(e,{startingIndex:s,disabledIndices:i}),o&&H(f,u,t)&&(f=W(e,{startingIndex:s-s%u-1,disabledIndices:i}))):o&&(f=W(e,{startingIndex:s-s%u-1,disabledIndices:i})),H(f,u,t)&&(f=s)),n.key===j&&(a&&L(n),s%u!=0?(f=W(e,{startingIndex:s,disabledIndices:i,decrement:!0}),o&&H(f,u,t)&&(f=W(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i}))):o&&(f=W(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i})),H(f,u,t)&&(f=s));const r=D(l/u)===t;q(e,f)&&(f=o&&r?n.key===j?l:W(e,{startingIndex:s-s%u-1,disabledIndices:i}):s)}return f}function z(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 X(e,t,n,r,o){if(-1===e)return-1;const u=n.indexOf(e);switch(o){case"tl":return u;case"tr":return u+t[e].width-1;case"bl":return u+(t[e].height-1)*r;case"br":return n.lastIndexOf(e)}}function Y(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}let V=0;function G(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(V);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():V=requestAnimationFrame(u)}var Z="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function $(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 Q=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function J(e){let{children:t,elementsRef:n,labelsRef:r}=e;const[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 Z((()=>{const e=new Map(o);Array.from(e.keys()).sort($).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(Q.Provider,{value:u.useMemo((()=>({register:c,unregister:l,map:o,elementsRef:n,labelsRef:r})),[c,l,o,n,r])},t)}function ee(e){let{label:t}=void 0===e?{}:e;const[n,r]=u.useState(null),o=u.useRef(null),{register:i,unregister:c,map:l,elementsRef:s,labelsRef:a}=u.useContext(Q),f=u.useCallback((e=>{if(o.current=e,null!==n&&(s.current[n]=e,a)){var r;const o=void 0!==t;a.current[n]=o?t:null!=(r=null==e?void 0:e.textContent)?r:null}}),[n,s,a,t]);return Z((()=>{const e=o.current;if(e)return i(e),()=>{c(e)}}),[i,c]),Z((()=>{const e=o.current?l.get(o.current):null;null!=e&&r(e)}),[l]),u.useMemo((()=>({ref:f,index:null==n?-1:n})),[n,f])}function te(e,t){return"function"==typeof e?e(t):e?u.cloneElement(e,t):u.createElement("div",t)}const ne=u.createContext({activeIndex:0,onNavigate:()=>{}}),re=[j,K],oe=[N,F],ue=[...re,...oe],ie=u.forwardRef((function(e,t){let{render:n,orientation:r="both",loop:o=!0,cols:i=1,disabledIndices:c=[],activeIndex:s,onNavigate:a,itemSizes:f,dense:d=!1,...v}=e;const[m,p]=u.useState(0),g=null!=s?s:m,h=l(null!=a?a:p),y=u.useRef([]),b=n&&"function"!=typeof n?n.props:{},E=u.useMemo((()=>({activeIndex:g,onNavigate:h})),[g,h]),w=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(!ue.includes(e.key))return;let t=g;if(w){const n=f||Array.from({length:y.current.length},(()=>({width:1,height:1}))),u=z(n,i,d),l=u.findIndex((e=>null!=e&&!c.includes(e))),s=u.reduce(((e,t,n)=>null==t||null!=c&&c.includes(t)?e:n),-1);t=u[U({current:u.map((e=>e?y.current[e]:null))},{event:e,orientation:r,loop:o,cols:i,disabledIndices:Y([...c,void 0],u),minIndex:l,maxIndex:s,prevIndex:X(g,n,u,i,e.key===F?"bl":e.key===K?"tr":"tl")})]}const n=_(y,c),u=B(y,c),l={horizontal:[K],vertical:[F],both:[K,F]}[r],s={horizontal:[j],vertical:[N],both:[j,N]}[r],a=w?ue:{horizontal:re,vertical:oe,both:ue}[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:W(y,{startingIndex:t,decrement:s.includes(e.key),disabledIndices:c})),t===g||q(y,t)||(e.stopPropagation(),a.includes(e.key)&&e.preventDefault(),h(t),queueMicrotask((()=>{G(y.current[t])})))}(e)}};return u.createElement(ne.Provider,{value:E},u.createElement(J,{elementsRef:y},te(n,x)))})),ce=u.forwardRef((function(e,t){let{render:n,...r}=e;const o=n&&"function"!=typeof n?n.props:{},{activeIndex:c,onNavigate:l}=u.useContext(ne),{ref:s,index:a}=ee(),f=i([s,t,o.ref]),d=c===a;return te(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 le(){return le=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},le.apply(this,arguments)}let se=!1,ae=0;const fe=()=>"floating-ui-"+ae++;const de=u["useId".toString()]||function(){const[e,t]=u.useState((()=>se?fe():void 0));return Z((()=>{null==e&&t(fe())}),[]),u.useEffect((()=>{se||(se=!0)}),[]),e},ve=u.forwardRef((function(e,t){let{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;const h=de();if(!o)return null;a*=2;const y=a/2,b=c/2*(s/-8+1),E=l/2*s/4,[w,x]=r.split("-"),R=n.platform.isRTL(o),I=!!v,k="top"===w||"bottom"===w,O=f&&"end"===x?"bottom":"top";let C=f&&"end"===x?"right":"left";f&&R&&(C="end"===x?"left":"right");const M=null!=(null==i?void 0:i.x)?f||i.x:"",T=null!=(null==i?void 0:i.y)?f||i.y:"",S=v||"M0,0 H"+c+" L"+(c-b)+","+(l-E)+" Q"+c/2+","+l+" "+b+","+(l-E)+" Z",P={top:I?"rotate(180deg)":"",left:I?"rotate(90deg)":"rotate(-90deg)",bottom:I?"":"rotate(180deg)",right:I?"rotate(-90deg)":"rotate(90deg)"}[w];return u.createElement("svg",le({},g,{"aria-hidden":!0,ref:t,width:I?c:c+a,height:c,viewBox:"0 0 "+c+" "+(l>c?l:c),style:{position:"absolute",pointerEvents:"none",[C]:M,[O]:T,[w]:k||I?"100%":"calc(100% - "+a/2+"px)",transform:""+P+(null!=m?m:""),...p}}),a>0&&u.createElement("path",{clipPath:"url(#"+h+")",fill:"none",stroke:d,strokeWidth:a+(v?0:1),d:S}),u.createElement("path",{stroke:a&&!v?g.fill:"none",d:S}),u.createElement("clipPath",{id:h},u.createElement("rect",{x:-y,y:y*(I?-1:1),width:c+a,height:c})))}));function me(){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 pe=u.createContext(null),ge=u.createContext(null),he=()=>{var e;return(null==(e=u.useContext(pe))?void 0:e.id)||null},ye=()=>u.useContext(ge);function be(e){return"data-floating-ui-"+e}function Ee(e){const n=t.useRef(e);return Z((()=>{n.current=e})),n}const we=be("safe-polygon");function xe(e,t,n){return n&&!O(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}const Re=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),Ie=()=>u.useContext(Re);
/*!

@@ -6,2 +6,2 @@ * tabbable 6.2.0

*/
var ke=["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(","),Oe="undefined"==typeof Element,Ce=Oe?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Me=!Oe&&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},Te=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)},Se=function e(t,n,r){for(var o=[],u=Array.from(t);u.length;){var i=u.shift();if(!Te(i,!1))if("SLOT"===i.tagName){var l=i.assignedElements(),c=e(l.length?l:i.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{Ce.call(i,ke)&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),a=!Te(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},Pe=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Le=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))&&!Pe(e)?0:e.tabIndex},Ae=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},De=function(e){return"INPUT"===e.tagName},Ne=function(e){return function(e){return De(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Me(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)},Fe=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},je=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Ce.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Ce.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Fe(e)}else{if("function"==typeof r){for(var u=e;e;){var i=e.parentElement,l=Me(e);if(i&&!i.shadowRoot&&!0===r(i))return Fe(e);e=e.assignedSlot?e.assignedSlot:i||l===e.ownerDocument?i:l.host}e=u}if(function(e){var t,n,r,o,u=e&&Me(e),i=null===(t=u)||void 0===t?void 0:t.host,l=!1;if(u&&u!==e)for(l=!!(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));!l&&i;){var c,s,a;l=!(null===(s=i=null===(c=u=Me(i))||void 0===c?void 0:c.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(i))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Ke=function(e,t){return!(t.disabled||Te(t)||function(e){return De(e)&&"hidden"===e.type}(t)||je(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!!Ce.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},He=function(e,t){return!(Ne(t)||Le(t)<0||!Ke(e,t))},qe=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},_e=function e(t){var n=[],r=[];return t.forEach((function(t,o){var u=!!t.scopeParent,i=u?t.scopeParent:t,l=function(e,t){var n=Le(e);return n<0&&t&&!Pe(e)?0:n}(i,u),c=u?e(t.candidates):i;0===l?u?n.push.apply(n,c):n.push(i):r.push({documentOrder:o,tabIndex:l,item:t,isScope:u,content:c})})),r.sort(Ae).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Be=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Se([e],t.includeContainer,{filter:He.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:qe}):function(e,t,n){if(Te(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ke));return t&&Ce.call(e,ke)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,He.bind(null,t)),_e(n)};function We(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 Ue=new WeakMap,ze=new WeakSet,Xe={},Ye=0;const Ve=e=>e&&(e.host||Ve(e.parentNode)),Ge=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=Ve(t);return e.contains(n)?n:null})).filter((e=>null!=e));function Ze(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=C(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",u=r?"inert":n?"aria-hidden":null,i=Ge(t,e),l=new Set,c=new Set(i),s=[];Xe[o]||(Xe[o]=new WeakMap);const a=Xe[o];return i.forEach((function e(t){t&&!l.has(t)&&(l.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!c.has(t)&&Array.prototype.forEach.call(t.children,(t=>{if(l.has(t))e(t);else{const e=u?t.getAttribute(u):null,n=null!==e&&"false"!==e,r=(Ue.get(t)||0)+1,i=(a.get(t)||0)+1;Ue.set(t,r),a.set(t,i),s.push(t),1===r&&n&&ze.add(t),1===i&&t.setAttribute(o,""),!n&&u&&t.setAttribute(u,"true")}}))}(t),l.clear(),Ye++,()=>{s.forEach((e=>{const t=(Ue.get(e)||0)-1,n=(a.get(e)||0)-1;Ue.set(e,t),a.set(e,n),t||(!ze.has(e)&&u&&e.removeAttribute(u),ze.delete(e)),n||e.removeAttribute(o)})),Ye--,Ye||(Ue=new WeakMap,Ue=new WeakMap,ze=new WeakSet,Xe={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const $e=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Qe(e,t){const n=Be(e,$e());"prev"===t&&n.reverse();const r=n.indexOf(h(C(e)));return n.slice(r+1)[0]}function Je(){return Qe(document.body,"next")}function et(){return Qe(document.body,"prev")}function tt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!y(n,r)}function nt(e){Be(e,$e()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function rt(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 ot={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function ut(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const it=u.forwardRef((function(e,t){const[n,r]=u.useState();Z((()=>(R()&&r("button"),document.addEventListener("keydown",ut),()=>{document.removeEventListener("keydown",ut)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[be("focus-guard")]:"",style:ot};return u.createElement("span",ce({},e,o))})),lt=u.createContext(null);function ct(e){let{id:t,root:n}=void 0===e?{}:e;const[r,o]=u.useState(null),i=de(),l=st(),c=u.useMemo((()=>({id:t,root:n,portalContext:l,uniqueId:i})),[t,n,l,i]),s=u.useRef();return Z((()=>()=>{null==r||r.remove()}),[r,c]),Z((()=>{if(s.current===c)return;s.current=c;const{id:e,root:t,portalContext:n,uniqueId:r}=c,u=e?document.getElementById(e):null,i=be("portal");if(u){const e=document.createElement("div");e.id=r,e.setAttribute(i,""),u.appendChild(e),o(e)}else{let u=t||(null==n?void 0:n.portalNode);u&&!d(u)&&(u=u.current),u=u||document.body;let l=null;e&&(l=document.createElement("div"),l.id=e,u.appendChild(l));const c=document.createElement("div");c.id=r,c.setAttribute(i,""),u=l||u,u.appendChild(c),o(c)}}),[c]),r}const st=()=>u.useContext(lt),at=20;let ft=[];function dt(e){ft=ft.filter((e=>e.isConnected)),e&&"body"!==s(e)&&(ft.push(e),ft.length>at&&(ft=ft.slice(-at)))}function vt(){return ft.slice().reverse().find((e=>e.isConnected))}const mt=u.forwardRef((function(e,t){return u.createElement("button",ce({},e,{type:"button",ref:t,tabIndex:-1,style:ot}))}));const pt=new Set,gt=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;const o=de();return Z((()=>{if(!n)return;pt.add(o);const e=/iP(hone|ad|od)|iOS/.test(b()),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,l=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",u&&(t[r]=u+"px"),e){var c,s;const e=(null==(c=window.visualViewport)?void 0:c.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(l-Math.floor(n))+"px",left:-(i-Math.floor(e))+"px",right:"0"})}return()=>{pt.delete(o),0===pt.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(i,l)))}}),[o,n]),u.createElement("div",ce({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function ht(e){return v(e.target)&&"BUTTON"===e.target.tagName}function yt(e){return P(e)}function bt(e){return null!=e&&null!=e.clientX}const Et={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},wt={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},xt=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}};const Rt="active",It="selected";function kt(e,t,n){const r=new Map,o="item"===n;let u=e;if(o&&e){const{[Rt]:t,[It]: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&&[Rt,It].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 Ot=!1;function Ct(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Mt(e,t){return Ct(t,e===N||e===F,e===j||e===K)}function Tt(e,t,n){return Ct(t,e===F,n?e===j:e===K)||"Enter"===e||" "===e||""===e}function St(e,t,n){return Ct(t,n?e===K:e===j,e===N)}const Pt=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const Lt=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function At(e,t){return"function"==typeof e?e(t):e}function Dt(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,[l,c]=u.useState(!1),[s,a]=u.useState("unmounted"),f=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return Z((()=>{l&&!f&&a("unmounted")}),[l,f]),Z((()=>{if(r){if(n){a("initial");const e=requestAnimationFrame((()=>{a("open")}));return()=>{cancelAnimationFrame(e)}}c(!0),a("close")}}),[n,r]),{isMounted:f,status:s}}function Nt(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function Ft(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,l]=t[e]||[0,0],[c,s]=t[i]||[0,0];l>=r!=s>=r&&n<=(c-u)*(r-l)/(s-l)+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=ie,e.CompositeItem=le,e.FloatingArrow=ve,e.FloatingDelayGroup=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,i]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),l=u.useRef(null),c=u.useCallback((e=>{i({currentId:e})}),[]);return Z((()=>{o.currentId?null===l.current?l.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),l.current=null)}),[o.currentId]),u.createElement(Re.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:c})),[o,c])},t)},e.FloatingFocusManager=function(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:l=0,returnFocus:c=!0,modal:s=!0,visuallyHiddenDismiss:a=!1,closeOnFocusOut:f=!0}=e,{open:d,refs:m,nodeId:p,onOpenChange:g,events:b,dataRef:E,elements:{domReference:R,floating:I}}=t,k="number"==typeof l&&l<0,O=A(R)&&k,M="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||i,S=Ee(o),P=Ee(l),D=Ee(c),N=ye(),F=st(),j=u.useRef(null),K=u.useRef(null),H=u.useRef(!1),q=u.useRef(!1),_=null!=F,B=u.useCallback((function(e){return void 0===e&&(e=I),e?Be(e,$e()):[]}),[I]),W=u.useCallback((e=>{const t=B(e);return S.current.map((e=>R&&"reference"===e?R:I&&"floating"===e?I:t)).filter(Boolean).flat()}),[R,I,S,B]);function U(e){return!r&&a&&s?u.createElement(mt,{ref:"start"===e?j:K,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof a?a:"Dismiss"):null}u.useEffect((()=>{if(r||!s)return;function e(e){if("Tab"===e.key){y(I,h(C(I)))&&0===B().length&&!O&&L(e);const t=W(),n=T(e);"reference"===S.current[0]&&n===R&&(L(e),e.shiftKey?G(t[t.length-1]):G(t[1])),"floating"===S.current[1]&&n===I&&e.shiftKey&&(L(e),G(t[0]))}}const t=C(I);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,R,I,s,S,O,B,W]),u.useEffect((()=>{if(!r&&f)return I&&v(R)?(R.addEventListener("focusout",t),R.addEventListener("pointerdown",e),!s&&I.addEventListener("focusout",t),()=>{R.removeEventListener("focusout",t),R.removeEventListener("pointerdown",e),!s&&I.removeEventListener("focusout",t)}):void 0;function e(){q.current=!0,setTimeout((()=>{q.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(y(R,t)||y(I,t)||y(t,I)||y(null==F?void 0:F.portalNode,t)||null!=t&&t.hasAttribute(be("focus-guard"))||N&&(We(N.nodesRef.current,p).find((e=>{var n,r;return y(null==(n=e.context)?void 0:n.elements.floating,t)||y(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}(N.nodesRef.current,p).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}))));t&&n&&!q.current&&t!==vt()&&(H.current=!0,g(!1,e))}))}}),[r,R,I,s,p,N,F,g,f]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==F||null==(e=F.portalNode)?void 0:e.querySelectorAll("["+be("portal")+"]"))||[]);if(I){const e=[I,...t,j.current,K.current,S.current.includes("reference")||O?R:null].filter((e=>null!=e)),n=s||O?Ze(e,M,!M):Ze(e);return()=>{n()}}}),[r,R,I,s,S,F,O,M]),Z((()=>{if(r||!I)return;const e=h(C(I));queueMicrotask((()=>{const t=W(I),n=P.current,r=("number"==typeof n?t[n]:n.current)||I,o=y(I,e);k||o||!d||G(r,{preventScroll:r===I})}))}),[r,d,I,k,W,P]),Z((()=>{if(r||!I)return;let e=!1;const t=C(I),n=h(t),o=E.current;function u(t){let{reason:n,event:r,nested:o}=t;"escape-key"===n&&m.domReference.current&&dt(m.domReference.current),"hover"===n&&"mouseleave"===r.type&&(H.current=!0),"outside-press"===n&&(o?(H.current=!1,e=!0):H.current=!(w(r)||x(r)))}return dt(n),b.on("openchange",u),()=>{b.off("openchange",u);const n=h(t),r=y(I,n)||N&&We(N.nodesRef.current,p).some((e=>{var t;return y(null==(t=e.context)?void 0:t.elements.floating,n)}));(r||o.openEvent&&["click","mousedown"].includes(o.openEvent.type))&&m.domReference.current&&dt(m.domReference.current);const i=vt();D.current&&!H.current&&v(i)&&(i===n||n===t.body||r)&&G(i,{cancelPrevious:!1,preventScroll:e})}}),[r,I,D,E,m,b,N,p]),Z((()=>{if(!r&&F)return F.setFocusManagerState({modal:s,closeOnFocusOut:f,open:d,onOpenChange:g,refs:m}),()=>{F.setFocusManagerState(null)}}),[r,F,s,d,g,m,f]),Z((()=>{if(r||!I||"function"!=typeof MutationObserver||k)return;const e=()=>{const e=I.getAttribute("tabindex");S.current.includes("floating")||h(C(I))!==m.domReference.current&&0===B().length?"0"!==e&&I.setAttribute("tabindex","0"):"-1"!==e&&I.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(I,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,I,m,S,B,k]);const z=!r&&M&&(_||s);return u.createElement(u.Fragment,null,z&&u.createElement(it,{"data-type":"inside",ref:null==F?void 0:F.beforeInsideRef,onFocus:e=>{if(s){const e=W();G("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=F&&F.preserveTabOrder&&F.portalNode)if(H.current=!1,tt(e,F.portalNode)){const e=Je()||R;null==e||e.focus()}else{var t;null==(t=F.beforeOutsideRef.current)||t.focus()}}}),!O&&U("start"),n,U("end"),z&&u.createElement(it,{"data-type":"inside",ref:null==F?void 0:F.afterInsideRef,onFocus:e=>{if(s)G(W()[0]);else if(null!=F&&F.preserveTabOrder&&F.portalNode)if(f&&(H.current=!0),tt(e,F.portalNode)){const e=et()||R;null==e||e.focus()}else{var t;null==(t=F.afterOutsideRef.current)||t.focus()}}}))},e.FloatingList=J,e.FloatingNode=function(e){let{children:t,id:n}=e;const r=he();return u.createElement(pe.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=gt,e.FloatingPortal=function(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const l=ct({id:n,root:o}),[c,s]=u.useState(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),v=u.useRef(null),m=!!c&&!c.modal&&c.open&&i&&!(!o&&!l);return u.useEffect((()=>{if(l&&i&&(null==c||!c.modal))return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&tt(e)){("focusin"===e.type?rt:nt)(l)}}}),[l,i,null==c?void 0:c.modal]),u.createElement(lt.Provider,{value:u.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:v,portalNode:l,setFocusManagerState:s})),[i,l])},m&&l&&u.createElement(it,{"data-type":"outside",ref:a,onFocus:e=>{if(tt(e,l)){var t;null==(t=d.current)||t.focus()}else{const e=et()||(null==c?void 0:c.refs.domReference.current);null==e||e.focus()}}}),m&&l&&u.createElement("span",{"aria-owns":l.id,style:ot}),l&&r.createPortal(t,l),m&&l&&u.createElement(it,{"data-type":"outside",ref:f,onFocus:e=>{if(tt(e,l)){var t;null==(t=v.current)||t.focus()}else{const t=Je()||(null==c?void 0:c.refs.domReference.current);null==t||t.focus(),(null==c?void 0:c.closeOnFocusOut)&&(null==c||c.onOpenChange(!1,e.nativeEvent))}}}))},e.FloatingTree=function(e){let{children:t}=e;const 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((()=>me()))[0];return u.createElement(ge.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:l=0,index:c=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:v,elements:{floating:m}}=t,p=o.current[c];if(!p)return{};const g={...t,...await n.offset(-p.offsetTop-m.clientTop-v.reference.height/2-p.offsetHeight/2-l).fn(t)},h=(null==f?void 0:f.current)||m,y=await n.detectOverflow(Nt(g,h.scrollHeight),d),b=await n.detectOverflow(g,{...d,elementContext:"reference"}),E=Math.max(0,y.top),w=g.y+E,x=Math.max(0,h.scrollHeight-E-Math.max(0,y.bottom));return h.style.maxHeight=x+"px",h.scrollTop=E,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(Nt({...g,y:w},h.offsetHeight),d)),{y:w}}}),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,l=null,c=performance.now();const s=e=>{let{x:n,y:s,placement:a,elements:f,onClose:v,nodeId:m,tree:p}=e;return function(e){function g(){clearTimeout(o),v()}if(clearTimeout(o),!f.domReference||!f.floating||null==a||null==n||null==s)return;const{clientX:h,clientY:b}=e,E=[h,b],w=T(e),x="mouseleave"===e.type,R=y(f.floating,w),I=y(f.domReference,w),k=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),C=a.split("-")[0],M=n>O.right-O.width/2,S=s>O.bottom-O.height/2,P=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(E,k),L=O.width>k.width,A=O.height>k.height,D=(L?k:O).left,N=(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&&d(e.relatedTarget)&&y(f.floating,e.relatedTarget))return;if(p&&We(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=[[D,k.top+1],[D,O.bottom-1],[N,O.bottom-1],[N,k.top+1]];break;case"bottom":K=[[D,O.top+1],[D,k.bottom-1],[N,k.bottom-1],[N,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(!Ft([h,b],K)){if(u&&!P)return g();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-c;if(null===i||null===l||0===r)return i=e,l=t,c=n,null;const o=e-i,u=t-l,s=Math.sqrt(o*o+u*u);return i=e,l=t,c=n,s/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return g()}Ft([h,b],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:S?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:S?r+4*t:r-4*t];return[...[[S||A?O.right-t:O.left,O.top],[S?A?O.right-t:O.left:O.right-t,O.bottom]],e,o]}case"right":return[[n-t,A?r+t/2:S?r+4*t:r-4*t],[n-t,A?r-t/2:S?r+4*t:r-4*t],...[[S||A?O.left+t:O.right,O.top],[S?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:l=!0,event:c="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=t,d=u.useRef(),v=u.useRef(!1);return u.useMemo((()=>l?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(O(d.current,!0)&&a||"click"!==c&&(!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"===c&&d.current?d.current=void 0:O(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||ht(e)||(" "!==e.key||yt(i)||(e.preventDefault(),v.current=!0),"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!f||ht(e)||yt(i)||" "===e.key&&v.current&&(v.current=!1,r(!n||!s,e.nativeEvent,"click"))}}}:{}),[l,o,c,a,f,i,s,n,r])},e.useClientPoint=function(e,t){void 0===t&&(t={});const{open:n,refs:r,dataRef:o,elements:{floating:i}}=e,{enabled:l=!0,axis:s="both",x:f=null,y:d=null}=t,v=u.useRef(!1),m=u.useRef(null),[p,g]=u.useState(),[h,b]=u.useState([]),E=c(((e,t)=>{v.current||o.current.openEvent&&!bt(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,i;const l=(null==(u=e.current)?void 0:u.getBoundingClientRect())||{width:0,height:0,x:0,y:0},c="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,a=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let f=l.width,d=l.height,v=l.x,m=l.y;return null==n&&t.x&&c&&(n=l.x-t.x),null==r&&t.y&&s&&(r=l.y-t.y),v-=n||0,m-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?l.width:0,d="x"===t.axis?l.height:0,v=c&&null!=t.x?t.x:v,m=s&&null!=t.y?t.y:m):o&&!a&&(d="x"===t.axis?l.height:d,f="y"===t.axis?l.width:f),o=!0,{width:f,height:d,x:v,y:m,top:m,right:v+f,bottom:m+d,left:v}}}}(r.domReference,{x:e,y:t,axis:s,dataRef:o,pointerType:p}))})),w=c((e=>{null==f&&null==d&&(n?m.current||b([]):E(e.clientX,e.clientY))})),x=O(p)?i:n,R=u.useCallback((()=>{if(!x||!l||null!=f||null!=d)return;const e=a(r.floating.current);function t(n){const o=T(n);y(r.floating.current,o)?(e.removeEventListener("mousemove",t),m.current=null):E(n.clientX,n.clientY)}if(!o.current.openEvent||bt(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),m.current=null};return m.current=n,n}r.setPositionReference(r.domReference.current)}),[o,l,x,r,E,f,d]);return u.useEffect((()=>R()),[R,h]),u.useEffect((()=>{l&&!i&&(v.current=!1)}),[l,i]),u.useEffect((()=>{!l&&n&&(v.current=!0)}),[l,n]),Z((()=>{!l||null==f&&null==d||(v.current=!1,E(f,d))}),[l,f,d,E]),u.useMemo((()=>{if(!l)return{};function e(e){let{pointerType:t}=e;g(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:w,onMouseEnter:w}}}),[l,w])},e.useDelayGroup=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:u,setCurrentId:i,initialDelay:l,setState:c,timeoutMs:s}=Ie();Z((()=>{u&&(c({delay:{open:1,close:xe(l,"close")}}),u!==o&&r(!1))}),[o,r,c,u,l]),Z((()=>{function e(){r(!1),c({delay:l,currentId:null})}if(!n&&u===o){if(s){const t=window.setTimeout(e,s);return()=>{clearTimeout(t)}}e()}}),[n,c,u,o,r,l,s]),Z((()=>{n&&i(o)}),[n,i,o])},e.useDelayGroupContext=Ie,e.useDismiss=function(e,t){void 0===t&&(t={});const{open:r,onOpenChange:o,nodeId:i,elements:{reference:l,domReference:s,floating:f},dataRef:m}=e,{enabled:h=!0,escapeKey:b=!0,outsidePress:E=!0,outsidePressEvent:w="pointerdown",referencePress:x=!1,referencePressEvent:R="pointerdown",ancestorScroll:I=!1,bubbles:k,capture:O}=t,S=ye(),P=c("function"==typeof E?E:()=>!1),L="function"==typeof E?P:E,A=u.useRef(!1),D=u.useRef(!1),{escapeKey:N,outsidePress:F}=xt(k),{escapeKey:j,outsidePress:K}=xt(O),H=c((e=>{if(!r||!h||!b||"Escape"!==e.key)return;const t=S?We(S.nodesRef.current,i):[];if(!N&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.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")})),q=c((e=>{var t;const n=()=>{var t;H(e),null==(t=T(e))||t.removeEventListener("keydown",n)};null==(t=T(e))||t.addEventListener("keydown",n)})),_=c((e=>{const t=A.current;A.current=!1;const n=D.current;if(D.current=!1,"click"===w&&n)return;if(t)return;if("function"==typeof L&&!L(e))return;const r=T(e),u="["+be("inert")+"]",l=C(f).querySelectorAll(u);let c=d(r)?r:null;for(;c&&!p(c);){const e=g(c);if(p(e)||!d(e))break;c=e}if(l.length&&d(r)&&!r.matches("html,body")&&!y(r,f)&&Array.from(l).every((e=>!y(c,e))))return;if(v(r)&&f){const t=r.clientWidth>0&&r.scrollWidth>r.clientWidth,n=r.clientHeight>0&&r.scrollHeight>r.clientHeight;let o=n&&e.offsetX>r.clientWidth;if(n){const t="rtl"===function(e){return a(e).getComputedStyle(e)}(r).direction;t&&(o=e.offsetX<=r.offsetWidth-r.clientWidth)}if(o||t&&e.offsetY>r.clientHeight)return}const m=S&&We(S.nodesRef.current,i).some((t=>{var n;return M(e,null==(n=t.context)?void 0:n.elements.floating)}));if(M(e,f)||M(e,s)||m)return;const h=S?We(S.nodesRef.current,i):[];if(h.length>0){let e=!0;if(h.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),B=c((e=>{var t;const n=()=>{var t;_(e),null==(t=T(e))||t.removeEventListener(w,n)};null==(t=T(e))||t.addEventListener(w,n)}));return u.useEffect((()=>{if(!r||!h)return;function e(e){o(!1,e,"ancestor-scroll")}m.current.__escapeKeyBubbles=N,m.current.__outsidePressBubbles=F;const t=C(f);b&&t.addEventListener("keydown",j?q:H,j),L&&t.addEventListener(w,K?B:_,K);let u=[];return I&&(d(s)&&(u=n.getOverflowAncestors(s)),d(f)&&(u=u.concat(n.getOverflowAncestors(f))),!d(l)&&l&&l.contextElement&&(u=u.concat(n.getOverflowAncestors(l.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})})),()=>{b&&t.removeEventListener("keydown",j?q:H,j),L&&t.removeEventListener(w,K?B:_,K),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[m,f,s,l,b,L,w,r,o,I,h,N,F,H,j,q,_,K,B]),u.useEffect((()=>{A.current=!1}),[L,w]),u.useMemo((()=>h?{reference:{onKeyDown:H,[Et[R]]:e=>{x&&o(!1,e.nativeEvent,"reference-press")}},floating:{onKeyDown:H,onMouseDown(){D.current=!0},onMouseUp(){D.current=!0},[wt[w]]:()=>{A.current=!0}}}:{}),[h,x,w,R,o,H])},e.useFloating=function(e){var t;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:i}=e,[l,s]=u.useState(null),a=(null==(t=e.elements)?void 0:t.reference)||l,f=n.useFloating(e),v=ye(),m=null!=he(),p=c(((e,t,n)=>{e&&(h.current.openEvent=t),y.emit("openchange",{open:e,event:t,reason:n,nested:m}),null==o||o(e,t,n)})),g=u.useRef(null),h=u.useRef({}),y=u.useState((()=>me()))[0],b=de(),E=u.useCallback((e=>{const t=d(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;f.refs.setReference(t)}),[f.refs]),w=u.useCallback((e=>{(d(e)||null===e)&&(g.current=e,s(e)),(d(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!d(e))&&f.refs.setReference(e)}),[f.refs]),x=u.useMemo((()=>({...f.refs,setReference:w,setPositionReference:E,domReference:g})),[f.refs,w,E]),R=u.useMemo((()=>({...f.elements,domReference:a})),[f.elements,a]),I=u.useMemo((()=>({...f,refs:x,elements:R,dataRef:h,nodeId:i,floatingId:b,events:y,open:r,onOpenChange:p})),[f,i,b,y,r,p,x,R]);return Z((()=>{const e=null==v?void 0:v.nodesRef.current.find((e=>e.id===i));e&&(e.context=I)})),u.useMemo((()=>({...f,context:I,refs:x,elements:R})),[f,x,R,I])},e.useFloatingNodeId=function(e){const t=de(),n=ye(),r=he(),o=e||r;return Z((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t},e.useFloatingParentNodeId=he,e.useFloatingPortalNode=ct,e.useFloatingTree=ye,e.useFocus=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,refs:i,elements:{floating:l,domReference:c}}=e,{enabled:s=!0,visibleOnly:f=!0}=t,m=u.useRef(!1),p=u.useRef(),g=u.useRef(!0);return u.useEffect((()=>{if(!s)return;const e=a(c);function t(){!n&&v(c)&&c===h(C(c))&&(m.current=!0)}function r(){g.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[c,n,s]),u.useEffect((()=>{if(s)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(m.current=!0)}}),[o,s]),u.useEffect((()=>()=>{clearTimeout(p.current)}),[]),u.useMemo((()=>s?{reference:{onPointerDown(e){x(e.nativeEvent)||(g.current=!1)},onMouseLeave(){m.current=!1},onFocus(e){if(m.current)return;const t=T(e.nativeEvent);if(f&&d(t))try{if(R()&&k())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!g.current&&!P(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){m.current=!1;const t=e.relatedTarget,n=d(t)&&t.hasAttribute(be("focus-guard"))&&"outside"===t.getAttribute("data-type");p.current=window.setTimeout((()=>{const o=h(c?c.ownerDocument:document);(t||o!==c)&&(y(i.floating.current,t)||y(c,t)||n||r(!1,e.nativeEvent,"focus"))}))}}}:{}),[s,f,c,i,r])},e.useHover=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:l,floating:c},refs:s}=e,{enabled:a=!0,delay:f=0,handleClose:v=null,mouseOnly:m=!1,restMs:p=0,move:g=!0}=t,h=ye(),b=he(),E=Ee(v),w=Ee(f),x=u.useRef(),R=u.useRef(),I=u.useRef(),k=u.useRef(),M=u.useRef(!0),T=u.useRef(!1),S=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(a)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(R.current),clearTimeout(k.current),M.current=!0)}}),[a,i]),u.useEffect((()=>{if(!a||!E.current||!n)return;function e(e){P()&&r(!1,e,"hover")}const t=C(c).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[c,n,r,a,E,P]);const L=u.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=xe(w.current,"close",x.current);o&&!I.current?(clearTimeout(R.current),R.current=setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(R.current),r(!1,e,n))}),[w,r]),A=u.useCallback((()=>{S.current(),I.current=void 0}),[]),D=u.useCallback((()=>{if(T.current){const e=C(s.floating.current).body;e.style.pointerEvents="",e.removeAttribute(we),T.current=!1}}),[s]);return u.useEffect((()=>{if(a&&d(l)){const e=l;return n&&e.addEventListener("mouseleave",s),null==c||c.addEventListener("mouseleave",s),g&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",i),()=>{n&&e.removeEventListener("mouseleave",s),null==c||c.removeEventListener("mouseleave",s),g&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(R.current),M.current=!1,m&&!O(x.current)||p>0&&0===xe(w.current,"open"))return;const t=xe(w.current,"open",x.current);t?R.current=setTimeout((()=>{r(!0,e,"hover")}),t):r(!0,e,"hover")}function i(r){if(t())return;S.current();const o=C(c);if(clearTimeout(k.current),E.current){n||clearTimeout(R.current),I.current=E.current({...e,tree:h,x:r.clientX,y:r.clientY,onClose(){D(),A(),L(r,!0,"safe-polygon")}});const t=I.current;return o.addEventListener("mousemove",t),void(S.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==x.current||!y(c,r.relatedTarget))&&L(r)}function s(n){t()||null==E.current||E.current({...e,tree:h,x:n.clientX,y:n.clientY,onClose(){D(),A(),L(n)}})(n)}}),[l,c,a,e,m,p,g,L,A,D,r,n,h,w,E,o]),Z((()=>{var e;if(a&&n&&null!=(e=E.current)&&e.__options.blockPointerEvents&&P()){const e=C(c).body;if(e.setAttribute(we,""),e.style.pointerEvents="none",T.current=!0,d(l)&&c){var t;const e=l,n=null==h||null==(t=h.nodesRef.current.find((e=>e.id===b)))||null==(t=t.context)?void 0:t.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",c.style.pointerEvents="auto",()=>{e.style.pointerEvents="",c.style.pointerEvents=""}}}}),[a,n,b,c,l,h,E,P]),Z((()=>{n||(x.current=void 0,A(),D())}),[n,A,D]),u.useEffect((()=>()=>{A(),clearTimeout(R.current),clearTimeout(k.current),D()}),[a,l,A,D]),u.useMemo((()=>{if(!a)return{};function e(e){x.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===p||(clearTimeout(k.current),k.current=setTimeout((()=>{M.current||r(!0,e.nativeEvent,"hover")}),p))}},floating:{onMouseEnter(){clearTimeout(R.current)},onMouseLeave(e){L(e.nativeEvent,!1)}}}}),[a,p,n,r,L])},e.useId=de,e.useInnerOffset=function(e,t){const{open:n,elements:o}=e,{enabled:i=!0,overflowRef:l,scrollRef:s,onChange:a}=t,f=c(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==l.current)return;const n=e.deltaY,o=l.current.top>=-.5,u=l.current.bottom>=-.5,i=t.scrollHeight-t.clientHeight,c=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*c)))}))):/firefox/i.test(E())&&(t.scrollTop+=n))}const t=(null==s?void 0:s.current)||o.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{v.current=t.scrollTop,null!=l.current&&(m.current={...l.current})})),()=>{v.current=null,m.current=null,t.removeEventListener("wheel",e)}):void 0}),[i,n,o.floating,l,s,f]),u.useMemo((()=>i?{floating:{onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const e=(null==s?void 0:s.current)||o.floating;if(l.current&&e&&d.current){if(null!==v.current){const t=e.scrollTop-v.current;(l.current.bottom<-.5&&t<-1||l.current.top<-.5&&t>1)&&r.flushSync((()=>f((e=>e+t))))}requestAnimationFrame((()=>{v.current=e.scrollTop}))}}}}:{}),[i,l,o.floating,s,f])},e.useInteractions=function(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>kt(t,e,"reference")),t),r=u.useCallback((t=>kt(t,e,"floating")),t),o=u.useCallback((t=>kt(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=ee,e.useListNavigation=function(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:i,floating:l}}=e,{listRef:s,activeIndex:a,onNavigate:f=(()=>{}),enabled:d=!0,selectedIndex:m=null,allowEscape:p=!1,loop:g=!1,nested:b=!1,rtl:E=!1,virtual:I=!1,focusItemOnOpen:O="auto",focusItemOnHover:M=!0,openOnArrowKeyDown:T=!0,disabledIndices:S,orientation:P="vertical",cols:D=1,scrollItemIntoView:N=!0,virtualItemRef:H,itemSizes:V,dense:$=!1}=t,Q=he(),J=ye(),ee=c(f),te=u.useRef(O),ne=u.useRef(null!=m?m:-1),re=u.useRef(null),oe=u.useRef(!0),ue=u.useRef(ee),ie=u.useRef(!!l),le=u.useRef(!1),ce=u.useRef(!1),se=Ee(S),ae=Ee(n),fe=Ee(N),[de,ve]=u.useState(),[me,pe]=u.useState(),ge=c((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(I?(ve(r.id),null==J||J.events.emit("virtualfocus",r),H&&(H.current=r)):G(r,{preventScroll:!0,sync:!(!k()||!R())&&(Ot||le.current)}),requestAnimationFrame((()=>{const e=fe.current;e&&r&&(n||!oe.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));Z((()=>{document.createElement("div").focus({get preventScroll(){return Ot=!0,!1}})}),[]),Z((()=>{d&&(n&&l?te.current&&null!=m&&(ce.current=!0,ne.current=m,ee(m)):ie.current&&(ne.current=-1,ue.current(null)))}),[d,n,l,m,ee]),Z((()=>{if(d&&n&&l)if(null==a){if(le.current=!1,null!=m)return;if(ie.current&&(ne.current=-1,ge(s,ne)),!ie.current&&te.current&&(null!=re.current||!0===te.current&&null==re.current)){let e=0;const t=()=>{if(null==s.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else ne.current=null==re.current||Tt(re.current,P,E)||b?_(s,se.current):B(s,se.current),re.current=null,ee(ne.current)};t()}}else q(s,a)||(ne.current=a,ge(s,ne,ce.current),ce.current=!1)}),[d,n,l,a,m,b,s,P,E,ee,ge,se]),Z((()=>{var e;if(!d||l||!J||I||!ie.current)return;const t=J.nodesRef.current,n=null==(e=t.find((e=>e.id===Q)))||null==(e=e.context)?void 0:e.elements.floating,r=h(C(l)),o=t.some((e=>e.context&&y(e.context.elements.floating,r)));n&&!o&&oe.current&&n.focus({preventScroll:!0})}),[d,l,J,Q,I]),Z((()=>{if(d&&J&&I&&!Q)return J.events.on("virtualfocus",e),()=>{J.events.off("virtualfocus",e)};function e(e){pe(e.id),H&&(H.current=e)}}),[d,J,I,Q,H]),Z((()=>{ue.current=ee,ie.current=!!l})),Z((()=>{n||(re.current=null)}),[n]);const be=null!=a,we=u.useMemo((()=>{function e(e){if(!n)return;const t=s.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})},...M&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;oe.current&&"touch"!==t&&(ne.current=-1,ge(s,ne),ee(null),I||G(o.floating.current,{preventScroll:!0}))}}}}),[n,o,ge,M,s,ee,I]);return u.useMemo((()=>{if(!d)return{};const e=se.current;function t(t){if(oe.current=!1,le.current=!0,!ae.current&&t.currentTarget===o.floating.current)return;if(b&&St(t.key,P,E))return L(t),r(!1,t.nativeEvent,"list-navigation"),void(v(i)&&!I&&i.focus());const u=ne.current,l=_(s,e),c=B(s,e);if("Home"===t.key&&(L(t),ne.current=l,ee(ne.current)),"End"===t.key&&(L(t),ne.current=c,ee(ne.current)),D>1){const n=V||Array.from({length:s.current.length},(()=>({width:1,height:1}))),r=z(n,D,$),o=r.findIndex((t=>null!=t&&!(null!=e&&e.includes(t)))),u=r.reduce(((t,n,r)=>null==n||null!=e&&e.includes(n)?t:r),-1);if(ne.current=r[U({current:r.map((e=>null!=e?s.current[e]:null))},{event:t,orientation:P,loop:g,cols:D,disabledIndices:Y([...e||[],void 0],r),minIndex:o,maxIndex:u,prevIndex:X(ne.current,n,r,D,t.key===F?"bl":t.key===K?"tr":"tl"),stopEvent:!0})],ee(ne.current),"both"===P)return}if(Mt(t.key,P)){if(L(t),n&&!I&&h(t.currentTarget.ownerDocument)===t.currentTarget)return ne.current=Tt(t.key,P,E)?l:c,void ee(ne.current);Tt(t.key,P,E)?ne.current=g?u>=c?p&&u!==s.current.length?-1:l:W(s,{startingIndex:u,disabledIndices:e}):Math.min(c,W(s,{startingIndex:u,disabledIndices:e})):ne.current=g?u<=l?p&&-1!==u?s.current.length:c:W(s,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(l,W(s,{startingIndex:u,decrement:!0,disabledIndices:e})),q(s,ne.current)?ee(null):ee(ne.current)}}function u(e){"auto"===O&&w(e.nativeEvent)&&(te.current=!0)}const l=I&&n&&be&&{"aria-activedescendant":me||de},c=s.current.find((e=>(null==e?void 0:e.id)===de));return{reference:{...l,onKeyDown(o){oe.current=!1;const u=0===o.key.indexOf("Arrow"),i=function(e,t,n){return Ct(t,n?e===j:e===K,e===F)}(o.key,P,E),l=St(o.key,P,E),a=Mt(o.key,P),f=(b?i:a)||"Enter"===o.key||""===o.key.trim();if(I&&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),We(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&&H){const e=new KeyboardEvent("keydown",{key:o.key,bubbles:!0});if(i||l){var d,v;const t=(null==(d=n.context)?void 0:d.elements.domReference)===o.currentTarget,r=l&&!t?null==(v=n.context)?void 0:v.elements.domReference:i?c:null;r&&(L(o),r.dispatchEvent(e),pe(void 0))}var p;if(a&&n.context)if(n.context.open&&n.parentId&&o.currentTarget!==n.context.elements.domReference)return L(o),void(null==(p=n.context.elements.domReference)||p.dispatchEvent(e))}return t(o)}(n||T||!u)&&(f&&(re.current=b&&a?null:o.key),b?i&&(L(o),n?(ne.current=_(s,e),ee(ne.current)):r(!0,o.nativeEvent,"list-navigation")):a&&(null!=m&&(ne.current=m),L(o),!n&&T?r(!0,o.nativeEvent,"list-navigation"):t(o),n&&ee(ne.current)))},onFocus(){n&&ee(null)},onPointerDown:function(e){te.current=O,"auto"===O&&x(e.nativeEvent)&&(te.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===P?void 0:P,...!A(i)&&l,onKeyDown:t,onPointerMove(){oe.current=!0}},item:we}}),[i,o,de,me,se,ae,s,d,P,E,I,n,be,b,m,T,p,D,g,O,ee,r,we,J,H,V,$])},e.useMergeRefs=i,e.useRole=function(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:l="dialog"}=t,c=null!=(n=Pt.get(l))?n:l,s=de(),a=null!=he();return u.useMemo((()=>{if(!i)return{};const e={id:o,...c&&{role:c}};return"tooltip"===c||"label"===l?{reference:{["aria-"+("label"===l?"labelledby":"describedby")]:r?o:void 0},floating:e}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===c?"dialog":c,"aria-controls":r?o:void 0,..."listbox"===c&&{role:"combobox"},..."menu"===c&&{id:s},..."menu"===c&&a&&{role:"menuitem"},..."select"===l&&{"aria-autocomplete":"none"},..."combobox"===l&&{"aria-autocomplete":"list"}},floating:{...e,..."menu"===c&&{"aria-labelledby":s}},item(e){let{active:t,selected:n}=e;const r={role:"option",...t&&{id:o+"-option"}};switch(l){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}}}),[i,l,c,r,o,s,a])},e.useTransitionStatus=Dt,e.useTransitionStyles=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:l=250}=t,c=e.placement,s=c.split("-")[0],a=u.useMemo((()=>({side:s,placement:c})),[s,c]),f="number"==typeof l,d=(f?l:l.open)||0,v=(f?l:l.close)||0,[m,p]=u.useState((()=>({...At(i,a),...At(n,a)}))),{isMounted:g,status:h}=Dt(e,{duration:l}),y=Ee(n),b=Ee(r),E=Ee(o),w=Ee(i);return Z((()=>{const e=At(y.current,a),t=At(E.current,a),n=At(w.current,a),r=At(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(Lt).join(","),transitionDuration:d+"ms",...n,...r}),"close"===h){const r=t||e;p({transitionProperty:Object.keys(r).map(Lt).join(","),transitionDuration:v+"ms",...n,...r})}}),[v,E,y,b,w,d,h,a]),{isMounted:g,styles:m}},e.useTypeahead=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:l,onMatch:s,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:l)?n:-1),b=u.useRef(null),E=c(s),w=c(a),x=Ee(d),R=Ee(m);return Z((()=>{r&&(clearTimeout(g.current),b.current=null,h.current="")}),[r]),Z((()=>{var e;r&&""===h.current&&(y.current=null!=(e=null!=p?p:l)?e:-1)}),[r,p,l]),u.useMemo((()=>{if(!f)return{};function e(e){e?o.current.typing||(o.current.typing=e,w(e)):o.current.typing&&(o.current.typing=e,w(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&&L(n)),null==o||R.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(L(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,l=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],h.current);-1!==l?(E(l),b.current=l):" "!==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,E,w])}}));
var ke=["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(","),Oe="undefined"==typeof Element,Ce=Oe?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Me=!Oe&&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},Te=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)},Se=function e(t,n,r){for(var o=[],u=Array.from(t);u.length;){var i=u.shift();if(!Te(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{Ce.call(i,ke)&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),a=!Te(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},Pe=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Le=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))&&!Pe(e)?0:e.tabIndex},Ae=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},De=function(e){return"INPUT"===e.tagName},Ne=function(e){return function(e){return De(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Me(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)},Fe=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},je=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Ce.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Ce.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Fe(e)}else{if("function"==typeof r){for(var u=e;e;){var i=e.parentElement,c=Me(e);if(i&&!i.shadowRoot&&!0===r(i))return Fe(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&&Me(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=Me(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},Ke=function(e,t){return!(t.disabled||Te(t)||function(e){return De(e)&&"hidden"===e.type}(t)||je(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!!Ce.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},He=function(e,t){return!(Ne(t)||Le(t)<0||!Ke(e,t))},qe=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},_e=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=Le(e);return n<0&&t&&!Pe(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(Ae).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Be=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Se([e],t.includeContainer,{filter:He.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:qe}):function(e,t,n){if(Te(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ke));return t&&Ce.call(e,ke)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,He.bind(null,t)),_e(n)};function We(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 Ue=new WeakMap,ze=new WeakSet,Xe={},Ye=0;const Ve=e=>e&&(e.host||Ve(e.parentNode)),Ge=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=Ve(t);return e.contains(n)?n:null})).filter((e=>null!=e));function Ze(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=C(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",u=r?"inert":n?"aria-hidden":null,i=Ge(t,e),c=new Set,l=new Set(i),s=[];Xe[o]||(Xe[o]=new WeakMap);const a=Xe[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)&&Array.prototype.forEach.call(t.children,(t=>{if(c.has(t))e(t);else{const e=u?t.getAttribute(u):null,n=null!==e&&"false"!==e,r=(Ue.get(t)||0)+1,i=(a.get(t)||0)+1;Ue.set(t,r),a.set(t,i),s.push(t),1===r&&n&&ze.add(t),1===i&&t.setAttribute(o,""),!n&&u&&t.setAttribute(u,"true")}}))}(t),c.clear(),Ye++,()=>{s.forEach((e=>{const t=(Ue.get(e)||0)-1,n=(a.get(e)||0)-1;Ue.set(e,t),a.set(e,n),t||(!ze.has(e)&&u&&e.removeAttribute(u),ze.delete(e)),n||e.removeAttribute(o)})),Ye--,Ye||(Ue=new WeakMap,Ue=new WeakMap,ze=new WeakSet,Xe={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const $e=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Qe(e,t){const n=Be(e,$e());"prev"===t&&n.reverse();const r=n.indexOf(h(C(e)));return n.slice(r+1)[0]}function Je(){return Qe(document.body,"next")}function et(){return Qe(document.body,"prev")}function tt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!y(n,r)}function nt(e){Be(e,$e()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function rt(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 ot={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function ut(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const it=u.forwardRef((function(e,t){const[n,r]=u.useState();Z((()=>(R()&&r("button"),document.addEventListener("keydown",ut),()=>{document.removeEventListener("keydown",ut)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[be("focus-guard")]:"",style:ot};return u.createElement("span",le({},e,o))})),ct=u.createContext(null),lt=be("portal");function st(e){let{id:t,root:n}=void 0===e?{}:e;const[r,o]=u.useState(null),i=de(),c=at(),l=u.useRef(null);return Z((()=>()=>{null==r||r.remove(),queueMicrotask((()=>{l.current=null}))}),[r]),Z((()=>{if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=i,n.setAttribute(lt,""),e.appendChild(n),l.current=n,o(n)}),[t,i]),Z((()=>{if(l.current)return;let e=n||(null==c?void 0:c.portalNode);e&&!d(e)&&(e=e.current),e=e||document.body;let r=null;t&&(r=document.createElement("div"),r.id=t,e.appendChild(r));const u=document.createElement("div");u.id=i,u.setAttribute(lt,""),e=r||e,e.appendChild(u),l.current=u,o(u)}),[t,n,i,c]),r}const at=()=>u.useContext(ct),ft=20;let dt=[];function vt(e){dt=dt.filter((e=>e.isConnected)),e&&"body"!==s(e)&&(dt.push(e),dt.length>ft&&(dt=dt.slice(-ft)))}function mt(){return dt.slice().reverse().find((e=>e.isConnected))}const pt=u.forwardRef((function(e,t){return u.createElement("button",le({},e,{type:"button",ref:t,tabIndex:-1,style:ot}))}));const gt=new Set,ht=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;const o=de();return Z((()=>{if(!n)return;gt.add(o);const e=/iP(hone|ad|od)|iOS/.test(b()),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()=>{gt.delete(o),0===gt.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(i,c)))}}),[o,n]),u.createElement("div",le({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function yt(e){return v(e.target)&&"BUTTON"===e.target.tagName}function bt(e){return P(e)}function Et(e){return null!=e&&null!=e.clientX}const wt={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},xt={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Rt=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}};const It="active",kt="selected";function Ot(e,t,n){const r=new Map,o="item"===n;let u=e;if(o&&e){const{[It]:t,[kt]: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&&[It,kt].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 Ct=!1;function Mt(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Tt(e,t){return Mt(t,e===N||e===F,e===j||e===K)}function St(e,t,n){return Mt(t,e===F,n?e===j:e===K)||"Enter"===e||" "===e||""===e}function Pt(e,t,n){return Mt(t,n?e===K:e===j,e===N)}const Lt=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const At=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Dt(e,t){return"function"==typeof e?e(t):e}function Nt(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(!1),[s,a]=u.useState("unmounted"),f=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return Z((()=>{c&&!f&&a("unmounted")}),[c,f]),Z((()=>{if(r){if(n){a("initial");const e=requestAnimationFrame((()=>{a("open")}));return()=>{cancelAnimationFrame(e)}}l(!0),a("close")}}),[n,r]),{isMounted:f,status:s}}function Ft(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function jt(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=ie,e.CompositeItem=ce,e.FloatingArrow=ve,e.FloatingDelayGroup=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[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 Z((()=>{o.currentId?null===c.current?c.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),c.current=null)}),[o.currentId]),u.createElement(Re.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,modal:s=!0,visuallyHiddenDismiss:a=!1,closeOnFocusOut:f=!0}=e,{open:d,refs:m,nodeId:p,onOpenChange:g,events:b,dataRef:E,elements:{domReference:R,floating:I}}=t,k="number"==typeof c&&c<0,O=A(R)&&k,M="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||i,S=Ee(o),P=Ee(c),D=Ee(l),N=ye(),F=at(),j=u.useRef(null),K=u.useRef(null),H=u.useRef(!1),q=u.useRef(!1),_=null!=F,B=u.useCallback((function(e){return void 0===e&&(e=I),e?Be(e,$e()):[]}),[I]),W=u.useCallback((e=>{const t=B(e);return S.current.map((e=>R&&"reference"===e?R:I&&"floating"===e?I:t)).filter(Boolean).flat()}),[R,I,S,B]);function U(e){return!r&&a&&s?u.createElement(pt,{ref:"start"===e?j:K,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof a?a:"Dismiss"):null}u.useEffect((()=>{if(r||!s)return;function e(e){if("Tab"===e.key){y(I,h(C(I)))&&0===B().length&&!O&&L(e);const t=W(),n=T(e);"reference"===S.current[0]&&n===R&&(L(e),e.shiftKey?G(t[t.length-1]):G(t[1])),"floating"===S.current[1]&&n===I&&e.shiftKey&&(L(e),G(t[0]))}}const t=C(I);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,R,I,s,S,O,B,W]),u.useEffect((()=>{if(!r&&f)return I&&v(R)?(R.addEventListener("focusout",t),R.addEventListener("pointerdown",e),!s&&I.addEventListener("focusout",t),()=>{R.removeEventListener("focusout",t),R.removeEventListener("pointerdown",e),!s&&I.removeEventListener("focusout",t)}):void 0;function e(){q.current=!0,setTimeout((()=>{q.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(y(R,t)||y(I,t)||y(t,I)||y(null==F?void 0:F.portalNode,t)||null!=t&&t.hasAttribute(be("focus-guard"))||N&&(We(N.nodesRef.current,p).find((e=>{var n,r;return y(null==(n=e.context)?void 0:n.elements.floating,t)||y(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}(N.nodesRef.current,p).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}))));t&&n&&!q.current&&t!==mt()&&(H.current=!0,g(!1,e))}))}}),[r,R,I,s,p,N,F,g,f]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==F||null==(e=F.portalNode)?void 0:e.querySelectorAll("["+be("portal")+"]"))||[]);if(I){const e=[I,...t,j.current,K.current,S.current.includes("reference")||O?R:null].filter((e=>null!=e)),n=s||O?Ze(e,M,!M):Ze(e);return()=>{n()}}}),[r,R,I,s,S,F,O,M]),Z((()=>{if(r||!I)return;const e=h(C(I));queueMicrotask((()=>{const t=W(I),n=P.current,r=("number"==typeof n?t[n]:n.current)||I,o=y(I,e);k||o||!d||G(r,{preventScroll:r===I})}))}),[r,d,I,k,W,P]),Z((()=>{if(r||!I)return;let e=!1;const t=C(I),n=h(t),o=E.current;function u(t){let{reason:n,event:r,nested:o}=t;"escape-key"===n&&m.domReference.current&&vt(m.domReference.current),"hover"===n&&"mouseleave"===r.type&&(H.current=!0),"outside-press"===n&&(o?(H.current=!1,e=!0):H.current=!(w(r)||x(r)))}return vt(n),b.on("openchange",u),()=>{b.off("openchange",u);const n=h(t),r=y(I,n)||N&&We(N.nodesRef.current,p).some((e=>{var t;return y(null==(t=e.context)?void 0:t.elements.floating,n)}));(r||o.openEvent&&["click","mousedown"].includes(o.openEvent.type))&&m.domReference.current&&vt(m.domReference.current);const i=mt();D.current&&!H.current&&v(i)&&(i===n||n===t.body||r)&&G(i,{cancelPrevious:!1,preventScroll:e})}}),[r,I,D,E,m,b,N,p]),Z((()=>{if(!r&&F)return F.setFocusManagerState({modal:s,closeOnFocusOut:f,open:d,onOpenChange:g,refs:m}),()=>{F.setFocusManagerState(null)}}),[r,F,s,d,g,m,f]),Z((()=>{if(r||!I||"function"!=typeof MutationObserver||k)return;const e=()=>{const e=I.getAttribute("tabindex");S.current.includes("floating")||h(C(I))!==m.domReference.current&&0===B().length?"0"!==e&&I.setAttribute("tabindex","0"):"-1"!==e&&I.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(I,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,I,m,S,B,k]);const z=!r&&M&&(_||s);return u.createElement(u.Fragment,null,z&&u.createElement(it,{"data-type":"inside",ref:null==F?void 0:F.beforeInsideRef,onFocus:e=>{if(s){const e=W();G("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=F&&F.preserveTabOrder&&F.portalNode)if(H.current=!1,tt(e,F.portalNode)){const e=Je()||R;null==e||e.focus()}else{var t;null==(t=F.beforeOutsideRef.current)||t.focus()}}}),!O&&U("start"),n,U("end"),z&&u.createElement(it,{"data-type":"inside",ref:null==F?void 0:F.afterInsideRef,onFocus:e=>{if(s)G(W()[0]);else if(null!=F&&F.preserveTabOrder&&F.portalNode)if(f&&(H.current=!0),tt(e,F.portalNode)){const e=et()||R;null==e||e.focus()}else{var t;null==(t=F.afterOutsideRef.current)||t.focus()}}}))},e.FloatingList=J,e.FloatingNode=function(e){let{children:t,id:n}=e;const r=he();return u.createElement(pe.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=ht,e.FloatingPortal=function(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const c=st({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&&tt(e)){("focusin"===e.type?rt:nt)(c)}}}),[c,i,null==l?void 0:l.modal]),u.createElement(ct.Provider,{value:u.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:v,portalNode:c,setFocusManagerState:s})),[i,c])},m&&c&&u.createElement(it,{"data-type":"outside",ref:a,onFocus:e=>{if(tt(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=et()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),m&&c&&u.createElement("span",{"aria-owns":c.id,style:ot}),c&&r.createPortal(t,c),m&&c&&u.createElement(it,{"data-type":"outside",ref:f,onFocus:e=>{if(tt(e,c)){var t;null==(t=v.current)||t.focus()}else{const t=Je()||(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){let{children:t}=e;const 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((()=>me()))[0];return u.createElement(ge.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(Ft(g,h.scrollHeight),d),b=await n.detectOverflow(g,{...d,elementContext:"reference"}),E=Math.max(0,y.top),w=g.y+E,x=Math.max(0,h.scrollHeight-E-Math.max(0,y.bottom));return h.style.maxHeight=x+"px",h.scrollTop=E,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(Ft({...g,y:w},h.offsetHeight),d)),{y:w}}}),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:v,nodeId:m,tree:p}=e;return function(e){function g(){clearTimeout(o),v()}if(clearTimeout(o),!f.domReference||!f.floating||null==a||null==n||null==s)return;const{clientX:h,clientY:b}=e,E=[h,b],w=T(e),x="mouseleave"===e.type,R=y(f.floating,w),I=y(f.domReference,w),k=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),C=a.split("-")[0],M=n>O.right-O.width/2,S=s>O.bottom-O.height/2,P=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(E,k),L=O.width>k.width,A=O.height>k.height,D=(L?k:O).left,N=(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&&d(e.relatedTarget)&&y(f.floating,e.relatedTarget))return;if(p&&We(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=[[D,k.top+1],[D,O.bottom-1],[N,O.bottom-1],[N,k.top+1]];break;case"bottom":K=[[D,O.top+1],[D,k.bottom-1],[N,k.bottom-1],[N,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(!jt([h,b],K)){if(u&&!P)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()}jt([h,b],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:S?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:S?r+4*t:r-4*t];return[...[[S||A?O.right-t:O.left,O.top],[S?A?O.right-t:O.left:O.right-t,O.bottom]],e,o]}case"right":return[[n-t,A?r+t/2:S?r+4*t:r-4*t],[n-t,A?r-t/2:S?r+4*t:r-4*t],...[[S||A?O.left+t:O.right,O.top],[S?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&&(O(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:O(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||yt(e)||(" "!==e.key||bt(i)||(e.preventDefault(),v.current=!0),"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!f||yt(e)||bt(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,refs:r,dataRef:o,elements:{floating:i}}=e,{enabled:c=!0,axis:s="both",x:f=null,y:d=null}=t,v=u.useRef(!1),m=u.useRef(null),[p,g]=u.useState(),[h,b]=u.useState([]),E=l(((e,t)=>{v.current||o.current.openEvent&&!Et(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,i;const c=(null==(u=e.current)?void 0:u.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,a=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let f=c.width,d=c.height,v=c.x,m=c.y;return null==n&&t.x&&l&&(n=c.x-t.x),null==r&&t.y&&s&&(r=c.y-t.y),v-=n||0,m-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?c.width:0,d="x"===t.axis?c.height:0,v=l&&null!=t.x?t.x:v,m=s&&null!=t.y?t.y:m):o&&!a&&(d="x"===t.axis?c.height:d,f="y"===t.axis?c.width:f),o=!0,{width:f,height:d,x:v,y:m,top:m,right:v+f,bottom:m+d,left:v}}}}(r.domReference,{x:e,y:t,axis:s,dataRef:o,pointerType:p}))})),w=l((e=>{null==f&&null==d&&(n?m.current||b([]):E(e.clientX,e.clientY))})),x=O(p)?i:n,R=u.useCallback((()=>{if(!x||!c||null!=f||null!=d)return;const e=a(r.floating.current);function t(n){const o=T(n);y(r.floating.current,o)?(e.removeEventListener("mousemove",t),m.current=null):E(n.clientX,n.clientY)}if(!o.current.openEvent||Et(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),m.current=null};return m.current=n,n}r.setPositionReference(r.domReference.current)}),[o,c,x,r,E,f,d]);return u.useEffect((()=>R()),[R,h]),u.useEffect((()=>{c&&!i&&(v.current=!1)}),[c,i]),u.useEffect((()=>{!c&&n&&(v.current=!0)}),[c,n]),Z((()=>{!c||null==f&&null==d||(v.current=!1,E(f,d))}),[c,f,d,E]),u.useMemo((()=>{if(!c)return{};function e(e){let{pointerType:t}=e;g(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:w,onMouseEnter:w}}}),[c,w])},e.useDelayGroup=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:u,setCurrentId:i,initialDelay:c,setState:l,timeoutMs:s}=Ie();Z((()=>{u&&(l({delay:{open:1,close:xe(c,"close")}}),u!==o&&r(!1))}),[o,r,l,u,c]),Z((()=>{function e(){r(!1),l({delay:c,currentId:null})}if(!n&&u===o){if(s){const t=window.setTimeout(e,s);return()=>{clearTimeout(t)}}e()}}),[n,l,u,o,r,c,s]),Z((()=>{n&&i(o)}),[n,i,o])},e.useDelayGroupContext=Ie,e.useDismiss=function(e,t){void 0===t&&(t={});const{open:r,onOpenChange:o,nodeId:i,elements:{reference:c,domReference:s,floating:f},dataRef:m}=e,{enabled:h=!0,escapeKey:b=!0,outsidePress:E=!0,outsidePressEvent:w="pointerdown",referencePress:x=!1,referencePressEvent:R="pointerdown",ancestorScroll:I=!1,bubbles:k,capture:O}=t,S=ye(),P=l("function"==typeof E?E:()=>!1),L="function"==typeof E?P:E,A=u.useRef(!1),D=u.useRef(!1),{escapeKey:N,outsidePress:F}=Rt(k),{escapeKey:j,outsidePress:K}=Rt(O),H=l((e=>{if(!r||!h||!b||"Escape"!==e.key)return;const t=S?We(S.nodesRef.current,i):[];if(!N&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.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")})),q=l((e=>{var t;const n=()=>{var t;H(e),null==(t=T(e))||t.removeEventListener("keydown",n)};null==(t=T(e))||t.addEventListener("keydown",n)})),_=l((e=>{const t=A.current;A.current=!1;const n=D.current;if(D.current=!1,"click"===w&&n)return;if(t)return;if("function"==typeof L&&!L(e))return;const r=T(e),u="["+be("inert")+"]",c=C(f).querySelectorAll(u);let l=d(r)?r:null;for(;l&&!p(l);){const e=g(l);if(p(e)||!d(e))break;l=e}if(c.length&&d(r)&&!r.matches("html,body")&&!y(r,f)&&Array.from(c).every((e=>!y(l,e))))return;if(v(r)&&f){const t=r.clientWidth>0&&r.scrollWidth>r.clientWidth,n=r.clientHeight>0&&r.scrollHeight>r.clientHeight;let o=n&&e.offsetX>r.clientWidth;if(n){const t="rtl"===function(e){return a(e).getComputedStyle(e)}(r).direction;t&&(o=e.offsetX<=r.offsetWidth-r.clientWidth)}if(o||t&&e.offsetY>r.clientHeight)return}const m=S&&We(S.nodesRef.current,i).some((t=>{var n;return M(e,null==(n=t.context)?void 0:n.elements.floating)}));if(M(e,f)||M(e,s)||m)return;const h=S?We(S.nodesRef.current,i):[];if(h.length>0){let e=!0;if(h.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),B=l((e=>{var t;const n=()=>{var t;_(e),null==(t=T(e))||t.removeEventListener(w,n)};null==(t=T(e))||t.addEventListener(w,n)}));return u.useEffect((()=>{if(!r||!h)return;function e(e){o(!1,e,"ancestor-scroll")}m.current.__escapeKeyBubbles=N,m.current.__outsidePressBubbles=F;const t=C(f);b&&t.addEventListener("keydown",j?q:H,j),L&&t.addEventListener(w,K?B:_,K);let u=[];return I&&(d(s)&&(u=n.getOverflowAncestors(s)),d(f)&&(u=u.concat(n.getOverflowAncestors(f))),!d(c)&&c&&c.contextElement&&(u=u.concat(n.getOverflowAncestors(c.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})})),()=>{b&&t.removeEventListener("keydown",j?q:H,j),L&&t.removeEventListener(w,K?B:_,K),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[m,f,s,c,b,L,w,r,o,I,h,N,F,H,j,q,_,K,B]),u.useEffect((()=>{A.current=!1}),[L,w]),u.useMemo((()=>h?{reference:{onKeyDown:H,[wt[R]]:e=>{x&&o(!1,e.nativeEvent,"reference-press")}},floating:{onKeyDown:H,onMouseDown(){D.current=!0},onMouseUp(){D.current=!0},[xt[w]]:()=>{A.current=!0}}}:{}),[h,x,w,R,o,H])},e.useFloating=function(e){var t;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:i}=e,[c,s]=u.useState(null),a=(null==(t=e.elements)?void 0:t.reference)||c,f=n.useFloating(e),v=ye(),m=null!=he(),p=l(((e,t,n)=>{e&&(h.current.openEvent=t),y.emit("openchange",{open:e,event:t,reason:n,nested:m}),null==o||o(e,t,n)})),g=u.useRef(null),h=u.useRef({}),y=u.useState((()=>me()))[0],b=de(),E=u.useCallback((e=>{const t=d(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;f.refs.setReference(t)}),[f.refs]),w=u.useCallback((e=>{(d(e)||null===e)&&(g.current=e,s(e)),(d(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!d(e))&&f.refs.setReference(e)}),[f.refs]),x=u.useMemo((()=>({...f.refs,setReference:w,setPositionReference:E,domReference:g})),[f.refs,w,E]),R=u.useMemo((()=>({...f.elements,domReference:a})),[f.elements,a]),I=u.useMemo((()=>({...f,refs:x,elements:R,dataRef:h,nodeId:i,floatingId:b,events:y,open:r,onOpenChange:p})),[f,i,b,y,r,p,x,R]);return Z((()=>{const e=null==v?void 0:v.nodesRef.current.find((e=>e.id===i));e&&(e.context=I)})),u.useMemo((()=>({...f,context:I,refs:x,elements:R})),[f,x,R,I])},e.useFloatingNodeId=function(e){const t=de(),n=ye(),r=he(),o=e||r;return Z((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t},e.useFloatingParentNodeId=he,e.useFloatingPortalNode=st,e.useFloatingTree=ye,e.useFocus=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,refs:i,elements:{domReference:c}}=e,{enabled:l=!0,visibleOnly:s=!0}=t,f=u.useRef(!1),m=u.useRef(),p=u.useRef(!0);return u.useEffect((()=>{if(!l)return;const e=a(c);function t(){!n&&v(c)&&c===h(C(c))&&(f.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||(f.current=!0)}}),[o,l]),u.useEffect((()=>()=>{clearTimeout(m.current)}),[]),u.useMemo((()=>l?{reference:{onPointerDown(e){x(e.nativeEvent)||(p.current=!1)},onMouseLeave(){f.current=!1},onFocus(e){if(f.current)return;const t=T(e.nativeEvent);if(s&&d(t))try{if(R()&&k())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!p.current&&!P(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){f.current=!1;const t=e.relatedTarget,n=d(t)&&t.hasAttribute(be("focus-guard"))&&"outside"===t.getAttribute("data-type");m.current=window.setTimeout((()=>{const o=h(c?c.ownerDocument:document);(t||o!==c)&&(y(i.floating.current,t)||y(c,t)||n||r(!1,e.nativeEvent,"focus"))}))}}}:{}),[l,s,c,i,r])},e.useHover=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:c,floating:l},refs:s}=e,{enabled:a=!0,delay:f=0,handleClose:v=null,mouseOnly:m=!1,restMs:p=0,move:g=!0}=t,h=ye(),b=he(),E=Ee(v),w=Ee(f),x=u.useRef(),R=u.useRef(),I=u.useRef(),k=u.useRef(),M=u.useRef(!0),T=u.useRef(!1),S=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(a)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(R.current),clearTimeout(k.current),M.current=!0)}}),[a,i]),u.useEffect((()=>{if(!a||!E.current||!n)return;function e(e){P()&&r(!1,e,"hover")}const t=C(l).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[l,n,r,a,E,P]);const L=u.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=xe(w.current,"close",x.current);o&&!I.current?(clearTimeout(R.current),R.current=setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(R.current),r(!1,e,n))}),[w,r]),A=u.useCallback((()=>{S.current(),I.current=void 0}),[]),D=u.useCallback((()=>{if(T.current){const e=C(s.floating.current).body;e.style.pointerEvents="",e.removeAttribute(we),T.current=!1}}),[s]);return u.useEffect((()=>{if(a&&d(c)){const e=c;return n&&e.addEventListener("mouseleave",s),null==l||l.addEventListener("mouseleave",s),g&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",i),()=>{n&&e.removeEventListener("mouseleave",s),null==l||l.removeEventListener("mouseleave",s),g&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(R.current),M.current=!1,m&&!O(x.current)||p>0&&0===xe(w.current,"open"))return;const t=xe(w.current,"open",x.current);t?R.current=setTimeout((()=>{r(!0,e,"hover")}),t):r(!0,e,"hover")}function i(r){if(t())return;S.current();const o=C(l);if(clearTimeout(k.current),E.current){n||clearTimeout(R.current),I.current=E.current({...e,tree:h,x:r.clientX,y:r.clientY,onClose(){D(),A(),L(r,!0,"safe-polygon")}});const t=I.current;return o.addEventListener("mousemove",t),void(S.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==x.current||!y(l,r.relatedTarget))&&L(r)}function s(n){t()||null==E.current||E.current({...e,tree:h,x:n.clientX,y:n.clientY,onClose(){D(),A(),L(n)}})(n)}}),[c,l,a,e,m,p,g,L,A,D,r,n,h,w,E,o]),Z((()=>{var e;if(a&&n&&null!=(e=E.current)&&e.__options.blockPointerEvents&&P()){const e=C(l).body;if(e.setAttribute(we,""),e.style.pointerEvents="none",T.current=!0,d(c)&&l){var t;const e=c,n=null==h||null==(t=h.nodesRef.current.find((e=>e.id===b)))||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,b,l,c,h,E,P]),Z((()=>{n||(x.current=void 0,A(),D())}),[n,A,D]),u.useEffect((()=>()=>{A(),clearTimeout(R.current),clearTimeout(k.current),D()}),[a,c,A,D]),u.useMemo((()=>{if(!a)return{};function e(e){x.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===p||(clearTimeout(k.current),k.current=setTimeout((()=>{M.current||r(!0,e.nativeEvent,"hover")}),p))}},floating:{onMouseEnter(){clearTimeout(R.current)},onMouseLeave(e){L(e.nativeEvent,!1)}}}}),[a,p,n,r,L])},e.useId=de,e.useInnerOffset=function(e,t){const{open:n,elements:o}=e,{enabled:i=!0,overflowRef:c,scrollRef:s,onChange:a}=t,f=l(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==s?void 0:s.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,s,f]),u.useMemo((()=>i?{floating:{onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const e=(null==s?void 0:s.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,s,f])},e.useInteractions=function(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>Ot(t,e,"reference")),t),r=u.useCallback((t=>Ot(t,e,"floating")),t),o=u.useCallback((t=>Ot(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=ee,e.useListNavigation=function(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:i,floating:c}}=e,{listRef:s,activeIndex:a,onNavigate:f=(()=>{}),enabled:d=!0,selectedIndex:m=null,allowEscape:p=!1,loop:g=!1,nested:b=!1,rtl:E=!1,virtual:I=!1,focusItemOnOpen:O="auto",focusItemOnHover:M=!0,openOnArrowKeyDown:T=!0,disabledIndices:S,orientation:P="vertical",cols:D=1,scrollItemIntoView:N=!0,virtualItemRef:H,itemSizes:V,dense:$=!1}=t,Q=he(),J=ye(),ee=l(f),te=u.useRef(O),ne=u.useRef(null!=m?m:-1),re=u.useRef(null),oe=u.useRef(!0),ue=u.useRef(ee),ie=u.useRef(!!c),ce=u.useRef(!1),le=u.useRef(!1),se=Ee(S),ae=Ee(n),fe=Ee(N),[de,ve]=u.useState(),[me,pe]=u.useState(),ge=l((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(I?(ve(r.id),null==J||J.events.emit("virtualfocus",r),H&&(H.current=r)):G(r,{preventScroll:!0,sync:!(!k()||!R())&&(Ct||ce.current)}),requestAnimationFrame((()=>{const e=fe.current;e&&r&&(n||!oe.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));Z((()=>{document.createElement("div").focus({get preventScroll(){return Ct=!0,!1}})}),[]),Z((()=>{d&&(n&&c?te.current&&null!=m&&(le.current=!0,ne.current=m,ee(m)):ie.current&&(ne.current=-1,ue.current(null)))}),[d,n,c,m,ee]),Z((()=>{if(d&&n&&c)if(null==a){if(ce.current=!1,null!=m)return;if(ie.current&&(ne.current=-1,ge(s,ne)),!ie.current&&te.current&&(null!=re.current||!0===te.current&&null==re.current)){let e=0;const t=()=>{if(null==s.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else ne.current=null==re.current||St(re.current,P,E)||b?_(s,se.current):B(s,se.current),re.current=null,ee(ne.current)};t()}}else q(s,a)||(ne.current=a,ge(s,ne,le.current),le.current=!1)}),[d,n,c,a,m,b,s,P,E,ee,ge,se]),Z((()=>{var e;if(!d||c||!J||I||!ie.current)return;const t=J.nodesRef.current,n=null==(e=t.find((e=>e.id===Q)))||null==(e=e.context)?void 0:e.elements.floating,r=h(C(c)),o=t.some((e=>e.context&&y(e.context.elements.floating,r)));n&&!o&&oe.current&&n.focus({preventScroll:!0})}),[d,c,J,Q,I]),Z((()=>{if(d&&J&&I&&!Q)return J.events.on("virtualfocus",e),()=>{J.events.off("virtualfocus",e)};function e(e){pe(e.id),H&&(H.current=e)}}),[d,J,I,Q,H]),Z((()=>{ue.current=ee,ie.current=!!c})),Z((()=>{n||(re.current=null)}),[n]);const be=null!=a,we=u.useMemo((()=>{function e(e){if(!n)return;const t=s.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})},...M&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;oe.current&&"touch"!==t&&(ne.current=-1,ge(s,ne),ee(null),I||G(o.floating.current,{preventScroll:!0}))}}}}),[n,o,ge,M,s,ee,I]);return u.useMemo((()=>{if(!d)return{};const e=se.current;function t(t){if(oe.current=!1,ce.current=!0,!ae.current&&t.currentTarget===o.floating.current)return;if(b&&Pt(t.key,P,E))return L(t),r(!1,t.nativeEvent,"list-navigation"),void(v(i)&&!I&&i.focus());const u=ne.current,c=_(s,e),l=B(s,e);if("Home"===t.key&&(L(t),ne.current=c,ee(ne.current)),"End"===t.key&&(L(t),ne.current=l,ee(ne.current)),D>1){const n=V||Array.from({length:s.current.length},(()=>({width:1,height:1}))),r=z(n,D,$),o=r.findIndex((t=>null!=t&&!(null!=e&&e.includes(t)))),u=r.reduce(((t,n,r)=>null==n||null!=e&&e.includes(n)?t:r),-1);if(ne.current=r[U({current:r.map((e=>null!=e?s.current[e]:null))},{event:t,orientation:P,loop:g,cols:D,disabledIndices:Y([...e||[],void 0],r),minIndex:o,maxIndex:u,prevIndex:X(ne.current,n,r,D,t.key===F?"bl":t.key===K?"tr":"tl"),stopEvent:!0})],ee(ne.current),"both"===P)return}if(Tt(t.key,P)){if(L(t),n&&!I&&h(t.currentTarget.ownerDocument)===t.currentTarget)return ne.current=St(t.key,P,E)?c:l,void ee(ne.current);St(t.key,P,E)?ne.current=g?u>=l?p&&u!==s.current.length?-1:c:W(s,{startingIndex:u,disabledIndices:e}):Math.min(l,W(s,{startingIndex:u,disabledIndices:e})):ne.current=g?u<=c?p&&-1!==u?s.current.length:l:W(s,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(c,W(s,{startingIndex:u,decrement:!0,disabledIndices:e})),q(s,ne.current)?ee(null):ee(ne.current)}}function u(e){"auto"===O&&w(e.nativeEvent)&&(te.current=!0)}const c=I&&n&&be&&{"aria-activedescendant":me||de},l=s.current.find((e=>(null==e?void 0:e.id)===de));return{reference:{...c,onKeyDown(o){oe.current=!1;const u=0===o.key.indexOf("Arrow"),i=function(e,t,n){return Mt(t,n?e===j:e===K,e===F)}(o.key,P,E),c=Pt(o.key,P,E),a=Tt(o.key,P),f=(b?i:a)||"Enter"===o.key||""===o.key.trim();if(I&&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),We(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&&H){const e=new KeyboardEvent("keydown",{key:o.key,bubbles:!0});if(i||c){var d,v;const t=(null==(d=n.context)?void 0:d.elements.domReference)===o.currentTarget,r=c&&!t?null==(v=n.context)?void 0:v.elements.domReference:i?l:null;r&&(L(o),r.dispatchEvent(e),pe(void 0))}var p;if(a&&n.context)if(n.context.open&&n.parentId&&o.currentTarget!==n.context.elements.domReference)return L(o),void(null==(p=n.context.elements.domReference)||p.dispatchEvent(e))}return t(o)}(n||T||!u)&&(f&&(re.current=b&&a?null:o.key),b?i&&(L(o),n?(ne.current=_(s,e),ee(ne.current)):r(!0,o.nativeEvent,"list-navigation")):a&&(null!=m&&(ne.current=m),L(o),!n&&T?r(!0,o.nativeEvent,"list-navigation"):t(o),n&&ee(ne.current)))},onFocus(){n&&ee(null)},onPointerDown:function(e){te.current=O,"auto"===O&&x(e.nativeEvent)&&(te.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===P?void 0:P,...!A(i)&&c,onKeyDown:t,onPointerMove(){oe.current=!0}},item:we}}),[i,o,de,me,se,ae,s,d,P,E,I,n,be,b,m,T,p,D,g,O,ee,r,we,J,H,V,$])},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=Lt.get(c))?n:c,s=de(),a=null!=he();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=Nt,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((()=>({...Dt(i,a),...Dt(n,a)}))),{isMounted:g,status:h}=Nt(e,{duration:c}),y=Ee(n),b=Ee(r),E=Ee(o),w=Ee(i);return Z((()=>{const e=Dt(y.current,a),t=Dt(E.current,a),n=Dt(w.current,a),r=Dt(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(At).join(","),transitionDuration:d+"ms",...n,...r}),"close"===h){const r=t||e;p({transitionProperty:Object.keys(r).map(At).join(","),transitionDuration:v+"ms",...n,...r})}}),[v,E,y,b,w,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:s,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),E=l(s),w=l(a),x=Ee(d),R=Ee(m);return Z((()=>{r&&(clearTimeout(g.current),b.current=null,h.current="")}),[r]),Z((()=>{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,w(e)):o.current.typing&&(o.current.typing=e,w(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&&L(n)),null==o||R.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(L(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?(E(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,E,w])}}));
{
"name": "@floating-ui/react",
"version": "0.26.6",
"version": "0.26.7",
"description": "Floating UI for React",

@@ -63,3 +63,3 @@ "publishConfig": {

"tabbable": "^6.0.1",
"@floating-ui/react-dom": "^2.0.6",
"@floating-ui/react-dom": "^2.0.7",
"@floating-ui/utils": "^0.2.1"

@@ -66,0 +66,0 @@ },

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc