@radui/ui 0.3.0 → 0.4.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radui/ui",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "",
5
5
  "main": "dist",
6
6
  "type": "module",
@@ -62,16 +62,61 @@
62
62
  "require": "./dist/components/Card.cjs",
63
63
  "types": "./dist/components/Card.d.ts"
64
64
  },
65
+ "./Checkbox": {
66
+ "import": "./dist/components/Checkbox.js",
67
+ "require": "./dist/components/Checkbox.cjs",
68
+ "types": "./dist/components/Checkbox.d.ts"
69
+ },
70
+ "./CheckboxCards": {
71
+ "import": "./dist/components/CheckboxCards.js",
72
+ "require": "./dist/components/CheckboxCards.cjs",
73
+ "types": "./dist/components/CheckboxCards.d.ts"
74
+ },
75
+ "./CheckboxGroup": {
76
+ "import": "./dist/components/CheckboxGroup.js",
77
+ "require": "./dist/components/CheckboxGroup.cjs",
78
+ "types": "./dist/components/CheckboxGroup.d.ts"
79
+ },
65
80
  "./Code": {
66
81
  "import": "./dist/components/Code.js",
67
82
  "require": "./dist/components/Code.cjs",
68
83
  "types": "./dist/components/Code.d.ts"
69
84
  },
85
+ "./Collapsible": {
86
+ "import": "./dist/components/Collapsible.js",
87
+ "require": "./dist/components/Collapsible.cjs",
88
+ "types": "./dist/components/Collapsible.d.ts"
89
+ },
90
+ "./Combobox": {
91
+ "import": "./dist/components/Combobox.js",
92
+ "require": "./dist/components/Combobox.cjs",
93
+ "types": "./dist/components/Combobox.d.ts"
94
+ },
95
+ "./ContextMenu": {
96
+ "import": "./dist/components/ContextMenu.js",
97
+ "require": "./dist/components/ContextMenu.cjs",
98
+ "types": "./dist/components/ContextMenu.d.ts"
99
+ },
100
+ "./DataList": {
101
+ "import": "./dist/components/DataList.js",
102
+ "require": "./dist/components/DataList.cjs",
103
+ "types": "./dist/components/DataList.d.ts"
104
+ },
70
105
  "./Dialog": {
71
106
  "import": "./dist/components/Dialog.js",
72
107
  "require": "./dist/components/Dialog.cjs",
73
108
  "types": "./dist/components/Dialog.d.ts"
74
109
  },
110
+ "./Disclosure": {
111
+ "import": "./dist/components/Disclosure.js",
112
+ "require": "./dist/components/Disclosure.cjs",
113
+ "types": "./dist/components/Disclosure.d.ts"
114
+ },
115
+ "./DropdownMenu": {
116
+ "import": "./dist/components/DropdownMenu.js",
117
+ "require": "./dist/components/DropdownMenu.cjs",
118
+ "types": "./dist/components/DropdownMenu.d.ts"
119
+ },
75
120
  "./Em": {
76
121
  "import": "./dist/components/Em.js",
77
122
  "require": "./dist/components/Em.cjs",
@@ -82,6 +127,11 @@
82
127
  "require": "./dist/components/Heading.cjs",
83
128
  "types": "./dist/components/Heading.d.ts"
84
129
  },
130
+ "./HoverCard": {
131
+ "import": "./dist/components/HoverCard.js",
132
+ "require": "./dist/components/HoverCard.cjs",
133
+ "types": "./dist/components/HoverCard.d.ts"
134
+ },
85
135
  "./Kbd": {
86
136
  "import": "./dist/components/Kbd.js",
87
137
  "require": "./dist/components/Kbd.cjs",
@@ -92,21 +142,91 @@
92
142
  "require": "./dist/components/Link.cjs",
93
143
  "types": "./dist/components/Link.d.ts"
94
144
  },
145
+ "./Menubar": {
146
+ "import": "./dist/components/Menubar.js",
147
+ "require": "./dist/components/Menubar.cjs",
148
+ "types": "./dist/components/Menubar.d.ts"
149
+ },
150
+ "./Minimap": {
151
+ "import": "./dist/components/Minimap.js",
152
+ "require": "./dist/components/Minimap.cjs",
153
+ "types": "./dist/components/Minimap.d.ts"
154
+ },
155
+ "./NavigationMenu": {
156
+ "import": "./dist/components/NavigationMenu.js",
157
+ "require": "./dist/components/NavigationMenu.cjs",
158
+ "types": "./dist/components/NavigationMenu.d.ts"
159
+ },
160
+ "./NumberField": {
161
+ "import": "./dist/components/NumberField.js",
162
+ "require": "./dist/components/NumberField.cjs",
163
+ "types": "./dist/components/NumberField.d.ts"
164
+ },
95
165
  "./Progress": {
96
166
  "import": "./dist/components/Progress.js",
97
167
  "require": "./dist/components/Progress.cjs",
98
168
  "types": "./dist/components/Progress.d.ts"
99
169
  },
170
+ "./Quote": {
171
+ "import": "./dist/components/Quote.js",
172
+ "require": "./dist/components/Quote.cjs",
173
+ "types": "./dist/components/Quote.d.ts"
174
+ },
175
+ "./Radio": {
176
+ "import": "./dist/components/Radio.js",
177
+ "require": "./dist/components/Radio.cjs",
178
+ "types": "./dist/components/Radio.d.ts"
179
+ },
180
+ "./RadioCards": {
181
+ "import": "./dist/components/RadioCards.js",
182
+ "require": "./dist/components/RadioCards.cjs",
183
+ "types": "./dist/components/RadioCards.d.ts"
184
+ },
185
+ "./RadioGroup": {
186
+ "import": "./dist/components/RadioGroup.js",
187
+ "require": "./dist/components/RadioGroup.cjs",
188
+ "types": "./dist/components/RadioGroup.d.ts"
189
+ },
100
190
  "./ScrollArea": {
101
191
  "import": "./dist/components/ScrollArea.js",
102
192
  "require": "./dist/components/ScrollArea.cjs",
103
193
  "types": "./dist/components/ScrollArea.d.ts"
104
194
  },
195
+ "./Select": {
196
+ "import": "./dist/components/Select.js",
197
+ "require": "./dist/components/Select.cjs",
198
+ "types": "./dist/components/Select.d.ts"
199
+ },
105
200
  "./Separator": {
106
201
  "import": "./dist/components/Separator.js",
107
202
  "require": "./dist/components/Separator.cjs",
108
203
  "types": "./dist/components/Separator.d.ts"
109
204
  },
205
+ "./Skeleton": {
206
+ "import": "./dist/components/Skeleton.js",
207
+ "require": "./dist/components/Skeleton.cjs",
208
+ "types": "./dist/components/Skeleton.d.ts"
209
+ },
210
+ "./Slider": {
211
+ "import": "./dist/components/Slider.js",
212
+ "require": "./dist/components/Slider.cjs",
213
+ "types": "./dist/components/Slider.d.ts"
214
+ },
215
+ "./Spinner": {
216
+ "import": "./dist/components/Spinner.js",
217
+ "require": "./dist/components/Spinner.cjs",
218
+ "types": "./dist/components/Spinner.d.ts"
219
+ },
220
+ "./Splitter": {
221
+ "import": "./dist/components/Splitter.js",
222
+ "require": "./dist/components/Splitter.cjs",
223
+ "types": "./dist/components/Splitter.d.ts"
224
+ },
225
+ "./Steps": {
226
+ "import": "./dist/components/Steps.js",
227
+ "require": "./dist/components/Steps.cjs",
228
+ "types": "./dist/components/Steps.d.ts"
229
+ },
110
230
  "./Strong": {
111
231
  "import": "./dist/components/Strong.js",
112
232
  "require": "./dist/components/Strong.cjs",
@@ -117,6 +237,11 @@
117
237
  "require": "./dist/components/Switch.cjs",
118
238
  "types": "./dist/components/Switch.d.ts"
119
239
  },
240
+ "./TabNav": {
241
+ "import": "./dist/components/TabNav.js",
242
+ "require": "./dist/components/TabNav.cjs",
243
+ "types": "./dist/components/TabNav.d.ts"
244
+ },
120
245
  "./Table": {
121
246
  "import": "./dist/components/Table.js",
122
247
  "require": "./dist/components/Table.cjs",
@@ -132,6 +257,11 @@
132
257
  "require": "./dist/components/Text.cjs",
133
258
  "types": "./dist/components/Text.d.ts"
134
259
  },
260
+ "./TextArea": {
261
+ "import": "./dist/components/TextArea.js",
262
+ "require": "./dist/components/TextArea.cjs",
263
+ "types": "./dist/components/TextArea.d.ts"
264
+ },
135
265
  "./Theme": {
136
266
  "import": "./dist/components/Theme.js",
137
267
  "require": "./dist/components/Theme.cjs",
@@ -157,6 +287,11 @@
157
287
  "require": "./dist/components/Tooltip.cjs",
158
288
  "types": "./dist/components/Tooltip.d.ts"
159
289
  },
290
+ "./Tree": {
291
+ "import": "./dist/components/Tree.js",
292
+ "require": "./dist/components/Tree.cjs",
293
+ "types": "./dist/components/Tree.d.ts"
294
+ },
160
295
  "./VisuallyHidden": {
161
296
  "import": "./dist/components/VisuallyHidden.js",
162
297
  "require": "./dist/components/VisuallyHidden.cjs",
@@ -204,6 +339,7 @@
204
339
  "compile-components:esbuild": "node build-components.cjs",
205
340
  "check:types": "tsc --noEmit",
206
341
  "check:exports": "node scripts/generate-exports.cjs --check",
342
+ "validate:changesets": "node scripts/validate-changesets.mjs",
207
343
  "build-components:esbuild": "npm run compile-components:esbuild && npm run process-components",
208
344
  "build:esbuild": "npm run prebuild && npm run build:css && npm run build-components:esbuild",
209
345
  "release": "npm publish --access public",
@@ -249,13 +385,13 @@
249
385
  "@rollup/plugin-node-resolve": "16.0.3",
250
386
  "@rollup/plugin-terser": "1.0.0",
251
387
  "@rollup/plugin-typescript": "11.1.6",
252
- "@storybook/addon-a11y": "10.3.3",
253
- "@storybook/addon-links": "10.3.3",
254
- "@storybook/react-webpack5": "10.3.3",
388
+ "@storybook/addon-a11y": "10.3.4",
389
+ "@storybook/addon-links": "10.3.4",
390
+ "@storybook/react-webpack5": "10.3.4",
255
391
  "@storybook/testing-library": "0.2.2",
256
392
  "@testing-library/jest-dom": "6.6.3",
257
393
  "@testing-library/react": "16.0.0",
258
- "@types/jest": "^29.5.14",
394
+ "@types/jest": "^30.0.0",
259
395
  "@types/react": "^18.3.1",
260
396
  "autoprefixer": "10.4.15",
261
397
  "axe-core": "^4.10.3",
@@ -272,7 +408,7 @@
272
408
  "eslint-plugin-react": "^7.37.5",
273
409
  "eslint-plugin-react-hooks": "^5.2.0",
274
410
  "husky": "8.0.3",
275
- "jest": "29.7.0",
411
+ "jest": "30.3.0",
276
412
  "jest-environment-jsdom": "30.3.0",
277
413
  "lint-staged": "^16.1.2",
278
414
  "lucide-react": "^0.575.0",
@@ -286,18 +422,18 @@
286
422
  "rollup-plugin-postcss": "^4.0.2",
287
423
  "sass": "^1.77.2",
288
424
  "sass-loader": "16.0.4",
289
- "storybook": "10.3.3",
290
- "stylelint": "^16.12.0",
291
- "stylelint-config-standard": "^36.0.1",
292
- "stylelint-config-standard-scss": "^14.0.0",
425
+ "storybook": "10.3.4",
426
+ "stylelint": "^17.7.0",
427
+ "stylelint-config-standard": "^40.0.0",
428
+ "stylelint-config-standard-scss": "^17.0.0",
293
429
  "stylelint-config-tailwindcss": "^0.0.7",
294
430
  "tailwindcss": "3.4.1",
295
- "ts-jest": "29.4.0",
431
+ "ts-jest": "29.4.9",
296
432
  "ts-node": "^10.9.2",
297
433
  "tsx": "^4.21.0",
298
434
  "typescript": "5.8.3",
299
- "eslint-plugin-storybook": "10.3.3",
300
- "@storybook/addon-docs": "10.3.3"
435
+ "eslint-plugin-storybook": "10.3.4",
436
+ "@storybook/addon-docs": "10.3.4"
301
437
  },
302
438
  "dependencies": {
303
439
  "@floating-ui/react": "^0.27.16",
@@ -1 +0,0 @@
1
- 'use client';import{jsx as e}from"react/jsx-runtime";import t,{forwardRef as n,useState as s,useRef as i,useContext as o,useEffect as l}from"react";import{F as r}from"./index-W6-aam_B.js";import{u as a}from"./index-wRElCyvx.js";import{P as c}from"./index-98jQ1vTr.js";import{B as d}from"./index-BOy86lYu.js";const u=t.createContext(null),f=n((({children:n,className:o,open:l,onOpenChange:c,defaultOpen:d=!1,crossAxisOffset:f,mainAxisOffset:m,loop:p=!0,placement:g="bottom-start",avoidCollision:h=!0,rtl:x=!1,...v},N)=>{const[P,I]=a(l,d,c),[C,O]=s(null),b=i([]),R=i([]),y=i([]),F=i(null),M=r.useFloatingNodeId(),A=r.useFloatingParentNodeId(),k=null!=A,S=f??0,T=void 0!==m?m:k?2:4,{refs:j,floatingStyles:L,context:w}=r.useFloating({open:P,nodeId:M,onOpenChange:I,strategy:"fixed",placement:k?"right-start":g,middleware:[r.offset({mainAxis:T,crossAxis:S}),r.flip({mainAxis:h,crossAxis:h}),r.shift({padding:4})],whileElementsMounted:r.autoUpdate}),E=r.useListNavigation(w,{listRef:R,activeIndex:C,nested:k,rtl:x,loop:p,onNavigate:O}),D=r.useClick(w,{}),q=r.useHover(w,{enabled:k,delay:{open:75},handleClose:r.safePolygon({blockPointerEvents:!0})}),B=r.useDismiss(w,{bubbles:!0}),H=r.useTypeahead(w,{listRef:y,onMatch:P?O:void 0,activeIndex:C}),{getReferenceProps:U,getFloatingProps:z,getItemProps:G}=r.useInteractions([B,D,E,q,H]),J={isOpen:P,setIsOpen:I,refs:j,floatingStyles:L,getReferenceProps:U,getFloatingProps:z,getItemProps:G,activeIndex:C,setActiveIndex:O,listRef:b,elementsRef:R,labelsRef:y,virtualItemRef:F,nodeId:M,isNested:k,floatingContext:w,rtl:x},K=r.useFloatingTree();return t.useEffect((()=>{if(K)return K.events.on("click",e),()=>{K.events.off("click",e)};function e(){I(!1)}}),[K,M,A]),e("div",{ref:N,className:o,"data-tree":"true",...v,children:e(u.Provider,{value:J,children:e(r.FloatingNode,{id:M,children:n})})})}));f.displayName="MenuComponentRoot";const m=n((({children:t,className:n,open:s,onOpenChange:i,defaultOpen:o=!1,crossAxisOffset:l,mainAxisOffset:a,...c},d)=>e(r.FloatingTree,{children:e(f,{ref:d,className:n,open:s,onOpenChange:i,defaultOpen:o,crossAxisOffset:l,mainAxisOffset:a,...c,children:t})})));m.displayName="MenuPrimitiveRoot";const p=n((({children:n,className:s,label:i,disabled:o,asChild:l=!1,onSelect:a,...d},f)=>{const m=t.useContext(u),p=o?null:i,{ref:g,index:h}=r.useListItem({label:p}),x=r.useFloatingTree(),v=t.useCallback((e=>{"function"==typeof g?g(e):g&&(g.current=e),"function"==typeof f?f(e):f&&(f.current=e)}),[g,f]);if(!m)return null;const{activeIndex:N,getItemProps:P}=m,I=N===h;return e(c.button,{ref:v,tabIndex:I?0:-1,className:s,...P({onClick(e){o||(a?a(e):x?.events.emit("click"))}}),disabled:o,asChild:l,...d,children:n})}));p.displayName="MenuPrimitiveItem";const g=n((({children:t,className:n,asChild:s,...i},l)=>{const a=o(u),{ref:c,index:f}=r.useListItem(),m=r.useMergeRefs([a?.refs.setReference,c,l]);if(!a)return null;const{activeIndex:p,getReferenceProps:g,isNested:h}=a;return e(d,{className:n,tabIndex:h?p===f?0:-1:void 0,ref:m,...g(),asChild:s,...i,children:t})}));g.displayName="MenuPrimitiveTrigger";const h=n((({children:t,className:n,...s},i)=>{const l=o(u),a=r.useMergeRefs([l?.refs.setFloating,i]);if(!l||!l.isOpen)return null;const{floatingStyles:c,getFloatingProps:d,elementsRef:f,labelsRef:m,isNested:p,floatingContext:g}=l;return e(r.FloatingList,{elementsRef:f,labelsRef:m,children:e(r.FocusManager,{context:g,modal:!1,initialFocus:p?-1:0,returnFocus:!p,children:e("div",{ref:a,style:c,...d(),className:n,...s,children:t})})})}));h.displayName="MenuPrimitiveContent";const x=n((({children:t,className:n,open:s,onOpenChange:i,defaultOpen:l=!1,...r},a)=>{const c=o(u);return e(f,{ref:a,className:n,open:s,onOpenChange:i,defaultOpen:l,rtl:c&&c.rtl||!1,...r,children:t})}));x.displayName="MenuPrimitiveSub";const v=n((({children:t,...n},i)=>{const a=o(u),[c,d]=s(!1),f=document.querySelector("#rad-ui-theme-container")||document.body;if(l((()=>{f&&d(!0)}),[f]),!a)return null;const{isOpen:m}=a;return m&&c?e(r.Portal,{root:f,...n,children:e("div",{ref:i,children:t})}):null}));v.displayName="MenuPrimitivePortal";const N=()=>(console.warn("Direct usage of MenuPrimitive is not supported. Please use MenuPrimitive.Root, MenuPrimitive.Item instead."),null);N.Root=m,N.Item=p,N.Trigger=g,N.Content=h,N.Sub=x,N.Portal=v;export{N as M};
@@ -1,5 +0,0 @@
1
- 'use client';import*as e from"react";import{useLayoutEffect as t}from"react";import{jsx as n,jsxs as r,Fragment as o}from"react/jsx-runtime";import*as i from"react-dom";function u(){return"undefined"!=typeof window}function c(e){return a(e)?(e.nodeName||"").toLowerCase():"#document"}function l(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function s(e){var t;return null==(t=(a(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function a(e){return!!u()&&(e instanceof Node||e instanceof l(e).Node)}function f(e){return!!u()&&(e instanceof Element||e instanceof l(e).Element)}function d(e){return!!u()&&(e instanceof HTMLElement||e instanceof l(e).HTMLElement)}function m(e){return!(!u()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof l(e).ShadowRoot)}const p=new Set(["inline","contents"]);function v(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=S(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!p.has(o)}const g=new Set(["table","td","th"]);function h(e){return g.has(c(e))}const y=[":popover-open",":modal"];function w(e){return y.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}const b=["transform","translate","scale","rotate","perspective"],x=["transform","translate","scale","rotate","perspective","filter"],R=["paint","layout","strict","content"];function E(e){const t=k(),n=f(e)?S(e):e;return b.some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||x.some((e=>(n.willChange||"").includes(e)))||R.some((e=>(n.contain||"").includes(e)))}function k(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const I=new Set(["html","body","#document"]);function C(e){return I.has(c(e))}function S(e){return l(e).getComputedStyle(e)}function M(e){return f(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function L(e){if("html"===c(e))return e;const t=e.assignedSlot||e.parentNode||m(e)&&e.host||s(e);return m(t)?t.host:t}function T(e){const t=L(e);return C(t)?e.ownerDocument?e.ownerDocument.body:e.body:d(t)&&v(t)?t:T(t)}function A(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=T(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),u=l(o);if(i){const e=O(u);return t.concat(u,u.visualViewport||[],v(o)?o:[],e&&n?A(e):[])}return t.concat(o,A(o,[],n))}function O(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const P=["top","right","bottom","left"],N=Math.min,D=Math.max,F=Math.round,W=Math.floor,B=e=>({x:e,y:e}),_={left:"right",right:"left",bottom:"top",top:"bottom"},K={start:"end",end:"start"};function H(e,t,n){return D(e,N(t,n))}function V(e,t){return"function"==typeof e?e(t):e}function q(e){return e.split("-")[0]}function j(e){return e.split("-")[1]}function z(e){return"x"===e?"y":"x"}function U(e){return"y"===e?"height":"width"}const X=new Set(["top","bottom"]);function Y(e){return X.has(q(e))?"y":"x"}function $(e){return z(Y(e))}function G(e){return e.replace(/start|end/g,(e=>K[e]))}const Q=["left","right"],Z=["right","left"],J=["top","bottom"],ee=["bottom","top"];function te(e,t,n,r){const o=j(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Z:Q:t?Q:Z;case"left":case"right":return t?J:ee;default:return[]}}(q(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(G)))),i}function ne(e){return e.replace(/left|right|bottom|top/g,(e=>_[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 oe(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}
2
- /*!
3
- * tabbable 6.2.0
4
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
- */var ie=["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(","),ue="undefined"==typeof Element,ce=ue?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,le=!ue&&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},se=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},ae=function(e,t,n){if(se(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ie));return t&&ce.call(e,ie)&&r.unshift(e),r=r.filter(n)},fe=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var u=i.shift();if(!se(u,!1))if("SLOT"===u.tagName){var c=u.assignedElements(),l=e(c.length?c:u.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:u,candidates:l})}else{ce.call(u,ie)&&r.filter(u)&&(n||!t.includes(u))&&o.push(u);var s=u.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(u),a=!se(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(u));if(s&&a){var f=e(!0===s?u.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:u,candidates:f})}else i.unshift.apply(i,u.children)}}return o},de=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},me=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))&&!de(e)?0:e.tabIndex},pe=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){return function(e){return ve(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||le(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(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 o=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!o||o===e}(e)},he=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},ye=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=ce.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ce.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return he(e)}else{if("function"==typeof r){for(var i=e;e;){var u=e.parentElement,c=le(e);if(u&&!u.shadowRoot&&!0===r(u))return he(e);e=e.assignedSlot?e.assignedSlot:u||c===e.ownerDocument?u:c.host}e=i}if(function(e){var t,n,r,o,i=e&&le(e),u=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=u)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(u)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&u;){var l,s,a;c=!(null===(s=u=null===(l=i=le(u))||void 0===l?void 0:l.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(u))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},we=function(e,t){return!(t.disabled||se(t)||function(e){return ve(e)&&"hidden"===e.type}(t)||ye(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!ce.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},be=function(e,t){return!(ge(t)||me(t)<0||!we(e,t))},xe=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Re=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,u=i?t.scopeParent:t,c=function(e,t){var n=me(e);return n<0&&t&&!de(e)?0:n}(u,i),l=i?e(t.candidates):u;0===c?i?n.push.apply(n,l):n.push(u):r.push({documentOrder:o,tabIndex:c,item:t,isScope:i,content:l})})),r.sort(pe).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?fe([e],t.includeContainer,{filter:be.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:xe}):ae(e,t.includeContainer,be.bind(null,t)),Re(n)},ke=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==ce.call(e,ie)&&be(t,e)};function Ie(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function Ce(){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 Se(){return/apple/i.test(navigator.vendor)}function Me(){const e=/android/i;return e.test(Ie())||e.test(Ce())}function Le(){return Ce().includes("jsdom/")}const Te="data-floating-ui-focusable",Ae="ArrowLeft",Oe="ArrowRight";function Pe(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 Ne(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 De(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Fe(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 We(e){return(null==e?void 0:e.ownerDocument)||document}function Be(e){return d(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function _e(e){return!!e&&("combobox"===e.getAttribute("role")&&Be(e))}function Ke(e){return e?e.hasAttribute(Te)?e:e.querySelector("["+Te+"]")||e:null}function He(e,t,n){void 0===n&&(n=!0);return e.filter((e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))})).flatMap((t=>[t,...He(e,t.id,n)]))}function Ve(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function qe(e){e.preventDefault(),e.stopPropagation()}function je(e){return!(0!==e.mozInputSource||!e.isTrusted)||(Me()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function ze(e){return!Le()&&(!Me()&&0===e.width&&0===e.height||Me()&&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 Ue(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var Xe="undefined"!=typeof document?t:function(){};function Ye(t){const n=e.useRef(t);return Xe((()=>{n.current=t})),n}const $e={...e}.useInsertionEffect||(e=>e());function Ge(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return $e((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}function Qe(e,t,n){return Math.floor(e/t)!==n}function Ze(e,t){return t<0||t>=e.current.length}function Je(e,t){return tt(e,{disabledIndices:t})}function et(e,t){return tt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function tt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:i=1}=void 0===t?{}:t,u=n;do{u+=r?-i:i}while(u>=0&&u<=e.current.length-1&&ut(e,u,o));return u}function nt(e,t){let{event:n,orientation:r,loop:o,rtl:i,cols:u,disabledIndices:c,minIndex:l,maxIndex:s,prevIndex:a,stopEvent:f=!1}=t,d=a;if("ArrowUp"===n.key){if(f&&qe(n),-1===a)d=s;else if(d=tt(e,{startingIndex:d,amount:u,decrement:!0,disabledIndices:c}),o&&(a-u<l||d<0)){const e=a%u,t=s%u,n=s-(t-e);d=t===e?s:t>e?n:n-u}Ze(e,d)&&(d=a)}if("ArrowDown"===n.key&&(f&&qe(n),-1===a?d=l:(d=tt(e,{startingIndex:a,amount:u,disabledIndices:c}),o&&a+u>s&&(d=tt(e,{startingIndex:a%u-u,amount:u,disabledIndices:c}))),Ze(e,d)&&(d=a)),"both"===r){const t=W(a/u);n.key===(i?Ae:Oe)&&(f&&qe(n),a%u!=u-1?(d=tt(e,{startingIndex:a,disabledIndices:c}),o&&Qe(d,u,t)&&(d=tt(e,{startingIndex:a-a%u-1,disabledIndices:c}))):o&&(d=tt(e,{startingIndex:a-a%u-1,disabledIndices:c})),Qe(d,u,t)&&(d=a)),n.key===(i?Oe:Ae)&&(f&&qe(n),a%u!=0?(d=tt(e,{startingIndex:a,decrement:!0,disabledIndices:c}),o&&Qe(d,u,t)&&(d=tt(e,{startingIndex:a+(u-a%u),decrement:!0,disabledIndices:c}))):o&&(d=tt(e,{startingIndex:a+(u-a%u),decrement:!0,disabledIndices:c})),Qe(d,u,t)&&(d=a));const r=W(s/u)===t;Ze(e,d)&&(d=o&&r?n.key===(i?Oe:Ae)?s:tt(e,{startingIndex:a-a%u-1,disabledIndices:c}):a)}return d}function rt(e,t,n){const r=[];let o=0;return e.forEach(((e,i)=>{let{width:u,height:c}=e;if(u>t&&"production"!==process.env.NODE_ENV)throw new Error("[Floating UI]: Invalid grid - item width at index "+i+" is greater than grid columns");let l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;n<u;n++)for(let r=0;r<c;r++)e.push(o+n+r*t);o%t+u<=t&&e.every((e=>null==r[e]))?(e.forEach((e=>{r[e]=i})),l=!0):o++}})),[...r]}function ot(e,t,n,r,o){if(-1===e)return-1;const i=n.indexOf(e),u=t[e];switch(o){case"tl":return i;case"tr":return u?i+u.width-1:i;case"bl":return u?i+(u.height-1)*r:i;case"br":return n.lastIndexOf(e)}}function it(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function ut(e,t,n){if("function"==typeof n)return n(t);if(n)return n.includes(t);const r=e.current[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}const ct=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function lt(e,t){const n=Ee(e,ct()),r=n.length;if(0===r)return;const o=Pe(We(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function st(e){return lt(We(e).body,1)||e}function at(e){return lt(We(e).body,-1)||e}function ft(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ne(n,r)}function dt(e){Ee(e,ct()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function mt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}function pt(e,t,n){let{reference:r,floating:o}=e;const i=Y(t),u=$(t),c=U(u),l=q(t),s="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[c]/2-o[c]/2;let m;switch(l){case"top":m={x:a,y:r.y-o.height};break;case"bottom":m={x:a,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(j(t)){case"start":m[u]-=d*(n&&s?-1:1);break;case"end":m[u]+=d*(n&&s?-1:1)}return m}async function vt(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:u,elements:c,strategy:l}=e,{boundary:s="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:m=0}=V(t,e),p=re(m),v=c[d?"floating"===f?"reference":"floating":f],g=oe(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:s,rootBoundary:a,strategy:l})),h="floating"===f?{x:r,y:o,width:u.floating.width,height:u.floating.height}:u.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=oe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:h,offsetParent:y,strategy:l}):h);return{top:(g.top-b.top+p.top)/w.y,bottom:(b.bottom-g.bottom+p.bottom)/w.y,left:(g.left-b.left+p.left)/w.x,right:(b.right-g.right+p.right)/w.x}}function gt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ht(e){return P.some((t=>e[t]>=0))}const yt=new Set(["left","top"]);function wt(e){const t=S(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=d(e),i=o?e.offsetWidth:n,u=o?e.offsetHeight:r,c=F(n)!==i||F(r)!==u;return c&&(n=i,r=u),{width:n,height:r,$:c}}function bt(e){return f(e)?e:e.contextElement}function xt(e){const t=bt(e);if(!d(t))return B(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=wt(t);let u=(i?F(n.width):n.width)/r,c=(i?F(n.height):n.height)/o;return u&&Number.isFinite(u)||(u=1),c&&Number.isFinite(c)||(c=1),{x:u,y:c}}const Rt=B(0);function Et(e){const t=l(e);return k()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Rt}function kt(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=bt(e);let u=B(1);t&&(r?f(r)&&(u=xt(r)):u=xt(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==l(e))&&t}(i,n,r)?Et(i):B(0);let s=(o.left+c.x)/u.x,a=(o.top+c.y)/u.y,d=o.width/u.x,m=o.height/u.y;if(i){const e=l(i),t=r&&f(r)?l(r):r;let n=e,o=O(n);for(;o&&r&&t!==n;){const e=xt(o),t=o.getBoundingClientRect(),r=S(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,u=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,a*=e.y,d*=e.x,m*=e.y,s+=i,a+=u,n=l(o),o=O(n)}}return oe({width:d,height:m,x:s,y:a})}function It(e,t){const n=M(e).scrollLeft;return t?t.left+n:kt(s(e)).left+n}function Ct(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-It(e,n),y:n.top+t.scrollTop}}const St=new Set(["absolute","fixed"]);function Mt(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=l(e),r=s(e),o=n.visualViewport;let i=r.clientWidth,u=r.clientHeight,c=0,a=0;if(o){i=o.width,u=o.height;const e=k();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,a=o.offsetTop)}const f=It(r);if(f<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,u=Math.abs(r.clientWidth-t.clientWidth-o);u<=25&&(i-=u)}else f<=25&&(i+=f);return{width:i,height:u,x:c,y:a}}(e,n);else if("document"===t)r=function(e){const t=s(e),n=M(e),r=e.ownerDocument.body,o=D(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=D(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+It(e);const c=-n.scrollTop;return"rtl"===S(r).direction&&(u+=D(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:u,y:c}}(s(e));else if(f(t))r=function(e,t){const n=kt(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=d(e)?xt(e):B(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Et(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return oe(r)}function Lt(e,t){const n=L(e);return!(n===t||!f(n)||C(n))&&("fixed"===S(n).position||Lt(n,t))}function Tt(e,t,n){const r=d(t),o=s(t),i="fixed"===n,u=kt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const a=B(0);function f(){a.x=It(o)}if(r||!r&&!i)if(("body"!==c(t)||v(o))&&(l=M(t)),r){const e=kt(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&f();i&&!r&&o&&f();const m=!o||r||i?B(0):Ct(o,l);return{x:u.left+l.scrollLeft-a.x-m.x,y:u.top+l.scrollTop-a.y-m.y,width:u.width,height:u.height}}function At(e){return"static"===S(e).position}function Ot(e,t){if(!d(e)||"fixed"===S(e).position)return null;if(t)return t(e);let n=e.offsetParent;return s(e)===n&&(n=n.ownerDocument.body),n}function Pt(e,t){const n=l(e);if(w(e))return n;if(!d(e)){let t=L(e);for(;t&&!C(t);){if(f(t)&&!At(t))return t;t=L(t)}return n}let r=Ot(e,t);for(;r&&h(r)&&At(r);)r=Ot(r,t);return r&&C(r)&&At(r)&&!E(r)?n:r||function(e){let t=L(e);for(;d(t)&&!C(t);){if(E(t))return t;if(w(t))return null;t=L(t)}return null}(e)||n}const Nt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,u=s(r),l=!!t&&w(t.floating);if(r===u||l&&i)return n;let a={scrollLeft:0,scrollTop:0},f=B(1);const m=B(0),p=d(r);if((p||!p&&!i)&&(("body"!==c(r)||v(u))&&(a=M(r)),d(r))){const e=kt(r);f=xt(r),m.x=e.x+r.clientLeft,m.y=e.y+r.clientTop}const g=!u||p||i?B(0):Ct(u,a);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-a.scrollLeft*f.x+m.x+g.x,y:n.y*f.y-a.scrollTop*f.y+m.y+g.y}},getDocumentElement:s,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?w(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=A(e,[],!1).filter((e=>f(e)&&"body"!==c(e))),o=null;const i="fixed"===S(e).position;let u=i?L(e):e;for(;f(u)&&!C(u);){const t=S(u),n=E(u);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&St.has(o.position)||v(u)&&!n&&Lt(e,u))?r=r.filter((e=>e!==u)):o=t,u=L(u)}return t.set(e,r),r}(t,this._c):[].concat(n),r],u=i[0],l=i.reduce(((e,n)=>{const r=Mt(t,n,o);return e.top=D(r.top,e.top),e.right=N(r.right,e.right),e.bottom=N(r.bottom,e.bottom),e.left=D(r.left,e.left),e}),Mt(t,u,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Pt,getElementRects:async function(e){const t=this.getOffsetParent||Pt,n=this.getDimensions,r=await n(e.floating);return{reference:Tt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=wt(e);return{width:t,height:n}},getScale:xt,isElement:f,isRTL:function(e){return"rtl"===S(e).direction}};function Dt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ft(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:u="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,a=bt(e),f=o||i?[...a?A(a):[],...A(t)]:[];f.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=a&&c?function(e,t){let n,r=null;const o=s(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function u(c,l){void 0===c&&(c=!1),void 0===l&&(l=1),i();const s=e.getBoundingClientRect(),{left:a,top:f,width:d,height:m}=s;if(c||t(),!d||!m)return;const p={rootMargin:-W(f)+"px "+-W(o.clientWidth-(a+d))+"px "+-W(o.clientHeight-(f+m))+"px "+-W(a)+"px",threshold:D(0,N(1,l))||1};let v=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!v)return u();r?u(!1,r):n=setTimeout((()=>{u(!1,1e-7)}),1e3)}1!==r||Dt(s,e.getBoundingClientRect())||u(),v=!1}try{r=new IntersectionObserver(g,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,p)}r.observe(e)}(!0),i}(a,n):null;let m,p=-1,v=null;u&&(v=new ResizeObserver((e=>{let[r]=e;r&&r.target===a&&v&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=v)||e.observe(t)}))),n()})),a&&!l&&v.observe(a),v.observe(t));let g=l?kt(e):null;return l&&function t(){const r=kt(e);g&&!Dt(g,r)&&n();g=r,m=requestAnimationFrame(t)}(),n(),()=>{var e;f.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=v)||e.disconnect(),v=null,l&&cancelAnimationFrame(m)}}const Wt=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:u,middlewareData:c}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),u=q(n),c=j(n),l="y"===Y(n),s=yt.has(u)?-1:1,a=i&&l?-1:1,f=V(t,e);let{mainAxis:d,crossAxis:m,alignmentAxis:p}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&"number"==typeof p&&(m="end"===c?-1*p:p),l?{x:m*a,y:d*s}:{x:d*s,y:m*a}}(t,e);return u===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:u}}}}},Bt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:u=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=V(e,t),s={x:n,y:r},a=await vt(t,l),f=Y(q(o)),d=z(f);let m=s[d],p=s[f];if(i){const e="y"===d?"bottom":"right";m=H(m+a["y"===d?"top":"left"],m,m-a[e])}if(u){const e="y"===f?"bottom":"right";p=H(p+a["y"===f?"top":"left"],p,p-a[e])}const v=c.fn({...t,[d]:m,[f]:p});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:u}}}}}},_t=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:u,initialPlacement:c,platform:l,elements:s}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...g}=V(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const h=q(o),y=Y(c),w=q(c)===c,b=await(null==l.isRTL?void 0:l.isRTL(s.floating)),x=d||(w||!v?[ne(c)]:function(e){const t=ne(e);return[G(e),t,G(t)]}(c)),R="none"!==p;!d&&R&&x.push(...te(c,v,p,b));const E=[c,...x],k=await vt(t,g),I=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&I.push(k[h]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=j(e),o=$(e),i=U(o);let u="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(u=ne(u)),[u,ne(u)]}(o,u,b);I.push(k[e[0]],k[e[1]])}if(C=[...C,{placement:o,overflows:I}],!I.every((e=>e<=0))){var S,M;const e=((null==(S=i.flip)?void 0:S.index)||0)+1,t=E[e];if(t){if(!("alignment"===f&&y!==Y(t))||C.every((e=>Y(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:C},reset:{placement:t}}}let n=null==(M=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:M.placement;if(!n)switch(m){case"bestFit":{var L;const e=null==(L=C.filter((e=>{if(R){const t=Y(e.placement);return t===y||"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=c}if(o!==n)return{reset:{placement:n}}}return{}}}},Kt=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=V(e,t);switch(r){case"referenceHidden":{const e=gt(await vt(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ht(e)}}}case"escaped":{const e=gt(await vt(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ht(e)}}}default:return{}}}}},Ht=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:u,elements:c,middlewareData:l}=t,{element:s,padding:a=0}=V(e,t)||{};if(null==s)return{};const f=re(a),d={x:n,y:r},m=$(o),p=U(m),v=await u.getDimensions(s),g="y"===m,h=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",b=i.reference[p]+i.reference[m]-d[m]-i.floating[p],x=d[m]-i.reference[m],R=await(null==u.getOffsetParent?void 0:u.getOffsetParent(s));let E=R?R[w]:0;E&&await(null==u.isElement?void 0:u.isElement(R))||(E=c.floating[w]||i.floating[p]);const k=b/2-x/2,I=E/2-v[p]/2-1,C=N(f[h],I),S=N(f[y],I),M=C,L=E-v[p]-S,T=E/2-v[p]/2+k,A=H(M,T,L),O=!l.arrow&&null!=j(o)&&T!==A&&i.reference[p]/2-(T<M?C:S)-v[p]/2<0,P=O?T<M?T-M:T-L:0;return{[m]:d[m]+P,data:{[m]:A,centerOffset:T-A-P,...O&&{alignmentOffset:P}},reset:O}}}),Vt=(e,t,n)=>{const r=new Map,o={platform:Nt,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:u}=n,c=i.filter(Boolean),l=await(null==u.isRTL?void 0:u.isRTL(t));let s=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=pt(s,r,l),d=r,m={},p=0;for(let n=0;n<c.length;n++){const{name:i,fn:v}=c[n],{x:g,y:h,data:y,reset:w}=await v({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:m,rects:s,platform:u,elements:{reference:e,floating:t}});a=null!=g?g:a,f=null!=h?h:f,m={...m,[i]:{...m[i],...y}},w&&p<=50&&(p++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await u.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=pt(s,d,l))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:m}})(e,t,{...o,platform:i})};var qt="undefined"!=typeof document?t:function(){};function jt(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,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!jt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!jt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function zt(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ut(e,t){const n=zt(e);return Math.round(t*n)/n}function Xt(t){const n=e.useRef(t);return qt((()=>{n.current=t})),n}const Yt=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Ht({element:n.current,padding:r}).fn(t):{}:n?Ht({element:n,padding:r}).fn(t):{};var o}}),$t=(e,t)=>({...Wt(e),options:[e,t]}),Gt=(e,t)=>({...Bt(e),options:[e,t]}),Qt=(e,t)=>({..._t(e),options:[e,t]}),Zt=(e,t)=>({...Kt(e),options:[e,t]}),Jt=(e,t)=>({...Yt(e),options:[e,t]});function en(t){const n=e.useRef(void 0),r=e.useCallback((e=>{const n=t.map((t=>{if(null!=t){if("function"==typeof t){const n=t,r=n(e);return"function"==typeof r?r:()=>{n(null)}}return t.current=e,()=>{t.current=null}}}));return()=>{n.forEach((e=>null==e?void 0:e()))}}),t);return e.useMemo((()=>t.every((e=>null==e))?null:e=>{n.current&&(n.current(),n.current=void 0),null!=e&&(n.current=r(e))}),t)}function tn(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 nn=e.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function rn(t){const{children:r,elementsRef:o,labelsRef:i}=t,[u,c]=e.useState((()=>new Set)),l=e.useCallback((e=>{c((t=>new Set(t).add(e)))}),[]),s=e.useCallback((e=>{c((t=>{const n=new Set(t);return n.delete(e),n}))}),[]),a=e.useMemo((()=>{const e=new Map;return Array.from(u.keys()).sort(tn).forEach(((t,n)=>{e.set(t,n)})),e}),[u]);return n(nn.Provider,{value:e.useMemo((()=>({register:l,unregister:s,map:a,elementsRef:o,labelsRef:i})),[l,s,a,o,i]),children:r})}function on(t){void 0===t&&(t={});const{label:n}=t,{register:r,unregister:o,map:i,elementsRef:u,labelsRef:c}=e.useContext(nn),[l,s]=e.useState(null),a=e.useRef(null),f=e.useCallback((e=>{if(a.current=e,null!==l&&(u.current[l]=e,c)){var t;const r=void 0!==n;c.current[l]=r?n:null!=(t=null==e?void 0:e.textContent)?t:null}}),[l,u,c,n]);return Xe((()=>{const e=a.current;if(e)return r(e),()=>{o(e)}}),[r,o]),Xe((()=>{const e=a.current?i.get(a.current):null;null!=e&&s(e)}),[i]),e.useMemo((()=>({ref:f,index:null==l?-1:l})),[l,f])}const un="data-floating-ui-focusable",cn="active",ln="selected",sn="ArrowLeft",an="ArrowRight",fn="ArrowUp",dn="ArrowDown";function mn(t,r){return"function"==typeof t?t(r):t?e.cloneElement(t,r):n("div",{...r})}const pn=e.createContext({activeIndex:0,onNavigate:()=>{}}),vn=[sn,an],gn=[fn,dn],hn=[...vn,...gn],yn=e.forwardRef((function(t,r){const{render:o,orientation:i="both",loop:u=!0,rtl:c=!1,cols:l=1,disabledIndices:s,activeIndex:a,onNavigate:f,itemSizes:d,dense:m=!1,...p}=t,[v,g]=e.useState(0),h=null!=a?a:v,y=Ge(null!=f?f:g),w=e.useRef([]),b=o&&"function"!=typeof o?o.props:{},x=e.useMemo((()=>({activeIndex:h,onNavigate:y})),[h,y]),R=l>1;const E={...p,...b,ref:r,"aria-orientation":"both"===i?void 0:i,onKeyDown(e){null==p.onKeyDown||p.onKeyDown(e),null==b.onKeyDown||b.onKeyDown(e),function(e){if(!hn.includes(e.key))return;let t=h;const n=Je(w,s),r=et(w,s),o=c?sn:an,a=c?an:sn;if(R){const a=d||Array.from({length:w.current.length},(()=>({width:1,height:1}))),f=rt(a,l,m),p=f.findIndex((e=>null!=e&&!ut(w,e,s))),v=f.reduce(((e,t,n)=>null==t||ut(w,t,s)?e:n),-1),g=f[nt({current:f.map((e=>e?w.current[e]:null))},{event:e,orientation:i,loop:u,rtl:c,cols:l,disabledIndices:it([...("function"!=typeof s?s:null)||w.current.map(((e,t)=>ut(w,t,s)?t:void 0)),void 0],f),minIndex:p,maxIndex:v,prevIndex:ot(h>r?n:h,a,f,l,e.key===dn?"bl":e.key===o?"tr":"tl")})];null!=g&&(t=g)}const f={horizontal:[o],vertical:[dn],both:[o,dn]}[i],p={horizontal:[a],vertical:[fn],both:[a,fn]}[i],v=R?hn:{horizontal:vn,vertical:gn,both:hn}[i];var g;t===h&&[...f,...p].includes(e.key)&&(t=u&&t===r&&f.includes(e.key)?n:u&&t===n&&p.includes(e.key)?r:tt(w,{startingIndex:t,decrement:p.includes(e.key),disabledIndices:s})),t===h||Ze(w,t)||(e.stopPropagation(),v.includes(e.key)&&e.preventDefault(),y(t),null==(g=w.current[t])||g.focus())}(e)}};return n(pn.Provider,{value:x,children:n(rn,{elementsRef:w,children:mn(o,E)})})})),wn=e.forwardRef((function(t,n){const{render:r,...o}=t,i=r&&"function"!=typeof r?r.props:{},{activeIndex:u,onNavigate:c}=e.useContext(pn),{ref:l,index:s}=on(),a=en([l,n,i.ref]),f=u===s;return mn(r,{...o,...i,ref:a,tabIndex:f?0:-1,"data-active":f?"":void 0,onFocus(e){null==o.onFocus||o.onFocus(e),null==i.onFocus||i.onFocus(e),c(s)}})})),bn={...e};let xn=!1,Rn=0;const En=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Rn++;const kn=bn.useId||function(){const[t,n]=e.useState((()=>xn?En():void 0));return Xe((()=>{null==t&&n(En())}),[]),e.useEffect((()=>{xn=!0}),[]),t};let In;function Cn(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=In)&&e.has(o)||(null==(i=In)||i.add(o),console.warn(o))}"production"!==process.env.NODE_ENV&&(In=new Set);const Sn=e.forwardRef((function(t,o){const{context:{placement:i,elements:{floating:u},middlewareData:{arrow:c,shift:l}},width:s=14,height:a=7,tipRadius:f=0,strokeWidth:d=0,staticOffset:m,stroke:p,d:v,style:{transform:g,...h}={},...y}=t;"production"!==process.env.NODE_ENV&&(o||Cn("The `ref` prop is required for `FloatingArrow`."));const w=kn(),[b,x]=e.useState(!1);if(Xe((()=>{if(!u)return;"rtl"===S(u).direction&&x(!0)}),[u]),!u)return null;const[R,E]=i.split("-"),k="top"===R||"bottom"===R;let I=m;(k&&null!=l&&l.x||!k&&null!=l&&l.y)&&(I=null);const C=2*d,M=C/2,L=s/2*(f/-8+1),T=a/2*f/4,A=!!v,O=I&&"end"===E?"bottom":"top";let P=I&&"end"===E?"right":"left";I&&b&&(P="end"===E?"left":"right");const N=null!=(null==c?void 0:c.x)?I||c.x:"",D=null!=(null==c?void 0:c.y)?I||c.y:"",F=v||"M0,0 H"+s+" L"+(s-L)+","+(a-T)+" Q"+s/2+","+a+" "+L+","+(a-T)+" Z",W={top:A?"rotate(180deg)":"",left:A?"rotate(90deg)":"rotate(-90deg)",bottom:A?"":"rotate(180deg)",right:A?"rotate(-90deg)":"rotate(90deg)"}[R];return r("svg",{...y,"aria-hidden":!0,ref:o,width:A?s:s+C,height:s,viewBox:"0 0 "+s+" "+(a>s?a:s),style:{position:"absolute",pointerEvents:"none",[P]:N,[O]:D,[R]:k||A?"100%":"calc(100% - "+C/2+"px)",transform:[W,g].filter((e=>!!e)).join(" "),...h},children:[C>0&&n("path",{clipPath:"url(#"+w+")",fill:"none",stroke:p,strokeWidth:C+(v?0:1),d:F}),n("path",{stroke:C&&!v?y.fill:"none",d:F}),n("clipPath",{id:w,children:n("rect",{x:-M,y:M*(A?-1:1),width:s+C,height:s})})]})}));function Mn(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}const Ln=e.createContext(null),Tn=e.createContext(null),An=()=>{var t;return(null==(t=e.useContext(Ln))?void 0:t.id)||null},On=()=>e.useContext(Tn);function Pn(e){const t=kn(),n=On(),r=An(),o=e||r;return Xe((()=>{if(!t)return;const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t}function Nn(t){const{children:r,id:o}=t,i=An();return n(Ln.Provider,{value:e.useMemo((()=>({id:o,parentId:i})),[o,i]),children:r})}function Dn(t){const{children:r}=t,o=e.useRef([]),i=e.useCallback((e=>{o.current=[...o.current,e]}),[]),u=e.useCallback((e=>{o.current=o.current.filter((t=>t!==e))}),[]),[c]=e.useState((()=>Mn()));return n(Tn.Provider,{value:e.useMemo((()=>({nodesRef:o,addNode:i,removeNode:u,events:c})),[i,u,c]),children:r})}function Fn(e){return"data-floating-ui-"+e}function Wn(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const Bn=Fn("safe-polygon");function _n(e,t,n){if(n&&!Ue(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 Kn(e){return"function"==typeof e?e():e}function Hn(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:u,elements:c}=t,{enabled:l=!0,delay:s=0,handleClose:a=null,mouseOnly:d=!1,restMs:m=0,move:p=!0}=n,v=On(),g=An(),h=Ye(a),y=Ye(s),w=Ye(r),b=Ye(m),x=e.useRef(),R=e.useRef(-1),E=e.useRef(),k=e.useRef(-1),I=e.useRef(!0),C=e.useRef(!1),S=e.useRef((()=>{})),M=e.useRef(!1),L=Ge((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}));e.useEffect((()=>{if(l)return u.on("openchange",e),()=>{u.off("openchange",e)};function e(e){let{open:t}=e;t||(Wn(R),Wn(k),I.current=!0,M.current=!1)}}),[l,u]),e.useEffect((()=>{if(!l)return;if(!h.current)return;if(!r)return;function e(e){L()&&o(!1,e,"hover")}const t=We(c.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[c.floating,r,o,l,h,L]);const T=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=_n(y.current,"close",x.current);r&&!E.current?(Wn(R),R.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(Wn(R),o(!1,e,n))}),[y,o]),A=Ge((()=>{S.current(),E.current=void 0})),O=Ge((()=>{if(C.current){const e=We(c.floating).body;e.style.pointerEvents="",e.removeAttribute(Bn),C.current=!1}})),P=Ge((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(l&&f(c.domReference)){const o=c.domReference,i=c.floating;return r&&o.addEventListener("mouseleave",n),p&&o.addEventListener("mousemove",e,{once:!0}),o.addEventListener("mouseenter",e),o.addEventListener("mouseleave",t),i&&(i.addEventListener("mouseleave",n),i.addEventListener("mouseenter",u),i.addEventListener("mouseleave",s)),()=>{r&&o.removeEventListener("mouseleave",n),p&&o.removeEventListener("mousemove",e),o.removeEventListener("mouseenter",e),o.removeEventListener("mouseleave",t),i&&(i.removeEventListener("mouseleave",n),i.removeEventListener("mouseenter",u),i.removeEventListener("mouseleave",s))}}function e(e){if(Wn(R),I.current=!1,d&&!Ue(x.current)||Kn(b.current)>0&&!_n(y.current,"open"))return;const t=_n(y.current,"open",x.current);t?R.current=window.setTimeout((()=>{w.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function t(e){if(P())return void O();S.current();const t=We(c.floating);if(Wn(k),M.current=!1,h.current&&i.current.floatingContext){r||Wn(R),E.current=h.current({...i.current.floatingContext,tree:v,x:e.clientX,y:e.clientY,onClose(){O(),A(),P()||T(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(S.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==x.current||!Ne(c.floating,e.relatedTarget))&&T(e)}function n(e){P()||i.current.floatingContext&&(null==h.current||h.current({...i.current.floatingContext,tree:v,x:e.clientX,y:e.clientY,onClose(){O(),A(),P()||T(e)}})(e))}function u(){Wn(R)}function s(e){P()||T(e,!1)}}),[c,l,t,d,p,T,A,O,o,r,w,v,y,h,i,P,b]),Xe((()=>{var e;if(l&&r&&null!=(e=h.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&L()){C.current=!0;const e=c.floating;if(f(c.domReference)&&e){var t;const n=We(c.floating).body;n.setAttribute(Bn,"");const r=c.domReference,o=null==v||null==(t=v.nodesRef.current.find((e=>e.id===g)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[l,r,g,c,v,h,L]),Xe((()=>{r||(x.current=void 0,M.current=!1,A(),O())}),[r,A,O]),e.useEffect((()=>()=>{A(),Wn(R),Wn(k),O()}),[l,c.domReference,A,O]);const N=e.useMemo((()=>{function e(e){x.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){I.current||w.current||o(!0,t,"hover")}d&&!Ue(x.current)||r||0===Kn(b.current)||M.current&&e.movementX**2+e.movementY**2<2||(Wn(k),"touch"===x.current?n():(M.current=!0,k.current=window.setTimeout(n,Kn(b.current))))}}}),[d,o,r,w,b]);return e.useMemo((()=>l?{reference:N}:{}),[l,N])}let Vn=0;function qn(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Vn);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Vn=requestAnimationFrame(i)}function jn(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 zn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Un(e){return"inert"===e?zn.inert:"aria-hidden"===e?zn["aria-hidden"]:zn.none}let Xn=new WeakSet,Yn={},$n=0;const Gn=e=>e&&(e.host||Gn(e.parentNode));function Qn(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,u=(l=t,e.map((e=>{if(l.contains(e))return e;const t=Gn(e);return l.contains(t)?t:null})).filter((e=>null!=e)));var l;const s=new Set,a=new Set(u),f=[];Yn[o]||(Yn[o]=new WeakMap);const d=Yn[o];return u.forEach((function e(t){if(!t||s.has(t))return;s.add(t),t.parentNode&&e(t.parentNode)})),function e(t){if(!t||a.has(t))return;[].forEach.call(t.children,(t=>{if("script"!==c(t))if(s.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=Un(i),u=(r.get(t)||0)+1,c=(d.get(t)||0)+1;r.set(t,u),d.set(t,c),f.push(t),1===u&&n&&Xn.add(t),1===c&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"inert"===i?"":"true")}}))}(t),s.clear(),$n++,()=>{f.forEach((e=>{const t=Un(i),n=(t.get(e)||0)-1,r=(d.get(e)||0)-1;t.set(e,n),d.set(e,r),n||(!Xn.has(e)&&i&&e.removeAttribute(i),Xn.delete(e)),r||e.removeAttribute(o)})),$n--,$n||(zn.inert=new WeakMap,zn["aria-hidden"]=new WeakMap,zn.none=new WeakMap,Xn=new WeakSet,Yn={})}}function Zn(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=(o=e[0],(null==o?void 0:o.ownerDocument)||document).body;var o;return Qn(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const Jn={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},er=e.forwardRef((function(t,r){const[o,i]=e.useState();Xe((()=>{Se()&&i("button")}),[]);const u={ref:r,tabIndex:0,role:o,"aria-hidden":!o||void 0,[Fn("focus-guard")]:"",style:Jn};return n("span",{...t,...u})})),tr=e.createContext(null),nr=Fn("portal");function rr(t){const{children:o,id:u,root:c,preserveTabOrder:l=!0}=t,s=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=kn(),i=or(),[u,c]=e.useState(null),l=e.useRef(null);return Xe((()=>()=>{null==u||u.remove(),queueMicrotask((()=>{l.current=null}))}),[u]),Xe((()=>{if(!o)return;if(l.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(nr,""),e.appendChild(t),l.current=t,c(t)}),[n,o]),Xe((()=>{if(null===r)return;if(!o)return;if(l.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!a(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const u=document.createElement("div");u.id=o,u.setAttribute(nr,""),e=t||e,e.appendChild(u),l.current=u,c(u)}),[n,r,o,i]),u}({id:u,root:c}),[f,d]=e.useState(null),m=e.useRef(null),p=e.useRef(null),v=e.useRef(null),g=e.useRef(null),h=null==f?void 0:f.modal,y=null==f?void 0:f.open,w=!!f&&!f.modal&&f.open&&l&&!(!c&&!s);return e.useEffect((()=>{if(s&&l&&!h)return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){if(s&&ft(e)){("focusin"===e.type?mt:dt)(s)}}}),[s,l,h]),e.useEffect((()=>{s&&(y||mt(s))}),[y,s]),r(tr.Provider,{value:e.useMemo((()=>({preserveTabOrder:l,beforeOutsideRef:m,afterOutsideRef:p,beforeInsideRef:v,afterInsideRef:g,portalNode:s,setFocusManagerState:d})),[l,s]),children:[w&&s&&n(er,{"data-type":"outside",ref:m,onFocus:e=>{if(ft(e,s)){var t;null==(t=v.current)||t.focus()}else{const e=at(f?f.domReference:null);null==e||e.focus()}}}),w&&s&&n("span",{"aria-owns":s.id,style:Jn}),s&&i.createPortal(o,s),w&&s&&n(er,{"data-type":"outside",ref:p,onFocus:e=>{if(ft(e,s)){var t;null==(t=g.current)||t.focus()}else{const t=st(f?f.domReference:null);null==t||t.focus(),(null==f?void 0:f.closeOnFocusOut)&&(null==f||f.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const or=()=>e.useContext(tr);function ir(t){return e.useMemo((()=>e=>{t.forEach((t=>{t&&(t.current=e)}))}),t)}let ur=[];function cr(){ur=ur.filter((e=>e.isConnected))}function lr(){return cr(),ur[ur.length-1]}function sr(e,t){var n;if(!(t.current.includes("floating")||null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;const r=ct(),o=function(e,t){return(t=t||{}).getShadowRoot?fe([e],t.includeContainer,{filter:we.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):ae(e,t.includeContainer,we.bind(null,t))}(e,r),i=o.filter((e=>{const t=e.getAttribute("data-tabindex")||"";return ke(e,r)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")})),u=e.getAttribute("tabindex");t.current.includes("floating")||0===i.length?"0"!==u&&e.setAttribute("tabindex","0"):("-1"!==u||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const ar=e.forwardRef((function(e,t){return n("button",{...e,type:"button",ref:t,tabIndex:-1,style:Jn})}));function fr(t){const{context:i,children:u,disabled:l=!1,order:s=["content"],guards:a=!0,initialFocus:f=0,returnFocus:m=!0,restoreFocus:p=!1,modal:v=!0,visuallyHiddenDismiss:g=!1,closeOnFocusOut:h=!0,outsideElementsInert:y=!1,getInsideElements:w=()=>[]}=t,{open:b,onOpenChange:x,events:R,dataRef:E,elements:{domReference:k,floating:I}}=i,C=Ge((()=>{var e;return null==(e=E.current.floatingContext)?void 0:e.nodeId})),S=Ge(w),M="number"==typeof f&&f<0,L=_e(k)&&M,T="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,A=!T||a,O=!A||T&&y,P=Ye(s),N=Ye(f),D=Ye(m),F=On(),W=or(),B=e.useRef(null),_=e.useRef(null),K=e.useRef(!1),H=e.useRef(!1),V=e.useRef(-1),q=e.useRef(-1),j=null!=W,z=Ke(I),U=Ge((function(e){return void 0===e&&(e=z),e?Ee(e,ct()):[]})),X=Ge((e=>{const t=U(e);return P.current.map((e=>k&&"reference"===e?k:z&&"floating"===e?z:t)).filter(Boolean).flat()}));e.useEffect((()=>{if(l)return;if(!v)return;function e(e){if("Tab"===e.key){Ne(z,Pe(We(z)))&&0===U().length&&!L&&qe(e);const t=X(),n=De(e);"reference"===P.current[0]&&n===k&&(qe(e),e.shiftKey?qn(t[t.length-1]):qn(t[1])),"floating"===P.current[1]&&n===z&&e.shiftKey&&(qe(e),qn(t[0]))}}const t=We(z);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[l,k,z,v,P,L,U,X]),e.useEffect((()=>{if(!l&&I)return I.addEventListener("focusin",e),()=>{I.removeEventListener("focusin",e)};function e(e){const t=De(e),n=U().indexOf(t);-1!==n&&(V.current=n)}}),[l,I,U]),e.useEffect((()=>{if(l)return;if(!h)return;function e(){H.current=!0,setTimeout((()=>{H.current=!1}))}function t(e){const t=e.relatedTarget,n=e.currentTarget,r=De(e);queueMicrotask((()=>{const o=C(),i=!(Ne(k,t)||Ne(I,t)||Ne(t,I)||Ne(null==W?void 0:W.portalNode,t)||null!=t&&t.hasAttribute(Fn("focus-guard"))||F&&(He(F.nodesRef.current,o).find((e=>{var n,r;return Ne(null==(n=e.context)?void 0:n.elements.floating,t)||Ne(null==(r=e.context)?void 0:r.elements.domReference,t)}))||Ve(F.nodesRef.current,o).find((e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,Ke(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t}))));if(n===k&&z&&sr(z,P),p&&n!==k&&(null==r||!r.isConnected)&&Pe(We(z))===We(z).body){d(z)&&z.focus();const e=V.current,t=U(),n=t[e]||t[t.length-1]||z;d(n)&&n.focus()}E.current.insideReactTree?E.current.insideReactTree=!1:!L&&v||!t||!i||H.current||t===lr()||(K.current=!0,x(!1,e,"focus-out"))}))}const n=Boolean(!F&&W);function r(){Wn(q),E.current.insideReactTree=!0,q.current=window.setTimeout((()=>{E.current.insideReactTree=!1}))}return I&&d(k)?(k.addEventListener("focusout",t),k.addEventListener("pointerdown",e),I.addEventListener("focusout",t),n&&I.addEventListener("focusout",r,!0),()=>{k.removeEventListener("focusout",t),k.removeEventListener("pointerdown",e),I.removeEventListener("focusout",t),n&&I.removeEventListener("focusout",r,!0)}):void 0}),[l,k,I,z,v,F,W,x,h,p,U,L,C,P,E]);const Y=e.useRef(null),$=e.useRef(null),G=ir([Y,null==W?void 0:W.beforeInsideRef]),Q=ir([$,null==W?void 0:W.afterInsideRef]);function Z(e){return!l&&g&&v?n(ar,{ref:"start"===e?B:_,onClick:e=>x(!1,e.nativeEvent),children:"string"==typeof g?g:"Dismiss"}):null}e.useEffect((()=>{var e,t;if(l)return;if(!I)return;const n=Array.from((null==W||null==(e=W.portalNode)?void 0:e.querySelectorAll("["+Fn("portal")+"]"))||[]),r=null==(t=(F?Ve(F.nodesRef.current,C()):[]).find((e=>{var t;return _e((null==(t=e.context)?void 0:t.elements.domReference)||null)})))||null==(t=t.context)?void 0:t.elements.domReference,o=[I,r,...n,...S(),B.current,_.current,Y.current,$.current,null==W?void 0:W.beforeOutsideRef.current,null==W?void 0:W.afterOutsideRef.current,P.current.includes("reference")||L?k:null].filter((e=>null!=e)),i=v||L?Zn(o,!O,O):Zn(o);return()=>{i()}}),[l,k,I,v,P,W,L,A,O,F,C,S]),Xe((()=>{if(l||!d(z))return;const e=Pe(We(z));queueMicrotask((()=>{const t=X(z),n=N.current,r=("number"==typeof n?t[n]:n.current)||z,o=Ne(z,e);M||o||!b||qn(r,{preventScroll:r===z})}))}),[l,b,z,M,X,N]),Xe((()=>{if(l||!z)return;const e=We(z),t=Pe(e);var n;function r(e){let{reason:t,event:n,nested:r}=e;if(["hover","safe-polygon"].includes(t)&&"mouseleave"===n.type&&(K.current=!0),"outside-press"===t)if(r)K.current=!1;else if(je(n)||ze(n))K.current=!1;else{let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),K.current=!e}}n=t,cr(),n&&"body"!==c(n)&&(ur.push(n),ur.length>20&&(ur=ur.slice(-20))),R.on("openchange",r);const o=e.createElement("span");return o.setAttribute("tabindex","-1"),o.setAttribute("aria-hidden","true"),Object.assign(o.style,Jn),j&&k&&k.insertAdjacentElement("afterend",o),()=>{R.off("openchange",r);const t=Pe(e),n=Ne(I,t)||F&&He(F.nodesRef.current,C(),!1).some((e=>{var n;return Ne(null==(n=e.context)?void 0:n.elements.floating,t)})),i=function(){if("boolean"==typeof D.current){const e=k||lr();return e&&e.isConnected?e:o}return D.current.current||o}();queueMicrotask((()=>{const r=function(e){const t=ct();return ke(e,t)?e:Ee(e,t)[0]||e}(i);D.current&&!K.current&&d(r)&&(r===t||t===e.body||n)&&r.focus({preventScroll:!0}),o.remove()}))}}),[l,I,z,D,E,R,F,j,k,C]),e.useEffect((()=>(queueMicrotask((()=>{K.current=!1})),()=>{queueMicrotask(cr)})),[l]),Xe((()=>{if(!l&&W)return W.setFocusManagerState({modal:v,closeOnFocusOut:h,open:b,onOpenChange:x,domReference:k}),()=>{W.setFocusManagerState(null)}}),[l,W,v,b,x,h,k]),Xe((()=>{l||z&&sr(z,P)}),[l,z,P]);const J=!l&&A&&(!v||!L)&&(j||v);return r(o,{children:[J&&n(er,{"data-type":"inside",ref:G,onFocus:e=>{if(v){const e=X();qn("reference"===s[0]?e[0]:e[e.length-1])}else if(null!=W&&W.preserveTabOrder&&W.portalNode)if(K.current=!1,ft(e,W.portalNode)){const e=st(k);null==e||e.focus()}else{var t;null==(t=W.beforeOutsideRef.current)||t.focus()}}}),!L&&Z("start"),u,Z("end"),J&&n(er,{"data-type":"inside",ref:Q,onFocus:e=>{if(v)qn(X()[0]);else if(null!=W&&W.preserveTabOrder&&W.portalNode)if(h&&(K.current=!0),ft(e,W.portalNode)){const e=at(k);null==e||e.focus()}else{var t;null==(t=W.afterOutsideRef.current)||t.focus()}}})]})}let dr=0;const mr="--floating-ui-scrollbar-width";let pr=()=>{};const vr=e.forwardRef((function(e,t){const{lockScroll:r=!1,...o}=e;return Xe((()=>{if(r)return dr++,1===dr&&(pr=function(){const e=Ie(),t=/iP(hone|ad|od)|iOS/.test(e)||"MacIntel"===e&&navigator.maxTouchPoints>1,n=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,i=n.left?parseFloat(n.left):window.scrollX,u=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(mr,o+"px"),o&&(n[r]=o+"px"),t){var c,l;const e=(null==(c=window.visualViewport)?void 0:c.offsetLeft)||0,t=(null==(l=window.visualViewport)?void 0:l.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(u-Math.floor(t))+"px",left:-(i-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[r]:""}),n.removeProperty(mr),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(i,u))}}()),()=>{dr--,0===dr&&pr()}}),[r]),n("div",{ref:t,...o,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}})}));function gr(e){return d(e.target)&&"BUTTON"===e.target.tagName}function hr(e){return Be(e)}function yr(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,elements:{domReference:u}}=t,{enabled:c=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0,stickIfOpen:m=!0}=n,p=e.useRef(),v=e.useRef(!1),g=e.useMemo((()=>({onPointerDown(e){p.current=e.pointerType},onMouseDown(e){const t=p.current;0===e.button&&"click"!==l&&(Ue(t,!0)&&a||(!r||!s||i.current.openEvent&&m&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),o(!0,e.nativeEvent,"click")):o(!1,e.nativeEvent,"click")))},onClick(e){const t=p.current;"mousedown"===l&&p.current?p.current=void 0:Ue(t,!0)&&a||(!r||!s||i.current.openEvent&&m&&"click"!==i.current.openEvent.type?o(!0,e.nativeEvent,"click"):o(!1,e.nativeEvent,"click"))},onKeyDown(e){p.current=void 0,e.defaultPrevented||!f||gr(e)||(" "!==e.key||hr(u)||(e.preventDefault(),v.current=!0),function(e){return d(e.target)&&"A"===e.target.tagName}(e)||"Enter"===e.key&&o(!r||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!f||gr(e)||hr(u)||" "===e.key&&v.current&&(v.current=!1,o(!r||!s,e.nativeEvent,"click"))}})),[i,u,l,a,f,o,r,m,s]);return e.useMemo((()=>c?{reference:g}:{}),[c,g])}const wr={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},br={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},xr=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 Rr(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:u}=t,{enabled:c=!0,escapeKey:l=!0,outsidePress:s=!0,outsidePressEvent:a="pointerdown",referencePress:m=!1,referencePressEvent:p="pointerdown",ancestorScroll:v=!1,bubbles:g,capture:h}=n,y=On(),w=Ge("function"==typeof s?s:()=>!1),b="function"==typeof s?w:s,x=e.useRef(!1),{escapeKey:R,outsidePress:E}=xr(g),{escapeKey:I,outsidePress:M}=xr(h),T=e.useRef(!1),O=Ge((e=>{var t;if(!r||!c||!l||"Escape"!==e.key)return;if(T.current)return;const n=null==(t=u.current.floatingContext)?void 0:t.nodeId,i=y?He(y.nodesRef.current,n):[];if(!R&&(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}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),P=Ge((e=>{var t;const n=()=>{var t;O(e),null==(t=De(e))||t.removeEventListener("keydown",n)};null==(t=De(e))||t.addEventListener("keydown",n)})),N=Ge((e=>{var t;const n=u.current.insideReactTree;u.current.insideReactTree=!1;const r=x.current;if(x.current=!1,"click"===a&&r)return;if(n)return;if("function"==typeof b&&!b(e))return;const c=De(e),l="["+Fn("inert")+"]",s=We(i.floating).querySelectorAll(l);let m=f(c)?c:null;for(;m&&!C(m);){const e=L(m);if(C(e)||!f(e))break;m=e}if(s.length&&f(c)&&!c.matches("html,body")&&!Ne(c,i.floating)&&Array.from(s).every((e=>!Ne(m,e))))return;if(d(c)&&W){const t=C(c),n=S(c),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),u=o&&c.clientWidth>0&&c.scrollWidth>c.clientWidth,l=i&&c.clientHeight>0&&c.scrollHeight>c.clientHeight,s="rtl"===n.direction,a=l&&(s?e.offsetX<=c.offsetWidth-c.clientWidth:e.offsetX>c.clientWidth),f=u&&e.offsetY>c.clientHeight;if(a||f)return}const p=null==(t=u.current.floatingContext)?void 0:t.nodeId,v=y&&He(y.nodesRef.current,p).some((t=>{var n;return Fe(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Fe(e,i.floating)||Fe(e,i.domReference)||v)return;const g=y?He(y.nodesRef.current,p):[];if(g.length>0){let e=!0;if(g.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),D=Ge((e=>{var t;const n=()=>{var t;N(e),null==(t=De(e))||t.removeEventListener(a,n)};null==(t=De(e))||t.addEventListener(a,n)}));e.useEffect((()=>{if(!r||!c)return;u.current.__escapeKeyBubbles=R,u.current.__outsidePressBubbles=E;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),T.current=!0}function s(){e=window.setTimeout((()=>{T.current=!1}),k()?5:0)}const d=We(i.floating);l&&(d.addEventListener("keydown",I?P:O,I),d.addEventListener("compositionstart",n),d.addEventListener("compositionend",s)),b&&d.addEventListener(a,M?D:N,M);let m=[];return v&&(f(i.domReference)&&(m=A(i.domReference)),f(i.floating)&&(m=m.concat(A(i.floating))),!f(i.reference)&&i.reference&&i.reference.contextElement&&(m=m.concat(A(i.reference.contextElement)))),m=m.filter((e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)})),m.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{l&&(d.removeEventListener("keydown",I?P:O,I),d.removeEventListener("compositionstart",n),d.removeEventListener("compositionend",s)),b&&d.removeEventListener(a,M?D:N,M),m.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[u,i,l,b,a,r,o,v,c,R,E,O,I,P,N,M,D]),e.useEffect((()=>{u.current.insideReactTree=!1}),[u,b,a]);const F=e.useMemo((()=>({onKeyDown:O,...m&&{[wr[p]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==p&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[O,o,m,p]),W=e.useMemo((()=>({onKeyDown:O,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[br[a]]:()=>{u.current.insideReactTree=!0}})),[O,a,u]);return e.useMemo((()=>c?{reference:F,floating:W}:{}),[c,F,W])}function Er(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=kn(),u=e.useRef({}),[c]=e.useState((()=>Mn())),l=null!=An();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!f(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=In)&&e.has(o)||(null==(i=In)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,a]=e.useState(o.reference),d=Ge(((e,t,n)=>{u.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:n,nested:l}),null==r||r(e,t,n)})),m=e.useMemo((()=>({setPositionReference:a})),[]),p=e.useMemo((()=>({reference:s||o.reference||null,floating:o.floating||null,domReference:o.reference})),[s,o.reference,o.floating]);return e.useMemo((()=>({dataRef:u,open:n,onOpenChange:d,elements:p,events:c,floatingId:i,refs:m})),[n,d,p,c,i,m])}function kr(t){void 0===t&&(t={});const{nodeId:n}=t,r=Er({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,u=o.elements,[c,l]=e.useState(null),[s,a]=e.useState(null),d=(null==u?void 0:u.domReference)||c,m=e.useRef(null),p=On();Xe((()=>{d&&(m.current=d)}),[d]);const v=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:u,elements:{reference:c,floating:l}={},transform:s=!0,whileElementsMounted:a,open:f}=t,[d,m]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[p,v]=e.useState(o);jt(p,o)||v(o);const[g,h]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==k.current&&(k.current=e,h(e))}),[]),x=e.useCallback((e=>{e!==I.current&&(I.current=e,w(e))}),[]),R=c||g,E=l||y,k=e.useRef(null),I=e.useRef(null),C=e.useRef(d),S=null!=a,M=Xt(a),L=Xt(u),T=Xt(f),A=e.useCallback((()=>{if(!k.current||!I.current)return;const e={placement:n,strategy:r,middleware:p};L.current&&(e.platform=L.current),Vt(k.current,I.current,e).then((e=>{const t={...e,isPositioned:!1!==T.current};O.current&&!jt(C.current,t)&&(C.current=t,i.flushSync((()=>{m(t)})))}))}),[p,n,r,L,T]);qt((()=>{!1===f&&C.current.isPositioned&&(C.current.isPositioned=!1,m((e=>({...e,isPositioned:!1}))))}),[f]);const O=e.useRef(!1);qt((()=>(O.current=!0,()=>{O.current=!1})),[]),qt((()=>{if(R&&(k.current=R),E&&(I.current=E),R&&E){if(M.current)return M.current(R,E,A);A()}}),[R,E,A,M,S]);const P=e.useMemo((()=>({reference:k,floating:I,setReference:b,setFloating:x})),[b,x]),N=e.useMemo((()=>({reference:R,floating:E})),[R,E]),D=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!N.floating)return e;const t=Ut(N.floating,d.x),n=Ut(N.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...zt(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,s,N.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:A,refs:P,elements:N,floatingStyles:D})),[d,A,P,N,D])}({...t,elements:{...u,...s&&{reference:s}}}),g=e.useCallback((e=>{const t=f(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;a(t),v.refs.setReference(t)}),[v.refs]),h=e.useCallback((e=>{(f(e)||null===e)&&(m.current=e,l(e)),(f(v.refs.reference.current)||null===v.refs.reference.current||null!==e&&!f(e))&&v.refs.setReference(e)}),[v.refs]),y=e.useMemo((()=>({...v.refs,setReference:h,setPositionReference:g,domReference:m})),[v.refs,h,g]),w=e.useMemo((()=>({...v.elements,domReference:d})),[v.elements,d]),b=e.useMemo((()=>({...v,...o,refs:y,elements:w,nodeId:n})),[v,y,w,n,o]);return Xe((()=>{o.dataRef.current.floatingContext=b;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=b)})),e.useMemo((()=>({...v,context:b,refs:y,elements:w})),[v,y,w,b])}function Ir(){return Ie().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&Se()}function Cr(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,dataRef:u,elements:c}=t,{enabled:s=!0,visibleOnly:a=!0}=n,m=e.useRef(!1),p=e.useRef(-1),v=e.useRef(!0);e.useEffect((()=>{if(!s)return;const e=l(c.domReference);function t(){!r&&d(c.domReference)&&c.domReference===Pe(We(c.domReference))&&(m.current=!0)}function n(){v.current=!0}function o(){v.current=!1}return e.addEventListener("blur",t),Ir()&&(e.addEventListener("keydown",n,!0),e.addEventListener("pointerdown",o,!0)),()=>{e.removeEventListener("blur",t),Ir()&&(e.removeEventListener("keydown",n,!0),e.removeEventListener("pointerdown",o,!0))}}),[c.domReference,r,s]),e.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||(m.current=!0)}}),[i,s]),e.useEffect((()=>()=>{Wn(p)}),[]);const g=e.useMemo((()=>({onMouseLeave(){m.current=!1},onFocus(e){if(m.current)return;const t=De(e.nativeEvent);if(a&&f(t))if(Ir()&&!e.relatedTarget){if(!v.current&&!Be(t))return}else if(!function(e){if(!e||Le())return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(t))return;o(!0,e.nativeEvent,"focus")},onBlur(e){m.current=!1;const t=e.relatedTarget,n=e.nativeEvent,r=f(t)&&t.hasAttribute(Fn("focus-guard"))&&"outside"===t.getAttribute("data-type");p.current=window.setTimeout((()=>{var e;const i=Pe(c.domReference?c.domReference.ownerDocument:document);(t||i!==c.domReference)&&(Ne(null==(e=u.current.floatingContext)?void 0:e.refs.floating.current,i)||Ne(c.domReference,i)||r||o(!1,n,"focus"))}))}})),[u,c.domReference,o,a]);return e.useMemo((()=>s?{reference:g}:{}),[s,g])}function Sr(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[cn]:t,[ln]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[un]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var u;o&&[cn,ln].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(u=r.get(n))||u.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}function Mr(t){void 0===t&&(t=[]);const n=t.map((e=>null==e?void 0:e.reference)),r=t.map((e=>null==e?void 0:e.floating)),o=t.map((e=>null==e?void 0:e.item)),i=e.useCallback((e=>Sr(e,t,"reference")),n),u=e.useCallback((e=>Sr(e,t,"floating")),r),c=e.useCallback((e=>Sr(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:u,getItemProps:c})),[i,u,c])}function Lr(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Tr(e,t){return Lr(t,e===fn||e===dn,e===sn||e===an)}function Ar(e,t,n){return Lr(t,e===dn,n?e===sn:e===an)||"Enter"===e||" "===e||""===e}function Or(e,t,n){return Lr(t,n?e===sn:e===an,e===dn)}function Pr(e,t,n,r){return"both"===t||"horizontal"===t&&r&&r>1?"Escape"===e:Lr(t,n?e===an:e===sn,e===fn)}function Nr(t,n){const{open:r,onOpenChange:o,elements:i,floatingId:u}=t,{listRef:c,activeIndex:l,onNavigate:s=()=>{},enabled:a=!0,selectedIndex:f=null,allowEscape:m=!1,loop:p=!1,nested:v=!1,rtl:g=!1,virtual:h=!1,focusItemOnOpen:y="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:b=!0,disabledIndices:x,orientation:R="vertical",parentOrientation:E,cols:k=1,scrollItemIntoView:I=!0,virtualItemRef:C,itemSizes:S,dense:M=!1}=n;"production"!==process.env.NODE_ENV&&(m&&(p||Cn("`useListNavigation` looping must be enabled to allow escaping."),h||Cn("`useListNavigation` must be virtual to allow escaping.")),"vertical"===R&&k>1&&Cn("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const L=Ye(Ke(i.floating)),T=An(),A=On();Xe((()=>{t.dataRef.current.orientation=R}),[t,R]);const O=Ge((()=>{s(-1===D.current?null:D.current)})),P=_e(i.domReference),N=e.useRef(y),D=e.useRef(null!=f?f:-1),F=e.useRef(null),W=e.useRef(!0),B=e.useRef(O),_=e.useRef(!!i.floating),K=e.useRef(r),H=e.useRef(!1),V=e.useRef(!1),q=Ye(x),j=Ye(r),z=Ye(I),U=Ye(f),[X,Y]=e.useState(),[$,G]=e.useState(),Q=Ge((()=>{function e(e){var t;h?(null!=(t=e.id)&&t.endsWith("-fui-option")&&(e.id=u+"-"+Math.random().toString(16).slice(2,10)),Y(e.id),null==A||A.events.emit("virtualfocus",e),C&&(C.current=e)):qn(e,{sync:H.current,preventScroll:!0})}const t=c.current[D.current],n=V.current;t&&e(t);(H.current?e=>e():requestAnimationFrame)((()=>{const r=c.current[D.current]||t;if(!r)return;t||e(r);const o=z.current;o&&J&&(n||!W.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof o?{block:"nearest",inline:"nearest"}:o))}))}));Xe((()=>{a&&(r&&i.floating?N.current&&null!=f&&(V.current=!0,D.current=f,O()):_.current&&(D.current=-1,B.current()))}),[a,r,i.floating,f,O]),Xe((()=>{if(a&&r&&i.floating)if(null==l){if(H.current=!1,null!=U.current)return;if(_.current&&(D.current=-1,Q()),(!K.current||!_.current)&&N.current&&(null!=F.current||!0===N.current&&null==F.current)){let e=0;const t=()=>{if(null==c.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else D.current=null==F.current||Ar(F.current,R,g)||v?Je(c,q.current):et(c,q.current),F.current=null,O()};t()}}else Ze(c,l)||(D.current=l,Q(),V.current=!1)}),[a,r,i.floating,l,U,v,c,R,g,O,Q,q]),Xe((()=>{var e;if(!a||i.floating||!A||h||!_.current)return;const t=A.nodesRef.current,n=null==(e=t.find((e=>e.id===T)))||null==(e=e.context)?void 0:e.elements.floating,r=Pe(We(i.floating)),o=t.some((e=>e.context&&Ne(e.context.elements.floating,r)));n&&!o&&W.current&&n.focus({preventScroll:!0})}),[a,i.floating,A,T,h]),Xe((()=>{if(a&&A&&h&&!T)return A.events.on("virtualfocus",e),()=>{A.events.off("virtualfocus",e)};function e(e){G(e.id),C&&(C.current=e)}}),[a,A,h,T,C]),Xe((()=>{B.current=O,K.current=r,_.current=!!i.floating})),Xe((()=>{r||(F.current=null,N.current=y)}),[r,y]);const Z=null!=l,J=e.useMemo((()=>{function e(e){if(!j.current)return;const t=c.current.indexOf(e);-1!==t&&D.current!==t&&(D.current=t,O())}return{onFocus(t){let{currentTarget:n}=t;H.current=!0,e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},onMouseMove(t){let{currentTarget:n}=t;H.current=!0,V.current=!1,w&&e(n)},onPointerLeave(e){let{pointerType:t}=e;var n;W.current&&"touch"!==t&&(H.current=!0,w&&(D.current=-1,O(),h||null==(n=L.current)||n.focus({preventScroll:!0})))}}}),[j,L,w,c,O,h]),ee=e.useCallback((()=>{var e;return null!=E?E:null==A||null==(e=A.nodesRef.current.find((e=>e.id===T)))||null==(e=e.context)||null==(e=e.dataRef)?void 0:e.current.orientation}),[T,A,E]),te=Ge((e=>{if(W.current=!1,H.current=!0,229===e.which)return;if(!j.current&&e.currentTarget===L.current)return;if(v&&Pr(e.key,R,g,k))return Tr(e.key,ee())||qe(e),o(!1,e.nativeEvent,"list-navigation"),void(d(i.domReference)&&(h?null==A||A.events.emit("virtualfocus",i.domReference):i.domReference.focus()));const t=D.current,n=Je(c,x),u=et(c,x);if(P||("Home"===e.key&&(qe(e),D.current=n,O()),"End"===e.key&&(qe(e),D.current=u,O())),k>1){const t=S||Array.from({length:c.current.length},(()=>({width:1,height:1}))),r=rt(t,k,M),o=r.findIndex((e=>null!=e&&!ut(c,e,x))),i=r.reduce(((e,t,n)=>null==t||ut(c,t,x)?e:n),-1),l=r[nt({current:r.map((e=>null!=e?c.current[e]:null))},{event:e,orientation:R,loop:p,rtl:g,cols:k,disabledIndices:it([...("function"!=typeof x?x:null)||c.current.map(((e,t)=>ut(c,t,x)?t:void 0)),void 0],r),minIndex:o,maxIndex:i,prevIndex:ot(D.current>u?n:D.current,t,r,k,e.key===dn?"bl":e.key===(g?sn:an)?"tr":"tl"),stopEvent:!0})];if(null!=l&&(D.current=l,O()),"both"===R)return}if(Tr(e.key,R)){if(qe(e),r&&!h&&Pe(e.currentTarget.ownerDocument)===e.currentTarget)return D.current=Ar(e.key,R,g)?n:u,void O();Ar(e.key,R,g)?D.current=p?t>=u?m&&t!==c.current.length?-1:n:tt(c,{startingIndex:t,disabledIndices:x}):Math.min(u,tt(c,{startingIndex:t,disabledIndices:x})):D.current=p?t<=n?m&&-1!==t?c.current.length:u:tt(c,{startingIndex:t,decrement:!0,disabledIndices:x}):Math.max(n,tt(c,{startingIndex:t,decrement:!0,disabledIndices:x})),Ze(c,D.current)&&(D.current=-1),O()}})),ne=e.useMemo((()=>h&&r&&Z&&{"aria-activedescendant":$||X}),[h,r,Z,$,X]),re=e.useMemo((()=>({"aria-orientation":"both"===R?void 0:R,...P?{}:ne,onKeyDown:te,onPointerMove(){W.current=!0}})),[ne,te,R,P]),oe=e.useMemo((()=>{function e(e){"auto"===y&&je(e.nativeEvent)&&(N.current=!0)}function t(e){N.current=y,"auto"===y&&ze(e.nativeEvent)&&(N.current=!0)}return{...ne,onKeyDown(e){W.current=!1;const t=e.key.startsWith("Arrow"),n=["Home","End"].includes(e.key),i=t||n,u=Or(e.key,R,g),l=Pr(e.key,R,g,k),s=Or(e.key,ee(),g),a=Tr(e.key,R),d=(v?s:a)||"Enter"===e.key||""===e.key.trim();if(h&&r){const t=null==A?void 0:A.nodesRef.current.find((e=>null==e.parentId)),r=A&&t?function(e,t){let n,r=-1;return function t(o,i){i>r&&(n=o,r=i),He(e,o).forEach((e=>{t(e.id,i+1)}))}(t,0),e.find((e=>e.id===n))}(A.nodesRef.current,t.id):null;if(i&&r&&C){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(u||l){var m,p;const n=(null==(m=r.context)?void 0:m.elements.domReference)===e.currentTarget,o=l&&!n?null==(p=r.context)?void 0:p.elements.domReference:u?c.current.find((e=>(null==e?void 0:e.id)===X)):null;o&&(qe(e),o.dispatchEvent(t),G(void 0))}var y;if((a||n)&&r.context)if(r.context.open&&r.parentId&&e.currentTarget!==r.context.elements.domReference)return qe(e),void(null==(y=r.context.elements.domReference)||y.dispatchEvent(t))}return te(e)}if(r||b||!t){if(d){const t=Tr(e.key,ee());F.current=v&&t?null:e.key}v?s&&(qe(e),r?(D.current=Je(c,q.current),O()):o(!0,e.nativeEvent,"list-navigation")):a&&(null!=f&&(D.current=f),qe(e),!r&&b?o(!0,e.nativeEvent,"list-navigation"):te(e),r&&O())}},onFocus(){r&&!h&&(D.current=-1,O())},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}}),[X,ne,k,te,q,y,c,v,O,o,r,b,R,ee,g,f,A,h,C]);return e.useMemo((()=>a?{reference:oe,floating:re,item:J}:{}),[a,oe,re,J])}const Dr=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Fr(t,n){var r,o;void 0===n&&(n={});const{open:i,elements:u,floatingId:c}=t,{enabled:l=!0,role:s="dialog"}=n,a=kn(),f=(null==(r=u.domReference)?void 0:r.id)||a,d=e.useMemo((()=>{var e;return(null==(e=Ke(u.floating))?void 0:e.id)||c}),[u.floating,c]),m=null!=(o=Dr.get(s))?o:s,p=null!=An(),v=e.useMemo((()=>"tooltip"===m||"label"===s?{["aria-"+("label"===s?"labelledby":"describedby")]:i?d:void 0}:{"aria-expanded":i?"true":"false","aria-haspopup":"alertdialog"===m?"dialog":m,"aria-controls":i?d:void 0,..."listbox"===m&&{role:"combobox"},..."menu"===m&&{id:f},..."menu"===m&&p&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}}),[m,d,p,i,f,s]),g=e.useMemo((()=>{const e={id:d,...m&&{role:m}};return"tooltip"===m||"label"===s?e:{...e,..."menu"===m&&{"aria-labelledby":f}}}),[m,d,f,s]),h=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:d+"-fui-option"}};switch(s){case"select":case"combobox":return{...r,"aria-selected":n}}return{}}),[d,s]);return e.useMemo((()=>l?{reference:v,floating:g,item:h}:{}),[l,v,g,h])}function Wr(t,n){var r;const{open:o,dataRef:i}=t,{listRef:u,activeIndex:c,onMatch:l,onTypingChange:s,enabled:a=!0,findMatch:f=null,resetMs:d=750,ignoreKeys:m=[],selectedIndex:p=null}=n,v=e.useRef(-1),g=e.useRef(""),h=e.useRef(null!=(r=null!=p?p:c)?r:-1),y=e.useRef(null),w=Ge(l),b=Ge(s),x=Ye(f),R=Ye(m);Xe((()=>{o&&(Wn(v),y.current=null,g.current="")}),[o]),Xe((()=>{var e;o&&""===g.current&&(h.current=null!=(e=null!=p?p:c)?e:-1)}),[o,p,c]);const E=Ge((e=>{e?i.current.typing||(i.current.typing=e,b(e)):i.current.typing&&(i.current.typing=e,b(e))})),k=Ge((e=>{function t(e,t,n){const r=x.current?x.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}const n=u.current;if(g.current.length>0&&" "!==g.current[0]&&(-1===t(n,n,g.current)?E(!1):" "===e.key&&qe(e)),null==n||R.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;o&&" "!==e.key&&(qe(e),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())}))&&g.current===e.key&&(g.current="",h.current=y.current),g.current+=e.key,Wn(v),v.current=window.setTimeout((()=>{g.current="",h.current=y.current,E(!1)}),d);const r=h.current,i=t(n,[...n.slice((r||0)+1),...n.slice(0,(r||0)+1)],g.current);-1!==i?(w(i),y.current=i):" "!==e.key&&(g.current="",E(!1))})),I=e.useMemo((()=>({onKeyDown:k})),[k]),C=e.useMemo((()=>({onKeyDown:k,onKeyUp(e){" "===e.key&&E(!1)}})),[k,E]);return e.useMemo((()=>a?{reference:I,floating:C}:{}),[a,I,C])}function Br(e,t,n){void 0===n&&(n=!0);return e.filter((e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))})).flatMap((t=>[t,...Br(e,t.id,n)]))}function _r(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,u=i-1;e<i;u=e++){const[i,c]=t[e]||[0,0],[l,s]=t[u]||[0,0];c>=r!=s>=r&&n<=(l-i)*(r-c)/(s-c)+i&&(o=!o)}return o}function Kr(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,o={current:-1};let i=!1,u=null,c=null,l="undefined"!=typeof performance?performance.now():0;const s=e=>{let{x:n,y:s,placement:a,elements:d,onClose:m,nodeId:p,tree:v}=e;return function(e){function g(){Wn(o),m()}if(Wn(o),!d.domReference||!d.floating||null==a||null==n||null==s)return;const{clientX:h,clientY:y}=e,w=[h,y],b=function(e){return"composedPath"in e?e.composedPath()[0]:e.target}(e),x="mouseleave"===e.type,R=jn(d.floating,b),E=jn(d.domReference,b),k=d.domReference.getBoundingClientRect(),I=d.floating.getBoundingClientRect(),C=a.split("-")[0],S=n>I.right-I.width/2,M=s>I.bottom-I.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}(w,k),T=I.width>k.width,A=I.height>k.height,O=(T?k:I).left,P=(T?k:I).right,N=(A?k:I).top,D=(A?k:I).bottom;if(R&&(i=!0,!x))return;if(E&&(i=!1),E&&!x)return void(i=!0);if(x&&f(e.relatedTarget)&&jn(d.floating,e.relatedTarget))return;if(v&&Br(v.nodesRef.current,p).length)return;if("top"===C&&s>=k.bottom-1||"bottom"===C&&s<=k.top+1||"left"===C&&n>=k.right-1||"right"===C&&n<=k.left+1)return g();let F=[];switch(C){case"top":F=[[O,k.top+1],[O,I.bottom-1],[P,I.bottom-1],[P,k.top+1]];break;case"bottom":F=[[O,I.top+1],[O,k.bottom-1],[P,k.bottom-1],[P,I.top+1]];break;case"left":F=[[I.right-1,D],[I.right-1,N],[k.left+1,N],[k.left+1,D]];break;case"right":F=[[k.right-1,D],[k.right-1,N],[I.left+1,N],[I.left+1,D]]}if(!_r([h,y],F)){if(i&&!L)return g();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===u||null===c||0===r)return u=e,c=t,l=n,null;const o=e-u,i=t-c,s=Math.sqrt(o*o+i*i);return u=e,c=t,l=n,s/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return g()}_r([h,y],function(e){let[n,r]=e;switch(C){case"top":return[[T?n+t/2:S?n+4*t:n-4*t,r+t+1],[T?n-t/2:S?n+4*t:n-4*t,r+t+1],...[[I.left,S||T?I.bottom-t:I.top],[I.right,S?T?I.bottom-t:I.top:I.bottom-t]]];case"bottom":return[[T?n+t/2:S?n+4*t:n-4*t,r-t],[T?n-t/2:S?n+4*t:n-4*t,r-t],...[[I.left,S||T?I.top+t:I.bottom],[I.right,S?T?I.top+t:I.bottom:I.top+t]]];case"left":{const e=[n+t+1,A?r+t/2:M?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:M?r+4*t:r-4*t];return[...[[M||A?I.right-t:I.left,I.top],[M?A?I.right-t:I.left:I.right-t,I.bottom]],e,o]}case"right":return[[n-t,A?r+t/2:M?r+4*t:r-4*t],[n-t,A?r-t/2:M?r+4*t:r-4*t],...[[M||A?I.left+t:I.right,I.top],[M?A?I.left+t:I.right:I.left+t,I.bottom]]]}}([n,s]))?!i&&r&&(o.current=window.setTimeout(g,40)):g()}}};return s.__options={blockPointerEvents:n},s}export{fr as A,vr as B,wn as C,rr as D,Dn as F,kr as a,kn as b,yn as c,Hn as d,Rr as e,Qt as f,Mr as g,Zt as h,Cr as i,Fr as j,Jt as k,Nn as l,On as m,An as n,$t as o,Kr as p,Pn as q,Sn as r,Gt as s,on as t,en as u,Wr as v,yr as w,rn as x,Nr as y,Ft as z};
@@ -1 +0,0 @@
1
- 'use client';import{a as s,b as a,C as e,c as o,u as t,o as i,h as u,s as r,f as n,d as l,e as g,g as F,i as d,j as f,k as c,F as m,l as p,m as I,n as h,p as v,q as y,r as C,t as N,v as w,w as L,x as P,y as T,z as j,A as k,B as x,D as A}from"./floating-ui.react-DMgxgTKq.js";const D={Portal:A,Overlay:x,FocusManager:k,useFloating:s,autoUpdate:j,useListNavigation:T,FloatingList:P,useClick:L,useTypeahead:w,useListItem:N,Arrow:C,useFloatingNodeId:y,safePolygon:v,useFloatingParentNodeId:h,useFloatingTree:I,FloatingNode:p,FloatingTree:m,arrow:c,useRole:f,useFocus:d,useInteractions:F,useDismiss:g,useHover:l,flip:n,shift:r,hide:u,offset:i,useMergeRefs:t,Composite:o,CompositeItem:e,useId:a};export{D as F};