{"version":3,"sources":["webpack://web/./node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs","webpack://web/./node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs","webpack://web/./node_modules/@floating-ui/react-dom-interactions/dist/floating-ui.react-dom-interactions.esm.js","webpack://web/./node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js"],"names":["t","split","e","n","includes","r","i","o","a","reference","l","floating","s","c","x","width","f","y","height","u","m","g","d","p","async","placement","strategy","middleware","platform","filter","Boolean","isRTL","getElementRects","length","name","fn","h","data","w","reset","v","initialPlacement","middlewareData","rects","elements","top","right","bottom","left","boundary","rootBoundary","elementContext","altBoundary","padding","getClippingRect","element","isElement","contextElement","getDocumentElement","convertOffsetParentRelativeRectToViewportRelativeRect","rect","offsetParent","getOffsetParent","Math","min","max","options","getDimensions","b","R","A","P","T","clientHeight","clientWidth","O","L","D","k","E","B","centerOffset","replace","main","cross","start","end","reduce","concat","mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","flipAlignment","flip","overflows","push","every","index","map","sort","alignmentAxis","limiter","offset","document","location","alert","setInterval","window","ownerDocument","defaultView","getComputedStyle","nodeName","toLowerCase","navigator","userAgentData","brands","brand","version","join","userAgent","HTMLElement","Element","ShadowRoot","overflow","overflowX","overflowY","display","test","backdropFilter","WebkitBackdropFilter","transform","perspective","willChange","some","contain","round","getBoundingClientRect","offsetWidth","offsetHeight","visualViewport","offsetLeft","offsetTop","Node","documentElement","scrollLeft","scrollTop","pageXOffset","pageYOffset","clientLeft","clientTop","assignedSlot","parentNode","host","position","W","H","body","C","scrollWidth","scrollHeight","direction","S","getClientRects","Array","from","z","ancestorScroll","ancestorResize","elementResize","animationFrame","forEach","addEventListener","passive","ResizeObserver","observe","requestAnimationFrame","removeEventListener","disconnect","cancelAnimationFrame","useLayoutEffect","useEffect","serverHandoffComplete","count","genId","useReactId","toString","useId","id","setId","undefined","FloatingNodeContext","FloatingTreeContext","useFloatingParentNodeId","_React$useContext$id","_React$useContext","useFloatingTree","getDocument","_floating$ownerDocume","value","_getDocument$defaultV","getWindow","useInsertionEffect","useFloating","_temp","open","onOpenChange","unstable_onOpenChange","whileElementsMounted","nodeId","domReference","setDomReference","tree","domReferenceRef","dataRef","events","Map","emit","event","_map$get","get","handler","on","listener","set","off","createPubSub","callback","ref","current","_len","arguments","args","_key","useEvent","refs","context","_","node","nodesRef","find","setReference","mergeProps","userProps","propsList","elementKey","tabIndex","acc","props","Object","entries","_ref","key","indexOf","has","_map$get2","useInteractions","deps","getReferenceProps","getFloatingProps","getItemProps","getChildren","nodes","_nodes$filter","allChildren","_node$context","parentId","currentChildren","_nodes$filter2","_currentChildren","_node$context2","safePolygon","timeoutId","restMs","buffer","blockPointerEvents","debug","polygonIsDestroyed","onClose","leave","_refs$domReference$cu","_refs$floating$curren","_refs$floating$curren2","close","clearTimeout","pointerType","clientX","clientY","targetNode","composedPath","target","type","contains","relatedTarget","_ref2","refRect","side","cursorLeaveFromRight","cursorLeaveFromBottom","point","polygon","isInside","j","xi","yi","xj","yj","isPointInPolygon","_ref3","isFloatingWider","isFloatingTaller","cursorPointOne","cursorPointTwo","getPolygon","setTimeout","__options","useLatestRef","useRef","getDelay","prop","useHover","enabled","delay","handleClose","mouseOnly","move","handleCloseRef","delayRef","previousOpen","usePrevious","pointerTypeRef","timeoutRef","handlerRef","restTimeoutRef","blockMouseMoveRef","performedPointerEventsMutationRef","isHoverOpen","_dataRef$current$open","openEvent","onDismiss","onLeave","html","closeWithDelay","runElseBranch","closeDelay","cleanupPointerMoveHandler","clearPointerEvents","style","pointerEvents","isClickLikeOpenEvent","onMouseEnter","openDelay","onMouseLeave","doc","onScrollMouseLeave","once","_tree$nodesRef$curren","_tree$nodesRef$curren2","parentFloating","setPointerRef","onPointerDown","onPointerEnter","onMouseMove","isEventTargetWithin","bubbleHandlerKeys","pointerdown","mousedown","click","captureHandlerKeys","useDismiss","escapeKey","outsidePress","outsidePressEvent","referencePress","referencePressEvent","bubbles","nested","insideReactTreeRef","onKeyDown","preventScroll","onOutsidePress","insideReactTree","getTarget","win","canScrollX","canScrollY","xCond","offsetX","offsetY","targetIsInsideChildren","onScroll","ancestors","ancestor","_doc$defaultView","deepEqual","keys","isArray","prototype","hasOwnProperty","call","$$typeof","setData","latestMiddleware","setLatestMiddleware","cleanupRef","whileElementsMountedRef","update","then","isMountedRef","runElementMountCallback","cleanupFn","setFloating","arrow"],"mappings":"qHAAA,SAASA,EAAEA,GAAG,OAAOA,EAAEC,MAAM,KAAK,GAAG,SAASC,EAAEF,GAAG,OAAOA,EAAEC,MAAM,KAAK,GAAG,SAASE,EAAED,GAAG,MAAM,CAAC,MAAM,UAAUE,SAASJ,EAAEE,IAAI,IAAI,IAAI,SAASG,EAAEL,GAAG,MAAM,MAAMA,EAAE,SAAS,QAAQ,SAASM,EAAEA,EAAEC,EAAEC,GAAG,IAAIC,UAAUC,EAAEC,SAASC,GAAGN,EAAE,MAAMO,EAAEH,EAAEI,EAAEJ,EAAEK,MAAM,EAAEH,EAAEG,MAAM,EAAEC,EAAEN,EAAEO,EAAEP,EAAEQ,OAAO,EAAEN,EAAEM,OAAO,EAAEC,EAAEhB,EAAEI,GAAGa,EAAEf,EAAEc,GAAGE,EAAEX,EAAEU,GAAG,EAAER,EAAEQ,GAAG,EAAEE,EAAE,MAAMH,EAAE,IAAII,EAAE,OAAOvB,EAAEO,IAAI,IAAI,MAAMgB,EAAE,CAACT,EAAED,EAAEI,EAAEP,EAAEO,EAAEL,EAAEM,QAAQ,MAAM,IAAI,SAASK,EAAE,CAACT,EAAED,EAAEI,EAAEP,EAAEO,EAAEP,EAAEQ,QAAQ,MAAM,IAAI,QAAQK,EAAE,CAACT,EAAEJ,EAAEI,EAAEJ,EAAEK,MAAME,EAAED,GAAG,MAAM,IAAI,OAAOO,EAAE,CAACT,EAAEJ,EAAEI,EAAEF,EAAEG,MAAME,EAAED,GAAG,MAAM,QAAQO,EAAE,CAACT,EAAEJ,EAAEI,EAAEG,EAAEP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BhJ,EAAQ8K,SACH,QAAQ,CACb9K,QAASA,EAAQ8K,QACjBhL,YACClB,GAAGqM,GAGD,GACEjL,GACF,QAAQ,CACbA,UACAF,YACClB,GAAGqM,GAGD,GAzBX,IAAejC","file":"npm.floating-ui.b2a97dc86415e48d5846.react.bundle.js","sourcesContent":["function t(t){return t.split(\"-\")[0]}function e(t){return t.split(\"-\")[1]}function n(e){return[\"top\",\"bottom\"].includes(t(e))?\"x\":\"y\"}function r(t){return\"y\"===t?\"height\":\"width\"}function i(i,o,a){let{reference:l,floating:s}=i;const c=l.x+l.width/2-s.width/2,f=l.y+l.height/2-s.height/2,u=n(o),m=r(u),g=l[m]/2-s[m]/2,d=\"x\"===u;let p;switch(t(o)){case\"top\":p={x:c,y:l.y-s.height};break;case\"bottom\":p={x:c,y:l.y+l.height};break;case\"right\":p={x:l.x+l.width,y:f};break;case\"left\":p={x:l.x-s.width,y:f};break;default:p={x:l.x,y:l.y}}switch(e(o)){case\"start\":p[u]-=g*(a&&d?-1:1);break;case\"end\":p[u]+=g*(a&&d?-1:1)}return p}const o=async(t,e,n)=>{const{placement:r=\"bottom\",strategy:o=\"absolute\",middleware:a=[],platform:l}=n,s=a.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(e));let f=await l.getElementRects({reference:t,floating:e,strategy:o}),{x:u,y:m}=i(f,r,c),g=r,d={},p=0;for(let n=0;n({name:\"arrow\",options:t,async fn(i){const{element:o,padding:l=0}=null!=t?t:{},{x:s,y:c,placement:f,rects:m,platform:g}=i;if(null==o)return{};const d=a(l),p={x:s,y:c},h=n(f),y=e(f),x=r(h),w=await g.getDimensions(o),v=\"y\"===h?\"top\":\"left\",b=\"y\"===h?\"bottom\":\"right\",R=m.reference[x]+m.reference[h]-p[h]-m.floating[x],A=p[h]-m.reference[h],P=await(null==g.getOffsetParent?void 0:g.getOffsetParent(o));let T=P?\"y\"===h?P.clientHeight||0:P.clientWidth||0:0;0===T&&(T=m.floating[x]);const O=R/2-A/2,L=d[v],D=T-w[x]-d[b],k=T/2-w[x]/2+O,E=u(L,k,D),B=(\"start\"===y?d[v]:d[b])>0&&k!==E&&m.reference[x]<=m.floating[x];return{[h]:p[h]-(B?kg[t]))}function p(t,i,o){void 0===o&&(o=!1);const a=e(t),l=n(t),s=r(l);let c=\"x\"===l?a===(o?\"end\":\"start\")?\"right\":\"left\":\"start\"===a?\"bottom\":\"top\";return i.reference[s]>i.floating[s]&&(c=d(c)),{main:c,cross:d(c)}}const h={start:\"end\",end:\"start\"};function y(t){return t.replace(/start|end/g,(t=>h[t]))}const x=[\"top\",\"right\",\"bottom\",\"left\"],w=x.reduce(((t,e)=>t.concat(e,e+\"-start\",e+\"-end\")),[]);const v=function(n){return void 0===n&&(n={}),{name:\"autoPlacement\",options:n,async fn(r){var i,o,a,l,c;const{x:f,y:u,rects:m,middlewareData:g,placement:d,platform:h,elements:x}=r,{alignment:v=null,allowedPlacements:b=w,autoAlignment:R=!0,...A}=n,P=function(n,r,i){return(n?[...i.filter((t=>e(t)===n)),...i.filter((t=>e(t)!==n))]:i.filter((e=>t(e)===e))).filter((t=>!n||e(t)===n||!!r&&y(t)!==t))}(v,R,b),T=await s(r,A),O=null!=(i=null==(o=g.autoPlacement)?void 0:o.index)?i:0,L=P[O];if(null==L)return{};const{main:D,cross:k}=p(L,m,await(null==h.isRTL?void 0:h.isRTL(x.floating)));if(d!==L)return{x:f,y:u,reset:{placement:P[0]}};const E=[T[t(L)],T[D],T[k]],B=[...null!=(a=null==(l=g.autoPlacement)?void 0:l.overflows)?a:[],{placement:L,overflows:E}],C=P[O+1];if(C)return{data:{index:O+1,overflows:B},reset:{placement:C}};const H=B.slice().sort(((t,e)=>t.overflows[0]-e.overflows[0])),V=null==(c=H.find((t=>{let{overflows:e}=t;return e.every((t=>t<=0))})))?void 0:c.placement,F=null!=V?V:H[0].placement;return F!==d?{data:{index:O+1,overflows:B},reset:{placement:F}}:{}}}};const b=function(e){return void 0===e&&(e={}),{name:\"flip\",options:e,async fn(n){var r;const{placement:i,middlewareData:o,rects:a,initialPlacement:l,platform:c,elements:f}=n,{mainAxis:u=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:h=\"bestFit\",flipAlignment:x=!0,...w}=e,v=t(i),b=g||(v===l||!x?[d(l)]:function(t){const e=d(t);return[y(t),e,y(e)]}(l)),R=[l,...b],A=await s(n,w),P=[];let T=(null==(r=o.flip)?void 0:r.overflows)||[];if(u&&P.push(A[v]),m){const{main:t,cross:e}=p(i,a,await(null==c.isRTL?void 0:c.isRTL(f.floating)));P.push(A[t],A[e])}if(T=[...T,{placement:i,overflows:P}],!P.every((t=>t<=0))){var O,L;const t=(null!=(O=null==(L=o.flip)?void 0:L.index)?O:0)+1,e=R[t];if(e)return{data:{index:t,overflows:T},reset:{placement:e}};let n=\"bottom\";switch(h){case\"bestFit\":{var D;const t=null==(D=T.map((t=>[t,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:D[0].placement;t&&(n=t);break}case\"initialPlacement\":n=l}if(i!==n)return{reset:{placement:n}}}return{}}}};function R(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function A(t){return x.some((e=>t[e]>=0))}const P=function(t){let{strategy:e=\"referenceHidden\",...n}=void 0===t?{}:t;return{name:\"hide\",async fn(t){const{rects:r}=t;switch(e){case\"referenceHidden\":{const e=R(await s(t,{...n,elementContext:\"reference\"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:A(e)}}}case\"escaped\":{const e=R(await s(t,{...n,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:A(e)}}}default:return{}}}}};const T=function(r){return void 0===r&&(r=0),{name:\"offset\",options:r,async fn(i){const{x:o,y:a}=i,l=await async function(r,i){const{placement:o,platform:a,elements:l}=r,s=await(null==a.isRTL?void 0:a.isRTL(l.floating)),c=t(o),f=e(o),u=\"x\"===n(o),m=[\"left\",\"top\"].includes(c)?-1:1,g=s&&u?-1:1,d=\"function\"==typeof i?i(r):i;let{mainAxis:p,crossAxis:h,alignmentAxis:y}=\"number\"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return f&&\"number\"==typeof y&&(h=\"end\"===f?-1*y:y),u?{x:h*g,y:p*m}:{x:p*m,y:h*g}}(i,r);return{x:o+l.x,y:a+l.y,data:l}}}};function O(t){return\"x\"===t?\"y\":\"x\"}const L=function(e){return void 0===e&&(e={}),{name:\"shift\",options:e,async fn(r){const{x:i,y:o,placement:a}=r,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...m}=e,g={x:i,y:o},d=await s(r,m),p=n(t(a)),h=O(p);let y=g[p],x=g[h];if(l){const t=\"y\"===p?\"bottom\":\"right\";y=u(y+d[\"y\"===p?\"top\":\"left\"],y,y-d[t])}if(c){const t=\"y\"===h?\"bottom\":\"right\";x=u(x+d[\"y\"===h?\"top\":\"left\"],x,x-d[t])}const w=f.fn({...r,[p]:y,[h]:x});return{...w,data:{x:w.x-i,y:w.y-o}}}}},D=function(e){return void 0===e&&(e={}),{options:e,fn(r){const{x:i,y:o,placement:a,rects:l,middlewareData:s}=r,{offset:c=0,mainAxis:f=!0,crossAxis:u=!0}=e,m={x:i,y:o},g=n(a),d=O(g);let p=m[g],h=m[d];const y=\"function\"==typeof c?c(r):c,x=\"number\"==typeof y?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(f){const t=\"y\"===g?\"height\":\"width\",e=l.reference[g]-l.floating[t]+x.mainAxis,n=l.reference[g]+l.reference[t]-x.mainAxis;pn&&(p=n)}if(u){var w,v,b,R;const e=\"y\"===g?\"width\":\"height\",n=[\"top\",\"left\"].includes(t(a)),r=l.reference[d]-l.floating[e]+(n&&null!=(w=null==(v=s.offset)?void 0:v[d])?w:0)+(n?0:x.crossAxis),i=l.reference[d]+l.reference[e]+(n?0:null!=(b=null==(R=s.offset)?void 0:R[d])?b:0)-(n?x.crossAxis:0);hi&&(h=i)}return{[g]:p,[d]:h}}}},k=function(n){return void 0===n&&(n={}),{name:\"size\",options:n,async fn(r){const{placement:i,rects:o,platform:a,elements:l}=r,{apply:c=(()=>{}),...u}=n,m=await s(r,u),g=t(i),d=e(i);let p,h;\"top\"===g||\"bottom\"===g?(p=g,h=d===(await(null==a.isRTL?void 0:a.isRTL(l.floating))?\"start\":\"end\")?\"left\":\"right\"):(h=g,p=\"end\"===d?\"top\":\"bottom\");const y=f(m.left,0),x=f(m.right,0),w=f(m.top,0),v=f(m.bottom,0),b={availableHeight:o.floating.height-([\"left\",\"right\"].includes(i)?2*(0!==w||0!==v?w+v:f(m.top,m.bottom)):m[p]),availableWidth:o.floating.width-([\"top\",\"bottom\"].includes(i)?2*(0!==y||0!==x?y+x:f(m.left,m.right)):m[h])};await c({...r,...b});const R=await a.getDimensions(l.floating);return o.floating.width!==R.width||o.floating.height!==R.height?{reset:{rects:!0}}:{}}}},E=function(e){return void 0===e&&(e={}),{name:\"inline\",options:e,async fn(r){var i;const{placement:o,elements:s,rects:u,platform:m,strategy:g}=r,{padding:d=2,x:p,y:h}=e,y=l(m.convertOffsetParentRelativeRectToViewportRelativeRect?await m.convertOffsetParentRelativeRectToViewportRelativeRect({rect:u.reference,offsetParent:await(null==m.getOffsetParent?void 0:m.getOffsetParent(s.floating)),strategy:g}):u.reference),x=null!=(i=await(null==m.getClientRects?void 0:m.getClientRects(s.reference)))?i:[],w=a(d);const v=await m.getElementRects({reference:{getBoundingClientRect:function(){var e;if(2===x.length&&x[0].left>x[1].right&&null!=p&&null!=h)return null!=(e=x.find((t=>p>t.left-w.left&&pt.top-w.top&&h=2){if(\"x\"===n(o)){const e=x[0],n=x[x.length-1],r=\"top\"===t(o),i=e.top,a=n.bottom,l=r?e.left:n.left,s=r?e.right:n.right;return{top:i,bottom:a,left:l,right:s,width:s-l,height:a-i,x:l,y:i}}const e=\"left\"===t(o),r=f(...x.map((t=>t.right))),i=c(...x.map((t=>t.left))),a=x.filter((t=>e?t.left===i:t.right===r)),l=a[0].top,s=a[a.length-1].bottom;return{top:l,bottom:s,left:i,right:r,width:r-i,height:s-l,x:i,y:l}}return y}},floating:s.floating,strategy:g});return u.reference.x!==v.reference.x||u.reference.y!==v.reference.y||u.reference.width!==v.reference.width||u.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}};export{m as arrow,v as autoPlacement,o as computePosition,s as detectOverflow,b as flip,P as hide,E as inline,D as limitShift,T as offset,l as rectToClientRect,L as shift,k as size};\n","import{rectToClientRect as t,computePosition as e}from\"@floating-ui/core\";export{arrow,autoPlacement,detectOverflow,flip,hide,inline,limitShift,offset,shift,size}from\"@floating-ui/core\";function n(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function o(t){if(null==t)return window;if(!n(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function i(t){return o(t).getComputedStyle(t)}function r(t){return n(t)?\"\":t?(t.nodeName||\"\").toLowerCase():\"\"}function l(){const t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map((t=>t.brand+\"/\"+t.version)).join(\" \"):navigator.userAgent}function c(t){return t instanceof o(t).HTMLElement}function s(t){return t instanceof o(t).Element}function f(t){if(\"undefined\"==typeof ShadowRoot)return!1;return t instanceof o(t).ShadowRoot||t instanceof ShadowRoot}function u(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=i(t);return/auto|scroll|overlay|hidden/.test(e+o+n)&&![\"inline\",\"contents\"].includes(r)}function d(t){return[\"table\",\"td\",\"th\"].includes(r(t))}function a(t){const e=/firefox/i.test(l()),n=i(t),o=n.backdropFilter||n.WebkitBackdropFilter;return\"none\"!==n.transform||\"none\"!==n.perspective||!!o&&\"none\"!==o||e&&\"filter\"===n.willChange||e&&!!n.filter&&\"none\"!==n.filter||[\"transform\",\"perspective\"].some((t=>n.willChange.includes(t)))||[\"paint\",\"layout\",\"strict\",\"content\"].some((t=>{const e=n.contain;return null!=e&&e.includes(t)}))}function h(){return!/^((?!chrome|android).)*safari/i.test(l())}function g(t){return[\"html\",\"body\",\"#document\"].includes(r(t))}const m=Math.min,p=Math.max,w=Math.round;function v(t,e,n){var i,r,l,f;void 0===e&&(e=!1),void 0===n&&(n=!1);const u=t.getBoundingClientRect();let d=1,a=1;e&&c(t)&&(d=t.offsetWidth>0&&w(u.width)/t.offsetWidth||1,a=t.offsetHeight>0&&w(u.height)/t.offsetHeight||1);const g=s(t)?o(t):window,m=!h()&&n,p=(u.left+(m&&null!=(i=null==(r=g.visualViewport)?void 0:r.offsetLeft)?i:0))/d,v=(u.top+(m&&null!=(l=null==(f=g.visualViewport)?void 0:f.offsetTop)?l:0))/a,y=u.width/d,x=u.height/a;return{width:y,height:x,top:v,right:p+y,bottom:v+x,left:p,x:p,y:v}}function y(t){return(e=t,(e instanceof o(e).Node?t.ownerDocument:t.document)||window.document).documentElement;var e}function x(t){return s(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function b(t){return v(y(t)).left+x(t).scrollLeft}function L(t,e,n){const o=c(e),i=y(e),l=v(t,o&&function(t){const e=v(t);return w(e.width)!==t.offsetWidth||w(e.height)!==t.offsetHeight}(e),\"fixed\"===n);let s={scrollLeft:0,scrollTop:0};const f={x:0,y:0};if(o||!o&&\"fixed\"!==n)if((\"body\"!==r(e)||u(i))&&(s=x(e)),c(e)){const t=v(e,!0);f.x=t.x+e.clientLeft,f.y=t.y+e.clientTop}else i&&(f.x=b(i));return{x:l.left+s.scrollLeft-f.x,y:l.top+s.scrollTop-f.y,width:l.width,height:l.height}}function E(t){if(\"html\"===r(t))return t;const e=t.assignedSlot||t.parentNode||(f(t)?t.host:null)||y(t);return f(e)?e.host:e}function R(t){return c(t)&&\"fixed\"!==i(t).position?t.offsetParent:null}function T(t){const e=o(t);let n=R(t);for(;n&&d(n)&&\"static\"===i(n).position;)n=R(n);return n&&(\"html\"===r(n)||\"body\"===r(n)&&\"static\"===i(n).position&&!a(n))?e:n||function(t){let e=E(t);for(;c(e)&&!g(e);){if(a(e))return e;e=E(e)}return null}(t)||e}function W(t){if(c(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=v(t);return{width:e.width,height:e.height}}function H(t){const e=E(t);return g(e)?t.ownerDocument.body:c(e)&&u(e)?e:H(e)}function C(t,e){var n;void 0===e&&(e=[]);const i=H(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),l=o(i),c=r?[l].concat(l.visualViewport||[],u(i)?i:[]):i,s=e.concat(c);return r?s:s.concat(C(c))}function D(e,n,r){return\"viewport\"===n?t(function(t,e){const n=o(t),i=y(t),r=n.visualViewport;let l=i.clientWidth,c=i.clientHeight,s=0,f=0;if(r){l=r.width,c=r.height;const t=h();(t||!t&&\"fixed\"===e)&&(s=r.offsetLeft,f=r.offsetTop)}return{width:l,height:c,x:s,y:f}}(e,r)):s(n)?function(t,e){const n=v(t,!1,\"fixed\"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft;return{top:o,left:i,x:i,y:o,right:i+t.clientWidth,bottom:o+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}(n,r):t(function(t){var e;const n=y(t),o=x(t),r=null==(e=t.ownerDocument)?void 0:e.body,l=p(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),c=p(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0);let s=-o.scrollLeft+b(t);const f=-o.scrollTop;return\"rtl\"===i(r||n).direction&&(s+=p(n.clientWidth,r?r.clientWidth:0)-l),{width:l,height:c,x:s,y:f}}(y(e)))}const S={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:l}=t;const c=\"clippingAncestors\"===n?function(t){let e=C(t).filter((t=>s(t)&&\"body\"!==r(t))),n=t,o=null;for(;s(n)&&!g(n);){const t=i(n);\"static\"===t.position&&o&&[\"absolute\",\"fixed\"].includes(o.position)&&!a(n)?e=e.filter((t=>t!==n)):o=t,n=E(n)}return e}(e):[].concat(n),f=[...c,o],u=f[0],d=f.reduce(((t,n)=>{const o=D(e,n,l);return t.top=p(o.top,t.top),t.right=m(o.right,t.right),t.bottom=m(o.bottom,t.bottom),t.left=p(o.left,t.left),t}),D(e,u,l));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=c(n),l=y(n);if(n===l)return e;let s={scrollLeft:0,scrollTop:0};const f={x:0,y:0};if((i||!i&&\"fixed\"!==o)&&((\"body\"!==r(n)||u(l))&&(s=x(n)),c(n))){const t=v(n,!0);f.x=t.x+n.clientLeft,f.y=t.y+n.clientTop}return{...e,x:e.x-s.scrollLeft+f.x,y:e.y-s.scrollTop+f.y}},isElement:s,getDimensions:W,getOffsetParent:T,getDocumentElement:y,getElementRects:t=>{let{reference:e,floating:n,strategy:o}=t;return{reference:L(e,T(n),o),floating:{...W(n),x:0,y:0}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>\"rtl\"===i(t).direction};function z(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=!0,animationFrame:c=!1}=o,f=i&&!c,u=f||r?[...s(t)?C(t):t.contextElement?C(t.contextElement):[],...C(e)]:[];u.forEach((t=>{f&&t.addEventListener(\"scroll\",n,{passive:!0}),r&&t.addEventListener(\"resize\",n)}));let d,a=null;if(l){let o=!0;a=new ResizeObserver((()=>{o||n(),o=!1})),s(t)&&!c&&a.observe(t),s(t)||!t.contextElement||c||a.observe(t.contextElement),a.observe(e)}let h=c?v(t):null;return c&&function e(){const o=v(t);!h||o.x===h.x&&o.y===h.y&&o.width===h.width&&o.height===h.height||n();h=o,d=requestAnimationFrame(e)}(),n(),()=>{var t;u.forEach((t=>{f&&t.removeEventListener(\"scroll\",n),r&&t.removeEventListener(\"resize\",n)})),null==(t=a)||t.disconnect(),a=null,c&&cancelAnimationFrame(d)}}const A=(t,n,o)=>e(t,n,{platform:S,...o});export{z as autoUpdate,A as computePosition,C as getOverflowAncestors,S as platform};\n","import { useFloating as useFloating$1, offset, detectOverflow, getOverflowAncestors } from '@floating-ui/react-dom';\nexport * from '@floating-ui/react-dom';\nimport * as React from 'react';\nimport { useLayoutEffect, useEffect, useRef } from 'react';\nimport { createPortal, flushSync } from 'react-dom';\nimport { hideOthers } from 'aria-hidden';\n\nvar index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\n\nfunction createPubSub() {\n const map = new Map();\n return {\n emit(event, data) {\n var _map$get;\n\n (_map$get = map.get(event)) == null ? void 0 : _map$get.forEach(handler => handler(data));\n },\n\n on(event, listener) {\n map.set(event, [...(map.get(event) || []), listener]);\n },\n\n off(event, listener) {\n map.set(event, (map.get(event) || []).filter(l => l !== listener));\n }\n\n };\n}\n\nlet serverHandoffComplete = false;\nlet count = 0;\n\nconst genId = () => \"floating-ui-\" + count++;\n\nfunction useFloatingId() {\n const [id, setId] = React.useState(() => serverHandoffComplete ? genId() : undefined);\n index(() => {\n if (id == null) {\n setId(genId());\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, []);\n React.useEffect(() => {\n if (!serverHandoffComplete) {\n serverHandoffComplete = true;\n }\n }, []);\n return id;\n} // `toString()` prevents bundlers from trying to `import { useId } from 'react'`\n\n\nconst useReactId = React[/*#__PURE__*/'useId'.toString()];\n/**\n * Uses React 18's built-in `useId()` when available, or falls back to a\n * slightly less performant (requiring a double render) implementation for\n * earlier React versions.\n * @see https://floating-ui.com/docs/useId\n */\n\nconst useId = useReactId != null ? useReactId : useFloatingId;\n\nconst FloatingNodeContext = /*#__PURE__*/React.createContext(null);\nconst FloatingTreeContext = /*#__PURE__*/React.createContext(null);\nconst useFloatingParentNodeId = () => {\n var _React$useContext$id, _React$useContext;\n\n return (_React$useContext$id = (_React$useContext = React.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) != null ? _React$useContext$id : null;\n};\nconst useFloatingTree = () => React.useContext(FloatingTreeContext);\n/**\n * Registers a node into the floating tree, returning its id.\n */\n\nconst useFloatingNodeId = () => {\n const id = useId();\n const tree = useFloatingTree();\n const parentId = useFloatingParentNodeId();\n index(() => {\n const node = {\n id,\n parentId\n };\n tree == null ? void 0 : tree.addNode(node);\n return () => {\n tree == null ? void 0 : tree.removeNode(node);\n };\n }, [tree, id, parentId]);\n return id;\n};\n/**\n * Provides parent node context for nested floating elements.\n * @see https://floating-ui.com/docs/FloatingTree\n */\n\nconst FloatingNode = _ref => {\n let {\n children,\n id\n } = _ref;\n const parentId = useFloatingParentNodeId();\n return /*#__PURE__*/React.createElement(FloatingNodeContext.Provider, {\n value: React.useMemo(() => ({\n id,\n parentId\n }), [id, parentId])\n }, children);\n};\n/**\n * Provides context for nested floating elements when they are not children of\n * each other on the DOM (i.e. portalled to a common node, rather than their\n * respective parent).\n * @see https://floating-ui.com/docs/FloatingTree\n */\n\nconst FloatingTree = _ref2 => {\n let {\n children\n } = _ref2;\n const nodesRef = React.useRef([]);\n const addNode = React.useCallback(node => {\n nodesRef.current = [...nodesRef.current, node];\n }, []);\n const removeNode = React.useCallback(node => {\n nodesRef.current = nodesRef.current.filter(n => n !== node);\n }, []);\n const events = React.useState(() => createPubSub())[0];\n return /*#__PURE__*/React.createElement(FloatingTreeContext.Provider, {\n value: React.useMemo(() => ({\n nodesRef,\n addNode,\n removeNode,\n events\n }), [nodesRef, addNode, removeNode, events])\n }, children);\n};\n\nfunction getDocument(floating) {\n var _floating$ownerDocume;\n\n return (_floating$ownerDocume = floating == null ? void 0 : floating.ownerDocument) != null ? _floating$ownerDocume : document;\n}\n\nfunction getWindow(value) {\n var _getDocument$defaultV;\n\n return (_getDocument$defaultV = getDocument(value).defaultView) != null ? _getDocument$defaultV : window;\n}\n\nfunction isElement(value) {\n return value ? value instanceof getWindow(value).Element : false;\n}\nfunction isHTMLElement(value) {\n return value ? value instanceof getWindow(value).HTMLElement : false;\n}\n\n// `toString()` prevents bundlers from trying to `import { useInsertionEffect } from 'react'`\nconst useInsertionEffect = React[/*#__PURE__*/'useInsertionEffect'.toString()];\nfunction useEvent(callback) {\n const ref = React.useRef(() => {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error('Cannot call an event handler while rendering.');\n }\n });\n\n if (useInsertionEffect) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useInsertionEffect(() => {\n ref.current = callback;\n });\n } else {\n ref.current = callback;\n }\n\n return React.useCallback(function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return ref.current == null ? void 0 : ref.current(...args);\n }, []);\n}\n\nfunction useFloating(_temp) {\n let {\n open = false,\n onOpenChange: unstable_onOpenChange,\n whileElementsMounted,\n placement,\n middleware,\n strategy,\n nodeId\n } = _temp === void 0 ? {} : _temp;\n const [domReference, setDomReference] = React.useState(null);\n const tree = useFloatingTree();\n const domReferenceRef = React.useRef(null);\n const dataRef = React.useRef({});\n const events = React.useState(() => createPubSub())[0];\n const position = useFloating$1({\n placement,\n middleware,\n strategy,\n whileElementsMounted\n });\n const onOpenChange = useEvent(unstable_onOpenChange);\n const refs = React.useMemo(() => ({ ...position.refs,\n domReference: domReferenceRef\n }), [position.refs]);\n const context = React.useMemo(() => ({ ...position,\n refs,\n dataRef,\n nodeId,\n events,\n open,\n onOpenChange,\n _: {\n domReference\n }\n }), [position, nodeId, events, open, onOpenChange, refs, domReference]);\n index(() => {\n const node = tree == null ? void 0 : tree.nodesRef.current.find(node => node.id === nodeId);\n\n if (node) {\n node.context = context;\n }\n });\n const {\n reference\n } = position;\n const setReference = React.useCallback(node => {\n if (isElement(node) || node === null) {\n context.refs.domReference.current = node;\n setDomReference(node);\n }\n\n reference(node);\n }, [reference, context.refs]);\n return React.useMemo(() => ({ ...position,\n context,\n refs,\n reference: setReference\n }), [position, refs, context, setReference]);\n}\n\nfunction mergeProps(userProps, propsList, elementKey) {\n const map = new Map();\n return { ...(elementKey === 'floating' && {\n tabIndex: -1\n }),\n ...userProps,\n ...propsList.map(value => value ? value[elementKey] : null).concat(userProps).reduce((acc, props) => {\n if (!props) {\n return acc;\n }\n\n Object.entries(props).forEach(_ref => {\n let [key, value] = _ref;\n\n if (key.indexOf('on') === 0) {\n if (!map.has(key)) {\n map.set(key, []);\n }\n\n if (typeof value === 'function') {\n var _map$get;\n\n (_map$get = map.get(key)) == null ? void 0 : _map$get.push(value);\n\n acc[key] = function () {\n var _map$get2;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n (_map$get2 = map.get(key)) == null ? void 0 : _map$get2.forEach(fn => fn(...args));\n };\n }\n } else {\n acc[key] = value;\n }\n });\n return acc;\n }, {})\n };\n}\n\nconst useInteractions = function (propsList) {\n if (propsList === void 0) {\n propsList = [];\n }\n\n // The dependencies are a dynamic array, so we can't use the linter's\n // suggestion to add it to the deps array.\n const deps = propsList;\n const getReferenceProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'reference'), // eslint-disable-next-line react-hooks/exhaustive-deps\n deps);\n const getFloatingProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'floating'), // eslint-disable-next-line react-hooks/exhaustive-deps\n deps);\n const getItemProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'item'), // eslint-disable-next-line react-hooks/exhaustive-deps\n deps);\n return React.useMemo(() => ({\n getReferenceProps,\n getFloatingProps,\n getItemProps\n }), [getReferenceProps, getFloatingProps, getItemProps]);\n};\n\nfunction getChildren(nodes, id) {\n var _nodes$filter;\n\n let allChildren = (_nodes$filter = nodes.filter(node => {\n var _node$context;\n\n return node.parentId === id && ((_node$context = node.context) == null ? void 0 : _node$context.open);\n })) != null ? _nodes$filter : [];\n let currentChildren = allChildren;\n\n while (currentChildren.length) {\n var _nodes$filter2;\n\n currentChildren = (_nodes$filter2 = nodes.filter(node => {\n var _currentChildren;\n\n return (_currentChildren = currentChildren) == null ? void 0 : _currentChildren.some(n => {\n var _node$context2;\n\n return node.parentId === n.id && ((_node$context2 = node.context) == null ? void 0 : _node$context2.open);\n });\n })) != null ? _nodes$filter2 : [];\n allChildren = allChildren.concat(currentChildren);\n }\n\n return allChildren;\n}\n\nfunction isPointInPolygon(point, polygon) {\n const [x, y] = point;\n let isInside = false;\n const length = polygon.length;\n\n for (let i = 0, j = length - 1; i < length; j = i++) {\n const [xi, yi] = polygon[i] || [0, 0];\n const [xj, yj] = polygon[j] || [0, 0];\n const intersect = yi >= y !== yj >= y && x <= (xj - xi) * (y - yi) / (yj - yi) + xi;\n\n if (intersect) {\n isInside = !isInside;\n }\n }\n\n return isInside;\n}\n\nfunction safePolygon(_temp) {\n let {\n restMs = 0,\n buffer = 0.5,\n blockPointerEvents = true,\n debug = null\n } = _temp === void 0 ? {} : _temp;\n let timeoutId;\n let polygonIsDestroyed = false;\n\n const fn = _ref => {\n let {\n x,\n y,\n placement,\n refs,\n onClose,\n nodeId,\n tree,\n leave = false\n } = _ref;\n return function onPointerMove(event) {\n var _refs$domReference$cu, _refs$floating$curren, _refs$floating$curren2;\n\n clearTimeout(timeoutId);\n\n function close() {\n clearTimeout(timeoutId);\n onClose();\n }\n\n if (event.pointerType && event.pointerType !== 'mouse') {\n return;\n }\n\n const {\n clientX,\n clientY\n } = event;\n const target = 'composedPath' in event ? event.composedPath()[0] : event.target;\n const targetNode = target; // If the pointer is over the reference, there is no need to run the logic\n\n if (event.type === 'pointermove' && (_refs$domReference$cu = refs.domReference.current) != null && _refs$domReference$cu.contains(targetNode)) {\n return;\n } // Prevent overlapping floating element from being stuck in an open-close\n // loop: https://github.com/floating-ui/floating-ui/issues/1910\n\n\n if (event.type === 'mouseleave' && isElement(event.relatedTarget) && (_refs$floating$curren = refs.floating.current) != null && _refs$floating$curren.contains(event.relatedTarget)) {\n return;\n } // If any nested child is open, abort.\n\n\n if (tree && getChildren(tree.nodesRef.current, nodeId).some(_ref2 => {\n let {\n context\n } = _ref2;\n return context == null ? void 0 : context.open;\n })) {\n return;\n } // The cursor landed, so we destroy the polygon logic\n\n\n if ((_refs$floating$curren2 = refs.floating.current) != null && _refs$floating$curren2.contains(targetNode) && !leave) {\n polygonIsDestroyed = true;\n return;\n }\n\n if (!refs.domReference.current || !refs.floating.current || placement == null || x == null || y == null) {\n return;\n }\n\n const refRect = refs.domReference.current.getBoundingClientRect();\n const rect = refs.floating.current.getBoundingClientRect();\n const side = placement.split('-')[0];\n const cursorLeaveFromRight = x > rect.right - rect.width / 2;\n const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2; // If the pointer is leaving from the opposite side, the \"buffer\" logic\n // creates a point where the floating element remains open, but should be\n // ignored.\n // A constant of 1 handles floating point rounding errors.\n\n if (side === 'top' && y >= refRect.bottom - 1 || side === 'bottom' && y <= refRect.top + 1 || side === 'left' && x >= refRect.right - 1 || side === 'right' && x <= refRect.left + 1) {\n return close();\n } // Ignore when the cursor is within the rectangular trough between the\n // two elements. Since the triangle is created from the cursor point,\n // which can start beyond the ref element's edge, traversing back and\n // forth from the ref to the floating element can cause it to close. This\n // ensures it always remains open in that case.\n\n\n switch (side) {\n case 'top':\n if (clientX >= rect.left && clientX <= rect.right && clientY >= rect.top && clientY <= refRect.top + 1) {\n return;\n }\n\n break;\n\n case 'bottom':\n if (clientX >= rect.left && clientX <= rect.right && clientY >= refRect.bottom - 1 && clientY <= rect.bottom) {\n return;\n }\n\n break;\n\n case 'left':\n if (clientX >= rect.left && clientX <= refRect.left + 1 && clientY >= rect.top && clientY <= rect.bottom) {\n return;\n }\n\n break;\n\n case 'right':\n if (clientX >= refRect.right - 1 && clientX <= rect.right && clientY >= rect.top && clientY <= rect.bottom) {\n return;\n }\n\n break;\n }\n\n if (polygonIsDestroyed) {\n return close();\n }\n\n function getPolygon(_ref3) {\n let [x, y] = _ref3;\n const isFloatingWider = rect.width > refRect.width;\n const isFloatingTaller = rect.height > refRect.height;\n\n switch (side) {\n case 'top':\n {\n const cursorPointOne = [isFloatingWider ? x + buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y + buffer + 1];\n const cursorPointTwo = [isFloatingWider ? x - buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y + buffer + 1];\n const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.bottom - buffer : isFloatingWider ? rect.bottom - buffer : rect.top], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.bottom - buffer : rect.top : rect.bottom - buffer]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n\n case 'bottom':\n {\n const cursorPointOne = [isFloatingWider ? x + buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y - buffer];\n const cursorPointTwo = [isFloatingWider ? x - buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y - buffer];\n const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.top + buffer : isFloatingWider ? rect.top + buffer : rect.bottom], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.top + buffer : rect.bottom : rect.top + buffer]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n\n case 'left':\n {\n const cursorPointOne = [x + buffer + 1, isFloatingTaller ? y + buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const cursorPointTwo = [x + buffer + 1, isFloatingTaller ? y - buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const commonPoints = [[cursorLeaveFromBottom ? rect.right - buffer : isFloatingTaller ? rect.right - buffer : rect.left, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.right - buffer : rect.left : rect.right - buffer, rect.bottom]];\n return [...commonPoints, cursorPointOne, cursorPointTwo];\n }\n\n case 'right':\n {\n const cursorPointOne = [x - buffer, isFloatingTaller ? y + buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const cursorPointTwo = [x - buffer, isFloatingTaller ? y - buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const commonPoints = [[cursorLeaveFromBottom ? rect.left + buffer : isFloatingTaller ? rect.left + buffer : rect.right, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.left + buffer : rect.right : rect.left + buffer, rect.bottom]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n }\n }\n\n const poly = getPolygon([x, y]);\n\n if (process.env.NODE_ENV !== \"production\") {\n debug == null ? void 0 : debug(poly.slice(0, 4).join(', '));\n }\n\n if (!isPointInPolygon([clientX, clientY], poly)) {\n close();\n } else if (restMs) {\n timeoutId = setTimeout(onClose, restMs);\n }\n };\n };\n\n fn.__options = {\n blockPointerEvents\n };\n return fn;\n}\n\nconst DEFAULT_ID = 'floating-ui-root';\nconst useFloatingPortalNode = function (_temp) {\n let {\n id = DEFAULT_ID,\n enabled = true\n } = _temp === void 0 ? {} : _temp;\n const [portalEl, setPortalEl] = React.useState(null);\n index(() => {\n if (!enabled) {\n return;\n }\n\n const rootNode = document.getElementById(id);\n\n if (rootNode) {\n setPortalEl(rootNode);\n } else {\n const newPortalEl = document.createElement('div');\n newPortalEl.id = id;\n setPortalEl(newPortalEl);\n\n if (!document.body.contains(newPortalEl)) {\n document.body.appendChild(newPortalEl);\n }\n }\n }, [id, enabled]);\n return portalEl;\n};\n/**\n * Portals your floating element outside of the main app node.\n * @see https://floating-ui.com/docs/FloatingPortal\n */\n\nconst FloatingPortal = _ref => {\n let {\n children,\n id = DEFAULT_ID,\n root = null\n } = _ref;\n const portalNode = useFloatingPortalNode({\n id,\n enabled: !root\n });\n\n if (root) {\n return /*#__PURE__*/createPortal(children, root);\n }\n\n if (portalNode) {\n return /*#__PURE__*/createPortal(children, portalNode);\n }\n\n return null;\n};\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\n// Avoid Chrome DevTools blue warning\nfunction getPlatform() {\n const uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.platform) {\n return uaData.platform;\n }\n\n return navigator.platform;\n}\nfunction getUserAgent() {\n const uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands) {\n return uaData.brands.map(_ref => {\n let {\n brand,\n version\n } = _ref;\n return brand + \"/\" + version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}\n\nconst identifier = 'data-floating-ui-scroll-lock';\n/**\n * Provides base styling for a fixed overlay element to dim content or block\n * pointer events behind a floating element.\n * It's a regular `
`, so it can be styled via any CSS solution you prefer.\n * @see https://floating-ui.com/docs/FloatingOverlay\n */\n\nconst FloatingOverlay = /*#__PURE__*/React.forwardRef(function FloatingOverlay(_ref, ref) {\n let {\n lockScroll = false,\n ...rest\n } = _ref;\n index(() => {\n var _window$visualViewpor, _window$visualViewpor2, _window$visualViewpor3, _window$visualViewpor4;\n\n if (!lockScroll) {\n return;\n }\n\n const alreadyLocked = document.body.hasAttribute(identifier);\n\n if (alreadyLocked) {\n return;\n }\n\n document.body.setAttribute(identifier, ''); // RTL scrollbar\n\n const scrollbarX = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft;\n const paddingProp = scrollbarX ? 'paddingLeft' : 'paddingRight';\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth; // Only iOS doesn't respect `overflow: hidden` on document.body, and this\n // technique has fewer side effects.\n\n if (!/iP(hone|ad|od)|iOS/.test(getPlatform())) {\n Object.assign(document.body.style, {\n overflow: 'hidden',\n [paddingProp]: scrollbarWidth + \"px\"\n });\n return () => {\n document.body.removeAttribute(identifier);\n Object.assign(document.body.style, {\n overflow: '',\n [paddingProp]: ''\n });\n };\n } // iOS 12 does not support `visuaViewport`.\n\n\n const offsetLeft = (_window$visualViewpor = (_window$visualViewpor2 = window.visualViewport) == null ? void 0 : _window$visualViewpor2.offsetLeft) != null ? _window$visualViewpor : 0;\n const offsetTop = (_window$visualViewpor3 = (_window$visualViewpor4 = window.visualViewport) == null ? void 0 : _window$visualViewpor4.offsetTop) != null ? _window$visualViewpor3 : 0;\n const scrollX = window.pageXOffset;\n const scrollY = window.pageYOffset;\n Object.assign(document.body.style, {\n position: 'fixed',\n overflow: 'hidden',\n top: -(scrollY - Math.floor(offsetTop)) + \"px\",\n left: -(scrollX - Math.floor(offsetLeft)) + \"px\",\n right: '0',\n [paddingProp]: scrollbarWidth + \"px\"\n });\n return () => {\n Object.assign(document.body.style, {\n position: '',\n overflow: '',\n top: '',\n left: '',\n right: '',\n [paddingProp]: ''\n });\n document.body.removeAttribute(identifier);\n window.scrollTo(scrollX, scrollY);\n };\n }, [lockScroll]);\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n ref: ref\n }, rest, {\n style: {\n position: 'fixed',\n overflow: 'auto',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...rest.style\n }\n }));\n});\n\n/**\n * Find the real active element. Traverses into shadowRoots.\n */\nfunction activeElement(doc) {\n let activeElement = doc.activeElement;\n\n while (((_activeElement = activeElement) == null ? void 0 : (_activeElement$shadow = _activeElement.shadowRoot) == null ? void 0 : _activeElement$shadow.activeElement) != null) {\n var _activeElement, _activeElement$shadow;\n\n activeElement = activeElement.shadowRoot.activeElement;\n }\n\n return activeElement;\n}\n\nfunction getAncestors(nodes, id) {\n var _nodes$find;\n\n let allAncestors = [];\n let currentParentId = (_nodes$find = nodes.find(node => node.id === id)) == null ? void 0 : _nodes$find.parentId;\n\n while (currentParentId) {\n const currentNode = nodes.find(node => node.id === currentParentId);\n currentParentId = currentNode == null ? void 0 : currentNode.parentId;\n\n if (currentNode) {\n allAncestors = allAncestors.concat(currentNode);\n }\n }\n\n return allAncestors;\n}\n\nfunction getTarget(event) {\n if ('composedPath' in event) {\n return event.composedPath()[0];\n } // TS thinks `event` is of type never as it assumes all browsers support\n // `composedPath()`, but browsers without shadow DOM don't.\n\n\n return event.target;\n}\n\nconst TYPEABLE_SELECTOR = \"input:not([type='hidden']):not([disabled]),\" + \"[contenteditable]:not([contenteditable='false']),textarea:not([disabled])\";\nfunction isTypeableElement(element) {\n return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);\n}\n\nfunction stopEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\n\nfunction useLatestRef(value) {\n const ref = useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\n\nfunction focus(el, preventScroll) {\n if (preventScroll === void 0) {\n preventScroll = false;\n }\n\n // `mousedown` clicks occur before `focus`, so the button will steal the\n // focus unless we wait a frame.\n requestAnimationFrame(() => {\n el == null ? void 0 : el.focus({\n preventScroll\n });\n });\n}\n\nconst SELECTOR = 'select:not([disabled]),a[href],button:not([disabled]),[tabindex],' + 'iframe,object,embed,area[href],audio[controls],video[controls],' + TYPEABLE_SELECTOR;\nconst FocusGuard = /*#__PURE__*/React.forwardRef(function FocusGuard(props, ref) {\n return /*#__PURE__*/React.createElement(\"span\", _extends({}, props, {\n ref: ref,\n tabIndex: 0,\n style: {\n position: 'fixed',\n opacity: '0',\n pointerEvents: 'none',\n outline: '0'\n }\n }));\n});\n\n/**\n * Provides focus management for the floating element.\n * @see https://floating-ui.com/docs/FloatingFocusManager\n */\nfunction FloatingFocusManager(_ref) {\n let {\n context: {\n refs,\n nodeId,\n onOpenChange,\n dataRef,\n events\n },\n children,\n order = ['content'],\n endGuard = true,\n initialFocus = 0,\n returnFocus = true,\n modal = true\n } = _ref;\n const orderRef = useLatestRef(order);\n const tree = useFloatingTree();\n const didFocusOutRef = React.useRef(false);\n const getTabbableElements = React.useCallback(() => {\n return orderRef.current.map(type => {\n if (type === 'reference') {\n return refs.domReference.current;\n }\n\n if (refs.floating.current && type === 'floating') {\n return refs.floating.current;\n }\n\n if (type === 'content') {\n var _refs$floating$curren, _refs$floating$curren2;\n\n return Array.from((_refs$floating$curren = (_refs$floating$curren2 = refs.floating.current) == null ? void 0 : _refs$floating$curren2.querySelectorAll(SELECTOR)) != null ? _refs$floating$curren : []);\n }\n\n return null;\n }).flat().filter(el => {\n if (el === refs.floating.current || el === refs.domReference.current) {\n return true;\n }\n\n if (isHTMLElement(el)) {\n var _el$getAttribute;\n\n const tabIndex = (_el$getAttribute = el.getAttribute('tabindex')) != null ? _el$getAttribute : '0';\n return tabIndex[0].trim() !== '-';\n }\n });\n }, [orderRef, refs]);\n React.useEffect(() => {\n if (!modal) {\n return;\n } // If the floating element has no focusable elements inside it, fallback\n // to focusing the floating element and preventing tab navigation\n\n\n const noTabbableContentElements = getTabbableElements().filter(el => el !== refs.floating.current && el !== refs.domReference.current).length === 0;\n\n function onKeyDown(event) {\n if (event.key === 'Tab') {\n if (noTabbableContentElements) {\n stopEvent(event);\n }\n\n const els = getTabbableElements();\n const target = getTarget(event);\n\n if (orderRef.current[0] === 'reference' && target === refs.domReference.current) {\n stopEvent(event);\n\n if (event.shiftKey) {\n focus(els[els.length - 1]);\n } else {\n focus(els[1]);\n }\n }\n\n if (orderRef.current[1] === 'floating' && target === refs.floating.current && event.shiftKey) {\n stopEvent(event);\n focus(els[0]);\n }\n }\n }\n\n const doc = getDocument(refs.floating.current);\n doc.addEventListener('keydown', onKeyDown);\n return () => {\n doc.removeEventListener('keydown', onKeyDown);\n };\n }, [modal, getTabbableElements, orderRef, refs]);\n React.useEffect(() => {\n let isPointerDown = false;\n\n function onFocusOut(event) {\n var _refs$floating$curren3, _getAncestors;\n\n const relatedTarget = event.relatedTarget;\n const focusMovedOutsideFloating = !((_refs$floating$curren3 = refs.floating.current) != null && _refs$floating$curren3.contains(relatedTarget));\n const focusMovedOutsideReference = isElement(refs.domReference.current) && !refs.domReference.current.contains(relatedTarget);\n const isChildOpen = tree && getChildren(tree.nodesRef.current, nodeId).length > 0;\n const isParentRelated = tree && event.currentTarget === refs.domReference.current && ((_getAncestors = getAncestors(tree.nodesRef.current, nodeId)) == null ? void 0 : _getAncestors.some(node => {\n var _node$context, _node$context$refs$fl;\n\n return (_node$context = node.context) == null ? void 0 : (_node$context$refs$fl = _node$context.refs.floating.current) == null ? void 0 : _node$context$refs$fl.contains(relatedTarget);\n }));\n\n if (focusMovedOutsideFloating && focusMovedOutsideReference && !isChildOpen && !isParentRelated && !isPointerDown) {\n if (relatedTarget) {\n didFocusOutRef.current = true;\n }\n\n onOpenChange(false);\n }\n }\n\n function onPointerDown() {\n // In Safari, buttons *lose* focus when pressing them. This causes the\n // reference `focusout` to fire, which closes the floating element.\n isPointerDown = true;\n setTimeout(() => {\n isPointerDown = false;\n });\n }\n\n const floating = refs.floating.current;\n const reference = refs.domReference.current;\n\n if (floating && isHTMLElement(reference)) {\n if (!modal) {\n floating.addEventListener('focusout', onFocusOut);\n reference.addEventListener('focusout', onFocusOut);\n reference.addEventListener('pointerdown', onPointerDown);\n }\n\n let cleanup;\n\n if (modal) {\n if (orderRef.current.includes('reference')) {\n cleanup = hideOthers([reference, floating]);\n } else {\n cleanup = hideOthers(floating);\n }\n }\n\n return () => {\n if (!modal) {\n floating.removeEventListener('focusout', onFocusOut);\n reference.removeEventListener('focusout', onFocusOut);\n reference.removeEventListener('pointerdown', onPointerDown);\n }\n\n cleanup == null ? void 0 : cleanup();\n };\n }\n }, [nodeId, tree, modal, onOpenChange, orderRef, dataRef, getTabbableElements, refs]);\n React.useEffect(() => {\n const floating = refs.floating.current;\n const doc = getDocument(floating);\n let returnFocusValue = returnFocus;\n let preventReturnFocusScroll = false;\n let previouslyFocusedElement = activeElement(doc);\n\n if (previouslyFocusedElement === doc.body && refs.domReference.current) {\n previouslyFocusedElement = refs.domReference.current;\n }\n\n if (typeof initialFocus === 'number') {\n var _getTabbableElements$;\n\n const el = (_getTabbableElements$ = getTabbableElements()[initialFocus]) != null ? _getTabbableElements$ : floating;\n focus(el, el === floating);\n } else if (isHTMLElement(initialFocus.current)) {\n var _initialFocus$current;\n\n const el = (_initialFocus$current = initialFocus.current) != null ? _initialFocus$current : floating;\n focus(el, el === floating);\n } // Dismissing via outside press should always ignore `returnFocus` to\n // prevent unwanted scrolling.\n\n\n function onDismiss(allowReturnFocus) {\n if (allowReturnFocus === void 0) {\n allowReturnFocus = false;\n }\n\n if (typeof allowReturnFocus === 'object') {\n returnFocusValue = true;\n preventReturnFocusScroll = allowReturnFocus.preventScroll;\n } else {\n returnFocusValue = allowReturnFocus;\n }\n }\n\n events.on('dismiss', onDismiss);\n return () => {\n events.off('dismiss', onDismiss);\n\n if (returnFocusValue && isHTMLElement(previouslyFocusedElement) && !didFocusOutRef.current) {\n focus(previouslyFocusedElement, preventReturnFocusScroll);\n }\n };\n }, [getTabbableElements, initialFocus, returnFocus, refs, events]);\n\n const isTypeableCombobox = () => {\n var _refs$domReference$cu;\n\n return ((_refs$domReference$cu = refs.domReference.current) == null ? void 0 : _refs$domReference$cu.getAttribute('role')) === 'combobox' && isTypeableElement(refs.domReference.current);\n };\n\n return /*#__PURE__*/React.createElement(React.Fragment, null, modal && /*#__PURE__*/React.createElement(FocusGuard, {\n onFocus: event => {\n if (isTypeableCombobox()) {\n return;\n }\n\n stopEvent(event);\n const els = getTabbableElements();\n\n if (order[0] === 'reference') {\n focus(els[0]);\n } else {\n focus(els[els.length - 1]);\n }\n }\n }), /*#__PURE__*/React.cloneElement(children, order.includes('floating') ? {\n tabIndex: 0\n } : {}), modal && endGuard && /*#__PURE__*/React.createElement(FocusGuard, {\n onFocus: event => {\n if (isTypeableCombobox()) {\n return;\n }\n\n stopEvent(event);\n focus(getTabbableElements()[0]);\n }\n }));\n}\n\nfunction usePrevious(value) {\n const ref = useRef();\n index(() => {\n ref.current = value;\n }, [value]);\n return ref.current;\n}\n\nfunction getDelay(value, prop, pointerType) {\n if (pointerType && pointerType !== 'mouse') {\n return 0;\n }\n\n if (typeof value === 'number') {\n return value;\n }\n\n return value == null ? void 0 : value[prop];\n}\n\n/**\n * Adds hover event listeners that change the open state, like CSS :hover.\n * @see https://floating-ui.com/docs/useHover\n */\nconst useHover = function (context, _temp) {\n let {\n enabled = true,\n delay = 0,\n handleClose = null,\n mouseOnly = false,\n restMs = 0,\n move = true\n } = _temp === void 0 ? {} : _temp;\n const {\n open,\n onOpenChange,\n dataRef,\n events,\n refs,\n _\n } = context;\n const tree = useFloatingTree();\n const parentId = useFloatingParentNodeId();\n const handleCloseRef = useLatestRef(handleClose);\n const delayRef = useLatestRef(delay);\n const previousOpen = usePrevious(open);\n const pointerTypeRef = React.useRef();\n const timeoutRef = React.useRef();\n const handlerRef = React.useRef();\n const restTimeoutRef = React.useRef();\n const blockMouseMoveRef = React.useRef(true);\n const performedPointerEventsMutationRef = React.useRef(false);\n const isHoverOpen = React.useCallback(() => {\n var _dataRef$current$open;\n\n const type = (_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type;\n return (type == null ? void 0 : type.includes('mouse')) && type !== 'mousedown';\n }, [dataRef]);\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n\n function onDismiss() {\n clearTimeout(timeoutRef.current);\n clearTimeout(restTimeoutRef.current);\n blockMouseMoveRef.current = true;\n }\n\n events.on('dismiss', onDismiss);\n return () => {\n events.off('dismiss', onDismiss);\n };\n }, [enabled, events, refs]);\n React.useEffect(() => {\n if (!enabled || !handleCloseRef.current) {\n return;\n }\n\n function onLeave() {\n if (isHoverOpen()) {\n onOpenChange(false);\n }\n }\n\n const html = getDocument(refs.floating.current).documentElement;\n html.addEventListener('mouseleave', onLeave);\n return () => {\n html.removeEventListener('mouseleave', onLeave);\n };\n }, [refs, onOpenChange, enabled, handleCloseRef, dataRef, isHoverOpen]);\n const closeWithDelay = React.useCallback(function (runElseBranch) {\n if (runElseBranch === void 0) {\n runElseBranch = true;\n }\n\n const closeDelay = getDelay(delayRef.current, 'close', pointerTypeRef.current);\n\n if (closeDelay && !handlerRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = setTimeout(() => onOpenChange(false), closeDelay);\n } else if (runElseBranch) {\n clearTimeout(timeoutRef.current);\n onOpenChange(false);\n }\n }, [delayRef, onOpenChange]);\n const cleanupPointerMoveHandler = React.useCallback(() => {\n if (handlerRef.current) {\n getDocument(refs.floating.current).removeEventListener('pointermove', handlerRef.current);\n handlerRef.current = undefined;\n }\n }, [refs]);\n const clearPointerEvents = React.useCallback(() => {\n getDocument(refs.floating.current).body.style.pointerEvents = '';\n performedPointerEventsMutationRef.current = false;\n }, [refs]); // Registering the mouse events on the reference directly to bypass React's\n // delegation system. If the cursor was on a disabled element and then entered\n // the reference (no gap), `mouseenter` doesn't fire in the delegation system.\n\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n\n function isClickLikeOpenEvent() {\n return dataRef.current.openEvent ? ['click', 'mousedown'].includes(dataRef.current.openEvent.type) : false;\n }\n\n function onMouseEnter(event) {\n clearTimeout(timeoutRef.current);\n blockMouseMoveRef.current = false;\n\n if (mouseOnly && pointerTypeRef.current !== 'mouse' || restMs > 0 && getDelay(delayRef.current, 'open') === 0) {\n return;\n }\n\n dataRef.current.openEvent = event;\n const openDelay = getDelay(delayRef.current, 'open', pointerTypeRef.current);\n\n if (openDelay) {\n timeoutRef.current = setTimeout(() => {\n onOpenChange(true);\n }, openDelay);\n } else {\n onOpenChange(true);\n }\n }\n\n function onMouseLeave(event) {\n if (isClickLikeOpenEvent()) {\n return;\n }\n\n const doc = getDocument(refs.floating.current);\n clearTimeout(restTimeoutRef.current);\n\n if (handleCloseRef.current) {\n clearTimeout(timeoutRef.current);\n handlerRef.current && doc.removeEventListener('pointermove', handlerRef.current);\n handlerRef.current = handleCloseRef.current({ ...context,\n tree,\n x: event.clientX,\n y: event.clientY,\n\n onClose() {\n clearPointerEvents();\n cleanupPointerMoveHandler();\n closeWithDelay();\n }\n\n });\n doc.addEventListener('pointermove', handlerRef.current);\n return;\n }\n\n closeWithDelay();\n } // Ensure the floating element closes after scrolling even if the pointer\n // did not move.\n // https://github.com/floating-ui/floating-ui/discussions/1692\n\n\n function onScrollMouseLeave(event) {\n if (isClickLikeOpenEvent()) {\n return;\n }\n\n handleCloseRef.current == null ? void 0 : handleCloseRef.current({ ...context,\n tree,\n x: event.clientX,\n y: event.clientY,\n leave: true,\n\n onClose() {\n clearPointerEvents();\n cleanupPointerMoveHandler();\n closeWithDelay();\n }\n\n })(event);\n }\n\n const floating = refs.floating.current;\n const reference = refs.domReference.current;\n\n if (isElement(reference)) {\n open && reference.addEventListener('mouseleave', onScrollMouseLeave);\n floating == null ? void 0 : floating.addEventListener('mouseleave', onScrollMouseLeave);\n move && reference.addEventListener('mousemove', onMouseEnter, {\n once: true\n });\n reference.addEventListener('mouseenter', onMouseEnter);\n reference.addEventListener('mouseleave', onMouseLeave);\n return () => {\n open && reference.removeEventListener('mouseleave', onScrollMouseLeave);\n floating == null ? void 0 : floating.removeEventListener('mouseleave', onScrollMouseLeave);\n move && reference.removeEventListener('mousemove', onMouseEnter);\n reference.removeEventListener('mouseenter', onMouseEnter);\n reference.removeEventListener('mouseleave', onMouseLeave);\n };\n }\n }, [// Ensure the effect is re-run when the reference changes.\n // https://github.com/floating-ui/floating-ui/issues/1833\n _.domReference, enabled, context, mouseOnly, restMs, move, closeWithDelay, cleanupPointerMoveHandler, clearPointerEvents, onOpenChange, open, tree, refs, delayRef, handleCloseRef, dataRef]); // Block pointer-events of every element other than the reference and floating\n // while the floating element is open and has a `handleClose` handler. Also\n // handles nested floating elements.\n // https://github.com/floating-ui/floating-ui/issues/1722\n\n index(() => {\n if (!enabled) {\n return;\n }\n\n if (open && handleCloseRef.current && handleCloseRef.current.__options.blockPointerEvents && isHoverOpen()) {\n getDocument(refs.floating.current).body.style.pointerEvents = 'none';\n performedPointerEventsMutationRef.current = true;\n const reference = refs.domReference.current;\n const floating = refs.floating.current;\n\n if (isElement(reference) && floating) {\n var _tree$nodesRef$curren, _tree$nodesRef$curren2;\n\n const parentFloating = tree == null ? void 0 : (_tree$nodesRef$curren = tree.nodesRef.current.find(node => node.id === parentId)) == null ? void 0 : (_tree$nodesRef$curren2 = _tree$nodesRef$curren.context) == null ? void 0 : _tree$nodesRef$curren2.refs.floating.current;\n\n if (parentFloating) {\n parentFloating.style.pointerEvents = '';\n }\n\n reference.style.pointerEvents = 'auto';\n floating.style.pointerEvents = 'auto';\n return () => {\n reference.style.pointerEvents = '';\n floating.style.pointerEvents = '';\n };\n }\n }\n }, [enabled, open, parentId, refs, tree, handleCloseRef, dataRef, isHoverOpen]);\n index(() => {\n if (previousOpen && !open) {\n pointerTypeRef.current = undefined;\n cleanupPointerMoveHandler();\n clearPointerEvents();\n }\n });\n React.useEffect(() => {\n return () => {\n cleanupPointerMoveHandler();\n clearTimeout(timeoutRef.current);\n clearTimeout(restTimeoutRef.current);\n\n if (performedPointerEventsMutationRef.current) {\n clearPointerEvents();\n }\n };\n }, [enabled, cleanupPointerMoveHandler, clearPointerEvents]);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n\n function setPointerRef(event) {\n pointerTypeRef.current = event.pointerType;\n }\n\n return {\n reference: {\n onPointerDown: setPointerRef,\n onPointerEnter: setPointerRef,\n\n onMouseMove() {\n if (open || restMs === 0) {\n return;\n }\n\n clearTimeout(restTimeoutRef.current);\n restTimeoutRef.current = setTimeout(() => {\n if (!blockMouseMoveRef.current) {\n onOpenChange(true);\n }\n }, restMs);\n }\n\n },\n floating: {\n onMouseEnter() {\n clearTimeout(timeoutRef.current);\n },\n\n onMouseLeave() {\n closeWithDelay(false);\n }\n\n }\n };\n }, [enabled, restMs, open, onOpenChange, closeWithDelay]);\n};\n\nconst FloatingDelayGroupContext = /*#__PURE__*/React.createContext({\n delay: 1000,\n initialDelay: 1000,\n currentId: null,\n setCurrentId: () => {},\n setState: () => {}\n});\nconst useDelayGroupContext = () => React.useContext(FloatingDelayGroupContext);\n/**\n * Provides context for a group of floating elements that should share a\n * `delay`.\n * @see https://floating-ui.com/docs/FloatingDelayGroup\n */\n\nconst FloatingDelayGroup = _ref => {\n let {\n children,\n delay\n } = _ref;\n const [state, setState] = React.useState({\n delay,\n initialDelay: delay,\n currentId: null\n });\n const setCurrentId = React.useCallback(currentId => {\n setState(state => ({ ...state,\n currentId\n }));\n }, []);\n return /*#__PURE__*/React.createElement(FloatingDelayGroupContext.Provider, {\n value: React.useMemo(() => ({ ...state,\n setState,\n setCurrentId\n }), [state, setState, setCurrentId])\n }, children);\n};\nconst useDelayGroup = (_ref2, _ref3) => {\n let {\n open,\n onOpenChange\n } = _ref2;\n let {\n id\n } = _ref3;\n const {\n currentId,\n initialDelay,\n setState\n } = useDelayGroupContext();\n React.useEffect(() => {\n if (currentId) {\n setState(state => ({ ...state,\n delay: {\n open: 1,\n close: getDelay(initialDelay, 'close')\n }\n }));\n\n if (currentId !== id) {\n onOpenChange(false);\n }\n }\n }, [id, onOpenChange, setState, currentId, initialDelay]);\n React.useEffect(() => {\n if (!open && currentId === id) {\n onOpenChange(false);\n setState(state => ({ ...state,\n delay: initialDelay,\n currentId: null\n }));\n }\n }, [open, setState, currentId, id, onOpenChange, initialDelay]);\n};\n\nfunction getArgsWithCustomFloatingHeight(args, height) {\n return { ...args,\n rects: { ...args.rects,\n floating: { ...args.rects.floating,\n height\n }\n }\n };\n}\n\nconst inner = options => ({\n name: 'inner',\n options,\n\n async fn(middlewareArguments) {\n var _scrollRef$current;\n\n const {\n listRef,\n overflowRef,\n onFallbackChange,\n offset: innerOffset = 0,\n index = 0,\n minItemsVisible = 4,\n referenceOverflowThreshold = 0,\n scrollRef,\n ...detectOverflowOptions\n } = options;\n const {\n rects,\n elements: {\n floating\n }\n } = middlewareArguments;\n const item = listRef.current[index];\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!middlewareArguments.placement.startsWith('bottom')) {\n console.warn(['Floating UI: `placement` side must be \"bottom\" when using the', '`inner` middleware.'].join(' '));\n }\n }\n\n if (!item) {\n return {};\n }\n\n const nextArgs = { ...middlewareArguments,\n ...(await offset(-item.offsetTop - rects.reference.height / 2 - item.offsetHeight / 2 - innerOffset).fn(middlewareArguments))\n };\n const el = (_scrollRef$current = scrollRef == null ? void 0 : scrollRef.current) != null ? _scrollRef$current : floating;\n const overflow = await detectOverflow(getArgsWithCustomFloatingHeight(nextArgs, el.scrollHeight), detectOverflowOptions);\n const refOverflow = await detectOverflow(nextArgs, { ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const diffY = Math.max(0, overflow.top);\n const nextY = nextArgs.y + diffY;\n const maxHeight = Math.max(0, el.scrollHeight - diffY - Math.max(0, overflow.bottom));\n el.style.maxHeight = maxHeight + \"px\";\n el.scrollTop = diffY; // There is not enough space, fallback to standard anchored positioning\n\n if (onFallbackChange) {\n if (el.offsetHeight < item.offsetHeight * Math.min(minItemsVisible, listRef.current.length - 1) - 1 || refOverflow.top >= -referenceOverflowThreshold || refOverflow.bottom >= -referenceOverflowThreshold) {\n flushSync(() => onFallbackChange(true));\n } else {\n flushSync(() => onFallbackChange(false));\n }\n }\n\n if (overflowRef) {\n overflowRef.current = await detectOverflow(getArgsWithCustomFloatingHeight({ ...nextArgs,\n y: nextY\n }, el.offsetHeight), detectOverflowOptions);\n }\n\n return {\n y: nextY\n };\n }\n\n});\nconst useInnerOffset = (_ref, _ref2) => {\n let {\n open,\n refs\n } = _ref;\n let {\n enabled = true,\n overflowRef,\n scrollRef,\n onChange: unstable_onChange\n } = _ref2;\n const onChange = useEvent(unstable_onChange);\n const controlledScrollingRef = React.useRef(false);\n const prevScrollTopRef = React.useRef(null);\n const initialOverflowRef = React.useRef(null);\n React.useEffect(() => {\n var _scrollRef$current2;\n\n if (!enabled) {\n return;\n }\n\n function onWheel(e) {\n if (e.ctrlKey || !el || overflowRef.current == null) {\n return;\n }\n\n const dY = e.deltaY;\n const isAtTop = overflowRef.current.top >= -0.5;\n const isAtBottom = overflowRef.current.bottom >= -0.5;\n const remainingScroll = el.scrollHeight - el.clientHeight;\n const sign = dY < 0 ? -1 : 1;\n const method = dY < 0 ? 'max' : 'min';\n\n if (el.scrollHeight <= el.clientHeight) {\n return;\n }\n\n if (!isAtTop && dY > 0 || !isAtBottom && dY < 0) {\n e.preventDefault();\n flushSync(() => {\n onChange(d => d + Math[method](dY, remainingScroll * sign));\n });\n } else if (/firefox/i.test(getUserAgent())) {\n // Needed to propagate scrolling during momentum scrolling phase once\n // it gets limited by the boundary. UX improvement, not critical.\n el.scrollTop += dY;\n }\n }\n\n const el = (_scrollRef$current2 = scrollRef == null ? void 0 : scrollRef.current) != null ? _scrollRef$current2 : refs.floating.current;\n\n if (open && el) {\n el.addEventListener('wheel', onWheel); // Wait for the position to be ready.\n\n requestAnimationFrame(() => {\n prevScrollTopRef.current = el.scrollTop;\n\n if (overflowRef.current != null) {\n initialOverflowRef.current = { ...overflowRef.current\n };\n }\n });\n return () => {\n prevScrollTopRef.current = null;\n initialOverflowRef.current = null;\n el.removeEventListener('wheel', onWheel);\n };\n }\n }, [enabled, open, refs, overflowRef, scrollRef, onChange]);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n\n return {\n floating: {\n onKeyDown() {\n controlledScrollingRef.current = true;\n },\n\n onWheel() {\n controlledScrollingRef.current = false;\n },\n\n onPointerMove() {\n controlledScrollingRef.current = false;\n },\n\n onScroll() {\n const el = refs.floating.current;\n\n if (!overflowRef.current || !el || !controlledScrollingRef.current) {\n return;\n }\n\n if (prevScrollTopRef.current !== null) {\n const scrollDiff = el.scrollTop - prevScrollTopRef.current;\n\n if (overflowRef.current.bottom < -0.5 && scrollDiff < -1 || overflowRef.current.top < -0.5 && scrollDiff > 1) {\n flushSync(() => onChange(d => d + scrollDiff));\n }\n } // [Firefox] Wait for the height change to have been applied.\n\n\n requestAnimationFrame(() => {\n prevScrollTopRef.current = el.scrollTop;\n });\n }\n\n }\n };\n }, [enabled, overflowRef, refs, onChange]);\n};\n\n/**\n * Adds relevant screen reader props for a given element `role`.\n * @see https://floating-ui.com/docs/useRole\n */\nconst useRole = function (_ref, _temp) {\n let {\n open\n } = _ref;\n let {\n enabled = true,\n role = 'dialog'\n } = _temp === void 0 ? {} : _temp;\n const rootId = useId();\n const referenceId = useId();\n return React.useMemo(() => {\n const floatingProps = {\n id: rootId,\n role\n };\n\n if (!enabled) {\n return {};\n }\n\n if (role === 'tooltip') {\n return {\n reference: {\n 'aria-describedby': open ? rootId : undefined\n },\n floating: floatingProps\n };\n }\n\n return {\n reference: {\n 'aria-expanded': open ? 'true' : 'false',\n 'aria-haspopup': role === 'alertdialog' ? 'dialog' : role,\n 'aria-controls': open ? rootId : undefined,\n ...(role === 'listbox' && {\n role: 'combobox'\n }),\n ...(role === 'menu' && {\n id: referenceId\n })\n },\n floating: { ...floatingProps,\n ...(role === 'menu' && {\n 'aria-labelledby': referenceId\n })\n }\n };\n }, [enabled, role, open, rootId, referenceId]);\n};\n\nfunction isButtonTarget(event) {\n return isHTMLElement(event.target) && event.target.tagName === 'BUTTON';\n}\n\nfunction isSpaceIgnored(element) {\n return isTypeableElement(element);\n}\n\n/**\n * Adds click event listeners that change the open state.\n * @see https://floating-ui.com/docs/useClick\n */\nconst useClick = function (_ref, _temp) {\n let {\n open,\n onOpenChange,\n dataRef,\n refs\n } = _ref;\n let {\n enabled = true,\n event: eventOption = 'click',\n toggle = true,\n ignoreMouse = false,\n keyboardHandlers = true\n } = _temp === void 0 ? {} : _temp;\n const pointerTypeRef = React.useRef();\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n\n return {\n reference: {\n onPointerDown(event) {\n pointerTypeRef.current = event.pointerType;\n },\n\n onMouseDown(event) {\n // Ignore all buttons except for the \"main\" button.\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n if (event.button !== 0) {\n return;\n }\n\n if (pointerTypeRef.current === 'mouse' && ignoreMouse) {\n return;\n }\n\n if (eventOption === 'click') {\n return;\n }\n\n if (open) {\n if (toggle && (dataRef.current.openEvent ? dataRef.current.openEvent.type === 'mousedown' : true)) {\n onOpenChange(false);\n }\n } else {\n onOpenChange(true);\n }\n\n dataRef.current.openEvent = event.nativeEvent;\n },\n\n onClick(event) {\n if (eventOption === 'mousedown' && pointerTypeRef.current) {\n pointerTypeRef.current = undefined;\n return;\n }\n\n if (pointerTypeRef.current === 'mouse' && ignoreMouse) {\n return;\n }\n\n if (open) {\n if (toggle && (dataRef.current.openEvent ? dataRef.current.openEvent.type === 'click' : true)) {\n onOpenChange(false);\n }\n } else {\n onOpenChange(true);\n }\n\n dataRef.current.openEvent = event.nativeEvent;\n },\n\n onKeyDown(event) {\n pointerTypeRef.current = undefined;\n\n if (!keyboardHandlers) {\n return;\n }\n\n if (isButtonTarget(event)) {\n return;\n }\n\n if (event.key === ' ' && !isSpaceIgnored(refs.domReference.current)) {\n // Prvent scrolling\n event.preventDefault();\n }\n\n if (event.key === 'Enter') {\n if (open) {\n if (toggle) {\n onOpenChange(false);\n }\n } else {\n onOpenChange(true);\n }\n }\n },\n\n onKeyUp(event) {\n if (!keyboardHandlers) {\n return;\n }\n\n if (isButtonTarget(event) || isSpaceIgnored(refs.domReference.current)) {\n return;\n }\n\n if (event.key === ' ') {\n if (open) {\n if (toggle) {\n onOpenChange(false);\n }\n } else {\n onOpenChange(true);\n }\n }\n }\n\n }\n };\n }, [enabled, dataRef, eventOption, ignoreMouse, keyboardHandlers, refs, toggle, open, onOpenChange]);\n};\n\n/**\n * Check whether the event.target is within the provided node. Uses event.composedPath if available for custom element support.\n *\n * @param event The event whose target/composedPath to check\n * @param node The node to check against\n * @returns Whether the event.target/composedPath is within the node.\n */\nfunction isEventTargetWithin(event, node) {\n if (node == null) {\n return false;\n }\n\n if ('composedPath' in event) {\n return event.composedPath().includes(node);\n } // TS thinks `event` is of type never as it assumes all browsers support composedPath, but browsers without shadow dom don't\n\n\n const e = event;\n return e.target != null && node.contains(e.target);\n}\n\nconst bubbleHandlerKeys = {\n pointerdown: 'onPointerDown',\n mousedown: 'onMouseDown',\n click: 'onClick'\n};\nconst captureHandlerKeys = {\n pointerdown: 'onPointerDownCapture',\n mousedown: 'onMouseDownCapture',\n click: 'onClickCapture'\n};\n\n/**\n * Adds listeners that dismiss (close) the floating element.\n * @see https://floating-ui.com/docs/useDismiss\n */\nconst useDismiss = function (_ref, _temp) {\n let {\n open,\n onOpenChange,\n refs,\n events,\n nodeId\n } = _ref;\n let {\n enabled = true,\n escapeKey = true,\n outsidePress = true,\n outsidePressEvent = 'pointerdown',\n referencePress = false,\n referencePressEvent = 'pointerdown',\n ancestorScroll = false,\n bubbles = true\n } = _temp === void 0 ? {} : _temp;\n const tree = useFloatingTree();\n const nested = useFloatingParentNodeId() != null;\n const insideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n if (!open || !enabled) {\n return;\n }\n\n function onKeyDown(event) {\n if (event.key === 'Escape') {\n if (!bubbles && tree && getChildren(tree.nodesRef.current, nodeId).length > 0) {\n return;\n }\n\n events.emit('dismiss', {\n preventScroll: false\n });\n onOpenChange(false);\n }\n }\n\n function onOutsidePress(event) {\n // Given developers can stop the propagation of the synthetic event,\n // we can only be confident with a positive value.\n const insideReactTree = insideReactTreeRef.current;\n insideReactTreeRef.current = false;\n\n if (insideReactTree) {\n return;\n }\n\n const target = getTarget(event); // Check if the click occurred on the scrollbar\n\n if (isElement(target) && refs.floating.current) {\n var _refs$floating$curren;\n\n const win = (_refs$floating$curren = refs.floating.current.ownerDocument.defaultView) != null ? _refs$floating$curren : window;\n const canScrollX = target.scrollWidth > target.clientWidth;\n const canScrollY = target.scrollHeight > target.clientHeight;\n let xCond = canScrollY && event.offsetX > target.clientWidth; // In some browsers it is possible to change the (or window)\n // scrollbar to the left side, but is very rare and is difficult to\n // check for. Plus, for modal dialogs with backdrops, it is more\n // important that the backdrop is checked but not so much the window.\n\n if (canScrollY) {\n const isRTL = win.getComputedStyle(target).direction === 'rtl';\n\n if (isRTL) {\n xCond = event.offsetX <= target.offsetWidth - target.clientWidth;\n }\n }\n\n if (xCond || canScrollX && event.offsetY > target.clientHeight) {\n return;\n }\n }\n\n const targetIsInsideChildren = tree && getChildren(tree.nodesRef.current, nodeId).some(node => {\n var _node$context;\n\n return isEventTargetWithin(event, (_node$context = node.context) == null ? void 0 : _node$context.refs.floating.current);\n });\n\n if (isEventTargetWithin(event, refs.floating.current) || isEventTargetWithin(event, refs.domReference.current) || targetIsInsideChildren) {\n return;\n }\n\n if (!bubbles && tree && getChildren(tree.nodesRef.current, nodeId).length > 0) {\n return;\n }\n\n events.emit('dismiss', nested ? {\n preventScroll: true\n } : false);\n onOpenChange(false);\n }\n\n function onScroll() {\n onOpenChange(false);\n }\n\n const doc = getDocument(refs.floating.current);\n escapeKey && doc.addEventListener('keydown', onKeyDown);\n outsidePress && doc.addEventListener(outsidePressEvent, onOutsidePress);\n let ancestors = [];\n\n if (ancestorScroll) {\n if (isElement(refs.domReference.current)) {\n ancestors = getOverflowAncestors(refs.domReference.current);\n }\n\n if (isElement(refs.floating.current)) {\n ancestors = ancestors.concat(getOverflowAncestors(refs.floating.current));\n }\n\n if (!isElement(refs.reference.current) && refs.reference.current && // @ts-expect-error is VirtualElement\n refs.reference.current.contextElement) {\n ancestors = ancestors.concat( // @ts-expect-error is VirtualElement\n getOverflowAncestors(refs.reference.current.contextElement));\n }\n } // Ignore the visual viewport for scrolling dismissal (allow pinch-zoom)\n\n\n ancestors = ancestors.filter(ancestor => {\n var _doc$defaultView;\n\n return ancestor !== ((_doc$defaultView = doc.defaultView) == null ? void 0 : _doc$defaultView.visualViewport);\n });\n ancestors.forEach(ancestor => {\n ancestor.addEventListener('scroll', onScroll, {\n passive: true\n });\n });\n return () => {\n escapeKey && doc.removeEventListener('keydown', onKeyDown);\n outsidePress && doc.removeEventListener(outsidePressEvent, onOutsidePress);\n ancestors.forEach(ancestor => {\n ancestor.removeEventListener('scroll', onScroll);\n });\n };\n }, [escapeKey, outsidePress, outsidePressEvent, events, tree, nodeId, open, onOpenChange, ancestorScroll, enabled, bubbles, refs, nested]);\n React.useEffect(() => {\n insideReactTreeRef.current = false;\n }, [outsidePress, outsidePressEvent]);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n\n return {\n reference: {\n [bubbleHandlerKeys[referencePressEvent]]: () => {\n if (referencePress) {\n events.emit('dismiss');\n onOpenChange(false);\n }\n }\n },\n floating: {\n [captureHandlerKeys[outsidePressEvent]]: () => {\n insideReactTreeRef.current = true;\n }\n }\n };\n }, [enabled, events, referencePress, outsidePressEvent, referencePressEvent, onOpenChange]);\n};\n\n/**\n * Adds focus event listeners that change the open state, like CSS :focus.\n * @see https://floating-ui.com/docs/useFocus\n */\nconst useFocus = function (_ref, _temp) {\n let {\n open,\n onOpenChange,\n dataRef,\n refs,\n events\n } = _ref;\n let {\n enabled = true,\n keyboardOnly = true\n } = _temp === void 0 ? {} : _temp;\n const pointerTypeRef = React.useRef('');\n const blockFocusRef = React.useRef(false);\n const timeoutRef = React.useRef();\n React.useEffect(() => {\n var _doc$defaultView;\n\n if (!enabled) {\n return;\n }\n\n const doc = getDocument(refs.floating.current);\n const win = (_doc$defaultView = doc.defaultView) != null ? _doc$defaultView : window;\n\n function onBlur() {\n if (!open && isHTMLElement(refs.domReference.current)) {\n refs.domReference.current.blur();\n }\n }\n\n win.addEventListener('blur', onBlur);\n return () => {\n win.removeEventListener('blur', onBlur);\n };\n }, [refs, open, enabled]);\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n\n function onDismiss() {\n blockFocusRef.current = true;\n }\n\n events.on('dismiss', onDismiss);\n return () => {\n events.off('dismiss', onDismiss);\n };\n }, [events, enabled]);\n React.useEffect(() => {\n return () => {\n clearTimeout(timeoutRef.current);\n };\n }, []);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n\n return {\n reference: {\n onPointerDown(_ref2) {\n let {\n pointerType\n } = _ref2;\n pointerTypeRef.current = pointerType;\n blockFocusRef.current = !!(pointerType && keyboardOnly);\n },\n\n onPointerLeave() {\n blockFocusRef.current = false;\n },\n\n onFocus(event) {\n var _dataRef$current$open, _refs$domReference$cu, _dataRef$current$open2;\n\n if (blockFocusRef.current) {\n return;\n } // Dismiss with click should ignore the subsequent `focus` trigger, but\n // only if the click originated inside the reference element.\n\n\n if (event.type === 'focus' && ((_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type) === 'mousedown' && (_refs$domReference$cu = refs.domReference.current) != null && _refs$domReference$cu.contains((_dataRef$current$open2 = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open2.target)) {\n return;\n }\n\n dataRef.current.openEvent = event.nativeEvent;\n onOpenChange(true);\n },\n\n onBlur(event) {\n const target = event.relatedTarget; // Wait for the window blur listener to fire.\n\n timeoutRef.current = setTimeout(() => {\n var _refs$floating$curren, _refs$domReference$cu2;\n\n // When focusing the reference element (e.g. regular click), then\n // clicking into the floating element, prevent it from hiding.\n // Note: it must be focusable, e.g. `tabindex=\"-1\"`.\n if ((_refs$floating$curren = refs.floating.current) != null && _refs$floating$curren.contains(target) || (_refs$domReference$cu2 = refs.domReference.current) != null && _refs$domReference$cu2.contains(target)) {\n return;\n }\n\n blockFocusRef.current = false;\n onOpenChange(false);\n });\n }\n\n }\n };\n }, [enabled, keyboardOnly, refs, dataRef, onOpenChange]);\n};\n\nconst ARROW_UP = 'ArrowUp';\nconst ARROW_DOWN = 'ArrowDown';\nconst ARROW_LEFT = 'ArrowLeft';\nconst ARROW_RIGHT = 'ArrowRight';\n\nfunction isDifferentRow(index, cols, prevRow) {\n return Math.floor(index / cols) !== prevRow;\n}\n\nfunction isIndexOutOfBounds(listRef, index) {\n return index < 0 || index >= listRef.current.length;\n}\n\nfunction findNonDisabledIndex(listRef, _temp) {\n let {\n startingIndex = -1,\n decrement = false,\n disabledIndices,\n amount = 1\n } = _temp === void 0 ? {} : _temp;\n const list = listRef.current;\n let index = startingIndex;\n\n do {\n var _list$index, _list$index2;\n\n index = index + (decrement ? -amount : amount);\n } while (index >= 0 && index <= list.length - 1 && (disabledIndices ? disabledIndices.includes(index) : list[index] == null || ((_list$index = list[index]) == null ? void 0 : _list$index.hasAttribute('disabled')) || ((_list$index2 = list[index]) == null ? void 0 : _list$index2.getAttribute('aria-disabled')) === 'true'));\n\n return index;\n}\n\nfunction doSwitch(orientation, vertical, horizontal) {\n switch (orientation) {\n case 'vertical':\n return vertical;\n\n case 'horizontal':\n return horizontal;\n\n default:\n return vertical || horizontal;\n }\n}\n\nfunction isMainOrientationKey(key, orientation) {\n const vertical = key === ARROW_UP || key === ARROW_DOWN;\n const horizontal = key === ARROW_LEFT || key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal);\n}\n\nfunction isMainOrientationToEndKey(key, orientation, rtl) {\n const vertical = key === ARROW_DOWN;\n const horizontal = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal) || key === 'Enter' || key == ' ' || key === '';\n}\n\nfunction isCrossOrientationOpenKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n const horizontal = key === ARROW_DOWN;\n return doSwitch(orientation, vertical, horizontal);\n}\n\nfunction isCrossOrientationCloseKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT;\n const horizontal = key === ARROW_UP;\n return doSwitch(orientation, vertical, horizontal);\n}\n\nfunction getMinIndex(listRef, disabledIndices) {\n return findNonDisabledIndex(listRef, {\n disabledIndices\n });\n}\n\nfunction getMaxIndex(listRef, disabledIndices) {\n return findNonDisabledIndex(listRef, {\n decrement: true,\n startingIndex: listRef.current.length,\n disabledIndices\n });\n}\n\n/**\n * Adds focus-managed indexed navigation via arrow keys to a list of items\n * within the floating element.\n * @see https://floating-ui.com/docs/useListNavigation\n */\nconst useListNavigation = function (_ref, _temp2) {\n let {\n open,\n onOpenChange,\n refs\n } = _ref;\n let {\n listRef,\n activeIndex,\n onNavigate: unstable_onNavigate = () => {},\n enabled = true,\n selectedIndex = null,\n allowEscape = false,\n loop = false,\n nested = false,\n rtl = false,\n virtual = false,\n focusItemOnOpen = 'auto',\n focusItemOnHover = true,\n openOnArrowKeyDown = true,\n disabledIndices = undefined,\n orientation = 'vertical',\n cols = 1\n } = _temp2 === void 0 ? {\n listRef: {\n current: []\n },\n activeIndex: null,\n onNavigate: () => {}\n } : _temp2;\n\n if (process.env.NODE_ENV !== \"production\") {\n if (allowEscape) {\n if (!loop) {\n console.warn(['Floating UI: `useListNavigation` looping must be enabled to allow', 'escaping.'].join(' '));\n }\n\n if (!virtual) {\n console.warn(['Floating UI: `useListNavigation` must be virtual to allow', 'escaping.'].join(' '));\n }\n }\n\n if (orientation === 'vertical' && cols > 1) {\n console.warn(['Floating UI: In grid list navigation mode (`cols` > 1), the', '`orientation` should be either \"horizontal\" or \"both\".'].join(' '));\n }\n }\n\n const parentId = useFloatingParentNodeId();\n const tree = useFloatingTree();\n const previousOpen = usePrevious(open);\n const onNavigate = useEvent(unstable_onNavigate);\n const previousOnNavigate = useEvent(usePrevious(unstable_onNavigate));\n const focusItemOnOpenRef = React.useRef(focusItemOnOpen);\n const indexRef = React.useRef(selectedIndex != null ? selectedIndex : -1);\n const keyRef = React.useRef(null);\n const disabledIndicesRef = useLatestRef(disabledIndices);\n const blockPointerLeaveRef = React.useRef(false);\n const frameRef = React.useRef(-1);\n const [activeId, setActiveId] = React.useState();\n const focusItem = React.useCallback((listRef, indexRef) => {\n // `mousedown` clicks occur before `focus`, so the button will steal the\n // focus unless we wait a frame.\n frameRef.current = requestAnimationFrame(() => {\n if (virtual) {\n var _listRef$current$inde;\n\n setActiveId((_listRef$current$inde = listRef.current[indexRef.current]) == null ? void 0 : _listRef$current$inde.id);\n } else {\n var _listRef$current$inde2;\n\n (_listRef$current$inde2 = listRef.current[indexRef.current]) == null ? void 0 : _listRef$current$inde2.focus({\n preventScroll: true\n });\n }\n });\n }, [virtual]); // Sync `selectedIndex` to be the `activeIndex` upon opening the floating\n // element. Also, reset `activeIndex` upon closing the floating element.\n\n index(() => {\n if (!enabled) {\n return;\n }\n\n if (!previousOpen && open && focusItemOnOpenRef.current && selectedIndex != null) {\n onNavigate(selectedIndex);\n } // Unset `activeIndex`. Since the user can specify `onNavigate`\n // conditionally (onNavigate: open ? setActiveIndex : setSelectedIndex)\n // we store and call the previous function\n\n\n if (previousOpen && !open) {\n cancelAnimationFrame(frameRef.current);\n indexRef.current = -1;\n previousOnNavigate(null);\n }\n }, [open, previousOpen, selectedIndex, listRef, focusItem, enabled, onNavigate, previousOnNavigate]); // Sync `activeIndex` to be the focused item while the floating element is\n // open.\n\n index(() => {\n if (!enabled) {\n return;\n }\n\n if (open) {\n if (activeIndex == null) {\n if (selectedIndex != null) {\n return;\n } // Reset while the floating element was open (e.g. the list changed).\n\n\n if (previousOpen) {\n indexRef.current = -1;\n focusItem(listRef, indexRef);\n } // Initial sync\n\n\n if (!previousOpen && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {\n indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, orientation, rtl) || nested ? getMinIndex(listRef, disabledIndicesRef.current) : getMaxIndex(listRef, disabledIndicesRef.current);\n onNavigate(indexRef.current);\n focusItem(listRef, indexRef);\n }\n } else if (!isIndexOutOfBounds(listRef, activeIndex)) {\n indexRef.current = activeIndex;\n focusItem(listRef, indexRef);\n }\n }\n }, [open, previousOpen, activeIndex, selectedIndex, nested, listRef, onNavigate, focusItem, enabled, allowEscape, orientation, rtl, virtual, disabledIndicesRef]); // Ensure the parent floating element has focus when a nested child closes\n // to allow arrow key navigation to work after the pointer leaves the child.\n\n index(() => {\n if (!enabled) {\n return;\n }\n\n if (!open && previousOpen) {\n var _tree$nodesRef$curren, _tree$nodesRef$curren2;\n\n const parentFloating = tree == null ? void 0 : (_tree$nodesRef$curren = tree.nodesRef.current.find(node => node.id === parentId)) == null ? void 0 : (_tree$nodesRef$curren2 = _tree$nodesRef$curren.context) == null ? void 0 : _tree$nodesRef$curren2.refs.floating.current;\n\n if (parentFloating && !parentFloating.contains(activeElement(getDocument(parentFloating)))) {\n parentFloating.focus({\n preventScroll: true\n });\n }\n }\n }, [enabled, open, previousOpen, tree, parentId]);\n index(() => {\n keyRef.current = null;\n });\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n\n const disabledIndices = disabledIndicesRef.current;\n\n function onKeyDown(event) {\n blockPointerLeaveRef.current = true;\n\n if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl)) {\n stopEvent(event);\n onOpenChange(false);\n\n if (isHTMLElement(refs.domReference.current)) {\n refs.domReference.current.focus();\n }\n\n return;\n }\n\n const currentIndex = indexRef.current;\n const minIndex = getMinIndex(listRef, disabledIndices);\n const maxIndex = getMaxIndex(listRef, disabledIndices);\n\n if (event.key === 'Home') {\n indexRef.current = minIndex;\n onNavigate(indexRef.current);\n }\n\n if (event.key === 'End') {\n indexRef.current = maxIndex;\n onNavigate(indexRef.current);\n } // Grid navigation\n\n\n if (cols > 1) {\n const prevIndex = indexRef.current;\n\n if (event.key === ARROW_UP) {\n stopEvent(event);\n\n if (prevIndex === -1) {\n indexRef.current = maxIndex;\n } else {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex,\n amount: cols,\n decrement: true,\n disabledIndices\n });\n\n if (loop && (prevIndex - cols < minIndex || indexRef.current < 0)) {\n const col = prevIndex % cols;\n const maxCol = maxIndex % cols;\n const offset = maxIndex - (maxCol - col);\n\n if (maxCol === col) {\n indexRef.current = maxIndex;\n } else {\n indexRef.current = maxCol > col ? offset : offset - cols;\n }\n }\n }\n\n if (isIndexOutOfBounds(listRef, indexRef.current)) {\n indexRef.current = prevIndex;\n }\n\n onNavigate(indexRef.current);\n }\n\n if (event.key === ARROW_DOWN) {\n stopEvent(event);\n\n if (prevIndex === -1) {\n indexRef.current = minIndex;\n } else {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex,\n amount: cols,\n disabledIndices\n });\n\n if (loop && prevIndex + cols > maxIndex) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex % cols - cols,\n amount: cols,\n disabledIndices\n });\n }\n }\n\n if (isIndexOutOfBounds(listRef, indexRef.current)) {\n indexRef.current = prevIndex;\n }\n\n onNavigate(indexRef.current);\n } // Remains on the same row/column\n\n\n if (orientation === 'both') {\n const prevRow = Math.floor(prevIndex / cols);\n\n if (event.key === ARROW_RIGHT) {\n stopEvent(event);\n\n if (prevIndex % cols !== cols - 1) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex,\n disabledIndices\n });\n\n if (loop && isDifferentRow(indexRef.current, cols, prevRow)) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n }\n } else if (loop) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n }\n\n if (isDifferentRow(indexRef.current, cols, prevRow)) {\n indexRef.current = prevIndex;\n }\n }\n\n if (event.key === ARROW_LEFT) {\n stopEvent(event);\n\n if (prevIndex % cols !== 0) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex,\n disabledIndices,\n decrement: true\n });\n\n if (loop && isDifferentRow(indexRef.current, cols, prevRow)) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n }\n } else if (loop) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n }\n\n if (isDifferentRow(indexRef.current, cols, prevRow)) {\n indexRef.current = prevIndex;\n }\n }\n\n const lastRow = Math.floor(maxIndex / cols) === prevRow;\n\n if (isIndexOutOfBounds(listRef, indexRef.current)) {\n if (loop && lastRow) {\n indexRef.current = event.key === ARROW_LEFT ? maxIndex : findNonDisabledIndex(listRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n } else {\n indexRef.current = prevIndex;\n }\n }\n\n onNavigate(indexRef.current);\n return;\n }\n }\n\n if (isMainOrientationKey(event.key, orientation)) {\n stopEvent(event); // Reset the index if no item is focused.\n\n if (open && !virtual && activeElement(event.currentTarget.ownerDocument) === event.currentTarget) {\n indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;\n onNavigate(indexRef.current);\n return;\n }\n\n if (isMainOrientationToEndKey(event.key, orientation, rtl)) {\n if (loop) {\n indexRef.current = currentIndex >= maxIndex ? allowEscape && currentIndex !== listRef.current.length ? -1 : minIndex : findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n disabledIndices\n });\n } else {\n indexRef.current = Math.min(maxIndex, findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n disabledIndices\n }));\n }\n } else {\n if (loop) {\n indexRef.current = currentIndex <= minIndex ? allowEscape && currentIndex !== -1 ? listRef.current.length : maxIndex : findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n });\n } else {\n indexRef.current = Math.max(minIndex, findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n }));\n }\n }\n\n if (isIndexOutOfBounds(listRef, indexRef.current)) {\n onNavigate(null);\n } else {\n onNavigate(indexRef.current);\n }\n }\n }\n\n return {\n reference: { ...(virtual && open && activeIndex != null && {\n 'aria-activedescendant': activeId\n }),\n\n onKeyDown(event) {\n blockPointerLeaveRef.current = true;\n\n if (virtual && open) {\n return onKeyDown(event);\n }\n\n const isNavigationKey = event.key.indexOf('Arrow') === 0 || event.key === 'Enter' || event.key === ' ' || event.key === '';\n\n if (isNavigationKey) {\n keyRef.current = event.key;\n }\n\n if (nested) {\n if (isCrossOrientationOpenKey(event.key, orientation, rtl)) {\n stopEvent(event);\n\n if (open) {\n indexRef.current = getMinIndex(listRef, disabledIndices);\n onNavigate(indexRef.current);\n } else {\n onOpenChange(true);\n }\n }\n\n return;\n }\n\n if (isMainOrientationKey(event.key, orientation)) {\n if (selectedIndex != null) {\n indexRef.current = selectedIndex;\n }\n\n stopEvent(event);\n\n if (!open && openOnArrowKeyDown) {\n onOpenChange(true);\n } else {\n onKeyDown(event);\n }\n\n if (open) {\n onNavigate(indexRef.current);\n }\n }\n }\n\n },\n floating: {\n 'aria-orientation': orientation === 'both' ? undefined : orientation,\n ...(virtual && activeIndex != null && {\n 'aria-activedescendant': activeId\n }),\n onKeyDown,\n\n onPointerMove() {\n blockPointerLeaveRef.current = false;\n }\n\n },\n item: {\n onFocus(_ref2) {\n let {\n currentTarget\n } = _ref2;\n const index = listRef.current.indexOf(currentTarget);\n\n if (index !== -1) {\n onNavigate(index);\n }\n },\n\n onClick: _ref3 => {\n let {\n currentTarget\n } = _ref3;\n return currentTarget.focus({\n preventScroll: true\n });\n },\n // Safari\n ...(focusItemOnHover && {\n onMouseMove(_ref4) {\n let {\n currentTarget\n } = _ref4;\n const target = currentTarget;\n\n if (target) {\n const index = listRef.current.indexOf(target);\n\n if (index !== -1) {\n onNavigate(index);\n }\n }\n },\n\n onPointerLeave() {\n if (!blockPointerLeaveRef.current) {\n indexRef.current = -1;\n focusItem(listRef, indexRef);\n onNavigate(null);\n\n if (!virtual) {\n requestAnimationFrame(() => {\n var _refs$floating$curren;\n\n (_refs$floating$curren = refs.floating.current) == null ? void 0 : _refs$floating$curren.focus({\n preventScroll: true\n });\n });\n }\n }\n }\n\n })\n }\n };\n }, [activeId, disabledIndicesRef, listRef, enabled, orientation, rtl, virtual, open, activeIndex, nested, selectedIndex, openOnArrowKeyDown, focusItemOnHover, allowEscape, cols, loop, refs, focusItem, onNavigate, onOpenChange]);\n};\n\n/**\n * Provides a matching callback that can be used to focus an item as the user\n * types, often used in tandem with `useListNavigation()`.\n * @see https://floating-ui.com/docs/useTypeahead\n */\nconst useTypeahead = function (_ref, _temp) {\n var _ref2;\n\n let {\n open,\n dataRef\n } = _ref;\n let {\n listRef,\n activeIndex,\n onMatch: unstable_onMatch = () => {},\n enabled = true,\n findMatch = null,\n resetMs = 1000,\n ignoreKeys = [],\n selectedIndex = null\n } = _temp === void 0 ? {\n listRef: {\n current: []\n },\n activeIndex: null\n } : _temp;\n const timeoutIdRef = React.useRef();\n const stringRef = React.useRef('');\n const prevIndexRef = React.useRef((_ref2 = selectedIndex != null ? selectedIndex : activeIndex) != null ? _ref2 : -1);\n const matchIndexRef = React.useRef(null);\n const onMatch = useEvent(unstable_onMatch);\n const findMatchRef = useLatestRef(findMatch);\n const ignoreKeysRef = useLatestRef(ignoreKeys);\n index(() => {\n if (open) {\n clearTimeout(timeoutIdRef.current);\n matchIndexRef.current = null;\n stringRef.current = '';\n }\n }, [open]);\n index(() => {\n // Sync arrow key navigation but not typeahead navigation\n if (open && stringRef.current === '') {\n var _ref3;\n\n prevIndexRef.current = (_ref3 = selectedIndex != null ? selectedIndex : activeIndex) != null ? _ref3 : -1;\n }\n }, [open, selectedIndex, activeIndex]);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n\n function onKeyDown(event) {\n // Correctly scope nested non-portalled floating elements. Since the nested\n // floating element is inside of the another, we find the closest role\n // that indicates the floating element scope.\n const target = getTarget(event.nativeEvent);\n\n if (isElement(target) && (activeElement(getDocument(target)) !== event.currentTarget ? target.closest('[role=\"dialog\"],[role=\"menu\"],[role=\"listbox\"],[role=\"tree\"],[role=\"grid\"]') !== event.currentTarget : false)) {\n return;\n }\n\n if (stringRef.current.length > 0 && stringRef.current[0] !== ' ') {\n dataRef.current.typing = true;\n\n if (event.key === ' ') {\n stopEvent(event);\n }\n }\n\n const listContent = listRef.current;\n\n if (listContent == null || ignoreKeysRef.current.includes(event.key) || // Character key\n event.key.length !== 1 || // Modifier key\n event.ctrlKey || event.metaKey || event.altKey) {\n return;\n } // Bail out if the list contains a word like \"llama\" or \"aaron\". TODO:\n // allow it in this case, too.\n\n\n const allowRapidSuccessionOfFirstLetter = listContent.every(text => {\n var _text$, _text$2;\n\n return text ? ((_text$ = text[0]) == null ? void 0 : _text$.toLocaleLowerCase()) !== ((_text$2 = text[1]) == null ? void 0 : _text$2.toLocaleLowerCase()) : true;\n }); // Allows the user to cycle through items that start with the same letter\n // in rapid succession\n\n if (allowRapidSuccessionOfFirstLetter && stringRef.current === event.key) {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n }\n\n stringRef.current += event.key;\n clearTimeout(timeoutIdRef.current);\n timeoutIdRef.current = setTimeout(() => {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n dataRef.current.typing = false;\n }, resetMs);\n const prevIndex = prevIndexRef.current;\n const orderedList = [...listContent.slice((prevIndex != null ? prevIndex : 0) + 1), ...listContent.slice(0, (prevIndex != null ? prevIndex : 0) + 1)];\n const str = findMatchRef.current ? findMatchRef.current(orderedList, stringRef.current) : orderedList.find(text => (text == null ? void 0 : text.toLocaleLowerCase().indexOf(stringRef.current.toLocaleLowerCase())) === 0);\n const index = str ? listContent.indexOf(str) : -1;\n\n if (index !== -1) {\n onMatch(index);\n matchIndexRef.current = index;\n }\n }\n\n return {\n reference: {\n onKeyDown\n },\n floating: {\n onKeyDown\n }\n };\n }, [enabled, dataRef, listRef, resetMs, ignoreKeysRef, findMatchRef, onMatch]);\n};\n\nexport { FloatingDelayGroup, FloatingFocusManager, FloatingNode, FloatingOverlay, FloatingPortal, FloatingTree, inner, safePolygon, useClick, useDelayGroup, useDelayGroupContext, useDismiss, useFloating, useFloatingNodeId, useFloatingParentNodeId, useFloatingPortalNode, useFloatingTree, useFocus, useHover, useId, useInnerOffset, useInteractions, useListNavigation, useRole, useTypeahead };\n","import { computePosition, arrow as arrow$1 } from '@floating-ui/dom';\nexport * from '@floating-ui/dom';\nimport * as React from 'react';\nimport { useLayoutEffect, useEffect } from 'react';\nimport * as ReactDOM from 'react-dom';\n\nvar index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\n\n// Fork of `fast-deep-equal` that only does the comparisons we need and compares\n// functions\nfunction deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (typeof a !== typeof b) {\n return false;\n }\n\n if (typeof a === 'function' && a.toString() === b.toString()) {\n return true;\n }\n\n let length, i, keys;\n\n if (a && b && typeof a == 'object') {\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n\n for (i = length; i-- !== 0;) {\n if (!deepEqual(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n }\n\n keys = Object.keys(a);\n length = keys.length;\n\n if (length !== Object.keys(b).length) {\n return false;\n }\n\n for (i = length; i-- !== 0;) {\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) {\n return false;\n }\n }\n\n for (i = length; i-- !== 0;) {\n const key = keys[i];\n\n if (key === '_owner' && a.$$typeof) {\n continue;\n }\n\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n return a !== a && b !== b;\n}\n\nfunction useLatestRef(value) {\n const ref = React.useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\n\nfunction useFloating(_temp) {\n let {\n middleware = [],\n placement = 'bottom',\n strategy = 'absolute',\n whileElementsMounted\n } = _temp === void 0 ? {} : _temp;\n const [data, setData] = React.useState({\n // Setting these to `null` will allow the consumer to determine if\n // `computePosition()` has run yet\n x: null,\n y: null,\n strategy,\n placement,\n middlewareData: {}\n });\n const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);\n\n if (!deepEqual(latestMiddleware, middleware)) {\n setLatestMiddleware(middleware);\n }\n\n const reference = React.useRef(null);\n const floating = React.useRef(null);\n const cleanupRef = React.useRef(null);\n const dataRef = React.useRef(data);\n const whileElementsMountedRef = useLatestRef(whileElementsMounted);\n const update = React.useCallback(() => {\n if (!reference.current || !floating.current) {\n return;\n }\n\n computePosition(reference.current, floating.current, {\n middleware: latestMiddleware,\n placement,\n strategy\n }).then(data => {\n if (isMountedRef.current && !deepEqual(dataRef.current, data)) {\n dataRef.current = data;\n ReactDOM.flushSync(() => {\n setData(data);\n });\n }\n });\n }, [latestMiddleware, placement, strategy]);\n index(() => {\n // Skip first update\n if (isMountedRef.current) {\n update();\n }\n }, [update]);\n const isMountedRef = React.useRef(false);\n index(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n const runElementMountCallback = React.useCallback(() => {\n if (typeof cleanupRef.current === 'function') {\n cleanupRef.current();\n cleanupRef.current = null;\n }\n\n if (reference.current && floating.current) {\n if (whileElementsMountedRef.current) {\n const cleanupFn = whileElementsMountedRef.current(reference.current, floating.current, update);\n cleanupRef.current = cleanupFn;\n } else {\n update();\n }\n }\n }, [update, whileElementsMountedRef]);\n const setReference = React.useCallback(node => {\n reference.current = node;\n runElementMountCallback();\n }, [runElementMountCallback]);\n const setFloating = React.useCallback(node => {\n floating.current = node;\n runElementMountCallback();\n }, [runElementMountCallback]);\n const refs = React.useMemo(() => ({\n reference,\n floating\n }), []);\n return React.useMemo(() => ({ ...data,\n update,\n refs,\n reference: setReference,\n floating: setFloating\n }), [data, update, refs, setReference, setFloating]);\n}\n\n/**\n * Positions an inner element of the floating element such that it is centered\n * to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\n\nconst arrow = options => {\n const {\n element,\n padding\n } = options;\n\n function isRef(value) {\n return Object.prototype.hasOwnProperty.call(value, 'current');\n }\n\n return {\n name: 'arrow',\n options,\n\n fn(args) {\n if (isRef(element)) {\n if (element.current != null) {\n return arrow$1({\n element: element.current,\n padding\n }).fn(args);\n }\n\n return {};\n } else if (element) {\n return arrow$1({\n element,\n padding\n }).fn(args);\n }\n\n return {};\n }\n\n };\n};\n\nexport { arrow, useFloating };\n"],"sourceRoot":""}