@floating-ui/react
Advanced tools
Comparing version 0.24.3 to 0.24.4
@@ -1,1 +0,1 @@ | ||
import{platform as e,getOverflowAncestors as t,useFloating as n,offset as r,detectOverflow as o}from"@floating-ui/react-dom";export{arrow,autoPlacement,autoUpdate,computePosition,detectOverflow,flip,getOverflowAncestors,hide,inline,limitShift,offset,platform,shift,size}from"@floating-ui/react-dom";import*as u from"react";import{useLayoutEffect as i,useEffect as c,useRef as l}from"react";import{hideOthers as s}from"aria-hidden";import{tabbable as a}from"tabbable";import{createPortal as f,flushSync as d}from"react-dom";function m(){return m=Object.assign||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},m.apply(this,arguments)}var v="undefined"!=typeof document?i:c;let p=!1,g=0;const h=()=>"floating-ui-"+g++;const b=u["useId".toString()]||function(){const[e,t]=u.useState((()=>p?h():void 0));return v((()=>{null==e&&t(h())}),[]),u.useEffect((()=>{p||(p=!0)}),[]),e},y=u.forwardRef((function(t,n){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i}},width:c=14,height:l=7,tipRadius:s=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:v,style:{transform:p,...g}={},...h}=t;const y=b();if(!o)return null;a*=2;const E=a/2,w=c/2*(s/-8+1),R=l/2*s/4,[x,I]=r.split("-"),k=e.isRTL(o),C=!!v,M="top"===x||"bottom"===x,T=f&&"end"===I?"bottom":"top";let O=f&&"end"===I?"right":"left";f&&k&&(O="end"===I?"left":"right");const A=null!=(null==i?void 0:i.x)?f||i.x:"",L=null!=(null==i?void 0:i.y)?f||i.y:"",P=v||"M0,0 H"+c+" L"+(c-w)+","+(l-R)+" Q"+c/2+","+l+" "+w+","+(l-R)+" Z",S={top:C?"rotate(180deg)":"",left:C?"rotate(90deg)":"rotate(-90deg)",bottom:C?"":"rotate(180deg)",right:C?"rotate(-90deg)":"rotate(90deg)"}[x];return u.createElement("svg",m({},h,{"aria-hidden":!0,ref:n,width:C?c:c+a,height:c,viewBox:"0 0 "+c+" "+(l>c?l:c),style:{position:"absolute",pointerEvents:"none",[O]:A,[T]:L,[x]:M||C?"100%":"calc(100% - "+a/2+"px)",transform:""+S+(null!=p?p:""),...g}}),a>0&&u.createElement("path",{clipPath:"url(#"+y+")",fill:"none",stroke:d,strokeWidth:a+(v?0:1),d:P}),u.createElement("path",{stroke:a&&!v?h.fill:"none",d:P}),u.createElement("clipPath",{id:y},u.createElement("rect",{x:-E,y:E*(C?-1:1),width:c+a,height:c})))}));function E(){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 w=u.createContext(null),R=u.createContext(null),x=()=>{var e;return(null==(e=u.useContext(w))?void 0:e.id)||null},I=()=>u.useContext(R);function k(e){const t=b(),n=I(),r=x(),o=e||r;return v((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t}function C(e){let{children:t,id:n}=e;const r=x();return u.createElement(w.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)}function M(e){let{children:t}=e;const n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),i=u.useState((()=>E()))[0];return u.createElement(R.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:i})),[n,r,o,i])},t)}function T(e){return(null==e?void 0:e.ownerDocument)||document}function O(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function A(){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 L(e){return T(e).defaultView||window}function P(e){return!!e&&e instanceof L(e).Element}function S(e){return!!e&&e instanceof L(e).HTMLElement}function D(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(O())||t.test(A()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function N(e){return 0===e.width&&0===e.height||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}function F(){return/apple/i.test(navigator.vendor)}function K(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function B(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&(r=n,"undefined"!=typeof ShadowRoot&&(r instanceof L(r).ShadowRoot||r instanceof ShadowRoot))){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}var r;return!1}function H(e){const t=l(e);return v((()=>{t.current=e})),t}function _(e,t,n){return n&&!K(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function q(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:c,floating:l},refs:s}=e,{enabled:a=!0,delay:f=0,handleClose:d=null,mouseOnly:m=!1,restMs:p=0,move:g=!0}=t,h=I(),b=x(),y=H(d),E=H(f),w=u.useRef(),R=u.useRef(),k=u.useRef(),C=u.useRef(),M=u.useRef(!0),O=u.useRef(!1),A=u.useRef((()=>{})),L=u.useCallback((()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[o]);u.useEffect((()=>{if(a)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(){clearTimeout(R.current),clearTimeout(C.current),M.current=!0}}),[a,i]),u.useEffect((()=>{if(!a||!y.current||!n)return;function e(e){L()&&r(!1,e)}const t=T(l).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[l,n,r,a,y,o,L]);const S=u.useCallback((function(e,t){void 0===t&&(t=!0);const n=_(E.current,"close",w.current);n&&!k.current?(clearTimeout(R.current),R.current=setTimeout((()=>r(!1,e)),n)):t&&(clearTimeout(R.current),r(!1,e))}),[E,r]),D=u.useCallback((()=>{A.current(),k.current=void 0}),[]),N=u.useCallback((()=>{if(O.current){const e=T(s.floating.current).body;e.style.pointerEvents="",e.removeAttribute("data-floating-ui-safe-polygon"),O.current=!1}}),[s]);return u.useEffect((()=>{if(a&&P(c)){const e=c;return n&&e.addEventListener("mouseleave",s),null==l||l.addEventListener("mouseleave",s),g&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",i),()=>{n&&e.removeEventListener("mouseleave",s),null==l||l.removeEventListener("mouseleave",s),g&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(R.current),M.current=!1,m&&!K(w.current)||p>0&&0===_(E.current,"open"))return;const t=_(E.current,"open",w.current);t?R.current=setTimeout((()=>{r(!0,e)}),t):r(!0,e)}function i(r){if(t())return;A.current();const o=T(l);if(clearTimeout(C.current),y.current){n||clearTimeout(R.current),k.current=y.current({...e,tree:h,x:r.clientX,y:r.clientY,onClose(){N(),D(),S(r)}});const t=k.current;return o.addEventListener("mousemove",t),void(A.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==w.current||!B(l,r.relatedTarget))&&S(r)}function s(n){t()||null==y.current||y.current({...e,tree:h,x:n.clientX,y:n.clientY,onClose(){N(),D(),S(n)}})(n)}}),[c,l,a,e,m,p,g,S,D,N,r,n,h,E,y,o]),v((()=>{var e;if(a&&n&&null!=(e=y.current)&&e.__options.blockPointerEvents&&L()){const e=T(l).body;if(e.setAttribute("data-floating-ui-safe-polygon",""),e.style.pointerEvents="none",O.current=!0,P(c)&&l){var t,r;const e=c,n=null==h||null==(t=h.nodesRef.current.find((e=>e.id===b)))||null==(r=t.context)?void 0:r.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{e.style.pointerEvents="",l.style.pointerEvents=""}}}}),[a,n,b,l,c,h,y,o,L]),v((()=>{n||(w.current=void 0,D(),N())}),[n,D,N]),u.useEffect((()=>()=>{D(),clearTimeout(R.current),clearTimeout(C.current),N()}),[a,D,N]),u.useMemo((()=>{if(!a)return{};function e(e){w.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===p||(clearTimeout(C.current),C.current=setTimeout((()=>{M.current||r(!0,e.nativeEvent)}),p))}},floating:{onMouseEnter(){clearTimeout(R.current)},onMouseLeave(e){i.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),S(e.nativeEvent,!1)}}}}),[i,a,p,n,r,S])}const j=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),W=()=>u.useContext(j),U=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,i]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=u.useRef(null),l=u.useCallback((e=>{i({currentId:e})}),[]);return v((()=>{o.currentId?null===c.current?c.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),c.current=null)}),[o.currentId]),u.createElement(j.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:l})),[o,i,l])},t)},V=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:u,setCurrentId:i,initialDelay:c,setState:l,timeoutMs:s}=W();v((()=>{u&&(l({delay:{open:1,close:_(c,"close")}}),u!==o&&r(!1))}),[o,r,l,u,c]),v((()=>{function e(){r(!1),l({delay:c,currentId:null})}if(!n&&u===o){if(s){const t=window.setTimeout(e,s);return()=>{clearTimeout(t)}}e()}}),[n,l,u,o,r,c,s]),v((()=>{n&&i(o)}),[n,i,o])};function X(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}let Y=0;function z(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Y);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():Y=requestAnimationFrame(u)}function Z(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}function G(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Q(e){return S(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function J(e){e.preventDefault(),e.stopPropagation()}const $=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ee(e,t){const n=a(e,$());"prev"===t&&n.reverse();const r=n.indexOf(X(T(e)));return n.slice(r+1)[0]}function te(){return ee(document.body,"next")}function ne(){return ee(document.body,"prev")}function re(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!B(n,r)}function oe(e){a(e,$()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function ue(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 ie={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 ce(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const le=u.forwardRef((function(e,t){const[n,r]=u.useState();return v((()=>(F()&&r("button"),document.addEventListener("keydown",ce),()=>{document.removeEventListener("keydown",ce)})),[]),u.createElement("span",m({},e,{ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,"data-floating-ui-focus-guard":"",style:ie}))})),se=u.createContext(null);function ae(e){let{id:t,root:n}=void 0===e?{}:e;const[r,o]=u.useState(null),i=b(),c=de(),l=u.useMemo((()=>({id:t,root:n,portalContext:c,uniqueId:i})),[t,n,c,i]),s=u.useRef();return v((()=>()=>{null==r||r.remove()}),[r,l]),v((()=>{if(s.current===l)return;s.current=l;const{id:e,root:t,portalContext:n,uniqueId:r}=l,u=e?document.getElementById(e):null,i="data-floating-ui-portal";if(u){const e=document.createElement("div");e.id=r,e.setAttribute(i,""),u.appendChild(e),o(e)}else{let u=t||(null==n?void 0:n.portalNode);u&&!P(u)&&(u=u.current),u=u||document.body;let c=null;e&&(c=document.createElement("div"),c.id=e,u.appendChild(c));const l=document.createElement("div");l.id=r,l.setAttribute(i,""),u=c||u,u.appendChild(l),o(l)}}),[l]),r}function fe(e){let{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e;const i=ae({id:n,root:r}),[c,l]=u.useState(null),s=u.useRef(null),a=u.useRef(null),d=u.useRef(null),m=u.useRef(null),v=!!c&&!c.modal&&c.open&&o&&!(!r&&!i);return u.useEffect((()=>{if(i&&o&&(null==c||!c.modal))return i.addEventListener("focusin",e,!0),i.addEventListener("focusout",e,!0),()=>{i.removeEventListener("focusin",e,!0),i.removeEventListener("focusout",e,!0)};function e(e){if(i&&re(e)){("focusin"===e.type?ue:oe)(i)}}}),[i,o,null==c?void 0:c.modal]),u.createElement(se.Provider,{value:u.useMemo((()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:a,beforeInsideRef:d,afterInsideRef:m,portalNode:i,setFocusManagerState:l})),[o,i])},v&&i&&u.createElement(le,{"data-type":"outside",ref:s,onFocus:e=>{if(re(e,i)){var t;null==(t=d.current)||t.focus()}else{const e=ne()||(null==c?void 0:c.refs.domReference.current);null==e||e.focus()}}}),v&&i&&u.createElement("span",{"aria-owns":i.id,style:ie}),i&&f(t,i),v&&i&&u.createElement(le,{"data-type":"outside",ref:a,onFocus:e=>{if(re(e,i)){var t;null==(t=m.current)||t.focus()}else{const t=te()||(null==c?void 0:c.refs.domReference.current);null==t||t.focus(),(null==c?void 0:c.closeOnFocusOut)&&(null==c||c.onOpenChange(!1,e.nativeEvent))}}}))}const de=()=>u.useContext(se),me=u.forwardRef((function(e,t){return u.createElement("button",m({},e,{type:"button",ref:t,tabIndex:-1,style:ie}))}));function ve(e){const{context:t,children:n,order:r=["content"],guards:o=!0,initialFocus:i=0,returnFocus:c=!0,modal:l=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:d=!0}=e,{open:m,refs:p,nodeId:g,onOpenChange:h,events:b,dataRef:y,elements:{domReference:E,floating:w}}=t,R=H(r),x=H(i),k=H(c),C=I(),M=de(),O="number"==typeof i&&i<0,A=u.useRef(null),L=u.useRef(null),P=u.useRef(!1),D=u.useRef(null),N=u.useRef(!1),F=null!=M,K=E&&"combobox"===E.getAttribute("role")&&Q(E),_=u.useCallback((function(e){return void 0===e&&(e=w),e?a(e,$()):[]}),[w]),q=u.useCallback((e=>{const t=_(e);return R.current.map((e=>E&&"reference"===e?E:w&&"floating"===e?w:t)).filter(Boolean).flat()}),[E,w,R,_]);function j(e){return f&&l?u.createElement(me,{ref:"start"===e?A:L,onClick:e=>h(!1,e.nativeEvent)},"string"==typeof f?f:"Dismiss"):null}u.useEffect((()=>{if(!l)return;function e(e){if("Tab"===e.key){B(w,X(T(w)))&&0===_().length&&!K&&J(e);const t=q(),n=G(e);"reference"===R.current[0]&&n===E&&(J(e),e.shiftKey?z(t[t.length-1]):z(t[1])),"floating"===R.current[1]&&n===w&&e.shiftKey&&(J(e),z(t[0]))}}const t=T(w);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[E,w,l,R,p,K,_,q]),u.useEffect((()=>{if(d)return w&&S(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),!l&&w.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),!l&&w.removeEventListener("focusout",t)}):void 0;function e(){N.current=!0,setTimeout((()=>{N.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(B(E,t)||B(w,t)||B(t,w)||B(null==M?void 0:M.portalNode,t)||null!=t&&t.hasAttribute("data-floating-ui-focus-guard")||C&&(Z(C.nodesRef.current,g).find((e=>{var n,r;return B(null==(n=e.context)?void 0:n.elements.floating,t)||B(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(C.nodesRef.current,g).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!N.current&&t!==D.current&&(P.current=!0,h(!1,e))}))}}),[E,w,l,g,C,M,h,d]),u.useEffect((()=>{var e;const t=Array.from((null==M||null==(e=M.portalNode)?void 0:e.querySelectorAll("[data-floating-ui-portal]"))||[]);if(w&&l){const e=[w,...t,...[A.current,L.current].filter(Boolean)],n=s(R.current.includes("reference")||K?e.concat(E||[]):e);return()=>{n()}}}),[E,w,l,R,M,K]),u.useEffect((()=>{if(l&&!o&&w){const e=[],t=$(),n=a(T(w).body,t),r=q(),o=n.filter((e=>!r.includes(e)));return o.forEach(((t,n)=>{e[n]=t.getAttribute("tabindex"),t.setAttribute("tabindex","-1")})),()=>{o.forEach(((t,n)=>{const r=e[n];null==r?t.removeAttribute("tabindex"):t.setAttribute("tabindex",r)}))}}}),[w,l,o,q]),v((()=>{if(!w)return;const e=X(T(w));queueMicrotask((()=>{const t=q(w),n=x.current,r=("number"==typeof n?t[n]:n.current)||w,o=B(w,e);O||o||!m||z(r,{preventScroll:r===w})}))}),[m,w,O,q,x]),v((()=>{if(!w)return;let e=!1;const t=T(w),n=X(t),r=y.current;function o(t){if("escapeKey"===t.type&&p.domReference.current&&(D.current=p.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(P.current=!1,e=n.preventScroll):P.current=!n}return D.current=n,b.on("dismiss",o),()=>{b.off("dismiss",o);const n=X(t);(B(w,n)||C&&Z(C.nodesRef.current,g).some((e=>{var t;return B(null==(t=e.context)?void 0:t.elements.floating,n)}))||r.openEvent&&["click","mousedown"].includes(r.openEvent.type))&&p.domReference.current&&(D.current=p.domReference.current),k.current&&S(D.current)&&!P.current&&z(D.current,{cancelPrevious:!1,preventScroll:e})}}),[w,k,y,p,b,C,g]),v((()=>{if(M)return M.setFocusManagerState({...t,modal:l,closeOnFocusOut:d,open:m}),()=>{M.setFocusManagerState(null)}}),[M,l,m,d,t]),v((()=>{if(w&&"function"==typeof MutationObserver){const e=()=>{const e=w.getAttribute("tabindex");R.current.includes("floating")||X(T(w))!==p.domReference.current&&0===_().length?"0"!==e&&w.setAttribute("tabindex","0"):"-1"!==e&&w.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(w,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[w,p,R,_]);const W=o&&!K&&(F||l);return u.createElement(u.Fragment,null,W&&u.createElement(le,{"data-type":"inside",ref:null==M?void 0:M.beforeInsideRef,onFocus:e=>{if(l){const e=q();z("reference"===r[0]?e[0]:e[e.length-1])}else if(null!=M&&M.preserveTabOrder&&M.portalNode)if(P.current=!1,re(e,M.portalNode)){const e=te()||E;null==e||e.focus()}else{var t;null==(t=M.beforeOutsideRef.current)||t.focus()}}}),!K&&j("start"),n,j("end"),W&&u.createElement(le,{"data-type":"inside",ref:null==M?void 0:M.afterInsideRef,onFocus:e=>{if(l)z(q()[0]);else if(null!=M&&M.preserveTabOrder&&M.portalNode)if(d&&(P.current=!0),re(e,M.portalNode)){const e=ne()||E;null==e||e.focus()}else{var t;null==(t=M.afterOutsideRef.current)||t.focus()}}}))}function pe(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 ge=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function he(e){let{children:t,elementsRef:n,labelsRef:r}=e;const[o,i]=u.useState((()=>new Map)),c=u.useCallback((e=>{i((t=>new Map(t).set(e,null)))}),[]),l=u.useCallback((e=>{i((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return v((()=>{const e=new Map(o);Array.from(e.keys()).sort(pe).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(ge.Provider,{value:u.useMemo((()=>({register:c,unregister:l,map:o,elementsRef:n,labelsRef:r})),[c,l,o,n,r])},t)}function be(e){let{label:t}=void 0===e?{}:e;const[n,r]=u.useState(null),o=u.useRef(null),{register:i,unregister:c,map:l,elementsRef:s,labelsRef:a}=u.useContext(ge),f=u.useCallback((e=>{if(o.current=e,null!==n&&(s.current[n]=e,a)){var r;const o=void 0!==t;a.current[n]=o?t:null!=(r=null==e?void 0:e.textContent)?r:null}}),[n,s,a,t]);return v((()=>{const e=o.current;if(e)return i(e),()=>{c(e)}}),[i,c]),v((()=>{const e=o.current?l.get(o.current):null;null!=e&&r(e)}),[l]),u.useMemo((()=>({ref:f,index:null==n?-1:n})),[n,f])}const ye="data-floating-ui-scroll-lock",Ee=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return v((()=>{var e,t;if(!n)return;if(document.body.hasAttribute(ye))return;document.body.setAttribute(ye,"");const r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth;if(!/iP(hone|ad|od)|iOS/.test(O()))return Object.assign(document.body.style,{overflow:"hidden",[r]:o+"px"}),()=>{document.body.removeAttribute(ye),Object.assign(document.body.style,{overflow:"",[r]:""})};const u=(null==(e=window.visualViewport)?void 0:e.offsetLeft)||0,i=(null==(t=window.visualViewport)?void 0:t.offsetTop)||0,c=window.pageXOffset,l=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(l-Math.floor(i))+"px",left:-(c-Math.floor(u))+"px",right:"0",[r]:o+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[r]:""}),document.body.removeAttribute(ye),window.scrollTo(c,l)}}),[n]),u.createElement("div",m({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function we(e){return S(e.target)&&"BUTTON"===e.target.tagName}function Re(e){return Q(e)}function xe(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);return u.useMemo((()=>c?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(K(d.current,!0)&&a||"click"!==l&&(n?!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type||r(!1,e.nativeEvent):(e.preventDefault(),r(!0,e.nativeEvent))))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:K(d.current,!0)&&a||(n?!s||o.current.openEvent&&"click"!==o.current.openEvent.type||r(!1,e.nativeEvent):r(!0,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||we(e)||(" "!==e.key||Re(i)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&(n?s&&r(!1,e.nativeEvent):r(!0,e.nativeEvent)))},onKeyUp(e){e.defaultPrevented||!f||we(e)||Re(i)||" "===e.key&&m.current&&(m.current=!1,n?s&&r(!1,e.nativeEvent):r(!0,e.nativeEvent))}}}:{}),[c,o,l,a,f,i,s,n,r])}const Ie=u["useInsertionEffect".toString()]||(e=>e());function ke(e){const t=u.useRef((()=>{}));return Ie((()=>{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 Ce(e){return null!=e&&null!=e.clientX}function Me(e,t){void 0===t&&(t={});const{open:n,refs:r,dataRef:o,elements:{floating:i}}=e,{enabled:c=!0,axis:l="both",x:s=null,y:a=null}=t,f=u.useRef(!1),d=u.useRef(null),[m,p]=u.useState(),[g,h]=u.useState([]),b=ke(((e,t)=>{f.current||o.current.openEvent&&!Ce(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,i;const c=(null==(u=e.current)?void 0:u.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,a=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let f=c.width,d=c.height,m=c.x,v=c.y;return null==n&&t.x&&l&&(n=c.x-t.x),null==r&&t.y&&s&&(r=c.y-t.y),m-=n||0,v-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?c.width:0,d="x"===t.axis?c.height:0,m=l&&null!=t.x?t.x:m,v=s&&null!=t.y?t.y:v):o&&!a&&(d="x"===t.axis?c.height:d,f="y"===t.axis?c.width:f),o=!0,{width:f,height:d,x:m,y:v,top:v,right:m+f,bottom:v+d,left:m}}}}(r.domReference,{x:e,y:t,axis:l,dataRef:o,pointerType:m}))})),y=ke((e=>{null==s&&null==a&&(n?d.current||h([]):b(e.clientX,e.clientY))})),E=K(m)?i:n,w=u.useCallback((()=>{if(!E||!c||null!=s||null!=a)return;const e=L(r.floating.current);function t(n){const o=G(n);B(r.floating.current,o)?(e.removeEventListener("mousemove",t),d.current=null):b(n.clientX,n.clientY)}if(!o.current.openEvent||Ce(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),d.current=null};return d.current=n,n}r.setPositionReference(r.domReference.current)}),[o,c,E,r,b,s,a]);return u.useEffect((()=>w()),[w,g]),u.useEffect((()=>{c&&!i&&(f.current=!1)}),[c,i]),u.useEffect((()=>{!c&&n&&(f.current=!0)}),[c,n]),v((()=>{!c||null==s&&null==a||(f.current=!1,b(s,a))}),[c,s,a,b]),u.useMemo((()=>{if(!c)return{};function e(e){let{pointerType:t}=e;p(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:y,onMouseEnter:y}}}),[c,y])}function Te(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)}const Oe={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ae={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"};function Le(e,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,nodeId:c,elements:{reference:l,domReference:s,floating:a},dataRef:f}=e,{enabled:d=!0,escapeKey:m=!0,outsidePress:v=!0,outsidePressEvent:p="pointerdown",referencePress:g=!1,referencePressEvent:h="pointerdown",ancestorScroll:b=!1,bubbles:y}=n,E=I(),w=null!=x(),R=ke("function"==typeof v?v:()=>!1),k="function"==typeof v?R:v,C=u.useRef(!1),{escapeKeyBubbles:M,outsidePressBubbles:O}=(e=>{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}})(y),A=ke((e=>{if(!r||!d||!m||"Escape"!==e.key)return;const t=E?Z(E.nodesRef.current,c):[];if(!M&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e)})),F=ke((e=>{const t=C.current;if(C.current=!1,t)return;if("function"==typeof k&&!k(e))return;const n=G(e);if(S(n)&&a){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,r=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let o=r&&e.offsetX>n.clientWidth;if(r){"rtl"===L(a).getComputedStyle(n).direction&&(o=e.offsetX<=n.offsetWidth-n.clientWidth)}if(o||t&&e.offsetY>n.clientHeight)return}const r=E&&Z(E.nodesRef.current,c).some((t=>{var n;return Te(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Te(e,a)||Te(e,s)||r)return;const u=E?Z(E.nodesRef.current,c):[];if(u.length>0){let e=!0;if(u.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:D(e)||N(e)}}),o(!1,e)}));return u.useEffect((()=>{if(!r||!d)return;function e(e){o(!1,e)}f.current.__escapeKeyBubbles=M,f.current.__outsidePressBubbles=O;const n=T(a);m&&n.addEventListener("keydown",A),k&&n.addEventListener(p,F);let u=[];return b&&(P(s)&&(u=t(s)),P(a)&&(u=u.concat(t(a))),!P(l)&&l&&l.contextElement&&(u=u.concat(t(l.contextElement)))),u=u.filter((e=>{var t;return e!==(null==(t=n.defaultView)?void 0:t.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{m&&n.removeEventListener("keydown",A),k&&n.removeEventListener(p,F),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[f,a,s,l,m,k,p,r,o,b,d,M,O,A,F]),u.useEffect((()=>{C.current=!1}),[k,p]),u.useMemo((()=>d?{reference:{onKeyDown:A,[Oe[h]]:e=>{g&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:A,[Ae[p]]:()=>{C.current=!0}}}:{}),[d,i,g,p,h,o,A])}function Pe(e){var t;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:i}=e,[c,l]=u.useState(null),s=(null==(t=e.elements)?void 0:t.reference)||c,a=n(e),f=I(),d=ke(((e,t)=>{e&&(p.current.openEvent=t),null==o||o(e,t)})),m=u.useRef(null),p=u.useRef({}),g=u.useState((()=>E()))[0],h=b(),y=u.useCallback((e=>{const t=P(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a.refs.setReference(t)}),[a.refs]),w=u.useCallback((e=>{(P(e)||null===e)&&(m.current=e,l(e)),(P(a.refs.reference.current)||null===a.refs.reference.current||null!==e&&!P(e))&&a.refs.setReference(e)}),[a.refs]),R=u.useMemo((()=>({...a.refs,setReference:w,setPositionReference:y,domReference:m})),[a.refs,w,y]),x=u.useMemo((()=>({...a.elements,domReference:s})),[a.elements,s]),k=u.useMemo((()=>({...a,refs:R,elements:x,dataRef:p,nodeId:i,floatingId:h,events:g,open:r,onOpenChange:d})),[a,i,h,g,r,d,R,x]);return v((()=>{const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===i));e&&(e.context=k)})),u.useMemo((()=>({...a,context:k,refs:R,elements:x})),[a,R,x,k])}function Se(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,refs:c,elements:{floating:l,domReference:s}}=e,{enabled:a=!0,keyboardOnly:f=!0}=t,d=u.useRef(""),m=u.useRef(!1),v=u.useRef();return u.useEffect((()=>{if(!a)return;const e=T(l).defaultView||window;function t(){!n&&S(s)&&s===X(T(s))&&(m.current=!0)}return e.addEventListener("blur",t),()=>{e.removeEventListener("blur",t)}}),[l,s,n,a]),u.useEffect((()=>{if(a)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(e){"referencePress"!==e.type&&"escapeKey"!==e.type||(m.current=!0)}}),[i,a]),u.useEffect((()=>()=>{clearTimeout(v.current)}),[]),u.useMemo((()=>a?{reference:{onPointerDown(e){let{pointerType:t}=e;d.current=t,m.current=!(!t||!f)},onMouseLeave(){m.current=!1},onFocus(e){var t;m.current||"focus"===e.type&&"mousedown"===(null==(t=o.current.openEvent)?void 0:t.type)&&Te(o.current.openEvent,s)||r(!0,e.nativeEvent)},onBlur(e){m.current=!1;const t=e.relatedTarget,n=P(t)&&t.hasAttribute("data-floating-ui-focus-guard")&&"outside"===t.getAttribute("data-type");v.current=setTimeout((()=>{B(c.floating.current,t)||B(s,t)||n||r(!1,e.nativeEvent)}))}}}:{}),[a,f,s,c,o,r])}function De(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var u;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(u=r.get(n))||u.push(o),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]=o})),e):e),{})}}function Ne(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>De(t,e,"reference")),t),r=u.useCallback((t=>De(t,e,"floating")),t),o=u.useCallback((t=>De(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return u.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])}let Fe=!1;function Ke(e,t,n){return Math.floor(e/t)!==n}function Be(e,t){return t<0||t>=e.current.length}function He(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{var l,s;c+=r?-u:u}while(c>=0&&c<=i.length-1&&(o?o.includes(c):null==i[c]||(null==(l=i[c])?void 0:l.hasAttribute("disabled"))||"true"===(null==(s=i[c])?void 0:s.getAttribute("aria-disabled"))));return c}function _e(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function qe(e,t){return _e(t,"ArrowUp"===e||"ArrowDown"===e,"ArrowLeft"===e||"ArrowRight"===e)}function je(e,t,n){return _e(t,"ArrowDown"===e,n?"ArrowLeft"===e:"ArrowRight"===e)||"Enter"===e||" "==e||""===e}function We(e,t){return He(e,{disabledIndices:t})}function Ue(e,t){return He(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ve(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:i,floating:c}}=e,{listRef:l,activeIndex:s,onNavigate:a=(()=>{}),enabled:f=!0,selectedIndex:d=null,allowEscape:m=!1,loop:p=!1,nested:g=!1,rtl:h=!1,virtual:b=!1,focusItemOnOpen:y="auto",focusItemOnHover:E=!0,openOnArrowKeyDown:w=!0,disabledIndices:R,orientation:k="vertical",cols:C=1,scrollItemIntoView:M=!0}=t,A=x(),L=I(),P=ke(a),K=u.useRef(y),_=u.useRef(null!=d?d:-1),q=u.useRef(null),j=u.useRef(!0),W=u.useRef(P),U=u.useRef(!!c),V=u.useRef(!1),Y=u.useRef(!1),Z=H(R),G=H(n),Q=H(M),[$,ee]=u.useState(),te=ke((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(b?ee(r.id):z(r,{preventScroll:!0,sync:!(!O().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!F())&&(Fe||V.current)}),requestAnimationFrame((()=>{const e=Q.current;e&&r&&(n||!j.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));v((()=>{document.createElement("div").focus({get preventScroll(){return Fe=!0,!1}})}),[]),v((()=>{f&&(n&&c?K.current&&null!=d&&(Y.current=!0,P(d)):U.current&&(_.current=-1,W.current(null)))}),[f,n,c,d,P]),v((()=>{if(f&&n&&c)if(null==s){if(V.current=!1,null!=d)return;if(U.current&&(_.current=-1,te(l,_)),!U.current&&K.current&&(null!=q.current||!0===K.current&&null==q.current)){let e=0;const t=()=>{if(null==l.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else _.current=null==q.current||je(q.current,k,h)||g?We(l,Z.current):Ue(l,Z.current),q.current=null,P(_.current)};t()}}else Be(l,s)||(_.current=s,te(l,_,Y.current),Y.current=!1)}),[f,n,c,s,d,g,l,k,h,P,te,Z]),v((()=>{if(f&&U.current&&!c&&L){var e,t;const n=L.nodesRef.current,r=null==(e=n.find((e=>e.id===A)))||null==(t=e.context)?void 0:t.elements.floating,o=X(T(c)),u=n.some((e=>e.context&&B(e.context.elements.floating,o)));r&&!u&&r.focus({preventScroll:!0})}}),[f,c,L,A]),v((()=>{W.current=P,U.current=!!c})),v((()=>{n||(q.current=null)}),[n]);const ne=null!=s,re=u.useMemo((()=>{function e(e){if(!n)return;const t=l.current.indexOf(e);-1!==t&&P(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...E&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;j.current&&"touch"!==t&&(_.current=-1,te(l,_),P(null),b||z(o.floating.current,{preventScroll:!0}))}}}}),[n,o,te,E,l,P,b]);return u.useMemo((()=>{if(!f)return{};const e=Z.current;function t(t){if(j.current=!1,V.current=!0,!G.current&&t.currentTarget===o.floating.current)return;if(g&&function(e,t,n){return _e(t,n?"ArrowRight"===e:"ArrowLeft"===e,"ArrowUp"===e)}(t.key,k,h))return J(t),r(!1,t.nativeEvent),void(S(i)&&i.focus());const u=_.current,c=We(l,e),s=Ue(l,e);if("Home"===t.key&&(J(t),_.current=c,P(_.current)),"End"===t.key&&(J(t),_.current=s,P(_.current)),C>1){const n=_.current;if("ArrowUp"===t.key){if(J(t),-1===n)_.current=s;else if(_.current=He(l,{startingIndex:n,amount:C,decrement:!0,disabledIndices:e}),p&&(n-C<c||_.current<0)){const e=n%C,t=s%C,r=s-(t-e);_.current=t===e?s:t>e?r:r-C}Be(l,_.current)&&(_.current=n),P(_.current)}if("ArrowDown"===t.key&&(J(t),-1===n?_.current=c:(_.current=He(l,{startingIndex:n,amount:C,disabledIndices:e}),p&&n+C>s&&(_.current=He(l,{startingIndex:n%C-C,amount:C,disabledIndices:e}))),Be(l,_.current)&&(_.current=n),P(_.current)),"both"===k){const r=Math.floor(n/C);"ArrowRight"===t.key&&(J(t),n%C!=C-1?(_.current=He(l,{startingIndex:n,disabledIndices:e}),p&&Ke(_.current,C,r)&&(_.current=He(l,{startingIndex:n-n%C-1,disabledIndices:e}))):p&&(_.current=He(l,{startingIndex:n-n%C-1,disabledIndices:e})),Ke(_.current,C,r)&&(_.current=n)),"ArrowLeft"===t.key&&(J(t),n%C!=0?(_.current=He(l,{startingIndex:n,disabledIndices:e,decrement:!0}),p&&Ke(_.current,C,r)&&(_.current=He(l,{startingIndex:n+(C-n%C),decrement:!0,disabledIndices:e}))):p&&(_.current=He(l,{startingIndex:n+(C-n%C),decrement:!0,disabledIndices:e})),Ke(_.current,C,r)&&(_.current=n));const o=Math.floor(s/C)===r;return Be(l,_.current)&&(_.current=p&&o?"ArrowLeft"===t.key?s:He(l,{startingIndex:n-n%C-1,disabledIndices:e}):n),void P(_.current)}}if(qe(t.key,k)){if(J(t),n&&!b&&X(t.currentTarget.ownerDocument)===t.currentTarget)return _.current=je(t.key,k,h)?c:s,void P(_.current);je(t.key,k,h)?_.current=p?u>=s?m&&u!==l.current.length?-1:c:He(l,{startingIndex:u,disabledIndices:e}):Math.min(s,He(l,{startingIndex:u,disabledIndices:e})):_.current=p?u<=c?m&&-1!==u?l.current.length:s:He(l,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(c,He(l,{startingIndex:u,decrement:!0,disabledIndices:e})),Be(l,_.current)?P(null):P(_.current)}}function u(e){"auto"===y&&D(e.nativeEvent)&&(K.current=!0)}const c=b&&n&&ne&&{"aria-activedescendant":$};return{reference:{...c,onKeyDown(o){j.current=!1;const u=0===o.key.indexOf("Arrow");if(b&&n)return t(o);if(!n&&!w&&u)return;const i=u||"Enter"===o.key||""===o.key.trim(),c=qe(o.key,k),s=function(e,t,n){return _e(t,n?"ArrowLeft"===e:"ArrowRight"===e,"ArrowDown"===e)}(o.key,k,h);i&&(q.current=g&&c?null:o.key),g?s&&(J(o),n?(_.current=We(l,e),P(_.current)):r(!0,o.nativeEvent)):c&&(null!=d&&(_.current=d),J(o),!n&&w?r(!0,o.nativeEvent):t(o),n&&P(_.current))},onFocus(){n&&P(null)},onPointerDown:function(e){K.current=y,"auto"===y&&N(e.nativeEvent)&&(K.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===k?void 0:k,...c,onKeyDown:t,onPointerMove(){j.current=!0}},item:re}}),[i,o,$,Z,G,l,f,k,h,b,n,ne,g,d,w,m,C,p,y,P,r,re])}function Xe(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)}function Ye(e,t){void 0===t&&(t={});const{open:n,floatingId:r}=e,{enabled:o=!0,role:i="dialog"}=t,c=b();return u.useMemo((()=>{const e={id:r,role:i};return o?"tooltip"===i?{reference:{"aria-describedby":n?r:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===i?"dialog":i,"aria-controls":n?r:void 0,..."listbox"===i&&{role:"combobox"},..."menu"===i&&{id:c}},floating:{...e,..."menu"===i&&{"aria-labelledby":c}}}:{}}),[o,i,n,r,c])}const ze=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Ze(e,t){return"function"==typeof e?e(t):e}function Ge(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[c,l]=u.useState(!1),[s,a]=u.useState("unmounted"),f=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return v((()=>{c&&!f&&a("unmounted")}),[c,f]),v((()=>{if(r){if(n){a("initial");const e=requestAnimationFrame((()=>{a("open")}));return()=>{cancelAnimationFrame(e)}}l(!0),a("close")}}),[n,r]),{isMounted:f,status:s}}function Qe(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,[p,g]=u.useState((()=>({...Ze(i,a),...Ze(n,a)}))),{isMounted:h,status:b}=Ge(e,{duration:c}),y=H(n),E=H(r),w=H(o),R=H(i);return v((()=>{const e=Ze(y.current,a),t=Ze(w.current,a),n=Ze(R.current,a),r=Ze(E.current,a)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===b&&g((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===b&&g({transitionProperty:Object.keys(r).map(ze).join(","),transitionDuration:d+"ms",...n,...r}),"close"===b){const r=t||e;g({transitionProperty:Object.keys(r).map(ze).join(","),transitionDuration:m+"ms",...n,...r})}}),[m,w,y,E,R,d,b,a]),{isMounted:h,styles:p}}function Je(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:c,onMatch:l,onTypingChange:s,enabled:a=!0,findMatch:f=null,resetMs:d=750,ignoreKeys:m=[],selectedIndex:p=null}=t,g=u.useRef(),h=u.useRef(""),b=u.useRef(null!=(n=null!=p?p:c)?n:-1),y=u.useRef(null),E=ke(l),w=ke(s),R=H(f),x=H(m);return v((()=>{r&&(clearTimeout(g.current),y.current=null,h.current="")}),[r]),v((()=>{var e;r&&""===h.current&&(b.current=null!=(e=null!=p?p:c)?e:-1)}),[r,p,c]),u.useMemo((()=>{if(!a)return{};function e(e){e?o.current.typing||(o.current.typing=e,w(e)):o.current.typing&&(o.current.typing=e,w(e))}function t(e,t,n){const r=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}function n(n){const o=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(o,o,h.current)?e(!1):" "===n.key&&J(n)),null==o||x.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(J(n),e(!0));o.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.current===n.key&&(h.current="",b.current=y.current),h.current+=n.key,clearTimeout(g.current),g.current=setTimeout((()=>{h.current="",b.current=y.current,e(!1)}),d);const u=b.current,c=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],h.current);-1!==c?(E(c),y.current=c):" "!==n.key&&(h.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[a,r,o,i,d,x,R,E,w])}function $e(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const et=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:u,onFallbackChange:i,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...m}=e,{rects:v,elements:{floating:p}}=t,g=n.current[l];if(!g)return{};const h={...t,...await r(-g.offsetTop-v.reference.height/2-g.offsetHeight/2-c).fn(t)},b=(null==f?void 0:f.current)||p,y=await o($e(h,b.scrollHeight),m),E=await o(h,{...m,elementContext:"reference"}),w=Math.max(0,y.top),R=h.y+w,x=Math.max(0,b.scrollHeight-w-Math.max(0,y.bottom));return b.style.maxHeight=x+"px",b.scrollTop=w,i&&(b.offsetHeight<g.offsetHeight*Math.min(s,n.current.length-1)-1||E.top>=-a||E.bottom>=-a?d((()=>i(!0))):d((()=>i(!1)))),u&&(u.current=await o($e({...h,y:R},b.offsetHeight),m)),{y:R}}});function tt(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:c,onChange:l}=t,s=ke(l),a=u.useRef(!1),f=u.useRef(null),m=u.useRef(null);return u.useEffect((()=>{if(!o)return;function e(e){if(e.ctrlKey||!t||null==i.current)return;const n=e.deltaY,r=i.current.top>=-.5,o=i.current.bottom>=-.5,u=t.scrollHeight-t.clientHeight,c=n<0?-1:1,l=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&n>0||!o&&n<0?(e.preventDefault(),d((()=>{s((e=>e+Math[l](n,u*c)))}))):/firefox/i.test(A())&&(t.scrollTop+=n))}const t=(null==c?void 0:c.current)||r.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{f.current=t.scrollTop,null!=i.current&&(m.current={...i.current})})),()=>{f.current=null,m.current=null,t.removeEventListener("wheel",e)}):void 0}),[o,n,r.floating,i,c,s]),u.useMemo((()=>o?{floating:{onKeyDown(){a.current=!0},onWheel(){a.current=!1},onPointerMove(){a.current=!1},onScroll(){const e=(null==c?void 0:c.current)||r.floating;if(i.current&&e&&a.current){if(null!==f.current){const t=e.scrollTop-f.current;(i.current.bottom<-.5&&t<-1||i.current.top<-.5&&t>1)&&d((()=>s((e=>e+t))))}requestAnimationFrame((()=>{f.current=e.scrollTop}))}}}}:{}),[o,i,r.floating,c,s])}function nt(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}function rt(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 p(){clearTimeout(o),d()}if(clearTimeout(o),!f.domReference||!f.floating||null==a||null==n||null==s)return;const{clientX:g,clientY:h}=e,b=[g,h],y=G(e),E="mouseleave"===e.type,w=B(f.floating,y),R=B(f.domReference,y),x=f.domReference.getBoundingClientRect(),I=f.floating.getBoundingClientRect(),k=a.split("-")[0],C=n>I.right-I.width/2,M=s>I.bottom-I.height/2,T=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,x),O=I.width>x.width,A=I.height>x.height,L=(O?x:I).left,S=(O?x:I).right,D=(A?x:I).top,N=(A?x:I).bottom;if(w&&(u=!0,!E))return;if(R&&(u=!1),R&&!E)return void(u=!0);if(E&&P(e.relatedTarget)&&B(f.floating,e.relatedTarget))return;if(v&&Z(v.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===k&&s>=x.bottom-1||"bottom"===k&&s<=x.top+1||"left"===k&&n>=x.right-1||"right"===k&&n<=x.left+1)return p();let F=[];switch(k){case"top":F=[[L,x.top+1],[L,I.bottom-1],[S,I.bottom-1],[S,x.top+1]];break;case"bottom":F=[[L,I.top+1],[L,x.bottom-1],[S,x.bottom-1],[S,I.top+1]];break;case"left":F=[[I.right-1,N],[I.right-1,D],[x.left+1,D],[x.left+1,N]];break;case"right":F=[[x.right-1,N],[x.right-1,D],[I.left+1,D],[I.left+1,N]]}if(!nt([g,h],F)){if(u&&!T)return p();if(!E&&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),n=.1;if(null!==t&&t<n)return p()}nt([g,h],function(e){let[n,r]=e;switch(k){case"top":return[[O?n+t/2:C?n+4*t:n-4*t,r+t+1],[O?n-t/2:C?n+4*t:n-4*t,r+t+1],...[[I.left,C||O?I.bottom-t:I.top],[I.right,C?O?I.bottom-t:I.top:I.bottom-t]]];case"bottom":return[[O?n+t/2:C?n+4*t:n-4*t,r-t],[O?n-t/2:C?n+4*t:n-4*t,r-t],...[[I.left,C||O?I.top+t:I.bottom],[I.right,C?O?I.top+t:I.bottom:I.top+t]]];case"left":{const e=[n+t+1,A?r+t/2:M?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:M?r+4*t:r-4*t];return[...[[M||A?I.right-t:I.left,I.top],[M?A?I.right-t:I.left:I.right-t,I.bottom]],e,o]}case"right":return[[n-t,A?r+t/2:M?r+4*t:r-4*t],[n-t,A?r-t/2:M?r+4*t:r-4*t],...[[M||A?I.left+t:I.right,I.top],[M?A?I.left+t:I.right:I.left+t,I.bottom]]]}}([n,s]))?!u&&r&&(o=window.setTimeout(p,40)):p()}}};return s.__options={blockPointerEvents:n},s}export{y as FloatingArrow,U as FloatingDelayGroup,ve as FloatingFocusManager,he as FloatingList,C as FloatingNode,Ee as FloatingOverlay,fe as FloatingPortal,M as FloatingTree,et as inner,rt as safePolygon,xe as useClick,Me as useClientPoint,V as useDelayGroup,W as useDelayGroupContext,Le as useDismiss,Pe as useFloating,k as useFloatingNodeId,x as useFloatingParentNodeId,ae as useFloatingPortalNode,I as useFloatingTree,Se as useFocus,q as useHover,b as useId,tt as useInnerOffset,Ne as useInteractions,be as useListItem,Ve as useListNavigation,Xe as useMergeRefs,Ye as useRole,Ge as useTransitionStatus,Qe as useTransitionStyles,Je as useTypeahead}; | ||
import{platform as e,getOverflowAncestors as t,useFloating as n,offset as r,detectOverflow as o}from"@floating-ui/react-dom";export{arrow,autoPlacement,autoUpdate,computePosition,detectOverflow,flip,getOverflowAncestors,hide,inline,limitShift,offset,platform,shift,size}from"@floating-ui/react-dom";import*as u from"react";import{useLayoutEffect as i,useEffect as c,useRef as l}from"react";import{supportsInert as s,hideOthers as a,suppressOthers as f}from"aria-hidden";import{tabbable as d}from"tabbable";import{createPortal as m,flushSync as v}from"react-dom";function p(){return p=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},p.apply(this,arguments)}var g="undefined"!=typeof document?i:c;let h=!1,y=0;const b=()=>"floating-ui-"+y++;const E=u["useId".toString()]||function(){const[e,t]=u.useState((()=>h?b():void 0));return g((()=>{null==e&&t(b())}),[]),u.useEffect((()=>{h||(h=!0)}),[]),e},w=u.forwardRef((function(t,n){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i}},width:c=14,height:l=7,tipRadius:s=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:m,style:{transform:v,...g}={},...h}=t;const y=E();if(!o)return null;a*=2;const b=a/2,w=c/2*(s/-8+1),R=l/2*s/4,[x,I]=r.split("-"),k=e.isRTL(o),C=!!m,M="top"===x||"bottom"===x,T=f&&"end"===I?"bottom":"top";let O=f&&"end"===I?"right":"left";f&&k&&(O="end"===I?"left":"right");const P=null!=(null==i?void 0:i.x)?f||i.x:"",L=null!=(null==i?void 0:i.y)?f||i.y:"",S=m||"M0,0 H"+c+" L"+(c-w)+","+(l-R)+" Q"+c/2+","+l+" "+w+","+(l-R)+" Z",A={top:C?"rotate(180deg)":"",left:C?"rotate(90deg)":"rotate(-90deg)",bottom:C?"":"rotate(180deg)",right:C?"rotate(-90deg)":"rotate(90deg)"}[x];return u.createElement("svg",p({},h,{"aria-hidden":!0,ref:n,width:C?c:c+a,height:c,viewBox:"0 0 "+c+" "+(l>c?l:c),style:{position:"absolute",pointerEvents:"none",[O]:P,[T]:L,[x]:M||C?"100%":"calc(100% - "+a/2+"px)",transform:""+A+(null!=v?v:""),...g}}),a>0&&u.createElement("path",{clipPath:"url(#"+y+")",fill:"none",stroke:d,strokeWidth:a+(m?0:1),d:S}),u.createElement("path",{stroke:a&&!m?h.fill:"none",d:S}),u.createElement("clipPath",{id:y},u.createElement("rect",{x:-b,y:b*(C?-1:1),width:c+a,height:c})))}));function R(){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 x=u.createContext(null),I=u.createContext(null),k=()=>{var e;return(null==(e=u.useContext(x))?void 0:e.id)||null},C=()=>u.useContext(I);function M(e){const t=E(),n=C(),r=k(),o=e||r;return g((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t}function T(e){let{children:t,id:n}=e;const r=k();return u.createElement(x.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)}function O(e){let{children:t}=e;const n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),i=u.useState((()=>R()))[0];return u.createElement(I.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:i})),[n,r,o,i])},t)}function P(e){return(null==e?void 0:e.ownerDocument)||document}function L(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function S(){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 A(e){return P(e).defaultView||window}function D(e){return!!e&&e instanceof A(e).Element}function N(e){return!!e&&e instanceof A(e).HTMLElement}function F(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof A(e).ShadowRoot||e instanceof ShadowRoot}function K(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(L())||t.test(S()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function B(e){return 0===e.width&&0===e.height||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}function H(){return/apple/i.test(navigator.vendor)}function _(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function q(e){return e.matches("html,body")}function j(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&F(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function W(e){return"data-floating-ui-"+e}function V(e){const t=l(e);return g((()=>{t.current=e})),t}const X=W("safe-polygon");function Y(e,t,n){return n&&!_(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function U(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:c,floating:l},refs:s}=e,{enabled:a=!0,delay:f=0,handleClose:d=null,mouseOnly:m=!1,restMs:v=0,move:p=!0}=t,h=C(),y=k(),b=V(d),E=V(f),w=u.useRef(),R=u.useRef(),x=u.useRef(),I=u.useRef(),M=u.useRef(!0),T=u.useRef(!1),O=u.useRef((()=>{})),L=u.useCallback((()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[o]);u.useEffect((()=>{if(a)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(){clearTimeout(R.current),clearTimeout(I.current),M.current=!0}}),[a,i]),u.useEffect((()=>{if(!a||!b.current||!n)return;function e(e){L()&&r(!1,e)}const t=P(l).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[l,n,r,a,b,o,L]);const S=u.useCallback((function(e,t){void 0===t&&(t=!0);const n=Y(E.current,"close",w.current);n&&!x.current?(clearTimeout(R.current),R.current=setTimeout((()=>r(!1,e)),n)):t&&(clearTimeout(R.current),r(!1,e))}),[E,r]),A=u.useCallback((()=>{O.current(),x.current=void 0}),[]),N=u.useCallback((()=>{if(T.current){const e=P(s.floating.current).body;e.style.pointerEvents="",e.removeAttribute(X),T.current=!1}}),[s]);return u.useEffect((()=>{if(a&&D(c)){const e=c;return n&&e.addEventListener("mouseleave",s),null==l||l.addEventListener("mouseleave",s),p&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",i),()=>{n&&e.removeEventListener("mouseleave",s),null==l||l.removeEventListener("mouseleave",s),p&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(R.current),M.current=!1,m&&!_(w.current)||v>0&&0===Y(E.current,"open"))return;const t=Y(E.current,"open",w.current);t?R.current=setTimeout((()=>{r(!0,e)}),t):r(!0,e)}function i(r){if(t())return;O.current();const o=P(l);if(clearTimeout(I.current),b.current){n||clearTimeout(R.current),x.current=b.current({...e,tree:h,x:r.clientX,y:r.clientY,onClose(){N(),A(),S(r)}});const t=x.current;return o.addEventListener("mousemove",t),void(O.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==w.current||!j(l,r.relatedTarget))&&S(r)}function s(n){t()||null==b.current||b.current({...e,tree:h,x:n.clientX,y:n.clientY,onClose(){N(),A(),S(n)}})(n)}}),[c,l,a,e,m,v,p,S,A,N,r,n,h,E,b,o]),g((()=>{var e;if(a&&n&&null!=(e=b.current)&&e.__options.blockPointerEvents&&L()){const e=P(l).body;if(e.setAttribute(X,""),e.style.pointerEvents="none",T.current=!0,D(c)&&l){var t,r;const e=c,n=null==h||null==(t=h.nodesRef.current.find((e=>e.id===y)))||null==(r=t.context)?void 0:r.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{e.style.pointerEvents="",l.style.pointerEvents=""}}}}),[a,n,y,l,c,h,b,o,L]),g((()=>{n||(w.current=void 0,A(),N())}),[n,A,N]),u.useEffect((()=>()=>{A(),clearTimeout(R.current),clearTimeout(I.current),N()}),[a,A,N]),u.useMemo((()=>{if(!a)return{};function e(e){w.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===v||(clearTimeout(I.current),I.current=setTimeout((()=>{M.current||r(!0,e.nativeEvent)}),v))}},floating:{onMouseEnter(){clearTimeout(R.current)},onMouseLeave(e){i.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),S(e.nativeEvent,!1)}}}}),[i,a,v,n,r,S])}const z=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),Z=()=>u.useContext(z),G=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,i]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=u.useRef(null),l=u.useCallback((e=>{i({currentId:e})}),[]);return g((()=>{o.currentId?null===c.current?c.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),c.current=null)}),[o.currentId]),u.createElement(z.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:l})),[o,i,l])},t)},Q=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:u,setCurrentId:i,initialDelay:c,setState:l,timeoutMs:s}=Z();g((()=>{u&&(l({delay:{open:1,close:Y(c,"close")}}),u!==o&&r(!1))}),[o,r,l,u,c]),g((()=>{function e(){r(!1),l({delay:c,currentId:null})}if(!n&&u===o){if(s){const t=window.setTimeout(e,s);return()=>{clearTimeout(t)}}e()}}),[n,l,u,o,r,c,s]),g((()=>{n&&i(o)}),[n,i,o])};function J(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}let $=0;function ee(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame($);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():$=requestAnimationFrame(u)}function te(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}function ne(e){return"composedPath"in e?e.composedPath()[0]:e.target}const re="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function oe(e){return N(e)&&e.matches(re)}function ue(e){e.preventDefault(),e.stopPropagation()}const ie=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ce(e,t){const n=d(e,ie());"prev"===t&&n.reverse();const r=n.indexOf(J(P(e)));return n.slice(r+1)[0]}function le(){return ce(document.body,"next")}function se(){return ce(document.body,"prev")}function ae(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!j(n,r)}function fe(e){d(e,ie()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function de(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 me={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 ve(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const pe=u.forwardRef((function(e,t){const[n,r]=u.useState();g((()=>(H()&&r("button"),document.addEventListener("keydown",ve),()=>{document.removeEventListener("keydown",ve)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[W("focus-guard")]:"",style:me};return u.createElement("span",p({},e,o))})),ge=u.createContext(null);function he(e){let{id:t,root:n}=void 0===e?{}:e;const[r,o]=u.useState(null),i=E(),c=be(),l=u.useMemo((()=>({id:t,root:n,portalContext:c,uniqueId:i})),[t,n,c,i]),s=u.useRef();return g((()=>()=>{null==r||r.remove()}),[r,l]),g((()=>{if(s.current===l)return;s.current=l;const{id:e,root:t,portalContext:n,uniqueId:r}=l,u=e?document.getElementById(e):null,i=W("portal");if(u){const e=document.createElement("div");e.id=r,e.setAttribute(i,""),u.appendChild(e),o(e)}else{let u=t||(null==n?void 0:n.portalNode);u&&!D(u)&&(u=u.current),u=u||document.body;let c=null;e&&(c=document.createElement("div"),c.id=e,u.appendChild(c));const l=document.createElement("div");l.id=r,l.setAttribute(i,""),u=c||u,u.appendChild(l),o(l)}}),[l]),r}function ye(e){let{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e;const i=he({id:n,root:r}),[c,l]=u.useState(null),s=u.useRef(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),v=!!c&&!c.modal&&c.open&&o&&!(!r&&!i);return u.useEffect((()=>{if(i&&o&&(null==c||!c.modal))return i.addEventListener("focusin",e,!0),i.addEventListener("focusout",e,!0),()=>{i.removeEventListener("focusin",e,!0),i.removeEventListener("focusout",e,!0)};function e(e){if(i&&ae(e)){("focusin"===e.type?de:fe)(i)}}}),[i,o,null==c?void 0:c.modal]),u.createElement(ge.Provider,{value:u.useMemo((()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:a,beforeInsideRef:f,afterInsideRef:d,portalNode:i,setFocusManagerState:l})),[o,i])},v&&i&&u.createElement(pe,{"data-type":"outside",ref:s,onFocus:e=>{if(ae(e,i)){var t;null==(t=f.current)||t.focus()}else{const e=se()||(null==c?void 0:c.refs.domReference.current);null==e||e.focus()}}}),v&&i&&u.createElement("span",{"aria-owns":i.id,style:me}),i&&m(t,i),v&&i&&u.createElement(pe,{"data-type":"outside",ref:a,onFocus:e=>{if(ae(e,i)){var t;null==(t=d.current)||t.focus()}else{const t=le()||(null==c?void 0:c.refs.domReference.current);null==t||t.focus(),(null==c?void 0:c.closeOnFocusOut)&&(null==c||c.onOpenChange(!1,e.nativeEvent))}}}))}const be=()=>u.useContext(ge),Ee=u.forwardRef((function(e,t){return u.createElement("button",p({},e,{type:"button",ref:t,tabIndex:-1,style:me}))}));function we(e){const{context:t,children:n,order:r=["content"],guards:o=!0,initialFocus:i=0,returnFocus:c=!0,modal:l=!0,visuallyHiddenDismiss:m=!1,closeOnFocusOut:v=!0}=e,{open:p,refs:h,nodeId:y,onOpenChange:b,events:E,dataRef:w,elements:{domReference:R,floating:x}}=t,I=!s()||o,k=V(r),M=V(i),T=V(c),O=C(),L=be(),S="number"==typeof i&&i<0,A=u.useRef(null),D=u.useRef(null),F=u.useRef(!1),K=u.useRef(null),B=u.useRef(!1),H=null!=L,_=R&&"combobox"===R.getAttribute("role")&&oe(R),q=u.useCallback((function(e){return void 0===e&&(e=x),e?d(e,ie()):[]}),[x]),X=u.useCallback((e=>{const t=q(e);return k.current.map((e=>R&&"reference"===e?R:x&&"floating"===e?x:t)).filter(Boolean).flat()}),[R,x,k,q]);function Y(e){return m&&l?u.createElement(Ee,{ref:"start"===e?A:D,onClick:e=>b(!1,e.nativeEvent)},"string"==typeof m?m:"Dismiss"):null}u.useEffect((()=>{if(!l)return;function e(e){if("Tab"===e.key){j(x,J(P(x)))&&0===q().length&&!_&&ue(e);const t=X(),n=ne(e);"reference"===k.current[0]&&n===R&&(ue(e),e.shiftKey?ee(t[t.length-1]):ee(t[1])),"floating"===k.current[1]&&n===x&&e.shiftKey&&(ue(e),ee(t[0]))}}const t=P(x);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[R,x,l,k,h,_,q,X]),u.useEffect((()=>{if(v)return x&&N(R)?(R.addEventListener("focusout",t),R.addEventListener("pointerdown",e),!l&&x.addEventListener("focusout",t),()=>{R.removeEventListener("focusout",t),R.removeEventListener("pointerdown",e),!l&&x.removeEventListener("focusout",t)}):void 0;function e(){B.current=!0,setTimeout((()=>{B.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(j(R,t)||j(x,t)||j(t,x)||j(null==L?void 0:L.portalNode,t)||null!=t&&t.hasAttribute(W("focus-guard"))||O&&(te(O.nodesRef.current,y).find((e=>{var n,r;return j(null==(n=e.context)?void 0:n.elements.floating,t)||j(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}(O.nodesRef.current,y).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!B.current&&t!==K.current&&(F.current=!0,b(!1,e))}))}}),[R,x,l,y,O,L,b,v]),u.useEffect((()=>{var e;const t=Array.from((null==L||null==(e=L.portalNode)?void 0:e.querySelectorAll("["+W("portal")+"]"))||[]);if(x&&l){const e=[x,...t,A.current,D.current].filter((e=>null!=e)),n=(I?a:f)(k.current.includes("reference")||_?e.concat(R||[]):e,void 0,W("inert"));return()=>{n()}}}),[R,x,l,k,L,_,I]),g((()=>{if(!x)return;const e=J(P(x));queueMicrotask((()=>{const t=X(x),n=M.current,r=("number"==typeof n?t[n]:n.current)||x,o=j(x,e);S||o||!p||ee(r,{preventScroll:r===x})}))}),[p,x,S,X,M]),g((()=>{if(!x)return;let e=!1;const t=P(x),n=J(t),r=w.current;function o(t){if("escapeKey"===t.type&&h.domReference.current&&(K.current=h.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(F.current=!1,e=n.preventScroll):F.current=!n}return K.current=n,E.on("dismiss",o),()=>{E.off("dismiss",o);const n=J(t);(j(x,n)||O&&te(O.nodesRef.current,y).some((e=>{var t;return j(null==(t=e.context)?void 0:t.elements.floating,n)}))||r.openEvent&&["click","mousedown"].includes(r.openEvent.type))&&h.domReference.current&&(K.current=h.domReference.current),T.current&&N(K.current)&&!F.current&&ee(K.current,{cancelPrevious:!1,preventScroll:e})}}),[x,T,w,h,E,O,y]),g((()=>{if(L)return L.setFocusManagerState({...t,modal:l,closeOnFocusOut:v,open:p}),()=>{L.setFocusManagerState(null)}}),[L,l,p,v,t]),g((()=>{if(x&&"function"==typeof MutationObserver){const e=()=>{const e=x.getAttribute("tabindex");k.current.includes("floating")||J(P(x))!==h.domReference.current&&0===q().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()}}}),[x,h,k,q]);const U=I&&!_&&(H||l);return u.createElement(u.Fragment,null,U&&u.createElement(pe,{"data-type":"inside",ref:null==L?void 0:L.beforeInsideRef,onFocus:e=>{if(l){const e=X();ee("reference"===r[0]?e[0]:e[e.length-1])}else if(null!=L&&L.preserveTabOrder&&L.portalNode)if(F.current=!1,ae(e,L.portalNode)){const e=le()||R;null==e||e.focus()}else{var t;null==(t=L.beforeOutsideRef.current)||t.focus()}}}),!_&&Y("start"),n,Y("end"),U&&u.createElement(pe,{"data-type":"inside",ref:null==L?void 0:L.afterInsideRef,onFocus:e=>{if(l)ee(X()[0]);else if(null!=L&&L.preserveTabOrder&&L.portalNode)if(v&&(F.current=!0),ae(e,L.portalNode)){const e=se()||R;null==e||e.focus()}else{var t;null==(t=L.afterOutsideRef.current)||t.focus()}}}))}function Re(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 xe=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function Ie(e){let{children:t,elementsRef:n,labelsRef:r}=e;const[o,i]=u.useState((()=>new Map)),c=u.useCallback((e=>{i((t=>new Map(t).set(e,null)))}),[]),l=u.useCallback((e=>{i((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return g((()=>{const e=new Map(o);Array.from(e.keys()).sort(Re).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(xe.Provider,{value:u.useMemo((()=>({register:c,unregister:l,map:o,elementsRef:n,labelsRef:r})),[c,l,o,n,r])},t)}function ke(e){let{label:t}=void 0===e?{}:e;const[n,r]=u.useState(null),o=u.useRef(null),{register:i,unregister:c,map:l,elementsRef:s,labelsRef:a}=u.useContext(xe),f=u.useCallback((e=>{if(o.current=e,null!==n&&(s.current[n]=e,a)){var r;const o=void 0!==t;a.current[n]=o?t:null!=(r=null==e?void 0:e.textContent)?r:null}}),[n,s,a,t]);return g((()=>{const e=o.current;if(e)return i(e),()=>{c(e)}}),[i,c]),g((()=>{const e=o.current?l.get(o.current):null;null!=e&&r(e)}),[l]),u.useMemo((()=>({ref:f,index:null==n?-1:n})),[n,f])}const Ce=W("scroll-lock"),Me=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return g((()=>{var e,t;if(!n)return;if(document.body.hasAttribute(Ce))return;document.body.setAttribute(Ce,"");const r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth;if(!/iP(hone|ad|od)|iOS/.test(L()))return Object.assign(document.body.style,{overflow:"hidden",[r]:o+"px"}),()=>{document.body.removeAttribute(Ce),Object.assign(document.body.style,{overflow:"",[r]:""})};const u=(null==(e=window.visualViewport)?void 0:e.offsetLeft)||0,i=(null==(t=window.visualViewport)?void 0:t.offsetTop)||0,c=window.pageXOffset,l=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(l-Math.floor(i))+"px",left:-(c-Math.floor(u))+"px",right:"0",[r]:o+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[r]:""}),document.body.removeAttribute(Ce),window.scrollTo(c,l)}}),[n]),u.createElement("div",p({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Te(e){return N(e.target)&&"BUTTON"===e.target.tagName}function Oe(e){return oe(e)}function Pe(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);return u.useMemo((()=>c?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(_(d.current,!0)&&a||"click"!==l&&(n?!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type||r(!1,e.nativeEvent):(e.preventDefault(),r(!0,e.nativeEvent))))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:_(d.current,!0)&&a||(n?!s||o.current.openEvent&&"click"!==o.current.openEvent.type||r(!1,e.nativeEvent):r(!0,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||Te(e)||(" "!==e.key||Oe(i)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&(n?s&&r(!1,e.nativeEvent):r(!0,e.nativeEvent)))},onKeyUp(e){e.defaultPrevented||!f||Te(e)||Oe(i)||" "===e.key&&m.current&&(m.current=!1,n?s&&r(!1,e.nativeEvent):r(!0,e.nativeEvent))}}}:{}),[c,o,l,a,f,i,s,n,r])}const Le=u["useInsertionEffect".toString()]||(e=>e());function Se(e){const t=u.useRef((()=>{}));return Le((()=>{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 Ae(e){return null!=e&&null!=e.clientX}function De(e,t){void 0===t&&(t={});const{open:n,refs:r,dataRef:o,elements:{floating:i}}=e,{enabled:c=!0,axis:l="both",x:s=null,y:a=null}=t,f=u.useRef(!1),d=u.useRef(null),[m,v]=u.useState(),[p,h]=u.useState([]),y=Se(((e,t)=>{f.current||o.current.openEvent&&!Ae(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,i;const c=(null==(u=e.current)?void 0:u.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,a=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let f=c.width,d=c.height,m=c.x,v=c.y;return null==n&&t.x&&l&&(n=c.x-t.x),null==r&&t.y&&s&&(r=c.y-t.y),m-=n||0,v-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?c.width:0,d="x"===t.axis?c.height:0,m=l&&null!=t.x?t.x:m,v=s&&null!=t.y?t.y:v):o&&!a&&(d="x"===t.axis?c.height:d,f="y"===t.axis?c.width:f),o=!0,{width:f,height:d,x:m,y:v,top:v,right:m+f,bottom:v+d,left:m}}}}(r.domReference,{x:e,y:t,axis:l,dataRef:o,pointerType:m}))})),b=Se((e=>{null==s&&null==a&&(n?d.current||h([]):y(e.clientX,e.clientY))})),E=_(m)?i:n,w=u.useCallback((()=>{if(!E||!c||null!=s||null!=a)return;const e=A(r.floating.current);function t(n){const o=ne(n);j(r.floating.current,o)?(e.removeEventListener("mousemove",t),d.current=null):y(n.clientX,n.clientY)}if(!o.current.openEvent||Ae(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),d.current=null};return d.current=n,n}r.setPositionReference(r.domReference.current)}),[o,c,E,r,y,s,a]);return u.useEffect((()=>w()),[w,p]),u.useEffect((()=>{c&&!i&&(f.current=!1)}),[c,i]),u.useEffect((()=>{!c&&n&&(f.current=!0)}),[c,n]),g((()=>{!c||null==s&&null==a||(f.current=!1,y(s,a))}),[c,s,a,y]),u.useMemo((()=>{if(!c)return{};function e(e){let{pointerType:t}=e;v(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:b,onMouseEnter:b}}}),[c,b])}function Ne(e,t){return!e||D(e)&&q(e)?null:F(e)?Ne(e.host,t):D(e)&&e.matches(t)?e:Ne(e.parentNode,t)}function Fe(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)}const Ke={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Be={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"};function He(e,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,nodeId:c,elements:{reference:l,domReference:s,floating:a},dataRef:f}=e,{enabled:d=!0,escapeKey:m=!0,outsidePress:v=!0,outsidePressEvent:p="pointerdown",referencePress:g=!1,referencePressEvent:h="pointerdown",ancestorScroll:y=!1,bubbles:b}=n,E=C(),w=null!=k(),R=Se("function"==typeof v?v:()=>!1),x="function"==typeof v?R:v,I=u.useRef(!1),{escapeKeyBubbles:M,outsidePressBubbles:T}=(e=>{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}})(b),O=Se((e=>{if(!r||!d||!m||"Escape"!==e.key)return;const t=E?te(E.nodesRef.current,c):[];if(!M&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e)})),L=Se((e=>{const t=I.current;if(I.current=!1,t)return;if("function"==typeof x&&!x(e))return;const n=ne(e),r="["+W("inert")+"]";if(D(n)&&P(n).querySelector(r)&&!Ne(n,r)&&!q(n))return;if(N(n)&&a){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,r=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let o=r&&e.offsetX>n.clientWidth;if(r){"rtl"===A(a).getComputedStyle(n).direction&&(o=e.offsetX<=n.offsetWidth-n.clientWidth)}if(o||t&&e.offsetY>n.clientHeight)return}const u=E&&te(E.nodesRef.current,c).some((t=>{var n;return Fe(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Fe(e,a)||Fe(e,s)||u)return;const l=E?te(E.nodesRef.current,c):[];if(l.length>0){let e=!0;if(l.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:K(e)||B(e)}}),o(!1,e)}));return u.useEffect((()=>{if(!r||!d)return;function e(e){o(!1,e)}f.current.__escapeKeyBubbles=M,f.current.__outsidePressBubbles=T;const n=P(a);m&&n.addEventListener("keydown",O),x&&n.addEventListener(p,L);let u=[];return y&&(D(s)&&(u=t(s)),D(a)&&(u=u.concat(t(a))),!D(l)&&l&&l.contextElement&&(u=u.concat(t(l.contextElement)))),u=u.filter((e=>{var t;return e!==(null==(t=n.defaultView)?void 0:t.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{m&&n.removeEventListener("keydown",O),x&&n.removeEventListener(p,L),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[f,a,s,l,m,x,p,r,o,y,d,M,T,O,L]),u.useEffect((()=>{I.current=!1}),[x,p]),u.useMemo((()=>d?{reference:{onKeyDown:O,[Ke[h]]:e=>{g&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:O,[Be[p]]:()=>{I.current=!0}}}:{}),[d,i,g,p,h,o,O])}function _e(e){var t;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:i}=e,[c,l]=u.useState(null),s=(null==(t=e.elements)?void 0:t.reference)||c,a=n(e),f=C(),d=Se(((e,t)=>{e&&(v.current.openEvent=t),null==o||o(e,t)})),m=u.useRef(null),v=u.useRef({}),p=u.useState((()=>R()))[0],h=E(),y=u.useCallback((e=>{const t=D(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a.refs.setReference(t)}),[a.refs]),b=u.useCallback((e=>{(D(e)||null===e)&&(m.current=e,l(e)),(D(a.refs.reference.current)||null===a.refs.reference.current||null!==e&&!D(e))&&a.refs.setReference(e)}),[a.refs]),w=u.useMemo((()=>({...a.refs,setReference:b,setPositionReference:y,domReference:m})),[a.refs,b,y]),x=u.useMemo((()=>({...a.elements,domReference:s})),[a.elements,s]),I=u.useMemo((()=>({...a,refs:w,elements:x,dataRef:v,nodeId:i,floatingId:h,events:p,open:r,onOpenChange:d})),[a,i,h,p,r,d,w,x]);return g((()=>{const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===i));e&&(e.context=I)})),u.useMemo((()=>({...a,context:I,refs:w,elements:x})),[a,w,x,I])}function qe(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,refs:c,elements:{floating:l,domReference:s}}=e,{enabled:a=!0,keyboardOnly:f=!0}=t,d=u.useRef(""),m=u.useRef(!1),v=u.useRef();return u.useEffect((()=>{if(!a)return;const e=P(l).defaultView||window;function t(){!n&&N(s)&&s===J(P(s))&&(m.current=!0)}return e.addEventListener("blur",t),()=>{e.removeEventListener("blur",t)}}),[l,s,n,a]),u.useEffect((()=>{if(a)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(e){"referencePress"!==e.type&&"escapeKey"!==e.type||(m.current=!0)}}),[i,a]),u.useEffect((()=>()=>{clearTimeout(v.current)}),[]),u.useMemo((()=>a?{reference:{onPointerDown(e){let{pointerType:t}=e;d.current=t,m.current=!(!t||!f)},onMouseLeave(){m.current=!1},onFocus(e){var t;m.current||"focus"===e.type&&"mousedown"===(null==(t=o.current.openEvent)?void 0:t.type)&&Fe(o.current.openEvent,s)||r(!0,e.nativeEvent)},onBlur(e){m.current=!1;const t=e.relatedTarget,n=D(t)&&t.hasAttribute(W("focus-guard"))&&"outside"===t.getAttribute("data-type");v.current=setTimeout((()=>{j(c.floating.current,t)||j(s,t)||n||r(!1,e.nativeEvent)}))}}}:{}),[a,f,s,c,o,r])}function je(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var u;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(u=r.get(n))||u.push(o),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]=o})),e):e),{})}}function We(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>je(t,e,"reference")),t),r=u.useCallback((t=>je(t,e,"floating")),t),o=u.useCallback((t=>je(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return u.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])}let Ve=!1;const Xe="ArrowUp",Ye="ArrowDown",Ue="ArrowLeft",ze="ArrowRight";function Ze(e,t,n){return Math.floor(e/t)!==n}function Ge(e,t){return t<0||t>=e.current.length}function Qe(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{var l,s;c+=r?-u:u}while(c>=0&&c<=i.length-1&&(o?o.includes(c):null==i[c]||(null==(l=i[c])?void 0:l.hasAttribute("disabled"))||"true"===(null==(s=i[c])?void 0:s.getAttribute("aria-disabled"))||(a=i[c])&&null===a.offsetParent));var a;return c}function Je(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function $e(e,t){return Je(t,e===Xe||e===Ye,e===Ue||e===ze)}function et(e,t,n){return Je(t,e===Ye,n?e===Ue:e===ze)||"Enter"===e||" "==e||""===e}function tt(e,t){return Qe(e,{disabledIndices:t})}function nt(e,t){return Qe(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function rt(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:i,floating:c}}=e,{listRef:l,activeIndex:s,onNavigate:a=(()=>{}),enabled:f=!0,selectedIndex:d=null,allowEscape:m=!1,loop:v=!1,nested:p=!1,rtl:h=!1,virtual:y=!1,focusItemOnOpen:b="auto",focusItemOnHover:E=!0,openOnArrowKeyDown:w=!0,disabledIndices:R,orientation:x="vertical",cols:I=1,scrollItemIntoView:M=!0}=t,T=k(),O=C(),S=Se(a),A=u.useRef(b),D=u.useRef(null!=d?d:-1),F=u.useRef(null),_=u.useRef(!0),q=u.useRef(S),W=u.useRef(!!c),X=u.useRef(!1),Y=u.useRef(!1),U=V(R),z=V(n),Z=V(M),[G,Q]=u.useState(),$=Se((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(y?Q(r.id):ee(r,{preventScroll:!0,sync:!(!L().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!H())&&(Ve||X.current)}),requestAnimationFrame((()=>{const e=Z.current;e&&r&&(n||!_.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));g((()=>{document.createElement("div").focus({get preventScroll(){return Ve=!0,!1}})}),[]),g((()=>{f&&(n&&c?A.current&&null!=d&&(Y.current=!0,S(d)):W.current&&(D.current=-1,q.current(null)))}),[f,n,c,d,S]),g((()=>{if(f&&n&&c)if(null==s){if(X.current=!1,null!=d)return;if(W.current&&(D.current=-1,$(l,D)),!W.current&&A.current&&(null!=F.current||!0===A.current&&null==F.current)){let e=0;const t=()=>{if(null==l.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else D.current=null==F.current||et(F.current,x,h)||p?tt(l,U.current):nt(l,U.current),F.current=null,S(D.current)};t()}}else Ge(l,s)||(D.current=s,$(l,D,Y.current),Y.current=!1)}),[f,n,c,s,d,p,l,x,h,S,$,U]),g((()=>{if(f&&W.current&&!c&&O){var e,t;const n=O.nodesRef.current,r=null==(e=n.find((e=>e.id===T)))||null==(t=e.context)?void 0:t.elements.floating,o=J(P(c)),u=n.some((e=>e.context&&j(e.context.elements.floating,o)));r&&!u&&r.focus({preventScroll:!0})}}),[f,c,O,T]),g((()=>{q.current=S,W.current=!!c})),g((()=>{n||(F.current=null)}),[n]);const te=null!=s,ne=u.useMemo((()=>{function e(e){if(!n)return;const t=l.current.indexOf(e);-1!==t&&S(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...E&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;_.current&&"touch"!==t&&(D.current=-1,$(l,D),S(null),y||ee(o.floating.current,{preventScroll:!0}))}}}}),[n,o,$,E,l,S,y]);return u.useMemo((()=>{if(!f)return{};const e=U.current;function t(t){if(_.current=!1,X.current=!0,!z.current&&t.currentTarget===o.floating.current)return;if(p&&function(e,t,n){return Je(t,n?e===ze:e===Ue,e===Xe)}(t.key,x,h))return ue(t),r(!1,t.nativeEvent),void(N(i)&&i.focus());const u=D.current,c=tt(l,e),s=nt(l,e);if("Home"===t.key&&(ue(t),D.current=c,S(D.current)),"End"===t.key&&(ue(t),D.current=s,S(D.current)),I>1){const n=D.current;if(t.key===Xe){if(ue(t),-1===n)D.current=s;else if(D.current=Qe(l,{startingIndex:n,amount:I,decrement:!0,disabledIndices:e}),v&&(n-I<c||D.current<0)){const e=n%I,t=s%I,r=s-(t-e);D.current=t===e?s:t>e?r:r-I}Ge(l,D.current)&&(D.current=n),S(D.current)}if(t.key===Ye&&(ue(t),-1===n?D.current=c:(D.current=Qe(l,{startingIndex:n,amount:I,disabledIndices:e}),v&&n+I>s&&(D.current=Qe(l,{startingIndex:n%I-I,amount:I,disabledIndices:e}))),Ge(l,D.current)&&(D.current=n),S(D.current)),"both"===x){const r=Math.floor(n/I);t.key===ze&&(ue(t),n%I!=I-1?(D.current=Qe(l,{startingIndex:n,disabledIndices:e}),v&&Ze(D.current,I,r)&&(D.current=Qe(l,{startingIndex:n-n%I-1,disabledIndices:e}))):v&&(D.current=Qe(l,{startingIndex:n-n%I-1,disabledIndices:e})),Ze(D.current,I,r)&&(D.current=n)),t.key===Ue&&(ue(t),n%I!=0?(D.current=Qe(l,{startingIndex:n,disabledIndices:e,decrement:!0}),v&&Ze(D.current,I,r)&&(D.current=Qe(l,{startingIndex:n+(I-n%I),decrement:!0,disabledIndices:e}))):v&&(D.current=Qe(l,{startingIndex:n+(I-n%I),decrement:!0,disabledIndices:e})),Ze(D.current,I,r)&&(D.current=n));const o=Math.floor(s/I)===r;return Ge(l,D.current)&&(D.current=v&&o?t.key===Ue?s:Qe(l,{startingIndex:n-n%I-1,disabledIndices:e}):n),void S(D.current)}}if($e(t.key,x)){if(ue(t),n&&!y&&J(t.currentTarget.ownerDocument)===t.currentTarget)return D.current=et(t.key,x,h)?c:s,void S(D.current);et(t.key,x,h)?D.current=v?u>=s?m&&u!==l.current.length?-1:c:Qe(l,{startingIndex:u,disabledIndices:e}):Math.min(s,Qe(l,{startingIndex:u,disabledIndices:e})):D.current=v?u<=c?m&&-1!==u?l.current.length:s:Qe(l,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(c,Qe(l,{startingIndex:u,decrement:!0,disabledIndices:e})),Ge(l,D.current)?S(null):S(D.current)}}function u(e){"auto"===b&&K(e.nativeEvent)&&(A.current=!0)}const c=y&&n&&te&&{"aria-activedescendant":G};return{reference:{...c,onKeyDown(o){_.current=!1;const u=0===o.key.indexOf("Arrow");if(y&&n)return t(o);if(!n&&!w&&u)return;const i=u||"Enter"===o.key||""===o.key.trim(),c=$e(o.key,x),s=function(e,t,n){return Je(t,n?e===Ue:e===ze,e===Ye)}(o.key,x,h);i&&(F.current=p&&c?null:o.key),p?s&&(ue(o),n?(D.current=tt(l,e),S(D.current)):r(!0,o.nativeEvent)):c&&(null!=d&&(D.current=d),ue(o),!n&&w?r(!0,o.nativeEvent):t(o),n&&S(D.current))},onFocus(){n&&S(null)},onPointerDown:function(e){A.current=b,"auto"===b&&B(e.nativeEvent)&&(A.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===x?void 0:x,...c,onKeyDown:t,onPointerMove(){_.current=!0}},item:ne}}),[i,o,G,U,z,l,f,x,h,y,n,te,p,d,w,m,I,v,b,S,r,ne])}function ot(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)}function ut(e,t){void 0===t&&(t={});const{open:n,floatingId:r}=e,{enabled:o=!0,role:i="dialog"}=t,c=E();return u.useMemo((()=>{const e={id:r,role:i};return o?"tooltip"===i?{reference:{"aria-describedby":n?r:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===i?"dialog":i,"aria-controls":n?r:void 0,..."listbox"===i&&{role:"combobox"},..."menu"===i&&{id:c}},floating:{...e,..."menu"===i&&{"aria-labelledby":c}}}:{}}),[o,i,n,r,c])}const it=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function ct(e,t){return"function"==typeof e?e(t):e}function lt(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[c,l]=u.useState(!1),[s,a]=u.useState("unmounted"),f=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return g((()=>{c&&!f&&a("unmounted")}),[c,f]),g((()=>{if(r){if(n){a("initial");const e=requestAnimationFrame((()=>{a("open")}));return()=>{cancelAnimationFrame(e)}}l(!0),a("close")}}),[n,r]),{isMounted:f,status:s}}function st(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((()=>({...ct(i,a),...ct(n,a)}))),{isMounted:h,status:y}=lt(e,{duration:c}),b=V(n),E=V(r),w=V(o),R=V(i);return g((()=>{const e=ct(b.current,a),t=ct(w.current,a),n=ct(R.current,a),r=ct(E.current,a)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===y&&p((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===y&&p({transitionProperty:Object.keys(r).map(it).join(","),transitionDuration:d+"ms",...n,...r}),"close"===y){const r=t||e;p({transitionProperty:Object.keys(r).map(it).join(","),transitionDuration:m+"ms",...n,...r})}}),[m,w,b,E,R,d,y,a]),{isMounted:h,styles:v}}function at(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:c,onMatch:l,onTypingChange:s,enabled:a=!0,findMatch:f=null,resetMs:d=750,ignoreKeys:m=[],selectedIndex:v=null}=t,p=u.useRef(),h=u.useRef(""),y=u.useRef(null!=(n=null!=v?v:c)?n:-1),b=u.useRef(null),E=Se(l),w=Se(s),R=V(f),x=V(m);return g((()=>{r&&(clearTimeout(p.current),b.current=null,h.current="")}),[r]),g((()=>{var e;r&&""===h.current&&(y.current=null!=(e=null!=v?v:c)?e:-1)}),[r,v,c]),u.useMemo((()=>{if(!a)return{};function e(e){e?o.current.typing||(o.current.typing=e,w(e)):o.current.typing&&(o.current.typing=e,w(e))}function t(e,t,n){const r=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}function n(n){const o=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(o,o,h.current)?e(!1):" "===n.key&&ue(n)),null==o||x.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(ue(n),e(!0));o.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.current===n.key&&(h.current="",y.current=b.current),h.current+=n.key,clearTimeout(p.current),p.current=setTimeout((()=>{h.current="",y.current=b.current,e(!1)}),d);const u=y.current,c=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],h.current);-1!==c?(E(c),b.current=c):" "!==n.key&&(h.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[a,r,o,i,d,x,R,E,w])}function ft(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const dt=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:u,onFallbackChange:i,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:m,elements:{floating:p}}=t,g=n.current[l];if(!g)return{};const h={...t,...await r(-g.offsetTop-p.clientTop-m.reference.height/2-g.offsetHeight/2-c).fn(t)},y=(null==f?void 0:f.current)||p,b=await o(ft(h,y.scrollHeight),d),E=await o(h,{...d,elementContext:"reference"}),w=Math.max(0,b.top),R=h.y+w,x=Math.max(0,y.scrollHeight-w-Math.max(0,b.bottom));return y.style.maxHeight=x+"px",y.scrollTop=w,i&&(y.offsetHeight<g.offsetHeight*Math.min(s,n.current.length-1)-1||E.top>=-a||E.bottom>=-a?v((()=>i(!0))):v((()=>i(!1)))),u&&(u.current=await o(ft({...h,y:R},y.offsetHeight),d)),{y:R}}});function mt(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:c,onChange:l}=t,s=Se(l),a=u.useRef(!1),f=u.useRef(null),d=u.useRef(null);return u.useEffect((()=>{if(!o)return;function e(e){if(e.ctrlKey||!t||null==i.current)return;const n=e.deltaY,r=i.current.top>=-.5,o=i.current.bottom>=-.5,u=t.scrollHeight-t.clientHeight,c=n<0?-1:1,l=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&n>0||!o&&n<0?(e.preventDefault(),v((()=>{s((e=>e+Math[l](n,u*c)))}))):/firefox/i.test(S())&&(t.scrollTop+=n))}const t=(null==c?void 0:c.current)||r.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{f.current=t.scrollTop,null!=i.current&&(d.current={...i.current})})),()=>{f.current=null,d.current=null,t.removeEventListener("wheel",e)}):void 0}),[o,n,r.floating,i,c,s]),u.useMemo((()=>o?{floating:{onKeyDown(){a.current=!0},onWheel(){a.current=!1},onPointerMove(){a.current=!1},onScroll(){const e=(null==c?void 0:c.current)||r.floating;if(i.current&&e&&a.current){if(null!==f.current){const t=e.scrollTop-f.current;(i.current.bottom<-.5&&t<-1||i.current.top<-.5&&t>1)&&v((()=>s((e=>e+t))))}requestAnimationFrame((()=>{f.current=e.scrollTop}))}}}}:{}),[o,i,r.floating,c,s])}function vt(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}function pt(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 p(){clearTimeout(o),d()}if(clearTimeout(o),!f.domReference||!f.floating||null==a||null==n||null==s)return;const{clientX:g,clientY:h}=e,y=[g,h],b=ne(e),E="mouseleave"===e.type,w=j(f.floating,b),R=j(f.domReference,b),x=f.domReference.getBoundingClientRect(),I=f.floating.getBoundingClientRect(),k=a.split("-")[0],C=n>I.right-I.width/2,M=s>I.bottom-I.height/2,T=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,x),O=I.width>x.width,P=I.height>x.height,L=(O?x:I).left,S=(O?x:I).right,A=(P?x:I).top,N=(P?x:I).bottom;if(w&&(u=!0,!E))return;if(R&&(u=!1),R&&!E)return void(u=!0);if(E&&D(e.relatedTarget)&&j(f.floating,e.relatedTarget))return;if(v&&te(v.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===k&&s>=x.bottom-1||"bottom"===k&&s<=x.top+1||"left"===k&&n>=x.right-1||"right"===k&&n<=x.left+1)return p();let F=[];switch(k){case"top":F=[[L,x.top+1],[L,I.bottom-1],[S,I.bottom-1],[S,x.top+1]];break;case"bottom":F=[[L,I.top+1],[L,x.bottom-1],[S,x.bottom-1],[S,I.top+1]];break;case"left":F=[[I.right-1,N],[I.right-1,A],[x.left+1,A],[x.left+1,N]];break;case"right":F=[[x.right-1,N],[x.right-1,A],[I.left+1,A],[I.left+1,N]]}if(!vt([g,h],F)){if(u&&!T)return p();if(!E&&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 p()}vt([g,h],function(e){let[n,r]=e;switch(k){case"top":return[[O?n+t/2:C?n+4*t:n-4*t,r+t+1],[O?n-t/2:C?n+4*t:n-4*t,r+t+1],...[[I.left,C||O?I.bottom-t:I.top],[I.right,C?O?I.bottom-t:I.top:I.bottom-t]]];case"bottom":return[[O?n+t/2:C?n+4*t:n-4*t,r-t],[O?n-t/2:C?n+4*t:n-4*t,r-t],...[[I.left,C||O?I.top+t:I.bottom],[I.right,C?O?I.top+t:I.bottom:I.top+t]]];case"left":{const e=[n+t+1,P?r+t/2:M?r+4*t:r-4*t],o=[n+t+1,P?r-t/2:M?r+4*t:r-4*t];return[...[[M||P?I.right-t:I.left,I.top],[M?P?I.right-t:I.left:I.right-t,I.bottom]],e,o]}case"right":return[[n-t,P?r+t/2:M?r+4*t:r-4*t],[n-t,P?r-t/2:M?r+4*t:r-4*t],...[[M||P?I.left+t:I.right,I.top],[M?P?I.left+t:I.right:I.left+t,I.bottom]]]}}([n,s]))?!u&&r&&(o=window.setTimeout(p,40)):p()}}};return s.__options={blockPointerEvents:n},s}export{w as FloatingArrow,G as FloatingDelayGroup,we as FloatingFocusManager,Ie as FloatingList,T as FloatingNode,Me as FloatingOverlay,ye as FloatingPortal,O as FloatingTree,dt as inner,pt as safePolygon,Pe as useClick,De as useClientPoint,Q as useDelayGroup,Z as useDelayGroupContext,He as useDismiss,_e as useFloating,M as useFloatingNodeId,k as useFloatingParentNodeId,he as useFloatingPortalNode,C as useFloatingTree,qe as useFocus,U as useHover,E as useId,mt as useInnerOffset,We as useInteractions,ke as useListItem,rt as useListNavigation,ot as useMergeRefs,ut as useRole,lt as useTransitionStatus,st as useTransitionStyles,at as useTypeahead}; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@floating-ui/react-dom"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/react-dom","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIReact={},e.FloatingUIReactDOM,e.React,e.ReactDOM)}(this,(function(e,t,n,r){"use strict";function o(e){if(e&&e.__esModule)return 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(n);function i(){return i=Object.assign||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},i.apply(this,arguments)}var c="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;let l=!1,s=0;const a=()=>"floating-ui-"+s++;const f=u["useId".toString()]||function(){const[e,t]=u.useState((()=>l?a():void 0));return c((()=>{null==e&&t(a())}),[]),u.useEffect((()=>{l||(l=!0)}),[]),e},d=u.forwardRef((function(e,n){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:c}},width:l=14,height:s=7,tipRadius:a=0,strokeWidth:d=0,staticOffset:m,stroke:p,d:v,style:{transform:g,...h}={},...y}=e;const b=f();if(!o)return null;d*=2;const E=d/2,w=l/2*(a/-8+1),R=s/2*a/4,[x,I]=r.split("-"),O=t.platform.isRTL(o),k=!!v,C="top"===x||"bottom"===x,M=m&&"end"===I?"bottom":"top";let P=m&&"end"===I?"right":"left";m&&O&&(P="end"===I?"left":"right");const T=null!=(null==c?void 0:c.x)?m||c.x:"",S=null!=(null==c?void 0:c.y)?m||c.y:"",A=v||"M0,0 H"+l+" L"+(l-w)+","+(s-R)+" Q"+l/2+","+s+" "+w+","+(s-R)+" Z",L={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[x];return u.createElement("svg",i({},y,{"aria-hidden":!0,ref:n,width:k?l:l+d,height:l,viewBox:"0 0 "+l+" "+(s>l?s:l),style:{position:"absolute",pointerEvents:"none",[P]:T,[M]:S,[x]:C||k?"100%":"calc(100% - "+d/2+"px)",transform:""+L+(null!=g?g:""),...h}}),d>0&&u.createElement("path",{clipPath:"url(#"+b+")",fill:"none",stroke:p,strokeWidth:d+(v?0:1),d:A}),u.createElement("path",{stroke:d&&!v?y.fill:"none",d:A}),u.createElement("clipPath",{id:b},u.createElement("rect",{x:-E,y:E*(k?-1:1),width:l+d,height:l})))}));function m(){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 p=u.createContext(null),v=u.createContext(null),g=()=>{var e;return(null==(e=u.useContext(p))?void 0:e.id)||null},h=()=>u.useContext(v);function y(e){return(null==e?void 0:e.ownerDocument)||document}function b(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function E(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function w(e){return y(e).defaultView||window}function R(e){return!!e&&e instanceof w(e).Element}function x(e){return!!e&&e instanceof w(e).HTMLElement}function I(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(b())||t.test(E()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function O(e){return 0===e.width&&0===e.height||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}function k(){return/apple/i.test(navigator.vendor)}function C(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function M(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&(r=n,"undefined"!=typeof ShadowRoot&&(r instanceof w(r).ShadowRoot||r instanceof ShadowRoot))){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}var r;return!1}function P(e){const t=n.useRef(e);return c((()=>{t.current=e})),t}const T="data-floating-ui-safe-polygon";function S(e,t,n){return n&&!C(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}const A=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),L=()=>u.useContext(A);var D=new WeakMap,N=new WeakMap,F={},j=0,K=function(e,t,n){void 0===t&&(t=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e)),void 0===n&&(n="data-aria-hidden");var r=Array.isArray(e)?e:[e];F[n]||(F[n]=new WeakMap);var o=F[n],u=[],i=new Set,c=function(e){e&&!i.has(e)&&(i.add(e),c(e.parentNode))};r.forEach(c);var l=function(e){!e||r.indexOf(e)>=0||Array.prototype.forEach.call(e.children,(function(e){if(i.has(e))l(e);else{var t=e.getAttribute("aria-hidden"),r=null!==t&&"false"!==t,c=(D.get(e)||0)+1,s=(o.get(e)||0)+1;D.set(e,c),o.set(e,s),u.push(e),1===c&&r&&N.set(e,!0),1===s&&e.setAttribute(n,"true"),r||e.setAttribute("aria-hidden","true")}}))};return l(t),i.clear(),j++,function(){u.forEach((function(e){var t=D.get(e)-1,r=o.get(e)-1;D.set(e,t),o.set(e,r),t||(N.has(e)||e.removeAttribute("aria-hidden"),N.delete(e)),r||e.removeAttribute(n)})),--j||(D=new WeakMap,D=new WeakMap,N=new WeakMap,F={})}},_=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"].join(","),B="undefined"==typeof Element,H=B?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,q=!B&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},W=function e(t,n,r){for(var o=[],u=Array.from(t);u.length;){var i=u.shift();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{H.call(i,_)&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),a=!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},U=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},z=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},V=function(e){return"INPUT"===e.tagName},X=function(e){return function(e){return V(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||q(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)},Y=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},G=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=H.call(e,"details>summary:first-of-type")?e.parentElement:e;if(H.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Y(e)}else{if("function"==typeof r){for(var u=e;e;){var i=e.parentElement,c=q(e);if(i&&!i.shadowRoot&&!0===r(i))return Y(e);e=e.assignedSlot?e.assignedSlot:i||c===e.ownerDocument?i:c.host}e=u}if(function(e){for(var t,n=q(e).host,r=!!(null!==(t=n)&&void 0!==t&&t.ownerDocument.contains(n)||e.ownerDocument.contains(e));!r&&n;){var o;r=!(null===(o=n=q(n).host)||void 0===o||!o.ownerDocument.contains(n))}return r}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Z=function(e,t){return!(t.disabled||function(e){return V(e)&&"hidden"===e.type}(t)||G(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!!H.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},$=function(e,t){return!(X(t)||U(t)<0||!Z(e,t))},Q=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},J=function e(t){var n=[],r=[];return t.forEach((function(t,o){var u=!!t.scopeParent,i=u?t.scopeParent:t,c=U(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(z).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ee=function(e,t){var n;return n=(t=t||{}).getShadowRoot?W([e],t.includeContainer,{filter:$.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Q}):function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(_));return t&&H.call(e,_)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,$.bind(null,t)),J(n)};function te(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}let ne=0;function re(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(ne);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():ne=requestAnimationFrame(u)}function oe(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}function ue(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ie(e){return x(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function ce(e){e.preventDefault(),e.stopPropagation()}const le=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function se(e,t){const n=ee(e,le());"prev"===t&&n.reverse();const r=n.indexOf(te(y(e)));return n.slice(r+1)[0]}function ae(){return se(document.body,"next")}function fe(){return se(document.body,"prev")}function de(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!M(n,r)}function me(e){ee(e,le()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function pe(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 ve={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 ge(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const he=u.forwardRef((function(e,t){const[n,r]=u.useState();return c((()=>(k()&&r("button"),document.addEventListener("keydown",ge),()=>{document.removeEventListener("keydown",ge)})),[]),u.createElement("span",i({},e,{ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,"data-floating-ui-focus-guard":"",style:ve}))})),ye=u.createContext(null);function be(e){let{id:t,root:n}=void 0===e?{}:e;const[r,o]=u.useState(null),i=f(),l=Ee(),s=u.useMemo((()=>({id:t,root:n,portalContext:l,uniqueId:i})),[t,n,l,i]),a=u.useRef();return c((()=>()=>{null==r||r.remove()}),[r,s]),c((()=>{if(a.current===s)return;a.current=s;const{id:e,root:t,portalContext:n,uniqueId:r}=s,u=e?document.getElementById(e):null,i="data-floating-ui-portal";if(u){const e=document.createElement("div");e.id=r,e.setAttribute(i,""),u.appendChild(e),o(e)}else{let u=t||(null==n?void 0:n.portalNode);u&&!R(u)&&(u=u.current),u=u||document.body;let c=null;e&&(c=document.createElement("div"),c.id=e,u.appendChild(c));const l=document.createElement("div");l.id=r,l.setAttribute(i,""),u=c||u,u.appendChild(l),o(l)}}),[s]),r}const Ee=()=>u.useContext(ye),we=u.forwardRef((function(e,t){return u.createElement("button",i({},e,{type:"button",ref:t,tabIndex:-1,style:ve}))}));function Re(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 xe=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});const Ie="data-floating-ui-scroll-lock",Oe=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return c((()=>{var e,t;if(!n)return;if(document.body.hasAttribute(Ie))return;document.body.setAttribute(Ie,"");const r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth;if(!/iP(hone|ad|od)|iOS/.test(b()))return Object.assign(document.body.style,{overflow:"hidden",[r]:o+"px"}),()=>{document.body.removeAttribute(Ie),Object.assign(document.body.style,{overflow:"",[r]:""})};const u=(null==(e=window.visualViewport)?void 0:e.offsetLeft)||0,i=(null==(t=window.visualViewport)?void 0:t.offsetTop)||0,c=window.pageXOffset,l=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(l-Math.floor(i))+"px",left:-(c-Math.floor(u))+"px",right:"0",[r]:o+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[r]:""}),document.body.removeAttribute(Ie),window.scrollTo(c,l)}}),[n]),u.createElement("div",i({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function ke(e){return x(e.target)&&"BUTTON"===e.target.tagName}function Ce(e){return ie(e)}const Me=u["useInsertionEffect".toString()]||(e=>e());function Pe(e){const t=u.useRef((()=>{}));return Me((()=>{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 Te(e){return null!=e&&null!=e.clientX}function Se(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)}const Ae={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Le={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"};function De(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var u;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(u=r.get(n))||u.push(o),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]=o})),e):e),{})}}let Ne=!1;const Fe="ArrowUp",je="ArrowDown",Ke="ArrowLeft",_e="ArrowRight";function Be(e,t,n){return Math.floor(e/t)!==n}function He(e,t){return t<0||t>=e.current.length}function qe(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{var l,s;c+=r?-u:u}while(c>=0&&c<=i.length-1&&(o?o.includes(c):null==i[c]||(null==(l=i[c])?void 0:l.hasAttribute("disabled"))||"true"===(null==(s=i[c])?void 0:s.getAttribute("aria-disabled"))));return c}function We(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ue(e,t){return We(t,e===Fe||e===je,e===Ke||e===_e)}function ze(e,t,n){return We(t,e===je,n?e===Ke:e===_e)||"Enter"===e||" "==e||""===e}function Ve(e,t){return qe(e,{disabledIndices:t})}function Xe(e,t){return qe(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const Ye=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Ge(e,t){return"function"==typeof e?e(t):e}function Ze(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[l,s]=u.useState(!1),[a,f]=u.useState("unmounted"),d=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return c((()=>{l&&!d&&f("unmounted")}),[l,d]),c((()=>{if(r){if(n){f("initial");const e=requestAnimationFrame((()=>{f("open")}));return()=>{cancelAnimationFrame(e)}}s(!0),f("close")}}),[n,r]),{isMounted:d,status:a}}function $e(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function Qe(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 t.arrow}}),Object.defineProperty(e,"autoPlacement",{enumerable:!0,get:function(){return t.autoPlacement}}),Object.defineProperty(e,"autoUpdate",{enumerable:!0,get:function(){return t.autoUpdate}}),Object.defineProperty(e,"computePosition",{enumerable:!0,get:function(){return t.computePosition}}),Object.defineProperty(e,"detectOverflow",{enumerable:!0,get:function(){return t.detectOverflow}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return t.flip}}),Object.defineProperty(e,"getOverflowAncestors",{enumerable:!0,get:function(){return t.getOverflowAncestors}}),Object.defineProperty(e,"hide",{enumerable:!0,get:function(){return t.hide}}),Object.defineProperty(e,"inline",{enumerable:!0,get:function(){return t.inline}}),Object.defineProperty(e,"limitShift",{enumerable:!0,get:function(){return t.limitShift}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return t.offset}}),Object.defineProperty(e,"platform",{enumerable:!0,get:function(){return t.platform}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return t.shift}}),Object.defineProperty(e,"size",{enumerable:!0,get:function(){return t.size}}),e.FloatingArrow=d,e.FloatingDelayGroup=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,i]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),l=u.useRef(null),s=u.useCallback((e=>{i({currentId:e})}),[]);return c((()=>{o.currentId?null===l.current?l.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),l.current=null)}),[o.currentId]),u.createElement(A.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:s})),[o,i,s])},t)},e.FloatingFocusManager=function(e){const{context:t,children:n,order:r=["content"],guards:o=!0,initialFocus:i=0,returnFocus:l=!0,modal:s=!0,visuallyHiddenDismiss:a=!1,closeOnFocusOut:f=!0}=e,{open:d,refs:m,nodeId:p,onOpenChange:v,events:g,dataRef:b,elements:{domReference:E,floating:w}}=t,R=P(r),I=P(i),O=P(l),k=h(),C=Ee(),T="number"==typeof i&&i<0,S=u.useRef(null),A=u.useRef(null),L=u.useRef(!1),D=u.useRef(null),N=u.useRef(!1),F=null!=C,j=E&&"combobox"===E.getAttribute("role")&&ie(E),_=u.useCallback((function(e){return void 0===e&&(e=w),e?ee(e,le()):[]}),[w]),B=u.useCallback((e=>{const t=_(e);return R.current.map((e=>E&&"reference"===e?E:w&&"floating"===e?w:t)).filter(Boolean).flat()}),[E,w,R,_]);function H(e){return a&&s?u.createElement(we,{ref:"start"===e?S:A,onClick:e=>v(!1,e.nativeEvent)},"string"==typeof a?a:"Dismiss"):null}u.useEffect((()=>{if(!s)return;function e(e){if("Tab"===e.key){M(w,te(y(w)))&&0===_().length&&!j&&ce(e);const t=B(),n=ue(e);"reference"===R.current[0]&&n===E&&(ce(e),e.shiftKey?re(t[t.length-1]):re(t[1])),"floating"===R.current[1]&&n===w&&e.shiftKey&&(ce(e),re(t[0]))}}const t=y(w);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[E,w,s,R,m,j,_,B]),u.useEffect((()=>{if(f)return w&&x(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),!s&&w.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),!s&&w.removeEventListener("focusout",t)}):void 0;function e(){N.current=!0,setTimeout((()=>{N.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(M(E,t)||M(w,t)||M(t,w)||M(null==C?void 0:C.portalNode,t)||null!=t&&t.hasAttribute("data-floating-ui-focus-guard")||k&&(oe(k.nodesRef.current,p).find((e=>{var n,r;return M(null==(n=e.context)?void 0:n.elements.floating,t)||M(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,p).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!N.current&&t!==D.current&&(L.current=!0,v(!1,e))}))}}),[E,w,s,p,k,C,v,f]),u.useEffect((()=>{var e;const t=Array.from((null==C||null==(e=C.portalNode)?void 0:e.querySelectorAll("[data-floating-ui-portal]"))||[]);if(w&&s){const e=[w,...t,...[S.current,A.current].filter(Boolean)],n=K(R.current.includes("reference")||j?e.concat(E||[]):e);return()=>{n()}}}),[E,w,s,R,C,j]),u.useEffect((()=>{if(s&&!o&&w){const e=[],t=le(),n=ee(y(w).body,t),r=B(),o=n.filter((e=>!r.includes(e)));return o.forEach(((t,n)=>{e[n]=t.getAttribute("tabindex"),t.setAttribute("tabindex","-1")})),()=>{o.forEach(((t,n)=>{const r=e[n];null==r?t.removeAttribute("tabindex"):t.setAttribute("tabindex",r)}))}}}),[w,s,o,B]),c((()=>{if(!w)return;const e=te(y(w));queueMicrotask((()=>{const t=B(w),n=I.current,r=("number"==typeof n?t[n]:n.current)||w,o=M(w,e);T||o||!d||re(r,{preventScroll:r===w})}))}),[d,w,T,B,I]),c((()=>{if(!w)return;let e=!1;const t=y(w),n=te(t),r=b.current;function o(t){if("escapeKey"===t.type&&m.domReference.current&&(D.current=m.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(L.current=!1,e=n.preventScroll):L.current=!n}return D.current=n,g.on("dismiss",o),()=>{g.off("dismiss",o);const n=te(t);(M(w,n)||k&&oe(k.nodesRef.current,p).some((e=>{var t;return M(null==(t=e.context)?void 0:t.elements.floating,n)}))||r.openEvent&&["click","mousedown"].includes(r.openEvent.type))&&m.domReference.current&&(D.current=m.domReference.current),O.current&&x(D.current)&&!L.current&&re(D.current,{cancelPrevious:!1,preventScroll:e})}}),[w,O,b,m,g,k,p]),c((()=>{if(C)return C.setFocusManagerState({...t,modal:s,closeOnFocusOut:f,open:d}),()=>{C.setFocusManagerState(null)}}),[C,s,d,f,t]),c((()=>{if(w&&"function"==typeof MutationObserver){const e=()=>{const e=w.getAttribute("tabindex");R.current.includes("floating")||te(y(w))!==m.domReference.current&&0===_().length?"0"!==e&&w.setAttribute("tabindex","0"):"-1"!==e&&w.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(w,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[w,m,R,_]);const q=o&&!j&&(F||s);return u.createElement(u.Fragment,null,q&&u.createElement(he,{"data-type":"inside",ref:null==C?void 0:C.beforeInsideRef,onFocus:e=>{if(s){const e=B();re("reference"===r[0]?e[0]:e[e.length-1])}else if(null!=C&&C.preserveTabOrder&&C.portalNode)if(L.current=!1,de(e,C.portalNode)){const e=ae()||E;null==e||e.focus()}else{var t;null==(t=C.beforeOutsideRef.current)||t.focus()}}}),!j&&H("start"),n,H("end"),q&&u.createElement(he,{"data-type":"inside",ref:null==C?void 0:C.afterInsideRef,onFocus:e=>{if(s)re(B()[0]);else if(null!=C&&C.preserveTabOrder&&C.portalNode)if(f&&(L.current=!0),de(e,C.portalNode)){const e=fe()||E;null==e||e.focus()}else{var t;null==(t=C.afterOutsideRef.current)||t.focus()}}}))},e.FloatingList=function(e){let{children:t,elementsRef:n,labelsRef:r}=e;const[o,i]=u.useState((()=>new Map)),l=u.useCallback((e=>{i((t=>new Map(t).set(e,null)))}),[]),s=u.useCallback((e=>{i((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return c((()=>{const e=new Map(o);Array.from(e.keys()).sort(Re).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(xe.Provider,{value:u.useMemo((()=>({register:l,unregister:s,map:o,elementsRef:n,labelsRef:r})),[l,s,o,n,r])},t)},e.FloatingNode=function(e){let{children:t,id:n}=e;const r=g();return u.createElement(p.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=Oe,e.FloatingPortal=function(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const c=be({id:n,root:o}),[l,s]=u.useState(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),m=u.useRef(null),p=!!l&&!l.modal&&l.open&&i&&!(!o&&!c);return u.useEffect((()=>{if(c&&i&&(null==l||!l.modal))return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&de(e)){("focusin"===e.type?pe:me)(c)}}}),[c,i,null==l?void 0:l.modal]),u.createElement(ye.Provider,{value:u.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:m,portalNode:c,setFocusManagerState:s})),[i,c])},p&&c&&u.createElement(he,{"data-type":"outside",ref:a,onFocus:e=>{if(de(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=fe()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),p&&c&&u.createElement("span",{"aria-owns":c.id,style:ve}),c&&r.createPortal(t,c),p&&c&&u.createElement(he,{"data-type":"outside",ref:f,onFocus:e=>{if(de(e,c)){var t;null==(t=m.current)||t.focus()}else{const t=ae()||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))},e.FloatingTree=function(e){let{children:t}=e;const n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),i=u.useState((()=>m()))[0];return u.createElement(v.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:i})),[n,r,o,i])},t)},e.inner=e=>({name:"inner",options:e,async fn(n){const{listRef:o,overflowRef:u,onFallbackChange:i,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:m,elements:{floating:p}}=n,v=o.current[l];if(!v)return{};const g={...n,...await t.offset(-v.offsetTop-m.reference.height/2-v.offsetHeight/2-c).fn(n)},h=(null==f?void 0:f.current)||p,y=await t.detectOverflow($e(g,h.scrollHeight),d),b=await t.detectOverflow(g,{...d,elementContext:"reference"}),E=Math.max(0,y.top),w=g.y+E,R=Math.max(0,h.scrollHeight-E-Math.max(0,y.bottom));return h.style.maxHeight=R+"px",h.scrollTop=E,i&&(h.offsetHeight<v.offsetHeight*Math.min(s,o.current.length-1)-1||b.top>=-a||b.bottom>=-a?r.flushSync((()=>i(!0))):r.flushSync((()=>i(!1)))),u&&(u.current=await t.detectOverflow($e({...g,y:w},h.offsetHeight),d)),{y:w}}}),e.safePolygon=function(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,u=!1,i=null,c=null,l=performance.now();const s=e=>{let{x:n,y:s,placement:a,elements:f,onClose:d,nodeId:m,tree:p}=e;return function(e){function v(){clearTimeout(o),d()}if(clearTimeout(o),!f.domReference||!f.floating||null==a||null==n||null==s)return;const{clientX:g,clientY:h}=e,y=[g,h],b=ue(e),E="mouseleave"===e.type,w=M(f.floating,b),x=M(f.domReference,b),I=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),k=a.split("-")[0],C=n>O.right-O.width/2,P=s>O.bottom-O.height/2,T=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,I),S=O.width>I.width,A=O.height>I.height,L=(S?I:O).left,D=(S?I:O).right,N=(A?I:O).top,F=(A?I:O).bottom;if(w&&(u=!0,!E))return;if(x&&(u=!1),x&&!E)return void(u=!0);if(E&&R(e.relatedTarget)&&M(f.floating,e.relatedTarget))return;if(p&&oe(p.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===k&&s>=I.bottom-1||"bottom"===k&&s<=I.top+1||"left"===k&&n>=I.right-1||"right"===k&&n<=I.left+1)return v();let j=[];switch(k){case"top":j=[[L,I.top+1],[L,O.bottom-1],[D,O.bottom-1],[D,I.top+1]];break;case"bottom":j=[[L,O.top+1],[L,I.bottom-1],[D,I.bottom-1],[D,O.top+1]];break;case"left":j=[[O.right-1,F],[O.right-1,N],[I.left+1,N],[I.left+1,F]];break;case"right":j=[[I.right-1,F],[I.right-1,N],[O.left+1,N],[O.left+1,F]]}if(!Qe([g,h],j)){if(u&&!T)return v();if(!E&&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),n=.1;if(null!==t&&t<n)return v()}Qe([g,h],function(e){let[n,r]=e;switch(k){case"top":return[[S?n+t/2:C?n+4*t:n-4*t,r+t+1],[S?n-t/2:C?n+4*t:n-4*t,r+t+1],...[[O.left,C||S?O.bottom-t:O.top],[O.right,C?S?O.bottom-t:O.top:O.bottom-t]]];case"bottom":return[[S?n+t/2:C?n+4*t:n-4*t,r-t],[S?n-t/2:C?n+4*t:n-4*t,r-t],...[[O.left,C||S?O.top+t:O.bottom],[O.right,C?S?O.top+t:O.bottom:O.top+t]]];case"left":{const e=[n+t+1,A?r+t/2:P?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:P?r+4*t:r-4*t];return[...[[P||A?O.right-t:O.left,O.top],[P?A?O.right-t:O.left:O.right-t,O.bottom]],e,o]}case"right":return[[n-t,A?r+t/2:P?r+4*t:r-4*t],[n-t,A?r-t/2:P?r+4*t:r-4*t],...[[P||A?O.left+t:O.right,O.top],[P?A?O.left+t:O.right:O.left+t,O.bottom]]]}}([n,s]))?!u&&r&&(o=window.setTimeout(v,40)):v()}}};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);return u.useMemo((()=>c?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(C(d.current,!0)&&a||"click"!==l&&(n?!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type||r(!1,e.nativeEvent):(e.preventDefault(),r(!0,e.nativeEvent))))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:C(d.current,!0)&&a||(n?!s||o.current.openEvent&&"click"!==o.current.openEvent.type||r(!1,e.nativeEvent):r(!0,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||ke(e)||(" "!==e.key||Ce(i)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&(n?s&&r(!1,e.nativeEvent):r(!0,e.nativeEvent)))},onKeyUp(e){e.defaultPrevented||!f||ke(e)||Ce(i)||" "===e.key&&m.current&&(m.current=!1,n?s&&r(!1,e.nativeEvent):r(!0,e.nativeEvent))}}}:{}),[c,o,l,a,f,i,s,n,r])},e.useClientPoint=function(e,t){void 0===t&&(t={});const{open:n,refs:r,dataRef:o,elements:{floating:i}}=e,{enabled:l=!0,axis:s="both",x:a=null,y:f=null}=t,d=u.useRef(!1),m=u.useRef(null),[p,v]=u.useState(),[g,h]=u.useState([]),y=Pe(((e,t)=>{d.current||o.current.openEvent&&!Te(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,i;const c=(null==(u=e.current)?void 0:u.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,a=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let f=c.width,d=c.height,m=c.x,p=c.y;return null==n&&t.x&&l&&(n=c.x-t.x),null==r&&t.y&&s&&(r=c.y-t.y),m-=n||0,p-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?c.width:0,d="x"===t.axis?c.height:0,m=l&&null!=t.x?t.x:m,p=s&&null!=t.y?t.y:p):o&&!a&&(d="x"===t.axis?c.height:d,f="y"===t.axis?c.width:f),o=!0,{width:f,height:d,x:m,y:p,top:p,right:m+f,bottom:p+d,left:m}}}}(r.domReference,{x:e,y:t,axis:s,dataRef:o,pointerType:p}))})),b=Pe((e=>{null==a&&null==f&&(n?m.current||h([]):y(e.clientX,e.clientY))})),E=C(p)?i:n,R=u.useCallback((()=>{if(!E||!l||null!=a||null!=f)return;const e=w(r.floating.current);function t(n){const o=ue(n);M(r.floating.current,o)?(e.removeEventListener("mousemove",t),m.current=null):y(n.clientX,n.clientY)}if(!o.current.openEvent||Te(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),m.current=null};return m.current=n,n}r.setPositionReference(r.domReference.current)}),[o,l,E,r,y,a,f]);return u.useEffect((()=>R()),[R,g]),u.useEffect((()=>{l&&!i&&(d.current=!1)}),[l,i]),u.useEffect((()=>{!l&&n&&(d.current=!0)}),[l,n]),c((()=>{!l||null==a&&null==f||(d.current=!1,y(a,f))}),[l,a,f,y]),u.useMemo((()=>{if(!l)return{};function e(e){let{pointerType:t}=e;v(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:b,onMouseEnter:b}}}),[l,b])},e.useDelayGroup=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:u,setCurrentId:i,initialDelay:l,setState:s,timeoutMs:a}=L();c((()=>{u&&(s({delay:{open:1,close:S(l,"close")}}),u!==o&&r(!1))}),[o,r,s,u,l]),c((()=>{function e(){r(!1),s({delay:l,currentId:null})}if(!n&&u===o){if(a){const t=window.setTimeout(e,a);return()=>{clearTimeout(t)}}e()}}),[n,s,u,o,r,l,a]),c((()=>{n&&i(o)}),[n,i,o])},e.useDelayGroupContext=L,e.useDismiss=function(e,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,nodeId:c,elements:{reference:l,domReference:s,floating:a},dataRef:f}=e,{enabled:d=!0,escapeKey:m=!0,outsidePress:p=!0,outsidePressEvent:v="pointerdown",referencePress:b=!1,referencePressEvent:E="pointerdown",ancestorScroll:k=!1,bubbles:C}=n,M=h(),P=null!=g(),T=Pe("function"==typeof p?p:()=>!1),S="function"==typeof p?T:p,A=u.useRef(!1),{escapeKeyBubbles:L,outsidePressBubbles:D}=(e=>{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}})(C),N=Pe((e=>{if(!r||!d||!m||"Escape"!==e.key)return;const t=M?oe(M.nodesRef.current,c):[];if(!L&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e)})),F=Pe((e=>{const t=A.current;if(A.current=!1,t)return;if("function"==typeof S&&!S(e))return;const n=ue(e);if(x(n)&&a){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,r=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let o=r&&e.offsetX>n.clientWidth;if(r){"rtl"===w(a).getComputedStyle(n).direction&&(o=e.offsetX<=n.offsetWidth-n.clientWidth)}if(o||t&&e.offsetY>n.clientHeight)return}const r=M&&oe(M.nodesRef.current,c).some((t=>{var n;return Se(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Se(e,a)||Se(e,s)||r)return;const u=M?oe(M.nodesRef.current,c):[];if(u.length>0){let e=!0;if(u.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:P?{preventScroll:!0}:I(e)||O(e)}}),o(!1,e)}));return u.useEffect((()=>{if(!r||!d)return;function e(e){o(!1,e)}f.current.__escapeKeyBubbles=L,f.current.__outsidePressBubbles=D;const n=y(a);m&&n.addEventListener("keydown",N),S&&n.addEventListener(v,F);let u=[];return k&&(R(s)&&(u=t.getOverflowAncestors(s)),R(a)&&(u=u.concat(t.getOverflowAncestors(a))),!R(l)&&l&&l.contextElement&&(u=u.concat(t.getOverflowAncestors(l.contextElement)))),u=u.filter((e=>{var t;return e!==(null==(t=n.defaultView)?void 0:t.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{m&&n.removeEventListener("keydown",N),S&&n.removeEventListener(v,F),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[f,a,s,l,m,S,v,r,o,k,d,L,D,N,F]),u.useEffect((()=>{A.current=!1}),[S,v]),u.useMemo((()=>d?{reference:{onKeyDown:N,[Ae[E]]:e=>{b&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:N,[Le[v]]:()=>{A.current=!0}}}:{}),[d,i,b,v,E,o,N])},e.useFloating=function(e){var n;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:i}=e,[l,s]=u.useState(null),a=(null==(n=e.elements)?void 0:n.reference)||l,d=t.useFloating(e),p=h(),v=Pe(((e,t)=>{e&&(y.current.openEvent=t),null==o||o(e,t)})),g=u.useRef(null),y=u.useRef({}),b=u.useState((()=>m()))[0],E=f(),w=u.useCallback((e=>{const t=R(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;d.refs.setReference(t)}),[d.refs]),x=u.useCallback((e=>{(R(e)||null===e)&&(g.current=e,s(e)),(R(d.refs.reference.current)||null===d.refs.reference.current||null!==e&&!R(e))&&d.refs.setReference(e)}),[d.refs]),I=u.useMemo((()=>({...d.refs,setReference:x,setPositionReference:w,domReference:g})),[d.refs,x,w]),O=u.useMemo((()=>({...d.elements,domReference:a})),[d.elements,a]),k=u.useMemo((()=>({...d,refs:I,elements:O,dataRef:y,nodeId:i,floatingId:E,events:b,open:r,onOpenChange:v})),[d,i,E,b,r,v,I,O]);return c((()=>{const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===i));e&&(e.context=k)})),u.useMemo((()=>({...d,context:k,refs:I,elements:O})),[d,I,O,k])},e.useFloatingNodeId=function(e){const t=f(),n=h(),r=g(),o=e||r;return c((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t},e.useFloatingParentNodeId=g,e.useFloatingPortalNode=be,e.useFloatingTree=h,e.useFocus=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,refs:c,elements:{floating:l,domReference:s}}=e,{enabled:a=!0,keyboardOnly:f=!0}=t,d=u.useRef(""),m=u.useRef(!1),p=u.useRef();return u.useEffect((()=>{if(!a)return;const e=y(l).defaultView||window;function t(){!n&&x(s)&&s===te(y(s))&&(m.current=!0)}return e.addEventListener("blur",t),()=>{e.removeEventListener("blur",t)}}),[l,s,n,a]),u.useEffect((()=>{if(a)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(e){"referencePress"!==e.type&&"escapeKey"!==e.type||(m.current=!0)}}),[i,a]),u.useEffect((()=>()=>{clearTimeout(p.current)}),[]),u.useMemo((()=>a?{reference:{onPointerDown(e){let{pointerType:t}=e;d.current=t,m.current=!(!t||!f)},onMouseLeave(){m.current=!1},onFocus(e){var t;m.current||"focus"===e.type&&"mousedown"===(null==(t=o.current.openEvent)?void 0:t.type)&&Se(o.current.openEvent,s)||r(!0,e.nativeEvent)},onBlur(e){m.current=!1;const t=e.relatedTarget,n=R(t)&&t.hasAttribute("data-floating-ui-focus-guard")&&"outside"===t.getAttribute("data-type");p.current=setTimeout((()=>{M(c.floating.current,t)||M(s,t)||n||r(!1,e.nativeEvent)}))}}}:{}),[a,f,s,c,o,r])},e.useHover=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:l,floating:s},refs:a}=e,{enabled:f=!0,delay:d=0,handleClose:m=null,mouseOnly:p=!1,restMs:v=0,move:b=!0}=t,E=h(),w=g(),x=P(m),I=P(d),O=u.useRef(),k=u.useRef(),A=u.useRef(),L=u.useRef(),D=u.useRef(!0),N=u.useRef(!1),F=u.useRef((()=>{})),j=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(f)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(){clearTimeout(k.current),clearTimeout(L.current),D.current=!0}}),[f,i]),u.useEffect((()=>{if(!f||!x.current||!n)return;function e(e){j()&&r(!1,e)}const t=y(s).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[s,n,r,f,x,o,j]);const K=u.useCallback((function(e,t){void 0===t&&(t=!0);const n=S(I.current,"close",O.current);n&&!A.current?(clearTimeout(k.current),k.current=setTimeout((()=>r(!1,e)),n)):t&&(clearTimeout(k.current),r(!1,e))}),[I,r]),_=u.useCallback((()=>{F.current(),A.current=void 0}),[]),B=u.useCallback((()=>{if(N.current){const e=y(a.floating.current).body;e.style.pointerEvents="",e.removeAttribute(T),N.current=!1}}),[a]);return u.useEffect((()=>{if(f&&R(l)){const e=l;return n&&e.addEventListener("mouseleave",c),null==s||s.addEventListener("mouseleave",c),b&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",i),()=>{n&&e.removeEventListener("mouseleave",c),null==s||s.removeEventListener("mouseleave",c),b&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(k.current),D.current=!1,p&&!C(O.current)||v>0&&0===S(I.current,"open"))return;const t=S(I.current,"open",O.current);t?k.current=setTimeout((()=>{r(!0,e)}),t):r(!0,e)}function i(r){if(t())return;F.current();const o=y(s);if(clearTimeout(L.current),x.current){n||clearTimeout(k.current),A.current=x.current({...e,tree:E,x:r.clientX,y:r.clientY,onClose(){B(),_(),K(r)}});const t=A.current;return o.addEventListener("mousemove",t),void(F.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==O.current||!M(s,r.relatedTarget))&&K(r)}function c(n){t()||null==x.current||x.current({...e,tree:E,x:n.clientX,y:n.clientY,onClose(){B(),_(),K(n)}})(n)}}),[l,s,f,e,p,v,b,K,_,B,r,n,E,I,x,o]),c((()=>{var e;if(f&&n&&null!=(e=x.current)&&e.__options.blockPointerEvents&&j()){const e=y(s).body;if(e.setAttribute(T,""),e.style.pointerEvents="none",N.current=!0,R(l)&&s){var t,r;const e=l,n=null==E||null==(t=E.nodesRef.current.find((e=>e.id===w)))||null==(r=t.context)?void 0:r.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",s.style.pointerEvents="auto",()=>{e.style.pointerEvents="",s.style.pointerEvents=""}}}}),[f,n,w,s,l,E,x,o,j]),c((()=>{n||(O.current=void 0,_(),B())}),[n,_,B]),u.useEffect((()=>()=>{_(),clearTimeout(k.current),clearTimeout(L.current),B()}),[f,_,B]),u.useMemo((()=>{if(!f)return{};function e(e){O.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===v||(clearTimeout(L.current),L.current=setTimeout((()=>{D.current||r(!0,e.nativeEvent)}),v))}},floating:{onMouseEnter(){clearTimeout(k.current)},onMouseLeave(e){i.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),K(e.nativeEvent,!1)}}}}),[i,f,v,n,r,K])},e.useId=f,e.useInnerOffset=function(e,t){const{open:n,elements:o}=e,{enabled:i=!0,overflowRef:c,scrollRef:l,onChange:s}=t,a=Pe(s),f=u.useRef(!1),d=u.useRef(null),m=u.useRef(null);return u.useEffect((()=>{if(!i)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;const n=e.deltaY,o=c.current.top>=-.5,u=c.current.bottom>=-.5,i=t.scrollHeight-t.clientHeight,l=n<0?-1:1,s=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!o&&n>0||!u&&n<0?(e.preventDefault(),r.flushSync((()=>{a((e=>e+Math[s](n,i*l)))}))):/firefox/i.test(E())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||o.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{d.current=t.scrollTop,null!=c.current&&(m.current={...c.current})})),()=>{d.current=null,m.current=null,t.removeEventListener("wheel",e)}):void 0}),[i,n,o.floating,c,l,a]),u.useMemo((()=>i?{floating:{onKeyDown(){f.current=!0},onWheel(){f.current=!1},onPointerMove(){f.current=!1},onScroll(){const e=(null==l?void 0:l.current)||o.floating;if(c.current&&e&&f.current){if(null!==d.current){const t=e.scrollTop-d.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&r.flushSync((()=>a((e=>e+t))))}requestAnimationFrame((()=>{d.current=e.scrollTop}))}}}}:{}),[i,c,o.floating,l,a])},e.useInteractions=function(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>De(t,e,"reference")),t),r=u.useCallback((t=>De(t,e,"floating")),t),o=u.useCallback((t=>De(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return u.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])},e.useListItem=function(e){let{label:t}=void 0===e?{}:e;const[n,r]=u.useState(null),o=u.useRef(null),{register:i,unregister:l,map:s,elementsRef:a,labelsRef:f}=u.useContext(xe),d=u.useCallback((e=>{if(o.current=e,null!==n&&(a.current[n]=e,f)){var r;const o=void 0!==t;f.current[n]=o?t:null!=(r=null==e?void 0:e.textContent)?r:null}}),[n,a,f,t]);return c((()=>{const e=o.current;if(e)return i(e),()=>{l(e)}}),[i,l]),c((()=>{const e=o.current?s.get(o.current):null;null!=e&&r(e)}),[s]),u.useMemo((()=>({ref:d,index:null==n?-1:n})),[n,d])},e.useListNavigation=function(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:i,floating:l}}=e,{listRef:s,activeIndex:a,onNavigate:f=(()=>{}),enabled:d=!0,selectedIndex:m=null,allowEscape:p=!1,loop:v=!1,nested:E=!1,rtl:w=!1,virtual:R=!1,focusItemOnOpen:C="auto",focusItemOnHover:T=!0,openOnArrowKeyDown:S=!0,disabledIndices:A,orientation:L="vertical",cols:D=1,scrollItemIntoView:N=!0}=t,F=g(),j=h(),K=Pe(f),_=u.useRef(C),B=u.useRef(null!=m?m:-1),H=u.useRef(null),q=u.useRef(!0),W=u.useRef(K),U=u.useRef(!!l),z=u.useRef(!1),V=u.useRef(!1),X=P(A),Y=P(n),G=P(N),[Z,$]=u.useState(),Q=Pe((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(R?$(r.id):re(r,{preventScroll:!0,sync:!(!b().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!k())&&(Ne||z.current)}),requestAnimationFrame((()=>{const e=G.current;e&&r&&(n||!q.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));c((()=>{document.createElement("div").focus({get preventScroll(){return Ne=!0,!1}})}),[]),c((()=>{d&&(n&&l?_.current&&null!=m&&(V.current=!0,K(m)):U.current&&(B.current=-1,W.current(null)))}),[d,n,l,m,K]),c((()=>{if(d&&n&&l)if(null==a){if(z.current=!1,null!=m)return;if(U.current&&(B.current=-1,Q(s,B)),!U.current&&_.current&&(null!=H.current||!0===_.current&&null==H.current)){let e=0;const t=()=>{if(null==s.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else B.current=null==H.current||ze(H.current,L,w)||E?Ve(s,X.current):Xe(s,X.current),H.current=null,K(B.current)};t()}}else He(s,a)||(B.current=a,Q(s,B,V.current),V.current=!1)}),[d,n,l,a,m,E,s,L,w,K,Q,X]),c((()=>{if(d&&U.current&&!l&&j){var e,t;const n=j.nodesRef.current,r=null==(e=n.find((e=>e.id===F)))||null==(t=e.context)?void 0:t.elements.floating,o=te(y(l)),u=n.some((e=>e.context&&M(e.context.elements.floating,o)));r&&!u&&r.focus({preventScroll:!0})}}),[d,l,j,F]),c((()=>{W.current=K,U.current=!!l})),c((()=>{n||(H.current=null)}),[n]);const J=null!=a,ee=u.useMemo((()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&K(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...T&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;q.current&&"touch"!==t&&(B.current=-1,Q(s,B),K(null),R||re(o.floating.current,{preventScroll:!0}))}}}}),[n,o,Q,T,s,K,R]);return u.useMemo((()=>{if(!d)return{};const e=X.current;function t(t){if(q.current=!1,z.current=!0,!Y.current&&t.currentTarget===o.floating.current)return;if(E&&function(e,t,n){return We(t,n?e===_e:e===Ke,e===Fe)}(t.key,L,w))return ce(t),r(!1,t.nativeEvent),void(x(i)&&i.focus());const u=B.current,c=Ve(s,e),l=Xe(s,e);if("Home"===t.key&&(ce(t),B.current=c,K(B.current)),"End"===t.key&&(ce(t),B.current=l,K(B.current)),D>1){const n=B.current;if(t.key===Fe){if(ce(t),-1===n)B.current=l;else if(B.current=qe(s,{startingIndex:n,amount:D,decrement:!0,disabledIndices:e}),v&&(n-D<c||B.current<0)){const e=n%D,t=l%D,r=l-(t-e);B.current=t===e?l:t>e?r:r-D}He(s,B.current)&&(B.current=n),K(B.current)}if(t.key===je&&(ce(t),-1===n?B.current=c:(B.current=qe(s,{startingIndex:n,amount:D,disabledIndices:e}),v&&n+D>l&&(B.current=qe(s,{startingIndex:n%D-D,amount:D,disabledIndices:e}))),He(s,B.current)&&(B.current=n),K(B.current)),"both"===L){const r=Math.floor(n/D);t.key===_e&&(ce(t),n%D!=D-1?(B.current=qe(s,{startingIndex:n,disabledIndices:e}),v&&Be(B.current,D,r)&&(B.current=qe(s,{startingIndex:n-n%D-1,disabledIndices:e}))):v&&(B.current=qe(s,{startingIndex:n-n%D-1,disabledIndices:e})),Be(B.current,D,r)&&(B.current=n)),t.key===Ke&&(ce(t),n%D!=0?(B.current=qe(s,{startingIndex:n,disabledIndices:e,decrement:!0}),v&&Be(B.current,D,r)&&(B.current=qe(s,{startingIndex:n+(D-n%D),decrement:!0,disabledIndices:e}))):v&&(B.current=qe(s,{startingIndex:n+(D-n%D),decrement:!0,disabledIndices:e})),Be(B.current,D,r)&&(B.current=n));const o=Math.floor(l/D)===r;return He(s,B.current)&&(B.current=v&&o?t.key===Ke?l:qe(s,{startingIndex:n-n%D-1,disabledIndices:e}):n),void K(B.current)}}if(Ue(t.key,L)){if(ce(t),n&&!R&&te(t.currentTarget.ownerDocument)===t.currentTarget)return B.current=ze(t.key,L,w)?c:l,void K(B.current);ze(t.key,L,w)?B.current=v?u>=l?p&&u!==s.current.length?-1:c:qe(s,{startingIndex:u,disabledIndices:e}):Math.min(l,qe(s,{startingIndex:u,disabledIndices:e})):B.current=v?u<=c?p&&-1!==u?s.current.length:l:qe(s,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(c,qe(s,{startingIndex:u,decrement:!0,disabledIndices:e})),He(s,B.current)?K(null):K(B.current)}}function u(e){"auto"===C&&I(e.nativeEvent)&&(_.current=!0)}const c=R&&n&&J&&{"aria-activedescendant":Z};return{reference:{...c,onKeyDown(o){q.current=!1;const u=0===o.key.indexOf("Arrow");if(R&&n)return t(o);if(!n&&!S&&u)return;const i=u||"Enter"===o.key||""===o.key.trim(),c=Ue(o.key,L),l=function(e,t,n){return We(t,n?e===Ke:e===_e,e===je)}(o.key,L,w);i&&(H.current=E&&c?null:o.key),E?l&&(ce(o),n?(B.current=Ve(s,e),K(B.current)):r(!0,o.nativeEvent)):c&&(null!=m&&(B.current=m),ce(o),!n&&S?r(!0,o.nativeEvent):t(o),n&&K(B.current))},onFocus(){n&&K(null)},onPointerDown:function(e){_.current=C,"auto"===C&&O(e.nativeEvent)&&(_.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===L?void 0:L,...c,onKeyDown:t,onPointerMove(){q.current=!0}},item:ee}}),[i,o,Z,X,Y,s,d,L,w,R,n,J,E,m,S,p,D,v,C,K,r,ee])},e.useMergeRefs=function(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)},e.useRole=function(e,t){void 0===t&&(t={});const{open:n,floatingId:r}=e,{enabled:o=!0,role:i="dialog"}=t,c=f();return u.useMemo((()=>{const e={id:r,role:i};return o?"tooltip"===i?{reference:{"aria-describedby":n?r:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===i?"dialog":i,"aria-controls":n?r:void 0,..."listbox"===i&&{role:"combobox"},..."menu"===i&&{id:c}},floating:{...e,..."menu"===i&&{"aria-labelledby":c}}}:{}}),[o,i,n,r,c])},e.useTransitionStatus=Ze,e.useTransitionStyles=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:l=250}=t,s=e.placement,a=s.split("-")[0],f=u.useMemo((()=>({side:a,placement:s})),[a,s]),d="number"==typeof l,m=(d?l:l.open)||0,p=(d?l:l.close)||0,[v,g]=u.useState((()=>({...Ge(i,f),...Ge(n,f)}))),{isMounted:h,status:y}=Ze(e,{duration:l}),b=P(n),E=P(r),w=P(o),R=P(i);return c((()=>{const e=Ge(b.current,f),t=Ge(w.current,f),n=Ge(R.current,f),r=Ge(E.current,f)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===y&&g((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===y&&g({transitionProperty:Object.keys(r).map(Ye).join(","),transitionDuration:m+"ms",...n,...r}),"close"===y){const r=t||e;g({transitionProperty:Object.keys(r).map(Ye).join(","),transitionDuration:p+"ms",...n,...r})}}),[p,w,b,E,R,m,y,f]),{isMounted:h,styles:v}},e.useTypeahead=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:l,onMatch:s,onTypingChange:a,enabled:f=!0,findMatch:d=null,resetMs:m=750,ignoreKeys:p=[],selectedIndex:v=null}=t,g=u.useRef(),h=u.useRef(""),y=u.useRef(null!=(n=null!=v?v:l)?n:-1),b=u.useRef(null),E=Pe(s),w=Pe(a),R=P(d),x=P(p);return c((()=>{r&&(clearTimeout(g.current),b.current=null,h.current="")}),[r]),c((()=>{var e;r&&""===h.current&&(y.current=null!=(e=null!=v?v:l)?e:-1)}),[r,v,l]),u.useMemo((()=>{if(!f)return{};function e(e){e?o.current.typing||(o.current.typing=e,w(e)):o.current.typing&&(o.current.typing=e,w(e))}function t(e,t,n){const r=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}function n(n){const o=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(o,o,h.current)?e(!1):" "===n.key&&ce(n)),null==o||x.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(ce(n),e(!0));o.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.current===n.key&&(h.current="",y.current=b.current),h.current+=n.key,clearTimeout(g.current),g.current=setTimeout((()=>{h.current="",y.current=b.current,e(!1)}),m);const u=y.current,c=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],h.current);-1!==c?(E(c),b.current=c):" "!==n.key&&(h.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[f,r,o,i,m,x,R,E,w])},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@floating-ui/react-dom"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/react-dom","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIReact={},e.FloatingUIReactDOM,e.React,e.ReactDOM)}(this,(function(e,t,n,r){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=o(n);function i(){return i=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},i.apply(this,arguments)}var c="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;let l=!1,s=0;const a=()=>"floating-ui-"+s++;const f=u["useId".toString()]||function(){const[e,t]=u.useState((()=>l?a():void 0));return c((()=>{null==e&&t(a())}),[]),u.useEffect((()=>{l||(l=!0)}),[]),e},d=u.forwardRef((function(e,n){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:c}},width:l=14,height:s=7,tipRadius:a=0,strokeWidth:d=0,staticOffset:m,stroke:p,d:v,style:{transform:g,...h}={},...y}=e;const b=f();if(!o)return null;d*=2;const E=d/2,w=l/2*(a/-8+1),R=s/2*a/4,[x,I]=r.split("-"),O=t.platform.isRTL(o),k=!!v,T="top"===x||"bottom"===x,C=m&&"end"===I?"bottom":"top";let M=m&&"end"===I?"right":"left";m&&O&&(M="end"===I?"left":"right");const P=null!=(null==c?void 0:c.x)?m||c.x:"",S=null!=(null==c?void 0:c.y)?m||c.y:"",A=v||"M0,0 H"+l+" L"+(l-w)+","+(s-R)+" Q"+l/2+","+s+" "+w+","+(s-R)+" Z",L={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[x];return u.createElement("svg",i({},y,{"aria-hidden":!0,ref:n,width:k?l:l+d,height:l,viewBox:"0 0 "+l+" "+(s>l?s:l),style:{position:"absolute",pointerEvents:"none",[M]:P,[C]:S,[x]:T||k?"100%":"calc(100% - "+d/2+"px)",transform:""+L+(null!=g?g:""),...h}}),d>0&&u.createElement("path",{clipPath:"url(#"+b+")",fill:"none",stroke:p,strokeWidth:d+(v?0:1),d:A}),u.createElement("path",{stroke:d&&!v?y.fill:"none",d:A}),u.createElement("clipPath",{id:b},u.createElement("rect",{x:-E,y:E*(k?-1:1),width:l+d,height:l})))}));function m(){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 p=u.createContext(null),v=u.createContext(null),g=()=>{var e;return(null==(e=u.useContext(p))?void 0:e.id)||null},h=()=>u.useContext(v);function y(e){return(null==e?void 0:e.ownerDocument)||document}function b(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function E(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function w(e){return y(e).defaultView||window}function R(e){return!!e&&e instanceof w(e).Element}function x(e){return!!e&&e instanceof w(e).HTMLElement}function I(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof w(e).ShadowRoot||e instanceof ShadowRoot}function O(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(b())||t.test(E()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function k(e){return 0===e.width&&0===e.height||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}function T(){return/apple/i.test(navigator.vendor)}function C(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function M(e){return e.matches("html,body")}function P(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&I(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function S(e){return"data-floating-ui-"+e}function A(e){const t=n.useRef(e);return c((()=>{t.current=e})),t}const L=S("safe-polygon");function D(e,t,n){return n&&!C(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}const N=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),F=()=>u.useContext(N);var j=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},K=new WeakMap,B=new WeakMap,H={},q=0,_=function(e){return e&&(e.host||_(e.parentNode))},W=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=_(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);H[n]||(H[n]=new WeakMap);var u=H[n],i=[],c=new Set,l=new Set(o),s=function(e){e&&!c.has(e)&&(c.add(e),s(e.parentNode))};o.forEach(s);var a=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(c.has(e))a(e);else{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(K.get(e)||0)+1,s=(u.get(e)||0)+1;K.set(e,l),u.set(e,s),i.push(e),1===l&&o&&B.set(e,!0),1===s&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}}))};return a(t),c.clear(),q++,function(){i.forEach((function(e){var t=K.get(e)-1,o=u.get(e)-1;K.set(e,t),u.set(e,o),t||(B.has(e)||e.removeAttribute(r),B.delete(e)),o||e.removeAttribute(n)})),--q||(K=new WeakMap,K=new WeakMap,B=new WeakMap,H={})}},U=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||j(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),W(r,o,n,"aria-hidden")):function(){return null}},z=function(e,t,n){void 0===n&&(n="data-inert-ed");var r=t||j(e);return r?W(e,r,n,"inert"):function(){return null}},V=function(){return"undefined"!=typeof HTMLElement&&HTMLElement.prototype.hasOwnProperty("inert")},X=function(e,t,n){return void 0===n&&(n="data-suppressed"),(V()?z:U)(e,t,n)},Y=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"].join(","),G="undefined"==typeof Element,Z=G?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$=!G&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},Q=function e(t,n,r){for(var o=[],u=Array.from(t);u.length;){var i=u.shift();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{Z.call(i,Y)&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),a=!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},J=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},ee=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},te=function(e){return"INPUT"===e.tagName},ne=function(e){return function(e){return te(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||$(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)},re=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},oe=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Z.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Z.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return re(e)}else{if("function"==typeof r){for(var u=e;e;){var i=e.parentElement,c=$(e);if(i&&!i.shadowRoot&&!0===r(i))return re(e);e=e.assignedSlot?e.assignedSlot:i||c===e.ownerDocument?i:c.host}e=u}if(function(e){for(var t,n=$(e).host,r=!!(null!==(t=n)&&void 0!==t&&t.ownerDocument.contains(n)||e.ownerDocument.contains(e));!r&&n;){var o;r=!(null===(o=n=$(n).host)||void 0===o||!o.ownerDocument.contains(n))}return r}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},ue=function(e,t){return!(t.disabled||function(e){return te(e)&&"hidden"===e.type}(t)||oe(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!!Z.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},ie=function(e,t){return!(ne(t)||J(t)<0||!ue(e,t))},ce=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},le=function e(t){var n=[],r=[];return t.forEach((function(t,o){var u=!!t.scopeParent,i=u?t.scopeParent:t,c=J(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(ee).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},se=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Q([e],t.includeContainer,{filter:ie.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ce}):function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(Y));return t&&Z.call(e,Y)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,ie.bind(null,t)),le(n)};function ae(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}let fe=0;function de(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(fe);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():fe=requestAnimationFrame(u)}function me(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}function pe(e){return"composedPath"in e?e.composedPath()[0]:e.target}const ve="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ge(e){return x(e)&&e.matches(ve)}function he(e){e.preventDefault(),e.stopPropagation()}const ye=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function be(e,t){const n=se(e,ye());"prev"===t&&n.reverse();const r=n.indexOf(ae(y(e)));return n.slice(r+1)[0]}function Ee(){return be(document.body,"next")}function we(){return be(document.body,"prev")}function Re(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!P(n,r)}function xe(e){se(e,ye()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Ie(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 Oe={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 ke(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Te=u.forwardRef((function(e,t){const[n,r]=u.useState();c((()=>(T()&&r("button"),document.addEventListener("keydown",ke),()=>{document.removeEventListener("keydown",ke)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[S("focus-guard")]:"",style:Oe};return u.createElement("span",i({},e,o))})),Ce=u.createContext(null);function Me(e){let{id:t,root:n}=void 0===e?{}:e;const[r,o]=u.useState(null),i=f(),l=Pe(),s=u.useMemo((()=>({id:t,root:n,portalContext:l,uniqueId:i})),[t,n,l,i]),a=u.useRef();return c((()=>()=>{null==r||r.remove()}),[r,s]),c((()=>{if(a.current===s)return;a.current=s;const{id:e,root:t,portalContext:n,uniqueId:r}=s,u=e?document.getElementById(e):null,i=S("portal");if(u){const e=document.createElement("div");e.id=r,e.setAttribute(i,""),u.appendChild(e),o(e)}else{let u=t||(null==n?void 0:n.portalNode);u&&!R(u)&&(u=u.current),u=u||document.body;let c=null;e&&(c=document.createElement("div"),c.id=e,u.appendChild(c));const l=document.createElement("div");l.id=r,l.setAttribute(i,""),u=c||u,u.appendChild(l),o(l)}}),[s]),r}const Pe=()=>u.useContext(Ce),Se=u.forwardRef((function(e,t){return u.createElement("button",i({},e,{type:"button",ref:t,tabIndex:-1,style:Oe}))}));function Ae(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 Le=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});const De=S("scroll-lock"),Ne=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return c((()=>{var e,t;if(!n)return;if(document.body.hasAttribute(De))return;document.body.setAttribute(De,"");const r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth;if(!/iP(hone|ad|od)|iOS/.test(b()))return Object.assign(document.body.style,{overflow:"hidden",[r]:o+"px"}),()=>{document.body.removeAttribute(De),Object.assign(document.body.style,{overflow:"",[r]:""})};const u=(null==(e=window.visualViewport)?void 0:e.offsetLeft)||0,i=(null==(t=window.visualViewport)?void 0:t.offsetTop)||0,c=window.pageXOffset,l=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(l-Math.floor(i))+"px",left:-(c-Math.floor(u))+"px",right:"0",[r]:o+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[r]:""}),document.body.removeAttribute(De),window.scrollTo(c,l)}}),[n]),u.createElement("div",i({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Fe(e){return x(e.target)&&"BUTTON"===e.target.tagName}function je(e){return ge(e)}const Ke=u["useInsertionEffect".toString()]||(e=>e());function Be(e){const t=u.useRef((()=>{}));return Ke((()=>{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 He(e){return null!=e&&null!=e.clientX}function qe(e,t){return!e||R(e)&&M(e)?null:I(e)?qe(e.host,t):R(e)&&e.matches(t)?e:qe(e.parentNode,t)}function _e(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)}const We={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ue={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"};function ze(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var u;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(u=r.get(n))||u.push(o),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]=o})),e):e),{})}}let Ve=!1;const Xe="ArrowUp",Ye="ArrowDown",Ge="ArrowLeft",Ze="ArrowRight";function $e(e,t,n){return Math.floor(e/t)!==n}function Qe(e,t){return t<0||t>=e.current.length}function Je(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{var l,s;c+=r?-u:u}while(c>=0&&c<=i.length-1&&(o?o.includes(c):null==i[c]||(null==(l=i[c])?void 0:l.hasAttribute("disabled"))||"true"===(null==(s=i[c])?void 0:s.getAttribute("aria-disabled"))||(a=i[c])&&null===a.offsetParent));var a;return c}function et(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function tt(e,t){return et(t,e===Xe||e===Ye,e===Ge||e===Ze)}function nt(e,t,n){return et(t,e===Ye,n?e===Ge:e===Ze)||"Enter"===e||" "==e||""===e}function rt(e,t){return Je(e,{disabledIndices:t})}function ot(e,t){return Je(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const ut=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function it(e,t){return"function"==typeof e?e(t):e}function ct(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[l,s]=u.useState(!1),[a,f]=u.useState("unmounted"),d=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return c((()=>{l&&!d&&f("unmounted")}),[l,d]),c((()=>{if(r){if(n){f("initial");const e=requestAnimationFrame((()=>{f("open")}));return()=>{cancelAnimationFrame(e)}}s(!0),f("close")}}),[n,r]),{isMounted:d,status:a}}function lt(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function st(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 t.arrow}}),Object.defineProperty(e,"autoPlacement",{enumerable:!0,get:function(){return t.autoPlacement}}),Object.defineProperty(e,"autoUpdate",{enumerable:!0,get:function(){return t.autoUpdate}}),Object.defineProperty(e,"computePosition",{enumerable:!0,get:function(){return t.computePosition}}),Object.defineProperty(e,"detectOverflow",{enumerable:!0,get:function(){return t.detectOverflow}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return t.flip}}),Object.defineProperty(e,"getOverflowAncestors",{enumerable:!0,get:function(){return t.getOverflowAncestors}}),Object.defineProperty(e,"hide",{enumerable:!0,get:function(){return t.hide}}),Object.defineProperty(e,"inline",{enumerable:!0,get:function(){return t.inline}}),Object.defineProperty(e,"limitShift",{enumerable:!0,get:function(){return t.limitShift}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return t.offset}}),Object.defineProperty(e,"platform",{enumerable:!0,get:function(){return t.platform}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return t.shift}}),Object.defineProperty(e,"size",{enumerable:!0,get:function(){return t.size}}),e.FloatingArrow=d,e.FloatingDelayGroup=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,i]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),l=u.useRef(null),s=u.useCallback((e=>{i({currentId:e})}),[]);return c((()=>{o.currentId?null===l.current?l.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),l.current=null)}),[o.currentId]),u.createElement(N.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:s})),[o,i,s])},t)},e.FloatingFocusManager=function(e){const{context:t,children:n,order:r=["content"],guards:o=!0,initialFocus:i=0,returnFocus:l=!0,modal:s=!0,visuallyHiddenDismiss:a=!1,closeOnFocusOut:f=!0}=e,{open:d,refs:m,nodeId:p,onOpenChange:v,events:g,dataRef:b,elements:{domReference:E,floating:w}}=t,R=!V()||o,I=A(r),O=A(i),k=A(l),T=h(),C=Pe(),M="number"==typeof i&&i<0,L=u.useRef(null),D=u.useRef(null),N=u.useRef(!1),F=u.useRef(null),j=u.useRef(!1),K=null!=C,B=E&&"combobox"===E.getAttribute("role")&&ge(E),H=u.useCallback((function(e){return void 0===e&&(e=w),e?se(e,ye()):[]}),[w]),q=u.useCallback((e=>{const t=H(e);return I.current.map((e=>E&&"reference"===e?E:w&&"floating"===e?w:t)).filter(Boolean).flat()}),[E,w,I,H]);function _(e){return a&&s?u.createElement(Se,{ref:"start"===e?L:D,onClick:e=>v(!1,e.nativeEvent)},"string"==typeof a?a:"Dismiss"):null}u.useEffect((()=>{if(!s)return;function e(e){if("Tab"===e.key){P(w,ae(y(w)))&&0===H().length&&!B&&he(e);const t=q(),n=pe(e);"reference"===I.current[0]&&n===E&&(he(e),e.shiftKey?de(t[t.length-1]):de(t[1])),"floating"===I.current[1]&&n===w&&e.shiftKey&&(he(e),de(t[0]))}}const t=y(w);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[E,w,s,I,m,B,H,q]),u.useEffect((()=>{if(f)return w&&x(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),!s&&w.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),!s&&w.removeEventListener("focusout",t)}):void 0;function e(){j.current=!0,setTimeout((()=>{j.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(P(E,t)||P(w,t)||P(t,w)||P(null==C?void 0:C.portalNode,t)||null!=t&&t.hasAttribute(S("focus-guard"))||T&&(me(T.nodesRef.current,p).find((e=>{var n,r;return P(null==(n=e.context)?void 0:n.elements.floating,t)||P(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}(T.nodesRef.current,p).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!j.current&&t!==F.current&&(N.current=!0,v(!1,e))}))}}),[E,w,s,p,T,C,v,f]),u.useEffect((()=>{var e;const t=Array.from((null==C||null==(e=C.portalNode)?void 0:e.querySelectorAll("["+S("portal")+"]"))||[]);if(w&&s){const e=[w,...t,L.current,D.current].filter((e=>null!=e)),n=(R?U:X)(I.current.includes("reference")||B?e.concat(E||[]):e,void 0,S("inert"));return()=>{n()}}}),[E,w,s,I,C,B,R]),c((()=>{if(!w)return;const e=ae(y(w));queueMicrotask((()=>{const t=q(w),n=O.current,r=("number"==typeof n?t[n]:n.current)||w,o=P(w,e);M||o||!d||de(r,{preventScroll:r===w})}))}),[d,w,M,q,O]),c((()=>{if(!w)return;let e=!1;const t=y(w),n=ae(t),r=b.current;function o(t){if("escapeKey"===t.type&&m.domReference.current&&(F.current=m.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(N.current=!1,e=n.preventScroll):N.current=!n}return F.current=n,g.on("dismiss",o),()=>{g.off("dismiss",o);const n=ae(t);(P(w,n)||T&&me(T.nodesRef.current,p).some((e=>{var t;return P(null==(t=e.context)?void 0:t.elements.floating,n)}))||r.openEvent&&["click","mousedown"].includes(r.openEvent.type))&&m.domReference.current&&(F.current=m.domReference.current),k.current&&x(F.current)&&!N.current&&de(F.current,{cancelPrevious:!1,preventScroll:e})}}),[w,k,b,m,g,T,p]),c((()=>{if(C)return C.setFocusManagerState({...t,modal:s,closeOnFocusOut:f,open:d}),()=>{C.setFocusManagerState(null)}}),[C,s,d,f,t]),c((()=>{if(w&&"function"==typeof MutationObserver){const e=()=>{const e=w.getAttribute("tabindex");I.current.includes("floating")||ae(y(w))!==m.domReference.current&&0===H().length?"0"!==e&&w.setAttribute("tabindex","0"):"-1"!==e&&w.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(w,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[w,m,I,H]);const W=R&&!B&&(K||s);return u.createElement(u.Fragment,null,W&&u.createElement(Te,{"data-type":"inside",ref:null==C?void 0:C.beforeInsideRef,onFocus:e=>{if(s){const e=q();de("reference"===r[0]?e[0]:e[e.length-1])}else if(null!=C&&C.preserveTabOrder&&C.portalNode)if(N.current=!1,Re(e,C.portalNode)){const e=Ee()||E;null==e||e.focus()}else{var t;null==(t=C.beforeOutsideRef.current)||t.focus()}}}),!B&&_("start"),n,_("end"),W&&u.createElement(Te,{"data-type":"inside",ref:null==C?void 0:C.afterInsideRef,onFocus:e=>{if(s)de(q()[0]);else if(null!=C&&C.preserveTabOrder&&C.portalNode)if(f&&(N.current=!0),Re(e,C.portalNode)){const e=we()||E;null==e||e.focus()}else{var t;null==(t=C.afterOutsideRef.current)||t.focus()}}}))},e.FloatingList=function(e){let{children:t,elementsRef:n,labelsRef:r}=e;const[o,i]=u.useState((()=>new Map)),l=u.useCallback((e=>{i((t=>new Map(t).set(e,null)))}),[]),s=u.useCallback((e=>{i((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return c((()=>{const e=new Map(o);Array.from(e.keys()).sort(Ae).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(Le.Provider,{value:u.useMemo((()=>({register:l,unregister:s,map:o,elementsRef:n,labelsRef:r})),[l,s,o,n,r])},t)},e.FloatingNode=function(e){let{children:t,id:n}=e;const r=g();return u.createElement(p.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=Ne,e.FloatingPortal=function(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const c=Me({id:n,root:o}),[l,s]=u.useState(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),m=u.useRef(null),p=!!l&&!l.modal&&l.open&&i&&!(!o&&!c);return u.useEffect((()=>{if(c&&i&&(null==l||!l.modal))return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&Re(e)){("focusin"===e.type?Ie:xe)(c)}}}),[c,i,null==l?void 0:l.modal]),u.createElement(Ce.Provider,{value:u.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:m,portalNode:c,setFocusManagerState:s})),[i,c])},p&&c&&u.createElement(Te,{"data-type":"outside",ref:a,onFocus:e=>{if(Re(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=we()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),p&&c&&u.createElement("span",{"aria-owns":c.id,style:Oe}),c&&r.createPortal(t,c),p&&c&&u.createElement(Te,{"data-type":"outside",ref:f,onFocus:e=>{if(Re(e,c)){var t;null==(t=m.current)||t.focus()}else{const t=Ee()||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))},e.FloatingTree=function(e){let{children:t}=e;const n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),i=u.useState((()=>m()))[0];return u.createElement(v.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:i})),[n,r,o,i])},t)},e.inner=e=>({name:"inner",options:e,async fn(n){const{listRef:o,overflowRef:u,onFallbackChange:i,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:m,elements:{floating:p}}=n,v=o.current[l];if(!v)return{};const g={...n,...await t.offset(-v.offsetTop-p.clientTop-m.reference.height/2-v.offsetHeight/2-c).fn(n)},h=(null==f?void 0:f.current)||p,y=await t.detectOverflow(lt(g,h.scrollHeight),d),b=await t.detectOverflow(g,{...d,elementContext:"reference"}),E=Math.max(0,y.top),w=g.y+E,R=Math.max(0,h.scrollHeight-E-Math.max(0,y.bottom));return h.style.maxHeight=R+"px",h.scrollTop=E,i&&(h.offsetHeight<v.offsetHeight*Math.min(s,o.current.length-1)-1||b.top>=-a||b.bottom>=-a?r.flushSync((()=>i(!0))):r.flushSync((()=>i(!1)))),u&&(u.current=await t.detectOverflow(lt({...g,y:w},h.offsetHeight),d)),{y:w}}}),e.safePolygon=function(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,u=!1,i=null,c=null,l=performance.now();const s=e=>{let{x:n,y:s,placement:a,elements:f,onClose:d,nodeId:m,tree:p}=e;return function(e){function v(){clearTimeout(o),d()}if(clearTimeout(o),!f.domReference||!f.floating||null==a||null==n||null==s)return;const{clientX:g,clientY:h}=e,y=[g,h],b=pe(e),E="mouseleave"===e.type,w=P(f.floating,b),x=P(f.domReference,b),I=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),k=a.split("-")[0],T=n>O.right-O.width/2,C=s>O.bottom-O.height/2,M=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,I),S=O.width>I.width,A=O.height>I.height,L=(S?I:O).left,D=(S?I:O).right,N=(A?I:O).top,F=(A?I:O).bottom;if(w&&(u=!0,!E))return;if(x&&(u=!1),x&&!E)return void(u=!0);if(E&&R(e.relatedTarget)&&P(f.floating,e.relatedTarget))return;if(p&&me(p.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===k&&s>=I.bottom-1||"bottom"===k&&s<=I.top+1||"left"===k&&n>=I.right-1||"right"===k&&n<=I.left+1)return v();let j=[];switch(k){case"top":j=[[L,I.top+1],[L,O.bottom-1],[D,O.bottom-1],[D,I.top+1]];break;case"bottom":j=[[L,O.top+1],[L,I.bottom-1],[D,I.bottom-1],[D,O.top+1]];break;case"left":j=[[O.right-1,F],[O.right-1,N],[I.left+1,N],[I.left+1,F]];break;case"right":j=[[I.right-1,F],[I.right-1,N],[O.left+1,N],[O.left+1,F]]}if(!st([g,h],j)){if(u&&!M)return v();if(!E&&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 v()}st([g,h],function(e){let[n,r]=e;switch(k){case"top":return[[S?n+t/2:T?n+4*t:n-4*t,r+t+1],[S?n-t/2:T?n+4*t:n-4*t,r+t+1],...[[O.left,T||S?O.bottom-t:O.top],[O.right,T?S?O.bottom-t:O.top:O.bottom-t]]];case"bottom":return[[S?n+t/2:T?n+4*t:n-4*t,r-t],[S?n-t/2:T?n+4*t:n-4*t,r-t],...[[O.left,T||S?O.top+t:O.bottom],[O.right,T?S?O.top+t:O.bottom:O.top+t]]];case"left":{const e=[n+t+1,A?r+t/2:C?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:C?r+4*t:r-4*t];return[...[[C||A?O.right-t:O.left,O.top],[C?A?O.right-t:O.left:O.right-t,O.bottom]],e,o]}case"right":return[[n-t,A?r+t/2:C?r+4*t:r-4*t],[n-t,A?r-t/2:C?r+4*t:r-4*t],...[[C||A?O.left+t:O.right,O.top],[C?A?O.left+t:O.right:O.left+t,O.bottom]]]}}([n,s]))?!u&&r&&(o=window.setTimeout(v,40)):v()}}};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);return u.useMemo((()=>c?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(C(d.current,!0)&&a||"click"!==l&&(n?!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type||r(!1,e.nativeEvent):(e.preventDefault(),r(!0,e.nativeEvent))))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:C(d.current,!0)&&a||(n?!s||o.current.openEvent&&"click"!==o.current.openEvent.type||r(!1,e.nativeEvent):r(!0,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||Fe(e)||(" "!==e.key||je(i)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&(n?s&&r(!1,e.nativeEvent):r(!0,e.nativeEvent)))},onKeyUp(e){e.defaultPrevented||!f||Fe(e)||je(i)||" "===e.key&&m.current&&(m.current=!1,n?s&&r(!1,e.nativeEvent):r(!0,e.nativeEvent))}}}:{}),[c,o,l,a,f,i,s,n,r])},e.useClientPoint=function(e,t){void 0===t&&(t={});const{open:n,refs:r,dataRef:o,elements:{floating:i}}=e,{enabled:l=!0,axis:s="both",x:a=null,y:f=null}=t,d=u.useRef(!1),m=u.useRef(null),[p,v]=u.useState(),[g,h]=u.useState([]),y=Be(((e,t)=>{d.current||o.current.openEvent&&!He(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,i;const c=(null==(u=e.current)?void 0:u.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,a=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let f=c.width,d=c.height,m=c.x,p=c.y;return null==n&&t.x&&l&&(n=c.x-t.x),null==r&&t.y&&s&&(r=c.y-t.y),m-=n||0,p-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?c.width:0,d="x"===t.axis?c.height:0,m=l&&null!=t.x?t.x:m,p=s&&null!=t.y?t.y:p):o&&!a&&(d="x"===t.axis?c.height:d,f="y"===t.axis?c.width:f),o=!0,{width:f,height:d,x:m,y:p,top:p,right:m+f,bottom:p+d,left:m}}}}(r.domReference,{x:e,y:t,axis:s,dataRef:o,pointerType:p}))})),b=Be((e=>{null==a&&null==f&&(n?m.current||h([]):y(e.clientX,e.clientY))})),E=C(p)?i:n,R=u.useCallback((()=>{if(!E||!l||null!=a||null!=f)return;const e=w(r.floating.current);function t(n){const o=pe(n);P(r.floating.current,o)?(e.removeEventListener("mousemove",t),m.current=null):y(n.clientX,n.clientY)}if(!o.current.openEvent||He(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),m.current=null};return m.current=n,n}r.setPositionReference(r.domReference.current)}),[o,l,E,r,y,a,f]);return u.useEffect((()=>R()),[R,g]),u.useEffect((()=>{l&&!i&&(d.current=!1)}),[l,i]),u.useEffect((()=>{!l&&n&&(d.current=!0)}),[l,n]),c((()=>{!l||null==a&&null==f||(d.current=!1,y(a,f))}),[l,a,f,y]),u.useMemo((()=>{if(!l)return{};function e(e){let{pointerType:t}=e;v(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:b,onMouseEnter:b}}}),[l,b])},e.useDelayGroup=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:u,setCurrentId:i,initialDelay:l,setState:s,timeoutMs:a}=F();c((()=>{u&&(s({delay:{open:1,close:D(l,"close")}}),u!==o&&r(!1))}),[o,r,s,u,l]),c((()=>{function e(){r(!1),s({delay:l,currentId:null})}if(!n&&u===o){if(a){const t=window.setTimeout(e,a);return()=>{clearTimeout(t)}}e()}}),[n,s,u,o,r,l,a]),c((()=>{n&&i(o)}),[n,i,o])},e.useDelayGroupContext=F,e.useDismiss=function(e,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,nodeId:c,elements:{reference:l,domReference:s,floating:a},dataRef:f}=e,{enabled:d=!0,escapeKey:m=!0,outsidePress:p=!0,outsidePressEvent:v="pointerdown",referencePress:b=!1,referencePressEvent:E="pointerdown",ancestorScroll:I=!1,bubbles:T}=n,C=h(),P=null!=g(),A=Be("function"==typeof p?p:()=>!1),L="function"==typeof p?A:p,D=u.useRef(!1),{escapeKeyBubbles:N,outsidePressBubbles:F}=(e=>{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}})(T),j=Be((e=>{if(!r||!d||!m||"Escape"!==e.key)return;const t=C?me(C.nodesRef.current,c):[];if(!N&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e)})),K=Be((e=>{const t=D.current;if(D.current=!1,t)return;if("function"==typeof L&&!L(e))return;const n=pe(e),r="["+S("inert")+"]";if(R(n)&&y(n).querySelector(r)&&!qe(n,r)&&!M(n))return;if(x(n)&&a){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,r=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let o=r&&e.offsetX>n.clientWidth;if(r){"rtl"===w(a).getComputedStyle(n).direction&&(o=e.offsetX<=n.offsetWidth-n.clientWidth)}if(o||t&&e.offsetY>n.clientHeight)return}const u=C&&me(C.nodesRef.current,c).some((t=>{var n;return _e(e,null==(n=t.context)?void 0:n.elements.floating)}));if(_e(e,a)||_e(e,s)||u)return;const l=C?me(C.nodesRef.current,c):[];if(l.length>0){let e=!0;if(l.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:P?{preventScroll:!0}:O(e)||k(e)}}),o(!1,e)}));return u.useEffect((()=>{if(!r||!d)return;function e(e){o(!1,e)}f.current.__escapeKeyBubbles=N,f.current.__outsidePressBubbles=F;const n=y(a);m&&n.addEventListener("keydown",j),L&&n.addEventListener(v,K);let u=[];return I&&(R(s)&&(u=t.getOverflowAncestors(s)),R(a)&&(u=u.concat(t.getOverflowAncestors(a))),!R(l)&&l&&l.contextElement&&(u=u.concat(t.getOverflowAncestors(l.contextElement)))),u=u.filter((e=>{var t;return e!==(null==(t=n.defaultView)?void 0:t.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{m&&n.removeEventListener("keydown",j),L&&n.removeEventListener(v,K),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[f,a,s,l,m,L,v,r,o,I,d,N,F,j,K]),u.useEffect((()=>{D.current=!1}),[L,v]),u.useMemo((()=>d?{reference:{onKeyDown:j,[We[E]]:e=>{b&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:j,[Ue[v]]:()=>{D.current=!0}}}:{}),[d,i,b,v,E,o,j])},e.useFloating=function(e){var n;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:i}=e,[l,s]=u.useState(null),a=(null==(n=e.elements)?void 0:n.reference)||l,d=t.useFloating(e),p=h(),v=Be(((e,t)=>{e&&(y.current.openEvent=t),null==o||o(e,t)})),g=u.useRef(null),y=u.useRef({}),b=u.useState((()=>m()))[0],E=f(),w=u.useCallback((e=>{const t=R(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;d.refs.setReference(t)}),[d.refs]),x=u.useCallback((e=>{(R(e)||null===e)&&(g.current=e,s(e)),(R(d.refs.reference.current)||null===d.refs.reference.current||null!==e&&!R(e))&&d.refs.setReference(e)}),[d.refs]),I=u.useMemo((()=>({...d.refs,setReference:x,setPositionReference:w,domReference:g})),[d.refs,x,w]),O=u.useMemo((()=>({...d.elements,domReference:a})),[d.elements,a]),k=u.useMemo((()=>({...d,refs:I,elements:O,dataRef:y,nodeId:i,floatingId:E,events:b,open:r,onOpenChange:v})),[d,i,E,b,r,v,I,O]);return c((()=>{const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===i));e&&(e.context=k)})),u.useMemo((()=>({...d,context:k,refs:I,elements:O})),[d,I,O,k])},e.useFloatingNodeId=function(e){const t=f(),n=h(),r=g(),o=e||r;return c((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t},e.useFloatingParentNodeId=g,e.useFloatingPortalNode=Me,e.useFloatingTree=h,e.useFocus=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,refs:c,elements:{floating:l,domReference:s}}=e,{enabled:a=!0,keyboardOnly:f=!0}=t,d=u.useRef(""),m=u.useRef(!1),p=u.useRef();return u.useEffect((()=>{if(!a)return;const e=y(l).defaultView||window;function t(){!n&&x(s)&&s===ae(y(s))&&(m.current=!0)}return e.addEventListener("blur",t),()=>{e.removeEventListener("blur",t)}}),[l,s,n,a]),u.useEffect((()=>{if(a)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(e){"referencePress"!==e.type&&"escapeKey"!==e.type||(m.current=!0)}}),[i,a]),u.useEffect((()=>()=>{clearTimeout(p.current)}),[]),u.useMemo((()=>a?{reference:{onPointerDown(e){let{pointerType:t}=e;d.current=t,m.current=!(!t||!f)},onMouseLeave(){m.current=!1},onFocus(e){var t;m.current||"focus"===e.type&&"mousedown"===(null==(t=o.current.openEvent)?void 0:t.type)&&_e(o.current.openEvent,s)||r(!0,e.nativeEvent)},onBlur(e){m.current=!1;const t=e.relatedTarget,n=R(t)&&t.hasAttribute(S("focus-guard"))&&"outside"===t.getAttribute("data-type");p.current=setTimeout((()=>{P(c.floating.current,t)||P(s,t)||n||r(!1,e.nativeEvent)}))}}}:{}),[a,f,s,c,o,r])},e.useHover=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:l,floating:s},refs:a}=e,{enabled:f=!0,delay:d=0,handleClose:m=null,mouseOnly:p=!1,restMs:v=0,move:b=!0}=t,E=h(),w=g(),x=A(m),I=A(d),O=u.useRef(),k=u.useRef(),T=u.useRef(),M=u.useRef(),S=u.useRef(!0),N=u.useRef(!1),F=u.useRef((()=>{})),j=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(f)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(){clearTimeout(k.current),clearTimeout(M.current),S.current=!0}}),[f,i]),u.useEffect((()=>{if(!f||!x.current||!n)return;function e(e){j()&&r(!1,e)}const t=y(s).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[s,n,r,f,x,o,j]);const K=u.useCallback((function(e,t){void 0===t&&(t=!0);const n=D(I.current,"close",O.current);n&&!T.current?(clearTimeout(k.current),k.current=setTimeout((()=>r(!1,e)),n)):t&&(clearTimeout(k.current),r(!1,e))}),[I,r]),B=u.useCallback((()=>{F.current(),T.current=void 0}),[]),H=u.useCallback((()=>{if(N.current){const e=y(a.floating.current).body;e.style.pointerEvents="",e.removeAttribute(L),N.current=!1}}),[a]);return u.useEffect((()=>{if(f&&R(l)){const e=l;return n&&e.addEventListener("mouseleave",c),null==s||s.addEventListener("mouseleave",c),b&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",i),()=>{n&&e.removeEventListener("mouseleave",c),null==s||s.removeEventListener("mouseleave",c),b&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(k.current),S.current=!1,p&&!C(O.current)||v>0&&0===D(I.current,"open"))return;const t=D(I.current,"open",O.current);t?k.current=setTimeout((()=>{r(!0,e)}),t):r(!0,e)}function i(r){if(t())return;F.current();const o=y(s);if(clearTimeout(M.current),x.current){n||clearTimeout(k.current),T.current=x.current({...e,tree:E,x:r.clientX,y:r.clientY,onClose(){H(),B(),K(r)}});const t=T.current;return o.addEventListener("mousemove",t),void(F.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==O.current||!P(s,r.relatedTarget))&&K(r)}function c(n){t()||null==x.current||x.current({...e,tree:E,x:n.clientX,y:n.clientY,onClose(){H(),B(),K(n)}})(n)}}),[l,s,f,e,p,v,b,K,B,H,r,n,E,I,x,o]),c((()=>{var e;if(f&&n&&null!=(e=x.current)&&e.__options.blockPointerEvents&&j()){const e=y(s).body;if(e.setAttribute(L,""),e.style.pointerEvents="none",N.current=!0,R(l)&&s){var t,r;const e=l,n=null==E||null==(t=E.nodesRef.current.find((e=>e.id===w)))||null==(r=t.context)?void 0:r.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",s.style.pointerEvents="auto",()=>{e.style.pointerEvents="",s.style.pointerEvents=""}}}}),[f,n,w,s,l,E,x,o,j]),c((()=>{n||(O.current=void 0,B(),H())}),[n,B,H]),u.useEffect((()=>()=>{B(),clearTimeout(k.current),clearTimeout(M.current),H()}),[f,B,H]),u.useMemo((()=>{if(!f)return{};function e(e){O.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===v||(clearTimeout(M.current),M.current=setTimeout((()=>{S.current||r(!0,e.nativeEvent)}),v))}},floating:{onMouseEnter(){clearTimeout(k.current)},onMouseLeave(e){i.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),K(e.nativeEvent,!1)}}}}),[i,f,v,n,r,K])},e.useId=f,e.useInnerOffset=function(e,t){const{open:n,elements:o}=e,{enabled:i=!0,overflowRef:c,scrollRef:l,onChange:s}=t,a=Be(s),f=u.useRef(!1),d=u.useRef(null),m=u.useRef(null);return u.useEffect((()=>{if(!i)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;const n=e.deltaY,o=c.current.top>=-.5,u=c.current.bottom>=-.5,i=t.scrollHeight-t.clientHeight,l=n<0?-1:1,s=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!o&&n>0||!u&&n<0?(e.preventDefault(),r.flushSync((()=>{a((e=>e+Math[s](n,i*l)))}))):/firefox/i.test(E())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||o.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{d.current=t.scrollTop,null!=c.current&&(m.current={...c.current})})),()=>{d.current=null,m.current=null,t.removeEventListener("wheel",e)}):void 0}),[i,n,o.floating,c,l,a]),u.useMemo((()=>i?{floating:{onKeyDown(){f.current=!0},onWheel(){f.current=!1},onPointerMove(){f.current=!1},onScroll(){const e=(null==l?void 0:l.current)||o.floating;if(c.current&&e&&f.current){if(null!==d.current){const t=e.scrollTop-d.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&r.flushSync((()=>a((e=>e+t))))}requestAnimationFrame((()=>{d.current=e.scrollTop}))}}}}:{}),[i,c,o.floating,l,a])},e.useInteractions=function(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>ze(t,e,"reference")),t),r=u.useCallback((t=>ze(t,e,"floating")),t),o=u.useCallback((t=>ze(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return u.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])},e.useListItem=function(e){let{label:t}=void 0===e?{}:e;const[n,r]=u.useState(null),o=u.useRef(null),{register:i,unregister:l,map:s,elementsRef:a,labelsRef:f}=u.useContext(Le),d=u.useCallback((e=>{if(o.current=e,null!==n&&(a.current[n]=e,f)){var r;const o=void 0!==t;f.current[n]=o?t:null!=(r=null==e?void 0:e.textContent)?r:null}}),[n,a,f,t]);return c((()=>{const e=o.current;if(e)return i(e),()=>{l(e)}}),[i,l]),c((()=>{const e=o.current?s.get(o.current):null;null!=e&&r(e)}),[s]),u.useMemo((()=>({ref:d,index:null==n?-1:n})),[n,d])},e.useListNavigation=function(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:i,floating:l}}=e,{listRef:s,activeIndex:a,onNavigate:f=(()=>{}),enabled:d=!0,selectedIndex:m=null,allowEscape:p=!1,loop:v=!1,nested:E=!1,rtl:w=!1,virtual:R=!1,focusItemOnOpen:I="auto",focusItemOnHover:C=!0,openOnArrowKeyDown:M=!0,disabledIndices:S,orientation:L="vertical",cols:D=1,scrollItemIntoView:N=!0}=t,F=g(),j=h(),K=Be(f),B=u.useRef(I),H=u.useRef(null!=m?m:-1),q=u.useRef(null),_=u.useRef(!0),W=u.useRef(K),U=u.useRef(!!l),z=u.useRef(!1),V=u.useRef(!1),X=A(S),Y=A(n),G=A(N),[Z,$]=u.useState(),Q=Be((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(R?$(r.id):de(r,{preventScroll:!0,sync:!(!b().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!T())&&(Ve||z.current)}),requestAnimationFrame((()=>{const e=G.current;e&&r&&(n||!_.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));c((()=>{document.createElement("div").focus({get preventScroll(){return Ve=!0,!1}})}),[]),c((()=>{d&&(n&&l?B.current&&null!=m&&(V.current=!0,K(m)):U.current&&(H.current=-1,W.current(null)))}),[d,n,l,m,K]),c((()=>{if(d&&n&&l)if(null==a){if(z.current=!1,null!=m)return;if(U.current&&(H.current=-1,Q(s,H)),!U.current&&B.current&&(null!=q.current||!0===B.current&&null==q.current)){let e=0;const t=()=>{if(null==s.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else H.current=null==q.current||nt(q.current,L,w)||E?rt(s,X.current):ot(s,X.current),q.current=null,K(H.current)};t()}}else Qe(s,a)||(H.current=a,Q(s,H,V.current),V.current=!1)}),[d,n,l,a,m,E,s,L,w,K,Q,X]),c((()=>{if(d&&U.current&&!l&&j){var e,t;const n=j.nodesRef.current,r=null==(e=n.find((e=>e.id===F)))||null==(t=e.context)?void 0:t.elements.floating,o=ae(y(l)),u=n.some((e=>e.context&&P(e.context.elements.floating,o)));r&&!u&&r.focus({preventScroll:!0})}}),[d,l,j,F]),c((()=>{W.current=K,U.current=!!l})),c((()=>{n||(q.current=null)}),[n]);const J=null!=a,ee=u.useMemo((()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&K(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...C&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;_.current&&"touch"!==t&&(H.current=-1,Q(s,H),K(null),R||de(o.floating.current,{preventScroll:!0}))}}}}),[n,o,Q,C,s,K,R]);return u.useMemo((()=>{if(!d)return{};const e=X.current;function t(t){if(_.current=!1,z.current=!0,!Y.current&&t.currentTarget===o.floating.current)return;if(E&&function(e,t,n){return et(t,n?e===Ze:e===Ge,e===Xe)}(t.key,L,w))return he(t),r(!1,t.nativeEvent),void(x(i)&&i.focus());const u=H.current,c=rt(s,e),l=ot(s,e);if("Home"===t.key&&(he(t),H.current=c,K(H.current)),"End"===t.key&&(he(t),H.current=l,K(H.current)),D>1){const n=H.current;if(t.key===Xe){if(he(t),-1===n)H.current=l;else if(H.current=Je(s,{startingIndex:n,amount:D,decrement:!0,disabledIndices:e}),v&&(n-D<c||H.current<0)){const e=n%D,t=l%D,r=l-(t-e);H.current=t===e?l:t>e?r:r-D}Qe(s,H.current)&&(H.current=n),K(H.current)}if(t.key===Ye&&(he(t),-1===n?H.current=c:(H.current=Je(s,{startingIndex:n,amount:D,disabledIndices:e}),v&&n+D>l&&(H.current=Je(s,{startingIndex:n%D-D,amount:D,disabledIndices:e}))),Qe(s,H.current)&&(H.current=n),K(H.current)),"both"===L){const r=Math.floor(n/D);t.key===Ze&&(he(t),n%D!=D-1?(H.current=Je(s,{startingIndex:n,disabledIndices:e}),v&&$e(H.current,D,r)&&(H.current=Je(s,{startingIndex:n-n%D-1,disabledIndices:e}))):v&&(H.current=Je(s,{startingIndex:n-n%D-1,disabledIndices:e})),$e(H.current,D,r)&&(H.current=n)),t.key===Ge&&(he(t),n%D!=0?(H.current=Je(s,{startingIndex:n,disabledIndices:e,decrement:!0}),v&&$e(H.current,D,r)&&(H.current=Je(s,{startingIndex:n+(D-n%D),decrement:!0,disabledIndices:e}))):v&&(H.current=Je(s,{startingIndex:n+(D-n%D),decrement:!0,disabledIndices:e})),$e(H.current,D,r)&&(H.current=n));const o=Math.floor(l/D)===r;return Qe(s,H.current)&&(H.current=v&&o?t.key===Ge?l:Je(s,{startingIndex:n-n%D-1,disabledIndices:e}):n),void K(H.current)}}if(tt(t.key,L)){if(he(t),n&&!R&&ae(t.currentTarget.ownerDocument)===t.currentTarget)return H.current=nt(t.key,L,w)?c:l,void K(H.current);nt(t.key,L,w)?H.current=v?u>=l?p&&u!==s.current.length?-1:c:Je(s,{startingIndex:u,disabledIndices:e}):Math.min(l,Je(s,{startingIndex:u,disabledIndices:e})):H.current=v?u<=c?p&&-1!==u?s.current.length:l:Je(s,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(c,Je(s,{startingIndex:u,decrement:!0,disabledIndices:e})),Qe(s,H.current)?K(null):K(H.current)}}function u(e){"auto"===I&&O(e.nativeEvent)&&(B.current=!0)}const c=R&&n&&J&&{"aria-activedescendant":Z};return{reference:{...c,onKeyDown(o){_.current=!1;const u=0===o.key.indexOf("Arrow");if(R&&n)return t(o);if(!n&&!M&&u)return;const i=u||"Enter"===o.key||""===o.key.trim(),c=tt(o.key,L),l=function(e,t,n){return et(t,n?e===Ge:e===Ze,e===Ye)}(o.key,L,w);i&&(q.current=E&&c?null:o.key),E?l&&(he(o),n?(H.current=rt(s,e),K(H.current)):r(!0,o.nativeEvent)):c&&(null!=m&&(H.current=m),he(o),!n&&M?r(!0,o.nativeEvent):t(o),n&&K(H.current))},onFocus(){n&&K(null)},onPointerDown:function(e){B.current=I,"auto"===I&&k(e.nativeEvent)&&(B.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===L?void 0:L,...c,onKeyDown:t,onPointerMove(){_.current=!0}},item:ee}}),[i,o,Z,X,Y,s,d,L,w,R,n,J,E,m,M,p,D,v,I,K,r,ee])},e.useMergeRefs=function(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)},e.useRole=function(e,t){void 0===t&&(t={});const{open:n,floatingId:r}=e,{enabled:o=!0,role:i="dialog"}=t,c=f();return u.useMemo((()=>{const e={id:r,role:i};return o?"tooltip"===i?{reference:{"aria-describedby":n?r:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===i?"dialog":i,"aria-controls":n?r:void 0,..."listbox"===i&&{role:"combobox"},..."menu"===i&&{id:c}},floating:{...e,..."menu"===i&&{"aria-labelledby":c}}}:{}}),[o,i,n,r,c])},e.useTransitionStatus=ct,e.useTransitionStyles=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:l=250}=t,s=e.placement,a=s.split("-")[0],f=u.useMemo((()=>({side:a,placement:s})),[a,s]),d="number"==typeof l,m=(d?l:l.open)||0,p=(d?l:l.close)||0,[v,g]=u.useState((()=>({...it(i,f),...it(n,f)}))),{isMounted:h,status:y}=ct(e,{duration:l}),b=A(n),E=A(r),w=A(o),R=A(i);return c((()=>{const e=it(b.current,f),t=it(w.current,f),n=it(R.current,f),r=it(E.current,f)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===y&&g((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===y&&g({transitionProperty:Object.keys(r).map(ut).join(","),transitionDuration:m+"ms",...n,...r}),"close"===y){const r=t||e;g({transitionProperty:Object.keys(r).map(ut).join(","),transitionDuration:p+"ms",...n,...r})}}),[p,w,b,E,R,m,y,f]),{isMounted:h,styles:v}},e.useTypeahead=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:l,onMatch:s,onTypingChange:a,enabled:f=!0,findMatch:d=null,resetMs:m=750,ignoreKeys:p=[],selectedIndex:v=null}=t,g=u.useRef(),h=u.useRef(""),y=u.useRef(null!=(n=null!=v?v:l)?n:-1),b=u.useRef(null),E=Be(s),w=Be(a),R=A(d),x=A(p);return c((()=>{r&&(clearTimeout(g.current),b.current=null,h.current="")}),[r]),c((()=>{var e;r&&""===h.current&&(y.current=null!=(e=null!=v?v:l)?e:-1)}),[r,v,l]),u.useMemo((()=>{if(!f)return{};function e(e){e?o.current.typing||(o.current.typing=e,w(e)):o.current.typing&&(o.current.typing=e,w(e))}function t(e,t,n){const r=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}function n(n){const o=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(o,o,h.current)?e(!1):" "===n.key&&he(n)),null==o||x.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(he(n),e(!0));o.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.current===n.key&&(h.current="",y.current=b.current),h.current+=n.key,clearTimeout(g.current),g.current=setTimeout((()=>{h.current="",y.current=b.current,e(!1)}),m);const u=y.current,c=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],h.current);-1!==c?(E(c),b.current=c):" "!==n.key&&(h.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[f,r,o,i,m,x,R,E,w])}})); |
{ | ||
"name": "@floating-ui/react", | ||
"version": "0.24.3", | ||
"version": "0.24.4", | ||
"@rollingversions": { | ||
@@ -35,5 +35,5 @@ "baseVersion": [ | ||
"scripts": { | ||
"test": "jest test", | ||
"test": "vitest", | ||
"build": "NODE_ENV=build rollup -c", | ||
"dev": "parcel test/visual/index.html" | ||
"dev": "vite" | ||
}, | ||
@@ -65,3 +65,3 @@ "author": "atomiks", | ||
"@floating-ui/react-dom": "^2.0.1", | ||
"aria-hidden": "^1.1.3", | ||
"aria-hidden": "^1.2.3", | ||
"tabbable": "^6.0.1" | ||
@@ -73,3 +73,2 @@ }, | ||
"@radix-ui/react-icons": "^1.2.0", | ||
"@rollup/plugin-commonjs": "^21.0.1", | ||
"@testing-library/jest-dom": "^5.16.4", | ||
@@ -79,8 +78,7 @@ "@testing-library/react": "^13.1.1", | ||
"@testing-library/user-event": "^14.4.3", | ||
"@types/react": "^18.0.28", | ||
"@types/react": "^18.2.14", | ||
"@vitejs/plugin-react": "^4.0.1", | ||
"clsx": "^1.2.1", | ||
"framer-motion": "^6.2.8", | ||
"react": "^18.0.0", | ||
"react-dom": "^18.0.0", | ||
"react-merge-refs": "^1.1.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-responsive": "^9.0.2", | ||
@@ -87,0 +85,0 @@ "react-router-dom": "^6.3.0", |
@@ -22,3 +22,3 @@ import * as React from 'react'; | ||
*/ | ||
export declare function FloatingPortal({ children, id, root, preserveTabOrder, }: FloatingPortalProps): JSX.Element; | ||
export declare function FloatingPortal({ children, id, root, preserveTabOrder, }: FloatingPortalProps): import("react/jsx-runtime").JSX.Element; | ||
export declare const usePortalContext: () => { | ||
@@ -25,0 +25,0 @@ preserveTabOrder: boolean; |
@@ -6,2 +6,2 @@ import * as React from 'react'; | ||
*/ | ||
export declare function useMergeRefs<Instance>(refs: Array<React.Ref<Instance>>): React.RefCallback<Instance> | null; | ||
export declare function useMergeRefs<Instance>(refs: Array<React.Ref<Instance> | undefined>): React.RefCallback<Instance> | null; |
@@ -46,3 +46,3 @@ import type { UseFloatingOptions as UsePositionOptions, UseFloatingReturn as UsePositionFloatingReturn, VirtualElement } from '@floating-ui/react-dom'; | ||
} | ||
export type FloatingContext<RT extends ReferenceType = ReferenceType> = Prettify<Omit<UsePositionFloatingReturn<RT>, 'refs' | 'elements'> & { | ||
export type FloatingContext<RT extends ReferenceType = ReferenceType> = Omit<UsePositionFloatingReturn<RT>, 'refs' | 'elements'> & { | ||
open: boolean; | ||
@@ -56,3 +56,3 @@ onOpenChange: (open: boolean, event?: Event) => void; | ||
elements: ExtendedElements<RT>; | ||
}>; | ||
}; | ||
export interface FloatingNodeType<RT extends ReferenceType = ReferenceType> { | ||
@@ -77,3 +77,3 @@ id: string; | ||
export type UseFloatingReturn<RT extends ReferenceType = ReferenceType> = Prettify<UsePositionFloatingReturn & { | ||
context: FloatingContext<RT>; | ||
context: Prettify<FloatingContext<RT>>; | ||
refs: ExtendedRefs<RT>; | ||
@@ -80,0 +80,0 @@ elements: ExtendedElements<RT>; |
@@ -12,1 +12,3 @@ /// <reference types="react" /> | ||
export declare function isReactEvent(event: any): event is React.SyntheticEvent; | ||
export declare function isHidden(el: HTMLElement | null): boolean; | ||
export declare function isRootElement(element: Element): boolean; |
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
575716
16
52
13017
Updatedaria-hidden@^1.2.3