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CAAAtS,IACnB,IAAAuS,EAAA,CACA,GAAAvS,CAAA,CACAyR,aAAA,EACA,CACAe,CAAAA,EAAAvR,OAAA,GAAAiQ,EAAAzR,EAAAwB,OAAA,CAAAsR,KACA9S,EAAAwB,OAAA,CAAAsR,EACQE,EAAAC,SAAkB,MAC1BnB,EAAAgB,EACA,GAEA,EACA,EAAG,CAAAb,EAAA3S,EAAAE,EAAA8S,EAAA,EACHxV,EAAA,KACA,KAAAoC,GAAAc,EAAAwB,OAAA,CAAAwQ,YAAA,GACAhS,EAAAwB,OAAA,CAAAwQ,YAAA,IACAF,EAAAvR,GAAA,EACA,GAAAA,CAAA,CACAyR,aAAA,EACA,IAEA,EAAG,CAAA9S,EAAA,EACH,IAAA6T,EAAuB/V,EAAA+C,MAAY,KACnCjD,EAAA,KACAiW,EAAAvR,OAAA,IACA,KACAuR,EAAAvR,OAAA,GACA,GACG,IACH1E,EAAA,KACA,GAAAwF,GAAArE,EAAA,CACA,GAAAoU,EAAA7Q,OAAA,CACA,OAAA6Q,EAAA7Q,OAAA,CAAAc,EAAArE,EAAAyU,GAEAA,GAEA,CACA,EAAG,CAAApQ,EAAArE,EAAAyU,EAAAL,EAAA,EACH,IAAAtQ,EAAe/E,EAAAgF,OAAa,OAC5BM,UAAA6P,EACAlU,SAAAmU,EACA7P,aAAAA,EACAkQ,YAAAA,CACA,GAAG,CAAAlQ,EAAAkQ,EAAA,EACHS,EAAmBlW,EAAAgF,OAAa,OAChCM,UAAAA,EACArE,SAAAA,CACA,GAAG,CAAAqE,EAAArE,EAAA,EACH,OAASjB,EAAAgF,OAAa,OACtB,GAAAzB,CAAA,CACAmS,OAAAA,EACA3Q,KAAAA,EACAmR,SAAAA,EACA5Q,UAAAC,EACAtE,SAAAwU,CACA,GAAG,CAAAlS,EAAAmS,EAAA3Q,EAAAmR,EAAA3Q,EAAAkQ,EAAA,CACH","sources":["webpack://_N_E/./node_modules/@floating-ui/react-dom-interactions/dist/floating-ui.react-dom-interactions.esm.js","webpack://_N_E/./node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js"],"sourcesContent":["import { useFloating as useFloating$1, offset, detectOverflow, getOverflowAncestors } from '@floating-ui/react-dom';\nexport * from '@floating-ui/react-dom';\nimport * as React from 'react';\nimport { useLayoutEffect, useEffect, useRef } from 'react';\nimport { createPortal, flushSync } from 'react-dom';\nimport { tabbable } from 'tabbable';\nimport { hideOthers } from 'aria-hidden';\n\nvar index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\n\nfunction createPubSub() {\n const map = new Map();\n return {\n emit(event, data) {\n var _map$get;\n\n (_map$get = map.get(event)) == null ? void 0 : _map$get.forEach(handler => handler(data));\n },\n\n on(event, listener) {\n map.set(event, [...(map.get(event) || []), listener]);\n },\n\n off(event, listener) {\n map.set(event, (map.get(event) || []).filter(l => l !== listener));\n }\n\n };\n}\n\nlet serverHandoffComplete = false;\nlet count = 0;\n\nconst genId = () => \"floating-ui-\" + count++;\n\nfunction useFloatingId() {\n const [id, setId] = React.useState(() => serverHandoffComplete ? genId() : undefined);\n index(() => {\n if (id == null) {\n setId(genId());\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, []);\n React.useEffect(() => {\n if (!serverHandoffComplete) {\n serverHandoffComplete = true;\n }\n }, []);\n return id;\n} // `toString()` prevents bundlers from trying to `import { useId } from 'react'`\n\n\nconst useReactId = React[/*#__PURE__*/'useId'.toString()];\n/**\n * Uses React 18's built-in `useId()` when available, or falls back to a\n * slightly less performant (requiring a double render) implementation for\n * earlier React versions.\n * @see https://floating-ui.com/docs/useId\n */\n\nconst useId = useReactId != null ? useReactId : useFloatingId;\n\nconst FloatingNodeContext = /*#__PURE__*/React.createContext(null);\nconst FloatingTreeContext = /*#__PURE__*/React.createContext(null);\nconst useFloatingParentNodeId = () => {\n var _React$useContext$id, _React$useContext;\n\n return (_React$useContext$id = (_React$useContext = React.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) != null ? _React$useContext$id : null;\n};\nconst useFloatingTree = () => React.useContext(FloatingTreeContext);\n/**\n * Registers a node into the floating tree, returning its id.\n */\n\nconst useFloatingNodeId = customParentId => {\n const id = useId();\n const tree = useFloatingTree();\n const reactParentId = useFloatingParentNodeId();\n const parentId = customParentId || reactParentId;\n index(() => {\n const node = {\n id,\n parentId\n };\n tree == null ? void 0 : tree.addNode(node);\n return () => {\n tree == null ? void 0 : tree.removeNode(node);\n };\n }, [tree, id, parentId]);\n return id;\n};\n/**\n * Provides parent node context for nested floating elements.\n * @see https://floating-ui.com/docs/FloatingTree\n */\n\nconst FloatingNode = _ref => {\n let {\n children,\n id\n } = _ref;\n const parentId = useFloatingParentNodeId();\n return /*#__PURE__*/React.createElement(FloatingNodeContext.Provider, {\n value: React.useMemo(() => ({\n id,\n parentId\n }), [id, parentId])\n }, children);\n};\n/**\n * Provides context for nested floating elements when they are not children of\n * each other on the DOM (i.e. portalled to a common node, rather than their\n * respective parent).\n * @see https://floating-ui.com/docs/FloatingTree\n */\n\nconst FloatingTree = _ref2 => {\n let {\n children\n } = _ref2;\n const nodesRef = React.useRef([]);\n const addNode = React.useCallback(node => {\n nodesRef.current = [...nodesRef.current, node];\n }, []);\n const removeNode = React.useCallback(node => {\n nodesRef.current = nodesRef.current.filter(n => n !== node);\n }, []);\n const events = React.useState(() => createPubSub())[0];\n return /*#__PURE__*/React.createElement(FloatingTreeContext.Provider, {\n value: React.useMemo(() => ({\n nodesRef,\n addNode,\n removeNode,\n events\n }), [nodesRef, addNode, removeNode, events])\n }, children);\n};\n\nfunction getDocument(floating) {\n var _floating$ownerDocume;\n\n return (_floating$ownerDocume = floating == null ? void 0 : floating.ownerDocument) != null ? _floating$ownerDocume : document;\n}\n\n// Avoid Chrome DevTools blue warning\nfunction getPlatform() {\n const uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.platform) {\n return uaData.platform;\n }\n\n return navigator.platform;\n}\nfunction getUserAgent() {\n const uaData = navigator.userAgentData;\n\n if (uaData && Array.isArray(uaData.brands)) {\n return uaData.brands.map(_ref => {\n let {\n brand,\n version\n } = _ref;\n return brand + \"/\" + version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}\n\nfunction getWindow(value) {\n var _getDocument$defaultV;\n\n return (_getDocument$defaultV = getDocument(value).defaultView) != null ? _getDocument$defaultV : window;\n}\n\nfunction isElement(value) {\n return value ? value instanceof getWindow(value).Element : false;\n}\nfunction isHTMLElement(value) {\n return value ? value instanceof getWindow(value).HTMLElement : false;\n}\nfunction isShadowRoot(node) {\n // Browsers without `ShadowRoot` support\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n const OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n} // License: https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/utils/src/isVirtualEvent.ts\n\nfunction isVirtualClick(event) {\n if (event.mozInputSource === 0 && event.isTrusted) {\n return true;\n }\n\n const androidRe = /Android/i;\n\n if ((androidRe.test(getPlatform()) || androidRe.test(getUserAgent())) && event.pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n\n return event.detail === 0 && !event.pointerType;\n}\nfunction isVirtualPointerEvent(event) {\n return event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType !== 'mouse' || // iOS VoiceOver returns 0.333• for width/height.\n event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0;\n}\nfunction isSafari() {\n // Chrome DevTools does not complain about navigator.vendor\n return /apple/i.test(navigator.vendor);\n}\nfunction isMac() {\n return getPlatform().toLowerCase().startsWith('mac') && !navigator.maxTouchPoints;\n}\n\n// `toString()` prevents bundlers from trying to `import { useInsertionEffect } from 'react'`\nconst useInsertionEffect = React[/*#__PURE__*/'useInsertionEffect'.toString()];\n\nconst useSafeInsertionEffect = useInsertionEffect || (fn => fn());\n\nfunction useEvent(callback) {\n const ref = React.useRef(() => {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error('Cannot call an event handler while rendering.');\n }\n });\n useSafeInsertionEffect(() => {\n ref.current = callback;\n });\n return React.useCallback(function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return ref.current == null ? void 0 : ref.current(...args);\n }, []);\n}\n\nfunction useFloating(_temp) {\n let {\n open = false,\n onOpenChange: unstable_onOpenChange,\n whileElementsMounted,\n placement,\n middleware,\n strategy,\n nodeId\n } = _temp === void 0 ? {} : _temp;\n const [domReference, setDomReference] = React.useState(null);\n const tree = useFloatingTree();\n const domReferenceRef = React.useRef(null);\n const dataRef = React.useRef({});\n const events = React.useState(() => createPubSub())[0];\n const position = useFloating$1({\n placement,\n middleware,\n strategy,\n whileElementsMounted\n });\n const onOpenChange = useEvent(unstable_onOpenChange);\n const refs = React.useMemo(() => ({ ...position.refs,\n domReference: domReferenceRef\n }), [position.refs]);\n const context = React.useMemo(() => ({ ...position,\n refs,\n dataRef,\n nodeId,\n events,\n open,\n onOpenChange,\n _: {\n domReference\n }\n }), [position, nodeId, events, open, onOpenChange, refs, domReference]);\n index(() => {\n const node = tree == null ? void 0 : tree.nodesRef.current.find(node => node.id === nodeId);\n\n if (node) {\n node.context = context;\n }\n });\n const {\n reference\n } = position;\n const setReference = React.useCallback(node => {\n if (isElement(node) || node === null) {\n context.refs.domReference.current = node;\n setDomReference(node);\n }\n\n reference(node);\n }, [reference, context.refs]);\n return React.useMemo(() => ({ ...position,\n context,\n refs,\n reference: setReference\n }), [position, refs, context, setReference]);\n}\n\nfunction mergeProps(userProps, propsList, elementKey) {\n const map = new Map();\n return { ...(elementKey === 'floating' && {\n tabIndex: -1\n }),\n ...userProps,\n ...propsList.map(value => value ? value[elementKey] : null).concat(userProps).reduce((acc, props) => {\n if (!props) {\n return acc;\n }\n\n Object.entries(props).forEach(_ref => {\n let [key, value] = _ref;\n\n if (key.indexOf('on') === 0) {\n if (!map.has(key)) {\n map.set(key, []);\n }\n\n if (typeof value === 'function') {\n var _map$get;\n\n (_map$get = map.get(key)) == null ? void 0 : _map$get.push(value);\n\n acc[key] = function () {\n var _map$get2;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n (_map$get2 = map.get(key)) == null ? void 0 : _map$get2.forEach(fn => fn(...args));\n };\n }\n } else {\n acc[key] = value;\n }\n });\n return acc;\n }, {})\n };\n}\n\nconst useInteractions = function (propsList) {\n if (propsList === void 0) {\n propsList = [];\n }\n\n // The dependencies are a dynamic array, so we can't use the linter's\n // suggestion to add it to the deps array.\n const deps = propsList;\n const getReferenceProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'reference'), // eslint-disable-next-line react-hooks/exhaustive-deps\n deps);\n const getFloatingProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'floating'), // eslint-disable-next-line react-hooks/exhaustive-deps\n deps);\n const getItemProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'item'), // eslint-disable-next-line react-hooks/exhaustive-deps\n deps);\n return React.useMemo(() => ({\n getReferenceProps,\n getFloatingProps,\n getItemProps\n }), [getReferenceProps, getFloatingProps, getItemProps]);\n};\n\nfunction contains(parent, child) {\n if (!parent || !child) {\n return false;\n }\n\n const rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n\n do {\n if (next && parent === next) {\n return true;\n } // @ts-ignore\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}\n\nfunction getChildren(nodes, id) {\n var _nodes$filter;\n\n let allChildren = (_nodes$filter = nodes.filter(node => {\n var _node$context;\n\n return node.parentId === id && ((_node$context = node.context) == null ? void 0 : _node$context.open);\n })) != null ? _nodes$filter : [];\n let currentChildren = allChildren;\n\n while (currentChildren.length) {\n var _nodes$filter2;\n\n currentChildren = (_nodes$filter2 = nodes.filter(node => {\n var _currentChildren;\n\n return (_currentChildren = currentChildren) == null ? void 0 : _currentChildren.some(n => {\n var _node$context2;\n\n return node.parentId === n.id && ((_node$context2 = node.context) == null ? void 0 : _node$context2.open);\n });\n })) != null ? _nodes$filter2 : [];\n allChildren = allChildren.concat(currentChildren);\n }\n\n return allChildren;\n}\n\nfunction getTarget(event) {\n if ('composedPath' in event) {\n return event.composedPath()[0];\n } // TS thinks `event` is of type never as it assumes all browsers support\n // `composedPath()`, but browsers without shadow DOM don't.\n\n\n return event.target;\n}\n\nfunction isPointInPolygon(point, polygon) {\n const [x, y] = point;\n let isInside = false;\n const length = polygon.length;\n\n for (let i = 0, j = length - 1; i < length; j = i++) {\n const [xi, yi] = polygon[i] || [0, 0];\n const [xj, yj] = polygon[j] || [0, 0];\n const intersect = yi >= y !== yj >= y && x <= (xj - xi) * (y - yi) / (yj - yi) + xi;\n\n if (intersect) {\n isInside = !isInside;\n }\n }\n\n return isInside;\n}\n\nfunction safePolygon(_temp) {\n let {\n restMs = 0,\n buffer = 0.5,\n blockPointerEvents = true,\n debug = null\n } = _temp === void 0 ? {} : _temp;\n let timeoutId;\n let polygonIsDestroyed = false;\n\n const fn = _ref => {\n let {\n x,\n y,\n placement,\n refs,\n onClose,\n nodeId,\n tree,\n leave = false\n } = _ref;\n return function onMouseMove(event) {\n clearTimeout(timeoutId);\n\n function close() {\n clearTimeout(timeoutId);\n onClose();\n }\n\n const {\n clientX,\n clientY\n } = event;\n const target = getTarget(event); // If the pointer is over the reference, there is no need to run the logic\n\n if (event.type === 'mousemove' && contains(refs.domReference.current, target)) {\n return;\n } // Prevent overlapping floating element from being stuck in an open-close\n // loop: https://github.com/floating-ui/floating-ui/issues/1910\n\n\n if (event.type === 'mouseleave' && isElement(event.relatedTarget) && contains(refs.floating.current, event.relatedTarget)) {\n return;\n } // If any nested child is open, abort.\n\n\n if (tree && getChildren(tree.nodesRef.current, nodeId).some(_ref2 => {\n let {\n context\n } = _ref2;\n return context == null ? void 0 : context.open;\n })) {\n return;\n } // The cursor landed, so we destroy the polygon logic\n\n\n if (contains(refs.floating.current, target) && !leave) {\n polygonIsDestroyed = true;\n return;\n }\n\n if (!refs.domReference.current || !refs.floating.current || placement == null || x == null || y == null) {\n return;\n }\n\n const refRect = refs.domReference.current.getBoundingClientRect();\n const rect = refs.floating.current.getBoundingClientRect();\n const side = placement.split('-')[0];\n const cursorLeaveFromRight = x > rect.right - rect.width / 2;\n const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2; // If the pointer is leaving from the opposite side, the \"buffer\" logic\n // creates a point where the floating element remains open, but should be\n // ignored.\n // A constant of 1 handles floating point rounding errors.\n\n if (side === 'top' && y >= refRect.bottom - 1 || side === 'bottom' && y <= refRect.top + 1 || side === 'left' && x >= refRect.right - 1 || side === 'right' && x <= refRect.left + 1) {\n return close();\n } // Ignore when the cursor is within the rectangular trough between the\n // two elements. Since the triangle is created from the cursor point,\n // which can start beyond the ref element's edge, traversing back and\n // forth from the ref to the floating element can cause it to close. This\n // ensures it always remains open in that case.\n\n\n switch (side) {\n case 'top':\n if (clientX >= rect.left && clientX <= rect.right && clientY >= rect.top && clientY <= refRect.top + 1) {\n return;\n }\n\n break;\n\n case 'bottom':\n if (clientX >= rect.left && clientX <= rect.right && clientY >= refRect.bottom - 1 && clientY <= rect.bottom) {\n return;\n }\n\n break;\n\n case 'left':\n if (clientX >= rect.left && clientX <= refRect.left + 1 && clientY >= rect.top && clientY <= rect.bottom) {\n return;\n }\n\n break;\n\n case 'right':\n if (clientX >= refRect.right - 1 && clientX <= rect.right && clientY >= rect.top && clientY <= rect.bottom) {\n return;\n }\n\n break;\n }\n\n if (polygonIsDestroyed) {\n return close();\n }\n\n function getPolygon(_ref3) {\n let [x, y] = _ref3;\n const isFloatingWider = rect.width > refRect.width;\n const isFloatingTaller = rect.height > refRect.height;\n\n switch (side) {\n case 'top':\n {\n const cursorPointOne = [isFloatingWider ? x + buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y + buffer + 1];\n const cursorPointTwo = [isFloatingWider ? x - buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y + buffer + 1];\n const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.bottom - buffer : isFloatingWider ? rect.bottom - buffer : rect.top], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.bottom - buffer : rect.top : rect.bottom - buffer]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n\n case 'bottom':\n {\n const cursorPointOne = [isFloatingWider ? x + buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y - buffer];\n const cursorPointTwo = [isFloatingWider ? x - buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y - buffer];\n const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.top + buffer : isFloatingWider ? rect.top + buffer : rect.bottom], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.top + buffer : rect.bottom : rect.top + buffer]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n\n case 'left':\n {\n const cursorPointOne = [x + buffer + 1, isFloatingTaller ? y + buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const cursorPointTwo = [x + buffer + 1, isFloatingTaller ? y - buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const commonPoints = [[cursorLeaveFromBottom ? rect.right - buffer : isFloatingTaller ? rect.right - buffer : rect.left, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.right - buffer : rect.left : rect.right - buffer, rect.bottom]];\n return [...commonPoints, cursorPointOne, cursorPointTwo];\n }\n\n case 'right':\n {\n const cursorPointOne = [x - buffer, isFloatingTaller ? y + buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const cursorPointTwo = [x - buffer, isFloatingTaller ? y - buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const commonPoints = [[cursorLeaveFromBottom ? rect.left + buffer : isFloatingTaller ? rect.left + buffer : rect.right, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.left + buffer : rect.right : rect.left + buffer, rect.bottom]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n }\n }\n\n const poly = getPolygon([x, y]);\n\n if (process.env.NODE_ENV !== \"production\") {\n debug == null ? void 0 : debug(poly.slice(0, 4).join(', '));\n }\n\n if (!isPointInPolygon([clientX, clientY], poly)) {\n close();\n } else if (restMs) {\n timeoutId = setTimeout(onClose, restMs);\n }\n };\n };\n\n fn.__options = {\n blockPointerEvents\n };\n return fn;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\n// https://codesandbox.io/s/tabbable-portal-f4tng?file=/src/FocusTrap.tsx\n\nconst HIDDEN_STYLES = {\n border: 0,\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: 0,\n position: 'fixed',\n whiteSpace: 'nowrap',\n width: '1px',\n top: 0,\n left: 0\n};\nlet activeElement$1;\nlet timeoutId;\n\nfunction setActiveElementOnTab(event) {\n if (event.key === 'Tab') {\n activeElement$1 = event.target;\n clearTimeout(timeoutId);\n }\n}\n\nfunction isTabFocus(event) {\n const result = activeElement$1 === event.relatedTarget;\n activeElement$1 = event.relatedTarget;\n clearTimeout(timeoutId);\n return result;\n}\n\nconst FocusGuard = /*#__PURE__*/React.forwardRef(function FocusGuard(props, ref) {\n const onFocus = useEvent(props.onFocus);\n const [role, setRole] = React.useState();\n index(() => {\n if (isSafari()) {\n // Unlike other screen readers such as NVDA and JAWS, the virtual cursor\n // on VoiceOver does trigger the onFocus event, so we can use the focus\n // trap element. On Safari, only buttons trigger the onFocus event.\n // NB: \"group\" role in the Sandbox no longer appears to work, must be a\n // button role.\n setRole('button');\n }\n\n document.addEventListener('keydown', setActiveElementOnTab);\n return () => {\n document.removeEventListener('keydown', setActiveElementOnTab);\n };\n }, []);\n return /*#__PURE__*/React.createElement(\"span\", _extends({}, props, {\n ref: ref,\n tabIndex: 0 // Role is only for VoiceOver\n ,\n role: role,\n \"aria-hidden\": role ? undefined : true,\n \"data-floating-ui-focus-guard\": \"\",\n style: HIDDEN_STYLES,\n onFocus: event => {\n if (isSafari() && isMac() && !isTabFocus(event)) {\n // On macOS we need to wait a little bit before moving\n // focus again.\n event.persist();\n timeoutId = window.setTimeout(() => {\n onFocus(event);\n }, 50);\n } else {\n onFocus(event);\n }\n }\n }));\n});\n\n/**\n * Find the real active element. Traverses into shadowRoots.\n */\nfunction activeElement(doc) {\n let activeElement = doc.activeElement;\n\n while (((_activeElement = activeElement) == null ? void 0 : (_activeElement$shadow = _activeElement.shadowRoot) == null ? void 0 : _activeElement$shadow.activeElement) != null) {\n var _activeElement, _activeElement$shadow;\n\n activeElement = activeElement.shadowRoot.activeElement;\n }\n\n return activeElement;\n}\n\nconst getTabbableOptions = () => ({\n getShadowRoot: true,\n displayCheck: // JSDOM does not support the `tabbable` library. To solve this we can\n // check if `ResizeObserver` is a real function (not polyfilled), which\n // determines if the current environment is JSDOM-like.\n typeof ResizeObserver === 'function' && ResizeObserver.toString().includes('[native code]') ? 'full' : 'none'\n});\nfunction getTabbableIn(container, direction) {\n const allTabbable = tabbable(container, getTabbableOptions());\n\n if (direction === 'prev') {\n allTabbable.reverse();\n }\n\n const activeIndex = allTabbable.indexOf(activeElement(getDocument(container)));\n const nextTabbableElements = allTabbable.slice(activeIndex + 1);\n return nextTabbableElements[0];\n}\nfunction getNextTabbable() {\n return getTabbableIn(document.body, 'next');\n}\nfunction getPreviousTabbable() {\n return getTabbableIn(document.body, 'prev');\n}\nfunction isOutsideEvent(event, container) {\n const containerElement = container || event.currentTarget;\n const relatedTarget = event.relatedTarget;\n return !relatedTarget || !contains(containerElement, relatedTarget);\n}\nfunction disableFocusInside(container) {\n const tabbableElements = tabbable(container, getTabbableOptions());\n tabbableElements.forEach(element => {\n var _element$getAttribute;\n\n element.dataset.tabindex = (_element$getAttribute = element.getAttribute('tabindex')) != null ? _element$getAttribute : '';\n element.setAttribute('tabindex', '-1');\n });\n}\nfunction enableFocusInside(container) {\n const elements = container.querySelectorAll('[data-tabindex]');\n elements.forEach(element => {\n const tabindex = element.dataset.tabindex;\n delete element.dataset.tabindex;\n\n if (tabindex) {\n element.setAttribute('tabindex', tabindex);\n } else {\n element.removeAttribute('tabindex');\n }\n });\n}\n\nconst PortalContext = /*#__PURE__*/React.createContext(null);\nconst useFloatingPortalNode = function (_temp) {\n let {\n id,\n enabled = true\n } = _temp === void 0 ? {} : _temp;\n const [portalEl, setPortalEl] = React.useState(null);\n const uniqueId = useId();\n const portalContext = usePortalContext();\n index(() => {\n if (!enabled) {\n return;\n }\n\n const rootNode = id ? document.getElementById(id) : null;\n\n if (rootNode) {\n rootNode.setAttribute('data-floating-ui-portal', '');\n setPortalEl(rootNode);\n } else {\n const newPortalEl = document.createElement('div');\n newPortalEl.id = id || uniqueId;\n newPortalEl.setAttribute('data-floating-ui-portal', '');\n setPortalEl(newPortalEl);\n const container = (portalContext == null ? void 0 : portalContext.portalNode) || document.body;\n container.appendChild(newPortalEl);\n return () => {\n container.removeChild(newPortalEl);\n };\n }\n }, [id, portalContext, uniqueId, enabled]);\n return portalEl;\n};\n/**\n * Portals your floating element outside of the main app node.\n * @see https://floating-ui.com/docs/FloatingPortal\n */\n\nconst FloatingPortal = _ref => {\n let {\n children,\n id,\n root = null,\n preserveTabOrder = true\n } = _ref;\n const portalNode = useFloatingPortalNode({\n id,\n enabled: !root\n });\n const [focusManagerState, setFocusManagerState] = React.useState(null);\n const beforeOutsideRef = React.useRef(null);\n const afterOutsideRef = React.useRef(null);\n const beforeInsideRef = React.useRef(null);\n const afterInsideRef = React.useRef(null);\n const shouldRenderGuards = // The FocusManager and therefore floating element are currently open/\n // rendered.\n !!focusManagerState && // Guards are only for non-modal focus management.\n !focusManagerState.modal && !!(root || portalNode) && preserveTabOrder; // https://codesandbox.io/s/tabbable-portal-f4tng?file=/src/TabbablePortal.tsx\n\n React.useEffect(() => {\n if (!portalNode || !preserveTabOrder || focusManagerState != null && focusManagerState.modal) {\n return;\n } // Make sure elements inside the portal element are tabbable only when the\n // portal has already been focused, either by tabbing into a focus trap\n // element outside or using the mouse.\n\n\n function onFocus(event) {\n if (portalNode && isOutsideEvent(event)) {\n const focusing = event.type === 'focusin';\n const manageFocus = focusing ? enableFocusInside : disableFocusInside;\n manageFocus(portalNode);\n }\n } // Listen to the event on the capture phase so they run before the focus\n // trap elements onFocus prop is called.\n\n\n portalNode.addEventListener('focusin', onFocus, true);\n portalNode.addEventListener('focusout', onFocus, true);\n return () => {\n portalNode.removeEventListener('focusin', onFocus, true);\n portalNode.removeEventListener('focusout', onFocus, true);\n };\n }, [portalNode, preserveTabOrder, focusManagerState == null ? void 0 : focusManagerState.modal]);\n return /*#__PURE__*/React.createElement(PortalContext.Provider, {\n value: React.useMemo(() => ({\n preserveTabOrder,\n beforeOutsideRef,\n afterOutsideRef,\n beforeInsideRef,\n afterInsideRef,\n portalNode,\n setFocusManagerState\n }), [preserveTabOrder, portalNode])\n }, shouldRenderGuards && portalNode && /*#__PURE__*/React.createElement(FocusGuard, {\n ref: beforeOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n var _beforeInsideRef$curr;\n\n (_beforeInsideRef$curr = beforeInsideRef.current) == null ? void 0 : _beforeInsideRef$curr.focus();\n } else {\n const prevTabbable = getPreviousTabbable() || (focusManagerState == null ? void 0 : focusManagerState.refs.domReference.current);\n prevTabbable == null ? void 0 : prevTabbable.focus();\n }\n }\n }), shouldRenderGuards && portalNode && /*#__PURE__*/React.createElement(\"span\", {\n \"aria-owns\": portalNode.id,\n style: HIDDEN_STYLES\n }), root ? /*#__PURE__*/createPortal(children, root) : portalNode ? /*#__PURE__*/createPortal(children, portalNode) : null, shouldRenderGuards && portalNode && /*#__PURE__*/React.createElement(FocusGuard, {\n ref: afterOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n var _afterInsideRef$curre;\n\n (_afterInsideRef$curre = afterInsideRef.current) == null ? void 0 : _afterInsideRef$curre.focus();\n } else {\n const nextTabbable = getNextTabbable() || (focusManagerState == null ? void 0 : focusManagerState.refs.domReference.current);\n nextTabbable == null ? void 0 : nextTabbable.focus();\n focusManagerState == null ? void 0 : focusManagerState.onOpenChange(false);\n }\n }\n }));\n};\nconst usePortalContext = () => React.useContext(PortalContext);\n\nconst identifier = 'data-floating-ui-scroll-lock';\n/**\n * Provides base styling for a fixed overlay element to dim content or block\n * pointer events behind a floating element.\n * It's a regular `
`, so it can be styled via any CSS solution you prefer.\n * @see https://floating-ui.com/docs/FloatingOverlay\n */\n\nconst FloatingOverlay = /*#__PURE__*/React.forwardRef(function FloatingOverlay(_ref, ref) {\n let {\n lockScroll = false,\n ...rest\n } = _ref;\n index(() => {\n var _window$visualViewpor, _window$visualViewpor2, _window$visualViewpor3, _window$visualViewpor4;\n\n if (!lockScroll) {\n return;\n }\n\n const alreadyLocked = document.body.hasAttribute(identifier);\n\n if (alreadyLocked) {\n return;\n }\n\n document.body.setAttribute(identifier, ''); // RTL scrollbar\n\n const scrollbarX = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft;\n const paddingProp = scrollbarX ? 'paddingLeft' : 'paddingRight';\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth; // Only iOS doesn't respect `overflow: hidden` on document.body, and this\n // technique has fewer side effects.\n\n if (!/iP(hone|ad|od)|iOS/.test(getPlatform())) {\n Object.assign(document.body.style, {\n overflow: 'hidden',\n [paddingProp]: scrollbarWidth + \"px\"\n });\n return () => {\n document.body.removeAttribute(identifier);\n Object.assign(document.body.style, {\n overflow: '',\n [paddingProp]: ''\n });\n };\n } // iOS 12 does not support `visuaViewport`.\n\n\n const offsetLeft = (_window$visualViewpor = (_window$visualViewpor2 = window.visualViewport) == null ? void 0 : _window$visualViewpor2.offsetLeft) != null ? _window$visualViewpor : 0;\n const offsetTop = (_window$visualViewpor3 = (_window$visualViewpor4 = window.visualViewport) == null ? void 0 : _window$visualViewpor4.offsetTop) != null ? _window$visualViewpor3 : 0;\n const scrollX = window.pageXOffset;\n const scrollY = window.pageYOffset;\n Object.assign(document.body.style, {\n position: 'fixed',\n overflow: 'hidden',\n top: -(scrollY - Math.floor(offsetTop)) + \"px\",\n left: -(scrollX - Math.floor(offsetLeft)) + \"px\",\n right: '0',\n [paddingProp]: scrollbarWidth + \"px\"\n });\n return () => {\n Object.assign(document.body.style, {\n position: '',\n overflow: '',\n top: '',\n left: '',\n right: '',\n [paddingProp]: ''\n });\n document.body.removeAttribute(identifier);\n window.scrollTo(scrollX, scrollY);\n };\n }, [lockScroll]);\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n ref: ref\n }, rest, {\n style: {\n position: 'fixed',\n overflow: 'auto',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...rest.style\n }\n }));\n});\n\nconst TYPEABLE_SELECTOR = \"input:not([type='hidden']):not([disabled]),\" + \"[contenteditable]:not([contenteditable='false']),textarea:not([disabled])\";\nfunction isTypeableElement(element) {\n return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);\n}\n\nfunction stopEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\n\nfunction useLatestRef(value) {\n const ref = useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\n\nfunction getAncestors(nodes, id) {\n var _nodes$find;\n\n let allAncestors = [];\n let currentParentId = (_nodes$find = nodes.find(node => node.id === id)) == null ? void 0 : _nodes$find.parentId;\n\n while (currentParentId) {\n const currentNode = nodes.find(node => node.id === currentParentId);\n currentParentId = currentNode == null ? void 0 : currentNode.parentId;\n\n if (currentNode) {\n allAncestors = allAncestors.concat(currentNode);\n }\n }\n\n return allAncestors;\n}\n\nlet rafId = 0;\nfunction enqueueFocus(el, options) {\n if (options === void 0) {\n options = {};\n }\n\n const {\n preventScroll = false,\n cancelPrevious = true,\n sync = false\n } = options;\n cancelPrevious && cancelAnimationFrame(rafId);\n\n const exec = () => el == null ? void 0 : el.focus({\n preventScroll\n });\n\n if (sync) {\n exec();\n } else {\n rafId = requestAnimationFrame(exec);\n }\n}\n\nconst VisuallyHiddenDismiss = /*#__PURE__*/React.forwardRef(function VisuallyHiddenDismiss(props, ref) {\n return /*#__PURE__*/React.createElement(\"button\", _extends({}, props, {\n ref: ref,\n tabIndex: -1,\n style: HIDDEN_STYLES\n }));\n});\n\n/**\n * Provides focus management for the floating element.\n * @see https://floating-ui.com/docs/FloatingFocusManager\n */\nfunction FloatingFocusManager(_ref) {\n let {\n context,\n children,\n order = ['content'],\n guards = true,\n initialFocus = 0,\n returnFocus = true,\n modal = true,\n visuallyHiddenDismiss = false\n } = _ref;\n const {\n refs,\n nodeId,\n onOpenChange,\n events,\n _: {\n domReference\n }\n } = context;\n const orderRef = useLatestRef(order);\n const tree = useFloatingTree();\n const portalContext = usePortalContext();\n const [tabbableContentLength, setTabbableContentLength] = React.useState(null); // Controlled by `useListNavigation`.\n\n const initialFocusControlled = typeof initialFocus === 'number' && initialFocus < 0;\n const startDismissButtonRef = React.useRef(null);\n const endDismissButtonRef = React.useRef(null);\n const preventReturnFocusRef = React.useRef(false);\n const previouslyFocusedElementRef = React.useRef(null);\n const insidePortal = portalContext != null; // If the reference is a combobox and is typeable (e.g. input/textarea),\n // there are different focus semantics. The guards should not be rendered, but\n // aria-hidden should be applied to all nodes still. Further, the visually\n // hidden dismiss button should only appear at the end of the list, not the\n // start.\n\n const typeableCombobox = domReference && domReference.getAttribute('role') === 'combobox' && isTypeableElement(domReference);\n const getTabbableContent = React.useCallback(function (container) {\n if (container === void 0) {\n container = refs.floating.current;\n }\n\n return container ? tabbable(container, getTabbableOptions()) : [];\n }, [refs]);\n const getTabbableElements = React.useCallback(container => {\n const content = getTabbableContent(container);\n return orderRef.current.map(type => {\n if (refs.domReference.current && type === 'reference') {\n return refs.domReference.current;\n }\n\n if (refs.floating.current && type === 'floating') {\n return refs.floating.current;\n }\n\n return content;\n }).filter(Boolean).flat();\n }, [orderRef, refs, getTabbableContent]);\n React.useEffect(() => {\n if (!modal) {\n return;\n }\n\n function onKeyDown(event) {\n if (event.key === 'Tab') {\n // The focus guards have nothing to focus, so we need to stop the event.\n if (getTabbableContent().length === 0 && !typeableCombobox) {\n stopEvent(event);\n }\n\n const els = getTabbableElements();\n const target = getTarget(event);\n\n if (orderRef.current[0] === 'reference' && target === refs.domReference.current) {\n stopEvent(event);\n\n if (event.shiftKey) {\n enqueueFocus(els[els.length - 1]);\n } else {\n enqueueFocus(els[1]);\n }\n }\n\n if (orderRef.current[1] === 'floating' && target === refs.floating.current && event.shiftKey) {\n stopEvent(event);\n enqueueFocus(els[0]);\n }\n }\n }\n\n const doc = getDocument(refs.floating.current);\n doc.addEventListener('keydown', onKeyDown);\n return () => {\n doc.removeEventListener('keydown', onKeyDown);\n };\n }, [modal, orderRef, refs, typeableCombobox, getTabbableContent, getTabbableElements]);\n React.useEffect(() => {\n var _portalContext$portal, _portalContext$portal2;\n\n const floating = refs.floating.current;\n const reference = refs.domReference.current; // Don't hide portals nested within the parent portal.\n\n const portalNodes = Array.from((_portalContext$portal = portalContext == null ? void 0 : (_portalContext$portal2 = portalContext.portalNode) == null ? void 0 : _portalContext$portal2.querySelectorAll('[data-floating-ui-portal]')) != null ? _portalContext$portal : []);\n\n function getDismissButtons() {\n return [startDismissButtonRef.current, endDismissButtonRef.current].filter(Boolean);\n }\n\n let isPointerDown = false; // In Safari, buttons lose focus when pressing them.\n\n function handlePointerDown() {\n isPointerDown = true;\n setTimeout(() => {\n isPointerDown = false;\n });\n }\n\n function handleFocusOutside(event) {\n const relatedTarget = event.relatedTarget;\n const movedToUnrelatedNode = !(contains(reference, relatedTarget) || contains(floating, relatedTarget) || contains(relatedTarget, floating) || contains(portalContext == null ? void 0 : portalContext.portalNode, relatedTarget) || [portalContext == null ? void 0 : portalContext.beforeOutsideRef.current, portalContext == null ? void 0 : portalContext.afterOutsideRef.current].filter(Boolean).includes(relatedTarget) || tree && (getChildren(tree.nodesRef.current, nodeId).find(node => {\n var _node$context, _node$context2;\n\n return contains((_node$context = node.context) == null ? void 0 : _node$context.refs.floating.current, relatedTarget) || contains((_node$context2 = node.context) == null ? void 0 : _node$context2.refs.domReference.current, relatedTarget);\n }) || getAncestors(tree.nodesRef.current, nodeId).find(node => {\n var _node$context3, _node$context4;\n\n return ((_node$context3 = node.context) == null ? void 0 : _node$context3.refs.floating.current) === relatedTarget || ((_node$context4 = node.context) == null ? void 0 : _node$context4.refs.domReference.current) === relatedTarget;\n }))); // Focus did not move inside the floating tree, and there are no tabbable\n // portal guards to handle closing.\n\n if (relatedTarget && movedToUnrelatedNode && !isPointerDown && // Fix React 18 Strict Mode returnFocus due to double rendering.\n relatedTarget !== previouslyFocusedElementRef.current) {\n preventReturnFocusRef.current = true; // On iOS VoiceOver, dismissing the nested submenu will cause the\n // first item of the list to receive focus. Delaying it appears to fix\n // the issue.\n\n setTimeout(() => onOpenChange(false));\n }\n }\n\n if (floating && isHTMLElement(reference)) {\n let cleanup;\n\n if (modal) {\n const insideNodes = [floating, ...portalNodes, ...getDismissButtons()];\n cleanup = hideOthers(orderRef.current.includes('reference') || typeableCombobox ? insideNodes.concat(reference) : insideNodes);\n }\n\n reference.addEventListener('focusout', handleFocusOutside);\n reference.addEventListener('pointerdown', handlePointerDown);\n !modal && floating.addEventListener('focusout', handleFocusOutside);\n return () => {\n reference.removeEventListener('focusout', handleFocusOutside);\n reference.removeEventListener('pointerdown', handlePointerDown);\n !modal && floating.removeEventListener('focusout', handleFocusOutside);\n cleanup == null ? void 0 : cleanup();\n };\n }\n }, [modal, initialFocus, nodeId, tree, orderRef, refs, portalContext, typeableCombobox, initialFocusControlled, onOpenChange]);\n React.useEffect(() => {\n const floating = refs.floating.current;\n\n if (modal && !guards && floating) {\n const tabIndexValues = [];\n const options = getTabbableOptions();\n const allTabbable = tabbable(getDocument(floating).body, options);\n const floatingTabbable = getTabbableElements(); // Exclude all tabbable elements that are part of the order\n\n const elements = allTabbable.filter(el => !floatingTabbable.includes(el));\n elements.forEach((el, i) => {\n tabIndexValues[i] = el.getAttribute('tabindex');\n el.setAttribute('tabindex', '-1');\n });\n return () => {\n elements.forEach((el, i) => {\n const value = tabIndexValues[i];\n\n if (value == null) {\n el.removeAttribute('tabindex');\n } else {\n el.setAttribute('tabindex', value);\n }\n });\n };\n }\n }, [modal, guards, refs, getTabbableElements]); // Layout effect to ensure that the previouslyFocusedElement is set before\n // focus is moved inside the floating element via hooks like\n // useListNavigation.\n\n index(() => {\n const floating = refs.floating.current;\n\n if (!floating) {\n return;\n }\n\n const doc = getDocument(floating);\n let returnFocusValue = returnFocus;\n let preventReturnFocusScroll = false;\n const previouslyFocusedElement = activeElement(doc);\n previouslyFocusedElementRef.current = previouslyFocusedElement;\n const focusableElements = getTabbableElements(floating);\n const elToFocus = (typeof initialFocus === 'number' ? focusableElements[initialFocus] : initialFocus.current) || floating; // If the `useListNavigation` hook is active, always ignore `initialFocus`\n // because it has its own handling of the initial focus.\n\n !initialFocusControlled && enqueueFocus(elToFocus, {\n preventScroll: elToFocus === floating\n }); // Dismissing via outside press should always ignore `returnFocus` to\n // prevent unwanted scrolling.\n\n function onDismiss(payload) {\n if (payload.type === 'escapeKey' && refs.domReference.current) {\n previouslyFocusedElementRef.current = refs.domReference.current;\n }\n\n if (payload.type !== 'outsidePress') {\n return;\n }\n\n const returnFocus = payload.data.returnFocus;\n\n if (typeof returnFocus === 'object') {\n returnFocusValue = true;\n preventReturnFocusScroll = returnFocus.preventScroll;\n } else {\n returnFocusValue = returnFocus;\n }\n }\n\n events.on('dismiss', onDismiss);\n return () => {\n events.off('dismiss', onDismiss);\n\n if (contains(floating, activeElement(doc)) && refs.domReference.current) {\n previouslyFocusedElementRef.current = refs.domReference.current;\n }\n\n if (returnFocusValue && isHTMLElement(previouslyFocusedElementRef.current) && !preventReturnFocusRef.current) {\n enqueueFocus(previouslyFocusedElementRef.current, {\n preventScroll: preventReturnFocusScroll,\n // When dismissing nested floating elements, by the time the rAF has\n // executed, the menus will all have been unmounted. When they try\n // to get focused, the calls get ignored — leaving the root reference\n // focused as desired.\n cancelPrevious: false\n });\n }\n };\n }, [getTabbableElements, initialFocus, returnFocus, refs, events, initialFocusControlled]); // Synchronize the `context` & `modal` value to the FloatingPortal context.\n // It will decide whether or not it needs to render its own guards.\n\n index(() => {\n if (!portalContext) return;\n portalContext.setFocusManagerState({ ...context,\n modal // Not concerned about the generic type.\n\n });\n return () => {\n portalContext.setFocusManagerState(null);\n };\n }, [portalContext, modal, context]);\n index(() => {\n if (getTabbableContent().length === 0 && !initialFocusControlled) {\n setTabbableContentLength(0);\n }\n }, [getTabbableContent, refs, initialFocusControlled]);\n const shouldRenderGuards = guards && (insidePortal || modal) && !typeableCombobox;\n\n function renderDismissButton(location) {\n return visuallyHiddenDismiss && modal ? /*#__PURE__*/React.createElement(VisuallyHiddenDismiss, {\n ref: location === 'start' ? startDismissButtonRef : endDismissButtonRef,\n onClick: () => onOpenChange(false)\n }, typeof visuallyHiddenDismiss === 'string' ? visuallyHiddenDismiss : 'Dismiss') : null;\n }\n\n return /*#__PURE__*/React.createElement(React.Fragment, null, shouldRenderGuards && /*#__PURE__*/React.createElement(FocusGuard, {\n ref: portalContext == null ? void 0 : portalContext.beforeInsideRef,\n onFocus: event => {\n if (modal) {\n const els = getTabbableElements();\n enqueueFocus(order[0] === 'reference' ? els[0] : els[els.length - 1]);\n } else if (portalContext != null && portalContext.preserveTabOrder && portalContext.portalNode) {\n preventReturnFocusRef.current = false;\n\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const nextTabbable = getNextTabbable() || domReference;\n nextTabbable == null ? void 0 : nextTabbable.focus();\n } else {\n var _portalContext$before;\n\n (_portalContext$before = portalContext.beforeOutsideRef.current) == null ? void 0 : _portalContext$before.focus();\n }\n }\n }\n }), typeableCombobox ? null : renderDismissButton('start'), /*#__PURE__*/React.cloneElement(children, tabbableContentLength === 0 || order.includes('floating') ? {\n tabIndex: 0\n } : {}), renderDismissButton('end'), shouldRenderGuards && /*#__PURE__*/React.createElement(FocusGuard, {\n ref: portalContext == null ? void 0 : portalContext.afterInsideRef,\n onFocus: event => {\n if (modal) {\n enqueueFocus(getTabbableElements()[0]);\n } else if (portalContext != null && portalContext.preserveTabOrder && portalContext.portalNode) {\n preventReturnFocusRef.current = true;\n\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const prevTabbable = getPreviousTabbable() || domReference;\n prevTabbable == null ? void 0 : prevTabbable.focus();\n } else {\n var _portalContext$afterO;\n\n (_portalContext$afterO = portalContext.afterOutsideRef.current) == null ? void 0 : _portalContext$afterO.focus();\n }\n }\n }\n }));\n}\n\n// On some Linux machines with Chromium, mouse inputs return a `pointerType` of\n// \"pen\": https://github.com/floating-ui/floating-ui/issues/2015\nconst mouseLikePointerTypes = ['mouse', 'pen', '', undefined];\nfunction getDelay(value, prop, pointerType) {\n if (pointerType && !mouseLikePointerTypes.includes(pointerType)) {\n return 0;\n }\n\n if (typeof value === 'number') {\n return value;\n }\n\n return value == null ? void 0 : value[prop];\n}\n\n/**\n * Adds hover event listeners that change the open state, like CSS :hover.\n * @see https://floating-ui.com/docs/useHover\n */\nconst useHover = function (context, _temp) {\n let {\n enabled = true,\n delay = 0,\n handleClose = null,\n mouseOnly = false,\n restMs = 0,\n move = true\n } = _temp === void 0 ? {} : _temp;\n const {\n open,\n onOpenChange,\n dataRef,\n events,\n refs,\n _\n } = context;\n const tree = useFloatingTree();\n const parentId = useFloatingParentNodeId();\n const handleCloseRef = useLatestRef(handleClose);\n const delayRef = useLatestRef(delay);\n const pointerTypeRef = React.useRef();\n const timeoutRef = React.useRef();\n const handlerRef = React.useRef();\n const restTimeoutRef = React.useRef();\n const blockMouseMoveRef = React.useRef(true);\n const performedPointerEventsMutationRef = React.useRef(false);\n const isHoverOpen = React.useCallback(() => {\n var _dataRef$current$open;\n\n const type = (_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type;\n return (type == null ? void 0 : type.includes('mouse')) && type !== 'mousedown';\n }, [dataRef]); // When dismissing before opening, clear the delay timeouts to cancel it\n // from showing.\n\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n\n function onDismiss() {\n clearTimeout(timeoutRef.current);\n clearTimeout(restTimeoutRef.current);\n blockMouseMoveRef.current = true;\n }\n\n events.on('dismiss', onDismiss);\n return () => {\n events.off('dismiss', onDismiss);\n };\n }, [enabled, events, refs]);\n React.useEffect(() => {\n if (!enabled || !handleCloseRef.current || !open) {\n return;\n }\n\n function onLeave() {\n if (isHoverOpen()) {\n onOpenChange(false);\n }\n }\n\n const html = getDocument(refs.floating.current).documentElement;\n html.addEventListener('mouseleave', onLeave);\n return () => {\n html.removeEventListener('mouseleave', onLeave);\n };\n }, [refs, open, onOpenChange, enabled, handleCloseRef, dataRef, isHoverOpen]);\n const closeWithDelay = React.useCallback(function (runElseBranch) {\n if (runElseBranch === void 0) {\n runElseBranch = true;\n }\n\n const closeDelay = getDelay(delayRef.current, 'close', pointerTypeRef.current);\n\n if (closeDelay && !handlerRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = setTimeout(() => onOpenChange(false), closeDelay);\n } else if (runElseBranch) {\n clearTimeout(timeoutRef.current);\n onOpenChange(false);\n }\n }, [delayRef, onOpenChange]);\n const cleanupMouseMoveHandler = React.useCallback(() => {\n if (handlerRef.current) {\n getDocument(refs.floating.current).removeEventListener('mousemove', handlerRef.current);\n handlerRef.current = undefined;\n }\n }, [refs]);\n const clearPointerEvents = React.useCallback(() => {\n getDocument(refs.floating.current).body.style.pointerEvents = '';\n performedPointerEventsMutationRef.current = false;\n }, [refs]); // Registering the mouse events on the reference directly to bypass React's\n // delegation system. If the cursor was on a disabled element and then entered\n // the reference (no gap), `mouseenter` doesn't fire in the delegation system.\n\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n\n function isClickLikeOpenEvent() {\n return dataRef.current.openEvent ? ['click', 'mousedown'].includes(dataRef.current.openEvent.type) : false;\n }\n\n function onMouseEnter(event) {\n clearTimeout(timeoutRef.current);\n blockMouseMoveRef.current = false;\n\n if (mouseOnly && !mouseLikePointerTypes.includes(pointerTypeRef.current) || restMs > 0 && getDelay(delayRef.current, 'open') === 0) {\n return;\n }\n\n dataRef.current.openEvent = event;\n const openDelay = getDelay(delayRef.current, 'open', pointerTypeRef.current);\n\n if (openDelay) {\n timeoutRef.current = setTimeout(() => {\n onOpenChange(true);\n }, openDelay);\n } else {\n onOpenChange(true);\n }\n }\n\n function onMouseLeave(event) {\n if (isClickLikeOpenEvent()) {\n return;\n }\n\n const doc = getDocument(refs.floating.current);\n clearTimeout(restTimeoutRef.current);\n\n if (handleCloseRef.current) {\n clearTimeout(timeoutRef.current);\n handlerRef.current && doc.removeEventListener('mousemove', handlerRef.current);\n handlerRef.current = handleCloseRef.current({ ...context,\n tree,\n x: event.clientX,\n y: event.clientY,\n\n onClose() {\n clearPointerEvents();\n cleanupMouseMoveHandler();\n closeWithDelay();\n }\n\n });\n doc.addEventListener('mousemove', handlerRef.current);\n return;\n }\n\n closeWithDelay();\n } // Ensure the floating element closes after scrolling even if the pointer\n // did not move.\n // https://github.com/floating-ui/floating-ui/discussions/1692\n\n\n function onScrollMouseLeave(event) {\n if (isClickLikeOpenEvent()) {\n return;\n }\n\n handleCloseRef.current == null ? void 0 : handleCloseRef.current({ ...context,\n tree,\n x: event.clientX,\n y: event.clientY,\n leave: true,\n\n onClose() {\n clearPointerEvents();\n cleanupMouseMoveHandler();\n closeWithDelay();\n }\n\n })(event);\n }\n\n const floating = refs.floating.current;\n const reference = refs.domReference.current;\n\n if (isElement(reference)) {\n open && reference.addEventListener('mouseleave', onScrollMouseLeave);\n floating == null ? void 0 : floating.addEventListener('mouseleave', onScrollMouseLeave);\n move && reference.addEventListener('mousemove', onMouseEnter, {\n once: true\n });\n reference.addEventListener('mouseenter', onMouseEnter);\n reference.addEventListener('mouseleave', onMouseLeave);\n return () => {\n open && reference.removeEventListener('mouseleave', onScrollMouseLeave);\n floating == null ? void 0 : floating.removeEventListener('mouseleave', onScrollMouseLeave);\n move && reference.removeEventListener('mousemove', onMouseEnter);\n reference.removeEventListener('mouseenter', onMouseEnter);\n reference.removeEventListener('mouseleave', onMouseLeave);\n };\n }\n }, [// Ensure the effect is re-run when the reference changes.\n // https://github.com/floating-ui/floating-ui/issues/1833\n _.domReference, enabled, context, mouseOnly, restMs, move, closeWithDelay, cleanupMouseMoveHandler, clearPointerEvents, onOpenChange, open, tree, refs, delayRef, handleCloseRef, dataRef]); // Block pointer-events of every element other than the reference and floating\n // while the floating element is open and has a `handleClose` handler. Also\n // handles nested floating elements.\n // https://github.com/floating-ui/floating-ui/issues/1722\n\n index(() => {\n if (!enabled) {\n return;\n }\n\n if (open && handleCloseRef.current && handleCloseRef.current.__options.blockPointerEvents && isHoverOpen()) {\n getDocument(refs.floating.current).body.style.pointerEvents = 'none';\n performedPointerEventsMutationRef.current = true;\n const reference = refs.domReference.current;\n const floating = refs.floating.current;\n\n if (isElement(reference) && floating) {\n var _tree$nodesRef$curren, _tree$nodesRef$curren2;\n\n const parentFloating = tree == null ? void 0 : (_tree$nodesRef$curren = tree.nodesRef.current.find(node => node.id === parentId)) == null ? void 0 : (_tree$nodesRef$curren2 = _tree$nodesRef$curren.context) == null ? void 0 : _tree$nodesRef$curren2.refs.floating.current;\n\n if (parentFloating) {\n parentFloating.style.pointerEvents = '';\n }\n\n reference.style.pointerEvents = 'auto';\n floating.style.pointerEvents = 'auto';\n return () => {\n reference.style.pointerEvents = '';\n floating.style.pointerEvents = '';\n };\n }\n }\n }, [enabled, open, parentId, refs, tree, handleCloseRef, dataRef, isHoverOpen]);\n index(() => {\n if (!open) {\n pointerTypeRef.current = undefined;\n cleanupMouseMoveHandler();\n\n if (performedPointerEventsMutationRef.current) {\n clearPointerEvents();\n }\n }\n }, [open, cleanupMouseMoveHandler, clearPointerEvents]);\n React.useEffect(() => {\n return () => {\n cleanupMouseMoveHandler();\n clearTimeout(timeoutRef.current);\n clearTimeout(restTimeoutRef.current);\n\n if (performedPointerEventsMutationRef.current) {\n clearPointerEvents();\n }\n };\n }, [enabled, cleanupMouseMoveHandler, clearPointerEvents]);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n\n function setPointerRef(event) {\n pointerTypeRef.current = event.pointerType;\n }\n\n return {\n reference: {\n onPointerDown: setPointerRef,\n onPointerEnter: setPointerRef,\n\n onMouseMove() {\n if (open || restMs === 0) {\n return;\n }\n\n clearTimeout(restTimeoutRef.current);\n restTimeoutRef.current = setTimeout(() => {\n if (!blockMouseMoveRef.current) {\n onOpenChange(true);\n }\n }, restMs);\n }\n\n },\n floating: {\n onMouseEnter() {\n clearTimeout(timeoutRef.current);\n },\n\n onMouseLeave() {\n closeWithDelay(false);\n }\n\n }\n };\n }, [enabled, restMs, open, onOpenChange, closeWithDelay]);\n};\n\nconst FloatingDelayGroupContext = /*#__PURE__*/React.createContext({\n delay: 1000,\n initialDelay: 1000,\n currentId: null,\n setCurrentId: () => {},\n setState: () => {}\n});\nconst useDelayGroupContext = () => React.useContext(FloatingDelayGroupContext);\n/**\n * Provides context for a group of floating elements that should share a\n * `delay`.\n * @see https://floating-ui.com/docs/FloatingDelayGroup\n */\n\nconst FloatingDelayGroup = _ref => {\n let {\n children,\n delay\n } = _ref;\n const [state, setState] = React.useState({\n delay,\n initialDelay: delay,\n currentId: null\n });\n const setCurrentId = React.useCallback(currentId => {\n setState(state => ({ ...state,\n currentId\n }));\n }, []);\n return /*#__PURE__*/React.createElement(FloatingDelayGroupContext.Provider, {\n value: React.useMemo(() => ({ ...state,\n setState,\n setCurrentId\n }), [state, setState, setCurrentId])\n }, children);\n};\nconst useDelayGroup = (_ref2, _ref3) => {\n let {\n open,\n onOpenChange\n } = _ref2;\n let {\n id\n } = _ref3;\n const {\n currentId,\n initialDelay,\n setState\n } = useDelayGroupContext();\n React.useEffect(() => {\n if (currentId) {\n setState(state => ({ ...state,\n delay: {\n open: 1,\n close: getDelay(initialDelay, 'close')\n }\n }));\n\n if (currentId !== id) {\n onOpenChange(false);\n }\n }\n }, [id, onOpenChange, setState, currentId, initialDelay]);\n React.useEffect(() => {\n if (!open && currentId === id) {\n onOpenChange(false);\n setState(state => ({ ...state,\n delay: initialDelay,\n currentId: null\n }));\n }\n }, [open, setState, currentId, id, onOpenChange, initialDelay]);\n};\n\nfunction getArgsWithCustomFloatingHeight(args, height) {\n return { ...args,\n rects: { ...args.rects,\n floating: { ...args.rects.floating,\n height\n }\n }\n };\n}\n\nconst inner = options => ({\n name: 'inner',\n options,\n\n async fn(middlewareArguments) {\n var _scrollRef$current;\n\n const {\n listRef,\n overflowRef,\n onFallbackChange,\n offset: innerOffset = 0,\n index = 0,\n minItemsVisible = 4,\n referenceOverflowThreshold = 0,\n scrollRef,\n ...detectOverflowOptions\n } = options;\n const {\n rects,\n elements: {\n floating\n }\n } = middlewareArguments;\n const item = listRef.current[index];\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!middlewareArguments.placement.startsWith('bottom')) {\n console.warn(['Floating UI: `placement` side must be \"bottom\" when using the', '`inner` middleware.'].join(' '));\n }\n }\n\n if (!item) {\n return {};\n }\n\n const nextArgs = { ...middlewareArguments,\n ...(await offset(-item.offsetTop - rects.reference.height / 2 - item.offsetHeight / 2 - innerOffset).fn(middlewareArguments))\n };\n const el = (_scrollRef$current = scrollRef == null ? void 0 : scrollRef.current) != null ? _scrollRef$current : floating;\n const overflow = await detectOverflow(getArgsWithCustomFloatingHeight(nextArgs, el.scrollHeight), detectOverflowOptions);\n const refOverflow = await detectOverflow(nextArgs, { ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const diffY = Math.max(0, overflow.top);\n const nextY = nextArgs.y + diffY;\n const maxHeight = Math.max(0, el.scrollHeight - diffY - Math.max(0, overflow.bottom));\n el.style.maxHeight = maxHeight + \"px\";\n el.scrollTop = diffY; // There is not enough space, fallback to standard anchored positioning\n\n if (onFallbackChange) {\n if (el.offsetHeight < item.offsetHeight * Math.min(minItemsVisible, listRef.current.length - 1) - 1 || refOverflow.top >= -referenceOverflowThreshold || refOverflow.bottom >= -referenceOverflowThreshold) {\n flushSync(() => onFallbackChange(true));\n } else {\n flushSync(() => onFallbackChange(false));\n }\n }\n\n if (overflowRef) {\n overflowRef.current = await detectOverflow(getArgsWithCustomFloatingHeight({ ...nextArgs,\n y: nextY\n }, el.offsetHeight), detectOverflowOptions);\n }\n\n return {\n y: nextY\n };\n }\n\n});\nconst useInnerOffset = (_ref, _ref2) => {\n let {\n open,\n refs\n } = _ref;\n let {\n enabled = true,\n overflowRef,\n scrollRef,\n onChange: unstable_onChange\n } = _ref2;\n const onChange = useEvent(unstable_onChange);\n const controlledScrollingRef = React.useRef(false);\n const prevScrollTopRef = React.useRef(null);\n const initialOverflowRef = React.useRef(null);\n React.useEffect(() => {\n var _scrollRef$current2;\n\n if (!enabled) {\n return;\n }\n\n function onWheel(e) {\n if (e.ctrlKey || !el || overflowRef.current == null) {\n return;\n }\n\n const dY = e.deltaY;\n const isAtTop = overflowRef.current.top >= -0.5;\n const isAtBottom = overflowRef.current.bottom >= -0.5;\n const remainingScroll = el.scrollHeight - el.clientHeight;\n const sign = dY < 0 ? -1 : 1;\n const method = dY < 0 ? 'max' : 'min';\n\n if (el.scrollHeight <= el.clientHeight) {\n return;\n }\n\n if (!isAtTop && dY > 0 || !isAtBottom && dY < 0) {\n e.preventDefault();\n flushSync(() => {\n onChange(d => d + Math[method](dY, remainingScroll * sign));\n });\n } else if (/firefox/i.test(getUserAgent())) {\n // Needed to propagate scrolling during momentum scrolling phase once\n // it gets limited by the boundary. UX improvement, not critical.\n el.scrollTop += dY;\n }\n }\n\n const el = (_scrollRef$current2 = scrollRef == null ? void 0 : scrollRef.current) != null ? _scrollRef$current2 : refs.floating.current;\n\n if (open && el) {\n el.addEventListener('wheel', onWheel); // Wait for the position to be ready.\n\n requestAnimationFrame(() => {\n prevScrollTopRef.current = el.scrollTop;\n\n if (overflowRef.current != null) {\n initialOverflowRef.current = { ...overflowRef.current\n };\n }\n });\n return () => {\n prevScrollTopRef.current = null;\n initialOverflowRef.current = null;\n el.removeEventListener('wheel', onWheel);\n };\n }\n }, [enabled, open, refs, overflowRef, scrollRef, onChange]);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n\n return {\n floating: {\n onKeyDown() {\n controlledScrollingRef.current = true;\n },\n\n onWheel() {\n controlledScrollingRef.current = false;\n },\n\n onPointerMove() {\n controlledScrollingRef.current = false;\n },\n\n onScroll() {\n const el = (scrollRef == null ? void 0 : scrollRef.current) || refs.floating.current;\n\n if (!overflowRef.current || !el || !controlledScrollingRef.current) {\n return;\n }\n\n if (prevScrollTopRef.current !== null) {\n const scrollDiff = el.scrollTop - prevScrollTopRef.current;\n\n if (overflowRef.current.bottom < -0.5 && scrollDiff < -1 || overflowRef.current.top < -0.5 && scrollDiff > 1) {\n flushSync(() => onChange(d => d + scrollDiff));\n }\n } // [Firefox] Wait for the height change to have been applied.\n\n\n requestAnimationFrame(() => {\n prevScrollTopRef.current = el.scrollTop;\n });\n }\n\n }\n };\n }, [enabled, overflowRef, refs, scrollRef, onChange]);\n};\n\n/**\n * Adds relevant screen reader props for a given element `role`.\n * @see https://floating-ui.com/docs/useRole\n */\nconst useRole = function (_ref, _temp) {\n let {\n open\n } = _ref;\n let {\n enabled = true,\n role = 'dialog'\n } = _temp === void 0 ? {} : _temp;\n const rootId = useId();\n const referenceId = useId();\n return React.useMemo(() => {\n const floatingProps = {\n id: rootId,\n role\n };\n\n if (!enabled) {\n return {};\n }\n\n if (role === 'tooltip') {\n return {\n reference: {\n 'aria-describedby': open ? rootId : undefined\n },\n floating: floatingProps\n };\n }\n\n return {\n reference: {\n 'aria-expanded': open ? 'true' : 'false',\n 'aria-haspopup': role === 'alertdialog' ? 'dialog' : role,\n 'aria-controls': open ? rootId : undefined,\n ...(role === 'listbox' && {\n role: 'combobox'\n }),\n ...(role === 'menu' && {\n id: referenceId\n })\n },\n floating: { ...floatingProps,\n ...(role === 'menu' && {\n 'aria-labelledby': referenceId\n })\n }\n };\n }, [enabled, role, open, rootId, referenceId]);\n};\n\nfunction isButtonTarget(event) {\n return isHTMLElement(event.target) && event.target.tagName === 'BUTTON';\n}\n\nfunction isSpaceIgnored(element) {\n return isTypeableElement(element);\n}\n\n/**\n * Adds click event listeners that change the open state.\n * @see https://floating-ui.com/docs/useClick\n */\nconst useClick = function (_ref, _temp) {\n let {\n open,\n onOpenChange,\n dataRef,\n refs\n } = _ref;\n let {\n enabled = true,\n event: eventOption = 'click',\n toggle = true,\n ignoreMouse = false,\n keyboardHandlers = true\n } = _temp === void 0 ? {} : _temp;\n const pointerTypeRef = React.useRef();\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n\n return {\n reference: {\n onPointerDown(event) {\n pointerTypeRef.current = event.pointerType;\n },\n\n onMouseDown(event) {\n // Ignore all buttons except for the \"main\" button.\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n if (event.button !== 0) {\n return;\n }\n\n if (pointerTypeRef.current === 'mouse' && ignoreMouse) {\n return;\n }\n\n if (eventOption === 'click') {\n return;\n }\n\n if (open) {\n if (toggle && (dataRef.current.openEvent ? dataRef.current.openEvent.type === 'mousedown' : true)) {\n onOpenChange(false);\n }\n } else {\n // Prevent stealing focus from the floating element\n event.preventDefault();\n onOpenChange(true);\n }\n\n dataRef.current.openEvent = event.nativeEvent;\n },\n\n onClick(event) {\n if (eventOption === 'mousedown' && pointerTypeRef.current) {\n pointerTypeRef.current = undefined;\n return;\n }\n\n if (pointerTypeRef.current === 'mouse' && ignoreMouse) {\n return;\n }\n\n if (open) {\n if (toggle && (dataRef.current.openEvent ? dataRef.current.openEvent.type === 'click' : true)) {\n onOpenChange(false);\n }\n } else {\n onOpenChange(true);\n }\n\n dataRef.current.openEvent = event.nativeEvent;\n },\n\n onKeyDown(event) {\n pointerTypeRef.current = undefined;\n\n if (!keyboardHandlers) {\n return;\n }\n\n if (isButtonTarget(event)) {\n return;\n }\n\n if (event.key === ' ' && !isSpaceIgnored(refs.domReference.current)) {\n // Prevent scrolling\n event.preventDefault();\n }\n\n if (event.key === 'Enter') {\n if (open) {\n if (toggle) {\n onOpenChange(false);\n }\n } else {\n onOpenChange(true);\n }\n }\n },\n\n onKeyUp(event) {\n if (!keyboardHandlers) {\n return;\n }\n\n if (isButtonTarget(event) || isSpaceIgnored(refs.domReference.current)) {\n return;\n }\n\n if (event.key === ' ') {\n if (open) {\n if (toggle) {\n onOpenChange(false);\n }\n } else {\n onOpenChange(true);\n }\n }\n }\n\n }\n };\n }, [enabled, dataRef, eventOption, ignoreMouse, keyboardHandlers, refs, toggle, open, onOpenChange]);\n};\n\n/**\n * Check whether the event.target is within the provided node. Uses event.composedPath if available for custom element support.\n *\n * @param event The event whose target/composedPath to check\n * @param node The node to check against\n * @returns Whether the event.target/composedPath is within the node.\n */\nfunction isEventTargetWithin(event, node) {\n if (node == null) {\n return false;\n }\n\n if ('composedPath' in event) {\n return event.composedPath().includes(node);\n } // TS thinks `event` is of type never as it assumes all browsers support composedPath, but browsers without shadow dom don't\n\n\n const e = event;\n return e.target != null && node.contains(e.target);\n}\n\nconst bubbleHandlerKeys = {\n pointerdown: 'onPointerDown',\n mousedown: 'onMouseDown',\n click: 'onClick'\n};\nconst captureHandlerKeys = {\n pointerdown: 'onPointerDownCapture',\n mousedown: 'onMouseDownCapture',\n click: 'onClickCapture'\n};\n\n/**\n * Adds listeners that dismiss (close) the floating element.\n * @see https://floating-ui.com/docs/useDismiss\n */\nconst useDismiss = function (_ref, _temp) {\n let {\n open,\n onOpenChange,\n refs,\n events,\n nodeId\n } = _ref;\n let {\n enabled = true,\n escapeKey = true,\n outsidePress = true,\n outsidePressEvent = 'pointerdown',\n referencePress = false,\n referencePressEvent = 'pointerdown',\n ancestorScroll = false,\n bubbles = true\n } = _temp === void 0 ? {} : _temp;\n const tree = useFloatingTree();\n const nested = useFloatingParentNodeId() != null;\n const outsidePressRef = useLatestRef(outsidePress);\n const insideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n if (!open || !enabled) {\n return;\n }\n\n const outsidePress = outsidePressRef.current;\n\n function onKeyDown(event) {\n if (event.key === 'Escape') {\n if (!bubbles && tree && getChildren(tree.nodesRef.current, nodeId).length > 0) {\n return;\n }\n\n events.emit('dismiss', {\n type: 'escapeKey',\n data: {\n returnFocus: {\n preventScroll: false\n }\n }\n });\n onOpenChange(false);\n }\n }\n\n function onOutsidePress(event) {\n // Given developers can stop the propagation of the synthetic event,\n // we can only be confident with a positive value.\n const insideReactTree = insideReactTreeRef.current;\n insideReactTreeRef.current = false;\n\n if (insideReactTree) {\n return;\n }\n\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n\n const target = getTarget(event); // Check if the click occurred on the scrollbar\n\n if (isElement(target) && refs.floating.current) {\n var _refs$floating$curren;\n\n const win = (_refs$floating$curren = refs.floating.current.ownerDocument.defaultView) != null ? _refs$floating$curren : window;\n const canScrollX = target.scrollWidth > target.clientWidth;\n const canScrollY = target.scrollHeight > target.clientHeight;\n let xCond = canScrollY && event.offsetX > target.clientWidth; // In some browsers it is possible to change the (or window)\n // scrollbar to the left side, but is very rare and is difficult to\n // check for. Plus, for modal dialogs with backdrops, it is more\n // important that the backdrop is checked but not so much the window.\n\n if (canScrollY) {\n const isRTL = win.getComputedStyle(target).direction === 'rtl';\n\n if (isRTL) {\n xCond = event.offsetX <= target.offsetWidth - target.clientWidth;\n }\n }\n\n if (xCond || canScrollX && event.offsetY > target.clientHeight) {\n return;\n }\n }\n\n const targetIsInsideChildren = tree && getChildren(tree.nodesRef.current, nodeId).some(node => {\n var _node$context;\n\n return isEventTargetWithin(event, (_node$context = node.context) == null ? void 0 : _node$context.refs.floating.current);\n });\n\n if (isEventTargetWithin(event, refs.floating.current) || isEventTargetWithin(event, refs.domReference.current) || targetIsInsideChildren) {\n return;\n }\n\n if (!bubbles && tree && getChildren(tree.nodesRef.current, nodeId).length > 0) {\n return;\n }\n\n events.emit('dismiss', {\n type: 'outsidePress',\n data: {\n returnFocus: nested ? {\n preventScroll: true\n } : isVirtualClick(event) || isVirtualPointerEvent(event)\n }\n });\n onOpenChange(false);\n }\n\n function onScroll() {\n onOpenChange(false);\n }\n\n const doc = getDocument(refs.floating.current);\n escapeKey && doc.addEventListener('keydown', onKeyDown);\n outsidePress && doc.addEventListener(outsidePressEvent, onOutsidePress);\n let ancestors = [];\n\n if (ancestorScroll) {\n if (isElement(refs.domReference.current)) {\n ancestors = getOverflowAncestors(refs.domReference.current);\n }\n\n if (isElement(refs.floating.current)) {\n ancestors = ancestors.concat(getOverflowAncestors(refs.floating.current));\n }\n\n if (!isElement(refs.reference.current) && refs.reference.current && // @ts-expect-error is VirtualElement\n refs.reference.current.contextElement) {\n ancestors = ancestors.concat( // @ts-expect-error is VirtualElement\n getOverflowAncestors(refs.reference.current.contextElement));\n }\n } // Ignore the visual viewport for scrolling dismissal (allow pinch-zoom)\n\n\n ancestors = ancestors.filter(ancestor => {\n var _doc$defaultView;\n\n return ancestor !== ((_doc$defaultView = doc.defaultView) == null ? void 0 : _doc$defaultView.visualViewport);\n });\n ancestors.forEach(ancestor => {\n ancestor.addEventListener('scroll', onScroll, {\n passive: true\n });\n });\n return () => {\n escapeKey && doc.removeEventListener('keydown', onKeyDown);\n outsidePress && doc.removeEventListener(outsidePressEvent, onOutsidePress);\n ancestors.forEach(ancestor => {\n ancestor.removeEventListener('scroll', onScroll);\n });\n };\n }, [escapeKey, outsidePressRef, outsidePressEvent, events, tree, nodeId, open, onOpenChange, ancestorScroll, enabled, bubbles, refs, nested]);\n React.useEffect(() => {\n insideReactTreeRef.current = false;\n }, [outsidePress, outsidePressEvent]);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n\n return {\n reference: {\n [bubbleHandlerKeys[referencePressEvent]]: () => {\n if (referencePress) {\n events.emit('dismiss', {\n type: 'referencePress',\n data: {\n returnFocus: false\n }\n });\n onOpenChange(false);\n }\n }\n },\n floating: {\n [captureHandlerKeys[outsidePressEvent]]: () => {\n insideReactTreeRef.current = true;\n }\n }\n };\n }, [enabled, events, referencePress, outsidePressEvent, referencePressEvent, onOpenChange]);\n};\n\n/**\n * Adds focus event listeners that change the open state, like CSS :focus.\n * @see https://floating-ui.com/docs/useFocus\n */\nconst useFocus = function (_ref, _temp) {\n let {\n open,\n onOpenChange,\n dataRef,\n refs,\n events\n } = _ref;\n let {\n enabled = true,\n keyboardOnly = true\n } = _temp === void 0 ? {} : _temp;\n const pointerTypeRef = React.useRef('');\n const blockFocusRef = React.useRef(false);\n const timeoutRef = React.useRef();\n React.useEffect(() => {\n var _doc$defaultView;\n\n if (!enabled) {\n return;\n }\n\n const doc = getDocument(refs.floating.current);\n const win = (_doc$defaultView = doc.defaultView) != null ? _doc$defaultView : window; // If the reference was focused and the user left the tab/window, and the\n // floating element was not open, the focus should be blocked when they\n // return to the tab/window.\n\n function onBlur() {\n if (!open && isHTMLElement(refs.domReference.current) && refs.domReference.current === activeElement(getDocument(refs.domReference.current))) {\n blockFocusRef.current = true;\n }\n }\n\n win.addEventListener('blur', onBlur);\n return () => {\n win.removeEventListener('blur', onBlur);\n };\n }, [refs, open, enabled]);\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n\n function onDismiss(payload) {\n if (payload.type === 'referencePress' || payload.type === 'escapeKey') {\n blockFocusRef.current = true;\n }\n }\n\n events.on('dismiss', onDismiss);\n return () => {\n events.off('dismiss', onDismiss);\n };\n }, [events, enabled]);\n React.useEffect(() => {\n return () => {\n clearTimeout(timeoutRef.current);\n };\n }, []);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n\n return {\n reference: {\n onPointerDown(_ref2) {\n let {\n pointerType\n } = _ref2;\n pointerTypeRef.current = pointerType;\n blockFocusRef.current = !!(pointerType && keyboardOnly);\n },\n\n onMouseLeave() {\n blockFocusRef.current = false;\n },\n\n onFocus(event) {\n var _dataRef$current$open;\n\n if (blockFocusRef.current) {\n return;\n } // Dismiss with click should ignore the subsequent `focus` trigger,\n // but only if the click originated inside the reference element.\n\n\n if (event.type === 'focus' && ((_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type) === 'mousedown' && dataRef.current.openEvent && isEventTargetWithin(dataRef.current.openEvent, refs.domReference.current)) {\n return;\n }\n\n dataRef.current.openEvent = event.nativeEvent;\n onOpenChange(true);\n },\n\n onBlur(event) {\n blockFocusRef.current = false;\n const relatedTarget = event.relatedTarget; // Hit the non-modal focus management portal guard. Focus will be\n // moved into the floating element immediately after.\n\n const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute('data-floating-ui-focus-guard'); // Wait for the window blur listener to fire.\n\n timeoutRef.current = setTimeout(() => {\n // When focusing the reference element (e.g. regular click), then\n // clicking into the floating element, prevent it from hiding.\n // Note: it must be focusable, e.g. `tabindex=\"-1\"`.\n if (contains(refs.floating.current, relatedTarget) || contains(refs.domReference.current, relatedTarget) || movedToFocusGuard) {\n return;\n }\n\n onOpenChange(false);\n });\n }\n\n }\n };\n }, [enabled, keyboardOnly, refs, dataRef, onOpenChange]);\n};\n\nlet isPreventScrollSupported = false;\nconst ARROW_UP = 'ArrowUp';\nconst ARROW_DOWN = 'ArrowDown';\nconst ARROW_LEFT = 'ArrowLeft';\nconst ARROW_RIGHT = 'ArrowRight';\n\nfunction isDifferentRow(index, cols, prevRow) {\n return Math.floor(index / cols) !== prevRow;\n}\n\nfunction isIndexOutOfBounds(listRef, index) {\n return index < 0 || index >= listRef.current.length;\n}\n\nfunction findNonDisabledIndex(listRef, _temp) {\n let {\n startingIndex = -1,\n decrement = false,\n disabledIndices,\n amount = 1\n } = _temp === void 0 ? {} : _temp;\n const list = listRef.current;\n let index = startingIndex;\n\n do {\n var _list$index, _list$index2;\n\n index = index + (decrement ? -amount : amount);\n } while (index >= 0 && index <= list.length - 1 && (disabledIndices ? disabledIndices.includes(index) : list[index] == null || ((_list$index = list[index]) == null ? void 0 : _list$index.hasAttribute('disabled')) || ((_list$index2 = list[index]) == null ? void 0 : _list$index2.getAttribute('aria-disabled')) === 'true'));\n\n return index;\n}\n\nfunction doSwitch(orientation, vertical, horizontal) {\n switch (orientation) {\n case 'vertical':\n return vertical;\n\n case 'horizontal':\n return horizontal;\n\n default:\n return vertical || horizontal;\n }\n}\n\nfunction isMainOrientationKey(key, orientation) {\n const vertical = key === ARROW_UP || key === ARROW_DOWN;\n const horizontal = key === ARROW_LEFT || key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal);\n}\n\nfunction isMainOrientationToEndKey(key, orientation, rtl) {\n const vertical = key === ARROW_DOWN;\n const horizontal = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal) || key === 'Enter' || key == ' ' || key === '';\n}\n\nfunction isCrossOrientationOpenKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n const horizontal = key === ARROW_DOWN;\n return doSwitch(orientation, vertical, horizontal);\n}\n\nfunction isCrossOrientationCloseKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT;\n const horizontal = key === ARROW_UP;\n return doSwitch(orientation, vertical, horizontal);\n}\n\nfunction getMinIndex(listRef, disabledIndices) {\n return findNonDisabledIndex(listRef, {\n disabledIndices\n });\n}\n\nfunction getMaxIndex(listRef, disabledIndices) {\n return findNonDisabledIndex(listRef, {\n decrement: true,\n startingIndex: listRef.current.length,\n disabledIndices\n });\n}\n\n/**\n * Adds focus-managed indexed navigation via arrow keys to a list of items\n * within the floating element.\n * @see https://floating-ui.com/docs/useListNavigation\n */\nconst useListNavigation = function (_ref, _temp2) {\n let {\n open,\n onOpenChange,\n refs\n } = _ref;\n let {\n listRef,\n activeIndex,\n onNavigate: unstable_onNavigate = () => {},\n enabled = true,\n selectedIndex = null,\n allowEscape = false,\n loop = false,\n nested = false,\n rtl = false,\n virtual = false,\n focusItemOnOpen = 'auto',\n focusItemOnHover = true,\n openOnArrowKeyDown = true,\n disabledIndices = undefined,\n orientation = 'vertical',\n cols = 1\n } = _temp2 === void 0 ? {\n listRef: {\n current: []\n },\n activeIndex: null,\n onNavigate: () => {}\n } : _temp2;\n\n if (process.env.NODE_ENV !== \"production\") {\n if (allowEscape) {\n if (!loop) {\n console.warn(['Floating UI: `useListNavigation` looping must be enabled to allow', 'escaping.'].join(' '));\n }\n\n if (!virtual) {\n console.warn(['Floating UI: `useListNavigation` must be virtual to allow', 'escaping.'].join(' '));\n }\n }\n\n if (orientation === 'vertical' && cols > 1) {\n console.warn(['Floating UI: In grid list navigation mode (`cols` > 1), the', '`orientation` should be either \"horizontal\" or \"both\".'].join(' '));\n }\n }\n\n const parentId = useFloatingParentNodeId();\n const tree = useFloatingTree();\n const onNavigate = useEvent(unstable_onNavigate);\n const focusItemOnOpenRef = React.useRef(focusItemOnOpen);\n const indexRef = React.useRef(selectedIndex != null ? selectedIndex : -1);\n const keyRef = React.useRef(null);\n const blockPointerLeaveRef = React.useRef(false);\n const previousOnNavigateRef = React.useRef(onNavigate);\n const previousOpenRef = React.useRef(open);\n const forceSyncFocus = React.useRef(false);\n const disabledIndicesRef = useLatestRef(disabledIndices);\n const latestOpenRef = useLatestRef(open);\n const [activeId, setActiveId] = React.useState();\n const focusItem = React.useCallback((listRef, indexRef) => {\n if (virtual) {\n var _listRef$current$inde;\n\n setActiveId((_listRef$current$inde = listRef.current[indexRef.current]) == null ? void 0 : _listRef$current$inde.id);\n } else {\n const item = listRef.current[indexRef.current];\n enqueueFocus(item, {\n preventScroll: true,\n // Mac Safari does not move the virtual cursor unless the focus call\n // is sync. However, for the very first focus call, we need to wait\n // for the position to be ready in order to prevent unwanted\n // scrolling. This means the virtual cursor will not move to the first\n // item when first opening the floating element, but will on\n // subsequent calls. `preventScroll` is supported in modern Safari,\n // so we can use that instead.\n // iOS Safari must be async or the first item will not be focused.\n sync: isMac() && isSafari() ? isPreventScrollSupported || forceSyncFocus.current : false\n });\n }\n }, [virtual]);\n index(() => {\n document.createElement('div').focus({\n get preventScroll() {\n isPreventScrollSupported = true;\n return false;\n }\n\n });\n }, []); // Sync `selectedIndex` to be the `activeIndex` upon opening the floating\n // element. Also, reset `activeIndex` upon closing the floating element.\n\n index(() => {\n if (!enabled) {\n return;\n }\n\n if (open) {\n if (focusItemOnOpenRef.current && selectedIndex != null) {\n onNavigate(selectedIndex);\n }\n } else if (previousOpenRef.current) {\n // Since the user can specify `onNavigate` conditionally\n // (onNavigate: open ? setActiveIndex : setSelectedIndex),\n // we store and call the previous function\n indexRef.current = -1;\n previousOnNavigateRef.current(null);\n }\n }, [enabled, open, selectedIndex, onNavigate]); // Sync `activeIndex` to be the focused item while the floating element is\n // open.\n\n index(() => {\n if (!enabled) {\n return;\n }\n\n if (open) {\n if (activeIndex == null) {\n forceSyncFocus.current = false;\n\n if (selectedIndex != null) {\n return;\n } // Reset while the floating element was open (e.g. the list changed).\n\n\n if (previousOpenRef.current) {\n indexRef.current = -1;\n focusItem(listRef, indexRef);\n } // Initial sync\n\n\n if (!previousOpenRef.current && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {\n indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, orientation, rtl) || nested ? getMinIndex(listRef, disabledIndicesRef.current) : getMaxIndex(listRef, disabledIndicesRef.current);\n onNavigate(indexRef.current);\n }\n } else if (!isIndexOutOfBounds(listRef, activeIndex)) {\n indexRef.current = activeIndex;\n focusItem(listRef, indexRef);\n }\n }\n }, [enabled, open, activeIndex, selectedIndex, nested, listRef, orientation, rtl, onNavigate, focusItem, disabledIndicesRef]); // Ensure the parent floating element has focus when a nested child closes\n // to allow arrow key navigation to work after the pointer leaves the child.\n\n index(() => {\n if (!enabled) {\n return;\n }\n\n if (previousOpenRef.current && !open) {\n var _tree$nodesRef$curren, _tree$nodesRef$curren2;\n\n const parentFloating = tree == null ? void 0 : (_tree$nodesRef$curren = tree.nodesRef.current.find(node => node.id === parentId)) == null ? void 0 : (_tree$nodesRef$curren2 = _tree$nodesRef$curren.context) == null ? void 0 : _tree$nodesRef$curren2.refs.floating.current;\n\n if (parentFloating && !contains(parentFloating, activeElement(getDocument(parentFloating)))) {\n parentFloating.focus({\n preventScroll: true\n });\n }\n }\n }, [enabled, open, tree, parentId]);\n index(() => {\n keyRef.current = null;\n previousOnNavigateRef.current = onNavigate;\n previousOpenRef.current = open;\n });\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n\n const disabledIndices = disabledIndicesRef.current;\n\n function onKeyDown(event) {\n blockPointerLeaveRef.current = true;\n forceSyncFocus.current = true; // If the floating element is animating out, ignore navigation. Otherwise,\n // the `activeIndex` gets set to 0 despite not being open so the next time\n // the user ArrowDowns, the first item won't be focused.\n\n if (!latestOpenRef.current && event.currentTarget === refs.floating.current) {\n return;\n }\n\n if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl)) {\n stopEvent(event);\n onOpenChange(false);\n\n if (isHTMLElement(refs.domReference.current)) {\n refs.domReference.current.focus();\n }\n\n return;\n }\n\n const currentIndex = indexRef.current;\n const minIndex = getMinIndex(listRef, disabledIndices);\n const maxIndex = getMaxIndex(listRef, disabledIndices);\n\n if (event.key === 'Home') {\n indexRef.current = minIndex;\n onNavigate(indexRef.current);\n }\n\n if (event.key === 'End') {\n indexRef.current = maxIndex;\n onNavigate(indexRef.current);\n } // Grid navigation\n\n\n if (cols > 1) {\n const prevIndex = indexRef.current;\n\n if (event.key === ARROW_UP) {\n stopEvent(event);\n\n if (prevIndex === -1) {\n indexRef.current = maxIndex;\n } else {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex,\n amount: cols,\n decrement: true,\n disabledIndices\n });\n\n if (loop && (prevIndex - cols < minIndex || indexRef.current < 0)) {\n const col = prevIndex % cols;\n const maxCol = maxIndex % cols;\n const offset = maxIndex - (maxCol - col);\n\n if (maxCol === col) {\n indexRef.current = maxIndex;\n } else {\n indexRef.current = maxCol > col ? offset : offset - cols;\n }\n }\n }\n\n if (isIndexOutOfBounds(listRef, indexRef.current)) {\n indexRef.current = prevIndex;\n }\n\n onNavigate(indexRef.current);\n }\n\n if (event.key === ARROW_DOWN) {\n stopEvent(event);\n\n if (prevIndex === -1) {\n indexRef.current = minIndex;\n } else {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex,\n amount: cols,\n disabledIndices\n });\n\n if (loop && prevIndex + cols > maxIndex) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex % cols - cols,\n amount: cols,\n disabledIndices\n });\n }\n }\n\n if (isIndexOutOfBounds(listRef, indexRef.current)) {\n indexRef.current = prevIndex;\n }\n\n onNavigate(indexRef.current);\n } // Remains on the same row/column\n\n\n if (orientation === 'both') {\n const prevRow = Math.floor(prevIndex / cols);\n\n if (event.key === ARROW_RIGHT) {\n stopEvent(event);\n\n if (prevIndex % cols !== cols - 1) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex,\n disabledIndices\n });\n\n if (loop && isDifferentRow(indexRef.current, cols, prevRow)) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n }\n } else if (loop) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n }\n\n if (isDifferentRow(indexRef.current, cols, prevRow)) {\n indexRef.current = prevIndex;\n }\n }\n\n if (event.key === ARROW_LEFT) {\n stopEvent(event);\n\n if (prevIndex % cols !== 0) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex,\n disabledIndices,\n decrement: true\n });\n\n if (loop && isDifferentRow(indexRef.current, cols, prevRow)) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n }\n } else if (loop) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n }\n\n if (isDifferentRow(indexRef.current, cols, prevRow)) {\n indexRef.current = prevIndex;\n }\n }\n\n const lastRow = Math.floor(maxIndex / cols) === prevRow;\n\n if (isIndexOutOfBounds(listRef, indexRef.current)) {\n if (loop && lastRow) {\n indexRef.current = event.key === ARROW_LEFT ? maxIndex : findNonDisabledIndex(listRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n } else {\n indexRef.current = prevIndex;\n }\n }\n\n onNavigate(indexRef.current);\n return;\n }\n }\n\n if (isMainOrientationKey(event.key, orientation)) {\n stopEvent(event); // Reset the index if no item is focused.\n\n if (open && !virtual && activeElement(event.currentTarget.ownerDocument) === event.currentTarget) {\n indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;\n onNavigate(indexRef.current);\n return;\n }\n\n if (isMainOrientationToEndKey(event.key, orientation, rtl)) {\n if (loop) {\n indexRef.current = currentIndex >= maxIndex ? allowEscape && currentIndex !== listRef.current.length ? -1 : minIndex : findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n disabledIndices\n });\n } else {\n indexRef.current = Math.min(maxIndex, findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n disabledIndices\n }));\n }\n } else {\n if (loop) {\n indexRef.current = currentIndex <= minIndex ? allowEscape && currentIndex !== -1 ? listRef.current.length : maxIndex : findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n });\n } else {\n indexRef.current = Math.max(minIndex, findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n }));\n }\n }\n\n if (isIndexOutOfBounds(listRef, indexRef.current)) {\n onNavigate(null);\n } else {\n onNavigate(indexRef.current);\n }\n }\n }\n\n function checkVirtualMouse(event) {\n if (focusItemOnOpen === 'auto' && isVirtualClick(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n\n function checkVirtualPointer(event) {\n // `pointerdown` fires first, reset the state then perform the checks.\n focusItemOnOpenRef.current = focusItemOnOpen;\n\n if (focusItemOnOpen === 'auto' && isVirtualPointerEvent(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n\n return {\n reference: { ...(virtual && open && activeIndex != null && {\n 'aria-activedescendant': activeId\n }),\n\n onKeyDown(event) {\n blockPointerLeaveRef.current = true;\n const isArrowKey = event.key.indexOf('Arrow') === 0;\n\n if (virtual && open) {\n return onKeyDown(event);\n } // If a floating element should not open on arrow key down, avoid\n // setting `activeIndex` while it's closed.\n\n\n if (!open && !openOnArrowKeyDown && isArrowKey) {\n return;\n }\n\n const isNavigationKey = isArrowKey || event.key === 'Enter' || event.key === ' ' || event.key === '';\n\n if (isNavigationKey) {\n keyRef.current = event.key;\n }\n\n if (nested) {\n if (isCrossOrientationOpenKey(event.key, orientation, rtl)) {\n stopEvent(event);\n\n if (open) {\n indexRef.current = getMinIndex(listRef, disabledIndices);\n onNavigate(indexRef.current);\n } else {\n onOpenChange(true);\n }\n }\n\n return;\n }\n\n if (isMainOrientationKey(event.key, orientation)) {\n if (selectedIndex != null) {\n indexRef.current = selectedIndex;\n }\n\n stopEvent(event);\n\n if (!open && openOnArrowKeyDown) {\n onOpenChange(true);\n } else {\n onKeyDown(event);\n }\n\n if (open) {\n onNavigate(indexRef.current);\n }\n }\n },\n\n onFocus() {\n if (open) {\n onNavigate(null);\n }\n },\n\n onPointerDown: checkVirtualPointer,\n onMouseDown: checkVirtualMouse,\n onClick: checkVirtualMouse\n },\n floating: {\n 'aria-orientation': orientation === 'both' ? undefined : orientation,\n ...(virtual && activeIndex != null && {\n 'aria-activedescendant': activeId\n }),\n onKeyDown,\n\n onPointerMove() {\n blockPointerLeaveRef.current = false;\n }\n\n },\n item: {\n onFocus(_ref2) {\n let {\n currentTarget\n } = _ref2;\n const index = listRef.current.indexOf(currentTarget);\n\n if (index !== -1 && activeIndex !== index) {\n onNavigate(index);\n }\n },\n\n onClick: _ref3 => {\n let {\n currentTarget\n } = _ref3;\n return currentTarget.focus({\n preventScroll: true\n });\n },\n // Safari\n ...(focusItemOnHover && {\n onMouseMove(_ref4) {\n let {\n currentTarget\n } = _ref4;\n const target = currentTarget;\n\n if (target) {\n const index = listRef.current.indexOf(target);\n\n if (index !== -1 && activeIndex !== index) {\n onNavigate(index);\n }\n }\n },\n\n onPointerLeave() {\n if (!blockPointerLeaveRef.current) {\n indexRef.current = -1;\n focusItem(listRef, indexRef); // Virtual cursor with VoiceOver on iOS needs this to be flushed\n // synchronously or there is a glitch that prevents nested\n // submenus from being accessible.\n\n flushSync(() => onNavigate(null));\n\n if (!virtual) {\n var _refs$floating$curren;\n\n // This also needs to be sync to prevent fast mouse movements\n // from leaving behind a stale active item when landing on a\n // disabled button item.\n (_refs$floating$curren = refs.floating.current) == null ? void 0 : _refs$floating$curren.focus({\n preventScroll: true\n });\n }\n }\n }\n\n })\n }\n };\n }, [activeId, disabledIndicesRef, latestOpenRef, listRef, enabled, orientation, rtl, virtual, open, activeIndex, nested, selectedIndex, openOnArrowKeyDown, focusItemOnHover, allowEscape, cols, loop, refs, focusItemOnOpen, focusItem, onNavigate, onOpenChange]);\n};\n\n/**\n * Provides a matching callback that can be used to focus an item as the user\n * types, often used in tandem with `useListNavigation()`.\n * @see https://floating-ui.com/docs/useTypeahead\n */\nconst useTypeahead = function (_ref, _temp) {\n var _ref2;\n\n let {\n open,\n dataRef\n } = _ref;\n let {\n listRef,\n activeIndex,\n onMatch: unstable_onMatch = () => {},\n enabled = true,\n findMatch = null,\n resetMs = 1000,\n ignoreKeys = [],\n selectedIndex = null\n } = _temp === void 0 ? {\n listRef: {\n current: []\n },\n activeIndex: null\n } : _temp;\n const timeoutIdRef = React.useRef();\n const stringRef = React.useRef('');\n const prevIndexRef = React.useRef((_ref2 = selectedIndex != null ? selectedIndex : activeIndex) != null ? _ref2 : -1);\n const matchIndexRef = React.useRef(null);\n const onMatch = useEvent(unstable_onMatch);\n const findMatchRef = useLatestRef(findMatch);\n const ignoreKeysRef = useLatestRef(ignoreKeys);\n index(() => {\n if (open) {\n clearTimeout(timeoutIdRef.current);\n matchIndexRef.current = null;\n stringRef.current = '';\n }\n }, [open]);\n index(() => {\n // Sync arrow key navigation but not typeahead navigation\n if (open && stringRef.current === '') {\n var _ref3;\n\n prevIndexRef.current = (_ref3 = selectedIndex != null ? selectedIndex : activeIndex) != null ? _ref3 : -1;\n }\n }, [open, selectedIndex, activeIndex]);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n\n function onKeyDown(event) {\n // Correctly scope nested non-portalled floating elements. Since the nested\n // floating element is inside of the another, we find the closest role\n // that indicates the floating element scope.\n const target = getTarget(event.nativeEvent);\n\n if (isElement(target) && (activeElement(getDocument(target)) !== event.currentTarget ? target.closest('[role=\"dialog\"],[role=\"menu\"],[role=\"listbox\"],[role=\"tree\"],[role=\"grid\"]') !== event.currentTarget : false)) {\n return;\n }\n\n if (stringRef.current.length > 0 && stringRef.current[0] !== ' ') {\n dataRef.current.typing = true;\n\n if (event.key === ' ') {\n stopEvent(event);\n }\n }\n\n const listContent = listRef.current;\n\n if (listContent == null || ignoreKeysRef.current.includes(event.key) || // Character key\n event.key.length !== 1 || // Modifier key\n event.ctrlKey || event.metaKey || event.altKey) {\n return;\n } // Bail out if the list contains a word like \"llama\" or \"aaron\". TODO:\n // allow it in this case, too.\n\n\n const allowRapidSuccessionOfFirstLetter = listContent.every(text => {\n var _text$, _text$2;\n\n return text ? ((_text$ = text[0]) == null ? void 0 : _text$.toLocaleLowerCase()) !== ((_text$2 = text[1]) == null ? void 0 : _text$2.toLocaleLowerCase()) : true;\n }); // Allows the user to cycle through items that start with the same letter\n // in rapid succession\n\n if (allowRapidSuccessionOfFirstLetter && stringRef.current === event.key) {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n }\n\n stringRef.current += event.key;\n clearTimeout(timeoutIdRef.current);\n timeoutIdRef.current = setTimeout(() => {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n dataRef.current.typing = false;\n }, resetMs);\n const prevIndex = prevIndexRef.current;\n const orderedList = [...listContent.slice((prevIndex != null ? prevIndex : 0) + 1), ...listContent.slice(0, (prevIndex != null ? prevIndex : 0) + 1)];\n const str = findMatchRef.current ? findMatchRef.current(orderedList, stringRef.current) : orderedList.find(text => (text == null ? void 0 : text.toLocaleLowerCase().indexOf(stringRef.current.toLocaleLowerCase())) === 0);\n const index = str ? listContent.indexOf(str) : -1;\n\n if (index !== -1) {\n onMatch(index);\n matchIndexRef.current = index;\n }\n }\n\n return {\n reference: {\n onKeyDown\n },\n floating: {\n onKeyDown\n }\n };\n }, [enabled, dataRef, listRef, resetMs, ignoreKeysRef, findMatchRef, onMatch]);\n};\n\nexport { FloatingDelayGroup, FloatingFocusManager, FloatingNode, FloatingOverlay, FloatingPortal, FloatingTree, inner, safePolygon, useClick, useDelayGroup, useDelayGroupContext, useDismiss, useFloating, useFloatingNodeId, useFloatingParentNodeId, useFloatingPortalNode, useFloatingTree, useFocus, useHover, useId, useInnerOffset, useInteractions, useListNavigation, useRole, useTypeahead };\n","import { arrow as arrow$1, computePosition } from '@floating-ui/dom';\nexport { autoPlacement, autoUpdate, computePosition, detectOverflow, flip, getOverflowAncestors, hide, inline, limitShift, offset, platform, shift, size } from '@floating-ui/dom';\nimport * as React from 'react';\nimport { useLayoutEffect, useEffect } from 'react';\nimport * as ReactDOM from 'react-dom';\n\n/**\n * A data provider that provides data to position an inner element of the\n * floating element (usually a triangle or caret) so that it is centered to the\n * reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => {\n const {\n element,\n padding\n } = options;\n function isRef(value) {\n return Object.prototype.hasOwnProperty.call(value, 'current');\n }\n return {\n name: 'arrow',\n options,\n fn(args) {\n if (isRef(element)) {\n if (element.current != null) {\n return arrow$1({\n element: element.current,\n padding\n }).fn(args);\n }\n return {};\n } else if (element) {\n return arrow$1({\n element,\n padding\n }).fn(args);\n }\n return {};\n }\n };\n};\n\nvar index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\n\n// Fork of `fast-deep-equal` that only does the comparisons we need and compares\n// functions\nfunction deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (typeof a === 'function' && a.toString() === b.toString()) {\n return true;\n }\n let length, i, keys;\n if (a && b && typeof a == 'object') {\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;) {\n if (!deepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) {\n return false;\n }\n for (i = length; i-- !== 0;) {\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) {\n return false;\n }\n }\n for (i = length; i-- !== 0;) {\n const key = keys[i];\n if (key === '_owner' && a.$$typeof) {\n continue;\n }\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n return a !== a && b !== b;\n}\n\nfunction useLatestRef(value) {\n const ref = React.useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\n\n/**\n * Provides data to position a floating element.\n * @see https://floating-ui.com/docs/react\n */\nfunction useFloating(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform,\n whileElementsMounted,\n open\n } = options;\n const [data, setData] = React.useState({\n x: null,\n y: null,\n strategy,\n placement,\n middlewareData: {},\n isPositioned: false\n });\n const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);\n if (!deepEqual(latestMiddleware, middleware)) {\n setLatestMiddleware(middleware);\n }\n const referenceRef = React.useRef(null);\n const floatingRef = React.useRef(null);\n const dataRef = React.useRef(data);\n const whileElementsMountedRef = useLatestRef(whileElementsMounted);\n const platformRef = useLatestRef(platform);\n const [reference, _setReference] = React.useState(null);\n const [floating, _setFloating] = React.useState(null);\n const setReference = React.useCallback(node => {\n if (referenceRef.current !== node) {\n referenceRef.current = node;\n _setReference(node);\n }\n }, []);\n const setFloating = React.useCallback(node => {\n if (floatingRef.current !== node) {\n floatingRef.current = node;\n _setFloating(node);\n }\n }, []);\n const update = React.useCallback(() => {\n if (!referenceRef.current || !floatingRef.current) {\n return;\n }\n const config = {\n placement,\n strategy,\n middleware: latestMiddleware\n };\n if (platformRef.current) {\n config.platform = platformRef.current;\n }\n computePosition(referenceRef.current, floatingRef.current, config).then(data => {\n const fullData = {\n ...data,\n isPositioned: true\n };\n if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {\n dataRef.current = fullData;\n ReactDOM.flushSync(() => {\n setData(fullData);\n });\n }\n });\n }, [latestMiddleware, placement, strategy, platformRef]);\n index(() => {\n if (open === false && dataRef.current.isPositioned) {\n dataRef.current.isPositioned = false;\n setData(data => ({\n ...data,\n isPositioned: false\n }));\n }\n }, [open]);\n const isMountedRef = React.useRef(false);\n index(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n index(() => {\n if (reference && floating) {\n if (whileElementsMountedRef.current) {\n return whileElementsMountedRef.current(reference, floating, update);\n } else {\n update();\n }\n }\n }, [reference, floating, update, whileElementsMountedRef]);\n const refs = React.useMemo(() => ({\n reference: referenceRef,\n floating: floatingRef,\n setReference,\n setFloating\n }), [setReference, setFloating]);\n const elements = React.useMemo(() => ({\n reference,\n floating\n }), [reference, floating]);\n return React.useMemo(() => ({\n ...data,\n update,\n refs,\n elements,\n reference: setReference,\n floating: setFloating\n }), [data, update, refs, elements, setReference, setFloating]);\n}\n\nexport { arrow, useFloating };\n"],"names":["index","document","react__WEBPACK_IMPORTED_MODULE_0__","useLayoutEffect","useEffect","react__WEBPACK_IMPORTED_MODULE_0___namespace_cache","__webpack_require__","t","toString","FloatingNodeContext","createContext","FloatingTreeContext","useFloatingParentNodeId","_React$useContext$id","_React$useContext","useContext","id","useFloatingTree","getDocument","floating","_floating$ownerDocume","ownerDocument","getWindow","value","_getDocument$defaultV","defaultView","window","isElement","Element","isHTMLElement","HTMLElement","useSafeInsertionEffect","useInsertionEffect","fn","useFloating","_temp","open","onOpenChange","unstable_onOpenChange","whileElementsMounted","placement","middleware","strategy","nodeId","domReference","setDomReference","useState","tree","domReferenceRef","useRef","dataRef","events","createPubSub","map","Map","emit","event","data","_map$get","get","forEach","handler","on","listener","set","off","filter","l","position","_floating_ui_react_dom__WEBPACK_IMPORTED_MODULE_2__","YF","useEvent","callback","ref","current","useCallback","_len","arguments","length","args","_key","refs","useMemo","context","_","node","nodesRef","find","reference","setReference","mergeProps","userProps","propsList","elementKey","tabIndex","concat","reduce","acc","props","Object","entries","_ref","key","indexOf","has","push","_map$get2","useInteractions","deps","getReferenceProps","getFloatingProps","getItemProps","contains","parent","child","rootNode","getRootNode","isShadowRoot","ShadowRoot","OwnElement","next","parentNode","host","getChildren","nodes","_nodes$filter","_nodes$filter2","allChildren","_node$context","parentId","currentChildren","_currentChildren","some","n","_node$context2","getTarget","composedPath","target","safePolygon","timeoutId","restMs","buffer","blockPointerEvents","debug","polygonIsDestroyed","x","y","onClose","leave","close","clearTimeout","clientX","clientY","type","relatedTarget","_ref2","refRect","getBoundingClientRect","rect","side","split","cursorLeaveFromRight","right","width","cursorLeaveFromBottom","bottom","height","top","left","isPointInPolygon","point","polygon","isInside","i","j","xi","yi","xj","yj","getPolygon","_ref3","isFloatingWider","isFloatingTaller","commonPoints","setTimeout","__options","useLatestRef","mouseLikePointerTypes","undefined","getDelay","prop","pointerType","includes","useHover","enabled","delay","handleClose","mouseOnly","move","handleCloseRef","delayRef","pointerTypeRef","timeoutRef","handlerRef","restTimeoutRef","blockMouseMoveRef","performedPointerEventsMutationRef","isHoverOpen","_dataRef$current$open","openEvent","onDismiss","onLeave","html","documentElement","addEventListener","removeEventListener","closeWithDelay","runElseBranch","closeDelay","cleanupMouseMoveHandler","clearPointerEvents","body","style","pointerEvents","isClickLikeOpenEvent","onMouseEnter","openDelay","onMouseLeave","doc","onScrollMouseLeave","once","_tree$nodesRef$curren","_tree$nodesRef$curren2","parentFloating","setPointerRef","onPointerDown","onPointerEnter","onMouseMove","isButtonTarget","tagName","isSpaceIgnored","element","matches","useClick","eventOption","toggle","ignoreMouse","keyboardHandlers","onMouseDown","button","preventDefault","nativeEvent","onClick","onKeyDown","onKeyUp","isEventTargetWithin","e","bubbleHandlerKeys","pointerdown","mousedown","click","captureHandlerKeys","useDismiss","escapeKey","outsidePress","outsidePressEvent","referencePress","referencePressEvent","ancestorScroll","bubbles","nested","outsidePressRef","insideReactTreeRef","returnFocus","preventScroll","onOutsidePress","_refs$floating$curren","insideReactTree","win","canScrollX","scrollWidth","clientWidth","canScrollY","scrollHeight","clientHeight","xCond","offsetX","getComputedStyle","direction","offsetWidth","offsetY","targetIsInsideChildren","isVirtualClick","mozInputSource","isTrusted","androidRe","test","getPlatform","uaData","navigator","userAgentData","platform","getUserAgent","Array","isArray","brands","brand","version","join","userAgent","buttons","detail","pressure","onScroll","ancestors","_floating_ui_react_dom__WEBPACK_IMPORTED_MODULE_3__","Kx","contextElement","ancestor","_doc$defaultView","visualViewport","passive","arrow","options","padding","name","prototype","hasOwnProperty","call","_floating_ui_dom__WEBPACK_IMPORTED_MODULE_2__","x7","deepEqual","a","b","keys","$$typeof","setData","middlewareData","isPositioned","latestMiddleware","setLatestMiddleware","referenceRef","floatingRef","whileElementsMountedRef","platformRef","_setReference","_setFloating","setFloating","update","config","oo","then","fullData","isMountedRef","react_dom__WEBPACK_IMPORTED_MODULE_1__","flushSync","elements"],"sourceRoot":""}