nx
Version:
1 lines • 2.99 MB
JavaScript
(self.webpackChunk=self.webpackChunk||[]).push([[179],{10800:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Composite:()=>xe,CompositeItem:()=>Se,FloatingArrow:()=>Ne,FloatingDelayGroup:()=>Ye,FloatingFocusManager:()=>yt,FloatingList:()=>he,FloatingNode:()=>Pe,FloatingOverlay:()=>St,FloatingPortal:()=>ft,FloatingTree:()=>je,arrow:()=>R.x7,autoPlacement:()=>R.X5,autoUpdate:()=>T.Me,computePosition:()=>T.oo,detectOverflow:()=>T.US,flip:()=>R.RR,getOverflowAncestors:()=>i.Kx,hide:()=>R.Cp,inline:()=>R.Qo,inner:()=>Jt,limitShift:()=>R.dr,offset:()=>R.cv,platform:()=>T.Jv,safePolygon:()=>nn,shift:()=>R.uY,size:()=>R.dp,useClick:()=>Tt,useClientPoint:()=>Ot,useDelayGroup:()=>Ze,useDelayGroupContext:()=>ze,useDismiss:()=>Mt,useFloating:()=>kt,useFloatingNodeId:()=>Le,useFloatingParentNodeId:()=>ke,useFloatingPortalNode:()=>mt,useFloatingTree:()=>De,useFocus:()=>Dt,useHover:()=>He,useId:()=>Oe,useInnerOffset:()=>en,useInteractions:()=>Bt,useListItem:()=>ge,useListNavigation:()=>zt,useMergeRefs:()=>q,useRole:()=>Zt,useTransitionStatus:()=>$t,useTransitionStyles:()=>Kt,useTypeahead:()=>Qt});var r=n(2649),i=n(45449);function l(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function c(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&(0,i.Zq)(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function d(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function u(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function p(e){return!(0!==e.mozInputSource||!e.isTrusted)||(h()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function m(e){return!u().includes("jsdom/")&&(!h()&&0===e.width&&0===e.height||h()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function f(){return/apple/i.test(navigator.vendor)}function h(){const e=/android/i;return e.test(d())||e.test(u())}function g(){return d().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function _(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function v(e){return(null==e?void 0:e.ownerDocument)||document}function b(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function E(e){return"composedPath"in e?e.composedPath()[0]:e.target}const y="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function x(e){return(0,i.Re)(e)&&e.matches(y)}function S(e){e.preventDefault(),e.stopPropagation()}function w(e){return!!e&&("combobox"===e.getAttribute("role")&&x(e))}var C=n(35365),T=n(87906),R=n(90321),O=["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])"],N=O.join(","),I="undefined"==typeof Element,A=I?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,M=!I&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},k=function e(t,n){var r;void 0===n&&(n=!0);var i=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===i||"true"===i||n&&t&&e(t.parentNode)},D=function(e,t,n){if(k(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(N));return t&&A.call(e,N)&&r.unshift(e),r=r.filter(n)},L=function e(t,n,r){for(var i=[],l=Array.from(t);l.length;){var c=l.shift();if(!k(c,!1))if("SLOT"===c.tagName){var d=c.assignedElements(),u=e(d.length?d:c.children,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:c,candidates:u})}else{A.call(c,N)&&r.filter(c)&&(n||!t.includes(c))&&i.push(c);var p=c.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(c),m=!k(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(c));if(p&&m){var f=e(!0===p?c.children:p.children,!0,r);r.flatten?i.push.apply(i,f):i.push({scopeParent:c,candidates:f})}else l.unshift.apply(l,c.children)}}return i},P=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},j=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!P(e)?0:e.tabIndex},B=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},F=function(e){return"INPUT"===e.tagName},U=function(e){return function(e){return F(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||M(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(l){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",l.message),!1}var i=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!i||i===e}(e)},G=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},H=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var i=A.call(e,"details>summary:first-of-type")?e.parentElement:e;if(A.call(i,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return G(e)}else{if("function"==typeof r){for(var l=e;e;){var c=e.parentElement,d=M(e);if(c&&!c.shadowRoot&&!0===r(c))return G(e);e=e.assignedSlot?e.assignedSlot:c||d===e.ownerDocument?c:d.host}e=l}if(function(e){var t,n,r,i,l=e&&M(e),c=null===(t=l)||void 0===t?void 0:t.host,d=!1;if(l&&l!==e)for(d=!!(null!==(n=c)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(c)||null!=e&&null!==(i=e.ownerDocument)&&void 0!==i&&i.contains(e));!d&&c;){var u,p,m;d=!(null===(p=c=null===(u=l=M(c))||void 0===u?void 0:u.host)||void 0===p||null===(m=p.ownerDocument)||void 0===m||!m.contains(c))}return d}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},V=function(e,t){return!(t.disabled||k(t)||function(e){return F(e)&&"hidden"===e.type}(t)||H(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!A.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},z=function(e,t){return!(U(t)||j(t)<0||!V(e,t))},Y=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Z=function e(t){var n=[],r=[];return t.forEach((function(t,i){var l=!!t.scopeParent,c=l?t.scopeParent:t,d=function(e,t){var n=j(e);return n<0&&t&&!P(e)?0:n}(c,l),u=l?e(t.candidates):c;0===d?l?n.push.apply(n,u):n.push(c):r.push({documentOrder:i,tabIndex:d,item:t,isScope:l,content:u})})),r.sort(B).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},W=function(e,t){var n;return n=(t=t||{}).getShadowRoot?L([e],t.includeContainer,{filter:z.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Y}):D(e,t.includeContainer,z.bind(null,t)),Z(n)};function q(e){return r.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}),e)}const $=r["useInsertionEffect".toString()]||(e=>e());function K(e){const t=r.useRef((()=>{0}));return $((()=>{t.current=e})),r.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}const Q="ArrowUp",X="ArrowDown",J="ArrowLeft",ee="ArrowRight";function te(e,t,n){return Math.floor(e/t)!==n}function ne(e,t){return t<0||t>=e.current.length}function re(e,t){return oe(e,{disabledIndices:t})}function ae(e,t){return oe(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function oe(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:l=1}=void 0===t?{}:t;const c=e.current,d=i?e=>i.includes(e):e=>{const t=c[e];return null==t||t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled")};let u=n;do{u+=r?-l:l}while(u>=0&&u<=c.length-1&&d(u));return u}function ie(e,t){let{event:n,orientation:r,loop:i,cols:l,disabledIndices:c,minIndex:d,maxIndex:u,prevIndex:p,stopEvent:m=!1}=t,f=p;if(n.key===Q){if(m&&S(n),-1===p)f=u;else if(f=oe(e,{startingIndex:f,amount:l,decrement:!0,disabledIndices:c}),i&&(p-l<d||f<0)){const e=p%l,t=u%l,n=u-(t-e);f=t===e?u:t>e?n:n-l}ne(e,f)&&(f=p)}if(n.key===X&&(m&&S(n),-1===p?f=d:(f=oe(e,{startingIndex:p,amount:l,disabledIndices:c}),i&&p+l>u&&(f=oe(e,{startingIndex:p%l-l,amount:l,disabledIndices:c}))),ne(e,f)&&(f=p)),"both"===r){const t=(0,C.GW)(p/l);n.key===ee&&(m&&S(n),p%l!=l-1?(f=oe(e,{startingIndex:p,disabledIndices:c}),i&&te(f,l,t)&&(f=oe(e,{startingIndex:p-p%l-1,disabledIndices:c}))):i&&(f=oe(e,{startingIndex:p-p%l-1,disabledIndices:c})),te(f,l,t)&&(f=p)),n.key===J&&(m&&S(n),p%l!=0?(f=oe(e,{startingIndex:p,disabledIndices:c,decrement:!0}),i&&te(f,l,t)&&(f=oe(e,{startingIndex:p+(l-p%l),decrement:!0,disabledIndices:c}))):i&&(f=oe(e,{startingIndex:p+(l-p%l),decrement:!0,disabledIndices:c})),te(f,l,t)&&(f=p));const r=(0,C.GW)(u/l)===t;ne(e,f)&&(f=i&&r?n.key===J?u:oe(e,{startingIndex:p-p%l-1,disabledIndices:c}):p)}return f}function se(e,t,n){const r=[];let i=0;return e.forEach(((e,l)=>{let{width:c,height:d}=e,u=!1;for(n&&(i=0);!u;){const e=[];for(let n=0;n<c;n++)for(let r=0;r<d;r++)e.push(i+n+r*t);i%t+c<=t&&e.every((e=>null==r[e]))?(e.forEach((e=>{r[e]=l})),u=!0):i++}})),[...r]}function le(e,t,n,r,i){if(-1===e)return-1;const l=n.indexOf(e);switch(i){case"tl":return l;case"tr":return l+t[e].width-1;case"bl":return l+(t[e].height-1)*r;case"br":return n.lastIndexOf(e)}}function ce(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}let de=0;function ue(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(de);const l=()=>null==e?void 0:e.focus({preventScroll:n});i?l():de=requestAnimationFrame(l)}var pe="undefined"!=typeof document?r.useLayoutEffect:r.useEffect;function me(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const fe=r.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function he(e){let{children:t,elementsRef:n,labelsRef:i}=e;const[l,c]=r.useState((()=>new Map)),d=r.useCallback((e=>{c((t=>new Map(t).set(e,null)))}),[]),u=r.useCallback((e=>{c((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return pe((()=>{const e=new Map(l);Array.from(e.keys()).sort(me).forEach(((t,n)=>{e.set(t,n)})),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(l,e)||c(e)}),[l]),r.createElement(fe.Provider,{value:r.useMemo((()=>({register:d,unregister:u,map:l,elementsRef:n,labelsRef:i})),[d,u,l,n,i])},t)}function ge(e){let{label:t}=void 0===e?{}:e;const[n,i]=r.useState(null),l=r.useRef(null),{register:c,unregister:d,map:u,elementsRef:p,labelsRef:m}=r.useContext(fe),f=r.useCallback((e=>{if(l.current=e,null!==n&&(p.current[n]=e,m)){var r;const i=void 0!==t;m.current[n]=i?t:null!=(r=null==e?void 0:e.textContent)?r:null}}),[n,p,m,t]);return pe((()=>{const e=l.current;if(e)return c(e),()=>{d(e)}}),[c,d]),pe((()=>{const e=l.current?u.get(l.current):null;null!=e&&i(e)}),[u]),r.useMemo((()=>({ref:f,index:n??-1})),[n,f])}function _e(e,t){return"function"==typeof e?e(t):e?r.cloneElement(e,t):r.createElement("div",t)}const ve=r.createContext({activeIndex:0,onNavigate:()=>{}}),be=[J,ee],Ee=[Q,X],ye=[...be,...Ee],xe=r.forwardRef((function(e,t){let{render:n,orientation:i="both",loop:l=!0,cols:c=1,disabledIndices:d=[],activeIndex:u,onNavigate:p,itemSizes:m,dense:f=!1,...h}=e;const[g,_]=r.useState(0),v=null!=u?u:g,b=K(null!=p?p:_),E=r.useRef([]),y=n&&"function"!=typeof n?n.props:{},x=r.useMemo((()=>({activeIndex:v,onNavigate:b})),[v,b]),S=c>1;const w={...h,...y,ref:t,"aria-orientation":"both"===i?void 0:i,onKeyDown(e){null==h.onKeyDown||h.onKeyDown(e),null==y.onKeyDown||y.onKeyDown(e),function(e){if(!ye.includes(e.key))return;let t=v;if(S){const n=null!=m?m:Array.from(Array(E.current.length),(()=>({width:1,height:1}))),r=se(n,c,f),u=r.findIndex((e=>null!=e&&!d.includes(e))),p=r.reduce(((e,t,n)=>null==t||null!=d&&d.includes(t)?e:n),-1);t=r[ie({current:r.map((e=>e?E.current[e]:null))},{event:e,orientation:i,loop:l,cols:c,disabledIndices:ce([...d,void 0],r),minIndex:u,maxIndex:p,prevIndex:le(v,n,r,c,e.key===X?"bl":e.key===ee?"tr":"tl")})]}const n=re(E,d),r=ae(E,d),u={horizontal:[ee],vertical:[X],both:[ee,X]}[i],p={horizontal:[J],vertical:[Q],both:[J,Q]}[i],h=S?ye:{horizontal:be,vertical:Ee,both:ye}[i];t===v&&[...u,...p].includes(e.key)&&(t=l&&t===r&&u.includes(e.key)?n:l&&t===n&&p.includes(e.key)?r:oe(E,{startingIndex:t,decrement:p.includes(e.key),disabledIndices:d})),t===v||ne(E,t)||(e.stopPropagation(),h.includes(e.key)&&e.preventDefault(),b(t),queueMicrotask((()=>{ue(E.current[t])})))}(e)}};return r.createElement(ve.Provider,{value:x},r.createElement(he,{elementsRef:E},_e(n,w)))})),Se=r.forwardRef((function(e,t){let{render:n,...i}=e;const l=n&&"function"!=typeof n?n.props:{},{activeIndex:c,onNavigate:d}=r.useContext(ve),{ref:u,index:p}=ge(),m=q([u,t,l.ref]),f=c===p;return _e(n,{...i,...l,ref:m,tabIndex:f?0:-1,"data-active":f?"":void 0,onFocus(e){null==i.onFocus||i.onFocus(e),null==l.onFocus||l.onFocus(e),d(p)}})}));function we(){return we=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},we.apply(this,arguments)}let Ce=!1,Te=0;const Re=()=>"floating-ui-"+Te++;const Oe=r["useId".toString()]||function(){const[e,t]=r.useState((()=>Ce?Re():void 0));return pe((()=>{null==e&&t(Re())}),[]),r.useEffect((()=>{Ce||(Ce=!0)}),[]),e},Ne=r.forwardRef((function(e,t){let{context:{placement:n,elements:{floating:i},middlewareData:{arrow:l}},width:c=14,height:d=7,tipRadius:u=0,strokeWidth:p=0,staticOffset:m,stroke:f,d:h,style:{transform:g,..._}={},...v}=e;const b=Oe();if(!i)return null;p*=2;const E=p/2,y=c/2*(u/-8+1),x=d/2*u/4,[S,w]=n.split("-"),C=T.Jv.isRTL(i),R=!!h,O="top"===S||"bottom"===S,N=m&&"end"===w?"bottom":"top";let I=m&&"end"===w?"right":"left";m&&C&&(I="end"===w?"left":"right");const A=null!=(null==l?void 0:l.x)?m||l.x:"",M=null!=(null==l?void 0:l.y)?m||l.y:"",k=h||"M0,0 H"+c+" L"+(c-y)+","+(d-x)+" Q"+c/2+","+d+" "+y+","+(d-x)+" Z",D={top:R?"rotate(180deg)":"",left:R?"rotate(90deg)":"rotate(-90deg)",bottom:R?"":"rotate(180deg)",right:R?"rotate(-90deg)":"rotate(90deg)"}[S];return r.createElement("svg",we({},v,{"aria-hidden":!0,ref:t,width:R?c:c+p,height:c,viewBox:"0 0 "+c+" "+(d>c?d:c),style:{position:"absolute",pointerEvents:"none",[I]:A,[N]:M,[S]:O||R?"100%":"calc(100% - "+p/2+"px)",transform:""+D+(null!=g?g:""),..._}}),p>0&&r.createElement("path",{clipPath:"url(#"+b+")",fill:"none",stroke:f,strokeWidth:p+(h?0:1),d:k}),r.createElement("path",{stroke:p&&!h?v.fill:"none",d:k}),r.createElement("clipPath",{id:b},r.createElement("rect",{x:-E,y:E*(R?-1:1),width:c+p,height:c})))}));function Ie(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}const Ae=r.createContext(null),Me=r.createContext(null),ke=()=>{var e;return(null==(e=r.useContext(Ae))?void 0:e.id)||null},De=()=>r.useContext(Me);function Le(e){const t=Oe(),n=De(),r=ke(),i=e||r;return pe((()=>{const e={id:t,parentId:i};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,i]),t}function Pe(e){let{children:t,id:n}=e;const i=ke();return r.createElement(Ae.Provider,{value:r.useMemo((()=>({id:n,parentId:i})),[n,i])},t)}function je(e){let{children:t}=e;const n=r.useRef([]),i=r.useCallback((e=>{n.current=[...n.current,e]}),[]),l=r.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),c=r.useState((()=>Ie()))[0];return r.createElement(Me.Provider,{value:r.useMemo((()=>({nodesRef:n,addNode:i,removeNode:l,events:c})),[i,l,c])},t)}function Be(e){return"data-floating-ui-"+e}function Fe(e){const t=(0,r.useRef)(e);return pe((()=>{t.current=e})),t}const Ue=Be("safe-polygon");function Ge(e,t,n){return n&&!_(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function He(e,t){void 0===t&&(t={});const{open:n,onOpenChange:l,dataRef:d,events:u,elements:{domReference:p,floating:m},refs:f}=e,{enabled:h=!0,delay:g=0,handleClose:b=null,mouseOnly:E=!1,restMs:y=0,move:x=!0}=t,S=De(),w=ke(),C=Fe(b),T=Fe(g),R=r.useRef(),O=r.useRef(),N=r.useRef(),I=r.useRef(),A=r.useRef(!0),M=r.useRef(!1),k=r.useRef((()=>{})),D=r.useCallback((()=>{var e;const t=null==(e=d.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[d]);r.useEffect((()=>{if(h)return u.on("openchange",e),()=>{u.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(O.current),clearTimeout(I.current),A.current=!0)}}),[h,u]),r.useEffect((()=>{if(!h||!C.current||!n)return;function e(e){D()&&l(!1,e,"hover")}const t=v(m).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[m,n,l,h,C,D]);const L=r.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=Ge(T.current,"close",R.current);r&&!N.current?(clearTimeout(O.current),O.current=setTimeout((()=>l(!1,e,n)),r)):t&&(clearTimeout(O.current),l(!1,e,n))}),[T,l]),P=r.useCallback((()=>{k.current(),N.current=void 0}),[]),j=r.useCallback((()=>{if(M.current){const e=v(f.floating.current).body;e.style.pointerEvents="",e.removeAttribute(Ue),M.current=!1}}),[f]);return r.useEffect((()=>{if(h&&(0,i.kK)(p)){const e=p;return n&&e.addEventListener("mouseleave",f),null==m||m.addEventListener("mouseleave",f),x&&e.addEventListener("mousemove",r,{once:!0}),e.addEventListener("mouseenter",r),e.addEventListener("mouseleave",u),()=>{n&&e.removeEventListener("mouseleave",f),null==m||m.removeEventListener("mouseleave",f),x&&e.removeEventListener("mousemove",r),e.removeEventListener("mouseenter",r),e.removeEventListener("mouseleave",u)}}function t(){return!!d.current.openEvent&&["click","mousedown"].includes(d.current.openEvent.type)}function r(e){if(clearTimeout(O.current),A.current=!1,E&&!_(R.current)||y>0&&0===Ge(T.current,"open"))return;const t=Ge(T.current,"open",R.current);t?O.current=setTimeout((()=>{l(!0,e,"hover")}),t):l(!0,e,"hover")}function u(r){if(t())return;k.current();const i=v(m);if(clearTimeout(I.current),C.current){n||clearTimeout(O.current),N.current=C.current({...e,tree:S,x:r.clientX,y:r.clientY,onClose(){j(),P(),L(r,!0,"safe-polygon")}});const t=N.current;return i.addEventListener("mousemove",t),void(k.current=()=>{i.removeEventListener("mousemove",t)})}("touch"!==R.current||!c(m,r.relatedTarget))&&L(r)}function f(n){t()||null==C.current||C.current({...e,tree:S,x:n.clientX,y:n.clientY,onClose(){j(),P(),L(n)}})(n)}}),[p,m,h,e,E,y,x,L,P,j,l,n,S,T,C,d]),pe((()=>{var e;if(h&&n&&null!=(e=C.current)&&e.__options.blockPointerEvents&&D()){const e=v(m).body;if(e.setAttribute(Ue,""),e.style.pointerEvents="none",M.current=!0,(0,i.kK)(p)&&m){var t;const e=p,n=null==S||null==(t=S.nodesRef.current.find((e=>e.id===w)))||null==(t=t.context)?void 0:t.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",m.style.pointerEvents="auto",()=>{e.style.pointerEvents="",m.style.pointerEvents=""}}}}),[h,n,w,m,p,S,C,D]),pe((()=>{n||(R.current=void 0,P(),j())}),[n,P,j]),r.useEffect((()=>()=>{P(),clearTimeout(O.current),clearTimeout(I.current),j()}),[h,p,P,j]),r.useMemo((()=>{if(!h)return{};function e(e){R.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===y||(clearTimeout(I.current),I.current=setTimeout((()=>{A.current||l(!0,e.nativeEvent,"hover")}),y))}},floating:{onMouseEnter(){clearTimeout(O.current)},onMouseLeave(e){L(e.nativeEvent,!1)}}}}),[h,y,n,l,L])}const Ve=r.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),ze=()=>r.useContext(Ve),Ye=e=>{let{children:t,delay:n,timeoutMs:i=0}=e;const[l,c]=r.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:i,initialDelay:n,currentId:null,isInstantPhase:!1}),d=r.useRef(null),u=r.useCallback((e=>{c({currentId:e})}),[]);return pe((()=>{l.currentId?null===d.current?d.current=l.currentId:c({isInstantPhase:!0}):(c({isInstantPhase:!1}),d.current=null)}),[l.currentId]),r.createElement(Ve.Provider,{value:r.useMemo((()=>({...l,setState:c,setCurrentId:u})),[l,u])},t)},Ze=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:i}=t;const{currentId:l,setCurrentId:c,initialDelay:d,setState:u,timeoutMs:p}=ze();pe((()=>{l&&(u({delay:{open:1,close:Ge(d,"close")}}),l!==i&&r(!1))}),[i,r,u,l,d]),pe((()=>{function e(){r(!1),u({delay:d,currentId:null})}if(!n&&l===i){if(p){const t=window.setTimeout(e,p);return()=>{clearTimeout(t)}}e()}}),[n,u,l,i,r,d,p]),pe((()=>{n&&c(i)}),[n,c,i])};function We(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let qe=new WeakMap,$e=new WeakSet,Ke={},Qe=0;const Xe=()=>"undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,Je=e=>e&&(e.host||Je(e.parentNode)),et=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=Je(t);return e.contains(n)?n:null})).filter((e=>null!=e));function tt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=v(e[0]).body;return function(e,t,n,r){const i="data-floating-ui-inert",l=r?"inert":n?"aria-hidden":null,c=et(t,e),d=new Set,u=new Set(c),p=[];Ke[i]||(Ke[i]=new WeakMap);const m=Ke[i];return c.forEach((function e(t){t&&!d.has(t)&&(d.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!u.has(t)&&Array.prototype.forEach.call(t.children,(t=>{if(d.has(t))e(t);else{const e=l?t.getAttribute(l):null,n=null!==e&&"false"!==e,r=(qe.get(t)||0)+1,c=(m.get(t)||0)+1;qe.set(t,r),m.set(t,c),p.push(t),1===r&&n&&$e.add(t),1===c&&t.setAttribute(i,""),!n&&l&&t.setAttribute(l,"true")}}))}(t),d.clear(),Qe++,()=>{p.forEach((e=>{const t=(qe.get(e)||0)-1,n=(m.get(e)||0)-1;qe.set(e,t),m.set(e,n),t||(!$e.has(e)&&l&&e.removeAttribute(l),$e.delete(e)),n||e.removeAttribute(i)})),Qe--,Qe||(qe=new WeakMap,qe=new WeakMap,$e=new WeakSet,Ke={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const nt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function rt(e,t){const n=W(e,nt());"prev"===t&&n.reverse();const r=n.indexOf(l(v(e)));return n.slice(r+1)[0]}function at(){return rt(document.body,"next")}function ot(){return rt(document.body,"prev")}function it(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!c(n,r)}function st(e){W(e,nt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function lt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const ct={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function dt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const ut=r.forwardRef((function(e,t){const[n,i]=r.useState();pe((()=>(f()&&i("button"),document.addEventListener("keydown",dt),()=>{document.removeEventListener("keydown",dt)})),[]);const l={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Be("focus-guard")]:"",style:ct};return r.createElement("span",we({},e,l))})),pt=r.createContext(null);function mt(e){let{id:t,root:n}=void 0===e?{}:e;const[l,c]=r.useState(null),d=Oe(),u=ht(),p=r.useMemo((()=>({id:t,root:n,portalContext:u,uniqueId:d})),[t,n,u,d]),m=r.useRef();return pe((()=>()=>{null==l||l.remove()}),[l,p]),pe((()=>{if(m.current===p)return;m.current=p;const{id:e,root:t,portalContext:n,uniqueId:r}=p,l=e?document.getElementById(e):null,d=Be("portal");if(l){const e=document.createElement("div");e.id=r,e.setAttribute(d,""),l.appendChild(e),c(e)}else{let l=t||(null==n?void 0:n.portalNode);l&&!(0,i.kK)(l)&&(l=l.current),l=l||document.body;let u=null;e&&(u=document.createElement("div"),u.id=e,l.appendChild(u));const p=document.createElement("div");p.id=r,p.setAttribute(d,""),l=u||l,l.appendChild(p),c(p)}}),[p]),l}function ft(e){let{children:t,id:n,root:i=null,preserveTabOrder:l=!0}=e;const c=mt({id:n,root:i}),[d,u]=r.useState(null),p=r.useRef(null),m=r.useRef(null),f=r.useRef(null),h=r.useRef(null),g=!!d&&!d.modal&&d.open&&l&&!(!i&&!c);return r.useEffect((()=>{if(c&&l&&(null==d||!d.modal))return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&it(e)){("focusin"===e.type?lt:st)(c)}}}),[c,l,null==d?void 0:d.modal]),r.createElement(pt.Provider,{value:r.useMemo((()=>({preserveTabOrder:l,beforeOutsideRef:p,afterOutsideRef:m,beforeInsideRef:f,afterInsideRef:h,portalNode:c,setFocusManagerState:u})),[l,c])},g&&c&&r.createElement(ut,{"data-type":"outside",ref:p,onFocus:e=>{if(it(e,c)){var t;null==(t=f.current)||t.focus()}else{const e=ot()||(null==d?void 0:d.refs.domReference.current);null==e||e.focus()}}}),g&&c&&r.createElement("span",{"aria-owns":c.id,style:ct}),c&&(0,r.createPortal)(t,c),g&&c&&r.createElement(ut,{"data-type":"outside",ref:m,onFocus:e=>{if(it(e,c)){var t;null==(t=h.current)||t.focus()}else{const t=at()||(null==d?void 0:d.refs.domReference.current);null==t||t.focus(),(null==d?void 0:d.closeOnFocusOut)&&(null==d||d.onOpenChange(!1,e.nativeEvent))}}}))}const ht=()=>r.useContext(pt),gt=20;let _t=[];function vt(e){_t=_t.filter((e=>e.isConnected)),e&&"body"!==(0,i.wk)(e)&&(_t.push(e),_t.length>gt&&(_t=_t.slice(-gt)))}function bt(){return _t.slice().reverse().find((e=>e.isConnected))}const Et=r.forwardRef((function(e,t){return r.createElement("button",we({},e,{type:"button",ref:t,tabIndex:-1,style:ct}))}));function yt(e){const{context:t,children:n,disabled:d=!1,order:u=["content"],guards:f=!0,initialFocus:h=0,returnFocus:g=!0,modal:_=!0,visuallyHiddenDismiss:b=!1,closeOnFocusOut:y=!0}=e,{open:x,refs:C,nodeId:T,onOpenChange:R,events:O,dataRef:N,elements:{domReference:I,floating:A}}=t,M="number"==typeof h&&h<0,k=w(I)&&M,D=!Xe()||f,L=Fe(u),P=Fe(h),j=Fe(g),B=De(),F=ht(),U=r.useRef(null),G=r.useRef(null),H=r.useRef(!1),V=r.useRef(!1),z=null!=F,Y=r.useCallback((function(e){return void 0===e&&(e=A),e?W(e,nt()):[]}),[A]),Z=r.useCallback((e=>{const t=Y(e);return L.current.map((e=>I&&"reference"===e?I:A&&"floating"===e?A:t)).filter(Boolean).flat()}),[I,A,L,Y]);function q(e){return!d&&b&&_?r.createElement(Et,{ref:"start"===e?U:G,onClick:e=>R(!1,e.nativeEvent)},"string"==typeof b?b:"Dismiss"):null}r.useEffect((()=>{if(d||!_)return;function e(e){if("Tab"===e.key){c(A,l(v(A)))&&0===Y().length&&!k&&S(e);const t=Z(),n=E(e);"reference"===L.current[0]&&n===I&&(S(e),e.shiftKey?ue(t[t.length-1]):ue(t[1])),"floating"===L.current[1]&&n===A&&e.shiftKey&&(S(e),ue(t[0]))}}const t=v(A);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[d,I,A,_,L,k,Y,Z]),r.useEffect((()=>{if(!d&&y)return A&&(0,i.Re)(I)?(I.addEventListener("focusout",t),I.addEventListener("pointerdown",e),!_&&A.addEventListener("focusout",t),()=>{I.removeEventListener("focusout",t),I.removeEventListener("pointerdown",e),!_&&A.removeEventListener("focusout",t)}):void 0;function e(){V.current=!0,setTimeout((()=>{V.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(c(I,t)||c(A,t)||c(t,A)||c(null==F?void 0:F.portalNode,t)||null!=t&&t.hasAttribute(Be("focus-guard"))||B&&(We(B.nodesRef.current,T).find((e=>{var n,r;return c(null==(n=e.context)?void 0:n.elements.floating,t)||c(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],i=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;i;){const t=e.find((e=>e.id===i));i=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(B.nodesRef.current,T).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!V.current&&t!==bt()&&(H.current=!0,R(!1,e))}))}}),[d,I,A,_,T,B,F,R,y]),r.useEffect((()=>{var e;if(d)return;const t=Array.from((null==F||null==(e=F.portalNode)?void 0:e.querySelectorAll("["+Be("portal")+"]"))||[]);if(A){const e=[A,...t,U.current,G.current,L.current.includes("reference")||k?I:null].filter((e=>null!=e)),n=_||k?tt(e,D,!D):tt(e);return()=>{n()}}}),[d,I,A,_,L,F,k,D]),pe((()=>{if(d||!A)return;const e=l(v(A));queueMicrotask((()=>{const t=Z(A),n=P.current,r=("number"==typeof n?t[n]:n.current)||A,i=c(A,e);M||i||!x||ue(r,{preventScroll:r===A})}))}),[d,x,A,M,Z,P]),pe((()=>{if(d||!A)return;let e=!1;const t=v(A),n=l(t),r=N.current;function u(t){let{reason:n,event:r,nested:i}=t;"escape-key"===n&&C.domReference.current&&vt(C.domReference.current),"hover"===n&&"mouseleave"===r.type&&(H.current=!0),"outside-press"===n&&(i?(H.current=!1,e=!0):H.current=!(p(r)||m(r)))}return vt(n),O.on("openchange",u),()=>{O.off("openchange",u);const n=l(t),d=c(A,n)||B&&We(B.nodesRef.current,T).some((e=>{var t;return c(null==(t=e.context)?void 0:t.elements.floating,n)}));(d||r.openEvent&&["click","mousedown"].includes(r.openEvent.type))&&C.domReference.current&&vt(C.domReference.current);const p=bt();j.current&&!H.current&&(0,i.Re)(p)&&(p===n||n===t.body||d)&&ue(p,{cancelPrevious:!1,preventScroll:e})}}),[d,A,j,N,C,O,B,T]),pe((()=>{if(!d&&F)return F.setFocusManagerState({modal:_,closeOnFocusOut:y,open:x,onOpenChange:R,refs:C}),()=>{F.setFocusManagerState(null)}}),[d,F,_,x,R,C,y]),pe((()=>{if(d||!A||"function"!=typeof MutationObserver||M)return;const e=()=>{const e=A.getAttribute("tabindex");L.current.includes("floating")||l(v(A))!==C.domReference.current&&0===Y().length?"0"!==e&&A.setAttribute("tabindex","0"):"-1"!==e&&A.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(A,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[d,A,C,L,Y,M]);const $=!d&&D&&(z||_);return r.createElement(r.Fragment,null,$&&r.createElement(ut,{"data-type":"inside",ref:null==F?void 0:F.beforeInsideRef,onFocus:e=>{if(_){const e=Z();ue("reference"===u[0]?e[0]:e[e.length-1])}else if(null!=F&&F.preserveTabOrder&&F.portalNode)if(H.current=!1,it(e,F.portalNode)){const e=at()||I;null==e||e.focus()}else{var t;null==(t=F.beforeOutsideRef.current)||t.focus()}}}),!k&&q("start"),n,q("end"),$&&r.createElement(ut,{"data-type":"inside",ref:null==F?void 0:F.afterInsideRef,onFocus:e=>{if(_)ue(Z()[0]);else if(null!=F&&F.preserveTabOrder&&F.portalNode)if(y&&(H.current=!0),it(e,F.portalNode)){const e=ot()||I;null==e||e.focus()}else{var t;null==(t=F.afterOutsideRef.current)||t.focus()}}}))}const xt=new Set,St=r.forwardRef((function(e,t){let{lockScroll:n=!1,...i}=e;const l=Oe();return pe((()=>{if(!n)return;xt.add(l);const e=/iP(hone|ad|od)|iOS/.test(d()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",i=window.innerWidth-document.documentElement.clientWidth,c=t.left?parseFloat(t.left):window.pageXOffset,u=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",i&&(t[r]=i+"px"),e){var p,m;const e=(null==(p=window.visualViewport)?void 0:p.offsetLeft)||0,n=(null==(m=window.visualViewport)?void 0:m.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(u-Math.floor(n))+"px",left:-(c-Math.floor(e))+"px",right:"0"})}return()=>{xt.delete(l),0===xt.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(c,u)))}}),[l,n]),r.createElement("div",we({ref:t},i,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}}))}));function wt(e){return(0,i.Re)(e.target)&&"BUTTON"===e.target.tagName}function Ct(e){return x(e)}function Tt(e,t){void 0===t&&(t={});const{open:n,onOpenChange:i,dataRef:l,elements:{domReference:c}}=e,{enabled:d=!0,event:u="click",toggle:p=!0,ignoreMouse:m=!1,keyboardHandlers:f=!0}=t,h=r.useRef(),g=r.useRef(!1);return r.useMemo((()=>d?{reference:{onPointerDown(e){h.current=e.pointerType},onMouseDown(e){0===e.button&&(_(h.current,!0)&&m||"click"!==u&&(!n||!p||l.current.openEvent&&"mousedown"!==l.current.openEvent.type?(e.preventDefault(),i(!0,e.nativeEvent,"click")):i(!1,e.nativeEvent,"click")))},onClick(e){"mousedown"===u&&h.current?h.current=void 0:_(h.current,!0)&&m||(!n||!p||l.current.openEvent&&"click"!==l.current.openEvent.type?i(!0,e.nativeEvent,"click"):i(!1,e.nativeEvent,"click"))},onKeyDown(e){h.current=void 0,e.defaultPrevented||!f||wt(e)||(" "!==e.key||Ct(c)||(e.preventDefault(),g.current=!0),"Enter"===e.key&&i(!n||!p,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!f||wt(e)||Ct(c)||" "===e.key&&g.current&&(g.current=!1,i(!n||!p,e.nativeEvent,"click"))}}}:{}),[d,l,u,m,f,c,p,n,i])}function Rt(e){return null!=e&&null!=e.clientX}function Ot(e,t){void 0===t&&(t={});const{open:n,refs:l,dataRef:d,elements:{floating:u}}=e,{enabled:p=!0,axis:m="both",x:f=null,y:h=null}=t,g=r.useRef(!1),v=r.useRef(null),[b,y]=r.useState(),[x,S]=r.useState([]),w=K(((e,t)=>{g.current||d.current.openEvent&&!Rt(d.current.openEvent)||l.setPositionReference(function(e,t){let n=null,r=null,i=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var l,c;const d=(null==(l=e.current)?void 0:l.getBoundingClientRect())||{width:0,height:0,x:0,y:0},u="x"===t.axis||"both"===t.axis,p="y"===t.axis||"both"===t.axis,m=["mouseenter","mousemove"].includes((null==(c=t.dataRef.current.openEvent)?void 0:c.type)||"")&&"touch"!==t.pointerType;let f=d.width,h=d.height,g=d.x,_=d.y;return null==n&&t.x&&u&&(n=d.x-t.x),null==r&&t.y&&p&&(r=d.y-t.y),g-=n||0,_-=r||0,f=0,h=0,!i||m?(f="y"===t.axis?d.width:0,h="x"===t.axis?d.height:0,g=u&&null!=t.x?t.x:g,_=p&&null!=t.y?t.y:_):i&&!m&&(h="x"===t.axis?d.height:h,f="y"===t.axis?d.width:f),i=!0,{width:f,height:h,x:g,y:_,top:_,right:g+f,bottom:_+h,left:g}}}}(l.domReference,{x:e,y:t,axis:m,dataRef:d,pointerType:b}))})),C=K((e=>{null==f&&null==h&&(n?v.current||S([]):w(e.clientX,e.clientY))})),T=_(b)?u:n,R=r.useCallback((()=>{if(!T||!p||null!=f||null!=h)return;const e=(0,i.Jj)(l.floating.current);function t(n){const r=E(n);c(l.floating.current,r)?(e.removeEventListener("mousemove",t),v.current=null):w(n.clientX,n.clientY)}if(!d.current.openEvent||Rt(d.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),v.current=null};return v.current=n,n}l.setPositionReference(l.domReference.current)}),[d,p,T,l,w,f,h]);return r.useEffect((()=>R()),[R,x]),r.useEffect((()=>{p&&!u&&(g.current=!1)}),[p,u]),r.useEffect((()=>{!p&&n&&(g.current=!0)}),[p,n]),pe((()=>{!p||null==f&&null==h||(g.current=!1,w(f,h))}),[p,f,h,w]),r.useMemo((()=>{if(!p)return{};function e(e){let{pointerType:t}=e;y(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:C,onMouseEnter:C}}}),[p,C])}const Nt={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},It={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},At=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Mt(e,t){void 0===t&&(t={});const{open:n,onOpenChange:l,nodeId:d,elements:{reference:u,domReference:p,floating:m},dataRef:f}=e,{enabled:h=!0,escapeKey:g=!0,outsidePress:_=!0,outsidePressEvent:y="pointerdown",referencePress:x=!1,referencePressEvent:S="pointerdown",ancestorScroll:w=!1,bubbles:C,capture:T}=t,R=De(),O=K("function"==typeof _?_:()=>!1),N="function"==typeof _?O:_,I=r.useRef(!1),A=r.useRef(!1),{escapeKey:M,outsidePress:k}=At(C),{escapeKey:D,outsidePress:L}=At(T),P=K((e=>{if(!n||!h||!g||"Escape"!==e.key)return;const t=R?We(R.nodesRef.current,d):[];if(!M&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}l(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),j=K((e=>{var t;const n=()=>{var t;P(e),null==(t=E(e))||t.removeEventListener("keydown",n)};null==(t=E(e))||t.addEventListener("keydown",n)})),B=K((e=>{const t=I.current;I.current=!1;const n=A.current;if(A.current=!1,"click"===y&&n)return;if(t)return;if("function"==typeof N&&!N(e))return;const r=E(e),u="["+Be("inert")+"]",f=v(m).querySelectorAll(u);let h=(0,i.kK)(r)?r:null;for(;h&&!(0,i.Py)(h);){const e=(0,i.Ow)(h);if((0,i.Py)(e)||!(0,i.kK)(e))break;h=e}if(f.length&&(0,i.kK)(r)&&!r.matches("html,body")&&!c(r,m)&&Array.from(f).every((e=>!c(h,e))))return;if((0,i.Re)(r)&&m){const t=r.clientWidth>0&&r.scrollWidth>r.clientWidth,n=r.clientHeight>0&&r.scrollHeight>r.clientHeight;let l=n&&e.offsetX>r.clientWidth;if(n){"rtl"===(0,i.Dx)(r).direction&&(l=e.offsetX<=r.offsetWidth-r.clientWidth)}if(l||t&&e.offsetY>r.clientHeight)return}const g=R&&We(R.nodesRef.current,d).some((t=>{var n;return b(e,null==(n=t.context)?void 0:n.elements.floating)}));if(b(e,m)||b(e,p)||g)return;const _=R?We(R.nodesRef.current,d):[];if(_.length>0){let e=!0;if(_.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}l(!1,e,"outside-press")})),F=K((e=>{var t;const n=()=>{var t;B(e),null==(t=E(e))||t.removeEventListener(y,n)};null==(t=E(e))||t.addEventListener(y,n)}));return r.useEffect((()=>{if(!n||!h)return;function e(e){l(!1,e,"ancestor-scroll")}f.current.__escapeKeyBubbles=M,f.current.__outsidePressBubbles=k;const t=v(m);g&&t.addEventListener("keydown",D?j:P,D),N&&t.addEventListener(y,L?F:B,L);let r=[];return w&&((0,i.kK)(p)&&(r=(0,i.Kx)(p)),(0,i.kK)(m)&&(r=r.concat((0,i.Kx)(m))),!(0,i.kK)(u)&&u&&u.contextElement&&(r=r.concat((0,i.Kx)(u.contextElement)))),r=r.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),r.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{g&&t.removeEventListener("keydown",D?j:P,D),N&&t.removeEventListener(y,L?F:B,L),r.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[f,m,p,u,g,N,y,n,l,w,h,M,k,P,D,j,B,L,F]),r.useEffect((()=>{I.current=!1}),[N,y]),r.useMemo((()=>h?{reference:{onKeyDown:P,[Nt[S]]:e=>{x&&l(!1,e.nativeEvent,"reference-press")}},floating:{onKeyDown:P,onMouseDown(){A.current=!0},onMouseUp(){A.current=!0},[It[y]]:()=>{I.current=!0}}}:{}),[h,x,y,S,l,P])}function kt(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:l,nodeId:c}=e;const[d,u]=r.useState(null),p=(null==(t=e.elements)?void 0:t.reference)||d,m=(0,R.YF)(e),f=De(),h=null!=ke(),g=K(((e,t,n)=>{e&&(v.current.openEvent=t),b.emit("openchange",{open:e,event:t,reason:n,nested:h}),null==l||l(e,t,n)})),_=r.useRef(null),v=r.useRef({}),b=r.useState((()=>Ie()))[0],E=Oe(),y=r.useCallback((e=>{const t=(0,i.kK)(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;m.refs.setReference(t)}),[m.refs]),x=r.useCallback((e=>{((0,i.kK)(e)||null===e)&&(_.current=e,u(e)),((0,i.kK)(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!(0,i.kK)(e))&&m.refs.setReference(e)}),[m.refs]),S=r.useMemo((()=>({...m.refs,setReference:x,setPositionReference:y,domReference:_})),[m.refs,x,y]),w=r.useMemo((()=>({...m.elements,domReference:p})),[m.elements,p]),C=r.useMemo((()=>({...m,refs:S,elements:w,dataRef:v,nodeId:c,floatingId:E,events:b,open:n,onOpenChange:g})),[m,c,E,b,n,g,S,w]);return pe((()=>{const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===c));e&&(e.context=C)})),r.useMemo((()=>({...m,context:C,refs:S,elements:w})),[m,S,w,C])}function Dt(e,t){void 0===t&&(t={});const{open:n,onOpenChange:d,events:u,refs:p,elements:{floating:h,domReference:_}}=e,{enabled:b=!0,visibleOnly:y=!0}=t,S=r.useRef(!1),w=r.useRef(),C=r.useRef(!0);return r.useEffect((()=>{if(!b)return;const e=(0,i.Jj)(_);function t(){!n&&(0,i.Re)(_)&&_===l(v(_))&&(S.current=!0)}function r(){C.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[_,n,b]),r.useEffect((()=>{if(b)return u.on("openchange",e),()=>{u.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(S.current=!0)}}),[u,b]),r.useEffect((()=>()=>{clearTimeout(w.current)}),[]),r.useMemo((()=>b?{reference:{onPointerDown(e){m(e.nativeEvent)||(C.current=!1)},onMouseLeave(){S.current=!1},onFocus(e){if(S.current)return;const t=E(e.nativeEvent);if(y&&(0,i.kK)(t))try{if(f()&&g())throw Error();if(!t.matches(":focus-visible"))return}catch(n){if(!C.current&&!x(t))return}d(!0,e.nativeEvent,"focus")},onBlur(e){S.current=!1;const t=e.relatedTarget,n=(0,i.kK)(t)&&t.hasAttribute(Be("focus-guard"))&&"outside"===t.getAttribute("data-type");w.current=window.setTimeout((()=>{const r=l(_?_.ownerDocument:document);(t||r!==_)&&(c(p.floating.current,t)||c(_,t)||n||d(!1,e.nativeEvent,"focus"))}))}}}:{}),[b,y,_,p,d])}const Lt="active",Pt="selected";function jt(e,t,n){const r=new Map,i="item"===n;let l=e;if(i&&e){const{[Lt]:t,[Pt]:n,...r}=e;l=r}return{..."floating"===n&&{tabIndex:-1},...l,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,l]=t;var c;i&&[Lt,Pt].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof l&&(null==(c=r.get(n))||c.push(l),e[n]=function(){for(var e,t=arguments.length,i=new Array(t),l=0;l<t;l++)i[l]=arguments[l];return null==(e=r.get(n))?void 0:e.map((e=>e(...i))).find((e=>void 0!==e))})):e[n]=l)})),e):e),{})}}function Bt(e){void 0===e&&(e=[]);const t=e,n=r.useCallback((t=>jt(t,e,"reference")),t),i=r.useCallback((t=>jt(t,e,"floating")),t),l=r.useCallback((t=>jt(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return r.useMemo((()=>({getReferenceProps:n,getFloatingProps:i,getItemProps:l})),[n,i,l])}let Ft=!1;function Ut(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Gt(e,t){return Ut(t,e===Q||e===X,e===J||e===ee)}function Ht(e,t,n){return Ut(t,e===X,n?e===J:e===ee)||"Enter"===e||" "===e||""===e}function Vt(e,t,n){return Ut(t,n?e===ee:e===J,e===Q)}function zt(e,t){const{open:n,onOpenChange:d,refs:u,elements:{domReference:h,floating:_}}=e,{listRef:b,activeIndex:E,onNavigate:y=()=>{},enabled:x=!0,selectedIndex:C=null,allowEscape:T=!1,loop:R=!1,nested:O=!1,rtl:N=!1,virtual:I=!1,focusItemOnOpen:A="auto",focusItemOnHover:M=!0,openOnArrowKeyDown:k=!0,disabledIndices:D,orientation:L="vertical",cols:P=1,scrollItemIntoView:j=!0,virtualItemRef:B,itemSizes:F,dense:U=!1}=t;const G=ke(),H=De(),V=K(y),z=r.useRef(A),Y=r.useRef(null!=C?C:-1),Z=r.useRef(null),W=r.useRef(!0),q=r.useRef(V),$=r.useRef(!!_),Q=r.useRef(!1),te=r.useRef(!1),de=Fe(D),me=Fe(n),fe=Fe(j),[he,ge]=r.useState(),[_e,ve]=r.useState(),be=K((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(I?(ge(r.id),null==H||H.events.emit("virtualfocus",r),B&&(B.current=r)):ue(r,{preventScroll:!0,sync:!(!g()||!f())&&(Ft||Q.current)}),requestAnimationFrame((()=>{const e=fe.current;e&&r&&(n||!W.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));pe((()=>{document.createElement("div").focus({get preventScroll(){return Ft=!0,!1}})}),[]),pe((()=>{x&&(n&&_?z.current&&null!=C&&(te.current=!0,Y.current=C,V(C)):$.current&&(Y.current=-1,q.current(null)))}),[x,n,_,C,V]),pe((()=>{if(x&&n&&_)if(null==E){if(Q.current=!1,null!=C)return;if($.current&&(Y.current=-1,be(b,Y)),!$.current&&z.current&&(null!=Z.current||!0===z.current&&null==Z.current)){let e=0;const t=()=>{if(null==b.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else Y.current=null==Z.current||Ht(Z.current,L,N)||O?re(b,de.current):ae(b,de.current),Z.current=null,V(Y.current)};t()}}else ne(b,E)||(Y.current=E,be(b,Y,te.current),te.current=!1)}),[x,n,_,E,C,O,b,L,N,V,be,de]),pe((()=>{var e;if(!x||_||!H||I||!$.current)return;const t=H.nodesRef.current,n=null==(e=t.find((e=>e.id===G)))||null==(e=e.context)?void 0:e.elements.floating,r=l(v(_)),i=t.some((e=>e.context&&c(e.context.elements.floating,r)));n&&!i&&W.current&&n.focus({preventScroll:!0})}),[x,_,H,G,I]),pe((()=>{if(x&&H&&I&&!G)return H.events.on("virtualfocus",e),()=>{H.events.off("virtualfocus",e)};function e(e){ve(e.id),B&&(B.current=e)}}),[x,H,I,G,B]),pe((()=>{q.current=V,$.current=!!_})),pe((()=>{n||(Z.current=null)}),[n]);const Ee=null!=E,ye=r.useMemo((()=>{function e(e){if(!n)return;const t=b.current.indexOf(e);-1!==t&&V(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...M&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;W.current&&"touch"!==t&&(Y.current=-1,be(b,Y),V(null),I||ue(u.floating.current,{preventScroll:!0}))}}}}),[n,u,be,M,b,V,I]);return r.useMemo((()=>{if(!x)return{};const e=de.current;function t(t){if(W.current=!1,Q.current=!0,!me.current&&t.currentTarget===u.floating.current)return;if(O&&Vt(t.key,L,N))return S(t),d(!1,t.nativeEvent,"list-navigation"),void((0,i.Re)(h)&&!I&&h.focus());const r=Y.current,c=re(b,e),p=ae(b,e);if("Home"===t.key&&(S(t),Y.current=c,V(Y.current)),"End"===t.key&&(S(t),Y.current=p,V(Y.current)),P>1){const n=F||Array.from({length:b.current.length},(()=>({width:1,height:1}))),r=se(n,P,U),i=r.findIndex((t=>null!=t&&!(null!=e&&e.includes(t)))),l=r.reduce(((t,n,r)=>null==n||null!=e&&e.includes(n)?t:r),-1);if(Y.current=r[ie({current:r.map((e=>null!=e?b.current[e]:null))},{event:t,orientation:L,loop:R,cols:P,disabledIndices:ce([...e||[],void 0],r),minIndex:i,maxIndex:l,prevIndex:le(Y.current,n,r,P,t.key===X?"bl":t.key===ee?"tr":"tl"),stopEvent:!0})],V(Y.current),"both"===L)return}if(Gt(t.key,L)){if(S(t),n&&!I&&l(t.currentTarget.ownerDocument)===t.currentTarget)return Y.current=Ht(t.key,L,N)?c:p,void V(Y.current);Ht(t.key,L,N)?Y.current=R?r>=p?T&&r!==b.current.length?-1:c:oe(b,{startingIndex:r,disabledIndices:e}):Math.min(p,oe(b,{startingIndex:r,disabledIndices:e})):Y.current=R?r<=c?T&&-1!==r?b.current.length:p:oe(b,{startingIndex:r,decrement:!0,disabledIndices:e}):Math.max(c,oe(b,{startingIndex:r,decrement:!0,disabledIndices:e})),ne(b,Y.current)?V(null):V(Y.current)}}function r(e){"auto"===A&&p(e.nativeEvent)&&(z.current=!0)}const c=I&&n&&Ee&&{"aria-activedescendant":_e||he},f=b.current.find((e=>(null==e?void 0:e.id)===he));return{reference:{...c,onKeyDown(r){W.current=!1;const i=0===r.key.indexOf("Arrow"),l=function(e,t,n){return Ut(t,n?e===J:e===ee,e===X)}(r.key,L,N),c=Vt(r.key,L,N),u=Gt(r.key,L),p=(O?l:u)||"Enter"===r.key||""===r.key.trim();if(I&&n){const e=null==H?void 0:H.nodesRef.current.find((e=>null==e.parentId)),n=H&&e?function(e,t){let n,r=-1;return function t(i,l){l>r&&(n=i,r=l),We(e,i).forEach((e=>{t(e.id,l+1)}))}(t,0),e.find((e=>e.id===n))}(H.nodesRef.current,e.id):null;if(i&&n&&B){const e=new KeyboardEvent("keydown",{key:r.key,bubbles:!0});if(l||c){var m,h;const t=(null==(m=n.context)?void 0:m.elements.domReference)===r.currentTarget,i=c&&!t?null==(h=n.context)?void 0:h.elements.domReference:l?f:null;i&&(S(r),i.dispatchEvent(e),ve(void 0))}var g;if(u&&n.context)if(n.context.open&&n.parentId&&r.currentTarget!==n.context.elements.domReference)return S(r),void(null==(g=n.context.elements.domReference)||g.dispatchEvent(e))}return t(r)}(n||k||!i)&&(p&&(Z.current=O&&u?null:r.key),O?l&&(S(r),n?(Y.current=re(b,e),V(Y.current)):d(!0,r.nativeEvent,"list-navigation")):u&&(null!=C&&(Y.current=C),S(r),!n&&k?d(!0,r.nativeEvent,"list-navigation"):t(r),n&&V(Y.current)))},onFocus(){n&&V(null)},onPointerDown:function(e){z.current=A,"auto"===A&&m(e.nativeEvent)&&(z.current=!0)},onMouseDown:r,onClick:r},floating:{"aria-orientation":"both"===L?void 0:L,...!w(h)&&c,onKeyDown:t,onPointerMove(){W.current=!0}},item:ye}}),[h,u,he,_e,de,me,b,x,L,N,I,n,Ee,O,C,k,T,P,R,A,V,d,ye,H,B,F,U])}const Yt=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Zt(e,t){var n;void 0===t&&(t={});const{open:i,floatingId:l}=e,{enabled:c=!0,role:d="dialog"}=t,u=null!=(n=Yt.get(d))?n:d,p=Oe(),m=null!=ke();return r.useMemo((()=>{if(!c)return{};const e={id:l,...u&&{role:u}};return"tooltip"===u||"label"===d?{reference:{["aria-"+("label"===d?"labelledby":"describedby")]:i?l:void 0},floating:e}:{reference:{"aria-expanded":i?"true":"false","aria-haspopup":"alertdialog"===u?"dialog":u,"aria-controls":i?l:void 0,..."listbox"===u&&{role:"combobox"},..."menu"===u&&{id:p},..."menu"===u&&m&&{role:"menuitem"},..."select"===d&&{"aria-autocomplete":"none"},..."combobox"===d&&{"aria-autocomplete":"list"}},floating:{...e,..."menu"===u&&{"aria-labelledby":p}},item(e){let{active:t,selec