import{r as s,b as Ie}from"./index.J6jLrAk_.js";import{i as ne,b as Xe,s as ze,o as Je,c as Qe,r as Ae,d as D,g as re,e as et,f as oe,h as tt,j as nt}from"./floating-ui.dom.DMF2X1Sc.js";import{j as Y}from"./jsx-runtime.D_zvdyIk.js";import{G as _}from"./iconBase.CRikWSR1.js";/*! * tabbable 6.2.0 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE */var rt=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],ce=rt.join(","),Me=typeof Element>"u",G=Me?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Q=!Me&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},ee=function t(e,n){var r;n===void 0&&(n=!0);var o=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),i=o===""||o==="true",a=i||n&&e&&t(e.parentNode);return a},ot=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},it=function(e,n,r){if(ee(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(ce));return n&&G.call(e,ce)&&o.unshift(e),o=o.filter(r),o},at=function t(e,n,r){for(var o=[],i=Array.from(e);i.length;){var a=i.shift();if(!ee(a,!1))if(a.tagName==="SLOT"){var u=a.assignedElements(),f=u.length?u:a.children,c=t(f,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:a,candidates:c})}else{var d=G.call(a,ce);d&&r.filter(a)&&(n||!e.includes(a))&&o.push(a);var m=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),b=!ee(m,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(m&&b){var g=t(m===!0?a.children:m.children,!0,r);r.flatten?o.push.apply(o,g):o.push({scopeParent:a,candidates:g})}else i.unshift.apply(i,a.children)}}return o},ke=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},De=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||ot(e))&&!ke(e)?0:e.tabIndex},st=function(e,n){var r=De(e);return r<0&&n&&!ke(e)?0:r},ut=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},Oe=function(e){return e.tagName==="INPUT"},ct=function(e){return Oe(e)&&e.type==="hidden"},lt=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},ft=function(e,n){for(var r=0;rsummary:first-of-type"),a=i?e.parentElement:e;if(G.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var u=e;e;){var f=e.parentElement,c=Q(e);if(f&&!f.shadowRoot&&o(f)===!0)return ge(e);e.assignedSlot?e=e.assignedSlot:!f&&c!==e.ownerDocument?e=c.host:e=f}e=u}if(pt(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return ge(e);return!1},ht=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r=0)},Et=function t(e){var n=[],r=[];return e.forEach(function(o,i){var a=!!o.scopeParent,u=a?o.scopeParent:o,f=st(u,a),c=a?t(o.candidates):u;f===0?a?n.push.apply(n,c):n.push(u):r.push({documentOrder:i,tabIndex:f,item:o,isScope:a,content:c})}),r.sort(ut).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Le=function(e,n){n=n||{};var r;return n.getShadowRoot?r=at([e],n.includeContainer,{filter:pe.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Rt}):r=it(e,n.includeContainer,pe.bind(null,n)),Et(r)};function yt(){return/apple/i.test(navigator.vendor)}const wt="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function xt(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function le(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&Xe(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function U(t){return"composedPath"in t?t.composedPath()[0]:t.target}function ie(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function Ct(t){return t.matches("html,body")}function X(t){return t?.ownerDocument||document}function St(t){return ne(t)&&t.matches(wt)}function z(t,e,n){return n===void 0&&(n=!0),t.filter(o=>{var i;return o.parentId===e&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...z(t,o.id,n)])}function Tt(t){return"nativeEvent"in t}function me(t,e){return["mouse","pen"].includes(t)}var Pt=typeof document<"u",It=function(){},V=Pt?s.useLayoutEffect:It;const At={...Ie},Mt=At.useInsertionEffect,kt=Mt||(t=>t());function W(t){const e=s.useRef(()=>{});return kt(()=>{e.current=t}),s.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Fe(t,e){const n=Le(t,Ne()),r=n.length;if(r===0)return;const o=xt(X(t)),i=n.indexOf(o),a=i===-1?e===1?0:r-1:i+e;return n[a]}function Dt(t){return Fe(X(t).body,1)||t}function Ot(t){return Fe(X(t).body,-1)||t}function ae(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!le(n,r)}function Lt(t){Le(t,Ne()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function he(t){t.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}var Nt=typeof document<"u",Ft=function(){},J=Nt?s.useLayoutEffect:Ft;function te(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!te(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&t.$$typeof)&&!te(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function Be(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function be(t,e){const n=Be(t);return Math.round(e*n)/n}function se(t){const e=s.useRef(t);return J(()=>{e.current=t}),e}function Bt(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:u=!0,whileElementsMounted:f,open:c}=t,[d,m]=s.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[b,g]=s.useState(r);te(b,r)||g(r);const[x,l]=s.useState(null),[R,S]=s.useState(null),C=s.useCallback(h=>{h!==k.current&&(k.current=h,l(h))},[]),E=s.useCallback(h=>{h!==O.current&&(O.current=h,S(h))},[]),T=i||x,I=a||R,k=s.useRef(null),O=s.useRef(null),H=s.useRef(d),L=f!=null,Z=se(f),F=se(o),j=se(c),B=s.useCallback(()=>{if(!k.current||!O.current)return;const h={placement:e,strategy:n,middleware:b};F.current&&(h.platform=F.current),Qe(k.current,O.current,h).then(v=>{const w={...v,isPositioned:j.current!==!1};K.current&&!te(H.current,w)&&(H.current=w,Ae.flushSync(()=>{m(w)}))})},[b,e,n,F,j]);J(()=>{c===!1&&H.current.isPositioned&&(H.current.isPositioned=!1,m(h=>({...h,isPositioned:!1})))},[c]);const K=s.useRef(!1);J(()=>(K.current=!0,()=>{K.current=!1}),[]),J(()=>{if(T&&(k.current=T),I&&(O.current=I),T&&I){if(Z.current)return Z.current(T,I,B);B()}},[T,I,B,Z,L]);const p=s.useMemo(()=>({reference:k,floating:O,setReference:C,setFloating:E}),[C,E]),y=s.useMemo(()=>({reference:T,floating:I}),[T,I]),P=s.useMemo(()=>{const h={position:n,left:0,top:0};if(!y.floating)return h;const v=be(y.floating,d.x),w=be(y.floating,d.y);return u?{...h,transform:"translate("+v+"px, "+w+"px)",...Be(y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:v,top:w}},[n,u,y.floating,d.x,d.y]);return s.useMemo(()=>({...d,update:B,refs:p,elements:y,floatingStyles:P}),[d,B,p,y,P])}const on=(t,e)=>({...Je(t),options:[t,e]}),an=(t,e)=>({...ze(t),options:[t,e]}),$t="data-floating-ui-focusable",Re="active",Ee="selected",Ht={...Ie};let ye=!1,Zt=0;const we=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Zt++;function Kt(){const[t,e]=s.useState(()=>ye?we():void 0);return V(()=>{t==null&&e(we())},[]),s.useEffect(()=>{ye=!0},[]),t}const Vt=Ht.useId,$e=Vt||Kt;function _t(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(o=>o(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var r;(r=t.get(e))==null||r.delete(n)}}}const jt=s.createContext(null),Wt=s.createContext(null),qt=()=>{var t;return((t=s.useContext(jt))==null?void 0:t.id)||null},He=()=>s.useContext(Wt);function fe(t){return"data-floating-ui-"+t}function Ut(t){t.current!==-1&&(clearTimeout(t.current),t.current=-1)}const Ze={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},xe=s.forwardRef(function(e,n){const[r,o]=s.useState();V(()=>{yt()&&o("button")},[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[fe("focus-guard")]:"",style:Ze};return Y.jsx("span",{...e,...i})}),Ke=s.createContext(null),Ce=fe("portal");function Yt(t){t===void 0&&(t={});const{id:e,root:n}=t,r=$e(),o=Gt(),[i,a]=s.useState(null),u=s.useRef(null);return V(()=>()=>{i?.remove(),queueMicrotask(()=>{u.current=null})},[i]),V(()=>{if(!r||u.current)return;const f=e?document.getElementById(e):null;if(!f)return;const c=document.createElement("div");c.id=r,c.setAttribute(Ce,""),f.appendChild(c),u.current=c,a(c)},[e,r]),V(()=>{if(n===null||!r||u.current)return;let f=n||o?.portalNode;f&&!D(f)&&(f=f.current),f=f||document.body;let c=null;e&&(c=document.createElement("div"),c.id=e,f.appendChild(c));const d=document.createElement("div");d.id=r,d.setAttribute(Ce,""),f=c||f,f.appendChild(d),u.current=d,a(d)},[e,n,r,o]),i}function sn(t){const{children:e,id:n,root:r,preserveTabOrder:o=!0}=t,i=Yt({id:n,root:r}),[a,u]=s.useState(null),f=s.useRef(null),c=s.useRef(null),d=s.useRef(null),m=s.useRef(null),b=a?.modal,g=a?.open,x=!!a&&!a.modal&&a.open&&o&&!!(r||i);return s.useEffect(()=>{if(!i||!o||b)return;function l(R){i&&ae(R)&&(R.type==="focusin"?he:Lt)(i)}return i.addEventListener("focusin",l,!0),i.addEventListener("focusout",l,!0),()=>{i.removeEventListener("focusin",l,!0),i.removeEventListener("focusout",l,!0)}},[i,o,b]),s.useEffect(()=>{i&&(g||he(i))},[g,i]),Y.jsxs(Ke.Provider,{value:s.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:f,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:m,portalNode:i,setFocusManagerState:u}),[o,i]),children:[x&&i&&Y.jsx(xe,{"data-type":"outside",ref:f,onFocus:l=>{if(ae(l,i)){var R;(R=d.current)==null||R.focus()}else{const S=a?a.domReference:null,C=Ot(S);C?.focus()}}}),x&&i&&Y.jsx("span",{"aria-owns":i.id,style:Ze}),i&&Ae.createPortal(e,i),x&&i&&Y.jsx(xe,{"data-type":"outside",ref:c,onFocus:l=>{if(ae(l,i)){var R;(R=m.current)==null||R.focus()}else{const S=a?a.domReference:null,C=Dt(S);C?.focus(),a?.closeOnFocusOut&&a?.onOpenChange(!1,l.nativeEvent,"focus-out")}}})]})}const Gt=()=>s.useContext(Ke);function Se(t){return ne(t.target)&&t.target.tagName==="BUTTON"}function Xt(t){return ne(t.target)&&t.target.tagName==="A"}function Te(t){return St(t)}function un(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=t,{enabled:a=!0,event:u="click",toggle:f=!0,ignoreMouse:c=!1,keyboardHandlers:d=!0,stickIfOpen:m=!0}=e,b=s.useRef(),g=s.useRef(!1),x=s.useMemo(()=>({onPointerDown(l){b.current=l.pointerType},onMouseDown(l){const R=b.current;l.button===0&&u!=="click"&&(me(R)&&c||(n&&f&&(!(o.current.openEvent&&m)||o.current.openEvent.type==="mousedown")?r(!1,l.nativeEvent,"click"):(l.preventDefault(),r(!0,l.nativeEvent,"click"))))},onClick(l){const R=b.current;if(u==="mousedown"&&b.current){b.current=void 0;return}me(R)&&c||(n&&f&&(!(o.current.openEvent&&m)||o.current.openEvent.type==="click")?r(!1,l.nativeEvent,"click"):r(!0,l.nativeEvent,"click"))},onKeyDown(l){b.current=void 0,!(l.defaultPrevented||!d||Se(l))&&(l.key===" "&&!Te(i)&&(l.preventDefault(),g.current=!0),!Xt(l)&&l.key==="Enter"&&r(!(n&&f),l.nativeEvent,"click"))},onKeyUp(l){l.defaultPrevented||!d||Se(l)||Te(i)||l.key===" "&&g.current&&(g.current=!1,r(!(n&&f),l.nativeEvent,"click"))}}),[o,i,u,c,d,r,n,m,f]);return s.useMemo(()=>a?{reference:x}:{},[a,x])}const zt={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Jt={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Pe=t=>{var e,n;return{escapeKey:typeof t=="boolean"?t:(e=t?.escapeKey)!=null?e:!1,outsidePress:typeof t=="boolean"?t:(n=t?.outsidePress)!=null?n:!0}};function cn(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=t,{enabled:a=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:m="pointerdown",ancestorScroll:b=!1,bubbles:g,capture:x}=e,l=He(),R=W(typeof f=="function"?f:()=>!1),S=typeof f=="function"?R:f,C=s.useRef(!1),{escapeKey:E,outsidePress:T}=Pe(g),{escapeKey:I,outsidePress:k}=Pe(x),O=s.useRef(!1),H=s.useRef(-1),L=W(p=>{var y;if(!n||!a||!u||p.key!=="Escape"||O.current)return;const P=(y=i.current.floatingContext)==null?void 0:y.nodeId,h=l?z(l.nodesRef.current,P):[];if(!E&&(p.stopPropagation(),h.length>0)){let v=!0;if(h.forEach(w=>{var A;if((A=w.context)!=null&&A.open&&!w.context.dataRef.current.__escapeKeyBubbles){v=!1;return}}),!v)return}r(!1,Tt(p)?p.nativeEvent:p,"escape-key")}),Z=W(p=>{var y;const P=()=>{var h;L(p),(h=U(p))==null||h.removeEventListener("keydown",P)};(y=U(p))==null||y.addEventListener("keydown",P)}),F=W(p=>{var y;const P=i.current.insideReactTree;i.current.insideReactTree=!1;const h=C.current;if(C.current=!1,c==="click"&&h||P||typeof S=="function"&&!S(p))return;const v=U(p),w="["+fe("inert")+"]",A=X(o.floating).querySelectorAll(w);let $=D(v)?v:null;for(;$&&!oe($);){const M=tt($);if(oe(M)||!D(M))break;$=M}if(A.length&&D(v)&&!Ct(v)&&!le(v,o.floating)&&Array.from(A).every(M=>!le($,M)))return;if(ne(v)&&K){const M=oe(v),N=nt(v),q=/auto|scroll/,_e=M||q.test(N.overflowX),je=M||q.test(N.overflowY),We=_e&&v.clientWidth>0&&v.scrollWidth>v.clientWidth,qe=je&&v.clientHeight>0&&v.scrollHeight>v.clientHeight,Ue=N.direction==="rtl",Ye=qe&&(Ue?p.offsetX<=v.offsetWidth-v.clientWidth:p.offsetX>v.clientWidth),Ge=We&&p.offsetY>v.clientHeight;if(Ye||Ge)return}const de=(y=i.current.floatingContext)==null?void 0:y.nodeId,Ve=l&&z(l.nodesRef.current,de).some(M=>{var N;return ie(p,(N=M.context)==null?void 0:N.elements.floating)});if(ie(p,o.floating)||ie(p,o.domReference)||Ve)return;const ve=l?z(l.nodesRef.current,de):[];if(ve.length>0){let M=!0;if(ve.forEach(N=>{var q;if((q=N.context)!=null&&q.open&&!N.context.dataRef.current.__outsidePressBubbles){M=!1;return}}),!M)return}r(!1,p,"outside-press")}),j=W(p=>{var y;const P=()=>{var h;F(p),(h=U(p))==null||h.removeEventListener(c,P)};(y=U(p))==null||y.addEventListener(c,P)});s.useEffect(()=>{if(!n||!a)return;i.current.__escapeKeyBubbles=E,i.current.__outsidePressBubbles=T;let p=-1;function y(A){r(!1,A,"ancestor-scroll")}function P(){window.clearTimeout(p),O.current=!0}function h(){p=window.setTimeout(()=>{O.current=!1},et()?5:0)}const v=X(o.floating);u&&(v.addEventListener("keydown",I?Z:L,I),v.addEventListener("compositionstart",P),v.addEventListener("compositionend",h)),S&&v.addEventListener(c,k?j:F,k);let w=[];return b&&(D(o.domReference)&&(w=re(o.domReference)),D(o.floating)&&(w=w.concat(re(o.floating))),!D(o.reference)&&o.reference&&o.reference.contextElement&&(w=w.concat(re(o.reference.contextElement)))),w=w.filter(A=>{var $;return A!==(($=v.defaultView)==null?void 0:$.visualViewport)}),w.forEach(A=>{A.addEventListener("scroll",y,{passive:!0})}),()=>{u&&(v.removeEventListener("keydown",I?Z:L,I),v.removeEventListener("compositionstart",P),v.removeEventListener("compositionend",h)),S&&v.removeEventListener(c,k?j:F,k),w.forEach(A=>{A.removeEventListener("scroll",y)}),window.clearTimeout(p)}},[i,o,u,S,c,n,r,b,a,E,T,L,I,Z,F,k,j]),s.useEffect(()=>{i.current.insideReactTree=!1},[i,S,c]);const B=s.useMemo(()=>({onKeyDown:L,...d&&{[zt[m]]:p=>{r(!1,p.nativeEvent,"reference-press")},...m!=="click"&&{onClick(p){r(!1,p.nativeEvent,"reference-press")}}}}),[L,r,d,m]),K=s.useMemo(()=>({onKeyDown:L,onMouseDown(){C.current=!0},onMouseUp(){C.current=!0},[Jt[c]]:()=>{i.current.insideReactTree=!0},onBlurCapture(){l||(Ut(H),i.current.insideReactTree=!0,H.current=window.setTimeout(()=>{i.current.insideReactTree=!1}))}}),[L,c,i,l]);return s.useMemo(()=>a?{reference:B,floating:K}:{},[a,B,K])}function Qt(t){const{open:e=!1,onOpenChange:n,elements:r}=t,o=$e(),i=s.useRef({}),[a]=s.useState(()=>_t()),u=qt()!=null,[f,c]=s.useState(r.reference),d=W((g,x,l)=>{i.current.openEvent=g?x:void 0,a.emit("openchange",{open:g,event:x,reason:l,nested:u}),n?.(g,x,l)}),m=s.useMemo(()=>({setPositionReference:c}),[]),b=s.useMemo(()=>({reference:f||r.reference||null,floating:r.floating||null,domReference:r.reference}),[f,r.reference,r.floating]);return s.useMemo(()=>({dataRef:i,open:e,onOpenChange:d,elements:b,events:a,floatingId:o,refs:m}),[e,d,b,a,o,m])}function ln(t){t===void 0&&(t={});const{nodeId:e}=t,n=Qt({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,o=r.elements,[i,a]=s.useState(null),[u,f]=s.useState(null),d=o?.domReference||i,m=s.useRef(null),b=He();V(()=>{d&&(m.current=d)},[d]);const g=Bt({...t,elements:{...o,...u&&{reference:u}}}),x=s.useCallback(E=>{const T=D(E)?{getBoundingClientRect:()=>E.getBoundingClientRect(),getClientRects:()=>E.getClientRects(),contextElement:E}:E;f(T),g.refs.setReference(T)},[g.refs]),l=s.useCallback(E=>{(D(E)||E===null)&&(m.current=E,a(E)),(D(g.refs.reference.current)||g.refs.reference.current===null||E!==null&&!D(E))&&g.refs.setReference(E)},[g.refs]),R=s.useMemo(()=>({...g.refs,setReference:l,setPositionReference:x,domReference:m}),[g.refs,l,x]),S=s.useMemo(()=>({...g.elements,domReference:d}),[g.elements,d]),C=s.useMemo(()=>({...g,...r,refs:R,elements:S,nodeId:e}),[g,R,S,e,r]);return V(()=>{r.dataRef.current.floatingContext=C;const E=b?.nodesRef.current.find(T=>T.id===e);E&&(E.context=C)}),s.useMemo(()=>({...g,context:C,refs:R,elements:S}),[g,R,S,C])}function ue(t,e,n){const r=new Map,o=n==="item";let i=t;if(o&&t){const{[Re]:a,[Ee]:u,...f}=t;i=f}return{...n==="floating"&&{tabIndex:-1,[$t]:""},...i,...e.map(a=>{const u=a?a[n]:null;return typeof u=="function"?t?u(t):null:u}).concat(t).reduce((a,u)=>(u&&Object.entries(u).forEach(f=>{let[c,d]=f;if(!(o&&[Re,Ee].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof d=="function"){var m;(m=r.get(c))==null||m.push(d),a[c]=function(){for(var b,g=arguments.length,x=new Array(g),l=0;lR(...x)).find(R=>R!==void 0)}}}else a[c]=d}),a),{})}}function fn(t){t===void 0&&(t=[]);const e=t.map(u=>u?.reference),n=t.map(u=>u?.floating),r=t.map(u=>u?.item),o=s.useCallback(u=>ue(u,t,"reference"),e),i=s.useCallback(u=>ue(u,t,"floating"),n),a=s.useCallback(u=>ue(u,t,"item"),r);return s.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:a}),[o,i,a])}function dn(t){return _({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"},child:[]}]})(t)}function vn(t){return _({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M156,128a28,28,0,1,1-28-28A28,28,0,0,1,156,128ZM48,100a28,28,0,1,0,28,28A28,28,0,0,0,48,100Zm160,0a28,28,0,1,0,28,28A28,28,0,0,0,208,100Z"},child:[]}]})(t)}function gn(t){return _({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"},child:[]}]})(t)}function pn(t){return _({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,26A102,102,0,0,0,38.35,176.69L26.73,211.56a14,14,0,0,0,17.71,17.71l34.87-11.62A102,102,0,1,0,128,26Zm0,192a90,90,0,0,1-45.06-12.08,6.09,6.09,0,0,0-3-.81,6.2,6.2,0,0,0-1.9.31L40.65,217.88a2,2,0,0,1-2.53-2.53L50.58,178a6,6,0,0,0-.5-4.91A90,90,0,1,1,128,218Z"},child:[]}]})(t)}function mn(t){return _({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"},child:[]}]})(t)}function hn(t){return _({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M166,152a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,152Zm-6-38H96a6,6,0,0,0,0,12h64a6,6,0,0,0,0-12Zm54-66V216a14,14,0,0,1-14,14H56a14,14,0,0,1-14-14V48A14,14,0,0,1,56,34H93.17a45.91,45.91,0,0,1,69.66,0H200A14,14,0,0,1,214,48ZM94,64v2h68V64a34,34,0,0,0-68,0ZM202,48a2,2,0,0,0-2-2H170.33A45.77,45.77,0,0,1,174,64v8a6,6,0,0,1-6,6H88a6,6,0,0,1-6-6V64a45.77,45.77,0,0,1,3.67-18H56a2,2,0,0,0-2,2V216a2,2,0,0,0,2,2H200a2,2,0,0,0,2-2Z"},child:[]}]})(t)}function bn(t){return _({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"},child:[]}]})(t)}export{sn as F,dn as P,un as a,cn as b,fn as c,hn as d,gn as e,pn as f,mn as g,bn as h,vn as i,on as o,an as s,ln as u};