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