@equisoft/design-elements-react 9.8.3-snapshot.20250630124940 → 9.8.3-snapshot.20250701133942

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/bundle.js +1 -1
  2. package/package.json +1 -1
package/dist/bundle.js CHANGED
@@ -2895,7 +2895,7 @@
2895
2895
  position: absolute;
2896
2896
  width: 100%;
2897
2897
  z-index: 700;
2898
- `;t.DropdownMenu=(0,o.forwardRef)((e,t)=>{var{children:n,className:r,id:l,hidden:c,onKeyDown:m}=e,p=a(e,["children","className","id","hidden","onKeyDown"]);const f=(0,o.useMemo)(()=>l||(0,s.v4)(),[l]),h=(0,u.useDataAttributes)(p);return(0,i.jsx)(d,Object.assign({ref:t,className:r,"data-testid":"menu-list",id:f,hidden:c,onKeyDownCapture:e=>null==m?void 0:m(e)},h,{children:n}))});try{t.DropdownMenu.displayName="DropdownMenu",t.DropdownMenu.__docgenInfo={description:"",displayName:"DropdownMenu",props:{id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},hidden:{defaultValue:null,description:"",name:"hidden",required:!1,type:{name:"boolean"}},onKeyDown:{defaultValue:null,description:"",name:"onKeyDown",required:!1,type:{name:"((event: KeyboardEvent<Element>) => void)"}},ref:{defaultValue:null,description:"Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}",name:"ref",required:!1,type:{name:"LegacyRef<HTMLDivElement>"}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"Key | null"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/dropdown-menu/dropdown-menu.tsx#DropdownMenu"]={docgenInfo:t.DropdownMenu.__docgenInfo,name:"DropdownMenu",path:"src/components/dropdown-menu/dropdown-menu.tsx#DropdownMenu"})}catch(e){}},74464:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var a,r,i=n(39155);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},o.apply(null,arguments)}const l=function(e){return i.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),a||(a=i.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M8 14.667A6.667 6.667 0 1 0 8 1.333a6.667 6.667 0 0 0 0 13.334"})),r||(r=i.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M10.667 8 8 5.333 5.333 8M8 10.667V5.333"})))}},74785:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Composite:()=>yn,CompositeItem:()=>wn,FloatingArrow:()=>xn,FloatingDelayGroup:()=>Bn,FloatingFocusManager:()=>wa,FloatingList:()=>rn,FloatingNode:()=>Pn,FloatingOverlay:()=>ka,FloatingPortal:()=>ma,FloatingTree:()=>On,NextFloatingDelayGroup:()=>Kn,arrow:()=>en,autoPlacement:()=>Qt,autoUpdate:()=>Ht,computePosition:()=>At,detectOverflow:()=>Lt,flip:()=>Gt,getOverflowAncestors:()=>_,hide:()=>Jt,inline:()=>Zt,inner:()=>tr,limitShift:()=>Yt,offset:()=>Ut,platform:()=>xt,safePolygon:()=>rr,shift:()=>Kt,size:()=>Xt,useClick:()=>Ta,useClientPoint:()=>La,useDelayGroup:()=>$n,useDelayGroupContext:()=>Nn,useDismiss:()=>Pa,useFloating:()=>Da,useFloatingNodeId:()=>qn,useFloatingParentNodeId:()=>Vn,useFloatingPortalNode:()=>ca,useFloatingRootContext:()=>Oa,useFloatingTree:()=>Sn,useFocus:()=>ja,useHover:()=>Fn,useId:()=>Cn,useInnerOffset:()=>nr,useInteractions:()=>Aa,useListItem:()=>on,useListNavigation:()=>Ua,useMergeRefs:()=>tn,useNextDelayGroup:()=>Yn,useRole:()=>Ya,useTransitionStatus:()=>Qa,useTransitionStyles:()=>Ja,useTypeahead:()=>Za});var a=n(39155),r=n.t(a,2);function i(){return"undefined"!=typeof window}function o(e){return s(e)?(e.nodeName||"").toLowerCase():"#document"}function l(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function u(e){var t;return null==(t=(s(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function s(e){return!!i()&&(e instanceof Node||e instanceof l(e).Node)}function d(e){return!!i()&&(e instanceof Element||e instanceof l(e).Element)}function c(e){return!!i()&&(e instanceof HTMLElement||e instanceof l(e).HTMLElement)}function m(e){return!(!i()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof l(e).ShadowRoot)}function p(e){const{overflow:t,overflowX:n,overflowY:a,display:r}=y(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!["inline","contents"].includes(r)}function f(e){return["table","td","th"].includes(o(e))}function h(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(e){return!1}})}function v(e){const t=g(),n=d(e)?y(e):e;return["transform","translate","scale","rotate","perspective"].some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some(e=>(n.willChange||"").includes(e))||["paint","layout","strict","content"].some(e=>(n.contain||"").includes(e))}function g(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function b(e){return["html","body","#document"].includes(o(e))}function y(e){return l(e).getComputedStyle(e)}function w(e){return d(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function M(e){if("html"===o(e))return e;const t=e.assignedSlot||e.parentNode||m(e)&&e.host||u(e);return m(t)?t.host:t}function E(e){const t=M(e);return b(t)?e.ownerDocument?e.ownerDocument.body:e.body:c(t)&&p(t)?t:E(t)}function _(e,t,n){var a;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=E(e),i=r===(null==(a=e.ownerDocument)?void 0:a.body),o=l(r);if(i){const e=k(o);return t.concat(o,o.visualViewport||[],p(r)?r:[],e&&n?_(e):[])}return t.concat(r,_(r,[],n))}function k(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const C=["top","right","bottom","left"],x=["start","end"],T=C.reduce((e,t)=>e.concat(t,t+"-"+x[0],t+"-"+x[1]),[]),H=Math.min,L=Math.max,V=Math.round,S=Math.floor,q=e=>({x:e,y:e}),P={left:"right",right:"left",bottom:"top",top:"bottom"},O={start:"end",end:"start"};function D(e,t,n){return L(e,H(t,n))}function R(e,t){return"function"==typeof e?e(t):e}function j(e){return e.split("-")[0]}function I(e){return e.split("-")[1]}function A(e){return"x"===e?"y":"x"}function F(e){return"y"===e?"height":"width"}function z(e){return["top","bottom"].includes(j(e))?"y":"x"}function W(e){return A(z(e))}function N(e,t,n){void 0===n&&(n=!1);const a=I(e),r=W(e),i=F(r);let o="x"===r?a===(n?"end":"start")?"right":"left":"start"===a?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=$(o)),[o,$(o)]}function B(e){return e.replace(/start|end/g,e=>O[e])}function $(e){return e.replace(/left|right|bottom|top/g,e=>P[e])}function U(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function K(e){const{x:t,y:n,width:a,height:r}=e;return{width:a,height:r,top:n,left:t,right:t+a,bottom:n+r,x:t,y:n}}var Y=["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])"].join(","),G="undefined"==typeof Element,X=G?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Q=!G&&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},J=function e(t,n){var a;void 0===n&&(n=!0);var r=null==t||null===(a=t.getAttribute)||void 0===a?void 0:a.call(t,"inert");return""===r||"true"===r||n&&t&&e(t.parentNode)},Z=function(e,t,n){if(J(e))return[];var a=Array.prototype.slice.apply(e.querySelectorAll(Y));return t&&X.call(e,Y)&&a.unshift(e),a.filter(n)},ee=function e(t,n,a){for(var r=[],i=Array.from(t);i.length;){var o=i.shift();if(!J(o,!1))if("SLOT"===o.tagName){var l=o.assignedElements(),u=e(l.length?l:o.children,!0,a);a.flatten?r.push.apply(r,u):r.push({scopeParent:o,candidates:u})}else{X.call(o,Y)&&a.filter(o)&&(n||!t.includes(o))&&r.push(o);var s=o.shadowRoot||"function"==typeof a.getShadowRoot&&a.getShadowRoot(o),d=!J(s,!1)&&(!a.shadowRootFilter||a.shadowRootFilter(o));if(s&&d){var c=e(!0===s?o.children:s.children,!0,a);a.flatten?r.push.apply(r,c):r.push({scopeParent:o,candidates:c})}else i.unshift.apply(i,o.children)}}return r},te=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ne=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))&&!te(e)?0:e.tabIndex},ae=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},re=function(e){return"INPUT"===e.tagName},ie=function(e){var t=e.getBoundingClientRect(),n=t.width,a=t.height;return 0===n&&0===a},oe=function(e,t){return!(t.disabled||J(t)||function(e){return re(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,a=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var r=X.call(e,"details>summary:first-of-type")?e.parentElement:e;if(X.call(r,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ie(e)}else{if("function"==typeof a){for(var i=e;e;){var o=e.parentElement,l=Q(e);if(o&&!o.shadowRoot&&!0===a(o))return ie(e);e=e.assignedSlot?e.assignedSlot:o||l===e.ownerDocument?o:l.host}e=i}if(function(e){var t,n,a,r,i=e&&Q(e),o=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(n=o)&&void 0!==n&&null!==(a=n.ownerDocument)&&void 0!==a&&a.contains(o)||null!=e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(e));!l&&o;){var u,s,d;l=!(null===(s=o=null===(u=i=Q(o))||void 0===u?void 0:u.host)||void 0===s||null===(d=s.ownerDocument)||void 0===d||!d.contains(o))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(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 a=t.children.item(n);if("LEGEND"===a.tagName)return!!X.call(t,"fieldset[disabled] *")||!a.contains(e)}return!0}t=t.parentElement}return!1}(t))},le=function(e,t){return!(function(e){return function(e){return re(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Q(e),a=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=a(window.CSS.escape(e.name));else try{t=a(e.name)}catch(e){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",e.message),!1}var r=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!r||r===e}(e)}(t)||ne(t)<0||!oe(e,t))},ue=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},se=function e(t){var n=[],a=[];return t.forEach(function(t,r){var i=!!t.scopeParent,o=i?t.scopeParent:t,l=function(e,t){var n=ne(e);return n<0&&t&&!te(e)?0:n}(o,i),u=i?e(t.candidates):o;0===l?i?n.push.apply(n,u):n.push(o):a.push({documentOrder:r,tabIndex:l,item:t,isScope:i,content:u})}),a.sort(ae).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(n)},de=function(e,t){var n;return n=(t=t||{}).getShadowRoot?ee([e],t.includeContainer,{filter:le.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ue}):Z(e,t.includeContainer,le.bind(null,t)),se(n)},ce=function(e,t){return(t=t||{}).getShadowRoot?ee([e],t.includeContainer,{filter:oe.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Z(e,t.includeContainer,oe.bind(null,t))},me=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==X.call(e,Y)&&le(t,e)};function pe(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function fe(){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 he(){return/apple/i.test(navigator.vendor)}function ve(){const e=/android/i;return e.test(pe())||e.test(fe())}function ge(){return fe().includes("jsdom/")}const be="data-floating-ui-focusable",ye="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",we="ArrowLeft",Me="ArrowRight",Ee="ArrowUp",_e="ArrowDown";function ke(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 Ce(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&m(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function xe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Te(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 He(e){return(null==e?void 0:e.ownerDocument)||document}function Le(e){return c(e)&&e.matches(ye)}function Ve(e){return!!e&&"combobox"===e.getAttribute("role")&&Le(e)}function Se(e){return e?e.hasAttribute(be)?e:e.querySelector("["+be+"]")||e:null}function qe(e,t){let n=e.filter(e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)}),a=n;for(;a.length;)a=e.filter(e=>{var t;return null==(t=a)?void 0:t.some(t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)})}),n=n.concat(a);return n}function Pe(e,t){var n;let a=[],r=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;r;){const t=e.find(e=>e.id===r);r=null==t?void 0:t.parentId,t&&(a=a.concat(t))}return a}function Oe(e){e.preventDefault(),e.stopPropagation()}function De(e){return!(0!==e.mozInputSource||!e.isTrusted)||(ve()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function Re(e){return!ge()&&(!ve()&&0===e.width&&0===e.height||ve()&&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 je(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var Ie="undefined"!=typeof document?a.useLayoutEffect:function(){};function Ae(e){const t=a.useRef(e);return Ie(()=>{t.current=e}),t}const Fe={...r}.useInsertionEffect||(e=>e());function ze(e){const t=a.useRef(()=>{});return Fe(()=>{t.current=e}),a.useCallback(function(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];return null==t.current?void 0:t.current(...n)},[])}function We(e,t,n){return Math.floor(e/t)!==n}function Ne(e,t){return t<0||t>=e.current.length}function Be(e,t){return Ue(e,{disabledIndices:t})}function $e(e,t){return Ue(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ue(e,t){let{startingIndex:n=-1,decrement:a=!1,disabledIndices:r,amount:i=1}=void 0===t?{}:t,o=n;do{o+=a?-i:i}while(o>=0&&o<=e.current.length-1&&Qe(e,o,r));return o}function Ke(e,t){let{event:n,orientation:a,loop:r,rtl:i,cols:o,disabledIndices:l,minIndex:u,maxIndex:s,prevIndex:d,stopEvent:c=!1}=t,m=d;if(n.key===Ee){if(c&&Oe(n),-1===d)m=s;else if(m=Ue(e,{startingIndex:m,amount:o,decrement:!0,disabledIndices:l}),r&&(d-o<u||m<0)){const e=d%o,t=s%o,n=s-(t-e);m=t===e?s:t>e?n:n-o}Ne(e,m)&&(m=d)}if(n.key===_e&&(c&&Oe(n),-1===d?m=u:(m=Ue(e,{startingIndex:d,amount:o,disabledIndices:l}),r&&d+o>s&&(m=Ue(e,{startingIndex:d%o-o,amount:o,disabledIndices:l}))),Ne(e,m)&&(m=d)),"both"===a){const t=S(d/o);n.key===(i?we:Me)&&(c&&Oe(n),d%o!==o-1?(m=Ue(e,{startingIndex:d,disabledIndices:l}),r&&We(m,o,t)&&(m=Ue(e,{startingIndex:d-d%o-1,disabledIndices:l}))):r&&(m=Ue(e,{startingIndex:d-d%o-1,disabledIndices:l})),We(m,o,t)&&(m=d)),n.key===(i?Me:we)&&(c&&Oe(n),d%o!==0?(m=Ue(e,{startingIndex:d,decrement:!0,disabledIndices:l}),r&&We(m,o,t)&&(m=Ue(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:l}))):r&&(m=Ue(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:l})),We(m,o,t)&&(m=d));const a=S(s/o)===t;Ne(e,m)&&(m=r&&a?n.key===(i?Me:we)?s:Ue(e,{startingIndex:d-d%o-1,disabledIndices:l}):d)}return m}function Ye(e,t,n){const a=[];let r=0;return e.forEach((e,i)=>{let{width:o,height:l}=e,u=!1;for(n&&(r=0);!u;){const e=[];for(let n=0;n<o;n++)for(let a=0;a<l;a++)e.push(r+n+a*t);r%t+o<=t&&e.every(e=>null==a[e])?(e.forEach(e=>{a[e]=i}),u=!0):r++}}),[...a]}function Ge(e,t,n,a,r){if(-1===e)return-1;const i=n.indexOf(e),o=t[e];switch(r){case"tl":return i;case"tr":return o?i+o.width-1:i;case"bl":return o?i+(o.height-1)*a:i;case"br":return n.lastIndexOf(e)}}function Xe(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function Qe(e,t,n){if("function"==typeof n)return n(t);if(n)return n.includes(t);const a=e.current[t];return null==a||a.hasAttribute("disabled")||"true"===a.getAttribute("aria-disabled")}const Je=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Ze(e,t){const n=de(e,Je()),a=n.length;if(0===a)return;const r=ke(He(e)),i=n.indexOf(r);return n[-1===i?1===t?0:a-1:i+t]}function et(e){return Ze(He(e).body,1)||e}function tt(e){return Ze(He(e).body,-1)||e}function nt(e,t){const n=t||e.currentTarget,a=e.relatedTarget;return!a||!Ce(n,a)}function at(e){de(e,Je()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function rt(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}var it=n(31085),ot=n(69514);function lt(e,t,n){let{reference:a,floating:r}=e;const i=z(t),o=W(t),l=F(o),u=j(t),s="y"===i,d=a.x+a.width/2-r.width/2,c=a.y+a.height/2-r.height/2,m=a[l]/2-r[l]/2;let p;switch(u){case"top":p={x:d,y:a.y-r.height};break;case"bottom":p={x:d,y:a.y+a.height};break;case"right":p={x:a.x+a.width,y:c};break;case"left":p={x:a.x-r.width,y:c};break;default:p={x:a.x,y:a.y}}switch(I(t)){case"start":p[o]-=m*(n&&s?-1:1);break;case"end":p[o]+=m*(n&&s?-1:1)}return p}async function ut(e,t){var n;void 0===t&&(t={});const{x:a,y:r,platform:i,rects:o,elements:l,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:d="viewport",elementContext:c="floating",altBoundary:m=!1,padding:p=0}=R(t,e),f=U(p),h=l[m?"floating"===c?"reference":"floating":c],v=K(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:s,rootBoundary:d,strategy:u})),g="floating"===c?{x:a,y:r,width:o.floating.width,height:o.floating.height}:o.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),y=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},w=K(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:b,strategy:u}):g);return{top:(v.top-w.top+f.top)/y.y,bottom:(w.bottom-v.bottom+f.bottom)/y.y,left:(v.left-w.left+f.left)/y.x,right:(w.right-v.right+f.right)/y.x}}function st(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function dt(e){return C.some(t=>e[t]>=0)}function ct(e){const t=H(...e.map(e=>e.left)),n=H(...e.map(e=>e.top));return{x:t,y:n,width:L(...e.map(e=>e.right))-t,height:L(...e.map(e=>e.bottom))-n}}function mt(e){const t=y(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=c(e),i=r?e.offsetWidth:n,o=r?e.offsetHeight:a,l=V(n)!==i||V(a)!==o;return l&&(n=i,a=o),{width:n,height:a,$:l}}function pt(e){return d(e)?e:e.contextElement}function ft(e){const t=pt(e);if(!c(t))return q(1);const n=t.getBoundingClientRect(),{width:a,height:r,$:i}=mt(t);let o=(i?V(n.width):n.width)/a,l=(i?V(n.height):n.height)/r;return o&&Number.isFinite(o)||(o=1),l&&Number.isFinite(l)||(l=1),{x:o,y:l}}const ht=q(0);function vt(e){const t=l(e);return g()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ht}function gt(e,t,n,a){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=pt(e);let o=q(1);t&&(a?d(a)&&(o=ft(a)):o=ft(e));const u=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==l(e))&&t}(i,n,a)?vt(i):q(0);let s=(r.left+u.x)/o.x,c=(r.top+u.y)/o.y,m=r.width/o.x,p=r.height/o.y;if(i){const e=l(i),t=a&&d(a)?l(a):a;let n=e,r=k(n);for(;r&&a&&t!==n;){const e=ft(r),t=r.getBoundingClientRect(),a=y(r),i=t.left+(r.clientLeft+parseFloat(a.paddingLeft))*e.x,o=t.top+(r.clientTop+parseFloat(a.paddingTop))*e.y;s*=e.x,c*=e.y,m*=e.x,p*=e.y,s+=i,c+=o,n=l(r),r=k(n)}}return K({width:m,height:p,x:s,y:c})}function bt(e,t){const n=w(e).scrollLeft;return t?t.left+n:gt(u(e)).left+n}function yt(e,t,n){void 0===n&&(n=!1);const a=e.getBoundingClientRect();return{x:a.left+t.scrollLeft-(n?0:bt(e,a)),y:a.top+t.scrollTop}}function wt(e,t,n){let a;if("viewport"===t)a=function(e,t){const n=l(e),a=u(e),r=n.visualViewport;let i=a.clientWidth,o=a.clientHeight,s=0,d=0;if(r){i=r.width,o=r.height;const e=g();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,d=r.offsetTop)}return{width:i,height:o,x:s,y:d}}(e,n);else if("document"===t)a=function(e){const t=u(e),n=w(e),a=e.ownerDocument.body,r=L(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),i=L(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let o=-n.scrollLeft+bt(e);const l=-n.scrollTop;return"rtl"===y(a).direction&&(o+=L(t.clientWidth,a.clientWidth)-r),{width:r,height:i,x:o,y:l}}(u(e));else if(d(t))a=function(e,t){const n=gt(e,!0,"fixed"===t),a=n.top+e.clientTop,r=n.left+e.clientLeft,i=c(e)?ft(e):q(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:a*i.y}}(t,n);else{const n=vt(e);a={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return K(a)}function Mt(e,t){const n=M(e);return!(n===t||!d(n)||b(n))&&("fixed"===y(n).position||Mt(n,t))}function Et(e,t,n){const a=c(t),r=u(t),i="fixed"===n,l=gt(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const d=q(0);function m(){d.x=bt(r)}if(a||!a&&!i)if(("body"!==o(t)||p(r))&&(s=w(t)),a){const e=gt(t,!0,i,t);d.x=e.x+t.clientLeft,d.y=e.y+t.clientTop}else r&&m();i&&!a&&r&&m();const f=!r||a||i?q(0):yt(r,s);return{x:l.left+s.scrollLeft-d.x-f.x,y:l.top+s.scrollTop-d.y-f.y,width:l.width,height:l.height}}function _t(e){return"static"===y(e).position}function kt(e,t){if(!c(e)||"fixed"===y(e).position)return null;if(t)return t(e);let n=e.offsetParent;return u(e)===n&&(n=n.ownerDocument.body),n}function Ct(e,t){const n=l(e);if(h(e))return n;if(!c(e)){let t=M(e);for(;t&&!b(t);){if(d(t)&&!_t(t))return t;t=M(t)}return n}let a=kt(e,t);for(;a&&f(a)&&_t(a);)a=kt(a,t);return a&&b(a)&&_t(a)&&!v(a)?n:a||function(e){let t=M(e);for(;c(t)&&!b(t);){if(v(t))return t;if(h(t))return null;t=M(t)}return null}(e)||n}const xt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:a,strategy:r}=e;const i="fixed"===r,l=u(a),s=!!t&&h(t.floating);if(a===l||s&&i)return n;let d={scrollLeft:0,scrollTop:0},m=q(1);const f=q(0),v=c(a);if((v||!v&&!i)&&(("body"!==o(a)||p(l))&&(d=w(a)),c(a))){const e=gt(a);m=ft(a),f.x=e.x+a.clientLeft,f.y=e.y+a.clientTop}const g=!l||v||i?q(0):yt(l,d,!0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-d.scrollLeft*m.x+f.x+g.x,y:n.y*m.y-d.scrollTop*m.y+f.y+g.y}},getDocumentElement:u,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:a,strategy:r}=e;const i=[..."clippingAncestors"===n?h(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let a=_(e,[],!1).filter(e=>d(e)&&"body"!==o(e)),r=null;const i="fixed"===y(e).position;let l=i?M(e):e;for(;d(l)&&!b(l);){const t=y(l),n=v(l);n||"fixed"!==t.position||(r=null),(i?!n&&!r:!n&&"static"===t.position&&r&&["absolute","fixed"].includes(r.position)||p(l)&&!n&&Mt(e,l))?a=a.filter(e=>e!==l):r=t,l=M(l)}return t.set(e,a),a}(t,this._c):[].concat(n),a],l=i[0],u=i.reduce((e,n)=>{const a=wt(t,n,r);return e.top=L(a.top,e.top),e.right=H(a.right,e.right),e.bottom=H(a.bottom,e.bottom),e.left=L(a.left,e.left),e},wt(t,l,r));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:Ct,getElementRects:async function(e){const t=this.getOffsetParent||Ct,n=this.getDimensions,a=await n(e.floating);return{reference:Et(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=mt(e);return{width:t,height:n}},getScale:ft,isElement:d,isRTL:function(e){return"rtl"===y(e).direction}};function Tt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ht(e,t,n,a){void 0===a&&(a={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:o="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=a,d=pt(e),c=r||i?[...d?_(d):[],..._(t)]:[];c.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const m=d&&l?function(e,t){let n,a=null;const r=u(e);function i(){var e;clearTimeout(n),null==(e=a)||e.disconnect(),a=null}return function o(l,u){void 0===l&&(l=!1),void 0===u&&(u=1),i();const s=e.getBoundingClientRect(),{left:d,top:c,width:m,height:p}=s;if(l||t(),!m||!p)return;const f={rootMargin:-S(c)+"px "+-S(r.clientWidth-(d+m))+"px "+-S(r.clientHeight-(c+p))+"px "+-S(d)+"px",threshold:L(0,H(1,u))||1};let h=!0;function v(t){const a=t[0].intersectionRatio;if(a!==u){if(!h)return o();a?o(!1,a):n=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==a||Tt(s,e.getBoundingClientRect())||o(),h=!1}try{a=new IntersectionObserver(v,{...f,root:r.ownerDocument})}catch(e){a=new IntersectionObserver(v,f)}a.observe(e)}(!0),i}(d,n):null;let p,f=-1,h=null;o&&(h=new ResizeObserver(e=>{let[a]=e;a&&a.target===d&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),d&&!s&&h.observe(d),h.observe(t));let v=s?gt(e):null;return s&&function t(){const a=gt(e);v&&!Tt(v,a)&&n(),v=a,p=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==m||m(),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(p)}}const Lt=ut,Vt=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:r,y:i,placement:o,middlewareData:l}=t,u=await async function(e,t){const{placement:n,platform:a,elements:r}=e,i=await(null==a.isRTL?void 0:a.isRTL(r.floating)),o=j(n),l=I(n),u="y"===z(n),s=["left","top"].includes(o)?-1:1,d=i&&u?-1:1,c=R(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:f}="number"==typeof c?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return l&&"number"==typeof f&&(p="end"===l?-1*f:f),u?{x:p*d,y:m*s}:{x:m*s,y:p*d}}(t,e);return o===(null==(n=l.offset)?void 0:n.placement)&&null!=(a=l.arrow)&&a.alignmentOffset?{}:{x:r+u.x,y:i+u.y,data:{...u,placement:o}}}}},St=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,a,r;const{rects:i,middlewareData:o,placement:l,platform:u,elements:s}=t,{crossAxis:d=!1,alignment:c,allowedPlacements:m=T,autoAlignment:p=!0,...f}=R(e,t),h=void 0!==c||m===T?function(e,t,n){return(e?[...n.filter(t=>I(t)===e),...n.filter(t=>I(t)!==e)]:n.filter(e=>j(e)===e)).filter(n=>!e||I(n)===e||!!t&&B(n)!==n)}(c||null,p,m):m,v=await ut(t,f),g=(null==(n=o.autoPlacement)?void 0:n.index)||0,b=h[g];if(null==b)return{};const y=N(b,i,await(null==u.isRTL?void 0:u.isRTL(s.floating)));if(l!==b)return{reset:{placement:h[0]}};const w=[v[j(b)],v[y[0]],v[y[1]]],M=[...(null==(a=o.autoPlacement)?void 0:a.overflows)||[],{placement:b,overflows:w}],E=h[g+1];if(E)return{data:{index:g+1,overflows:M},reset:{placement:E}};const _=M.map(e=>{const t=I(e.placement);return[e.placement,t&&d?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),k=(null==(r=_.filter(e=>e[2].slice(0,I(e[0])?2:3).every(e=>e<=0))[0])?void 0:r[0])||_[0][0];return k!==l?{data:{index:g+1,overflows:M},reset:{placement:k}}:{}}}},qt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:r}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=R(e,t),s={x:n,y:a},d=await ut(t,u),c=z(j(r)),m=A(c);let p=s[m],f=s[c];if(i){const e="y"===m?"bottom":"right";p=D(p+d["y"===m?"top":"left"],p,p-d[e])}if(o){const e="y"===c?"bottom":"right";f=D(f+d["y"===c?"top":"left"],f,f-d[e])}const h=l.fn({...t,[m]:p,[c]:f});return{...h,data:{x:h.x-n,y:h.y-a,enabled:{[m]:i,[c]:o}}}}}},Pt=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,a;const{placement:r,middlewareData:i,rects:o,initialPlacement:l,platform:u,elements:s}=t,{mainAxis:d=!0,crossAxis:c=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:h=!0,...v}=R(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=j(r),b=z(l),y=j(l)===l,w=await(null==u.isRTL?void 0:u.isRTL(s.floating)),M=m||(y||!h?[$(l)]:function(e){const t=$(e);return[B(e),t,B(t)]}(l)),E="none"!==f;!m&&E&&M.push(...function(e,t,n,a){const r=I(e);let i=function(e,t,n){const a=["left","right"],r=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:a:t?a:r;case"left":case"right":return t?i:o;default:return[]}}(j(e),"start"===n,a);return r&&(i=i.map(e=>e+"-"+r),t&&(i=i.concat(i.map(B)))),i}(l,h,f,w));const _=[l,...M],k=await ut(t,v),C=[];let x=(null==(a=i.flip)?void 0:a.overflows)||[];if(d&&C.push(k[g]),c){const e=N(r,o,w);C.push(k[e[0]],k[e[1]])}if(x=[...x,{placement:r,overflows:C}],!C.every(e=>e<=0)){var T,H;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=_[e];if(t&&("alignment"!==c||b===z(t)||x.every(e=>e.overflows[0]>0&&z(e.placement)===b)))return{data:{index:e,overflows:x},reset:{placement:t}};let n=null==(H=x.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:H.placement;if(!n)switch(p){case"bestFit":{var L;const e=null==(L=x.filter(e=>{if(E){const t=z(e.placement);return t===b||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:L[0];e&&(n=e);break}case"initialPlacement":n=l}if(r!==n)return{reset:{placement:n}}}return{}}}},Ot=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:r,rects:i,platform:o,elements:l}=t,{apply:u=()=>{},...s}=R(e,t),d=await ut(t,s),c=j(r),m=I(r),p="y"===z(r),{width:f,height:h}=i.floating;let v,g;"top"===c||"bottom"===c?(v=c,g=m===(await(null==o.isRTL?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(g=c,v="end"===m?"top":"bottom");const b=h-d.top-d.bottom,y=f-d.left-d.right,w=H(h-d[v],b),M=H(f-d[g],y),E=!t.middlewareData.shift;let _=w,k=M;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(k=y),null!=(a=t.middlewareData.shift)&&a.enabled.y&&(_=b),E&&!m){const e=L(d.left,0),t=L(d.right,0),n=L(d.top,0),a=L(d.bottom,0);p?k=f-2*(0!==e||0!==t?e+t:L(d.left,d.right)):_=h-2*(0!==n||0!==a?n+a:L(d.top,d.bottom))}await u({...t,availableWidth:k,availableHeight:_});const C=await o.getDimensions(l.floating);return f!==C.width||h!==C.height?{reset:{rects:!0}}:{}}}},Dt=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:a="referenceHidden",...r}=R(e,t);switch(a){case"referenceHidden":{const e=st(await ut(t,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:dt(e)}}}case"escaped":{const e=st(await ut(t,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:dt(e)}}}default:return{}}}}},Rt=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:r,rects:i,platform:o,elements:l,middlewareData:u}=t,{element:s,padding:d=0}=R(e,t)||{};if(null==s)return{};const c=U(d),m={x:n,y:a},p=W(r),f=F(p),h=await o.getDimensions(s),v="y"===p,g=v?"top":"left",b=v?"bottom":"right",y=v?"clientHeight":"clientWidth",w=i.reference[f]+i.reference[p]-m[p]-i.floating[f],M=m[p]-i.reference[p],E=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s));let _=E?E[y]:0;_&&await(null==o.isElement?void 0:o.isElement(E))||(_=l.floating[y]||i.floating[f]);const k=w/2-M/2,C=_/2-h[f]/2-1,x=H(c[g],C),T=H(c[b],C),L=x,V=_-h[f]-T,S=_/2-h[f]/2+k,q=D(L,S,V),P=!u.arrow&&null!=I(r)&&S!==q&&i.reference[f]/2-(S<L?x:T)-h[f]/2<0,O=P?S<L?S-L:S-V:0;return{[p]:m[p]+O,data:{[p]:q,centerOffset:S-q-O,...P&&{alignmentOffset:O}},reset:P}}}),jt=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:a,rects:r,platform:i,strategy:o}=t,{padding:l=2,x:u,y:s}=R(e,t),d=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(a.reference))||[]),c=function(e){const t=e.slice().sort((e,t)=>e.y-t.y),n=[];let a=null;for(let e=0;e<t.length;e++){const r=t[e];!a||r.y-a.y>a.height/2?n.push([r]):n[n.length-1].push(r),a=r}return n.map(e=>K(ct(e)))}(d),m=K(ct(d)),p=U(l),f=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===c.length&&c[0].left>c[1].right&&null!=u&&null!=s)return c.find(e=>u>e.left-p.left&&u<e.right+p.right&&s>e.top-p.top&&s<e.bottom+p.bottom)||m;if(c.length>=2){if("y"===z(n)){const e=c[0],t=c[c.length-1],a="top"===j(n),r=e.top,i=t.bottom,o=a?e.left:t.left,l=a?e.right:t.right;return{top:r,bottom:i,left:o,right:l,width:l-o,height:i-r,x:o,y:r}}const e="left"===j(n),t=L(...c.map(e=>e.right)),a=H(...c.map(e=>e.left)),r=c.filter(n=>e?n.left===a:n.right===t),i=r[0].top,o=r[r.length-1].bottom;return{top:i,bottom:o,left:a,right:t,width:t-a,height:o-i,x:a,y:i}}return m}},floating:a.floating,strategy:o});return r.reference.x!==f.reference.x||r.reference.y!==f.reference.y||r.reference.width!==f.reference.width||r.reference.height!==f.reference.height?{reset:{rects:f}}:{}}}},It=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:r,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:u=!0,crossAxis:s=!0}=R(e,t),d={x:n,y:a},c=z(r),m=A(c);let p=d[m],f=d[c];const h=R(l,t),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){const e="y"===m?"height":"width",t=i.reference[m]-i.floating[e]+v.mainAxis,n=i.reference[m]+i.reference[e]-v.mainAxis;p<t?p=t:p>n&&(p=n)}if(s){var g,b;const e="y"===m?"width":"height",t=["top","left"].includes(j(r)),n=i.reference[c]-i.floating[e]+(t&&(null==(g=o.offset)?void 0:g[c])||0)+(t?0:v.crossAxis),a=i.reference[c]+i.reference[e]+(t?0:(null==(b=o.offset)?void 0:b[c])||0)-(t?v.crossAxis:0);f<n?f=n:f>a&&(f=a)}return{[m]:p,[c]:f}}}},At=(e,t,n)=>{const a=new Map,r={platform:xt,...n},i={...r.platform,_c:a};return(async(e,t,n)=>{const{placement:a="bottom",strategy:r="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),u=await(null==o.isRTL?void 0:o.isRTL(t));let s=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:c}=lt(s,a,u),m=a,p={},f=0;for(let n=0;n<l.length;n++){const{name:i,fn:h}=l[n],{x:v,y:g,data:b,reset:y}=await h({x:d,y:c,initialPlacement:a,placement:m,strategy:r,middlewareData:p,rects:s,platform:o,elements:{reference:e,floating:t}});d=null!=v?v:d,c=null!=g?g:c,p={...p,[i]:{...p[i],...b}},y&&f<=50&&(f++,"object"==typeof y&&(y.placement&&(m=y.placement),y.rects&&(s=!0===y.rects?await o.getElementRects({reference:e,floating:t,strategy:r}):y.rects),({x:d,y:c}=lt(s,m,u))),n=-1)}return{x:d,y:c,placement:m,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})};var Ft="undefined"!=typeof document?a.useLayoutEffect:function(){};function zt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,a,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(a=n;0!==a--;)if(!zt(e[a],t[a]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(a=n;0!==a--;)if(!{}.hasOwnProperty.call(t,r[a]))return!1;for(a=n;0!==a--;){const n=r[a];if(!("_owner"===n&&e.$$typeof||zt(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function Wt(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Nt(e,t){const n=Wt(e);return Math.round(t*n)/n}function Bt(e){const t=a.useRef(e);return Ft(()=>{t.current=e}),t}const $t=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:a}="function"==typeof e?e(t):e;return n&&(r=n,{}.hasOwnProperty.call(r,"current"))?null!=n.current?Rt({element:n.current,padding:a}).fn(t):{}:n?Rt({element:n,padding:a}).fn(t):{};var r}}),Ut=(e,t)=>({...Vt(e),options:[e,t]}),Kt=(e,t)=>({...qt(e),options:[e,t]}),Yt=(e,t)=>({...It(e),options:[e,t]}),Gt=(e,t)=>({...Pt(e),options:[e,t]}),Xt=(e,t)=>({...Ot(e),options:[e,t]}),Qt=(e,t)=>({...St(e),options:[e,t]}),Jt=(e,t)=>({...Dt(e),options:[e,t]}),Zt=(e,t)=>({...jt(e),options:[e,t]}),en=(e,t)=>({...$t(e),options:[e,t]});function tn(e){const t=a.useRef(void 0),n=a.useCallback(t=>{const n=e.map(e=>{if(null!=e){if("function"==typeof e){const n=e,a=n(t);return"function"==typeof a?a:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>null==e?void 0:e())}},e);return a.useMemo(()=>e.every(e=>null==e)?null:e=>{t.current&&(t.current(),t.current=void 0),null!=e&&(t.current=n(e))},e)}function nn(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 an=a.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function rn(e){const{children:t,elementsRef:n,labelsRef:r}=e,[i,o]=a.useState(()=>new Set),l=a.useCallback(e=>{o(t=>new Set(t).add(e))},[]),u=a.useCallback(e=>{o(t=>{const n=new Set(t);return n.delete(e),n})},[]),s=a.useMemo(()=>{const e=new Map;return Array.from(i.keys()).sort(nn).forEach((t,n)=>{e.set(t,n)}),e},[i]);return(0,it.jsx)(an.Provider,{value:a.useMemo(()=>({register:l,unregister:u,map:s,elementsRef:n,labelsRef:r}),[l,u,s,n,r]),children:t})}function on(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:r,map:i,elementsRef:o,labelsRef:l}=a.useContext(an),[u,s]=a.useState(null),d=a.useRef(null),c=a.useCallback(e=>{if(d.current=e,null!==u&&(o.current[u]=e,l)){var n;const a=void 0!==t;l.current[u]=a?t:null!=(n=null==e?void 0:e.textContent)?n:null}},[u,o,l,t]);return Ie(()=>{const e=d.current;if(e)return n(e),()=>{r(e)}},[n,r]),Ie(()=>{const e=d.current?i.get(d.current):null;null!=e&&s(e)},[i]),a.useMemo(()=>({ref:c,index:null==u?-1:u}),[u,c])}const ln="data-floating-ui-focusable",un="active",sn="selected",dn="ArrowLeft",cn="ArrowRight",mn="ArrowUp",pn="ArrowDown";function fn(e,t){return"function"==typeof e?e(t):e?a.cloneElement(e,t):(0,it.jsx)("div",{...t})}const hn=a.createContext({activeIndex:0,onNavigate:()=>{}}),vn=[dn,cn],gn=[mn,pn],bn=[...vn,...gn],yn=a.forwardRef(function(e,t){const{render:n,orientation:r="both",loop:i=!0,rtl:o=!1,cols:l=1,disabledIndices:u,activeIndex:s,onNavigate:d,itemSizes:c,dense:m=!1,...p}=e,[f,h]=a.useState(0),v=null!=s?s:f,g=ze(null!=d?d:h),b=a.useRef([]),y=n&&"function"!=typeof n?n.props:{},w=a.useMemo(()=>({activeIndex:v,onNavigate:g}),[v,g]),M=l>1,E={...p,...y,ref:t,"aria-orientation":"both"===r?void 0:r,onKeyDown(e){null==p.onKeyDown||p.onKeyDown(e),null==y.onKeyDown||y.onKeyDown(e),function(e){if(!bn.includes(e.key))return;let t=v;const n=Be(b,u),a=$e(b,u),s=o?dn:cn,d=o?cn:dn;if(M){const d=c||Array.from({length:b.current.length},()=>({width:1,height:1})),p=Ye(d,l,m),f=p.findIndex(e=>null!=e&&!Qe(b,e,u)),h=p.reduce((e,t,n)=>null==t||Qe(b,t,u)?e:n,-1),g=p[Ke({current:p.map(e=>e?b.current[e]:null)},{event:e,orientation:r,loop:i,rtl:o,cols:l,disabledIndices:Xe([...("function"!=typeof u?u:null)||b.current.map((e,t)=>Qe(b,t,u)?t:void 0),void 0],p),minIndex:f,maxIndex:h,prevIndex:Ge(v>a?n:v,d,p,l,e.key===pn?"bl":e.key===s?"tr":"tl")})];null!=g&&(t=g)}const p={horizontal:[s],vertical:[pn],both:[s,pn]}[r],f={horizontal:[d],vertical:[mn],both:[d,mn]}[r],h=M?bn:{horizontal:vn,vertical:gn,both:bn}[r];var y;t===v&&[...p,...f].includes(e.key)&&(t=i&&t===a&&p.includes(e.key)?n:i&&t===n&&f.includes(e.key)?a:Ue(b,{startingIndex:t,decrement:f.includes(e.key),disabledIndices:u})),t===v||Ne(b,t)||(e.stopPropagation(),h.includes(e.key)&&e.preventDefault(),g(t),null==(y=b.current[t])||y.focus())}(e)}};return(0,it.jsx)(hn.Provider,{value:w,children:(0,it.jsx)(rn,{elementsRef:b,children:fn(n,E)})})}),wn=a.forwardRef(function(e,t){const{render:n,...r}=e,i=n&&"function"!=typeof n?n.props:{},{activeIndex:o,onNavigate:l}=a.useContext(hn),{ref:u,index:s}=on(),d=tn([u,t,i.ref]),c=o===s;return fn(n,{...r,...i,ref:d,tabIndex:c?0:-1,"data-active":c?"":void 0,onFocus(e){null==r.onFocus||r.onFocus(e),null==i.onFocus||i.onFocus(e),l(s)}})}),Mn={...a};let En=!1,_n=0;const kn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+_n++,Cn=Mn.useId||function(){const[e,t]=a.useState(()=>En?kn():void 0);return Ie(()=>{null==e&&t(kn())},[]),a.useEffect(()=>{En=!0},[]),e},xn=a.forwardRef(function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:i,shift:o}},width:l=14,height:u=7,tipRadius:s=0,strokeWidth:d=0,staticOffset:c,stroke:m,d:p,style:{transform:f,...h}={},...v}=e,g=Cn(),[b,w]=a.useState(!1);if(Ie(()=>{r&&"rtl"===y(r).direction&&w(!0)},[r]),!r)return null;const[M,E]=n.split("-"),_="top"===M||"bottom"===M;let k=c;(_&&null!=o&&o.x||!_&&null!=o&&o.y)&&(k=null);const C=2*d,x=C/2,T=l/2*(s/-8+1),H=u/2*s/4,L=!!p,V=k&&"end"===E?"bottom":"top";let S=k&&"end"===E?"right":"left";k&&b&&(S="end"===E?"left":"right");const q=null!=(null==i?void 0:i.x)?k||i.x:"",P=null!=(null==i?void 0:i.y)?k||i.y:"",O=p||"M0,0 H"+l+" L"+(l-T)+","+(u-H)+" Q"+l/2+","+u+" "+T+","+(u-H)+" Z",D={top:L?"rotate(180deg)":"",left:L?"rotate(90deg)":"rotate(-90deg)",bottom:L?"":"rotate(180deg)",right:L?"rotate(-90deg)":"rotate(90deg)"}[M];return(0,it.jsxs)("svg",{...v,"aria-hidden":!0,ref:t,width:L?l:l+C,height:l,viewBox:"0 0 "+l+" "+(u>l?u:l),style:{position:"absolute",pointerEvents:"none",[S]:q,[V]:P,[M]:_||L?"100%":"calc(100% - "+C/2+"px)",transform:[D,f].filter(e=>!!e).join(" "),...h},children:[C>0&&(0,it.jsx)("path",{clipPath:"url(#"+g+")",fill:"none",stroke:m,strokeWidth:C+(p?0:1),d:O}),(0,it.jsx)("path",{stroke:C&&!p?v.fill:"none",d:O}),(0,it.jsx)("clipPath",{id:g,children:(0,it.jsx)("rect",{x:-x,y:x*(L?-1:1),width:l+C,height:l})})]})});function Tn(){const e=new Map;return{emit(t,n){var a;null==(a=e.get(t))||a.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var a;null==(a=e.get(t))||a.delete(n)}}}const Hn=a.createContext(null),Ln=a.createContext(null),Vn=()=>{var e;return(null==(e=a.useContext(Hn))?void 0:e.id)||null},Sn=()=>a.useContext(Ln);function qn(e){const t=Cn(),n=Sn(),a=Vn(),r=e||a;return Ie(()=>{if(!t)return;const e={id:t,parentId:r};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}},[n,t,r]),t}function Pn(e){const{children:t,id:n}=e,r=Vn();return(0,it.jsx)(Hn.Provider,{value:a.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function On(e){const{children:t}=e,n=a.useRef([]),r=a.useCallback(e=>{n.current=[...n.current,e]},[]),i=a.useCallback(e=>{n.current=n.current.filter(t=>t!==e)},[]),[o]=a.useState(()=>Tn());return(0,it.jsx)(Ln.Provider,{value:a.useMemo(()=>({nodesRef:n,addNode:r,removeNode:i,events:o}),[r,i,o]),children:t})}function Dn(e){return"data-floating-ui-"+e}function Rn(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const jn=Dn("safe-polygon");function In(e,t,n){if(n&&!je(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){const n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function An(e){return"function"==typeof e?e():e}function Fn(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:i,events:o,elements:l}=e,{enabled:u=!0,delay:s=0,handleClose:c=null,mouseOnly:m=!1,restMs:p=0,move:f=!0}=t,h=Sn(),v=Vn(),g=Ae(c),b=Ae(s),y=Ae(n),w=Ae(p),M=a.useRef(),E=a.useRef(-1),_=a.useRef(),k=a.useRef(-1),C=a.useRef(!0),x=a.useRef(!1),T=a.useRef(()=>{}),H=a.useRef(!1),L=ze(()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});a.useEffect(()=>{if(u)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{open:t}=e;t||(Rn(E),Rn(k),C.current=!0,H.current=!1)}},[u,o]),a.useEffect(()=>{if(!u)return;if(!g.current)return;if(!n)return;function e(e){L()&&r(!1,e,"hover")}const t=He(l.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[l.floating,n,r,u,g,L]);const V=a.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const a=In(b.current,"close",M.current);a&&!_.current?(Rn(E),E.current=window.setTimeout(()=>r(!1,e,n),a)):t&&(Rn(E),r(!1,e,n))},[b,r]),S=ze(()=>{T.current(),_.current=void 0}),q=ze(()=>{if(x.current){const e=He(l.floating).body;e.style.pointerEvents="",e.removeAttribute(jn),x.current=!1}}),P=ze(()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type));a.useEffect(()=>{if(u&&d(l.domReference)){const r=l.domReference,i=l.floating;return n&&r.addEventListener("mouseleave",a),f&&r.addEventListener("mousemove",e,{once:!0}),r.addEventListener("mouseenter",e),r.addEventListener("mouseleave",t),i&&(i.addEventListener("mouseleave",a),i.addEventListener("mouseenter",o),i.addEventListener("mouseleave",s)),()=>{n&&r.removeEventListener("mouseleave",a),f&&r.removeEventListener("mousemove",e),r.removeEventListener("mouseenter",e),r.removeEventListener("mouseleave",t),i&&(i.removeEventListener("mouseleave",a),i.removeEventListener("mouseenter",o),i.removeEventListener("mouseleave",s))}}function e(e){if(Rn(E),C.current=!1,m&&!je(M.current)||An(w.current)>0&&!In(b.current,"open"))return;const t=In(b.current,"open",M.current);t?E.current=window.setTimeout(()=>{y.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function t(e){if(P())return void q();T.current();const t=He(l.floating);if(Rn(k),H.current=!1,g.current&&i.current.floatingContext){n||Rn(E),_.current=g.current({...i.current.floatingContext,tree:h,x:e.clientX,y:e.clientY,onClose(){q(),S(),P()||V(e,!0,"safe-polygon")}});const a=_.current;return t.addEventListener("mousemove",a),void(T.current=()=>{t.removeEventListener("mousemove",a)})}("touch"!==M.current||!Ce(l.floating,e.relatedTarget))&&V(e)}function a(e){P()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:h,x:e.clientX,y:e.clientY,onClose(){q(),S(),P()||V(e)}})(e))}function o(){Rn(E)}function s(e){P()||V(e,!1)}},[l,u,e,m,f,V,S,q,r,n,y,h,b,g,i,P,w]),Ie(()=>{var e;if(u&&n&&null!=(e=g.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&L()){x.current=!0;const e=l.floating;if(d(l.domReference)&&e){var t;const n=He(l.floating).body;n.setAttribute(jn,"");const a=l.domReference,r=null==h||null==(t=h.nodesRef.current.find(e=>e.id===v))||null==(t=t.context)?void 0:t.elements.floating;return r&&(r.style.pointerEvents=""),n.style.pointerEvents="none",a.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",a.style.pointerEvents="",e.style.pointerEvents=""}}}},[u,n,v,l,h,g,L]),Ie(()=>{n||(M.current=void 0,H.current=!1,S(),q())},[n,S,q]),a.useEffect(()=>()=>{S(),Rn(E),Rn(k),q()},[u,l.domReference,S,q]);const O=a.useMemo(()=>{function e(e){M.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function a(){C.current||y.current||r(!0,t,"hover")}m&&!je(M.current)||n||0===An(w.current)||H.current&&e.movementX**2+e.movementY**2<2||(Rn(k),"touch"===M.current?a():(H.current=!0,k.current=window.setTimeout(a,An(w.current))))}}},[m,r,n,y,w]);return a.useMemo(()=>u?{reference:O}:{},[u,O])}const zn=()=>{},Wn=a.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:zn,setState:zn,isInstantPhase:!1}),Nn=()=>a.useContext(Wn);function Bn(e){const{children:t,delay:n,timeoutMs:r=0}=e,[i,o]=a.useReducer((e,t)=>({...e,...t}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),l=a.useRef(null),u=a.useCallback(e=>{o({currentId:e})},[]);return Ie(()=>{i.currentId?null===l.current?l.current=i.currentId:i.isInstantPhase||o({isInstantPhase:!0}):(i.isInstantPhase&&o({isInstantPhase:!1}),l.current=null)},[i.currentId,i.isInstantPhase]),(0,it.jsx)(Wn.Provider,{value:a.useMemo(()=>({...i,setState:o,setCurrentId:u}),[i,u]),children:t})}function $n(e,t){void 0===t&&(t={});const{open:n,onOpenChange:a,floatingId:r}=e,{id:i,enabled:o=!0}=t,l=null!=i?i:r,u=Nn(),{currentId:s,setCurrentId:d,initialDelay:c,setState:m,timeoutMs:p}=u;return Ie(()=>{o&&s&&(m({delay:{open:1,close:In(c,"close")}}),s!==l&&a(!1))},[o,l,a,m,s,c]),Ie(()=>{function e(){a(!1),m({delay:c,currentId:null})}if(o&&s&&!n&&s===l){if(p){const t=window.setTimeout(e,p);return()=>{clearTimeout(t)}}e()}},[o,n,m,s,l,a,c,p]),Ie(()=>{o&&d!==zn&&n&&d(l)},[o,n,d,l]),u}const Un=a.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeoutIdRef:{current:-1},currentIdRef:{current:null},currentContextRef:{current:null}});function Kn(e){const{children:t,delay:n,timeoutMs:r=0}=e,i=a.useRef(n),o=a.useRef(n),l=a.useRef(null),u=a.useRef(null),s=a.useRef(-1);return(0,it.jsx)(Un.Provider,{value:a.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:o,currentIdRef:l,timeoutMs:r,currentContextRef:u,timeoutIdRef:s}),[r]),children:t})}function Yn(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,floatingId:i}=e,{enabled:o=!0}=t,l=a.useContext(Un),{currentIdRef:u,delayRef:s,timeoutMs:d,initialDelayRef:c,currentContextRef:m,hasProvider:p,timeoutIdRef:f}=l,[h,v]=a.useState(!1);return Ie(()=>{function e(){var e;v(!1),null==(e=m.current)||e.setIsInstantPhase(!1),u.current=null,m.current=null,s.current=c.current}if(o&&u.current&&!n&&u.current===i){if(v(!1),d)return f.current=window.setTimeout(e,d),()=>{clearTimeout(f.current)};e()}},[o,n,i,u,s,d,c,m,f]),Ie(()=>{if(!o)return;if(!n)return;const e=m.current,t=u.current;m.current={onOpenChange:r,setIsInstantPhase:v},u.current=i,s.current={open:0,close:In(c.current,"close")},null!==t&&t!==i?(Rn(f),v(!0),null==e||e.setIsInstantPhase(!0),null==e||e.onOpenChange(!1)):(v(!1),null==e||e.setIsInstantPhase(!1))},[o,n,i,r,u,s,d,c,m,f]),Ie(()=>()=>{m.current=null},[m]),a.useMemo(()=>({hasProvider:p,delayRef:s,isInstantPhase:h}),[p,s,h])}let Gn=0;function Xn(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:a=!0,sync:r=!1}=t;a&&cancelAnimationFrame(Gn);const i=()=>null==e?void 0:e.focus({preventScroll:n});r?i():Gn=requestAnimationFrame(i)}function Qn(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&m(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}const Jn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Zn(e){return"inert"===e?Jn.inert:"aria-hidden"===e?Jn["aria-hidden"]:Jn.none}let ea=new WeakSet,ta={},na=0;const aa=()=>"undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,ra=e=>e&&(e.host||ra(e.parentNode)),ia=(e,t)=>t.map(t=>{if(e.contains(t))return t;const n=ra(t);return e.contains(n)?n:null}).filter(e=>null!=e);function oa(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const a=(r=e[0],(null==r?void 0:r.ownerDocument)||document).body;var r;return function(e,t,n,a){const r="data-floating-ui-inert",i=a?"inert":n?"aria-hidden":null,l=ia(t,e),u=new Set,s=new Set(l),d=[];ta[r]||(ta[r]=new WeakMap);const c=ta[r];return l.forEach(function e(t){t&&!u.has(t)&&(u.add(t),t.parentNode&&e(t.parentNode))}),function e(t){t&&!s.has(t)&&[].forEach.call(t.children,t=>{if("script"!==o(t))if(u.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,a=Zn(i),o=(a.get(t)||0)+1,l=(c.get(t)||0)+1;a.set(t,o),c.set(t,l),d.push(t),1===o&&n&&ea.add(t),1===l&&t.setAttribute(r,""),!n&&i&&t.setAttribute(i,"inert"===i?"":"true")}})}(t),u.clear(),na++,()=>{d.forEach(e=>{const t=Zn(i),n=(t.get(e)||0)-1,a=(c.get(e)||0)-1;t.set(e,n),c.set(e,a),n||(!ea.has(e)&&i&&e.removeAttribute(i),ea.delete(e)),a||e.removeAttribute(r)}),na--,na||(Jn.inert=new WeakMap,Jn["aria-hidden"]=new WeakMap,Jn.none=new WeakMap,ea=new WeakSet,ta={})}}(e.concat(Array.from(a.querySelectorAll("[aria-live]"))),a,t,n)}const la={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},ua=a.forwardRef(function(e,t){const[n,r]=a.useState();Ie(()=>{he()&&r("button")},[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Dn("focus-guard")]:"",style:la};return(0,it.jsx)("span",{...e,...i})}),sa=a.createContext(null),da=Dn("portal");function ca(e){void 0===e&&(e={});const{id:t,root:n}=e,r=Cn(),i=pa(),[o,l]=a.useState(null),u=a.useRef(null);return Ie(()=>()=>{null==o||o.remove(),queueMicrotask(()=>{u.current=null})},[o]),Ie(()=>{if(!r)return;if(u.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(da,""),e.appendChild(n),u.current=n,l(n)},[t,r]),Ie(()=>{if(null===n)return;if(!r)return;if(u.current)return;let e=n||(null==i?void 0:i.portalNode);e&&!d(e)&&(e=e.current),e=e||document.body;let a=null;t&&(a=document.createElement("div"),a.id=t,e.appendChild(a));const o=document.createElement("div");o.id=r,o.setAttribute(da,""),e=a||e,e.appendChild(o),u.current=o,l(o)},[t,n,r,i]),o}function ma(e){const{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,o=ca({id:n,root:r}),[l,u]=a.useState(null),s=a.useRef(null),d=a.useRef(null),c=a.useRef(null),m=a.useRef(null),p=null==l?void 0:l.modal,f=null==l?void 0:l.open,h=!!l&&!l.modal&&l.open&&i&&!(!r&&!o);return a.useEffect(()=>{if(o&&i&&!p)return o.addEventListener("focusin",e,!0),o.addEventListener("focusout",e,!0),()=>{o.removeEventListener("focusin",e,!0),o.removeEventListener("focusout",e,!0)};function e(e){o&&nt(e)&&("focusin"===e.type?rt:at)(o)}},[o,i,p]),a.useEffect(()=>{o&&(f||rt(o))},[f,o]),(0,it.jsxs)(sa.Provider,{value:a.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:d,beforeInsideRef:c,afterInsideRef:m,portalNode:o,setFocusManagerState:u}),[i,o]),children:[h&&o&&(0,it.jsx)(ua,{"data-type":"outside",ref:s,onFocus:e=>{if(nt(e,o)){var t;null==(t=c.current)||t.focus()}else{const e=tt(l?l.domReference:null);null==e||e.focus()}}}),h&&o&&(0,it.jsx)("span",{"aria-owns":o.id,style:la}),o&&ot.createPortal(t,o),h&&o&&(0,it.jsx)(ua,{"data-type":"outside",ref:d,onFocus:e=>{if(nt(e,o)){var t;null==(t=m.current)||t.focus()}else{const t=et(l?l.domReference:null);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const pa=()=>a.useContext(sa);function fa(e){return a.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}const ha=20;let va=[];function ga(){return va.slice().reverse().find(e=>e.isConnected)}function ba(e,t){var n;if(!(t.current.includes("floating")||null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;const a=Je(),r=ce(e,a).filter(e=>{const t=e.getAttribute("data-tabindex")||"";return me(e,a)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||0===r.length?"0"!==i&&e.setAttribute("tabindex","0"):("-1"!==i||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const ya=a.forwardRef(function(e,t){return(0,it.jsx)("button",{...e,type:"button",ref:t,tabIndex:-1,style:la})});function wa(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:l=!0,initialFocus:u=0,returnFocus:s=!0,restoreFocus:d=!1,modal:m=!0,visuallyHiddenDismiss:p=!1,closeOnFocusOut:f=!0,outsideElementsInert:h=!1,getInsideElements:v=()=>[]}=e,{open:g,onOpenChange:b,events:y,dataRef:w,elements:{domReference:M,floating:E}}=t,_=ze(()=>{var e;return null==(e=w.current.floatingContext)?void 0:e.nodeId}),k=ze(v),C="number"==typeof u&&u<0,x=Ve(M)&&C,T=aa(),H=!T||l,L=!H||T&&h,V=Ae(i),S=Ae(u),q=Ae(s),P=Sn(),O=pa(),D=a.useRef(null),R=a.useRef(null),j=a.useRef(!1),I=a.useRef(!1),A=a.useRef(-1),F=null!=O,z=Se(E),W=ze(function(e){return void 0===e&&(e=z),e?de(e,Je()):[]}),N=ze(e=>{const t=W(e);return V.current.map(e=>M&&"reference"===e?M:z&&"floating"===e?z:t).filter(Boolean).flat()});a.useEffect(()=>{if(r)return;if(!m)return;function e(e){if("Tab"===e.key){Ce(z,ke(He(z)))&&0===W().length&&!x&&Oe(e);const t=N(),n=xe(e);"reference"===V.current[0]&&n===M&&(Oe(e),e.shiftKey?Xn(t[t.length-1]):Xn(t[1])),"floating"===V.current[1]&&n===z&&e.shiftKey&&(Oe(e),Xn(t[0]))}}const t=He(z);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,M,z,m,V,x,W,N]),a.useEffect(()=>{if(!r&&E)return E.addEventListener("focusin",e),()=>{E.removeEventListener("focusin",e)};function e(e){const t=xe(e),n=W().indexOf(t);-1!==n&&(A.current=n)}},[r,E,W]),a.useEffect(()=>{if(!r&&f)return E&&c(M)?(M.addEventListener("focusout",t),M.addEventListener("pointerdown",e),E.addEventListener("focusout",t),()=>{M.removeEventListener("focusout",t),M.removeEventListener("pointerdown",e),E.removeEventListener("focusout",t)}):void 0;function e(){I.current=!0,setTimeout(()=>{I.current=!1})}function t(e){const t=e.relatedTarget,n=e.currentTarget,a=xe(e);queueMicrotask(()=>{const r=_(),i=!(Ce(M,t)||Ce(E,t)||Ce(t,E)||Ce(null==O?void 0:O.portalNode,t)||null!=t&&t.hasAttribute(Dn("focus-guard"))||P&&(qe(P.nodesRef.current,r).find(e=>{var n,a;return Ce(null==(n=e.context)?void 0:n.elements.floating,t)||Ce(null==(a=e.context)?void 0:a.elements.domReference,t)})||Pe(P.nodesRef.current,r).find(e=>{var n,a,r;return[null==(n=e.context)?void 0:n.elements.floating,Se(null==(a=e.context)?void 0:a.elements.floating)].includes(t)||(null==(r=e.context)?void 0:r.elements.domReference)===t})));if(n===M&&z&&ba(z,V),d&&n!==M&&(null==a||!a.isConnected)&&ke(He(z))===He(z).body){c(z)&&z.focus();const e=A.current,t=W(),n=t[e]||t[t.length-1]||z;c(n)&&n.focus()}w.current.insideReactTree?w.current.insideReactTree=!1:!x&&m||!t||!i||I.current||t===ga()||(j.current=!0,b(!1,e,"focus-out"))})}},[r,M,E,z,m,P,O,b,f,d,W,x,_,V,w]);const B=a.useRef(null),$=a.useRef(null),U=fa([B,null==O?void 0:O.beforeInsideRef]),K=fa([$,null==O?void 0:O.afterInsideRef]);function Y(e){return!r&&p&&m?(0,it.jsx)(ya,{ref:"start"===e?D:R,onClick:e=>b(!1,e.nativeEvent),children:"string"==typeof p?p:"Dismiss"}):null}a.useEffect(()=>{var e,t;if(r)return;if(!E)return;const n=Array.from((null==O||null==(e=O.portalNode)?void 0:e.querySelectorAll("["+Dn("portal")+"]"))||[]),a=P?Pe(P.nodesRef.current,_()):[],i=P&&!m?a.map(e=>{var t;return null==(t=e.context)?void 0:t.elements.floating}):[],o=null==(t=a.find(e=>{var t;return Ve((null==(t=e.context)?void 0:t.elements.domReference)||null)}))||null==(t=t.context)?void 0:t.elements.domReference,l=[E,o,...n,...i,...k(),D.current,R.current,B.current,$.current,null==O?void 0:O.beforeOutsideRef.current,null==O?void 0:O.afterOutsideRef.current,V.current.includes("reference")||x?M:null].filter(e=>null!=e),u=m||x?oa(l,!L,L):oa(l);return()=>{u()}},[r,M,E,m,V,O,x,H,L,P,_,k]),Ie(()=>{if(r||!c(z))return;const e=ke(He(z));queueMicrotask(()=>{const t=N(z),n=S.current,a=("number"==typeof n?t[n]:n.current)||z,r=Ce(z,e);C||r||!g||Xn(a,{preventScroll:a===z})})},[r,g,z,C,N,S]),Ie(()=>{if(r||!z)return;const e=He(z);var t;function n(e){let{reason:t,event:n,nested:a}=e;if(["hover","safe-polygon"].includes(t)&&"mouseleave"===n.type&&(j.current=!0),"outside-press"===t)if(a)j.current=!1;else if(De(n)||Re(n))j.current=!1;else{let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),j.current=!e}}t=ke(e),va=va.filter(e=>e.isConnected),t&&"body"!==o(t)&&(va.push(t),va.length>ha&&(va=va.slice(-20))),y.on("openchange",n);const a=e.createElement("span");return a.setAttribute("tabindex","-1"),a.setAttribute("aria-hidden","true"),Object.assign(a.style,la),F&&M&&M.insertAdjacentElement("afterend",a),()=>{y.off("openchange",n);const t=ke(e),r=Ce(E,t)||P&&qe(P.nodesRef.current,_()).some(e=>{var n;return Ce(null==(n=e.context)?void 0:n.elements.floating,t)}),i=function(){if("boolean"==typeof q.current){const e=M||ga();return e&&e.isConnected?e:a}return q.current.current||a}();queueMicrotask(()=>{const n=function(e){const t=Je();return me(e,t)?e:de(e,t)[0]||e}(i);q.current&&!j.current&&c(n)&&(n===t||t===e.body||r)&&n.focus({preventScroll:!0}),a.remove()})}},[r,E,z,q,w,y,P,F,M,_]),a.useEffect(()=>{queueMicrotask(()=>{j.current=!1})},[r]),Ie(()=>{if(!r&&O)return O.setFocusManagerState({modal:m,closeOnFocusOut:f,open:g,onOpenChange:b,domReference:M}),()=>{O.setFocusManagerState(null)}},[r,O,m,g,b,f,M]),Ie(()=>{r||z&&ba(z,V)},[r,z,V]);const G=!r&&H&&(!m||!x)&&(F||m);return(0,it.jsxs)(it.Fragment,{children:[G&&(0,it.jsx)(ua,{"data-type":"inside",ref:U,onFocus:e=>{if(m){const e=N();Xn("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=O&&O.preserveTabOrder&&O.portalNode)if(j.current=!1,nt(e,O.portalNode)){const e=et(M);null==e||e.focus()}else{var t;null==(t=O.beforeOutsideRef.current)||t.focus()}}}),!x&&Y("start"),n,Y("end"),G&&(0,it.jsx)(ua,{"data-type":"inside",ref:K,onFocus:e=>{if(m)Xn(N()[0]);else if(null!=O&&O.preserveTabOrder&&O.portalNode)if(f&&(j.current=!0),nt(e,O.portalNode)){const e=tt(M);null==e||e.focus()}else{var t;null==(t=O.afterOutsideRef.current)||t.focus()}}})]})}let Ma=0;const Ea="--floating-ui-scrollbar-width";let _a=()=>{};const ka=a.forwardRef(function(e,t){const{lockScroll:n=!1,...a}=e;return Ie(()=>{if(n)return Ma++,1===Ma&&(_a=function(){const e=pe(),t=/iP(hone|ad|od)|iOS/.test(e)||"MacIntel"===e&&navigator.maxTouchPoints>1,n=document.body.style,a=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,i=n.left?parseFloat(n.left):window.scrollX,o=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(Ea,r+"px"),r&&(n[a]=r+"px"),t){var l,u;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,t=(null==(u=window.visualViewport)?void 0:u.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(o-Math.floor(t))+"px",left:-(i-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[a]:""}),n.removeProperty(Ea),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(i,o))}}()),()=>{Ma--,0===Ma&&_a()}},[n]),(0,it.jsx)("div",{ref:t,...a,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...a.style}})});function Ca(e){return c(e.target)&&"BUTTON"===e.target.tagName}function xa(e){return Le(e)}function Ta(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:l=!0,event:u="click",toggle:s=!0,ignoreMouse:d=!1,keyboardHandlers:m=!0,stickIfOpen:p=!0}=t,f=a.useRef(),h=a.useRef(!1),v=a.useMemo(()=>({onPointerDown(e){f.current=e.pointerType},onMouseDown(e){const t=f.current;0===e.button&&"click"!==u&&(je(t,!0)&&d||(!n||!s||i.current.openEvent&&p&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=f.current;"mousedown"===u&&f.current?f.current=void 0:je(t,!0)&&d||(!n||!s||i.current.openEvent&&p&&"click"!==i.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){f.current=void 0,e.defaultPrevented||!m||Ca(e)||(" "!==e.key||xa(o)||(e.preventDefault(),h.current=!0),function(e){return c(e.target)&&"A"===e.target.tagName}(e)||"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!m||Ca(e)||xa(o)||" "===e.key&&h.current&&(h.current=!1,r(!n||!s,e.nativeEvent,"click"))}}),[i,o,u,d,m,r,n,p,s]);return a.useMemo(()=>l?{reference:v}:{},[l,v])}function Ha(e){return null!=e&&null!=e.clientX}function La(e,t){void 0===t&&(t={});const{open:n,dataRef:r,elements:{floating:i,domReference:o},refs:u}=e,{enabled:s=!0,axis:d="both",x:c=null,y:m=null}=t,p=a.useRef(!1),f=a.useRef(null),[h,v]=a.useState(),[g,b]=a.useState([]),y=ze((e,t)=>{p.current||r.current.openEvent&&!Ha(r.current.openEvent)||u.setPositionReference(function(e,t){let n=null,a=null,r=!1;return{contextElement:e||void 0,getBoundingClientRect(){var i;const o=(null==e?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,u="y"===t.axis||"both"===t.axis,s=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let d=o.width,c=o.height,m=o.x,p=o.y;return null==n&&t.x&&l&&(n=o.x-t.x),null==a&&t.y&&u&&(a=o.y-t.y),m-=n||0,p-=a||0,d=0,c=0,!r||s?(d="y"===t.axis?o.width:0,c="x"===t.axis?o.height:0,m=l&&null!=t.x?t.x:m,p=u&&null!=t.y?t.y:p):r&&!s&&(c="x"===t.axis?o.height:c,d="y"===t.axis?o.width:d),r=!0,{width:d,height:c,x:m,y:p,top:p,right:m+d,bottom:p+c,left:m}}}}(o,{x:e,y:t,axis:d,dataRef:r,pointerType:h}))}),w=ze(e=>{null==c&&null==m&&(n?f.current||b([]):y(e.clientX,e.clientY))}),M=je(h)?i:n,E=a.useCallback(()=>{if(!M||!s||null!=c||null!=m)return;const e=l(i);function t(n){const a=xe(n);Ce(i,a)?(e.removeEventListener("mousemove",t),f.current=null):y(n.clientX,n.clientY)}if(!r.current.openEvent||Ha(r.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),f.current=null};return f.current=n,n}u.setPositionReference(o)},[M,s,c,m,i,r,u,o,y]);a.useEffect(()=>E(),[E,g]),a.useEffect(()=>{s&&!i&&(p.current=!1)},[s,i]),a.useEffect(()=>{!s&&n&&(p.current=!0)},[s,n]),Ie(()=>{!s||null==c&&null==m||(p.current=!1,y(c,m))},[s,c,m,y]);const _=a.useMemo(()=>{function e(e){let{pointerType:t}=e;v(t)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:w,onMouseEnter:w}},[w]);return a.useMemo(()=>s?{reference:_}:{},[s,_])}const Va={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Sa={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},qa=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 Pa(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:o}=e,{enabled:l=!0,escapeKey:u=!0,outsidePress:s=!0,outsidePressEvent:m="pointerdown",referencePress:p=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:v,capture:w}=t,E=Sn(),k=ze("function"==typeof s?s:()=>!1),C="function"==typeof s?k:s,x=a.useRef(!1),{escapeKey:T,outsidePress:H}=qa(v),{escapeKey:L,outsidePress:V}=qa(w),S=a.useRef(!1),q=a.useRef(-1),P=ze(e=>{var t;if(!n||!l||!u||"Escape"!==e.key)return;if(S.current)return;const a=null==(t=o.current.floatingContext)?void 0:t.nodeId,i=E?qe(E.nodesRef.current,a):[];if(!T&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)}),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")}),O=ze(e=>{var t;const n=()=>{var t;P(e),null==(t=xe(e))||t.removeEventListener("keydown",n)};null==(t=xe(e))||t.addEventListener("keydown",n)}),D=ze(e=>{var t;const n=o.current.insideReactTree;o.current.insideReactTree=!1;const a=x.current;if(x.current=!1,"click"===m&&a)return;if(n)return;if("function"==typeof C&&!C(e))return;const l=xe(e),u="["+Dn("inert")+"]",s=He(i.floating).querySelectorAll(u);let p=d(l)?l:null;for(;p&&!b(p);){const e=M(p);if(b(e)||!d(e))break;p=e}if(s.length&&d(l)&&!l.matches("html,body")&&!Ce(l,i.floating)&&Array.from(s).every(e=>!Ce(p,e)))return;if(c(l)&&I){const t=b(l),n=y(l),a=/auto|scroll/,r=t||a.test(n.overflowX),i=t||a.test(n.overflowY),o=r&&l.clientWidth>0&&l.scrollWidth>l.clientWidth,u=i&&l.clientHeight>0&&l.scrollHeight>l.clientHeight,s="rtl"===n.direction,d=u&&(s?e.offsetX<=l.offsetWidth-l.clientWidth:e.offsetX>l.clientWidth),c=o&&e.offsetY>l.clientHeight;if(d||c)return}const f=null==(t=o.current.floatingContext)?void 0:t.nodeId,h=E&&qe(E.nodesRef.current,f).some(t=>{var n;return Te(e,null==(n=t.context)?void 0:n.elements.floating)});if(Te(e,i.floating)||Te(e,i.domReference)||h)return;const v=E?qe(E.nodesRef.current,f):[];if(v.length>0){let e=!0;if(v.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}r(!1,e,"outside-press")}),R=ze(e=>{var t;const n=()=>{var t;D(e),null==(t=xe(e))||t.removeEventListener(m,n)};null==(t=xe(e))||t.addEventListener(m,n)});a.useEffect(()=>{if(!n||!l)return;o.current.__escapeKeyBubbles=T,o.current.__outsidePressBubbles=H;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function a(){window.clearTimeout(e),S.current=!0}function s(){e=window.setTimeout(()=>{S.current=!1},g()?5:0)}const c=He(i.floating);u&&(c.addEventListener("keydown",L?O:P,L),c.addEventListener("compositionstart",a),c.addEventListener("compositionend",s)),C&&c.addEventListener(m,V?R:D,V);let p=[];return h&&(d(i.domReference)&&(p=_(i.domReference)),d(i.floating)&&(p=p.concat(_(i.floating))),!d(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(_(i.reference.contextElement)))),p=p.filter(e=>{var t;return e!==(null==(t=c.defaultView)?void 0:t.visualViewport)}),p.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{u&&(c.removeEventListener("keydown",L?O:P,L),c.removeEventListener("compositionstart",a),c.removeEventListener("compositionend",s)),C&&c.removeEventListener(m,V?R:D,V),p.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[o,i,u,C,m,n,r,h,l,T,H,P,L,O,D,V,R]),a.useEffect(()=>{o.current.insideReactTree=!1},[o,C,m]);const j=a.useMemo(()=>({onKeyDown:P,...p&&{[Va[f]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==f&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}}),[P,r,p,f]),I=a.useMemo(()=>({onKeyDown:P,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[Sa[m]]:()=>{o.current.insideReactTree=!0},onBlurCapture(){E||(Rn(q),o.current.insideReactTree=!0,q.current=window.setTimeout(()=>{o.current.insideReactTree=!1}))}}),[P,m,o,E]);return a.useMemo(()=>l?{reference:j,floating:I}:{},[l,j,I])}function Oa(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=Cn(),o=a.useRef({}),[l]=a.useState(()=>Tn()),u=null!=Vn(),[s,d]=a.useState(r.reference),c=ze((e,t,a)=>{o.current.openEvent=e?t:void 0,l.emit("openchange",{open:e,event:t,reason:a,nested:u}),null==n||n(e,t,a)}),m=a.useMemo(()=>({setPositionReference:d}),[]),p=a.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return a.useMemo(()=>({dataRef:o,open:t,onOpenChange:c,elements:p,events:l,floatingId:i,refs:m}),[t,c,p,l,i,m])}function Da(e){void 0===e&&(e={});const{nodeId:t}=e,n=Oa({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[o,l]=a.useState(null),[u,s]=a.useState(null),c=(null==i?void 0:i.domReference)||o,m=a.useRef(null),p=Sn();Ie(()=>{c&&(m.current=c)},[c]);const f=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:u=!0,whileElementsMounted:s,open:d}=e,[c,m]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=a.useState(r);zt(p,r)||f(r);const[h,v]=a.useState(null),[g,b]=a.useState(null),y=a.useCallback(e=>{e!==_.current&&(_.current=e,v(e))},[]),w=a.useCallback(e=>{e!==k.current&&(k.current=e,b(e))},[]),M=o||h,E=l||g,_=a.useRef(null),k=a.useRef(null),C=a.useRef(c),x=null!=s,T=Bt(s),H=Bt(i),L=Bt(d),V=a.useCallback(()=>{if(!_.current||!k.current)return;const e={placement:t,strategy:n,middleware:p};H.current&&(e.platform=H.current),At(_.current,k.current,e).then(e=>{const t={...e,isPositioned:!1!==L.current};S.current&&!zt(C.current,t)&&(C.current=t,ot.flushSync(()=>{m(t)}))})},[p,t,n,H,L]);Ft(()=>{!1===d&&C.current.isPositioned&&(C.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[d]);const S=a.useRef(!1);Ft(()=>(S.current=!0,()=>{S.current=!1}),[]),Ft(()=>{if(M&&(_.current=M),E&&(k.current=E),M&&E){if(T.current)return T.current(M,E,V);V()}},[M,E,V,T,x]);const q=a.useMemo(()=>({reference:_,floating:k,setReference:y,setFloating:w}),[y,w]),P=a.useMemo(()=>({reference:M,floating:E}),[M,E]),O=a.useMemo(()=>{const e={position:n,left:0,top:0};if(!P.floating)return e;const t=Nt(P.floating,c.x),a=Nt(P.floating,c.y);return u?{...e,transform:"translate("+t+"px, "+a+"px)",...Wt(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:a}},[n,u,P.floating,c.x,c.y]);return a.useMemo(()=>({...c,update:V,refs:q,elements:P,floatingStyles:O}),[c,V,q,P,O])}({...e,elements:{...i,...u&&{reference:u}}}),h=a.useCallback(e=>{const t=d(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),f.refs.setReference(t)},[f.refs]),v=a.useCallback(e=>{(d(e)||null===e)&&(m.current=e,l(e)),(d(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!d(e))&&f.refs.setReference(e)},[f.refs]),g=a.useMemo(()=>({...f.refs,setReference:v,setPositionReference:h,domReference:m}),[f.refs,v,h]),b=a.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),y=a.useMemo(()=>({...f,...r,refs:g,elements:b,nodeId:t}),[f,g,b,t,r]);return Ie(()=>{r.dataRef.current.floatingContext=y;const e=null==p?void 0:p.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),a.useMemo(()=>({...f,context:y,refs:g,elements:b}),[f,g,b,y])}function Ra(){return pe().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&he()}function ja(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:i,dataRef:o,elements:u}=e,{enabled:s=!0,visibleOnly:m=!0}=t,p=a.useRef(!1),f=a.useRef(-1),h=a.useRef(!0);a.useEffect(()=>{if(!s)return;const e=l(u.domReference);function t(){!n&&c(u.domReference)&&u.domReference===ke(He(u.domReference))&&(p.current=!0)}function a(){h.current=!0}function r(){h.current=!1}return e.addEventListener("blur",t),Ra()&&(e.addEventListener("keydown",a,!0),e.addEventListener("pointerdown",r,!0)),()=>{e.removeEventListener("blur",t),Ra()&&(e.removeEventListener("keydown",a,!0),e.removeEventListener("pointerdown",r,!0))}},[u.domReference,n,s]),a.useEffect(()=>{if(s)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(p.current=!0)}},[i,s]),a.useEffect(()=>()=>{Rn(f)},[]);const v=a.useMemo(()=>({onMouseLeave(){p.current=!1},onFocus(e){if(p.current)return;const t=xe(e.nativeEvent);if(m&&d(t))if(Ra()&&!e.relatedTarget){if(!h.current&&!Le(t))return}else if(!function(e){if(!e||ge())return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(t))return;r(!0,e.nativeEvent,"focus")},onBlur(e){p.current=!1;const t=e.relatedTarget,n=e.nativeEvent,a=d(t)&&t.hasAttribute(Dn("focus-guard"))&&"outside"===t.getAttribute("data-type");f.current=window.setTimeout(()=>{var e;const i=ke(u.domReference?u.domReference.ownerDocument:document);(t||i!==u.domReference)&&(Ce(null==(e=o.current.floatingContext)?void 0:e.refs.floating.current,i)||Ce(u.domReference,i)||a||r(!1,n,"focus"))})}}),[o,u.domReference,r,m]);return a.useMemo(()=>s?{reference:v}:{},[s,v])}function Ia(e,t,n){const a=new Map,r="item"===n;let i=e;if(r&&e){const{[un]:t,[sn]:n,...a}=e;i=a}return{..."floating"===n&&{tabIndex:-1,[ln]:""},...i,...t.map(t=>{const a=t?t[n]:null;return"function"==typeof a?e?a(e):null:a}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,i]=t;var o;r&&[un,sn].includes(n)||(0===n.indexOf("on")?(a.has(n)||a.set(n,[]),"function"==typeof i&&(null==(o=a.get(n))||o.push(i),e[n]=function(){for(var e,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return null==(e=a.get(n))?void 0:e.map(e=>e(...r)).find(e=>void 0!==e)})):e[n]=i)}),e):e,{})}}function Aa(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),i=a.useCallback(t=>Ia(t,e,"reference"),t),o=a.useCallback(t=>Ia(t,e,"floating"),n),l=a.useCallback(t=>Ia(t,e,"item"),r);return a.useMemo(()=>({getReferenceProps:i,getFloatingProps:o,getItemProps:l}),[i,o,l])}const Fa="Escape";function za(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Wa(e,t){return za(t,e===mn||e===pn,e===dn||e===cn)}function Na(e,t,n){return za(t,e===pn,n?e===dn:e===cn)||"Enter"===e||" "===e||""===e}function Ba(e,t,n){return za(t,n?e===dn:e===cn,e===pn)}function $a(e,t,n,a){return"both"===t||"horizontal"===t&&a&&a>1?e===Fa:za(t,n?e===cn:e===dn,e===mn)}function Ua(e,t){const{open:n,onOpenChange:r,elements:i,floatingId:o}=e,{listRef:l,activeIndex:u,onNavigate:s=()=>{},enabled:d=!0,selectedIndex:m=null,allowEscape:p=!1,loop:f=!1,nested:h=!1,rtl:v=!1,virtual:g=!1,focusItemOnOpen:b="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:w=!0,disabledIndices:M,orientation:E="vertical",parentOrientation:_,cols:k=1,scrollItemIntoView:C=!0,virtualItemRef:x,itemSizes:T,dense:H=!1}=t,L=Ae(Se(i.floating)),V=Vn(),S=Sn();Ie(()=>{e.dataRef.current.orientation=E},[e,E]);const q=ze(()=>{s(-1===D.current?null:D.current)}),P=Ve(i.domReference),O=a.useRef(b),D=a.useRef(null!=m?m:-1),R=a.useRef(null),j=a.useRef(!0),I=a.useRef(q),A=a.useRef(!!i.floating),F=a.useRef(n),z=a.useRef(!1),W=a.useRef(!1),N=Ae(M),B=Ae(n),$=Ae(C),U=Ae(m),[K,Y]=a.useState(),[G,X]=a.useState(),Q=ze(()=>{function e(e){var t;g?(null!=(t=e.id)&&t.endsWith("-fui-option")&&(e.id=o+"-"+Math.random().toString(16).slice(2,10)),Y(e.id),null==S||S.events.emit("virtualfocus",e),x&&(x.current=e)):Xn(e,{sync:z.current,preventScroll:!0})}const t=l.current[D.current],n=W.current;t&&e(t),(z.current?e=>e():requestAnimationFrame)(()=>{const a=l.current[D.current]||t;if(!a)return;t||e(a);const r=$.current;r&&Z&&(n||!j.current)&&(null==a.scrollIntoView||a.scrollIntoView("boolean"==typeof r?{block:"nearest",inline:"nearest"}:r))})});Ie(()=>{d&&(n&&i.floating?O.current&&null!=m&&(W.current=!0,D.current=m,q()):A.current&&(D.current=-1,I.current()))},[d,n,i.floating,m,q]),Ie(()=>{if(d&&n&&i.floating)if(null==u){if(z.current=!1,null!=U.current)return;if(A.current&&(D.current=-1,Q()),(!F.current||!A.current)&&O.current&&(null!=R.current||!0===O.current&&null==R.current)){let e=0;const t=()=>{null==l.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(D.current=null==R.current||Na(R.current,E,v)||h?Be(l,N.current):$e(l,N.current),R.current=null,q())};t()}}else Ne(l,u)||(D.current=u,Q(),W.current=!1)},[d,n,i.floating,u,U,h,l,E,v,q,Q,N]),Ie(()=>{var e;if(!d||i.floating||!S||g||!A.current)return;const t=S.nodesRef.current,n=null==(e=t.find(e=>e.id===V))||null==(e=e.context)?void 0:e.elements.floating,a=ke(He(i.floating)),r=t.some(e=>e.context&&Ce(e.context.elements.floating,a));n&&!r&&j.current&&n.focus({preventScroll:!0})},[d,i.floating,S,V,g]),Ie(()=>{if(d&&S&&g&&!V)return S.events.on("virtualfocus",e),()=>{S.events.off("virtualfocus",e)};function e(e){X(e.id),x&&(x.current=e)}},[d,S,g,V,x]),Ie(()=>{I.current=q,F.current=n,A.current=!!i.floating}),Ie(()=>{n||(R.current=null,O.current=b)},[n,b]);const J=null!=u,Z=a.useMemo(()=>{function e(e){if(!B.current)return;const t=l.current.indexOf(e);-1!==t&&D.current!==t&&(D.current=t,q())}return{onFocus(t){let{currentTarget:n}=t;z.current=!0,e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...y&&{onMouseMove(t){let{currentTarget:n}=t;z.current=!0,W.current=!1,e(n)},onPointerLeave(e){let{pointerType:t}=e;var n;j.current&&"touch"!==t&&(z.current=!0,D.current=-1,q(),g||null==(n=L.current)||n.focus({preventScroll:!0}))}}}},[B,L,y,l,q,g]),ee=a.useCallback(()=>{var e;return null!=_?_:null==S||null==(e=S.nodesRef.current.find(e=>e.id===V))||null==(e=e.context)||null==(e=e.dataRef)?void 0:e.current.orientation},[V,S,_]),te=ze(e=>{if(j.current=!1,z.current=!0,229===e.which)return;if(!B.current&&e.currentTarget===L.current)return;if(h&&$a(e.key,E,v,k))return Wa(e.key,ee())||Oe(e),r(!1,e.nativeEvent,"list-navigation"),void(c(i.domReference)&&(g?null==S||S.events.emit("virtualfocus",i.domReference):i.domReference.focus()));const t=D.current,a=Be(l,M),o=$e(l,M);if(P||("Home"===e.key&&(Oe(e),D.current=a,q()),"End"===e.key&&(Oe(e),D.current=o,q())),k>1){const t=T||Array.from({length:l.current.length},()=>({width:1,height:1})),n=Ye(t,k,H),r=n.findIndex(e=>null!=e&&!Qe(l,e,M)),i=n.reduce((e,t,n)=>null==t||Qe(l,t,M)?e:n,-1),u=n[Ke({current:n.map(e=>null!=e?l.current[e]:null)},{event:e,orientation:E,loop:f,rtl:v,cols:k,disabledIndices:Xe([...("function"!=typeof M?M:null)||l.current.map((e,t)=>Qe(l,t,M)?t:void 0),void 0],n),minIndex:r,maxIndex:i,prevIndex:Ge(D.current>o?a:D.current,t,n,k,e.key===pn?"bl":e.key===(v?dn:cn)?"tr":"tl"),stopEvent:!0})];if(null!=u&&(D.current=u,q()),"both"===E)return}if(Wa(e.key,E)){if(Oe(e),n&&!g&&ke(e.currentTarget.ownerDocument)===e.currentTarget)return D.current=Na(e.key,E,v)?a:o,void q();Na(e.key,E,v)?D.current=f?t>=o?p&&t!==l.current.length?-1:a:Ue(l,{startingIndex:t,disabledIndices:M}):Math.min(o,Ue(l,{startingIndex:t,disabledIndices:M})):D.current=f?t<=a?p&&-1!==t?l.current.length:o:Ue(l,{startingIndex:t,decrement:!0,disabledIndices:M}):Math.max(a,Ue(l,{startingIndex:t,decrement:!0,disabledIndices:M})),Ne(l,D.current)&&(D.current=-1),q()}}),ne=a.useMemo(()=>g&&n&&J&&{"aria-activedescendant":G||K},[g,n,J,G,K]),ae=a.useMemo(()=>({"aria-orientation":"both"===E?void 0:E,...P?{}:ne,onKeyDown:te,onPointerMove(){j.current=!0}}),[ne,te,E,P]),re=a.useMemo(()=>{function e(e){"auto"===b&&De(e.nativeEvent)&&(O.current=!0)}function t(e){O.current=b,"auto"===b&&Re(e.nativeEvent)&&(O.current=!0)}return{...ne,onKeyDown(e){j.current=!1;const t=e.key.startsWith("Arrow"),a=["Home","End"].includes(e.key),i=t||a,o=Ba(e.key,E,v),u=$a(e.key,E,v,k),s=Ba(e.key,ee(),v),d=Wa(e.key,E),c=(h?s:d)||"Enter"===e.key||""===e.key.trim();if(g&&n){const t=null==S?void 0:S.nodesRef.current.find(e=>null==e.parentId),n=S&&t?function(e,t){let n,a=-1;return function t(r,i){i>a&&(n=r,a=i),qe(e,r).forEach(e=>{t(e.id,i+1)})}(t,0),e.find(e=>e.id===n)}(S.nodesRef.current,t.id):null;if(i&&n&&x){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(o||u){var p,f;const a=(null==(p=n.context)?void 0:p.elements.domReference)===e.currentTarget,r=u&&!a?null==(f=n.context)?void 0:f.elements.domReference:o?l.current.find(e=>(null==e?void 0:e.id)===K):null;r&&(Oe(e),r.dispatchEvent(t),X(void 0))}var b;if((d||a)&&n.context&&n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference)return Oe(e),void(null==(b=n.context.elements.domReference)||b.dispatchEvent(t))}return te(e)}if(n||w||!t){if(c){const t=Wa(e.key,ee());R.current=h&&t?null:e.key}h?s&&(Oe(e),n?(D.current=Be(l,N.current),q()):r(!0,e.nativeEvent,"list-navigation")):d&&(null!=m&&(D.current=m),Oe(e),!n&&w?r(!0,e.nativeEvent,"list-navigation"):te(e),n&&q())}},onFocus(){n&&!g&&(D.current=-1,q())},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[K,ne,k,te,N,b,l,h,q,r,n,w,E,ee,v,m,S,g,x]);return a.useMemo(()=>d?{reference:re,floating:ae,item:Z}:{},[d,re,ae,Z])}const Ka=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Ya(e,t){var n,r;void 0===t&&(t={});const{open:i,elements:o,floatingId:l}=e,{enabled:u=!0,role:s="dialog"}=t,d=Cn(),c=(null==(n=o.domReference)?void 0:n.id)||d,m=a.useMemo(()=>{var e;return(null==(e=Se(o.floating))?void 0:e.id)||l},[o.floating,l]),p=null!=(r=Ka.get(s))?r:s,f=null!=Vn(),h=a.useMemo(()=>"tooltip"===p||"label"===s?{["aria-"+("label"===s?"labelledby":"describedby")]:i?m:void 0}:{"aria-expanded":i?"true":"false","aria-haspopup":"alertdialog"===p?"dialog":p,"aria-controls":i?m:void 0,..."listbox"===p&&{role:"combobox"},..."menu"===p&&{id:c},..."menu"===p&&f&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}},[p,m,f,i,c,s]),v=a.useMemo(()=>{const e={id:m,...p&&{role:p}};return"tooltip"===p||"label"===s?e:{...e,..."menu"===p&&{"aria-labelledby":c}}},[p,m,c,s]),g=a.useCallback(e=>{let{active:t,selected:n}=e;const a={role:"option",...t&&{id:m+"-fui-option"}};switch(s){case"select":return{...a,"aria-selected":t&&n};case"combobox":return{...a,"aria-selected":n}}return{}},[m,s]);return a.useMemo(()=>u?{reference:h,floating:v,item:g}:{},[u,h,v,g])}const Ga=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function Xa(e,t){return"function"==typeof e?e(t):e}function Qa(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,o=("number"==typeof i?i:i.close)||0,[l,u]=a.useState("unmounted"),s=function(e,t){const[n,r]=a.useState(e);return e&&!n&&r(!0),a.useEffect(()=>{if(!e&&n){const e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(n,o);return s||"close"!==l||u("unmounted"),Ie(()=>{if(r){if(n){u("initial");const e=requestAnimationFrame(()=>{ot.flushSync(()=>{u("open")})});return()=>{cancelAnimationFrame(e)}}u("close")}},[n,r]),{isMounted:s,status:l}}function Ja(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:i,common:o,duration:l=250}=t,u=e.placement,s=u.split("-")[0],d=a.useMemo(()=>({side:s,placement:u}),[s,u]),c="number"==typeof l,m=(c?l:l.open)||0,p=(c?l:l.close)||0,[f,h]=a.useState(()=>({...Xa(o,d),...Xa(n,d)})),{isMounted:v,status:g}=Qa(e,{duration:l}),b=Ae(n),y=Ae(r),w=Ae(i),M=Ae(o);return Ie(()=>{const e=Xa(b.current,d),t=Xa(w.current,d),n=Xa(M.current,d),a=Xa(y.current,d)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===g&&h(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===g&&h({transitionProperty:Object.keys(a).map(Ga).join(","),transitionDuration:m+"ms",...n,...a}),"close"===g){const a=t||e;h({transitionProperty:Object.keys(a).map(Ga).join(","),transitionDuration:p+"ms",...n,...a})}},[p,w,b,y,M,m,g,d]),{isMounted:v,styles:f}}function Za(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:l,onMatch:u,onTypingChange:s,enabled:d=!0,findMatch:c=null,resetMs:m=750,ignoreKeys:p=[],selectedIndex:f=null}=t,h=a.useRef(-1),v=a.useRef(""),g=a.useRef(null!=(n=null!=f?f:l)?n:-1),b=a.useRef(null),y=ze(u),w=ze(s),M=Ae(c),E=Ae(p);Ie(()=>{r&&(Rn(h),b.current=null,v.current="")},[r]),Ie(()=>{var e;r&&""===v.current&&(g.current=null!=(e=null!=f?f:l)?e:-1)},[r,f,l]);const _=ze(e=>{e?i.current.typing||(i.current.typing=e,w(e)):i.current.typing&&(i.current.typing=e,w(e))}),k=ze(e=>{function t(e,t,n){const a=M.current?M.current(t,n):t.find(e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase())));return a?e.indexOf(a):-1}const n=o.current;if(v.current.length>0&&" "!==v.current[0]&&(-1===t(n,n,v.current)?_(!1):" "===e.key&&Oe(e)),null==n||E.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(Oe(e),_(!0)),n.every(e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())})&&v.current===e.key&&(v.current="",g.current=b.current),v.current+=e.key,Rn(h),h.current=window.setTimeout(()=>{v.current="",g.current=b.current,_(!1)},m);const a=g.current,i=t(n,[...n.slice((a||0)+1),...n.slice(0,(a||0)+1)],v.current);-1!==i?(y(i),b.current=i):" "!==e.key&&(v.current="",_(!1))}),C=a.useMemo(()=>({onKeyDown:k}),[k]),x=a.useMemo(()=>({onKeyDown:k,onKeyUp(e){" "===e.key&&_(!1)}}),[k,_]);return a.useMemo(()=>d?{reference:C,floating:x}:{},[d,C,x])}function er(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const tr=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:a,onFallbackChange:r,offset:i=0,index:o=0,minItemsVisible:l=4,referenceOverflowThreshold:u=0,scrollRef:s,...d}=R(e,t),{rects:c,elements:{floating:m}}=t,p=n.current[o],f=(null==s?void 0:s.current)||m,h=m.clientTop||f.clientTop,v=0!==m.clientTop,g=0!==f.clientTop,b=m===f;if(!p)return{};const y={...t,...await Ut(-p.offsetTop-m.clientTop-c.reference.height/2-p.offsetHeight/2-i).fn(t)},w=await Lt(er(y,f.scrollHeight+h+m.clientTop),d),M=await Lt(y,{...d,elementContext:"reference"}),E=L(0,w.top),_=y.y+E,k=(f.scrollHeight>f.clientHeight?e=>e:V)(L(0,f.scrollHeight+(v&&b||g?2*h:0)-E-L(0,w.bottom)));if(f.style.maxHeight=k+"px",f.scrollTop=E,r){const e=f.offsetHeight<p.offsetHeight*H(l,n.current.length)-1||M.top>=-u||M.bottom>=-u;ot.flushSync(()=>r(e))}return a&&(a.current=await Lt(er({...y,y:_},f.offsetHeight+h+m.clientTop),d)),{y:_}}});function nr(e,t){const{open:n,elements:r}=e,{enabled:i=!0,overflowRef:o,scrollRef:l,onChange:u}=t,s=ze(u),d=a.useRef(!1),c=a.useRef(null),m=a.useRef(null);a.useEffect(()=>{if(!i)return;function e(e){if(e.ctrlKey||!t||null==o.current)return;const n=e.deltaY,a=o.current.top>=-.5,r=o.current.bottom>=-.5,i=t.scrollHeight-t.clientHeight,l=n<0?-1:1,u=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!a&&n>0||!r&&n<0?(e.preventDefault(),ot.flushSync(()=>{s(e=>e+Math[u](n,i*l))})):/firefox/i.test(fe())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||r.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame(()=>{c.current=t.scrollTop,null!=o.current&&(m.current={...o.current})}),()=>{c.current=null,m.current=null,t.removeEventListener("wheel",e)}):void 0},[i,n,r.floating,o,l,s]);const p=a.useMemo(()=>({onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const e=(null==l?void 0:l.current)||r.floating;if(o.current&&e&&d.current){if(null!==c.current){const t=e.scrollTop-c.current;(o.current.bottom<-.5&&t<-1||o.current.top<-.5&&t>1)&&ot.flushSync(()=>s(e=>e+t))}requestAnimationFrame(()=>{c.current=e.scrollTop})}}}),[r.floating,s,o,l]);return a.useMemo(()=>i?{floating:p}:{},[i,p])}function ar(e,t){const[n,a]=e;let r=!1;const i=t.length;for(let e=0,o=i-1;e<i;o=e++){const[i,l]=t[e]||[0,0],[u,s]=t[o]||[0,0];l>=a!=s>=a&&n<=(u-i)*(a-l)/(s-l)+i&&(r=!r)}return r}function rr(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:a=!0}=e,r={current:-1};let i=!1,o=null,l=null,u=performance.now();const s=e=>{let{x:n,y:s,placement:c,elements:m,onClose:p,nodeId:f,tree:h}=e;return function(e){function v(){Rn(r),p()}if(Rn(r),!m.domReference||!m.floating||null==c||null==n||null==s)return;const{clientX:g,clientY:b}=e,y=[g,b],w=function(e){return"composedPath"in e?e.composedPath()[0]:e.target}(e),M="mouseleave"===e.type,E=Qn(m.floating,w),_=Qn(m.domReference,w),k=m.domReference.getBoundingClientRect(),C=m.floating.getBoundingClientRect(),x=c.split("-")[0],T=n>C.right-C.width/2,H=s>C.bottom-C.height/2,L=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,k),V=C.width>k.width,S=C.height>k.height,q=(V?k:C).left,P=(V?k:C).right,O=(S?k:C).top,D=(S?k:C).bottom;if(E&&(i=!0,!M))return;if(_&&(i=!1),_&&!M)return void(i=!0);if(M&&d(e.relatedTarget)&&Qn(m.floating,e.relatedTarget))return;if(h&&function(e,t){let n=e.filter(e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)}),a=n;for(;a.length;)a=e.filter(e=>{var t;return null==(t=a)?void 0:t.some(t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)})}),n=n.concat(a);return n}(h.nodesRef.current,f).length)return;if("top"===x&&s>=k.bottom-1||"bottom"===x&&s<=k.top+1||"left"===x&&n>=k.right-1||"right"===x&&n<=k.left+1)return v();let R=[];switch(x){case"top":R=[[q,k.top+1],[q,C.bottom-1],[P,C.bottom-1],[P,k.top+1]];break;case"bottom":R=[[q,C.top+1],[q,k.bottom-1],[P,k.bottom-1],[P,C.top+1]];break;case"left":R=[[C.right-1,D],[C.right-1,O],[k.left+1,O],[k.left+1,D]];break;case"right":R=[[k.right-1,D],[k.right-1,O],[C.left+1,O],[C.left+1,D]]}if(!ar([g,b],R)){if(i&&!L)return v();if(!M&&a){const t=function(e,t){const n=performance.now(),a=n-u;if(null===o||null===l||0===a)return o=e,l=t,u=n,null;const r=e-o,i=t-l,s=Math.sqrt(r*r+i*i);return o=e,l=t,u=n,s/a}(e.clientX,e.clientY);if(null!==t&&t<.1)return v()}ar([g,b],function(e){let[n,a]=e;switch(x){case"top":return[[V?n+t/2:T?n+4*t:n-4*t,a+t+1],[V?n-t/2:T?n+4*t:n-4*t,a+t+1],[C.left,T||V?C.bottom-t:C.top],[C.right,T?V?C.bottom-t:C.top:C.bottom-t]];case"bottom":return[[V?n+t/2:T?n+4*t:n-4*t,a-t],[V?n-t/2:T?n+4*t:n-4*t,a-t],[C.left,T||V?C.top+t:C.bottom],[C.right,T?V?C.top+t:C.bottom:C.top+t]];case"left":{const e=[n+t+1,S?a+t/2:H?a+4*t:a-4*t],r=[n+t+1,S?a-t/2:H?a+4*t:a-4*t];return[[H||S?C.right-t:C.left,C.top],[H?S?C.right-t:C.left:C.right-t,C.bottom],e,r]}case"right":return[[n-t,S?a+t/2:H?a+4*t:a-4*t],[n-t,S?a-t/2:H?a+4*t:a-4*t],[H||S?C.left+t:C.right,C.top],[H?S?C.left+t:C.right:C.left+t,C.bottom]]}}([n,s]))?!i&&a&&(r.current=window.setTimeout(v,40)):v()}}};return s.__options={blockPointerEvents:n},s}},74801:(e,t,n)=>{"use strict";t.localeToNumber=function(e){const t=e.toString().replace(/[१२३४५६७८९०]/g,function(e){return r.number[e]});return Number(t)},t.localize=void 0,t.numberToLocale=i;var a=n(91151);const r={locale:{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},number:{"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"}};function i(e){return e.toString().replace(/\d/g,function(e){return r.locale[e]})}t.localize={ordinalNumber:(e,t)=>i(Number(e)),era:(0,a.buildLocalizeFn)({values:{narrow:["ईसा-पूर्व","ईस्वी"],abbreviated:["ईसा-पूर्व","ईस्वी"],wide:["ईसा-पूर्व","ईसवी सन"]},defaultWidth:"wide"}),quarter:(0,a.buildLocalizeFn)({values:{narrow:["1","2","3","4"],abbreviated:["ति1","ति2","ति3","ति4"],wide:["पहली तिमाही","दूसरी तिमाही","तीसरी तिमाही","चौथी तिमाही"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:(0,a.buildLocalizeFn)({values:{narrow:["ज","फ़","मा","अ","मई","जू","जु","अग","सि","अक्टू","न","दि"],abbreviated:["जन","फ़र","मार्च","अप्रैल","मई","जून","जुल","अग","सित","अक्टू","नव","दिस"],wide:["जनवरी","फ़रवरी","मार्च","अप्रैल","मई","जून","जुलाई","अगस्त","सितंबर","अक्टूबर","नवंबर","दिसंबर"]},defaultWidth:"wide"}),day:(0,a.buildLocalizeFn)({values:{narrow:["र","सो","मं","बु","गु","शु","श"],short:["र","सो","मं","बु","गु","शु","श"],abbreviated:["रवि","सोम","मंगल","बुध","गुरु","शुक्र","शनि"],wide:["रविवार","सोमवार","मंगलवार","बुधवार","गुरुवार","शुक्रवार","शनिवार"]},defaultWidth:"wide"}),dayPeriod:(0,a.buildLocalizeFn)({values:{narrow:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"},abbreviated:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"},wide:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"}},defaultWidth:"wide",formattingValues:{narrow:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"},abbreviated:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"},wide:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"}},defaultFormattingWidth:"wide"})}},75135:(e,t,n)=>{"use strict";t.lastDayOfDecade=function(e,t){const n=(0,a.toDate)(e,t?.in),r=n.getFullYear(),i=9+10*Math.floor(r/10);return n.setFullYear(i+1,0,0),n.setHours(0,0,0,0),(0,a.toDate)(n,t?.in)};var a=n(24429)},75219:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){var e=document.getElementsByTagName("html")[0];for(var t in n)r(e,n[t]);var i=document.body;for(var o in a)r(i,a[o]);n={},a={}},t.log=function(){};var n={},a={};function r(e,t){e.classList.remove(t)}t.add=function(e,t){return r=e.classList,i="html"==e.nodeName.toLowerCase()?n:a,void t.split(" ").forEach(function(e){!function(e,t){e[t]||(e[t]=0),e[t]+=1}(i,e),r.add(e)});var r,i},t.remove=function(e,t){return r=e.classList,i="html"==e.nodeName.toLowerCase()?n:a,void t.split(" ").forEach(function(e){!function(e,t){e[t]&&(e[t]-=1)}(i,e),0===i[e]&&r.remove(e)});var r,i}},75263:function(e,t,n){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RadioButton=void 0;const r=n(31085),i=a(n(88694)),o=n(77055),l=n(73693),u=i.default.label`
2898
+ `;t.DropdownMenu=(0,o.forwardRef)((e,t)=>{var{children:n,className:r,id:l,hidden:c,onKeyDown:m}=e,p=a(e,["children","className","id","hidden","onKeyDown"]);const f=(0,o.useMemo)(()=>l||(0,s.v4)(),[l]),h=(0,u.useDataAttributes)(p);return(0,i.jsx)(d,Object.assign({ref:t,className:r,"data-testid":"menu-list",id:f,hidden:c,onKeyDownCapture:e=>null==m?void 0:m(e)},h,{children:n}))});try{t.DropdownMenu.displayName="DropdownMenu",t.DropdownMenu.__docgenInfo={description:"",displayName:"DropdownMenu",props:{id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},hidden:{defaultValue:null,description:"",name:"hidden",required:!1,type:{name:"boolean"}},onKeyDown:{defaultValue:null,description:"",name:"onKeyDown",required:!1,type:{name:"((event: KeyboardEvent<Element>) => void)"}},ref:{defaultValue:null,description:"Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}",name:"ref",required:!1,type:{name:"LegacyRef<HTMLDivElement>"}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"Key | null"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/dropdown-menu/dropdown-menu.tsx#DropdownMenu"]={docgenInfo:t.DropdownMenu.__docgenInfo,name:"DropdownMenu",path:"src/components/dropdown-menu/dropdown-menu.tsx#DropdownMenu"})}catch(e){}},74464:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var a,r,i=n(39155);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},o.apply(null,arguments)}const l=function(e){return i.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),a||(a=i.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M8 14.667A6.667 6.667 0 1 0 8 1.333a6.667 6.667 0 0 0 0 13.334"})),r||(r=i.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M10.667 8 8 5.333 5.333 8M8 10.667V5.333"})))}},74785:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Composite:()=>Pn,CompositeItem:()=>On,FloatingArrow:()=>Fn,FloatingDelayGroup:()=>ra,FloatingFocusManager:()=>Oa,FloatingList:()=>yn,FloatingNode:()=>Kn,FloatingOverlay:()=>Ia,FloatingPortal:()=>xa,FloatingTree:()=>Yn,NextFloatingDelayGroup:()=>la,arrow:()=>hn,autoPlacement:()=>mn,autoUpdate:()=>Wt,computePosition:()=>Zt,detectOverflow:()=>Nt,flip:()=>dn,getOverflowAncestors:()=>V,hide:()=>pn,inline:()=>fn,inner:()=>hr,limitShift:()=>sn,offset:()=>ln,platform:()=>Ft,safePolygon:()=>yr,shift:()=>un,size:()=>cn,useClick:()=>za,useClientPoint:()=>Na,useDelayGroup:()=>ia,useDelayGroupContext:()=>aa,useDismiss:()=>Ka,useFloating:()=>Ga,useFloatingNodeId:()=>Un,useFloatingParentNodeId:()=>Bn,useFloatingPortalNode:()=>Ca,useFloatingRootContext:()=>Ya,useFloatingTree:()=>$n,useFocus:()=>Qa,useHover:()=>ea,useId:()=>An,useInnerOffset:()=>vr,useInteractions:()=>Za,useListItem:()=>wn,useListNavigation:()=>or,useMergeRefs:()=>vn,useNextDelayGroup:()=>ua,useRole:()=>ur,useTransitionStatus:()=>cr,useTransitionStyles:()=>mr,useTypeahead:()=>pr});var a=n(39155),r=n.t(a,2);function i(){return"undefined"!=typeof window}function o(e){return s(e)?(e.nodeName||"").toLowerCase():"#document"}function l(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function u(e){var t;return null==(t=(s(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function s(e){return!!i()&&(e instanceof Node||e instanceof l(e).Node)}function d(e){return!!i()&&(e instanceof Element||e instanceof l(e).Element)}function c(e){return!!i()&&(e instanceof HTMLElement||e instanceof l(e).HTMLElement)}function m(e){return!(!i()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof l(e).ShadowRoot)}const p=new Set(["inline","contents"]);function f(e){const{overflow:t,overflowX:n,overflowY:a,display:r}=x(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!p.has(r)}const h=new Set(["table","td","th"]);function v(e){return h.has(o(e))}const g=[":popover-open",":modal"];function b(e){return g.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const y=["transform","translate","scale","rotate","perspective"],w=["transform","translate","scale","rotate","perspective","filter"],M=["paint","layout","strict","content"];function E(e){const t=_(),n=d(e)?x(e):e;return y.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||w.some(e=>(n.willChange||"").includes(e))||M.some(e=>(n.contain||"").includes(e))}function _(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const k=new Set(["html","body","#document"]);function C(e){return k.has(o(e))}function x(e){return l(e).getComputedStyle(e)}function T(e){return d(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function H(e){if("html"===o(e))return e;const t=e.assignedSlot||e.parentNode||m(e)&&e.host||u(e);return m(t)?t.host:t}function L(e){const t=H(e);return C(t)?e.ownerDocument?e.ownerDocument.body:e.body:c(t)&&f(t)?t:L(t)}function V(e,t,n){var a;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=L(e),i=r===(null==(a=e.ownerDocument)?void 0:a.body),o=l(r);if(i){const e=S(o);return t.concat(o,o.visualViewport||[],f(r)?r:[],e&&n?V(e):[])}return t.concat(r,V(r,[],n))}function S(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const q=["top","right","bottom","left"],P=["start","end"],O=q.reduce((e,t)=>e.concat(t,t+"-"+P[0],t+"-"+P[1]),[]),D=Math.min,R=Math.max,j=Math.round,I=Math.floor,A=e=>({x:e,y:e}),F={left:"right",right:"left",bottom:"top",top:"bottom"},z={start:"end",end:"start"};function W(e,t,n){return R(e,D(t,n))}function N(e,t){return"function"==typeof e?e(t):e}function B(e){return e.split("-")[0]}function $(e){return e.split("-")[1]}function U(e){return"x"===e?"y":"x"}function K(e){return"y"===e?"height":"width"}const Y=new Set(["top","bottom"]);function G(e){return Y.has(B(e))?"y":"x"}function X(e){return U(G(e))}function Q(e,t,n){void 0===n&&(n=!1);const a=$(e),r=X(e),i=K(r);let o="x"===r?a===(n?"end":"start")?"right":"left":"start"===a?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=ae(o)),[o,ae(o)]}function J(e){return e.replace(/start|end/g,e=>z[e])}const Z=["left","right"],ee=["right","left"],te=["top","bottom"],ne=["bottom","top"];function ae(e){return e.replace(/left|right|bottom|top/g,e=>F[e])}function re(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function ie(e){const{x:t,y:n,width:a,height:r}=e;return{width:a,height:r,top:n,left:t,right:t+a,bottom:n+r,x:t,y:n}}var oe=["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])"].join(","),le="undefined"==typeof Element,ue=le?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,se=!le&&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},de=function e(t,n){var a;void 0===n&&(n=!0);var r=null==t||null===(a=t.getAttribute)||void 0===a?void 0:a.call(t,"inert");return""===r||"true"===r||n&&t&&e(t.parentNode)},ce=function(e,t,n){if(de(e))return[];var a=Array.prototype.slice.apply(e.querySelectorAll(oe));return t&&ue.call(e,oe)&&a.unshift(e),a.filter(n)},me=function e(t,n,a){for(var r=[],i=Array.from(t);i.length;){var o=i.shift();if(!de(o,!1))if("SLOT"===o.tagName){var l=o.assignedElements(),u=e(l.length?l:o.children,!0,a);a.flatten?r.push.apply(r,u):r.push({scopeParent:o,candidates:u})}else{ue.call(o,oe)&&a.filter(o)&&(n||!t.includes(o))&&r.push(o);var s=o.shadowRoot||"function"==typeof a.getShadowRoot&&a.getShadowRoot(o),d=!de(s,!1)&&(!a.shadowRootFilter||a.shadowRootFilter(o));if(s&&d){var c=e(!0===s?o.children:s.children,!0,a);a.flatten?r.push.apply(r,c):r.push({scopeParent:o,candidates:c})}else i.unshift.apply(i,o.children)}}return r},pe=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},fe=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))&&!pe(e)?0:e.tabIndex},he=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ve=function(e){return"INPUT"===e.tagName},ge=function(e){var t=e.getBoundingClientRect(),n=t.width,a=t.height;return 0===n&&0===a},be=function(e,t){return!(t.disabled||de(t)||function(e){return ve(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,a=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var r=ue.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ue.call(r,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ge(e)}else{if("function"==typeof a){for(var i=e;e;){var o=e.parentElement,l=se(e);if(o&&!o.shadowRoot&&!0===a(o))return ge(e);e=e.assignedSlot?e.assignedSlot:o||l===e.ownerDocument?o:l.host}e=i}if(function(e){var t,n,a,r,i=e&&se(e),o=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(n=o)&&void 0!==n&&null!==(a=n.ownerDocument)&&void 0!==a&&a.contains(o)||null!=e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(e));!l&&o;){var u,s,d;l=!(null===(s=o=null===(u=i=se(o))||void 0===u?void 0:u.host)||void 0===s||null===(d=s.ownerDocument)||void 0===d||!d.contains(o))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(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 a=t.children.item(n);if("LEGEND"===a.tagName)return!!ue.call(t,"fieldset[disabled] *")||!a.contains(e)}return!0}t=t.parentElement}return!1}(t))},ye=function(e,t){return!(function(e){return function(e){return ve(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||se(e),a=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=a(window.CSS.escape(e.name));else try{t=a(e.name)}catch(e){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",e.message),!1}var r=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!r||r===e}(e)}(t)||fe(t)<0||!be(e,t))},we=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Me=function e(t){var n=[],a=[];return t.forEach(function(t,r){var i=!!t.scopeParent,o=i?t.scopeParent:t,l=function(e,t){var n=fe(e);return n<0&&t&&!pe(e)?0:n}(o,i),u=i?e(t.candidates):o;0===l?i?n.push.apply(n,u):n.push(o):a.push({documentOrder:r,tabIndex:l,item:t,isScope:i,content:u})}),a.sort(he).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(n)},Ee=function(e,t){var n;return n=(t=t||{}).getShadowRoot?me([e],t.includeContainer,{filter:ye.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:we}):ce(e,t.includeContainer,ye.bind(null,t)),Me(n)},_e=function(e,t){return(t=t||{}).getShadowRoot?me([e],t.includeContainer,{filter:be.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):ce(e,t.includeContainer,be.bind(null,t))},ke=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==ue.call(e,oe)&&ye(t,e)};function Ce(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function xe(){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 Te(){return/apple/i.test(navigator.vendor)}function He(){const e=/android/i;return e.test(Ce())||e.test(xe())}function Le(){return xe().includes("jsdom/")}const Ve="data-floating-ui-focusable",Se="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",qe="ArrowLeft",Pe="ArrowRight",Oe="ArrowUp",De="ArrowDown";function Re(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 je(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&m(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ie(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ae(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 Fe(e){return(null==e?void 0:e.ownerDocument)||document}function ze(e){return c(e)&&e.matches(Se)}function We(e){return!!e&&"combobox"===e.getAttribute("role")&&ze(e)}function Ne(e){return e?e.hasAttribute(Ve)?e:e.querySelector("["+Ve+"]")||e:null}function Be(e,t,n){return void 0===n&&(n=!0),e.filter(e=>{var a;return e.parentId===t&&(!n||(null==(a=e.context)?void 0:a.open))}).flatMap(t=>[t,...Be(e,t.id,n)])}function $e(e,t){var n;let a=[],r=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;r;){const t=e.find(e=>e.id===r);r=null==t?void 0:t.parentId,t&&(a=a.concat(t))}return a}function Ue(e){e.preventDefault(),e.stopPropagation()}function Ke(e){return!(0!==e.mozInputSource||!e.isTrusted)||(He()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function Ye(e){return!Le()&&(!He()&&0===e.width&&0===e.height||He()&&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 Ge(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var Xe="undefined"!=typeof document?a.useLayoutEffect:function(){};function Qe(e){const t=a.useRef(e);return Xe(()=>{t.current=e}),t}const Je={...r}.useInsertionEffect||(e=>e());function Ze(e){const t=a.useRef(()=>{});return Je(()=>{t.current=e}),a.useCallback(function(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];return null==t.current?void 0:t.current(...n)},[])}function et(e,t,n){return Math.floor(e/t)!==n}function tt(e,t){return t<0||t>=e.current.length}function nt(e,t){return rt(e,{disabledIndices:t})}function at(e,t){return rt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function rt(e,t){let{startingIndex:n=-1,decrement:a=!1,disabledIndices:r,amount:i=1}=void 0===t?{}:t,o=n;do{o+=a?-i:i}while(o>=0&&o<=e.current.length-1&&st(e,o,r));return o}function it(e,t){let{event:n,orientation:a,loop:r,rtl:i,cols:o,disabledIndices:l,minIndex:u,maxIndex:s,prevIndex:d,stopEvent:c=!1}=t,m=d;if(n.key===Oe){if(c&&Ue(n),-1===d)m=s;else if(m=rt(e,{startingIndex:m,amount:o,decrement:!0,disabledIndices:l}),r&&(d-o<u||m<0)){const e=d%o,t=s%o,n=s-(t-e);m=t===e?s:t>e?n:n-o}tt(e,m)&&(m=d)}if(n.key===De&&(c&&Ue(n),-1===d?m=u:(m=rt(e,{startingIndex:d,amount:o,disabledIndices:l}),r&&d+o>s&&(m=rt(e,{startingIndex:d%o-o,amount:o,disabledIndices:l}))),tt(e,m)&&(m=d)),"both"===a){const t=I(d/o);n.key===(i?qe:Pe)&&(c&&Ue(n),d%o!==o-1?(m=rt(e,{startingIndex:d,disabledIndices:l}),r&&et(m,o,t)&&(m=rt(e,{startingIndex:d-d%o-1,disabledIndices:l}))):r&&(m=rt(e,{startingIndex:d-d%o-1,disabledIndices:l})),et(m,o,t)&&(m=d)),n.key===(i?Pe:qe)&&(c&&Ue(n),d%o!==0?(m=rt(e,{startingIndex:d,decrement:!0,disabledIndices:l}),r&&et(m,o,t)&&(m=rt(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:l}))):r&&(m=rt(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:l})),et(m,o,t)&&(m=d));const a=I(s/o)===t;tt(e,m)&&(m=r&&a?n.key===(i?Pe:qe)?s:rt(e,{startingIndex:d-d%o-1,disabledIndices:l}):d)}return m}function ot(e,t,n){const a=[];let r=0;return e.forEach((e,i)=>{let{width:o,height:l}=e,u=!1;for(n&&(r=0);!u;){const e=[];for(let n=0;n<o;n++)for(let a=0;a<l;a++)e.push(r+n+a*t);r%t+o<=t&&e.every(e=>null==a[e])?(e.forEach(e=>{a[e]=i}),u=!0):r++}}),[...a]}function lt(e,t,n,a,r){if(-1===e)return-1;const i=n.indexOf(e),o=t[e];switch(r){case"tl":return i;case"tr":return o?i+o.width-1:i;case"bl":return o?i+(o.height-1)*a:i;case"br":return n.lastIndexOf(e)}}function ut(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function st(e,t,n){if("function"==typeof n)return n(t);if(n)return n.includes(t);const a=e.current[t];return null==a||a.hasAttribute("disabled")||"true"===a.getAttribute("aria-disabled")}const dt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ct(e,t){const n=Ee(e,dt()),a=n.length;if(0===a)return;const r=Re(Fe(e)),i=n.indexOf(r);return n[-1===i?1===t?0:a-1:i+t]}function mt(e){return ct(Fe(e).body,1)||e}function pt(e){return ct(Fe(e).body,-1)||e}function ft(e,t){const n=t||e.currentTarget,a=e.relatedTarget;return!a||!je(n,a)}function ht(e){Ee(e,dt()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function vt(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}var gt=n(31085),bt=n(69514);function yt(e,t,n){let{reference:a,floating:r}=e;const i=G(t),o=X(t),l=K(o),u=B(t),s="y"===i,d=a.x+a.width/2-r.width/2,c=a.y+a.height/2-r.height/2,m=a[l]/2-r[l]/2;let p;switch(u){case"top":p={x:d,y:a.y-r.height};break;case"bottom":p={x:d,y:a.y+a.height};break;case"right":p={x:a.x+a.width,y:c};break;case"left":p={x:a.x-r.width,y:c};break;default:p={x:a.x,y:a.y}}switch($(t)){case"start":p[o]-=m*(n&&s?-1:1);break;case"end":p[o]+=m*(n&&s?-1:1)}return p}async function wt(e,t){var n;void 0===t&&(t={});const{x:a,y:r,platform:i,rects:o,elements:l,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:d="viewport",elementContext:c="floating",altBoundary:m=!1,padding:p=0}=N(t,e),f=re(p),h=l[m?"floating"===c?"reference":"floating":c],v=ie(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:s,rootBoundary:d,strategy:u})),g="floating"===c?{x:a,y:r,width:o.floating.width,height:o.floating.height}:o.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),y=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},w=ie(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:b,strategy:u}):g);return{top:(v.top-w.top+f.top)/y.y,bottom:(w.bottom-v.bottom+f.bottom)/y.y,left:(v.left-w.left+f.left)/y.x,right:(w.right-v.right+f.right)/y.x}}function Mt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Et(e){return q.some(t=>e[t]>=0)}function _t(e){const t=D(...e.map(e=>e.left)),n=D(...e.map(e=>e.top));return{x:t,y:n,width:R(...e.map(e=>e.right))-t,height:R(...e.map(e=>e.bottom))-n}}const kt=new Set(["left","top"]);function Ct(e){const t=x(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=c(e),i=r?e.offsetWidth:n,o=r?e.offsetHeight:a,l=j(n)!==i||j(a)!==o;return l&&(n=i,a=o),{width:n,height:a,$:l}}function xt(e){return d(e)?e:e.contextElement}function Tt(e){const t=xt(e);if(!c(t))return A(1);const n=t.getBoundingClientRect(),{width:a,height:r,$:i}=Ct(t);let o=(i?j(n.width):n.width)/a,l=(i?j(n.height):n.height)/r;return o&&Number.isFinite(o)||(o=1),l&&Number.isFinite(l)||(l=1),{x:o,y:l}}const Ht=A(0);function Lt(e){const t=l(e);return _()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ht}function Vt(e,t,n,a){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=xt(e);let o=A(1);t&&(a?d(a)&&(o=Tt(a)):o=Tt(e));const u=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==l(e))&&t}(i,n,a)?Lt(i):A(0);let s=(r.left+u.x)/o.x,c=(r.top+u.y)/o.y,m=r.width/o.x,p=r.height/o.y;if(i){const e=l(i),t=a&&d(a)?l(a):a;let n=e,r=S(n);for(;r&&a&&t!==n;){const e=Tt(r),t=r.getBoundingClientRect(),a=x(r),i=t.left+(r.clientLeft+parseFloat(a.paddingLeft))*e.x,o=t.top+(r.clientTop+parseFloat(a.paddingTop))*e.y;s*=e.x,c*=e.y,m*=e.x,p*=e.y,s+=i,c+=o,n=l(r),r=S(n)}}return ie({width:m,height:p,x:s,y:c})}function St(e,t){const n=T(e).scrollLeft;return t?t.left+n:Vt(u(e)).left+n}function qt(e,t,n){void 0===n&&(n=!1);const a=e.getBoundingClientRect();return{x:a.left+t.scrollLeft-(n?0:St(e,a)),y:a.top+t.scrollTop}}const Pt=new Set(["absolute","fixed"]);function Ot(e,t,n){let a;if("viewport"===t)a=function(e,t){const n=l(e),a=u(e),r=n.visualViewport;let i=a.clientWidth,o=a.clientHeight,s=0,d=0;if(r){i=r.width,o=r.height;const e=_();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,d=r.offsetTop)}return{width:i,height:o,x:s,y:d}}(e,n);else if("document"===t)a=function(e){const t=u(e),n=T(e),a=e.ownerDocument.body,r=R(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),i=R(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let o=-n.scrollLeft+St(e);const l=-n.scrollTop;return"rtl"===x(a).direction&&(o+=R(t.clientWidth,a.clientWidth)-r),{width:r,height:i,x:o,y:l}}(u(e));else if(d(t))a=function(e,t){const n=Vt(e,!0,"fixed"===t),a=n.top+e.clientTop,r=n.left+e.clientLeft,i=c(e)?Tt(e):A(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:a*i.y}}(t,n);else{const n=Lt(e);a={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ie(a)}function Dt(e,t){const n=H(e);return!(n===t||!d(n)||C(n))&&("fixed"===x(n).position||Dt(n,t))}function Rt(e,t,n){const a=c(t),r=u(t),i="fixed"===n,l=Vt(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const d=A(0);function m(){d.x=St(r)}if(a||!a&&!i)if(("body"!==o(t)||f(r))&&(s=T(t)),a){const e=Vt(t,!0,i,t);d.x=e.x+t.clientLeft,d.y=e.y+t.clientTop}else r&&m();i&&!a&&r&&m();const p=!r||a||i?A(0):qt(r,s);return{x:l.left+s.scrollLeft-d.x-p.x,y:l.top+s.scrollTop-d.y-p.y,width:l.width,height:l.height}}function jt(e){return"static"===x(e).position}function It(e,t){if(!c(e)||"fixed"===x(e).position)return null;if(t)return t(e);let n=e.offsetParent;return u(e)===n&&(n=n.ownerDocument.body),n}function At(e,t){const n=l(e);if(b(e))return n;if(!c(e)){let t=H(e);for(;t&&!C(t);){if(d(t)&&!jt(t))return t;t=H(t)}return n}let a=It(e,t);for(;a&&v(a)&&jt(a);)a=It(a,t);return a&&C(a)&&jt(a)&&!E(a)?n:a||function(e){let t=H(e);for(;c(t)&&!C(t);){if(E(t))return t;if(b(t))return null;t=H(t)}return null}(e)||n}const Ft={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:a,strategy:r}=e;const i="fixed"===r,l=u(a),s=!!t&&b(t.floating);if(a===l||s&&i)return n;let d={scrollLeft:0,scrollTop:0},m=A(1);const p=A(0),h=c(a);if((h||!h&&!i)&&(("body"!==o(a)||f(l))&&(d=T(a)),c(a))){const e=Vt(a);m=Tt(a),p.x=e.x+a.clientLeft,p.y=e.y+a.clientTop}const v=!l||h||i?A(0):qt(l,d,!0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-d.scrollLeft*m.x+p.x+v.x,y:n.y*m.y-d.scrollTop*m.y+p.y+v.y}},getDocumentElement:u,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:a,strategy:r}=e;const i=[..."clippingAncestors"===n?b(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let a=V(e,[],!1).filter(e=>d(e)&&"body"!==o(e)),r=null;const i="fixed"===x(e).position;let l=i?H(e):e;for(;d(l)&&!C(l);){const t=x(l),n=E(l);n||"fixed"!==t.position||(r=null),(i?!n&&!r:!n&&"static"===t.position&&r&&Pt.has(r.position)||f(l)&&!n&&Dt(e,l))?a=a.filter(e=>e!==l):r=t,l=H(l)}return t.set(e,a),a}(t,this._c):[].concat(n),a],l=i[0],u=i.reduce((e,n)=>{const a=Ot(t,n,r);return e.top=R(a.top,e.top),e.right=D(a.right,e.right),e.bottom=D(a.bottom,e.bottom),e.left=R(a.left,e.left),e},Ot(t,l,r));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:At,getElementRects:async function(e){const t=this.getOffsetParent||At,n=this.getDimensions,a=await n(e.floating);return{reference:Rt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Ct(e);return{width:t,height:n}},getScale:Tt,isElement:d,isRTL:function(e){return"rtl"===x(e).direction}};function zt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Wt(e,t,n,a){void 0===a&&(a={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:o="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=a,d=xt(e),c=r||i?[...d?V(d):[],...V(t)]:[];c.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const m=d&&l?function(e,t){let n,a=null;const r=u(e);function i(){var e;clearTimeout(n),null==(e=a)||e.disconnect(),a=null}return function o(l,u){void 0===l&&(l=!1),void 0===u&&(u=1),i();const s=e.getBoundingClientRect(),{left:d,top:c,width:m,height:p}=s;if(l||t(),!m||!p)return;const f={rootMargin:-I(c)+"px "+-I(r.clientWidth-(d+m))+"px "+-I(r.clientHeight-(c+p))+"px "+-I(d)+"px",threshold:R(0,D(1,u))||1};let h=!0;function v(t){const a=t[0].intersectionRatio;if(a!==u){if(!h)return o();a?o(!1,a):n=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==a||zt(s,e.getBoundingClientRect())||o(),h=!1}try{a=new IntersectionObserver(v,{...f,root:r.ownerDocument})}catch(e){a=new IntersectionObserver(v,f)}a.observe(e)}(!0),i}(d,n):null;let p,f=-1,h=null;o&&(h=new ResizeObserver(e=>{let[a]=e;a&&a.target===d&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),d&&!s&&h.observe(d),h.observe(t));let v=s?Vt(e):null;return s&&function t(){const a=Vt(e);v&&!zt(v,a)&&n(),v=a,p=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==m||m(),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(p)}}const Nt=wt,Bt=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:r,y:i,placement:o,middlewareData:l}=t,u=await async function(e,t){const{placement:n,platform:a,elements:r}=e,i=await(null==a.isRTL?void 0:a.isRTL(r.floating)),o=B(n),l=$(n),u="y"===G(n),s=kt.has(o)?-1:1,d=i&&u?-1:1,c=N(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:f}="number"==typeof c?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return l&&"number"==typeof f&&(p="end"===l?-1*f:f),u?{x:p*d,y:m*s}:{x:m*s,y:p*d}}(t,e);return o===(null==(n=l.offset)?void 0:n.placement)&&null!=(a=l.arrow)&&a.alignmentOffset?{}:{x:r+u.x,y:i+u.y,data:{...u,placement:o}}}}},$t=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,a,r;const{rects:i,middlewareData:o,placement:l,platform:u,elements:s}=t,{crossAxis:d=!1,alignment:c,allowedPlacements:m=O,autoAlignment:p=!0,...f}=N(e,t),h=void 0!==c||m===O?function(e,t,n){return(e?[...n.filter(t=>$(t)===e),...n.filter(t=>$(t)!==e)]:n.filter(e=>B(e)===e)).filter(n=>!e||$(n)===e||!!t&&J(n)!==n)}(c||null,p,m):m,v=await wt(t,f),g=(null==(n=o.autoPlacement)?void 0:n.index)||0,b=h[g];if(null==b)return{};const y=Q(b,i,await(null==u.isRTL?void 0:u.isRTL(s.floating)));if(l!==b)return{reset:{placement:h[0]}};const w=[v[B(b)],v[y[0]],v[y[1]]],M=[...(null==(a=o.autoPlacement)?void 0:a.overflows)||[],{placement:b,overflows:w}],E=h[g+1];if(E)return{data:{index:g+1,overflows:M},reset:{placement:E}};const _=M.map(e=>{const t=$(e.placement);return[e.placement,t&&d?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),k=(null==(r=_.filter(e=>e[2].slice(0,$(e[0])?2:3).every(e=>e<=0))[0])?void 0:r[0])||_[0][0];return k!==l?{data:{index:g+1,overflows:M},reset:{placement:k}}:{}}}},Ut=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:r}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=N(e,t),s={x:n,y:a},d=await wt(t,u),c=G(B(r)),m=U(c);let p=s[m],f=s[c];if(i){const e="y"===m?"bottom":"right";p=W(p+d["y"===m?"top":"left"],p,p-d[e])}if(o){const e="y"===c?"bottom":"right";f=W(f+d["y"===c?"top":"left"],f,f-d[e])}const h=l.fn({...t,[m]:p,[c]:f});return{...h,data:{x:h.x-n,y:h.y-a,enabled:{[m]:i,[c]:o}}}}}},Kt=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,a;const{placement:r,middlewareData:i,rects:o,initialPlacement:l,platform:u,elements:s}=t,{mainAxis:d=!0,crossAxis:c=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:h=!0,...v}=N(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=B(r),b=G(l),y=B(l)===l,w=await(null==u.isRTL?void 0:u.isRTL(s.floating)),M=m||(y||!h?[ae(l)]:function(e){const t=ae(e);return[J(e),t,J(t)]}(l)),E="none"!==f;!m&&E&&M.push(...function(e,t,n,a){const r=$(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?ee:Z:t?Z:ee;case"left":case"right":return t?te:ne;default:return[]}}(B(e),"start"===n,a);return r&&(i=i.map(e=>e+"-"+r),t&&(i=i.concat(i.map(J)))),i}(l,h,f,w));const _=[l,...M],k=await wt(t,v),C=[];let x=(null==(a=i.flip)?void 0:a.overflows)||[];if(d&&C.push(k[g]),c){const e=Q(r,o,w);C.push(k[e[0]],k[e[1]])}if(x=[...x,{placement:r,overflows:C}],!C.every(e=>e<=0)){var T,H;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=_[e];if(t&&("alignment"!==c||b===G(t)||x.every(e=>e.overflows[0]>0&&G(e.placement)===b)))return{data:{index:e,overflows:x},reset:{placement:t}};let n=null==(H=x.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:H.placement;if(!n)switch(p){case"bestFit":{var L;const e=null==(L=x.filter(e=>{if(E){const t=G(e.placement);return t===b||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:L[0];e&&(n=e);break}case"initialPlacement":n=l}if(r!==n)return{reset:{placement:n}}}return{}}}},Yt=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:r,rects:i,platform:o,elements:l}=t,{apply:u=()=>{},...s}=N(e,t),d=await wt(t,s),c=B(r),m=$(r),p="y"===G(r),{width:f,height:h}=i.floating;let v,g;"top"===c||"bottom"===c?(v=c,g=m===(await(null==o.isRTL?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(g=c,v="end"===m?"top":"bottom");const b=h-d.top-d.bottom,y=f-d.left-d.right,w=D(h-d[v],b),M=D(f-d[g],y),E=!t.middlewareData.shift;let _=w,k=M;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(k=y),null!=(a=t.middlewareData.shift)&&a.enabled.y&&(_=b),E&&!m){const e=R(d.left,0),t=R(d.right,0),n=R(d.top,0),a=R(d.bottom,0);p?k=f-2*(0!==e||0!==t?e+t:R(d.left,d.right)):_=h-2*(0!==n||0!==a?n+a:R(d.top,d.bottom))}await u({...t,availableWidth:k,availableHeight:_});const C=await o.getDimensions(l.floating);return f!==C.width||h!==C.height?{reset:{rects:!0}}:{}}}},Gt=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:a="referenceHidden",...r}=N(e,t);switch(a){case"referenceHidden":{const e=Mt(await wt(t,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Et(e)}}}case"escaped":{const e=Mt(await wt(t,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Et(e)}}}default:return{}}}}},Xt=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:r,rects:i,platform:o,elements:l,middlewareData:u}=t,{element:s,padding:d=0}=N(e,t)||{};if(null==s)return{};const c=re(d),m={x:n,y:a},p=X(r),f=K(p),h=await o.getDimensions(s),v="y"===p,g=v?"top":"left",b=v?"bottom":"right",y=v?"clientHeight":"clientWidth",w=i.reference[f]+i.reference[p]-m[p]-i.floating[f],M=m[p]-i.reference[p],E=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s));let _=E?E[y]:0;_&&await(null==o.isElement?void 0:o.isElement(E))||(_=l.floating[y]||i.floating[f]);const k=w/2-M/2,C=_/2-h[f]/2-1,x=D(c[g],C),T=D(c[b],C),H=x,L=_-h[f]-T,V=_/2-h[f]/2+k,S=W(H,V,L),q=!u.arrow&&null!=$(r)&&V!==S&&i.reference[f]/2-(V<H?x:T)-h[f]/2<0,P=q?V<H?V-H:V-L:0;return{[p]:m[p]+P,data:{[p]:S,centerOffset:V-S-P,...q&&{alignmentOffset:P}},reset:q}}}),Qt=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:a,rects:r,platform:i,strategy:o}=t,{padding:l=2,x:u,y:s}=N(e,t),d=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(a.reference))||[]),c=function(e){const t=e.slice().sort((e,t)=>e.y-t.y),n=[];let a=null;for(let e=0;e<t.length;e++){const r=t[e];!a||r.y-a.y>a.height/2?n.push([r]):n[n.length-1].push(r),a=r}return n.map(e=>ie(_t(e)))}(d),m=ie(_t(d)),p=re(l),f=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===c.length&&c[0].left>c[1].right&&null!=u&&null!=s)return c.find(e=>u>e.left-p.left&&u<e.right+p.right&&s>e.top-p.top&&s<e.bottom+p.bottom)||m;if(c.length>=2){if("y"===G(n)){const e=c[0],t=c[c.length-1],a="top"===B(n),r=e.top,i=t.bottom,o=a?e.left:t.left,l=a?e.right:t.right;return{top:r,bottom:i,left:o,right:l,width:l-o,height:i-r,x:o,y:r}}const e="left"===B(n),t=R(...c.map(e=>e.right)),a=D(...c.map(e=>e.left)),r=c.filter(n=>e?n.left===a:n.right===t),i=r[0].top,o=r[r.length-1].bottom;return{top:i,bottom:o,left:a,right:t,width:t-a,height:o-i,x:a,y:i}}return m}},floating:a.floating,strategy:o});return r.reference.x!==f.reference.x||r.reference.y!==f.reference.y||r.reference.width!==f.reference.width||r.reference.height!==f.reference.height?{reset:{rects:f}}:{}}}},Jt=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:r,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:u=!0,crossAxis:s=!0}=N(e,t),d={x:n,y:a},c=G(r),m=U(c);let p=d[m],f=d[c];const h=N(l,t),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){const e="y"===m?"height":"width",t=i.reference[m]-i.floating[e]+v.mainAxis,n=i.reference[m]+i.reference[e]-v.mainAxis;p<t?p=t:p>n&&(p=n)}if(s){var g,b;const e="y"===m?"width":"height",t=kt.has(B(r)),n=i.reference[c]-i.floating[e]+(t&&(null==(g=o.offset)?void 0:g[c])||0)+(t?0:v.crossAxis),a=i.reference[c]+i.reference[e]+(t?0:(null==(b=o.offset)?void 0:b[c])||0)-(t?v.crossAxis:0);f<n?f=n:f>a&&(f=a)}return{[m]:p,[c]:f}}}},Zt=(e,t,n)=>{const a=new Map,r={platform:Ft,...n},i={...r.platform,_c:a};return(async(e,t,n)=>{const{placement:a="bottom",strategy:r="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),u=await(null==o.isRTL?void 0:o.isRTL(t));let s=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:c}=yt(s,a,u),m=a,p={},f=0;for(let n=0;n<l.length;n++){const{name:i,fn:h}=l[n],{x:v,y:g,data:b,reset:y}=await h({x:d,y:c,initialPlacement:a,placement:m,strategy:r,middlewareData:p,rects:s,platform:o,elements:{reference:e,floating:t}});d=null!=v?v:d,c=null!=g?g:c,p={...p,[i]:{...p[i],...b}},y&&f<=50&&(f++,"object"==typeof y&&(y.placement&&(m=y.placement),y.rects&&(s=!0===y.rects?await o.getElementRects({reference:e,floating:t,strategy:r}):y.rects),({x:d,y:c}=yt(s,m,u))),n=-1)}return{x:d,y:c,placement:m,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})};var en="undefined"!=typeof document?a.useLayoutEffect:function(){};function tn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,a,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(a=n;0!==a--;)if(!tn(e[a],t[a]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(a=n;0!==a--;)if(!{}.hasOwnProperty.call(t,r[a]))return!1;for(a=n;0!==a--;){const n=r[a];if(!("_owner"===n&&e.$$typeof||tn(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function nn(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function an(e,t){const n=nn(e);return Math.round(t*n)/n}function rn(e){const t=a.useRef(e);return en(()=>{t.current=e}),t}const on=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:a}="function"==typeof e?e(t):e;return n&&(r=n,{}.hasOwnProperty.call(r,"current"))?null!=n.current?Xt({element:n.current,padding:a}).fn(t):{}:n?Xt({element:n,padding:a}).fn(t):{};var r}}),ln=(e,t)=>({...Bt(e),options:[e,t]}),un=(e,t)=>({...Ut(e),options:[e,t]}),sn=(e,t)=>({...Jt(e),options:[e,t]}),dn=(e,t)=>({...Kt(e),options:[e,t]}),cn=(e,t)=>({...Yt(e),options:[e,t]}),mn=(e,t)=>({...$t(e),options:[e,t]}),pn=(e,t)=>({...Gt(e),options:[e,t]}),fn=(e,t)=>({...Qt(e),options:[e,t]}),hn=(e,t)=>({...on(e),options:[e,t]});function vn(e){const t=a.useRef(void 0),n=a.useCallback(t=>{const n=e.map(e=>{if(null!=e){if("function"==typeof e){const n=e,a=n(t);return"function"==typeof a?a:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>null==e?void 0:e())}},e);return a.useMemo(()=>e.every(e=>null==e)?null:e=>{t.current&&(t.current(),t.current=void 0),null!=e&&(t.current=n(e))},e)}function gn(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 bn=a.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function yn(e){const{children:t,elementsRef:n,labelsRef:r}=e,[i,o]=a.useState(()=>new Set),l=a.useCallback(e=>{o(t=>new Set(t).add(e))},[]),u=a.useCallback(e=>{o(t=>{const n=new Set(t);return n.delete(e),n})},[]),s=a.useMemo(()=>{const e=new Map;return Array.from(i.keys()).sort(gn).forEach((t,n)=>{e.set(t,n)}),e},[i]);return(0,gt.jsx)(bn.Provider,{value:a.useMemo(()=>({register:l,unregister:u,map:s,elementsRef:n,labelsRef:r}),[l,u,s,n,r]),children:t})}function wn(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:r,map:i,elementsRef:o,labelsRef:l}=a.useContext(bn),[u,s]=a.useState(null),d=a.useRef(null),c=a.useCallback(e=>{if(d.current=e,null!==u&&(o.current[u]=e,l)){var n;const a=void 0!==t;l.current[u]=a?t:null!=(n=null==e?void 0:e.textContent)?n:null}},[u,o,l,t]);return Xe(()=>{const e=d.current;if(e)return n(e),()=>{r(e)}},[n,r]),Xe(()=>{const e=d.current?i.get(d.current):null;null!=e&&s(e)},[i]),a.useMemo(()=>({ref:c,index:null==u?-1:u}),[u,c])}const Mn="data-floating-ui-focusable",En="active",_n="selected",kn="ArrowLeft",Cn="ArrowRight",xn="ArrowUp",Tn="ArrowDown";function Hn(e,t){return"function"==typeof e?e(t):e?a.cloneElement(e,t):(0,gt.jsx)("div",{...t})}const Ln=a.createContext({activeIndex:0,onNavigate:()=>{}}),Vn=[kn,Cn],Sn=[xn,Tn],qn=[...Vn,...Sn],Pn=a.forwardRef(function(e,t){const{render:n,orientation:r="both",loop:i=!0,rtl:o=!1,cols:l=1,disabledIndices:u,activeIndex:s,onNavigate:d,itemSizes:c,dense:m=!1,...p}=e,[f,h]=a.useState(0),v=null!=s?s:f,g=Ze(null!=d?d:h),b=a.useRef([]),y=n&&"function"!=typeof n?n.props:{},w=a.useMemo(()=>({activeIndex:v,onNavigate:g}),[v,g]),M=l>1,E={...p,...y,ref:t,"aria-orientation":"both"===r?void 0:r,onKeyDown(e){null==p.onKeyDown||p.onKeyDown(e),null==y.onKeyDown||y.onKeyDown(e),function(e){if(!qn.includes(e.key))return;let t=v;const n=nt(b,u),a=at(b,u),s=o?kn:Cn,d=o?Cn:kn;if(M){const d=c||Array.from({length:b.current.length},()=>({width:1,height:1})),p=ot(d,l,m),f=p.findIndex(e=>null!=e&&!st(b,e,u)),h=p.reduce((e,t,n)=>null==t||st(b,t,u)?e:n,-1),g=p[it({current:p.map(e=>e?b.current[e]:null)},{event:e,orientation:r,loop:i,rtl:o,cols:l,disabledIndices:ut([...("function"!=typeof u?u:null)||b.current.map((e,t)=>st(b,t,u)?t:void 0),void 0],p),minIndex:f,maxIndex:h,prevIndex:lt(v>a?n:v,d,p,l,e.key===Tn?"bl":e.key===s?"tr":"tl")})];null!=g&&(t=g)}const p={horizontal:[s],vertical:[Tn],both:[s,Tn]}[r],f={horizontal:[d],vertical:[xn],both:[d,xn]}[r],h=M?qn:{horizontal:Vn,vertical:Sn,both:qn}[r];var y;t===v&&[...p,...f].includes(e.key)&&(t=i&&t===a&&p.includes(e.key)?n:i&&t===n&&f.includes(e.key)?a:rt(b,{startingIndex:t,decrement:f.includes(e.key),disabledIndices:u})),t===v||tt(b,t)||(e.stopPropagation(),h.includes(e.key)&&e.preventDefault(),g(t),null==(y=b.current[t])||y.focus())}(e)}};return(0,gt.jsx)(Ln.Provider,{value:w,children:(0,gt.jsx)(yn,{elementsRef:b,children:Hn(n,E)})})}),On=a.forwardRef(function(e,t){const{render:n,...r}=e,i=n&&"function"!=typeof n?n.props:{},{activeIndex:o,onNavigate:l}=a.useContext(Ln),{ref:u,index:s}=wn(),d=vn([u,t,i.ref]),c=o===s;return Hn(n,{...r,...i,ref:d,tabIndex:c?0:-1,"data-active":c?"":void 0,onFocus(e){null==r.onFocus||r.onFocus(e),null==i.onFocus||i.onFocus(e),l(s)}})}),Dn={...a};let Rn=!1,jn=0;const In=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+jn++,An=Dn.useId||function(){const[e,t]=a.useState(()=>Rn?In():void 0);return Xe(()=>{null==e&&t(In())},[]),a.useEffect(()=>{Rn=!0},[]),e},Fn=a.forwardRef(function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:i,shift:o}},width:l=14,height:u=7,tipRadius:s=0,strokeWidth:d=0,staticOffset:c,stroke:m,d:p,style:{transform:f,...h}={},...v}=e,g=An(),[b,y]=a.useState(!1);if(Xe(()=>{r&&"rtl"===x(r).direction&&y(!0)},[r]),!r)return null;const[w,M]=n.split("-"),E="top"===w||"bottom"===w;let _=c;(E&&null!=o&&o.x||!E&&null!=o&&o.y)&&(_=null);const k=2*d,C=k/2,T=l/2*(s/-8+1),H=u/2*s/4,L=!!p,V=_&&"end"===M?"bottom":"top";let S=_&&"end"===M?"right":"left";_&&b&&(S="end"===M?"left":"right");const q=null!=(null==i?void 0:i.x)?_||i.x:"",P=null!=(null==i?void 0:i.y)?_||i.y:"",O=p||"M0,0 H"+l+" L"+(l-T)+","+(u-H)+" Q"+l/2+","+u+" "+T+","+(u-H)+" Z",D={top:L?"rotate(180deg)":"",left:L?"rotate(90deg)":"rotate(-90deg)",bottom:L?"":"rotate(180deg)",right:L?"rotate(-90deg)":"rotate(90deg)"}[w];return(0,gt.jsxs)("svg",{...v,"aria-hidden":!0,ref:t,width:L?l:l+k,height:l,viewBox:"0 0 "+l+" "+(u>l?u:l),style:{position:"absolute",pointerEvents:"none",[S]:q,[V]:P,[w]:E||L?"100%":"calc(100% - "+k/2+"px)",transform:[D,f].filter(e=>!!e).join(" "),...h},children:[k>0&&(0,gt.jsx)("path",{clipPath:"url(#"+g+")",fill:"none",stroke:m,strokeWidth:k+(p?0:1),d:O}),(0,gt.jsx)("path",{stroke:k&&!p?v.fill:"none",d:O}),(0,gt.jsx)("clipPath",{id:g,children:(0,gt.jsx)("rect",{x:-C,y:C*(L?-1:1),width:l+k,height:l})})]})});function zn(){const e=new Map;return{emit(t,n){var a;null==(a=e.get(t))||a.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var a;null==(a=e.get(t))||a.delete(n)}}}const Wn=a.createContext(null),Nn=a.createContext(null),Bn=()=>{var e;return(null==(e=a.useContext(Wn))?void 0:e.id)||null},$n=()=>a.useContext(Nn);function Un(e){const t=An(),n=$n(),a=Bn(),r=e||a;return Xe(()=>{if(!t)return;const e={id:t,parentId:r};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}},[n,t,r]),t}function Kn(e){const{children:t,id:n}=e,r=Bn();return(0,gt.jsx)(Wn.Provider,{value:a.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Yn(e){const{children:t}=e,n=a.useRef([]),r=a.useCallback(e=>{n.current=[...n.current,e]},[]),i=a.useCallback(e=>{n.current=n.current.filter(t=>t!==e)},[]),[o]=a.useState(()=>zn());return(0,gt.jsx)(Nn.Provider,{value:a.useMemo(()=>({nodesRef:n,addNode:r,removeNode:i,events:o}),[r,i,o]),children:t})}function Gn(e){return"data-floating-ui-"+e}function Xn(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const Qn=Gn("safe-polygon");function Jn(e,t,n){if(n&&!Ge(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){const n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function Zn(e){return"function"==typeof e?e():e}function ea(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:i,events:o,elements:l}=e,{enabled:u=!0,delay:s=0,handleClose:c=null,mouseOnly:m=!1,restMs:p=0,move:f=!0}=t,h=$n(),v=Bn(),g=Qe(c),b=Qe(s),y=Qe(n),w=Qe(p),M=a.useRef(),E=a.useRef(-1),_=a.useRef(),k=a.useRef(-1),C=a.useRef(!0),x=a.useRef(!1),T=a.useRef(()=>{}),H=a.useRef(!1),L=Ze(()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});a.useEffect(()=>{if(u)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{open:t}=e;t||(Xn(E),Xn(k),C.current=!0,H.current=!1)}},[u,o]),a.useEffect(()=>{if(!u)return;if(!g.current)return;if(!n)return;function e(e){L()&&r(!1,e,"hover")}const t=Fe(l.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[l.floating,n,r,u,g,L]);const V=a.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const a=Jn(b.current,"close",M.current);a&&!_.current?(Xn(E),E.current=window.setTimeout(()=>r(!1,e,n),a)):t&&(Xn(E),r(!1,e,n))},[b,r]),S=Ze(()=>{T.current(),_.current=void 0}),q=Ze(()=>{if(x.current){const e=Fe(l.floating).body;e.style.pointerEvents="",e.removeAttribute(Qn),x.current=!1}}),P=Ze(()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type));a.useEffect(()=>{if(u&&d(l.domReference)){const r=l.domReference,i=l.floating;return n&&r.addEventListener("mouseleave",a),f&&r.addEventListener("mousemove",e,{once:!0}),r.addEventListener("mouseenter",e),r.addEventListener("mouseleave",t),i&&(i.addEventListener("mouseleave",a),i.addEventListener("mouseenter",o),i.addEventListener("mouseleave",s)),()=>{n&&r.removeEventListener("mouseleave",a),f&&r.removeEventListener("mousemove",e),r.removeEventListener("mouseenter",e),r.removeEventListener("mouseleave",t),i&&(i.removeEventListener("mouseleave",a),i.removeEventListener("mouseenter",o),i.removeEventListener("mouseleave",s))}}function e(e){if(Xn(E),C.current=!1,m&&!Ge(M.current)||Zn(w.current)>0&&!Jn(b.current,"open"))return;const t=Jn(b.current,"open",M.current);t?E.current=window.setTimeout(()=>{y.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function t(e){if(P())return void q();T.current();const t=Fe(l.floating);if(Xn(k),H.current=!1,g.current&&i.current.floatingContext){n||Xn(E),_.current=g.current({...i.current.floatingContext,tree:h,x:e.clientX,y:e.clientY,onClose(){q(),S(),P()||V(e,!0,"safe-polygon")}});const a=_.current;return t.addEventListener("mousemove",a),void(T.current=()=>{t.removeEventListener("mousemove",a)})}("touch"!==M.current||!je(l.floating,e.relatedTarget))&&V(e)}function a(e){P()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:h,x:e.clientX,y:e.clientY,onClose(){q(),S(),P()||V(e)}})(e))}function o(){Xn(E)}function s(e){P()||V(e,!1)}},[l,u,e,m,f,V,S,q,r,n,y,h,b,g,i,P,w]),Xe(()=>{var e;if(u&&n&&null!=(e=g.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&L()){x.current=!0;const e=l.floating;if(d(l.domReference)&&e){var t;const n=Fe(l.floating).body;n.setAttribute(Qn,"");const a=l.domReference,r=null==h||null==(t=h.nodesRef.current.find(e=>e.id===v))||null==(t=t.context)?void 0:t.elements.floating;return r&&(r.style.pointerEvents=""),n.style.pointerEvents="none",a.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",a.style.pointerEvents="",e.style.pointerEvents=""}}}},[u,n,v,l,h,g,L]),Xe(()=>{n||(M.current=void 0,H.current=!1,S(),q())},[n,S,q]),a.useEffect(()=>()=>{S(),Xn(E),Xn(k),q()},[u,l.domReference,S,q]);const O=a.useMemo(()=>{function e(e){M.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function a(){C.current||y.current||r(!0,t,"hover")}m&&!Ge(M.current)||n||0===Zn(w.current)||H.current&&e.movementX**2+e.movementY**2<2||(Xn(k),"touch"===M.current?a():(H.current=!0,k.current=window.setTimeout(a,Zn(w.current))))}}},[m,r,n,y,w]);return a.useMemo(()=>u?{reference:O}:{},[u,O])}const ta=()=>{},na=a.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:ta,setState:ta,isInstantPhase:!1}),aa=()=>a.useContext(na);function ra(e){const{children:t,delay:n,timeoutMs:r=0}=e,[i,o]=a.useReducer((e,t)=>({...e,...t}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),l=a.useRef(null),u=a.useCallback(e=>{o({currentId:e})},[]);return Xe(()=>{i.currentId?null===l.current?l.current=i.currentId:i.isInstantPhase||o({isInstantPhase:!0}):(i.isInstantPhase&&o({isInstantPhase:!1}),l.current=null)},[i.currentId,i.isInstantPhase]),(0,gt.jsx)(na.Provider,{value:a.useMemo(()=>({...i,setState:o,setCurrentId:u}),[i,u]),children:t})}function ia(e,t){void 0===t&&(t={});const{open:n,onOpenChange:a,floatingId:r}=e,{id:i,enabled:o=!0}=t,l=null!=i?i:r,u=aa(),{currentId:s,setCurrentId:d,initialDelay:c,setState:m,timeoutMs:p}=u;return Xe(()=>{o&&s&&(m({delay:{open:1,close:Jn(c,"close")}}),s!==l&&a(!1))},[o,l,a,m,s,c]),Xe(()=>{function e(){a(!1),m({delay:c,currentId:null})}if(o&&s&&!n&&s===l){if(p){const t=window.setTimeout(e,p);return()=>{clearTimeout(t)}}e()}},[o,n,m,s,l,a,c,p]),Xe(()=>{o&&d!==ta&&n&&d(l)},[o,n,d,l]),u}const oa=a.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeoutIdRef:{current:-1},currentIdRef:{current:null},currentContextRef:{current:null}});function la(e){const{children:t,delay:n,timeoutMs:r=0}=e,i=a.useRef(n),o=a.useRef(n),l=a.useRef(null),u=a.useRef(null),s=a.useRef(-1);return(0,gt.jsx)(oa.Provider,{value:a.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:o,currentIdRef:l,timeoutMs:r,currentContextRef:u,timeoutIdRef:s}),[r]),children:t})}function ua(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,floatingId:i}=e,{enabled:o=!0}=t,l=a.useContext(oa),{currentIdRef:u,delayRef:s,timeoutMs:d,initialDelayRef:c,currentContextRef:m,hasProvider:p,timeoutIdRef:f}=l,[h,v]=a.useState(!1);return Xe(()=>{function e(){var e;v(!1),null==(e=m.current)||e.setIsInstantPhase(!1),u.current=null,m.current=null,s.current=c.current}if(o&&u.current&&!n&&u.current===i){if(v(!1),d)return f.current=window.setTimeout(e,d),()=>{clearTimeout(f.current)};e()}},[o,n,i,u,s,d,c,m,f]),Xe(()=>{if(!o)return;if(!n)return;const e=m.current,t=u.current;m.current={onOpenChange:r,setIsInstantPhase:v},u.current=i,s.current={open:0,close:Jn(c.current,"close")},null!==t&&t!==i?(Xn(f),v(!0),null==e||e.setIsInstantPhase(!0),null==e||e.onOpenChange(!1)):(v(!1),null==e||e.setIsInstantPhase(!1))},[o,n,i,r,u,s,d,c,m,f]),Xe(()=>()=>{m.current=null},[m]),a.useMemo(()=>({hasProvider:p,delayRef:s,isInstantPhase:h}),[p,s,h])}let sa=0;function da(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:a=!0,sync:r=!1}=t;a&&cancelAnimationFrame(sa);const i=()=>null==e?void 0:e.focus({preventScroll:n});r?i():sa=requestAnimationFrame(i)}function ca(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&m(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}const ma={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function pa(e){return"inert"===e?ma.inert:"aria-hidden"===e?ma["aria-hidden"]:ma.none}let fa=new WeakSet,ha={},va=0;const ga=()=>"undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,ba=e=>e&&(e.host||ba(e.parentNode)),ya=(e,t)=>t.map(t=>{if(e.contains(t))return t;const n=ba(t);return e.contains(n)?n:null}).filter(e=>null!=e);function wa(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const a=(r=e[0],(null==r?void 0:r.ownerDocument)||document).body;var r;return function(e,t,n,a){const r="data-floating-ui-inert",i=a?"inert":n?"aria-hidden":null,l=ya(t,e),u=new Set,s=new Set(l),d=[];ha[r]||(ha[r]=new WeakMap);const c=ha[r];return l.forEach(function e(t){t&&!u.has(t)&&(u.add(t),t.parentNode&&e(t.parentNode))}),function e(t){t&&!s.has(t)&&[].forEach.call(t.children,t=>{if("script"!==o(t))if(u.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,a=pa(i),o=(a.get(t)||0)+1,l=(c.get(t)||0)+1;a.set(t,o),c.set(t,l),d.push(t),1===o&&n&&fa.add(t),1===l&&t.setAttribute(r,""),!n&&i&&t.setAttribute(i,"inert"===i?"":"true")}})}(t),u.clear(),va++,()=>{d.forEach(e=>{const t=pa(i),n=(t.get(e)||0)-1,a=(c.get(e)||0)-1;t.set(e,n),c.set(e,a),n||(!fa.has(e)&&i&&e.removeAttribute(i),fa.delete(e)),a||e.removeAttribute(r)}),va--,va||(ma.inert=new WeakMap,ma["aria-hidden"]=new WeakMap,ma.none=new WeakMap,fa=new WeakSet,ha={})}}(e.concat(Array.from(a.querySelectorAll('[aria-live],[role="status"],output'))),a,t,n)}const Ma={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},Ea=a.forwardRef(function(e,t){const[n,r]=a.useState();Xe(()=>{Te()&&r("button")},[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Gn("focus-guard")]:"",style:Ma};return(0,gt.jsx)("span",{...e,...i})}),_a=a.createContext(null),ka=Gn("portal");function Ca(e){void 0===e&&(e={});const{id:t,root:n}=e,r=An(),i=Ta(),[o,l]=a.useState(null),u=a.useRef(null);return Xe(()=>()=>{null==o||o.remove(),queueMicrotask(()=>{u.current=null})},[o]),Xe(()=>{if(!r)return;if(u.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(ka,""),e.appendChild(n),u.current=n,l(n)},[t,r]),Xe(()=>{if(null===n)return;if(!r)return;if(u.current)return;let e=n||(null==i?void 0:i.portalNode);e&&!d(e)&&(e=e.current),e=e||document.body;let a=null;t&&(a=document.createElement("div"),a.id=t,e.appendChild(a));const o=document.createElement("div");o.id=r,o.setAttribute(ka,""),e=a||e,e.appendChild(o),u.current=o,l(o)},[t,n,r,i]),o}function xa(e){const{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,o=Ca({id:n,root:r}),[l,u]=a.useState(null),s=a.useRef(null),d=a.useRef(null),c=a.useRef(null),m=a.useRef(null),p=null==l?void 0:l.modal,f=null==l?void 0:l.open,h=!!l&&!l.modal&&l.open&&i&&!(!r&&!o);return a.useEffect(()=>{if(o&&i&&!p)return o.addEventListener("focusin",e,!0),o.addEventListener("focusout",e,!0),()=>{o.removeEventListener("focusin",e,!0),o.removeEventListener("focusout",e,!0)};function e(e){o&&ft(e)&&("focusin"===e.type?vt:ht)(o)}},[o,i,p]),a.useEffect(()=>{o&&(f||vt(o))},[f,o]),(0,gt.jsxs)(_a.Provider,{value:a.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:d,beforeInsideRef:c,afterInsideRef:m,portalNode:o,setFocusManagerState:u}),[i,o]),children:[h&&o&&(0,gt.jsx)(Ea,{"data-type":"outside",ref:s,onFocus:e=>{if(ft(e,o)){var t;null==(t=c.current)||t.focus()}else{const e=pt(l?l.domReference:null);null==e||e.focus()}}}),h&&o&&(0,gt.jsx)("span",{"aria-owns":o.id,style:Ma}),o&&bt.createPortal(t,o),h&&o&&(0,gt.jsx)(Ea,{"data-type":"outside",ref:d,onFocus:e=>{if(ft(e,o)){var t;null==(t=m.current)||t.focus()}else{const t=mt(l?l.domReference:null);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const Ta=()=>a.useContext(_a);function Ha(e){return a.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}const La=20;let Va=[];function Sa(){return Va.slice().reverse().find(e=>e.isConnected)}function qa(e,t){var n;if(!(t.current.includes("floating")||null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;const a=dt(),r=_e(e,a).filter(e=>{const t=e.getAttribute("data-tabindex")||"";return ke(e,a)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||0===r.length?"0"!==i&&e.setAttribute("tabindex","0"):("-1"!==i||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const Pa=a.forwardRef(function(e,t){return(0,gt.jsx)("button",{...e,type:"button",ref:t,tabIndex:-1,style:Ma})});function Oa(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:l=!0,initialFocus:u=0,returnFocus:s=!0,restoreFocus:d=!1,modal:m=!0,visuallyHiddenDismiss:p=!1,closeOnFocusOut:f=!0,outsideElementsInert:h=!1,getInsideElements:v=()=>[]}=e,{open:g,onOpenChange:b,events:y,dataRef:w,elements:{domReference:M,floating:E}}=t,_=Ze(()=>{var e;return null==(e=w.current.floatingContext)?void 0:e.nodeId}),k=Ze(v),C="number"==typeof u&&u<0,x=We(M)&&C,T=ga(),H=!T||l,L=!H||T&&h,V=Qe(i),S=Qe(u),q=Qe(s),P=$n(),O=Ta(),D=a.useRef(null),R=a.useRef(null),j=a.useRef(!1),I=a.useRef(!1),A=a.useRef(-1),F=null!=O,z=Ne(E),W=Ze(function(e){return void 0===e&&(e=z),e?Ee(e,dt()):[]}),N=Ze(e=>{const t=W(e);return V.current.map(e=>M&&"reference"===e?M:z&&"floating"===e?z:t).filter(Boolean).flat()});a.useEffect(()=>{if(r)return;if(!m)return;function e(e){if("Tab"===e.key){je(z,Re(Fe(z)))&&0===W().length&&!x&&Ue(e);const t=N(),n=Ie(e);"reference"===V.current[0]&&n===M&&(Ue(e),e.shiftKey?da(t[t.length-1]):da(t[1])),"floating"===V.current[1]&&n===z&&e.shiftKey&&(Ue(e),da(t[0]))}}const t=Fe(z);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,M,z,m,V,x,W,N]),a.useEffect(()=>{if(!r&&E)return E.addEventListener("focusin",e),()=>{E.removeEventListener("focusin",e)};function e(e){const t=Ie(e),n=W().indexOf(t);-1!==n&&(A.current=n)}},[r,E,W]),a.useEffect(()=>{if(!r&&f)return E&&c(M)?(M.addEventListener("focusout",t),M.addEventListener("pointerdown",e),E.addEventListener("focusout",t),()=>{M.removeEventListener("focusout",t),M.removeEventListener("pointerdown",e),E.removeEventListener("focusout",t)}):void 0;function e(){I.current=!0,setTimeout(()=>{I.current=!1})}function t(e){const t=e.relatedTarget,n=e.currentTarget,a=Ie(e);queueMicrotask(()=>{const r=_(),i=!(je(M,t)||je(E,t)||je(t,E)||je(null==O?void 0:O.portalNode,t)||null!=t&&t.hasAttribute(Gn("focus-guard"))||P&&(Be(P.nodesRef.current,r).find(e=>{var n,a;return je(null==(n=e.context)?void 0:n.elements.floating,t)||je(null==(a=e.context)?void 0:a.elements.domReference,t)})||$e(P.nodesRef.current,r).find(e=>{var n,a,r;return[null==(n=e.context)?void 0:n.elements.floating,Ne(null==(a=e.context)?void 0:a.elements.floating)].includes(t)||(null==(r=e.context)?void 0:r.elements.domReference)===t})));if(n===M&&z&&qa(z,V),d&&n!==M&&(null==a||!a.isConnected)&&Re(Fe(z))===Fe(z).body){c(z)&&z.focus();const e=A.current,t=W(),n=t[e]||t[t.length-1]||z;c(n)&&n.focus()}w.current.insideReactTree?w.current.insideReactTree=!1:!x&&m||!t||!i||I.current||t===Sa()||(j.current=!0,b(!1,e,"focus-out"))})}},[r,M,E,z,m,P,O,b,f,d,W,x,_,V,w]);const B=a.useRef(null),$=a.useRef(null),U=Ha([B,null==O?void 0:O.beforeInsideRef]),K=Ha([$,null==O?void 0:O.afterInsideRef]);function Y(e){return!r&&p&&m?(0,gt.jsx)(Pa,{ref:"start"===e?D:R,onClick:e=>b(!1,e.nativeEvent),children:"string"==typeof p?p:"Dismiss"}):null}a.useEffect(()=>{var e,t;if(r)return;if(!E)return;const n=Array.from((null==O||null==(e=O.portalNode)?void 0:e.querySelectorAll("["+Gn("portal")+"]"))||[]),a=P?$e(P.nodesRef.current,_()):[],i=P&&!m?a.map(e=>{var t;return null==(t=e.context)?void 0:t.elements.floating}):[],o=null==(t=a.find(e=>{var t;return We((null==(t=e.context)?void 0:t.elements.domReference)||null)}))||null==(t=t.context)?void 0:t.elements.domReference,l=[E,o,...n,...i,...k(),D.current,R.current,B.current,$.current,null==O?void 0:O.beforeOutsideRef.current,null==O?void 0:O.afterOutsideRef.current,V.current.includes("reference")||x?M:null].filter(e=>null!=e),u=m||x?wa(l,!L,L):wa(l);return()=>{u()}},[r,M,E,m,V,O,x,H,L,P,_,k]),Xe(()=>{if(r||!c(z))return;const e=Re(Fe(z));queueMicrotask(()=>{const t=N(z),n=S.current,a=("number"==typeof n?t[n]:n.current)||z,r=je(z,e);C||r||!g||da(a,{preventScroll:a===z})})},[r,g,z,C,N,S]),Xe(()=>{if(r||!z)return;const e=Fe(z);var t;function n(e){let{reason:t,event:n,nested:a}=e;if(["hover","safe-polygon"].includes(t)&&"mouseleave"===n.type&&(j.current=!0),"outside-press"===t)if(a)j.current=!1;else if(Ke(n)||Ye(n))j.current=!1;else{let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),j.current=!e}}t=Re(e),Va=Va.filter(e=>e.isConnected),t&&"body"!==o(t)&&(Va.push(t),Va.length>La&&(Va=Va.slice(-20))),y.on("openchange",n);const a=e.createElement("span");return a.setAttribute("tabindex","-1"),a.setAttribute("aria-hidden","true"),Object.assign(a.style,Ma),F&&M&&M.insertAdjacentElement("afterend",a),()=>{y.off("openchange",n);const t=Re(e),r=je(E,t)||P&&Be(P.nodesRef.current,_(),!1).some(e=>{var n;return je(null==(n=e.context)?void 0:n.elements.floating,t)}),i=function(){if("boolean"==typeof q.current){const e=M||Sa();return e&&e.isConnected?e:a}return q.current.current||a}();queueMicrotask(()=>{const n=function(e){const t=dt();return ke(e,t)?e:Ee(e,t)[0]||e}(i);q.current&&!j.current&&c(n)&&(n===t||t===e.body||r)&&n.focus({preventScroll:!0}),a.remove()})}},[r,E,z,q,w,y,P,F,M,_]),a.useEffect(()=>{queueMicrotask(()=>{j.current=!1})},[r]),Xe(()=>{if(!r&&O)return O.setFocusManagerState({modal:m,closeOnFocusOut:f,open:g,onOpenChange:b,domReference:M}),()=>{O.setFocusManagerState(null)}},[r,O,m,g,b,f,M]),Xe(()=>{r||z&&qa(z,V)},[r,z,V]);const G=!r&&H&&(!m||!x)&&(F||m);return(0,gt.jsxs)(gt.Fragment,{children:[G&&(0,gt.jsx)(Ea,{"data-type":"inside",ref:U,onFocus:e=>{if(m){const e=N();da("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=O&&O.preserveTabOrder&&O.portalNode)if(j.current=!1,ft(e,O.portalNode)){const e=mt(M);null==e||e.focus()}else{var t;null==(t=O.beforeOutsideRef.current)||t.focus()}}}),!x&&Y("start"),n,Y("end"),G&&(0,gt.jsx)(Ea,{"data-type":"inside",ref:K,onFocus:e=>{if(m)da(N()[0]);else if(null!=O&&O.preserveTabOrder&&O.portalNode)if(f&&(j.current=!0),ft(e,O.portalNode)){const e=pt(M);null==e||e.focus()}else{var t;null==(t=O.afterOutsideRef.current)||t.focus()}}})]})}let Da=0;const Ra="--floating-ui-scrollbar-width";let ja=()=>{};const Ia=a.forwardRef(function(e,t){const{lockScroll:n=!1,...a}=e;return Xe(()=>{if(n)return Da++,1===Da&&(ja=function(){const e=Ce(),t=/iP(hone|ad|od)|iOS/.test(e)||"MacIntel"===e&&navigator.maxTouchPoints>1,n=document.body.style,a=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,i=n.left?parseFloat(n.left):window.scrollX,o=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(Ra,r+"px"),r&&(n[a]=r+"px"),t){var l,u;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,t=(null==(u=window.visualViewport)?void 0:u.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(o-Math.floor(t))+"px",left:-(i-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[a]:""}),n.removeProperty(Ra),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(i,o))}}()),()=>{Da--,0===Da&&ja()}},[n]),(0,gt.jsx)("div",{ref:t,...a,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...a.style}})});function Aa(e){return c(e.target)&&"BUTTON"===e.target.tagName}function Fa(e){return ze(e)}function za(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:l=!0,event:u="click",toggle:s=!0,ignoreMouse:d=!1,keyboardHandlers:m=!0,stickIfOpen:p=!0}=t,f=a.useRef(),h=a.useRef(!1),v=a.useMemo(()=>({onPointerDown(e){f.current=e.pointerType},onMouseDown(e){const t=f.current;0===e.button&&"click"!==u&&(Ge(t,!0)&&d||(!n||!s||i.current.openEvent&&p&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=f.current;"mousedown"===u&&f.current?f.current=void 0:Ge(t,!0)&&d||(!n||!s||i.current.openEvent&&p&&"click"!==i.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){f.current=void 0,e.defaultPrevented||!m||Aa(e)||(" "!==e.key||Fa(o)||(e.preventDefault(),h.current=!0),function(e){return c(e.target)&&"A"===e.target.tagName}(e)||"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!m||Aa(e)||Fa(o)||" "===e.key&&h.current&&(h.current=!1,r(!n||!s,e.nativeEvent,"click"))}}),[i,o,u,d,m,r,n,p,s]);return a.useMemo(()=>l?{reference:v}:{},[l,v])}function Wa(e){return null!=e&&null!=e.clientX}function Na(e,t){void 0===t&&(t={});const{open:n,dataRef:r,elements:{floating:i,domReference:o},refs:u}=e,{enabled:s=!0,axis:d="both",x:c=null,y:m=null}=t,p=a.useRef(!1),f=a.useRef(null),[h,v]=a.useState(),[g,b]=a.useState([]),y=Ze((e,t)=>{p.current||r.current.openEvent&&!Wa(r.current.openEvent)||u.setPositionReference(function(e,t){let n=null,a=null,r=!1;return{contextElement:e||void 0,getBoundingClientRect(){var i;const o=(null==e?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,u="y"===t.axis||"both"===t.axis,s=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let d=o.width,c=o.height,m=o.x,p=o.y;return null==n&&t.x&&l&&(n=o.x-t.x),null==a&&t.y&&u&&(a=o.y-t.y),m-=n||0,p-=a||0,d=0,c=0,!r||s?(d="y"===t.axis?o.width:0,c="x"===t.axis?o.height:0,m=l&&null!=t.x?t.x:m,p=u&&null!=t.y?t.y:p):r&&!s&&(c="x"===t.axis?o.height:c,d="y"===t.axis?o.width:d),r=!0,{width:d,height:c,x:m,y:p,top:p,right:m+d,bottom:p+c,left:m}}}}(o,{x:e,y:t,axis:d,dataRef:r,pointerType:h}))}),w=Ze(e=>{null==c&&null==m&&(n?f.current||b([]):y(e.clientX,e.clientY))}),M=Ge(h)?i:n,E=a.useCallback(()=>{if(!M||!s||null!=c||null!=m)return;const e=l(i);function t(n){const a=Ie(n);je(i,a)?(e.removeEventListener("mousemove",t),f.current=null):y(n.clientX,n.clientY)}if(!r.current.openEvent||Wa(r.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),f.current=null};return f.current=n,n}u.setPositionReference(o)},[M,s,c,m,i,r,u,o,y]);a.useEffect(()=>E(),[E,g]),a.useEffect(()=>{s&&!i&&(p.current=!1)},[s,i]),a.useEffect(()=>{!s&&n&&(p.current=!0)},[s,n]),Xe(()=>{!s||null==c&&null==m||(p.current=!1,y(c,m))},[s,c,m,y]);const _=a.useMemo(()=>{function e(e){let{pointerType:t}=e;v(t)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:w,onMouseEnter:w}},[w]);return a.useMemo(()=>s?{reference:_}:{},[s,_])}const Ba={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},$a={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ua=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 Ka(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:o}=e,{enabled:l=!0,escapeKey:u=!0,outsidePress:s=!0,outsidePressEvent:m="pointerdown",referencePress:p=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:v,capture:g}=t,b=$n(),y=Ze("function"==typeof s?s:()=>!1),w="function"==typeof s?y:s,M=a.useRef(!1),{escapeKey:E,outsidePress:k}=Ua(v),{escapeKey:T,outsidePress:L}=Ua(g),S=a.useRef(!1),q=a.useRef(-1),P=Ze(e=>{var t;if(!n||!l||!u||"Escape"!==e.key)return;if(S.current)return;const a=null==(t=o.current.floatingContext)?void 0:t.nodeId,i=b?Be(b.nodesRef.current,a):[];if(!E&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)}),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")}),O=Ze(e=>{var t;const n=()=>{var t;P(e),null==(t=Ie(e))||t.removeEventListener("keydown",n)};null==(t=Ie(e))||t.addEventListener("keydown",n)}),D=Ze(e=>{var t;const n=o.current.insideReactTree;o.current.insideReactTree=!1;const a=M.current;if(M.current=!1,"click"===m&&a)return;if(n)return;if("function"==typeof w&&!w(e))return;const l=Ie(e),u="["+Gn("inert")+"]",s=Fe(i.floating).querySelectorAll(u);let p=d(l)?l:null;for(;p&&!C(p);){const e=H(p);if(C(e)||!d(e))break;p=e}if(s.length&&d(l)&&!l.matches("html,body")&&!je(l,i.floating)&&Array.from(s).every(e=>!je(p,e)))return;if(c(l)&&I){const t=C(l),n=x(l),a=/auto|scroll/,r=t||a.test(n.overflowX),i=t||a.test(n.overflowY),o=r&&l.clientWidth>0&&l.scrollWidth>l.clientWidth,u=i&&l.clientHeight>0&&l.scrollHeight>l.clientHeight,s="rtl"===n.direction,d=u&&(s?e.offsetX<=l.offsetWidth-l.clientWidth:e.offsetX>l.clientWidth),c=o&&e.offsetY>l.clientHeight;if(d||c)return}const f=null==(t=o.current.floatingContext)?void 0:t.nodeId,h=b&&Be(b.nodesRef.current,f).some(t=>{var n;return Ae(e,null==(n=t.context)?void 0:n.elements.floating)});if(Ae(e,i.floating)||Ae(e,i.domReference)||h)return;const v=b?Be(b.nodesRef.current,f):[];if(v.length>0){let e=!0;if(v.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}r(!1,e,"outside-press")}),R=Ze(e=>{var t;const n=()=>{var t;D(e),null==(t=Ie(e))||t.removeEventListener(m,n)};null==(t=Ie(e))||t.addEventListener(m,n)});a.useEffect(()=>{if(!n||!l)return;o.current.__escapeKeyBubbles=E,o.current.__outsidePressBubbles=k;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function a(){window.clearTimeout(e),S.current=!0}function s(){e=window.setTimeout(()=>{S.current=!1},_()?5:0)}const c=Fe(i.floating);u&&(c.addEventListener("keydown",T?O:P,T),c.addEventListener("compositionstart",a),c.addEventListener("compositionend",s)),w&&c.addEventListener(m,L?R:D,L);let p=[];return h&&(d(i.domReference)&&(p=V(i.domReference)),d(i.floating)&&(p=p.concat(V(i.floating))),!d(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(V(i.reference.contextElement)))),p=p.filter(e=>{var t;return e!==(null==(t=c.defaultView)?void 0:t.visualViewport)}),p.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{u&&(c.removeEventListener("keydown",T?O:P,T),c.removeEventListener("compositionstart",a),c.removeEventListener("compositionend",s)),w&&c.removeEventListener(m,L?R:D,L),p.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[o,i,u,w,m,n,r,h,l,E,k,P,T,O,D,L,R]),a.useEffect(()=>{o.current.insideReactTree=!1},[o,w,m]);const j=a.useMemo(()=>({onKeyDown:P,...p&&{[Ba[f]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==f&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}}),[P,r,p,f]),I=a.useMemo(()=>({onKeyDown:P,onMouseDown(){M.current=!0},onMouseUp(){M.current=!0},[$a[m]]:()=>{o.current.insideReactTree=!0},onBlurCapture(){b||(Xn(q),o.current.insideReactTree=!0,q.current=window.setTimeout(()=>{o.current.insideReactTree=!1}))}}),[P,m,o,b]);return a.useMemo(()=>l?{reference:j,floating:I}:{},[l,j,I])}function Ya(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=An(),o=a.useRef({}),[l]=a.useState(()=>zn()),u=null!=Bn(),[s,d]=a.useState(r.reference),c=Ze((e,t,a)=>{o.current.openEvent=e?t:void 0,l.emit("openchange",{open:e,event:t,reason:a,nested:u}),null==n||n(e,t,a)}),m=a.useMemo(()=>({setPositionReference:d}),[]),p=a.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return a.useMemo(()=>({dataRef:o,open:t,onOpenChange:c,elements:p,events:l,floatingId:i,refs:m}),[t,c,p,l,i,m])}function Ga(e){void 0===e&&(e={});const{nodeId:t}=e,n=Ya({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[o,l]=a.useState(null),[u,s]=a.useState(null),c=(null==i?void 0:i.domReference)||o,m=a.useRef(null),p=$n();Xe(()=>{c&&(m.current=c)},[c]);const f=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:u=!0,whileElementsMounted:s,open:d}=e,[c,m]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=a.useState(r);tn(p,r)||f(r);const[h,v]=a.useState(null),[g,b]=a.useState(null),y=a.useCallback(e=>{e!==_.current&&(_.current=e,v(e))},[]),w=a.useCallback(e=>{e!==k.current&&(k.current=e,b(e))},[]),M=o||h,E=l||g,_=a.useRef(null),k=a.useRef(null),C=a.useRef(c),x=null!=s,T=rn(s),H=rn(i),L=rn(d),V=a.useCallback(()=>{if(!_.current||!k.current)return;const e={placement:t,strategy:n,middleware:p};H.current&&(e.platform=H.current),Zt(_.current,k.current,e).then(e=>{const t={...e,isPositioned:!1!==L.current};S.current&&!tn(C.current,t)&&(C.current=t,bt.flushSync(()=>{m(t)}))})},[p,t,n,H,L]);en(()=>{!1===d&&C.current.isPositioned&&(C.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[d]);const S=a.useRef(!1);en(()=>(S.current=!0,()=>{S.current=!1}),[]),en(()=>{if(M&&(_.current=M),E&&(k.current=E),M&&E){if(T.current)return T.current(M,E,V);V()}},[M,E,V,T,x]);const q=a.useMemo(()=>({reference:_,floating:k,setReference:y,setFloating:w}),[y,w]),P=a.useMemo(()=>({reference:M,floating:E}),[M,E]),O=a.useMemo(()=>{const e={position:n,left:0,top:0};if(!P.floating)return e;const t=an(P.floating,c.x),a=an(P.floating,c.y);return u?{...e,transform:"translate("+t+"px, "+a+"px)",...nn(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:a}},[n,u,P.floating,c.x,c.y]);return a.useMemo(()=>({...c,update:V,refs:q,elements:P,floatingStyles:O}),[c,V,q,P,O])}({...e,elements:{...i,...u&&{reference:u}}}),h=a.useCallback(e=>{const t=d(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),f.refs.setReference(t)},[f.refs]),v=a.useCallback(e=>{(d(e)||null===e)&&(m.current=e,l(e)),(d(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!d(e))&&f.refs.setReference(e)},[f.refs]),g=a.useMemo(()=>({...f.refs,setReference:v,setPositionReference:h,domReference:m}),[f.refs,v,h]),b=a.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),y=a.useMemo(()=>({...f,...r,refs:g,elements:b,nodeId:t}),[f,g,b,t,r]);return Xe(()=>{r.dataRef.current.floatingContext=y;const e=null==p?void 0:p.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),a.useMemo(()=>({...f,context:y,refs:g,elements:b}),[f,g,b,y])}function Xa(){return Ce().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&Te()}function Qa(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:i,dataRef:o,elements:u}=e,{enabled:s=!0,visibleOnly:m=!0}=t,p=a.useRef(!1),f=a.useRef(-1),h=a.useRef(!0);a.useEffect(()=>{if(!s)return;const e=l(u.domReference);function t(){!n&&c(u.domReference)&&u.domReference===Re(Fe(u.domReference))&&(p.current=!0)}function a(){h.current=!0}function r(){h.current=!1}return e.addEventListener("blur",t),Xa()&&(e.addEventListener("keydown",a,!0),e.addEventListener("pointerdown",r,!0)),()=>{e.removeEventListener("blur",t),Xa()&&(e.removeEventListener("keydown",a,!0),e.removeEventListener("pointerdown",r,!0))}},[u.domReference,n,s]),a.useEffect(()=>{if(s)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(p.current=!0)}},[i,s]),a.useEffect(()=>()=>{Xn(f)},[]);const v=a.useMemo(()=>({onMouseLeave(){p.current=!1},onFocus(e){if(p.current)return;const t=Ie(e.nativeEvent);if(m&&d(t))if(Xa()&&!e.relatedTarget){if(!h.current&&!ze(t))return}else if(!function(e){if(!e||Le())return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(t))return;r(!0,e.nativeEvent,"focus")},onBlur(e){p.current=!1;const t=e.relatedTarget,n=e.nativeEvent,a=d(t)&&t.hasAttribute(Gn("focus-guard"))&&"outside"===t.getAttribute("data-type");f.current=window.setTimeout(()=>{var e;const i=Re(u.domReference?u.domReference.ownerDocument:document);(t||i!==u.domReference)&&(je(null==(e=o.current.floatingContext)?void 0:e.refs.floating.current,i)||je(u.domReference,i)||a||r(!1,n,"focus"))})}}),[o,u.domReference,r,m]);return a.useMemo(()=>s?{reference:v}:{},[s,v])}function Ja(e,t,n){const a=new Map,r="item"===n;let i=e;if(r&&e){const{[En]:t,[_n]:n,...a}=e;i=a}return{..."floating"===n&&{tabIndex:-1,[Mn]:""},...i,...t.map(t=>{const a=t?t[n]:null;return"function"==typeof a?e?a(e):null:a}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,i]=t;var o;r&&[En,_n].includes(n)||(0===n.indexOf("on")?(a.has(n)||a.set(n,[]),"function"==typeof i&&(null==(o=a.get(n))||o.push(i),e[n]=function(){for(var e,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return null==(e=a.get(n))?void 0:e.map(e=>e(...r)).find(e=>void 0!==e)})):e[n]=i)}),e):e,{})}}function Za(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),i=a.useCallback(t=>Ja(t,e,"reference"),t),o=a.useCallback(t=>Ja(t,e,"floating"),n),l=a.useCallback(t=>Ja(t,e,"item"),r);return a.useMemo(()=>({getReferenceProps:i,getFloatingProps:o,getItemProps:l}),[i,o,l])}const er="Escape";function tr(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function nr(e,t){return tr(t,e===xn||e===Tn,e===kn||e===Cn)}function ar(e,t,n){return tr(t,e===Tn,n?e===kn:e===Cn)||"Enter"===e||" "===e||""===e}function rr(e,t,n){return tr(t,n?e===kn:e===Cn,e===Tn)}function ir(e,t,n,a){return"both"===t||"horizontal"===t&&a&&a>1?e===er:tr(t,n?e===Cn:e===kn,e===xn)}function or(e,t){const{open:n,onOpenChange:r,elements:i,floatingId:o}=e,{listRef:l,activeIndex:u,onNavigate:s=()=>{},enabled:d=!0,selectedIndex:m=null,allowEscape:p=!1,loop:f=!1,nested:h=!1,rtl:v=!1,virtual:g=!1,focusItemOnOpen:b="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:w=!0,disabledIndices:M,orientation:E="vertical",parentOrientation:_,cols:k=1,scrollItemIntoView:C=!0,virtualItemRef:x,itemSizes:T,dense:H=!1}=t,L=Qe(Ne(i.floating)),V=Bn(),S=$n();Xe(()=>{e.dataRef.current.orientation=E},[e,E]);const q=Ze(()=>{s(-1===D.current?null:D.current)}),P=We(i.domReference),O=a.useRef(b),D=a.useRef(null!=m?m:-1),R=a.useRef(null),j=a.useRef(!0),I=a.useRef(q),A=a.useRef(!!i.floating),F=a.useRef(n),z=a.useRef(!1),W=a.useRef(!1),N=Qe(M),B=Qe(n),$=Qe(C),U=Qe(m),[K,Y]=a.useState(),[G,X]=a.useState(),Q=Ze(()=>{function e(e){var t;g?(null!=(t=e.id)&&t.endsWith("-fui-option")&&(e.id=o+"-"+Math.random().toString(16).slice(2,10)),Y(e.id),null==S||S.events.emit("virtualfocus",e),x&&(x.current=e)):da(e,{sync:z.current,preventScroll:!0})}const t=l.current[D.current],n=W.current;t&&e(t),(z.current?e=>e():requestAnimationFrame)(()=>{const a=l.current[D.current]||t;if(!a)return;t||e(a);const r=$.current;r&&Z&&(n||!j.current)&&(null==a.scrollIntoView||a.scrollIntoView("boolean"==typeof r?{block:"nearest",inline:"nearest"}:r))})});Xe(()=>{d&&(n&&i.floating?O.current&&null!=m&&(W.current=!0,D.current=m,q()):A.current&&(D.current=-1,I.current()))},[d,n,i.floating,m,q]),Xe(()=>{if(d&&n&&i.floating)if(null==u){if(z.current=!1,null!=U.current)return;if(A.current&&(D.current=-1,Q()),(!F.current||!A.current)&&O.current&&(null!=R.current||!0===O.current&&null==R.current)){let e=0;const t=()=>{null==l.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(D.current=null==R.current||ar(R.current,E,v)||h?nt(l,N.current):at(l,N.current),R.current=null,q())};t()}}else tt(l,u)||(D.current=u,Q(),W.current=!1)},[d,n,i.floating,u,U,h,l,E,v,q,Q,N]),Xe(()=>{var e;if(!d||i.floating||!S||g||!A.current)return;const t=S.nodesRef.current,n=null==(e=t.find(e=>e.id===V))||null==(e=e.context)?void 0:e.elements.floating,a=Re(Fe(i.floating)),r=t.some(e=>e.context&&je(e.context.elements.floating,a));n&&!r&&j.current&&n.focus({preventScroll:!0})},[d,i.floating,S,V,g]),Xe(()=>{if(d&&S&&g&&!V)return S.events.on("virtualfocus",e),()=>{S.events.off("virtualfocus",e)};function e(e){X(e.id),x&&(x.current=e)}},[d,S,g,V,x]),Xe(()=>{I.current=q,F.current=n,A.current=!!i.floating}),Xe(()=>{n||(R.current=null,O.current=b)},[n,b]);const J=null!=u,Z=a.useMemo(()=>{function e(e){if(!B.current)return;const t=l.current.indexOf(e);-1!==t&&D.current!==t&&(D.current=t,q())}return{onFocus(t){let{currentTarget:n}=t;z.current=!0,e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...y&&{onMouseMove(t){let{currentTarget:n}=t;z.current=!0,W.current=!1,e(n)},onPointerLeave(e){let{pointerType:t}=e;var n;j.current&&"touch"!==t&&(z.current=!0,D.current=-1,q(),g||null==(n=L.current)||n.focus({preventScroll:!0}))}}}},[B,L,y,l,q,g]),ee=a.useCallback(()=>{var e;return null!=_?_:null==S||null==(e=S.nodesRef.current.find(e=>e.id===V))||null==(e=e.context)||null==(e=e.dataRef)?void 0:e.current.orientation},[V,S,_]),te=Ze(e=>{if(j.current=!1,z.current=!0,229===e.which)return;if(!B.current&&e.currentTarget===L.current)return;if(h&&ir(e.key,E,v,k))return nr(e.key,ee())||Ue(e),r(!1,e.nativeEvent,"list-navigation"),void(c(i.domReference)&&(g?null==S||S.events.emit("virtualfocus",i.domReference):i.domReference.focus()));const t=D.current,a=nt(l,M),o=at(l,M);if(P||("Home"===e.key&&(Ue(e),D.current=a,q()),"End"===e.key&&(Ue(e),D.current=o,q())),k>1){const t=T||Array.from({length:l.current.length},()=>({width:1,height:1})),n=ot(t,k,H),r=n.findIndex(e=>null!=e&&!st(l,e,M)),i=n.reduce((e,t,n)=>null==t||st(l,t,M)?e:n,-1),u=n[it({current:n.map(e=>null!=e?l.current[e]:null)},{event:e,orientation:E,loop:f,rtl:v,cols:k,disabledIndices:ut([...("function"!=typeof M?M:null)||l.current.map((e,t)=>st(l,t,M)?t:void 0),void 0],n),minIndex:r,maxIndex:i,prevIndex:lt(D.current>o?a:D.current,t,n,k,e.key===Tn?"bl":e.key===(v?kn:Cn)?"tr":"tl"),stopEvent:!0})];if(null!=u&&(D.current=u,q()),"both"===E)return}if(nr(e.key,E)){if(Ue(e),n&&!g&&Re(e.currentTarget.ownerDocument)===e.currentTarget)return D.current=ar(e.key,E,v)?a:o,void q();ar(e.key,E,v)?D.current=f?t>=o?p&&t!==l.current.length?-1:a:rt(l,{startingIndex:t,disabledIndices:M}):Math.min(o,rt(l,{startingIndex:t,disabledIndices:M})):D.current=f?t<=a?p&&-1!==t?l.current.length:o:rt(l,{startingIndex:t,decrement:!0,disabledIndices:M}):Math.max(a,rt(l,{startingIndex:t,decrement:!0,disabledIndices:M})),tt(l,D.current)&&(D.current=-1),q()}}),ne=a.useMemo(()=>g&&n&&J&&{"aria-activedescendant":G||K},[g,n,J,G,K]),ae=a.useMemo(()=>({"aria-orientation":"both"===E?void 0:E,...P?{}:ne,onKeyDown:te,onPointerMove(){j.current=!0}}),[ne,te,E,P]),re=a.useMemo(()=>{function e(e){"auto"===b&&Ke(e.nativeEvent)&&(O.current=!0)}function t(e){O.current=b,"auto"===b&&Ye(e.nativeEvent)&&(O.current=!0)}return{...ne,onKeyDown(e){j.current=!1;const t=e.key.startsWith("Arrow"),a=["Home","End"].includes(e.key),i=t||a,o=rr(e.key,E,v),u=ir(e.key,E,v,k),s=rr(e.key,ee(),v),d=nr(e.key,E),c=(h?s:d)||"Enter"===e.key||""===e.key.trim();if(g&&n){const t=null==S?void 0:S.nodesRef.current.find(e=>null==e.parentId),n=S&&t?function(e,t){let n,a=-1;return function t(r,i){i>a&&(n=r,a=i),Be(e,r).forEach(e=>{t(e.id,i+1)})}(t,0),e.find(e=>e.id===n)}(S.nodesRef.current,t.id):null;if(i&&n&&x){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(o||u){var p,f;const a=(null==(p=n.context)?void 0:p.elements.domReference)===e.currentTarget,r=u&&!a?null==(f=n.context)?void 0:f.elements.domReference:o?l.current.find(e=>(null==e?void 0:e.id)===K):null;r&&(Ue(e),r.dispatchEvent(t),X(void 0))}var b;if((d||a)&&n.context&&n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference)return Ue(e),void(null==(b=n.context.elements.domReference)||b.dispatchEvent(t))}return te(e)}if(n||w||!t){if(c){const t=nr(e.key,ee());R.current=h&&t?null:e.key}h?s&&(Ue(e),n?(D.current=nt(l,N.current),q()):r(!0,e.nativeEvent,"list-navigation")):d&&(null!=m&&(D.current=m),Ue(e),!n&&w?r(!0,e.nativeEvent,"list-navigation"):te(e),n&&q())}},onFocus(){n&&!g&&(D.current=-1,q())},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[K,ne,k,te,N,b,l,h,q,r,n,w,E,ee,v,m,S,g,x]);return a.useMemo(()=>d?{reference:re,floating:ae,item:Z}:{},[d,re,ae,Z])}const lr=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function ur(e,t){var n,r;void 0===t&&(t={});const{open:i,elements:o,floatingId:l}=e,{enabled:u=!0,role:s="dialog"}=t,d=An(),c=(null==(n=o.domReference)?void 0:n.id)||d,m=a.useMemo(()=>{var e;return(null==(e=Ne(o.floating))?void 0:e.id)||l},[o.floating,l]),p=null!=(r=lr.get(s))?r:s,f=null!=Bn(),h=a.useMemo(()=>"tooltip"===p||"label"===s?{["aria-"+("label"===s?"labelledby":"describedby")]:i?m:void 0}:{"aria-expanded":i?"true":"false","aria-haspopup":"alertdialog"===p?"dialog":p,"aria-controls":i?m:void 0,..."listbox"===p&&{role:"combobox"},..."menu"===p&&{id:c},..."menu"===p&&f&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}},[p,m,f,i,c,s]),v=a.useMemo(()=>{const e={id:m,...p&&{role:p}};return"tooltip"===p||"label"===s?e:{...e,..."menu"===p&&{"aria-labelledby":c}}},[p,m,c,s]),g=a.useCallback(e=>{let{active:t,selected:n}=e;const a={role:"option",...t&&{id:m+"-fui-option"}};switch(s){case"select":return{...a,"aria-selected":t&&n};case"combobox":return{...a,"aria-selected":n}}return{}},[m,s]);return a.useMemo(()=>u?{reference:h,floating:v,item:g}:{},[u,h,v,g])}const sr=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function dr(e,t){return"function"==typeof e?e(t):e}function cr(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,o=("number"==typeof i?i:i.close)||0,[l,u]=a.useState("unmounted"),s=function(e,t){const[n,r]=a.useState(e);return e&&!n&&r(!0),a.useEffect(()=>{if(!e&&n){const e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(n,o);return s||"close"!==l||u("unmounted"),Xe(()=>{if(r){if(n){u("initial");const e=requestAnimationFrame(()=>{bt.flushSync(()=>{u("open")})});return()=>{cancelAnimationFrame(e)}}u("close")}},[n,r]),{isMounted:s,status:l}}function mr(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:i,common:o,duration:l=250}=t,u=e.placement,s=u.split("-")[0],d=a.useMemo(()=>({side:s,placement:u}),[s,u]),c="number"==typeof l,m=(c?l:l.open)||0,p=(c?l:l.close)||0,[f,h]=a.useState(()=>({...dr(o,d),...dr(n,d)})),{isMounted:v,status:g}=cr(e,{duration:l}),b=Qe(n),y=Qe(r),w=Qe(i),M=Qe(o);return Xe(()=>{const e=dr(b.current,d),t=dr(w.current,d),n=dr(M.current,d),a=dr(y.current,d)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===g&&h(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===g&&h({transitionProperty:Object.keys(a).map(sr).join(","),transitionDuration:m+"ms",...n,...a}),"close"===g){const a=t||e;h({transitionProperty:Object.keys(a).map(sr).join(","),transitionDuration:p+"ms",...n,...a})}},[p,w,b,y,M,m,g,d]),{isMounted:v,styles:f}}function pr(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:l,onMatch:u,onTypingChange:s,enabled:d=!0,findMatch:c=null,resetMs:m=750,ignoreKeys:p=[],selectedIndex:f=null}=t,h=a.useRef(-1),v=a.useRef(""),g=a.useRef(null!=(n=null!=f?f:l)?n:-1),b=a.useRef(null),y=Ze(u),w=Ze(s),M=Qe(c),E=Qe(p);Xe(()=>{r&&(Xn(h),b.current=null,v.current="")},[r]),Xe(()=>{var e;r&&""===v.current&&(g.current=null!=(e=null!=f?f:l)?e:-1)},[r,f,l]);const _=Ze(e=>{e?i.current.typing||(i.current.typing=e,w(e)):i.current.typing&&(i.current.typing=e,w(e))}),k=Ze(e=>{function t(e,t,n){const a=M.current?M.current(t,n):t.find(e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase())));return a?e.indexOf(a):-1}const n=o.current;if(v.current.length>0&&" "!==v.current[0]&&(-1===t(n,n,v.current)?_(!1):" "===e.key&&Ue(e)),null==n||E.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(Ue(e),_(!0)),n.every(e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())})&&v.current===e.key&&(v.current="",g.current=b.current),v.current+=e.key,Xn(h),h.current=window.setTimeout(()=>{v.current="",g.current=b.current,_(!1)},m);const a=g.current,i=t(n,[...n.slice((a||0)+1),...n.slice(0,(a||0)+1)],v.current);-1!==i?(y(i),b.current=i):" "!==e.key&&(v.current="",_(!1))}),C=a.useMemo(()=>({onKeyDown:k}),[k]),x=a.useMemo(()=>({onKeyDown:k,onKeyUp(e){" "===e.key&&_(!1)}}),[k,_]);return a.useMemo(()=>d?{reference:C,floating:x}:{},[d,C,x])}function fr(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const hr=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:a,onFallbackChange:r,offset:i=0,index:o=0,minItemsVisible:l=4,referenceOverflowThreshold:u=0,scrollRef:s,...d}=N(e,t),{rects:c,elements:{floating:m}}=t,p=n.current[o],f=(null==s?void 0:s.current)||m,h=m.clientTop||f.clientTop,v=0!==m.clientTop,g=0!==f.clientTop,b=m===f;if(!p)return{};const y={...t,...await ln(-p.offsetTop-m.clientTop-c.reference.height/2-p.offsetHeight/2-i).fn(t)},w=await Nt(fr(y,f.scrollHeight+h+m.clientTop),d),M=await Nt(y,{...d,elementContext:"reference"}),E=R(0,w.top),_=y.y+E,k=(f.scrollHeight>f.clientHeight?e=>e:j)(R(0,f.scrollHeight+(v&&b||g?2*h:0)-E-R(0,w.bottom)));if(f.style.maxHeight=k+"px",f.scrollTop=E,r){const e=f.offsetHeight<p.offsetHeight*D(l,n.current.length)-1||M.top>=-u||M.bottom>=-u;bt.flushSync(()=>r(e))}return a&&(a.current=await Nt(fr({...y,y:_},f.offsetHeight+h+m.clientTop),d)),{y:_}}});function vr(e,t){const{open:n,elements:r}=e,{enabled:i=!0,overflowRef:o,scrollRef:l,onChange:u}=t,s=Ze(u),d=a.useRef(!1),c=a.useRef(null),m=a.useRef(null);a.useEffect(()=>{if(!i)return;function e(e){if(e.ctrlKey||!t||null==o.current)return;const n=e.deltaY,a=o.current.top>=-.5,r=o.current.bottom>=-.5,i=t.scrollHeight-t.clientHeight,l=n<0?-1:1,u=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!a&&n>0||!r&&n<0?(e.preventDefault(),bt.flushSync(()=>{s(e=>e+Math[u](n,i*l))})):/firefox/i.test(xe())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||r.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame(()=>{c.current=t.scrollTop,null!=o.current&&(m.current={...o.current})}),()=>{c.current=null,m.current=null,t.removeEventListener("wheel",e)}):void 0},[i,n,r.floating,o,l,s]);const p=a.useMemo(()=>({onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const e=(null==l?void 0:l.current)||r.floating;if(o.current&&e&&d.current){if(null!==c.current){const t=e.scrollTop-c.current;(o.current.bottom<-.5&&t<-1||o.current.top<-.5&&t>1)&&bt.flushSync(()=>s(e=>e+t))}requestAnimationFrame(()=>{c.current=e.scrollTop})}}}),[r.floating,s,o,l]);return a.useMemo(()=>i?{floating:p}:{},[i,p])}function gr(e,t,n){return void 0===n&&(n=!0),e.filter(e=>{var a;return e.parentId===t&&(!n||(null==(a=e.context)?void 0:a.open))}).flatMap(t=>[t,...gr(e,t.id,n)])}function br(e,t){const[n,a]=e;let r=!1;const i=t.length;for(let e=0,o=i-1;e<i;o=e++){const[i,l]=t[e]||[0,0],[u,s]=t[o]||[0,0];l>=a!=s>=a&&n<=(u-i)*(a-l)/(s-l)+i&&(r=!r)}return r}function yr(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:a=!0}=e,r={current:-1};let i=!1,o=null,l=null,u=performance.now();const s=e=>{let{x:n,y:s,placement:c,elements:m,onClose:p,nodeId:f,tree:h}=e;return function(e){function v(){Xn(r),p()}if(Xn(r),!m.domReference||!m.floating||null==c||null==n||null==s)return;const{clientX:g,clientY:b}=e,y=[g,b],w=function(e){return"composedPath"in e?e.composedPath()[0]:e.target}(e),M="mouseleave"===e.type,E=ca(m.floating,w),_=ca(m.domReference,w),k=m.domReference.getBoundingClientRect(),C=m.floating.getBoundingClientRect(),x=c.split("-")[0],T=n>C.right-C.width/2,H=s>C.bottom-C.height/2,L=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,k),V=C.width>k.width,S=C.height>k.height,q=(V?k:C).left,P=(V?k:C).right,O=(S?k:C).top,D=(S?k:C).bottom;if(E&&(i=!0,!M))return;if(_&&(i=!1),_&&!M)return void(i=!0);if(M&&d(e.relatedTarget)&&ca(m.floating,e.relatedTarget))return;if(h&&gr(h.nodesRef.current,f).length)return;if("top"===x&&s>=k.bottom-1||"bottom"===x&&s<=k.top+1||"left"===x&&n>=k.right-1||"right"===x&&n<=k.left+1)return v();let R=[];switch(x){case"top":R=[[q,k.top+1],[q,C.bottom-1],[P,C.bottom-1],[P,k.top+1]];break;case"bottom":R=[[q,C.top+1],[q,k.bottom-1],[P,k.bottom-1],[P,C.top+1]];break;case"left":R=[[C.right-1,D],[C.right-1,O],[k.left+1,O],[k.left+1,D]];break;case"right":R=[[k.right-1,D],[k.right-1,O],[C.left+1,O],[C.left+1,D]]}if(!br([g,b],R)){if(i&&!L)return v();if(!M&&a){const t=function(e,t){const n=performance.now(),a=n-u;if(null===o||null===l||0===a)return o=e,l=t,u=n,null;const r=e-o,i=t-l,s=Math.sqrt(r*r+i*i);return o=e,l=t,u=n,s/a}(e.clientX,e.clientY);if(null!==t&&t<.1)return v()}br([g,b],function(e){let[n,a]=e;switch(x){case"top":return[[V?n+t/2:T?n+4*t:n-4*t,a+t+1],[V?n-t/2:T?n+4*t:n-4*t,a+t+1],[C.left,T||V?C.bottom-t:C.top],[C.right,T?V?C.bottom-t:C.top:C.bottom-t]];case"bottom":return[[V?n+t/2:T?n+4*t:n-4*t,a-t],[V?n-t/2:T?n+4*t:n-4*t,a-t],[C.left,T||V?C.top+t:C.bottom],[C.right,T?V?C.top+t:C.bottom:C.top+t]];case"left":{const e=[n+t+1,S?a+t/2:H?a+4*t:a-4*t],r=[n+t+1,S?a-t/2:H?a+4*t:a-4*t];return[[H||S?C.right-t:C.left,C.top],[H?S?C.right-t:C.left:C.right-t,C.bottom],e,r]}case"right":return[[n-t,S?a+t/2:H?a+4*t:a-4*t],[n-t,S?a-t/2:H?a+4*t:a-4*t],[H||S?C.left+t:C.right,C.top],[H?S?C.left+t:C.right:C.left+t,C.bottom]]}}([n,s]))?!i&&a&&(r.current=window.setTimeout(v,40)):v()}}};return s.__options={blockPointerEvents:n},s}},74801:(e,t,n)=>{"use strict";t.localeToNumber=function(e){const t=e.toString().replace(/[१२३४५६७८९०]/g,function(e){return r.number[e]});return Number(t)},t.localize=void 0,t.numberToLocale=i;var a=n(91151);const r={locale:{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},number:{"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"}};function i(e){return e.toString().replace(/\d/g,function(e){return r.locale[e]})}t.localize={ordinalNumber:(e,t)=>i(Number(e)),era:(0,a.buildLocalizeFn)({values:{narrow:["ईसा-पूर्व","ईस्वी"],abbreviated:["ईसा-पूर्व","ईस्वी"],wide:["ईसा-पूर्व","ईसवी सन"]},defaultWidth:"wide"}),quarter:(0,a.buildLocalizeFn)({values:{narrow:["1","2","3","4"],abbreviated:["ति1","ति2","ति3","ति4"],wide:["पहली तिमाही","दूसरी तिमाही","तीसरी तिमाही","चौथी तिमाही"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:(0,a.buildLocalizeFn)({values:{narrow:["ज","फ़","मा","अ","मई","जू","जु","अग","सि","अक्टू","न","दि"],abbreviated:["जन","फ़र","मार्च","अप्रैल","मई","जून","जुल","अग","सित","अक्टू","नव","दिस"],wide:["जनवरी","फ़रवरी","मार्च","अप्रैल","मई","जून","जुलाई","अगस्त","सितंबर","अक्टूबर","नवंबर","दिसंबर"]},defaultWidth:"wide"}),day:(0,a.buildLocalizeFn)({values:{narrow:["र","सो","मं","बु","गु","शु","श"],short:["र","सो","मं","बु","गु","शु","श"],abbreviated:["रवि","सोम","मंगल","बुध","गुरु","शुक्र","शनि"],wide:["रविवार","सोमवार","मंगलवार","बुधवार","गुरुवार","शुक्रवार","शनिवार"]},defaultWidth:"wide"}),dayPeriod:(0,a.buildLocalizeFn)({values:{narrow:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"},abbreviated:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"},wide:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"}},defaultWidth:"wide",formattingValues:{narrow:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"},abbreviated:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"},wide:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"}},defaultFormattingWidth:"wide"})}},75135:(e,t,n)=>{"use strict";t.lastDayOfDecade=function(e,t){const n=(0,a.toDate)(e,t?.in),r=n.getFullYear(),i=9+10*Math.floor(r/10);return n.setFullYear(i+1,0,0),n.setHours(0,0,0,0),(0,a.toDate)(n,t?.in)};var a=n(24429)},75219:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){var e=document.getElementsByTagName("html")[0];for(var t in n)r(e,n[t]);var i=document.body;for(var o in a)r(i,a[o]);n={},a={}},t.log=function(){};var n={},a={};function r(e,t){e.classList.remove(t)}t.add=function(e,t){return r=e.classList,i="html"==e.nodeName.toLowerCase()?n:a,void t.split(" ").forEach(function(e){!function(e,t){e[t]||(e[t]=0),e[t]+=1}(i,e),r.add(e)});var r,i},t.remove=function(e,t){return r=e.classList,i="html"==e.nodeName.toLowerCase()?n:a,void t.split(" ").forEach(function(e){!function(e,t){e[t]&&(e[t]-=1)}(i,e),0===i[e]&&r.remove(e)});var r,i}},75263:function(e,t,n){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RadioButton=void 0;const r=n(31085),i=a(n(88694)),o=n(77055),l=n(73693),u=i.default.label`
2899
2899
  font-size: 0.875rem;
2900
2900
  line-height: 1.25rem;
2901
2901
  margin-left: var(--spacing-1x);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equisoft/design-elements-react",
3
- "version": "9.8.3-snapshot.20250630124940",
3
+ "version": "9.8.3-snapshot.20250701133942",
4
4
  "description": "React implementation of the Equisoft design system.",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/bundle.js",