UNPKG

nx

Version:

The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.

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