b(...m)).find(b=>b!==void 0)}}}else a[c]=d}),a),{})}}s(t4,"mergeProps");function w9(t){t===void 0&&(t=[]);const e=t.map(o=>o?.reference),n=t.map(o=>o?.floating),r=t.map(o=>o?.item),i=wp.element.useCallback(o=>t4(o,t,"reference"),e),l=wp.element.useCallback(o=>t4(o,t,"floating"),n),a=wp.element.useCallback(o=>t4(o,t,"item"),r);return wp.element.useMemo(()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:a}),[i,l,a])}s(w9,"useInteractions");const oee="Escape";function Fp(t,e,n){switch(t){case"vertical":return e;case"horizontal":return n;default:return e||n}}s(Fp,"doSwitch");function Lp(t,e){return Fp(e,t===r9||t===Bp,t===Xc||t===Ic)}s(Lp,"isMainOrientationKey");function n4(t,e,n){return Fp(e,t===Bp,n?t===Xc:t===Ic)||t==="Enter"||t===" "||t===""}s(n4,"isMainOrientationToEndKey");function x9(t,e,n){return Fp(e,n?t===Xc:t===Ic,t===Bp)}s(x9,"isCrossOrientationOpenKey");function $9(t,e,n,r){const i=n?t===Ic:t===Xc,l=t===r9;return e==="both"||e==="horizontal"&&r&&r>1?t===oee:Fp(e,i,l)}s($9,"isCrossOrientationCloseKey");function uee(t,e){const{open:n,onOpenChange:r,elements:i,floatingId:l}=t,{listRef:a,activeIndex:o,onNavigate:u=s(()=>{},"unstable_onNavigate"),enabled:c=!0,selectedIndex:d=null,allowEscape:f=!1,loop:h=!1,nested:p=!1,rtl:m=!1,virtual:g=!1,focusItemOnOpen:b="auto",focusItemOnHover:O=!0,openOnArrowKeyDown:v=!0,disabledIndices:y=void 0,orientation:w="vertical",parentOrientation:S,cols:$=1,scrollItemIntoView:C=!0,virtualItemRef:R,itemSizes:D,dense:E=!1}=e;process.env.NODE_ENV!=="production"&&(f&&(h||Np("`useListNavigation` looping must be enabled to allow escaping."),g||Np("`useListNavigation` must be virtual to allow escaping.")),w==="vertical"&&$>1&&Np("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const N=Dp(i.floating),j=ri(N),V=qO(),x=Qp();xt(()=>{t.dataRef.current.orientation=w},[t,w]);const k=Xt(()=>{u(M.current===-1?null:M.current)}),P=IO(i.domReference),B=wp.element.useRef(b),M=wp.element.useRef(d??-1),T=wp.element.useRef(null),A=wp.element.useRef(!0),F=wp.element.useRef(k),_=wp.element.useRef(!!i.floating),I=wp.element.useRef(n),X=wp.element.useRef(!1),Q=wp.element.useRef(!1),Z=ri(y),L=ri(n),W=ri(C),K=ri(d),[q,ie]=wp.element.useState(),[G,te]=wp.element.useState(),re=Xt(()=>{function Y(Oe){if(g){var ye;(ye=Oe.id)!=null&&ye.endsWith("-fui-option")&&(Oe.id=l+"-"+Math.random().toString(16).slice(2,10)),ie(Oe.id),x?.events.emit("virtualfocus",Oe),R&&(R.current=Oe)}else za(Oe,{sync:X.current,preventScroll:!0})}s(Y,"runFocus");const le=a.current[M.current],H=Q.current;le&&Y(le),(X.current?Oe=>Oe():requestAnimationFrame)(()=>{const Oe=a.current[M.current]||le;if(!Oe)return;le||Y(Oe);const ye=W.current;ye&&Se&&(H||!A.current)&&(Oe.scrollIntoView==null||Oe.scrollIntoView(typeof ye=="boolean"?{block:"nearest",inline:"nearest"}:ye))})});xt(()=>{c&&(n&&i.floating?B.current&&d!=null&&(Q.current=!0,M.current=d,k()):_.current&&(M.current=-1,F.current()))},[c,n,i.floating,d,k]),xt(()=>{if(c&&n&&i.floating)if(o==null){if(X.current=!1,K.current!=null)return;if(_.current&&(M.current=-1,re()),(!I.current||!_.current)&&B.current&&(T.current!=null||B.current===!0&&T.current==null)){let Y=0;const le=s(()=>{a.current[0]==null?(Y<2&&(Y?requestAnimationFrame:queueMicrotask)(le),Y++):(M.current=T.current==null||n4(T.current,w,m)||p?FO(a,Z.current):VE(a,Z.current),T.current=null,k())},"waitForListPopulated");le()}}else Nc(a,o)||(M.current=o,re(),Q.current=!1)},[c,n,i.floating,o,K,p,a,w,m,k,re,Z]),xt(()=>{var Y;if(!c||i.floating||!x||g||!_.current)return;const le=x.nodesRef.current,H=(Y=le.find(ye=>ye.id===V))==null||(Y=Y.context)==null?void 0:Y.elements.floating,me=Ql(dr(i.floating)),Oe=le.some(ye=>ye.context&&En(ye.context.elements.floating,me));H&&!Oe&&A.current&&H.focus({preventScroll:!0})},[c,i.floating,x,V,g]),xt(()=>{if(!c||!x||!g||V)return;function Y(le){te(le.id),R&&(R.current=le)}return s(Y,"handleVirtualFocus"),x.events.on("virtualfocus",Y),()=>{x.events.off("virtualfocus",Y)}},[c,x,g,V,R]),xt(()=>{F.current=k,I.current=n,_.current=!!i.floating}),xt(()=>{n||(T.current=null,B.current=b)},[n,b]);const we=o!=null,Se=wp.element.useMemo(()=>{function Y(H){if(!L.current)return;const me=a.current.indexOf(H);me!==-1&&M.current!==me&&(M.current=me,k())}return s(Y,"syncCurrentTarget"),{onFocus(H){let{currentTarget:me}=H;X.current=!0,Y(me)},onClick:s(H=>{let{currentTarget:me}=H;return me.focus({preventScroll:!0})},"onClick"),onMouseMove(H){let{currentTarget:me}=H;X.current=!0,Q.current=!1,O&&Y(me)},onPointerLeave(H){let{pointerType:me}=H;if(!(!A.current||me==="touch")&&(X.current=!0,!!O&&(M.current=-1,k(),!g))){var Oe;(Oe=j.current)==null||Oe.focus({preventScroll:!0})}}}},[L,j,O,a,k,g]),ve=wp.element.useCallback(()=>{var Y;return S??(x==null||(Y=x.nodesRef.current.find(le=>le.id===V))==null||(Y=Y.context)==null||(Y=Y.dataRef)==null?void 0:Y.current.orientation)},[V,x,S]),Me=Xt(Y=>{if(A.current=!1,X.current=!0,Y.which===229||!L.current&&Y.currentTarget===j.current)return;if(p&&$9(Y.key,w,m,$)){Lp(Y.key,ve())||Vt(Y),r(!1,Y.nativeEvent,"list-navigation"),Tt(i.domReference)&&(g?x?.events.emit("virtualfocus",i.domReference):i.domReference.focus());return}const le=M.current,H=FO(a,y),me=VE(a,y);if(P||(Y.key==="Home"&&(Vt(Y),M.current=H,k()),Y.key==="End"&&(Vt(Y),M.current=me,k())),$>1){const Oe=D||Array.from({length:a.current.length},()=>({width:1,height:1})),ye=UU(Oe,$,E),Ne=ye.findIndex(xe=>xe!=null&&!Ep(a,xe,y)),ht=ye.reduce((xe,Fe,Te)=>Fe!=null&&!Ep(a,Fe,y)?Te:xe,-1),bt=ye[HU({current:ye.map(xe=>xe!=null?a.current[xe]:null)},{event:Y,orientation:w,loop:h,rtl:m,cols:$,disabledIndices:eG([...(typeof y!="function"?y:null)||a.current.map((xe,Fe)=>Ep(a,Fe,y)?Fe:void 0),void 0],ye),minIndex:Ne,maxIndex:ht,prevIndex:GU(M.current>me?H:M.current,Oe,ye,$,Y.key===Bp?"bl":Y.key===(m?Xc:Ic)?"tr":"tl"),stopEvent:!0})];if(bt!=null&&(M.current=bt,k()),w==="both")return}if(Lp(Y.key,w)){if(Vt(Y),n&&!g&&Ql(Y.currentTarget.ownerDocument)===Y.currentTarget){M.current=n4(Y.key,w,m)?H:me,k();return}n4(Y.key,w,m)?h?M.current=le>=me?f&&le!==a.current.length?-1:H:Gt(a,{startingIndex:le,disabledIndices:y}):M.current=Math.min(me,Gt(a,{startingIndex:le,disabledIndices:y})):h?M.current=le<=H?f&&le!==-1?a.current.length:me:Gt(a,{startingIndex:le,decrement:!0,disabledIndices:y}):M.current=Math.max(H,Gt(a,{startingIndex:le,decrement:!0,disabledIndices:y})),Nc(a,M.current)&&(M.current=-1),k()}}),J=wp.element.useMemo(()=>g&&n&&we&&{"aria-activedescendant":G||q},[g,n,we,G,q]),U=wp.element.useMemo(()=>({"aria-orientation":w==="both"?void 0:w,...P?{}:J,onKeyDown:Me,onPointerMove(){A.current=!0}}),[J,Me,w,P]),fe=wp.element.useMemo(()=>{function Y(H){b==="auto"&&jE(H.nativeEvent)&&(B.current=!0)}s(Y,"checkVirtualMouse");function le(H){B.current=b,b==="auto"&&NE(H.nativeEvent)&&(B.current=!0)}return s(le,"checkVirtualPointer"),{...J,onKeyDown(H){A.current=!1;const me=H.key.startsWith("Arrow"),Oe=["Home","End"].includes(H.key),ye=me||Oe,Ne=x9(H.key,w,m),ht=$9(H.key,w,m,$),bt=x9(H.key,ve(),m),xe=Lp(H.key,w),Fe=(p?bt:xe)||H.key==="Enter"||H.key.trim()==="";if(g&&n){const Ye=x?.nodesRef.current.find(Hu=>Hu.parentId==null),Kt=x&&Ye?JU(x.nodesRef.current,Ye.id):null;if(ye&&Kt&&R){const Hu=new KeyboardEvent("keydown",{key:H.key,bubbles:!0});if(Ne||ht){var Te,Qt;const bS=((Te=Kt.context)==null?void 0:Te.elements.domReference)===H.currentTarget,D1=ht&&!bS?(Qt=Kt.context)==null?void 0:Qt.elements.domReference:Ne?a.current.find(P1=>P1?.id===q):null;D1&&(Vt(H),D1.dispatchEvent(Hu),te(void 0))}if((xe||Oe)&&Kt.context&&Kt.context.open&&Kt.parentId&&H.currentTarget!==Kt.context.elements.domReference){var Ee;Vt(H),(Ee=Kt.context.elements.domReference)==null||Ee.dispatchEvent(Hu);return}}return Me(H)}if(!(!n&&!v&&me)){if(Fe){const Ye=Lp(H.key,ve());T.current=p&&Ye?null:H.key}if(p){bt&&(Vt(H),n?(M.current=FO(a,Z.current),k()):r(!0,H.nativeEvent,"list-navigation"));return}xe&&(d!=null&&(M.current=d),Vt(H),!n&&v?r(!0,H.nativeEvent,"list-navigation"):Me(H),n&&k())}},onFocus(){n&&!g&&(M.current=-1,k())},onPointerDown:le,onPointerEnter:le,onMouseDown:Y,onClick:Y}},[q,J,$,Me,Z,b,a,p,k,r,n,v,w,ve,m,d,x,g,R]);return wp.element.useMemo(()=>c?{reference:fe,floating:U,item:Se}:{},[c,fe,U,Se])}s(uee,"useListNavigation");const cee=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function S9(t,e){var n,r;e===void 0&&(e={});const{open:i,elements:l,floatingId:a}=t,{enabled:o=!0,role:u="dialog"}=e,c=jp(),d=((n=l.domReference)==null?void 0:n.id)||c,f=wp.element.useMemo(()=>{var v;return((v=Dp(l.floating))==null?void 0:v.id)||a},[l.floating,a]),h=(r=cee.get(u))!=null?r:u,m=qO()!=null,g=wp.element.useMemo(()=>h==="tooltip"||u==="label"?{["aria-"+(u==="label"?"labelledby":"describedby")]:i?f:void 0}:{"aria-expanded":i?"true":"false","aria-haspopup":h==="alertdialog"?"dialog":h,"aria-controls":i?f:void 0,...h==="listbox"&&{role:"combobox"},...h==="menu"&&{id:d},...h==="menu"&&m&&{role:"menuitem"},...u==="select"&&{"aria-autocomplete":"none"},...u==="combobox"&&{"aria-autocomplete":"list"}},[h,f,m,i,d,u]),b=wp.element.useMemo(()=>{const v={id:f,...h&&{role:h}};return h==="tooltip"||u==="label"?v:{...v,...h==="menu"&&{"aria-labelledby":d}}},[h,f,d,u]),O=wp.element.useCallback(v=>{let{active:y,selected:w}=v;const S={role:"option",...y&&{id:f+"-fui-option"}};switch(u){case"select":case"combobox":return{...S,"aria-selected":w}}return{}},[f,u]);return wp.element.useMemo(()=>o?{reference:g,floating:b,item:O}:{},[o,g,b,O])}s(S9,"useRole");function dee(t,e){var n;const{open:r,dataRef:i}=t,{listRef:l,activeIndex:a,onMatch:o,onTypingChange:u,enabled:c=!0,findMatch:d=null,resetMs:f=750,ignoreKeys:h=[],selectedIndex:p=null}=e,m=wp.element.useRef(-1),g=wp.element.useRef(""),b=wp.element.useRef((n=p??a)!=null?n:-1),O=wp.element.useRef(null),v=Xt(o),y=Xt(u),w=ri(d),S=ri(h);xt(()=>{r&&(YO(m),O.current=null,g.current="")},[r]),xt(()=>{if(r&&g.current===""){var E;b.current=(E=p??a)!=null?E:-1}},[r,p,a]);const $=Xt(E=>{E?i.current.typing||(i.current.typing=E,y(E)):i.current.typing&&(i.current.typing=E,y(E))}),C=Xt(E=>{function N(P,B,M){const T=w.current?w.current(B,M):B.find(A=>A?.toLocaleLowerCase().indexOf(M.toLocaleLowerCase())===0);return T?P.indexOf(T):-1}s(N,"getMatchingIndex");const j=l.current;if(g.current.length>0&&g.current[0]!==" "&&(N(j,j,g.current)===-1?$(!1):E.key===" "&&Vt(E)),j==null||S.current.includes(E.key)||E.key.length!==1||E.ctrlKey||E.metaKey||E.altKey)return;r&&E.key!==" "&&(Vt(E),$(!0)),j.every(P=>{var B,M;return P?((B=P[0])==null?void 0:B.toLocaleLowerCase())!==((M=P[1])==null?void 0:M.toLocaleLowerCase()):!0})&&g.current===E.key&&(g.current="",b.current=O.current),g.current+=E.key,YO(m),m.current=window.setTimeout(()=>{g.current="",b.current=O.current,$(!1)},f);const x=b.current,k=N(j,[...j.slice((x||0)+1),...j.slice(0,(x||0)+1)],g.current);k!==-1?(v(k),O.current=k):E.key!==" "&&(g.current="",$(!1))}),R=wp.element.useMemo(()=>({onKeyDown:C}),[C]),D=wp.element.useMemo(()=>({onKeyDown:C,onKeyUp(E){E.key===" "&&$(!1)}}),[C,$]);return wp.element.useMemo(()=>c?{reference:R,floating:D}:{},[c,R,D])}s(dee,"useTypeahead");const r4="tui",zc=`${r4}-interface`,Ja=`${r4}-portal-root`,Ao=new WeakMap;function C9(t){const e=document.createElement("div");return e.id=t,e.style.cssText="position: fixed; inset: 0; pointer-events: none; z-index: var(--tui-layer-portal, 9999);",e}s(C9,"createPortalRoot");const zp=`${r4}-global-interface`;function fee(){let t=document.getElementById(zp);if(!t){t=document.createElement("div"),t.id=zp,t.className=zc;const e=document.body.getAttribute("data-theme")??document.documentElement.getAttribute("data-theme");e&&t.setAttribute("data-theme",e),document.body.appendChild(t)}return t}s(fee,"getOrCreateGlobalInterface");function R9(){const t=document.getElementById(zp);if(!t)return;const e=document.querySelector(`.${zc}:not(#${zp})`);if(!e)return;const n=t.querySelector(`[id^="${Ja}"]`);n&&(e.appendChild(n),Ao.set(e,n)),t.childElementCount===0&&t.remove()}s(R9,"reconcileFallback");function k9(){R9();const t=document.getElementById(Ja);if(t)return t;let e=document.querySelector(`.${zc}`);e||(e=fee());const n=C9(Ja);return e.appendChild(n),Ao.set(e,n),n}s(k9,"getPortalRoot");function Il(t){if(R9(),!t)return k9();const e=t.closest(`.${zc}`);if(!e)return k9();const n=Ao.get(e);if(n&&e.contains(n))return n;const r=document.getElementById(Ja);if(r&&e.contains(r))return Ao.set(e,r),r;const i=e.querySelector(`[id^="${Ja}"]`);if(i)return Ao.set(e,i),i;const l=document.querySelectorAll(`.${zc}`),a=Array.from(l).indexOf(e),o=a===0?Ja:`${Ja}-${a}`,u=C9(o);return e.appendChild(u),Ao.set(e,u),u}s(Il,"getPortalRootFor");const D9=wp.element.createContext(null);function i4(){const t=wp.element.useContext(D9);if(!t)throw new Error("Tooltip compound components must be used within