@iress-oss/ids-components 0.0.1-dev.2 → 0.0.1-dev.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/README.md +1 -1
  2. package/dist/{AutocompleteNoResults-ImNh0dmJ.js → AutocompleteNoResults-CogA3XZs.js} +1 -1
  3. package/dist/{ComboboxHiddenInput-BVhoQtv3.js → ComboboxHiddenInput-gTOjjF3f.js} +5 -5
  4. package/dist/{FieldAppendToLabel-CY2e0YuF.js → FieldAppendToLabel-DCv5E5th.js} +13 -11
  5. package/dist/{InputBase-LsLk3nX1.js → InputBase-BFK9n82f.js} +1 -1
  6. package/dist/Loading.module-g2pe-Gfx.js +13 -0
  7. package/dist/LoadingSuspense-BwlrIicY.js +5773 -0
  8. package/dist/LogoFromSrc-BnImWqt6.js +59 -0
  9. package/dist/MenuItem.module-BxcFZeSh.js +24 -0
  10. package/dist/Popover.module-BKrF_xRW.js +11 -0
  11. package/dist/PopoverProvider-d3hhpW2k.js +142 -0
  12. package/dist/{SelectControl-BJo08wJN.js → SelectControl-D1SJlplM.js} +1 -1
  13. package/dist/SlideoutProvider-CQh140HM.js +200 -0
  14. package/dist/{SliderTicks-MkaJGb9A.js → SliderTicks-DQN0Ka4d.js} +1 -1
  15. package/dist/TabSet.module-FRUnHgA1.js +13 -0
  16. package/dist/Table.module-r-RfIeLI.js +32 -0
  17. package/dist/components/Alert/Alert.js +1 -1
  18. package/dist/components/Alert/index.js +1 -1
  19. package/dist/components/Autocomplete/Autocomplete.js +8 -6
  20. package/dist/components/Autocomplete/components/AutocompleteInstructions.js +12 -0
  21. package/dist/components/Autocomplete/components/AutocompleteNoResults.js +1 -1
  22. package/dist/components/Autocomplete/hooks/useAutocompleteSearch.js +160 -95
  23. package/dist/components/Autocomplete/index.js +1 -1
  24. package/dist/components/Badge/Badge.js +4 -4
  25. package/dist/components/Button/Button.js +2 -2
  26. package/dist/components/Button/CloseButton/CloseButton.js +1 -1
  27. package/dist/components/Button/index.js +1 -1
  28. package/dist/components/ButtonGroup/ButtonGroup.js +2 -2
  29. package/dist/components/ButtonGroup/hooks/useIDSButtonGroupItem.js +1 -1
  30. package/dist/components/ButtonGroup/index.js +1 -1
  31. package/dist/components/Checkbox/Checkbox.js +1 -1
  32. package/dist/components/Checkbox/helpers/mapCheckboxGroupOptions.js +1 -1
  33. package/dist/components/Checkbox/index.js +1 -1
  34. package/dist/components/CheckboxGroup/CheckboxGroup.js +6 -6
  35. package/dist/components/CheckboxMark/CheckboxMark.types.js +2 -2
  36. package/dist/components/Combobox/Combobox.js +7 -5
  37. package/dist/components/Combobox/MultiCombobox/MultiCombobox.js +7 -5
  38. package/dist/components/Combobox/components/ComboboxHiddenInput.js +1 -1
  39. package/dist/components/Combobox/components/ComboboxResults.js +8 -6
  40. package/dist/components/Combobox/components/ComboboxResultsDescriptor.js +6 -4
  41. package/dist/components/Combobox/index.js +1 -1
  42. package/dist/components/Expander/Expander.js +1 -1
  43. package/dist/components/Field/Field.js +1 -1
  44. package/dist/components/Field/FieldGroup/FieldGroup.js +2 -2
  45. package/dist/components/Field/components/FieldAppendToLabel.js +7 -5
  46. package/dist/components/Filter/Filter.js +7 -5
  47. package/dist/components/Filter/components/FilterResetButton.js +6 -4
  48. package/dist/components/Filter/components/FilterSearch.js +6 -4
  49. package/dist/components/Filter/index.js +1 -1
  50. package/dist/components/Form/Form.js +1 -1
  51. package/dist/components/Form/FormField/FormField.js +45 -39
  52. package/dist/components/Form/FormField/FormFieldset.js +13 -11
  53. package/dist/components/Form/HookForm/HookForm.js +1 -1
  54. package/dist/components/Form/index.js +1 -1
  55. package/dist/components/Hide/Hide.js +1 -1
  56. package/dist/components/Hide/helpers/composeHideClasses.js +7 -5
  57. package/dist/components/Hide/index.js +1 -1
  58. package/dist/components/Icon/Icon.js +6 -4
  59. package/dist/components/Icon/index.js +1 -1
  60. package/dist/components/Inline/Inline.js +6 -4
  61. package/dist/components/Inline/index.js +1 -1
  62. package/dist/components/Input/ClearButton/ClearButton.js +1 -1
  63. package/dist/components/Input/Input.js +2 -2
  64. package/dist/components/Input/InputBase/InputBase.js +1 -1
  65. package/dist/components/Input/index.js +1 -1
  66. package/dist/components/InputCurrency/InputCurrency.js +1 -1
  67. package/dist/components/InputCurrency/index.js +1 -1
  68. package/dist/components/Label/LabelBase/LabelBase.js +1 -1
  69. package/dist/components/Menu/Menu.js +1 -1
  70. package/dist/components/Menu/MenuDivider/MenuDivider.js +6 -4
  71. package/dist/components/Menu/MenuHeading/MenuHeading.js +2 -2
  72. package/dist/components/Menu/MenuItem/MenuItem.js +1 -1
  73. package/dist/components/Menu/MenuItem/hooks/useMenuItemButtonProps.js +1 -1
  74. package/dist/components/Menu/MenuItem/hooks/useMenuItemComposite.js +2 -2
  75. package/dist/components/Menu/MenuItem/hooks/useMenuItemInteractions.js +41 -41
  76. package/dist/components/Menu/MenuText/MenuText.js +7 -5
  77. package/dist/components/Menu/helpers/mapMenuItems.js +1 -1
  78. package/dist/components/Menu/hooks/useMenuStyles.js +3 -3
  79. package/dist/components/Menu/index.js +1 -1
  80. package/dist/components/Modal/Modal.js +2 -2
  81. package/dist/components/Modal/hooks/useModal.js +17 -14
  82. package/dist/components/Modal/index.js +1 -1
  83. package/dist/components/Navbar/Navbar.js +2 -2
  84. package/dist/components/Navbar/components/HomeLinkContent.js +2 -2
  85. package/dist/components/Navbar/components/LogoFromSrc.js +1 -1
  86. package/dist/components/Navbar/components/NavbarLogo.js +2 -2
  87. package/dist/components/Navbar/index.js +1 -1
  88. package/dist/components/Placeholder/Placeholder.js +1 -1
  89. package/dist/components/Popover/InputPopover/InputPopover.js +36 -34
  90. package/dist/components/Popover/InputPopover/InputPopoverActivator.js +1 -1
  91. package/dist/components/Popover/InputPopover/InputPopoverProvider.js +72 -66
  92. package/dist/components/Popover/Popover.js +32 -30
  93. package/dist/components/Popover/PopoverProvider.js +13 -111
  94. package/dist/components/Popover/components/NestedPopoverActivator.js +9 -0
  95. package/dist/components/Popover/components/PopoverActivator.js +40 -41
  96. package/dist/components/Popover/components/PopoverContent.js +15 -15
  97. package/dist/components/Popover/helpers/composeFloatingProps.js +26 -22
  98. package/dist/components/Popover/helpers/handlePopoverTabKey.js +16 -13
  99. package/dist/components/Popover/helpers/waitUntilTrue.js +12 -0
  100. package/dist/components/Popover/hooks/usePopover.js +1 -1
  101. package/dist/components/Popover/hooks/usePopoverActivatorInteractions.js +25 -17
  102. package/dist/components/Popover/hooks/usePopoverItem.js +1 -1
  103. package/dist/components/Popover/hooks/usePopoverNavigation.js +1 -1
  104. package/dist/components/Progress/Progress.js +1 -1
  105. package/dist/components/Provider/Provider.js +38 -0
  106. package/dist/components/Provider/index.js +4 -0
  107. package/dist/components/Radio/Radio.js +1 -1
  108. package/dist/components/Radio/helpers/mapRadioGroupOptions.js +1 -1
  109. package/dist/components/Radio/index.js +1 -1
  110. package/dist/components/RadioGroup/RadioGroup.js +3 -3
  111. package/dist/components/Readonly/Readonly.js +7 -5
  112. package/dist/components/Readonly/index.js +1 -1
  113. package/dist/components/RichSelect/RichSelect.js +6 -4
  114. package/dist/components/RichSelect/SelectBody/SelectBody.js +7 -5
  115. package/dist/components/RichSelect/SelectCreate/SelectCreate.js +11 -9
  116. package/dist/components/RichSelect/SelectHeading/SelectHeading.js +6 -4
  117. package/dist/components/RichSelect/SelectLabel/SelectLabel.js +1 -1
  118. package/dist/components/RichSelect/SelectMenu/SelectMenu.js +6 -4
  119. package/dist/components/RichSelect/SelectMenu/SelectMenuItem.js +6 -4
  120. package/dist/components/RichSelect/SelectSearch/SelectSearch.js +5 -3
  121. package/dist/components/RichSelect/SelectSearchInput/SelectSearchInput.js +1 -1
  122. package/dist/components/RichSelect/SelectTags/SelectTags.js +5 -3
  123. package/dist/components/RichSelect/components/SelectActivator.js +1 -1
  124. package/dist/components/RichSelect/components/SelectOptions.js +6 -4
  125. package/dist/components/RichSelect/index.js +1 -1
  126. package/dist/components/Row/Row.js +6 -4
  127. package/dist/components/Row/index.js +1 -1
  128. package/dist/components/Select/Select.js +2 -2
  129. package/dist/components/Select/components/SelectControl.js +1 -1
  130. package/dist/components/Select/components/SelectReadonly.js +6 -4
  131. package/dist/components/Select/helpers/mapSelectOptions.js +1 -1
  132. package/dist/components/Select/helpers/nodesToSelectOptions.js +3 -3
  133. package/dist/components/Select/index.js +1 -1
  134. package/dist/components/Skeleton/Skeleton.js +2 -2
  135. package/dist/components/SkipLink/SkipLink.js +1 -1
  136. package/dist/components/Slideout/Slideout.js +5 -3
  137. package/dist/components/Slideout/SlideoutProvider.js +6 -89
  138. package/dist/components/Slideout/components/SlideoutInner.js +3 -2
  139. package/dist/components/Slideout/hooks/useIDSProvidedSlideout.js +1 -1
  140. package/dist/components/Slideout/hooks/useSlideout.js +17 -14
  141. package/dist/components/Slideout/index.js +7 -7
  142. package/dist/components/Slider/Slider.js +2 -2
  143. package/dist/components/Slider/components/SliderTicks.js +1 -1
  144. package/dist/components/Slider/index.js +1 -1
  145. package/dist/components/Spinner/Spinner.js +1 -1
  146. package/dist/components/Spinner/index.js +1 -1
  147. package/dist/components/TabSet/Tab/Tab.js +74 -62
  148. package/dist/components/TabSet/TabSet.js +2 -2
  149. package/dist/components/TabSet/components/TabSetItem.js +2 -2
  150. package/dist/components/Table/Table.js +4 -3
  151. package/dist/components/Table/TableBody/TableBody.js +2 -2
  152. package/dist/components/Table/TableProvider.js +29 -25
  153. package/dist/components/Table/components/TableEmpty.js +1 -1
  154. package/dist/components/Table/components/TableHeader.js +2 -2
  155. package/dist/components/Table/components/TableHeaderCell.js +2 -2
  156. package/dist/components/Table/components/TableRows.js +1 -1
  157. package/dist/components/Table/components/TableSortButton.js +2 -2
  158. package/dist/components/Table/helpers/composeIDSTableColumnDefs.js +5 -5
  159. package/dist/components/Table/hooks/useIDSTableColumnStyles.js +1 -1
  160. package/dist/components/Table/index.js +1 -1
  161. package/dist/components/Tag/Tag.js +1 -1
  162. package/dist/components/Tag/TagInput/TagInput.js +1 -1
  163. package/dist/components/Tag/components/TagListInput/TagListInput.js +1 -1
  164. package/dist/components/Tag/index.js +1 -1
  165. package/dist/components/Toaster/Toast/Toast.js +1 -1
  166. package/dist/components/Toaster/Toast/ToastAnimated.js +2 -2
  167. package/dist/components/Toaster/Toast/ToastIcon.js +1 -1
  168. package/dist/components/Toaster/Toaster.js +3 -3
  169. package/dist/components/Toaster/ToasterProvider.js +1 -1
  170. package/dist/components/Toaster/hooks/useToaster.js +24 -3
  171. package/dist/components/Toaster/index.js +11 -10
  172. package/dist/components/Toggle/Toggle.js +3 -3
  173. package/dist/components/Tooltip/Tooltip.js +18 -18
  174. package/dist/components/ValidationMessage/ValidationBase/ValidationBase.js +1 -1
  175. package/dist/components/ValidationMessage/ValidationSummary/ValidationSummary.js +1 -1
  176. package/dist/constants.js +11 -11
  177. package/dist/{floating-ui.react-D_ysmiM3.js → floating-ui.react-nmA48tb2.js} +1055 -1034
  178. package/dist/helpers/dom/closestCrossShadow.js +26 -0
  179. package/dist/helpers/dom/domUtils.js +12 -0
  180. package/dist/helpers/formatting/formatDateTime.js +21 -16
  181. package/dist/helpers/label-value/highlightQueryInLabelValue.js +6 -5
  182. package/dist/{index-CmsyHM_3.js → index-BQfnxwrU.js} +2 -2
  183. package/dist/{index-CtOScEKX.js → index-Dms7F5NM.js} +8 -8
  184. package/dist/main.js +185 -181
  185. package/dist/patterns/Loading/Loading.js +1 -1
  186. package/dist/patterns/Loading/LoadingSuspense.js +5 -49
  187. package/dist/patterns/Loading/components/ComponentLoading.js +2 -2
  188. package/dist/patterns/Loading/components/DefaultLoading.js +2 -2
  189. package/dist/patterns/Loading/components/LongLoading.js +2 -2
  190. package/dist/patterns/Loading/components/PageLoading.js +2 -2
  191. package/dist/patterns/Loading/components/StartUpLoading.js +2 -2
  192. package/dist/patterns/Loading/components/ValidateLoading.js +2 -2
  193. package/dist/patterns/Loading/index.js +3 -2
  194. package/dist/src/components/Autocomplete/Autocomplete.types.d.ts +38 -0
  195. package/dist/src/components/Autocomplete/components/AutocompleteInstructions.d.ts +2 -0
  196. package/dist/src/components/Autocomplete/hooks/useAutocompleteSearch.d.ts +5 -1
  197. package/dist/src/components/Form/Form.types.d.ts +10 -1
  198. package/dist/src/components/Form/FormField/FormField.d.ts +1 -1
  199. package/dist/src/components/Form/FormField/FormField.types.d.ts +8 -2
  200. package/dist/src/components/Modal/Modal.types.d.ts +4 -0
  201. package/dist/src/components/Popover/Popover.types.d.ts +3 -1
  202. package/dist/src/components/Popover/components/NestedPopoverActivator.d.ts +5 -0
  203. package/dist/src/components/Popover/helpers/handlePopoverTabKey.d.ts +1 -1
  204. package/dist/src/components/Popover/helpers/waitUntilTrue.d.ts +1 -0
  205. package/dist/src/components/Provider/Provider.d.ts +20 -0
  206. package/dist/src/components/Provider/index.d.ts +1 -0
  207. package/dist/src/components/RichSelect/RichSelect.types.d.ts +27 -1
  208. package/dist/src/components/RichSelect/SelectMenu/SelectMenuItem.d.ts +1 -1
  209. package/dist/src/components/RichSelect/components/SelectOptions.d.ts +4 -2
  210. package/dist/src/components/Slideout/Slideout.types.d.ts +5 -1
  211. package/dist/src/components/Table/Table.d.ts +7 -6
  212. package/dist/src/components/Table/Table.types.d.ts +10 -1
  213. package/dist/src/components/Table/TableProvider.d.ts +5 -2
  214. package/dist/src/components/Toaster/Toast/Toast.types.d.ts +2 -1
  215. package/dist/src/components/Toaster/ToasterProvider.d.ts +5 -2
  216. package/dist/src/components/Toaster/hooks/useToaster.d.ts +3 -3
  217. package/dist/src/constants.d.ts +7 -7
  218. package/dist/src/helpers/dom/closestCrossShadow.d.ts +9 -0
  219. package/dist/src/helpers/dom/domUtils.d.ts +5 -0
  220. package/dist/src/interfaces.d.ts +1 -0
  221. package/dist/src/main.d.ts +1 -0
  222. package/dist/src/patterns/Loading/LoadingSuspense.d.ts +1 -2
  223. package/dist/src/patterns/Loading/components/PageLoading.d.ts +3 -3
  224. package/dist/src/patterns/Loading/hooks/useShouldRenderLoading.d.ts +1 -0
  225. package/dist/src/patterns/Loading/index.d.ts +1 -0
  226. package/dist/style.css +1 -1
  227. package/dist/{useIDSButtonGroupItem-Y0ZSkNW8.js → useIDSButtonGroupItem-VfKx4O-O.js} +1 -1
  228. package/dist/vitest.config.d.ts +2 -0
  229. package/package.json +16 -28
  230. package/dist/Loading-rKDsRTjZ.js +0 -5638
  231. package/dist/Loading.module-C58kTwE4.js +0 -13
  232. package/dist/LogoFromSrc-KxC2Gztm.js +0 -59
  233. package/dist/MenuItem.module-3aqP1ZMw.js +0 -24
  234. package/dist/Popover.module-CLIdWyZD.js +0 -11
  235. package/dist/TabSet.module-DGDICWMf.js +0 -13
  236. package/dist/Table.module-Co33h7CZ.js +0 -32
  237. package/dist/components/Autocomplete/hooks/useAutocompleteFlags.js +0 -16
  238. package/dist/src/components/Autocomplete/hooks/useAutocompleteFlags.d.ts +0 -5
  239. /package/dist/{setupTests.d.ts → vitest.setup.d.ts} +0 -0
@@ -1,33 +1,33 @@
1
1
  import * as f from "react";
2
- import { useLayoutEffect as Vn, useEffect as Wn } from "react";
3
- import { t as At, i as $n, f as Or } from "./index.esm-BnSuefUA.js";
4
- import { jsx as me, jsxs as Bn, Fragment as Tr } from "react/jsx-runtime";
2
+ import { useLayoutEffect as $n } from "react";
3
+ import { t as At, i as Bn, f as Or } from "./index.esm-BnSuefUA.js";
4
+ import { jsx as ge, jsxs as Hn, Fragment as Ar } from "react/jsx-runtime";
5
5
  import * as tn from "react-dom";
6
6
  function Mt() {
7
7
  return typeof window < "u";
8
8
  }
9
- function Ke(e) {
10
- return Hn(e) ? (e.nodeName || "").toLowerCase() : "#document";
9
+ function We(e) {
10
+ return zn(e) ? (e.nodeName || "").toLowerCase() : "#document";
11
11
  }
12
- function ge(e) {
12
+ function he(e) {
13
13
  var t;
14
14
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
15
15
  }
16
- function Te(e) {
16
+ function Oe(e) {
17
17
  var t;
18
- return (t = (Hn(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
18
+ return (t = (zn(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
19
19
  }
20
- function Hn(e) {
21
- return Mt() ? e instanceof Node || e instanceof ge(e).Node : !1;
20
+ function zn(e) {
21
+ return Mt() ? e instanceof Node || e instanceof he(e).Node : !1;
22
22
  }
23
- function q(e) {
24
- return Mt() ? e instanceof Element || e instanceof ge(e).Element : !1;
23
+ function Y(e) {
24
+ return Mt() ? e instanceof Element || e instanceof he(e).Element : !1;
25
25
  }
26
- function ie(e) {
27
- return Mt() ? e instanceof HTMLElement || e instanceof ge(e).HTMLElement : !1;
26
+ function re(e) {
27
+ return Mt() ? e instanceof HTMLElement || e instanceof he(e).HTMLElement : !1;
28
28
  }
29
29
  function Xt(e) {
30
- return !Mt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof ge(e).ShadowRoot;
30
+ return !Mt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof he(e).ShadowRoot;
31
31
  }
32
32
  function ut(e) {
33
33
  const {
@@ -38,10 +38,10 @@ function ut(e) {
38
38
  } = we(e);
39
39
  return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !["inline", "contents"].includes(o);
40
40
  }
41
- function Ar(e) {
42
- return ["table", "td", "th"].includes(Ke(e));
41
+ function Mr(e) {
42
+ return ["table", "td", "th"].includes(We(e));
43
43
  }
44
- function St(e) {
44
+ function Pt(e) {
45
45
  return [":popover-open", ":modal"].some((t) => {
46
46
  try {
47
47
  return e.matches(t);
@@ -51,31 +51,31 @@ function St(e) {
51
51
  });
52
52
  }
53
53
  function nn(e) {
54
- const t = Pt(), n = q(e) ? we(e) : e;
54
+ const t = St(), n = Y(e) ? we(e) : e;
55
55
  return ["transform", "translate", "scale", "rotate", "perspective"].some((r) => n[r] ? n[r] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((r) => (n.willChange || "").includes(r)) || ["paint", "layout", "strict", "content"].some((r) => (n.contain || "").includes(r));
56
56
  }
57
- function Mr(e) {
58
- let t = Pe(e);
59
- for (; ie(t) && !Se(t); ) {
57
+ function Pr(e) {
58
+ let t = De(e);
59
+ for (; re(t) && !Se(t); ) {
60
60
  if (nn(t))
61
61
  return t;
62
- if (St(t))
62
+ if (Pt(t))
63
63
  return null;
64
- t = Pe(t);
64
+ t = De(t);
65
65
  }
66
66
  return null;
67
67
  }
68
- function Pt() {
68
+ function St() {
69
69
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
70
70
  }
71
71
  function Se(e) {
72
- return ["html", "body", "#document"].includes(Ke(e));
72
+ return ["html", "body", "#document"].includes(We(e));
73
73
  }
74
74
  function we(e) {
75
- return ge(e).getComputedStyle(e);
75
+ return he(e).getComputedStyle(e);
76
76
  }
77
77
  function Dt(e) {
78
- return q(e) ? {
78
+ return Y(e) ? {
79
79
  scrollLeft: e.scrollLeft,
80
80
  scrollTop: e.scrollTop
81
81
  } : {
@@ -83,26 +83,26 @@ function Dt(e) {
83
83
  scrollTop: e.scrollY
84
84
  };
85
85
  }
86
- function Pe(e) {
87
- if (Ke(e) === "html")
86
+ function De(e) {
87
+ if (We(e) === "html")
88
88
  return e;
89
89
  const t = (
90
90
  // Step into the shadow DOM of the parent of a slotted node.
91
91
  e.assignedSlot || // DOM Element detected.
92
92
  e.parentNode || // ShadowRoot detected.
93
93
  Xt(e) && e.host || // Fallback.
94
- Te(e)
94
+ Oe(e)
95
95
  );
96
96
  return Xt(t) ? t.host : t;
97
97
  }
98
- function zn(e) {
99
- const t = Pe(e);
100
- return Se(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : ie(t) && ut(t) ? t : zn(t);
98
+ function Un(e) {
99
+ const t = De(e);
100
+ return Se(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : re(t) && ut(t) ? t : Un(t);
101
101
  }
102
102
  function Le(e, t, n) {
103
103
  var r;
104
104
  t === void 0 && (t = []), n === void 0 && (n = !0);
105
- const o = zn(e), s = o === ((r = e.ownerDocument) == null ? void 0 : r.body), i = ge(o);
105
+ const o = Un(e), s = o === ((r = e.ownerDocument) == null ? void 0 : r.body), i = he(o);
106
106
  if (s) {
107
107
  const c = Jt(i);
108
108
  return t.concat(i, i.visualViewport || [], ut(o) ? o : [], c && n ? Le(c) : []);
@@ -112,56 +112,56 @@ function Le(e, t, n) {
112
112
  function Jt(e) {
113
113
  return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
114
114
  }
115
- const Sr = ["top", "right", "bottom", "left"], dn = ["start", "end"], mn = /* @__PURE__ */ Sr.reduce((e, t) => e.concat(t, t + "-" + dn[0], t + "-" + dn[1]), []), Qe = Math.min, he = Math.max, wt = Math.round, qe = Math.floor, Ie = (e) => ({
115
+ const Sr = ["top", "right", "bottom", "left"], dn = ["start", "end"], mn = /* @__PURE__ */ Sr.reduce((e, t) => e.concat(t, t + "-" + dn[0], t + "-" + dn[1]), []), Qe = Math.min, be = Math.max, wt = Math.round, je = Math.floor, Ce = (e) => ({
116
116
  x: e,
117
117
  y: e
118
- }), Pr = {
118
+ }), Dr = {
119
119
  left: "right",
120
120
  right: "left",
121
121
  bottom: "top",
122
122
  top: "bottom"
123
- }, Dr = {
123
+ }, kr = {
124
124
  start: "end",
125
125
  end: "start"
126
126
  };
127
- function gn(e, t, n) {
128
- return he(e, Qe(t, n));
127
+ function pn(e, t, n) {
128
+ return be(e, Qe(t, n));
129
129
  }
130
130
  function Ze(e, t) {
131
131
  return typeof e == "function" ? e(t) : e;
132
132
  }
133
- function Oe(e) {
133
+ function Te(e) {
134
134
  return e.split("-")[0];
135
135
  }
136
- function Ce(e) {
136
+ function Ie(e) {
137
137
  return e.split("-")[1];
138
138
  }
139
- function Un(e) {
139
+ function Gn(e) {
140
140
  return e === "x" ? "y" : "x";
141
141
  }
142
- function Gn(e) {
142
+ function jn(e) {
143
143
  return e === "y" ? "height" : "width";
144
144
  }
145
145
  function ze(e) {
146
- return ["top", "bottom"].includes(Oe(e)) ? "y" : "x";
146
+ return ["top", "bottom"].includes(Te(e)) ? "y" : "x";
147
147
  }
148
- function jn(e) {
149
- return Un(ze(e));
148
+ function qn(e) {
149
+ return Gn(ze(e));
150
150
  }
151
- function qn(e, t, n) {
151
+ function Yn(e, t, n) {
152
152
  n === void 0 && (n = !1);
153
- const r = Ce(e), o = jn(e), s = Gn(o);
153
+ const r = Ie(e), o = qn(e), s = jn(o);
154
154
  let i = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
155
155
  return t.reference[s] > t.floating[s] && (i = Et(i)), [i, Et(i)];
156
156
  }
157
- function kr(e) {
157
+ function Lr(e) {
158
158
  const t = Et(e);
159
159
  return [Rt(e), t, Rt(t)];
160
160
  }
161
161
  function Rt(e) {
162
- return e.replace(/start|end/g, (t) => Dr[t]);
162
+ return e.replace(/start|end/g, (t) => kr[t]);
163
163
  }
164
- function Lr(e, t, n) {
164
+ function Fr(e, t, n) {
165
165
  const r = ["left", "right"], o = ["right", "left"], s = ["top", "bottom"], i = ["bottom", "top"];
166
166
  switch (e) {
167
167
  case "top":
@@ -174,15 +174,15 @@ function Lr(e, t, n) {
174
174
  return [];
175
175
  }
176
176
  }
177
- function Fr(e, t, n, r) {
178
- const o = Ce(e);
179
- let s = Lr(Oe(e), n === "start", r);
177
+ function Nr(e, t, n, r) {
178
+ const o = Ie(e);
179
+ let s = Fr(Te(e), n === "start", r);
180
180
  return o && (s = s.map((i) => i + "-" + o), t && (s = s.concat(s.map(Rt)))), s;
181
181
  }
182
182
  function Et(e) {
183
- return e.replace(/left|right|bottom|top/g, (t) => Pr[t]);
183
+ return e.replace(/left|right|bottom|top/g, (t) => Dr[t]);
184
184
  }
185
- function Nr(e) {
185
+ function _r(e) {
186
186
  return {
187
187
  top: 0,
188
188
  right: 0,
@@ -191,15 +191,15 @@ function Nr(e) {
191
191
  ...e
192
192
  };
193
193
  }
194
- function _r(e) {
195
- return typeof e != "number" ? Nr(e) : {
194
+ function Wr(e) {
195
+ return typeof e != "number" ? _r(e) : {
196
196
  top: e,
197
197
  right: e,
198
198
  bottom: e,
199
199
  left: e
200
200
  };
201
201
  }
202
- function It(e) {
202
+ function Ct(e) {
203
203
  const {
204
204
  x: t,
205
205
  y: n,
@@ -221,7 +221,7 @@ function rn() {
221
221
  const e = navigator.userAgentData;
222
222
  return e != null && e.platform ? e.platform : navigator.platform;
223
223
  }
224
- function Yn() {
224
+ function Xn() {
225
225
  const e = navigator.userAgentData;
226
226
  return e && Array.isArray(e.brands) ? e.brands.map((t) => {
227
227
  let {
@@ -231,20 +231,20 @@ function Yn() {
231
231
  return n + "/" + r;
232
232
  }).join(" ") : navigator.userAgent;
233
233
  }
234
- function Xn() {
234
+ function Jn() {
235
235
  return /apple/i.test(navigator.vendor);
236
236
  }
237
237
  function Qt() {
238
238
  const e = /android/i;
239
- return e.test(rn()) || e.test(Yn());
239
+ return e.test(rn()) || e.test(Xn());
240
240
  }
241
241
  function Kr() {
242
242
  return rn().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
243
243
  }
244
- function Jn() {
245
- return Yn().includes("jsdom/");
244
+ function Qn() {
245
+ return Xn().includes("jsdom/");
246
246
  }
247
- const pn = "data-floating-ui-focusable", Vr = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])", _t = "ArrowLeft", Kt = "ArrowRight", Wr = "ArrowUp", $r = "ArrowDown";
247
+ const gn = "data-floating-ui-focusable", Vr = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])", _t = "ArrowLeft", Wt = "ArrowRight", $r = "ArrowUp", Br = "ArrowDown";
248
248
  function Ee(e) {
249
249
  let t = e.activeElement;
250
250
  for (; ((n = t) == null || (n = n.shadowRoot) == null ? void 0 : n.activeElement) != null; ) {
@@ -269,10 +269,10 @@ function ce(e, t) {
269
269
  }
270
270
  return !1;
271
271
  }
272
- function ke(e) {
272
+ function Pe(e) {
273
273
  return "composedPath" in e ? e.composedPath()[0] : e.target;
274
274
  }
275
- function Vt(e, t) {
275
+ function Kt(e, t) {
276
276
  if (t == null)
277
277
  return !1;
278
278
  if ("composedPath" in e)
@@ -280,49 +280,48 @@ function Vt(e, t) {
280
280
  const n = e;
281
281
  return n.target != null && t.contains(n.target);
282
282
  }
283
- function Br(e) {
283
+ function Hr(e) {
284
284
  return e.matches("html,body");
285
285
  }
286
286
  function le(e) {
287
287
  return (e == null ? void 0 : e.ownerDocument) || document;
288
288
  }
289
289
  function on(e) {
290
- return ie(e) && e.matches(Vr);
290
+ return re(e) && e.matches(Vr);
291
291
  }
292
292
  function Zt(e) {
293
293
  return e ? e.getAttribute("role") === "combobox" && on(e) : !1;
294
294
  }
295
- function Hr(e) {
296
- if (!e || Jn()) return !0;
295
+ function zr(e) {
296
+ if (!e || Qn()) return !0;
297
297
  try {
298
298
  return e.matches(":focus-visible");
299
299
  } catch {
300
300
  return !0;
301
301
  }
302
302
  }
303
- function Ct(e) {
304
- return e ? e.hasAttribute(pn) ? e : e.querySelector("[" + pn + "]") || e : null;
305
- }
306
- function Ye(e, t, n) {
307
- n === void 0 && (n = !0);
308
- let r = e.filter((s) => {
309
- var i;
310
- return s.parentId === t && ((i = s.context) == null ? void 0 : i.open);
311
- }), o = r;
312
- for (; o.length; )
313
- o = n ? e.filter((s) => {
314
- var i;
315
- return (i = o) == null ? void 0 : i.some((c) => {
316
- var a;
317
- return s.parentId === c.id && ((a = s.context) == null ? void 0 : a.open);
303
+ function It(e) {
304
+ return e ? e.hasAttribute(gn) ? e : e.querySelector("[" + gn + "]") || e : null;
305
+ }
306
+ function qe(e, t) {
307
+ let n = e.filter((o) => {
308
+ var s;
309
+ return o.parentId === t && ((s = o.context) == null ? void 0 : s.open);
310
+ }), r = n;
311
+ for (; r.length; )
312
+ r = e.filter((o) => {
313
+ var s;
314
+ return (s = r) == null ? void 0 : s.some((i) => {
315
+ var c;
316
+ return o.parentId === i.id && ((c = o.context) == null ? void 0 : c.open);
318
317
  });
319
- }) : e, r = r.concat(o);
320
- return r;
318
+ }), n = n.concat(r);
319
+ return n;
321
320
  }
322
- function zr(e, t) {
321
+ function Ur(e, t) {
323
322
  let n, r = -1;
324
323
  function o(s, i) {
325
- i > r && (n = s, r = i), Ye(e, s).forEach((a) => {
324
+ i > r && (n = s, r = i), qe(e, s).forEach((a) => {
326
325
  o(a.id, i + 1);
327
326
  });
328
327
  }
@@ -337,25 +336,26 @@ function hn(e, t) {
337
336
  }
338
337
  return r;
339
338
  }
340
- function de(e) {
339
+ function pe(e) {
341
340
  e.preventDefault(), e.stopPropagation();
342
341
  }
343
- function Ur(e) {
342
+ function Gr(e) {
344
343
  return "nativeEvent" in e;
345
344
  }
346
- function Qn(e) {
345
+ function Zn(e) {
347
346
  return e.mozInputSource === 0 && e.isTrusted ? !0 : Qt() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
348
347
  }
349
- function Zn(e) {
350
- return Jn() ? !1 : !Qt() && e.width === 0 && e.height === 0 || Qt() && e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
348
+ function er(e) {
349
+ return Qn() ? !1 : !Qt() && e.width === 0 && e.height === 0 || Qt() && e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
351
350
  e.width < 1 && e.height < 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "touch";
352
351
  }
353
352
  function it(e, t) {
354
353
  const n = ["mouse", "pen"];
355
354
  return t || n.push("", void 0), n.includes(e);
356
355
  }
357
- var X = typeof document < "u" ? Vn : Wn;
358
- const Gr = {
356
+ var jr = typeof document < "u", qr = function() {
357
+ }, X = jr ? $n : qr;
358
+ const Yr = {
359
359
  ...f
360
360
  };
361
361
  function xe(e) {
@@ -364,13 +364,13 @@ function xe(e) {
364
364
  t.current = e;
365
365
  }), t;
366
366
  }
367
- const jr = Gr.useInsertionEffect, qr = jr || ((e) => e());
368
- function ae(e) {
367
+ const Xr = Yr.useInsertionEffect, Jr = Xr || ((e) => e());
368
+ function se(e) {
369
369
  const t = f.useRef(() => {
370
370
  if (process.env.NODE_ENV !== "production")
371
371
  throw new Error("Cannot call an event handler while rendering.");
372
372
  });
373
- return qr(() => {
373
+ return Jr(() => {
374
374
  t.current = e;
375
375
  }), f.useCallback(function() {
376
376
  for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
@@ -378,10 +378,10 @@ function ae(e) {
378
378
  return t.current == null ? void 0 : t.current(...r);
379
379
  }, []);
380
380
  }
381
- function gt(e, t, n) {
381
+ function pt(e, t, n) {
382
382
  return Math.floor(e / t) !== n;
383
383
  }
384
- function Xe(e, t) {
384
+ function Ye(e, t) {
385
385
  return t < 0 || t >= e.current.length;
386
386
  }
387
387
  function yt(e, t) {
@@ -408,7 +408,7 @@ function ue(e, t) {
408
408
  while (i >= 0 && i <= e.current.length - 1 && He(e, i, o));
409
409
  return i;
410
410
  }
411
- function er(e, t) {
411
+ function tr(e, t) {
412
412
  let {
413
413
  event: n,
414
414
  orientation: r,
@@ -421,8 +421,8 @@ function er(e, t) {
421
421
  prevIndex: l,
422
422
  stopEvent: p = !1
423
423
  } = t, g = l;
424
- if (n.key === Wr) {
425
- if (p && de(n), l === -1)
424
+ if (n.key === $r) {
425
+ if (p && pe(n), l === -1)
426
426
  g = u;
427
427
  else if (g = ue(e, {
428
428
  startingIndex: g,
@@ -433,9 +433,9 @@ function er(e, t) {
433
433
  const d = l % i, h = u % i, m = u - (h - d);
434
434
  h === d ? g = u : g = h > d ? m : m - i;
435
435
  }
436
- Xe(e, g) && (g = l);
436
+ Ye(e, g) && (g = l);
437
437
  }
438
- if (n.key === $r && (p && de(n), l === -1 ? g = a : (g = ue(e, {
438
+ if (n.key === Br && (p && pe(n), l === -1 ? g = a : (g = ue(e, {
439
439
  startingIndex: l,
440
440
  amount: i,
441
441
  disabledIndices: c
@@ -443,22 +443,22 @@ function er(e, t) {
443
443
  startingIndex: l % i - i,
444
444
  amount: i,
445
445
  disabledIndices: c
446
- }))), Xe(e, g) && (g = l)), r === "both") {
447
- const d = qe(l / i);
448
- n.key === (s ? _t : Kt) && (p && de(n), l % i !== i - 1 ? (g = ue(e, {
446
+ }))), Ye(e, g) && (g = l)), r === "both") {
447
+ const d = je(l / i);
448
+ n.key === (s ? _t : Wt) && (p && pe(n), l % i !== i - 1 ? (g = ue(e, {
449
449
  startingIndex: l,
450
450
  disabledIndices: c
451
- }), o && gt(g, i, d) && (g = ue(e, {
451
+ }), o && pt(g, i, d) && (g = ue(e, {
452
452
  startingIndex: l - l % i - 1,
453
453
  disabledIndices: c
454
454
  }))) : o && (g = ue(e, {
455
455
  startingIndex: l - l % i - 1,
456
456
  disabledIndices: c
457
- })), gt(g, i, d) && (g = l)), n.key === (s ? Kt : _t) && (p && de(n), l % i !== 0 ? (g = ue(e, {
457
+ })), pt(g, i, d) && (g = l)), n.key === (s ? Wt : _t) && (p && pe(n), l % i !== 0 ? (g = ue(e, {
458
458
  startingIndex: l,
459
459
  decrement: !0,
460
460
  disabledIndices: c
461
- }), o && gt(g, i, d) && (g = ue(e, {
461
+ }), o && pt(g, i, d) && (g = ue(e, {
462
462
  startingIndex: l + (i - l % i),
463
463
  decrement: !0,
464
464
  disabledIndices: c
@@ -466,16 +466,16 @@ function er(e, t) {
466
466
  startingIndex: l + (i - l % i),
467
467
  decrement: !0,
468
468
  disabledIndices: c
469
- })), gt(g, i, d) && (g = l));
470
- const h = qe(u / i) === d;
471
- Xe(e, g) && (o && h ? g = n.key === (s ? Kt : _t) ? u : ue(e, {
469
+ })), pt(g, i, d) && (g = l));
470
+ const h = je(u / i) === d;
471
+ Ye(e, g) && (o && h ? g = n.key === (s ? Wt : _t) ? u : ue(e, {
472
472
  startingIndex: l - l % i - 1,
473
473
  disabledIndices: c
474
474
  }) : g = l);
475
475
  }
476
476
  return g;
477
477
  }
478
- function tr(e, t, n) {
478
+ function nr(e, t, n) {
479
479
  const r = [];
480
480
  let o = 0;
481
481
  return e.forEach((s, i) => {
@@ -497,7 +497,7 @@ function tr(e, t, n) {
497
497
  }
498
498
  }), [...r];
499
499
  }
500
- function nr(e, t, n, r, o) {
500
+ function rr(e, t, n, r, o) {
501
501
  if (e === -1) return -1;
502
502
  const s = n.indexOf(e), i = t[e];
503
503
  switch (o) {
@@ -511,10 +511,12 @@ function nr(e, t, n, r, o) {
511
511
  return n.lastIndexOf(e);
512
512
  }
513
513
  }
514
- function rr(e, t) {
514
+ function or(e, t) {
515
515
  return t.flatMap((n, r) => e.includes(n) ? [r] : []);
516
516
  }
517
517
  function He(e, t, n) {
518
+ if (typeof n == "function")
519
+ return n(t);
518
520
  if (n)
519
521
  return n.includes(t);
520
522
  const r = e.current[t];
@@ -529,23 +531,23 @@ const lt = () => ({
529
531
  typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
530
532
  )
531
533
  });
532
- function or(e, t) {
534
+ function ir(e, t) {
533
535
  const n = At(e, lt()), r = n.length;
534
536
  if (r === 0) return;
535
537
  const o = Ee(le(e)), s = n.indexOf(o), i = s === -1 ? t === 1 ? 0 : r - 1 : s + t;
536
538
  return n[i];
537
539
  }
538
- function ir(e) {
539
- return or(le(e).body, 1) || e;
540
- }
541
540
  function sr(e) {
542
- return or(le(e).body, -1) || e;
541
+ return ir(le(e).body, 1) || e;
542
+ }
543
+ function cr(e) {
544
+ return ir(le(e).body, -1) || e;
543
545
  }
544
546
  function ot(e, t) {
545
547
  const n = t || e.currentTarget, r = e.relatedTarget;
546
548
  return !r || !ce(n, r);
547
549
  }
548
- function Yr(e) {
550
+ function Qr(e) {
549
551
  At(e, lt()).forEach((n) => {
550
552
  n.dataset.tabindex = n.getAttribute("tabindex") || "", n.setAttribute("tabindex", "-1");
551
553
  });
@@ -561,7 +563,7 @@ function bn(e, t, n) {
561
563
  reference: r,
562
564
  floating: o
563
565
  } = e;
564
- const s = ze(t), i = jn(t), c = Gn(i), a = Oe(t), u = s === "y", l = r.x + r.width / 2 - o.width / 2, p = r.y + r.height / 2 - o.height / 2, g = r[c] / 2 - o[c] / 2;
566
+ const s = ze(t), i = qn(t), c = jn(i), a = Te(t), u = s === "y", l = r.x + r.width / 2 - o.width / 2, p = r.y + r.height / 2 - o.height / 2, g = r[c] / 2 - o[c] / 2;
565
567
  let d;
566
568
  switch (a) {
567
569
  case "top":
@@ -594,7 +596,7 @@ function bn(e, t, n) {
594
596
  y: r.y
595
597
  };
596
598
  }
597
- switch (Ce(t)) {
599
+ switch (Ie(t)) {
598
600
  case "start":
599
601
  d[i] -= g * (n && u ? -1 : 1);
600
602
  break;
@@ -604,7 +606,7 @@ function bn(e, t, n) {
604
606
  }
605
607
  return d;
606
608
  }
607
- const Xr = async (e, t, n) => {
609
+ const Zr = async (e, t, n) => {
608
610
  const {
609
611
  placement: r = "bottom",
610
612
  strategy: o = "absolute",
@@ -622,13 +624,13 @@ const Xr = async (e, t, n) => {
622
624
  for (let m = 0; m < c.length; m++) {
623
625
  const {
624
626
  name: y,
625
- fn: E
627
+ fn: R
626
628
  } = c[m], {
627
629
  x: v,
628
630
  y: x,
629
- data: I,
631
+ data: C,
630
632
  reset: A
631
- } = await E({
633
+ } = await R({
632
634
  x: l,
633
635
  y: p,
634
636
  initialPlacement: r,
@@ -646,7 +648,7 @@ const Xr = async (e, t, n) => {
646
648
  ...d,
647
649
  [y]: {
648
650
  ...d[y],
649
- ...I
651
+ ...C
650
652
  }
651
653
  }, A && h <= 50 && (h++, typeof A == "object" && (A.placement && (g = A.placement), A.rects && (u = A.rects === !0 ? await i.getElementRects({
652
654
  reference: e,
@@ -681,7 +683,7 @@ async function kt(e, t) {
681
683
  elementContext: p = "floating",
682
684
  altBoundary: g = !1,
683
685
  padding: d = 0
684
- } = Ze(t, e), h = _r(d), y = c[g ? p === "floating" ? "reference" : "floating" : p], E = It(await s.getClippingRect({
686
+ } = Ze(t, e), h = Wr(d), y = c[g ? p === "floating" ? "reference" : "floating" : p], R = Ct(await s.getClippingRect({
685
687
  element: (n = await (s.isElement == null ? void 0 : s.isElement(y))) == null || n ? y : y.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(c.floating)),
686
688
  boundary: u,
687
689
  rootBoundary: l,
@@ -691,29 +693,29 @@ async function kt(e, t) {
691
693
  y: o,
692
694
  width: i.floating.width,
693
695
  height: i.floating.height
694
- } : i.reference, x = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), I = await (s.isElement == null ? void 0 : s.isElement(x)) ? await (s.getScale == null ? void 0 : s.getScale(x)) || {
696
+ } : i.reference, x = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), C = await (s.isElement == null ? void 0 : s.isElement(x)) ? await (s.getScale == null ? void 0 : s.getScale(x)) || {
695
697
  x: 1,
696
698
  y: 1
697
699
  } : {
698
700
  x: 1,
699
701
  y: 1
700
- }, A = It(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
702
+ }, A = Ct(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
701
703
  elements: c,
702
704
  rect: v,
703
705
  offsetParent: x,
704
706
  strategy: a
705
707
  }) : v);
706
708
  return {
707
- top: (E.top - A.top + h.top) / I.y,
708
- bottom: (A.bottom - E.bottom + h.bottom) / I.y,
709
- left: (E.left - A.left + h.left) / I.x,
710
- right: (A.right - E.right + h.right) / I.x
709
+ top: (R.top - A.top + h.top) / C.y,
710
+ bottom: (A.bottom - R.bottom + h.bottom) / C.y,
711
+ left: (R.left - A.left + h.left) / C.x,
712
+ right: (A.right - R.right + h.right) / C.x
711
713
  };
712
714
  }
713
- function Jr(e, t, n) {
714
- return (e ? [...n.filter((o) => Ce(o) === e), ...n.filter((o) => Ce(o) !== e)] : n.filter((o) => Oe(o) === o)).filter((o) => e ? Ce(o) === e || (t ? Rt(o) !== o : !1) : !0);
715
+ function eo(e, t, n) {
716
+ return (e ? [...n.filter((o) => Ie(o) === e), ...n.filter((o) => Ie(o) !== e)] : n.filter((o) => Te(o) === o)).filter((o) => e ? Ie(o) === e || (t ? Rt(o) !== o : !1) : !0);
715
717
  }
716
- const Qr = function(e) {
718
+ const to = function(e) {
717
719
  return e === void 0 && (e = {}), {
718
720
  name: "autoPlacement",
719
721
  options: e,
@@ -731,57 +733,57 @@ const Qr = function(e) {
731
733
  allowedPlacements: g = mn,
732
734
  autoAlignment: d = !0,
733
735
  ...h
734
- } = Ze(e, t), m = p !== void 0 || g === mn ? Jr(p || null, d, g) : g, y = await kt(t, h), E = ((n = i.autoPlacement) == null ? void 0 : n.index) || 0, v = m[E];
736
+ } = Ze(e, t), m = p !== void 0 || g === mn ? eo(p || null, d, g) : g, y = await kt(t, h), R = ((n = i.autoPlacement) == null ? void 0 : n.index) || 0, v = m[R];
735
737
  if (v == null)
736
738
  return {};
737
- const x = qn(v, s, await (a.isRTL == null ? void 0 : a.isRTL(u.floating)));
739
+ const x = Yn(v, s, await (a.isRTL == null ? void 0 : a.isRTL(u.floating)));
738
740
  if (c !== v)
739
741
  return {
740
742
  reset: {
741
743
  placement: m[0]
742
744
  }
743
745
  };
744
- const I = [y[Oe(v)], y[x[0]], y[x[1]]], A = [...((r = i.autoPlacement) == null ? void 0 : r.overflows) || [], {
746
+ const C = [y[Te(v)], y[x[0]], y[x[1]]], A = [...((r = i.autoPlacement) == null ? void 0 : r.overflows) || [], {
745
747
  placement: v,
746
- overflows: I
747
- }], k = m[E + 1];
748
+ overflows: C
749
+ }], k = m[R + 1];
748
750
  if (k)
749
751
  return {
750
752
  data: {
751
- index: E + 1,
753
+ index: R + 1,
752
754
  overflows: A
753
755
  },
754
756
  reset: {
755
757
  placement: k
756
758
  }
757
759
  };
758
- const L = A.map((N) => {
759
- const _ = Ce(N.placement);
760
- return [N.placement, _ && l ? (
760
+ const N = A.map((F) => {
761
+ const _ = Ie(F.placement);
762
+ return [F.placement, _ && l ? (
761
763
  // Check along the mainAxis and main crossAxis side.
762
- N.overflows.slice(0, 2).reduce((U, V) => U + V, 0)
764
+ F.overflows.slice(0, 2).reduce((U, K) => U + K, 0)
763
765
  ) : (
764
766
  // Check only the mainAxis.
765
- N.overflows[0]
766
- ), N.overflows];
767
- }).sort((N, _) => N[1] - _[1]), F = ((o = L.filter((N) => N[2].slice(
767
+ F.overflows[0]
768
+ ), F.overflows];
769
+ }).sort((F, _) => F[1] - _[1]), L = ((o = N.filter((F) => F[2].slice(
768
770
  0,
769
771
  // Aligned placements should not check their opposite crossAxis
770
772
  // side.
771
- Ce(N[0]) ? 2 : 3
772
- ).every((_) => _ <= 0))[0]) == null ? void 0 : o[0]) || L[0][0];
773
- return F !== c ? {
773
+ Ie(F[0]) ? 2 : 3
774
+ ).every((_) => _ <= 0))[0]) == null ? void 0 : o[0]) || N[0][0];
775
+ return L !== c ? {
774
776
  data: {
775
- index: E + 1,
777
+ index: R + 1,
776
778
  overflows: A
777
779
  },
778
780
  reset: {
779
- placement: F
781
+ placement: L
780
782
  }
781
783
  } : {};
782
784
  }
783
785
  };
784
- }, Zr = function(e) {
786
+ }, no = function(e) {
785
787
  return e === void 0 && (e = {}), {
786
788
  name: "flip",
787
789
  options: e,
@@ -805,55 +807,55 @@ const Qr = function(e) {
805
807
  } = Ze(e, t);
806
808
  if ((n = s.arrow) != null && n.alignmentOffset)
807
809
  return {};
808
- const E = Oe(o), v = ze(c), x = Oe(c) === c, I = await (a.isRTL == null ? void 0 : a.isRTL(u.floating)), A = g || (x || !m ? [Et(c)] : kr(c)), k = h !== "none";
809
- !g && k && A.push(...Fr(c, m, h, I));
810
- const L = [c, ...A], M = await kt(t, y), F = [];
811
- let N = ((r = s.flip) == null ? void 0 : r.overflows) || [];
812
- if (l && F.push(M[E]), p) {
813
- const T = qn(o, i, I);
814
- F.push(M[T[0]], M[T[1]]);
810
+ const R = Te(o), v = ze(c), x = Te(c) === c, C = await (a.isRTL == null ? void 0 : a.isRTL(u.floating)), A = g || (x || !m ? [Et(c)] : Lr(c)), k = h !== "none";
811
+ !g && k && A.push(...Nr(c, m, h, C));
812
+ const N = [c, ...A], D = await kt(t, y), L = [];
813
+ let F = ((r = s.flip) == null ? void 0 : r.overflows) || [];
814
+ if (l && L.push(D[R]), p) {
815
+ const O = Yn(o, i, C);
816
+ L.push(D[O[0]], D[O[1]]);
815
817
  }
816
- if (N = [...N, {
818
+ if (F = [...F, {
817
819
  placement: o,
818
- overflows: F
819
- }], !F.every((T) => T <= 0)) {
820
+ overflows: L
821
+ }], !L.every((O) => O <= 0)) {
820
822
  var _, U;
821
- const T = (((_ = s.flip) == null ? void 0 : _.index) || 0) + 1, w = L[T];
823
+ const O = (((_ = s.flip) == null ? void 0 : _.index) || 0) + 1, w = N[O];
822
824
  if (w)
823
825
  return {
824
826
  data: {
825
- index: T,
826
- overflows: N
827
+ index: O,
828
+ overflows: F
827
829
  },
828
830
  reset: {
829
831
  placement: w
830
832
  }
831
833
  };
832
- let K = (U = N.filter((O) => O.overflows[0] <= 0).sort((O, b) => O.overflows[1] - b.overflows[1])[0]) == null ? void 0 : U.placement;
833
- if (!K)
834
+ let W = (U = F.filter((T) => T.overflows[0] <= 0).sort((T, b) => T.overflows[1] - b.overflows[1])[0]) == null ? void 0 : U.placement;
835
+ if (!W)
834
836
  switch (d) {
835
837
  case "bestFit": {
836
- var V;
837
- const O = (V = N.filter((b) => {
838
+ var K;
839
+ const T = (K = F.filter((b) => {
838
840
  if (k) {
839
- const R = ze(b.placement);
840
- return R === v || // Create a bias to the `y` side axis due to horizontal
841
+ const E = ze(b.placement);
842
+ return E === v || // Create a bias to the `y` side axis due to horizontal
841
843
  // reading directions favoring greater width.
842
- R === "y";
844
+ E === "y";
843
845
  }
844
846
  return !0;
845
- }).map((b) => [b.placement, b.overflows.filter((R) => R > 0).reduce((R, S) => R + S, 0)]).sort((b, R) => b[1] - R[1])[0]) == null ? void 0 : V[0];
846
- O && (K = O);
847
+ }).map((b) => [b.placement, b.overflows.filter((E) => E > 0).reduce((E, P) => E + P, 0)]).sort((b, E) => b[1] - E[1])[0]) == null ? void 0 : K[0];
848
+ T && (W = T);
847
849
  break;
848
850
  }
849
851
  case "initialPlacement":
850
- K = c;
852
+ W = c;
851
853
  break;
852
854
  }
853
- if (o !== K)
855
+ if (o !== W)
854
856
  return {
855
857
  reset: {
856
- placement: K
858
+ placement: W
857
859
  }
858
860
  };
859
861
  }
@@ -861,12 +863,12 @@ const Qr = function(e) {
861
863
  }
862
864
  };
863
865
  };
864
- async function eo(e, t) {
866
+ async function ro(e, t) {
865
867
  const {
866
868
  placement: n,
867
869
  platform: r,
868
870
  elements: o
869
- } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = Oe(n), c = Ce(n), a = ze(n) === "y", u = ["left", "top"].includes(i) ? -1 : 1, l = s && a ? -1 : 1, p = Ze(t, e);
871
+ } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = Te(n), c = Ie(n), a = ze(n) === "y", u = ["left", "top"].includes(i) ? -1 : 1, l = s && a ? -1 : 1, p = Ze(t, e);
870
872
  let {
871
873
  mainAxis: g,
872
874
  crossAxis: d,
@@ -888,7 +890,7 @@ async function eo(e, t) {
888
890
  y: d * l
889
891
  };
890
892
  }
891
- const to = function(e) {
893
+ const oo = function(e) {
892
894
  return e === void 0 && (e = 0), {
893
895
  name: "offset",
894
896
  options: e,
@@ -899,7 +901,7 @@ const to = function(e) {
899
901
  y: s,
900
902
  placement: i,
901
903
  middlewareData: c
902
- } = t, a = await eo(t, e);
904
+ } = t, a = await ro(t, e);
903
905
  return i === ((n = c.offset) == null ? void 0 : n.placement) && (r = c.arrow) != null && r.alignmentOffset ? {} : {
904
906
  x: o + a.x,
905
907
  y: s + a.y,
@@ -910,7 +912,7 @@ const to = function(e) {
910
912
  };
911
913
  }
912
914
  };
913
- }, no = function(e) {
915
+ }, io = function(e) {
914
916
  return e === void 0 && (e = {}), {
915
917
  name: "shift",
916
918
  options: e,
@@ -925,11 +927,11 @@ const to = function(e) {
925
927
  limiter: c = {
926
928
  fn: (y) => {
927
929
  let {
928
- x: E,
930
+ x: R,
929
931
  y: v
930
932
  } = y;
931
933
  return {
932
- x: E,
934
+ x: R,
933
935
  y: v
934
936
  };
935
937
  }
@@ -938,15 +940,15 @@ const to = function(e) {
938
940
  } = Ze(e, t), u = {
939
941
  x: n,
940
942
  y: r
941
- }, l = await kt(t, a), p = ze(Oe(o)), g = Un(p);
943
+ }, l = await kt(t, a), p = ze(Te(o)), g = Gn(p);
942
944
  let d = u[g], h = u[p];
943
945
  if (s) {
944
- const y = g === "y" ? "top" : "left", E = g === "y" ? "bottom" : "right", v = d + l[y], x = d - l[E];
945
- d = gn(v, d, x);
946
+ const y = g === "y" ? "top" : "left", R = g === "y" ? "bottom" : "right", v = d + l[y], x = d - l[R];
947
+ d = pn(v, d, x);
946
948
  }
947
949
  if (i) {
948
- const y = p === "y" ? "top" : "left", E = p === "y" ? "bottom" : "right", v = h + l[y], x = h - l[E];
949
- h = gn(v, h, x);
950
+ const y = p === "y" ? "top" : "left", R = p === "y" ? "bottom" : "right", v = h + l[y], x = h - l[R];
951
+ h = pn(v, h, x);
950
952
  }
951
953
  const m = c.fn({
952
954
  ...t,
@@ -966,7 +968,7 @@ const to = function(e) {
966
968
  };
967
969
  }
968
970
  };
969
- }, ro = function(e) {
971
+ }, so = function(e) {
970
972
  return e === void 0 && (e = {}), {
971
973
  name: "size",
972
974
  options: e,
@@ -981,25 +983,25 @@ const to = function(e) {
981
983
  apply: a = () => {
982
984
  },
983
985
  ...u
984
- } = Ze(e, t), l = await kt(t, u), p = Oe(o), g = Ce(o), d = ze(o) === "y", {
986
+ } = Ze(e, t), l = await kt(t, u), p = Te(o), g = Ie(o), d = ze(o) === "y", {
985
987
  width: h,
986
988
  height: m
987
989
  } = s.floating;
988
- let y, E;
989
- p === "top" || p === "bottom" ? (y = p, E = g === (await (i.isRTL == null ? void 0 : i.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (E = p, y = g === "end" ? "top" : "bottom");
990
- const v = m - l.top - l.bottom, x = h - l.left - l.right, I = Qe(m - l[y], v), A = Qe(h - l[E], x), k = !t.middlewareData.shift;
991
- let L = I, M = A;
992
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (M = x), (r = t.middlewareData.shift) != null && r.enabled.y && (L = v), k && !g) {
993
- const N = he(l.left, 0), _ = he(l.right, 0), U = he(l.top, 0), V = he(l.bottom, 0);
994
- d ? M = h - 2 * (N !== 0 || _ !== 0 ? N + _ : he(l.left, l.right)) : L = m - 2 * (U !== 0 || V !== 0 ? U + V : he(l.top, l.bottom));
990
+ let y, R;
991
+ p === "top" || p === "bottom" ? (y = p, R = g === (await (i.isRTL == null ? void 0 : i.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (R = p, y = g === "end" ? "top" : "bottom");
992
+ const v = m - l.top - l.bottom, x = h - l.left - l.right, C = Qe(m - l[y], v), A = Qe(h - l[R], x), k = !t.middlewareData.shift;
993
+ let N = C, D = A;
994
+ if ((n = t.middlewareData.shift) != null && n.enabled.x && (D = x), (r = t.middlewareData.shift) != null && r.enabled.y && (N = v), k && !g) {
995
+ const F = be(l.left, 0), _ = be(l.right, 0), U = be(l.top, 0), K = be(l.bottom, 0);
996
+ d ? D = h - 2 * (F !== 0 || _ !== 0 ? F + _ : be(l.left, l.right)) : N = m - 2 * (U !== 0 || K !== 0 ? U + K : be(l.top, l.bottom));
995
997
  }
996
998
  await a({
997
999
  ...t,
998
- availableWidth: M,
999
- availableHeight: L
1000
+ availableWidth: D,
1001
+ availableHeight: N
1000
1002
  });
1001
- const F = await i.getDimensions(c.floating);
1002
- return h !== F.width || m !== F.height ? {
1003
+ const L = await i.getDimensions(c.floating);
1004
+ return h !== L.width || m !== L.height ? {
1003
1005
  reset: {
1004
1006
  rects: !0
1005
1007
  }
@@ -1007,10 +1009,10 @@ const to = function(e) {
1007
1009
  }
1008
1010
  };
1009
1011
  };
1010
- function cr(e) {
1012
+ function ur(e) {
1011
1013
  const t = we(e);
1012
1014
  let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
1013
- const o = ie(e), s = o ? e.offsetWidth : n, i = o ? e.offsetHeight : r, c = wt(n) !== s || wt(r) !== i;
1015
+ const o = re(e), s = o ? e.offsetWidth : n, i = o ? e.offsetHeight : r, c = wt(n) !== s || wt(r) !== i;
1014
1016
  return c && (n = s, r = i), {
1015
1017
  width: n,
1016
1018
  height: r,
@@ -1018,50 +1020,50 @@ function cr(e) {
1018
1020
  };
1019
1021
  }
1020
1022
  function sn(e) {
1021
- return q(e) ? e : e.contextElement;
1023
+ return Y(e) ? e : e.contextElement;
1022
1024
  }
1023
- function Je(e) {
1025
+ function Xe(e) {
1024
1026
  const t = sn(e);
1025
- if (!ie(t))
1026
- return Ie(1);
1027
+ if (!re(t))
1028
+ return Ce(1);
1027
1029
  const n = t.getBoundingClientRect(), {
1028
1030
  width: r,
1029
1031
  height: o,
1030
1032
  $: s
1031
- } = cr(t);
1033
+ } = ur(t);
1032
1034
  let i = (s ? wt(n.width) : n.width) / r, c = (s ? wt(n.height) : n.height) / o;
1033
1035
  return (!i || !Number.isFinite(i)) && (i = 1), (!c || !Number.isFinite(c)) && (c = 1), {
1034
1036
  x: i,
1035
1037
  y: c
1036
1038
  };
1037
1039
  }
1038
- const oo = /* @__PURE__ */ Ie(0);
1039
- function ur(e) {
1040
- const t = ge(e);
1041
- return !Pt() || !t.visualViewport ? oo : {
1040
+ const co = /* @__PURE__ */ Ce(0);
1041
+ function lr(e) {
1042
+ const t = he(e);
1043
+ return !St() || !t.visualViewport ? co : {
1042
1044
  x: t.visualViewport.offsetLeft,
1043
1045
  y: t.visualViewport.offsetTop
1044
1046
  };
1045
1047
  }
1046
- function io(e, t, n) {
1047
- return t === void 0 && (t = !1), !n || t && n !== ge(e) ? !1 : t;
1048
+ function uo(e, t, n) {
1049
+ return t === void 0 && (t = !1), !n || t && n !== he(e) ? !1 : t;
1048
1050
  }
1049
1051
  function Ue(e, t, n, r) {
1050
1052
  t === void 0 && (t = !1), n === void 0 && (n = !1);
1051
1053
  const o = e.getBoundingClientRect(), s = sn(e);
1052
- let i = Ie(1);
1053
- t && (r ? q(r) && (i = Je(r)) : i = Je(e));
1054
- const c = io(s, n, r) ? ur(s) : Ie(0);
1054
+ let i = Ce(1);
1055
+ t && (r ? Y(r) && (i = Xe(r)) : i = Xe(e));
1056
+ const c = uo(s, n, r) ? lr(s) : Ce(0);
1055
1057
  let a = (o.left + c.x) / i.x, u = (o.top + c.y) / i.y, l = o.width / i.x, p = o.height / i.y;
1056
1058
  if (s) {
1057
- const g = ge(s), d = r && q(r) ? ge(r) : r;
1059
+ const g = he(s), d = r && Y(r) ? he(r) : r;
1058
1060
  let h = g, m = Jt(h);
1059
1061
  for (; m && r && d !== h; ) {
1060
- const y = Je(m), E = m.getBoundingClientRect(), v = we(m), x = E.left + (m.clientLeft + parseFloat(v.paddingLeft)) * y.x, I = E.top + (m.clientTop + parseFloat(v.paddingTop)) * y.y;
1061
- a *= y.x, u *= y.y, l *= y.x, p *= y.y, a += x, u += I, h = ge(m), m = Jt(h);
1062
+ const y = Xe(m), R = m.getBoundingClientRect(), v = we(m), x = R.left + (m.clientLeft + parseFloat(v.paddingLeft)) * y.x, C = R.top + (m.clientTop + parseFloat(v.paddingTop)) * y.y;
1063
+ a *= y.x, u *= y.y, l *= y.x, p *= y.y, a += x, u += C, h = he(m), m = Jt(h);
1062
1064
  }
1063
1065
  }
1064
- return It({
1066
+ return Ct({
1065
1067
  width: l,
1066
1068
  height: p,
1067
1069
  x: a,
@@ -1070,9 +1072,9 @@ function Ue(e, t, n, r) {
1070
1072
  }
1071
1073
  function cn(e, t) {
1072
1074
  const n = Dt(e).scrollLeft;
1073
- return t ? t.left + n : Ue(Te(e)).left + n;
1075
+ return t ? t.left + n : Ue(Oe(e)).left + n;
1074
1076
  }
1075
- function lr(e, t, n) {
1077
+ function ar(e, t, n) {
1076
1078
  n === void 0 && (n = !1);
1077
1079
  const r = e.getBoundingClientRect(), o = r.left + t.scrollLeft - (n ? 0 : (
1078
1080
  // RTL <body> scrollbar.
@@ -1083,26 +1085,26 @@ function lr(e, t, n) {
1083
1085
  y: s
1084
1086
  };
1085
1087
  }
1086
- function so(e) {
1088
+ function lo(e) {
1087
1089
  let {
1088
1090
  elements: t,
1089
1091
  rect: n,
1090
1092
  offsetParent: r,
1091
1093
  strategy: o
1092
1094
  } = e;
1093
- const s = o === "fixed", i = Te(r), c = t ? St(t.floating) : !1;
1095
+ const s = o === "fixed", i = Oe(r), c = t ? Pt(t.floating) : !1;
1094
1096
  if (r === i || c && s)
1095
1097
  return n;
1096
1098
  let a = {
1097
1099
  scrollLeft: 0,
1098
1100
  scrollTop: 0
1099
- }, u = Ie(1);
1100
- const l = Ie(0), p = ie(r);
1101
- if ((p || !p && !s) && ((Ke(r) !== "body" || ut(i)) && (a = Dt(r)), ie(r))) {
1101
+ }, u = Ce(1);
1102
+ const l = Ce(0), p = re(r);
1103
+ if ((p || !p && !s) && ((We(r) !== "body" || ut(i)) && (a = Dt(r)), re(r))) {
1102
1104
  const d = Ue(r);
1103
- u = Je(r), l.x = d.x + r.clientLeft, l.y = d.y + r.clientTop;
1105
+ u = Xe(r), l.x = d.x + r.clientLeft, l.y = d.y + r.clientTop;
1104
1106
  }
1105
- const g = i && !p && !s ? lr(i, a, !0) : Ie(0);
1107
+ const g = i && !p && !s ? ar(i, a, !0) : Ce(0);
1106
1108
  return {
1107
1109
  width: n.width * u.x,
1108
1110
  height: n.height * u.y,
@@ -1110,26 +1112,26 @@ function so(e) {
1110
1112
  y: n.y * u.y - a.scrollTop * u.y + l.y + g.y
1111
1113
  };
1112
1114
  }
1113
- function co(e) {
1115
+ function ao(e) {
1114
1116
  return Array.from(e.getClientRects());
1115
1117
  }
1116
- function uo(e) {
1117
- const t = Te(e), n = Dt(e), r = e.ownerDocument.body, o = he(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = he(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
1118
+ function fo(e) {
1119
+ const t = Oe(e), n = Dt(e), r = e.ownerDocument.body, o = be(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = be(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
1118
1120
  let i = -n.scrollLeft + cn(e);
1119
1121
  const c = -n.scrollTop;
1120
- return we(r).direction === "rtl" && (i += he(t.clientWidth, r.clientWidth) - o), {
1122
+ return we(r).direction === "rtl" && (i += be(t.clientWidth, r.clientWidth) - o), {
1121
1123
  width: o,
1122
1124
  height: s,
1123
1125
  x: i,
1124
1126
  y: c
1125
1127
  };
1126
1128
  }
1127
- function lo(e, t) {
1128
- const n = ge(e), r = Te(e), o = n.visualViewport;
1129
+ function mo(e, t) {
1130
+ const n = he(e), r = Oe(e), o = n.visualViewport;
1129
1131
  let s = r.clientWidth, i = r.clientHeight, c = 0, a = 0;
1130
1132
  if (o) {
1131
1133
  s = o.width, i = o.height;
1132
- const u = Pt();
1134
+ const u = St();
1133
1135
  (!u || u && t === "fixed") && (c = o.offsetLeft, a = o.offsetTop);
1134
1136
  }
1135
1137
  return {
@@ -1139,8 +1141,8 @@ function lo(e, t) {
1139
1141
  y: a
1140
1142
  };
1141
1143
  }
1142
- function ao(e, t) {
1143
- const n = Ue(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, s = ie(e) ? Je(e) : Ie(1), i = e.clientWidth * s.x, c = e.clientHeight * s.y, a = o * s.x, u = r * s.y;
1144
+ function po(e, t) {
1145
+ const n = Ue(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, s = re(e) ? Xe(e) : Ce(1), i = e.clientWidth * s.x, c = e.clientHeight * s.y, a = o * s.x, u = r * s.y;
1144
1146
  return {
1145
1147
  width: i,
1146
1148
  height: c,
@@ -1151,13 +1153,13 @@ function ao(e, t) {
1151
1153
  function yn(e, t, n) {
1152
1154
  let r;
1153
1155
  if (t === "viewport")
1154
- r = lo(e, n);
1156
+ r = mo(e, n);
1155
1157
  else if (t === "document")
1156
- r = uo(Te(e));
1157
- else if (q(t))
1158
- r = ao(t, n);
1158
+ r = fo(Oe(e));
1159
+ else if (Y(t))
1160
+ r = po(t, n);
1159
1161
  else {
1160
- const o = ur(e);
1162
+ const o = lr(e);
1161
1163
  r = {
1162
1164
  x: t.x - o.x,
1163
1165
  y: t.y - o.y,
@@ -1165,35 +1167,35 @@ function yn(e, t, n) {
1165
1167
  height: t.height
1166
1168
  };
1167
1169
  }
1168
- return It(r);
1170
+ return Ct(r);
1169
1171
  }
1170
- function ar(e, t) {
1171
- const n = Pe(e);
1172
- return n === t || !q(n) || Se(n) ? !1 : we(n).position === "fixed" || ar(n, t);
1172
+ function fr(e, t) {
1173
+ const n = De(e);
1174
+ return n === t || !Y(n) || Se(n) ? !1 : we(n).position === "fixed" || fr(n, t);
1173
1175
  }
1174
- function fo(e, t) {
1176
+ function go(e, t) {
1175
1177
  const n = t.get(e);
1176
1178
  if (n)
1177
1179
  return n;
1178
- let r = Le(e, [], !1).filter((c) => q(c) && Ke(c) !== "body"), o = null;
1180
+ let r = Le(e, [], !1).filter((c) => Y(c) && We(c) !== "body"), o = null;
1179
1181
  const s = we(e).position === "fixed";
1180
- let i = s ? Pe(e) : e;
1181
- for (; q(i) && !Se(i); ) {
1182
+ let i = s ? De(e) : e;
1183
+ for (; Y(i) && !Se(i); ) {
1182
1184
  const c = we(i), a = nn(i);
1183
- !a && c.position === "fixed" && (o = null), (s ? !a && !o : !a && c.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || ut(i) && !a && ar(e, i)) ? r = r.filter((l) => l !== i) : o = c, i = Pe(i);
1185
+ !a && c.position === "fixed" && (o = null), (s ? !a && !o : !a && c.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || ut(i) && !a && fr(e, i)) ? r = r.filter((l) => l !== i) : o = c, i = De(i);
1184
1186
  }
1185
1187
  return t.set(e, r), r;
1186
1188
  }
1187
- function mo(e) {
1189
+ function ho(e) {
1188
1190
  let {
1189
1191
  element: t,
1190
1192
  boundary: n,
1191
1193
  rootBoundary: r,
1192
1194
  strategy: o
1193
1195
  } = e;
1194
- const i = [...n === "clippingAncestors" ? St(t) ? [] : fo(t, this._c) : [].concat(n), r], c = i[0], a = i.reduce((u, l) => {
1196
+ const i = [...n === "clippingAncestors" ? Pt(t) ? [] : go(t, this._c) : [].concat(n), r], c = i[0], a = i.reduce((u, l) => {
1195
1197
  const p = yn(t, l, o);
1196
- return u.top = he(p.top, u.top), u.right = Qe(p.right, u.right), u.bottom = Qe(p.bottom, u.bottom), u.left = he(p.left, u.left), u;
1198
+ return u.top = be(p.top, u.top), u.right = Qe(p.right, u.right), u.bottom = Qe(p.bottom, u.bottom), u.left = be(p.left, u.left), u;
1197
1199
  }, yn(t, c, o));
1198
1200
  return {
1199
1201
  width: a.right - a.left,
@@ -1202,29 +1204,29 @@ function mo(e) {
1202
1204
  y: a.top
1203
1205
  };
1204
1206
  }
1205
- function go(e) {
1207
+ function vo(e) {
1206
1208
  const {
1207
1209
  width: t,
1208
1210
  height: n
1209
- } = cr(e);
1211
+ } = ur(e);
1210
1212
  return {
1211
1213
  width: t,
1212
1214
  height: n
1213
1215
  };
1214
1216
  }
1215
- function po(e, t, n) {
1216
- const r = ie(t), o = Te(t), s = n === "fixed", i = Ue(e, !0, s, t);
1217
+ function bo(e, t, n) {
1218
+ const r = re(t), o = Oe(t), s = n === "fixed", i = Ue(e, !0, s, t);
1217
1219
  let c = {
1218
1220
  scrollLeft: 0,
1219
1221
  scrollTop: 0
1220
1222
  };
1221
- const a = Ie(0);
1223
+ const a = Ce(0);
1222
1224
  if (r || !r && !s)
1223
- if ((Ke(t) !== "body" || ut(o)) && (c = Dt(t)), r) {
1225
+ if ((We(t) !== "body" || ut(o)) && (c = Dt(t)), r) {
1224
1226
  const g = Ue(t, !0, s, t);
1225
1227
  a.x = g.x + t.clientLeft, a.y = g.y + t.clientTop;
1226
1228
  } else o && (a.x = cn(o));
1227
- const u = o && !r && !s ? lr(o, c) : Ie(0), l = i.left + c.scrollLeft - a.x - u.x, p = i.top + c.scrollTop - a.y - u.y;
1229
+ const u = o && !r && !s ? ar(o, c) : Ce(0), l = i.left + c.scrollLeft - a.x - u.x, p = i.top + c.scrollTop - a.y - u.y;
1228
1230
  return {
1229
1231
  x: l,
1230
1232
  y: p,
@@ -1232,39 +1234,39 @@ function po(e, t, n) {
1232
1234
  height: i.height
1233
1235
  };
1234
1236
  }
1235
- function Wt(e) {
1237
+ function Vt(e) {
1236
1238
  return we(e).position === "static";
1237
1239
  }
1238
1240
  function xn(e, t) {
1239
- if (!ie(e) || we(e).position === "fixed")
1241
+ if (!re(e) || we(e).position === "fixed")
1240
1242
  return null;
1241
1243
  if (t)
1242
1244
  return t(e);
1243
1245
  let n = e.offsetParent;
1244
- return Te(e) === n && (n = n.ownerDocument.body), n;
1246
+ return Oe(e) === n && (n = n.ownerDocument.body), n;
1245
1247
  }
1246
- function fr(e, t) {
1247
- const n = ge(e);
1248
- if (St(e))
1248
+ function dr(e, t) {
1249
+ const n = he(e);
1250
+ if (Pt(e))
1249
1251
  return n;
1250
- if (!ie(e)) {
1251
- let o = Pe(e);
1252
+ if (!re(e)) {
1253
+ let o = De(e);
1252
1254
  for (; o && !Se(o); ) {
1253
- if (q(o) && !Wt(o))
1255
+ if (Y(o) && !Vt(o))
1254
1256
  return o;
1255
- o = Pe(o);
1257
+ o = De(o);
1256
1258
  }
1257
1259
  return n;
1258
1260
  }
1259
1261
  let r = xn(e, t);
1260
- for (; r && Ar(r) && Wt(r); )
1262
+ for (; r && Mr(r) && Vt(r); )
1261
1263
  r = xn(r, t);
1262
- return r && Se(r) && Wt(r) && !nn(r) ? n : r || Mr(e) || n;
1264
+ return r && Se(r) && Vt(r) && !nn(r) ? n : r || Pr(e) || n;
1263
1265
  }
1264
- const ho = async function(e) {
1265
- const t = this.getOffsetParent || fr, n = this.getDimensions, r = await n(e.floating);
1266
+ const yo = async function(e) {
1267
+ const t = this.getOffsetParent || dr, n = this.getDimensions, r = await n(e.floating);
1266
1268
  return {
1267
- reference: po(e.reference, await t(e.floating), e.strategy),
1269
+ reference: bo(e.reference, await t(e.floating), e.strategy),
1268
1270
  floating: {
1269
1271
  x: 0,
1270
1272
  y: 0,
@@ -1273,27 +1275,27 @@ const ho = async function(e) {
1273
1275
  }
1274
1276
  };
1275
1277
  };
1276
- function vo(e) {
1278
+ function xo(e) {
1277
1279
  return we(e).direction === "rtl";
1278
1280
  }
1279
- const bo = {
1280
- convertOffsetParentRelativeRectToViewportRelativeRect: so,
1281
- getDocumentElement: Te,
1282
- getClippingRect: mo,
1283
- getOffsetParent: fr,
1284
- getElementRects: ho,
1285
- getClientRects: co,
1286
- getDimensions: go,
1287
- getScale: Je,
1288
- isElement: q,
1289
- isRTL: vo
1281
+ const wo = {
1282
+ convertOffsetParentRelativeRectToViewportRelativeRect: lo,
1283
+ getDocumentElement: Oe,
1284
+ getClippingRect: ho,
1285
+ getOffsetParent: dr,
1286
+ getElementRects: yo,
1287
+ getClientRects: ao,
1288
+ getDimensions: vo,
1289
+ getScale: Xe,
1290
+ isElement: Y,
1291
+ isRTL: xo
1290
1292
  };
1291
- function dr(e, t) {
1293
+ function mr(e, t) {
1292
1294
  return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
1293
1295
  }
1294
- function yo(e, t) {
1296
+ function Ro(e, t) {
1295
1297
  let n = null, r;
1296
- const o = Te(e);
1298
+ const o = Oe(e);
1297
1299
  function s() {
1298
1300
  var c;
1299
1301
  clearTimeout(r), (c = n) == null || c.disconnect(), n = null;
@@ -1308,21 +1310,21 @@ function yo(e, t) {
1308
1310
  } = u;
1309
1311
  if (c || t(), !g || !d)
1310
1312
  return;
1311
- const h = qe(p), m = qe(o.clientWidth - (l + g)), y = qe(o.clientHeight - (p + d)), E = qe(l), x = {
1312
- rootMargin: -h + "px " + -m + "px " + -y + "px " + -E + "px",
1313
- threshold: he(0, Qe(1, a)) || 1
1313
+ const h = je(p), m = je(o.clientWidth - (l + g)), y = je(o.clientHeight - (p + d)), R = je(l), x = {
1314
+ rootMargin: -h + "px " + -m + "px " + -y + "px " + -R + "px",
1315
+ threshold: be(0, Qe(1, a)) || 1
1314
1316
  };
1315
- let I = !0;
1317
+ let C = !0;
1316
1318
  function A(k) {
1317
- const L = k[0].intersectionRatio;
1318
- if (L !== a) {
1319
- if (!I)
1319
+ const N = k[0].intersectionRatio;
1320
+ if (N !== a) {
1321
+ if (!C)
1320
1322
  return i();
1321
- L ? i(!1, L) : r = setTimeout(() => {
1323
+ N ? i(!1, N) : r = setTimeout(() => {
1322
1324
  i(!1, 1e-7);
1323
1325
  }, 1e3);
1324
1326
  }
1325
- L === 1 && !dr(u, e.getBoundingClientRect()) && i(), I = !1;
1327
+ N === 1 && !mr(u, e.getBoundingClientRect()) && i(), C = !1;
1326
1328
  }
1327
1329
  try {
1328
1330
  n = new IntersectionObserver(A, {
@@ -1337,7 +1339,7 @@ function yo(e, t) {
1337
1339
  }
1338
1340
  return i(!0), s;
1339
1341
  }
1340
- function ri(e, t, n, r) {
1342
+ function ui(e, t, n, r) {
1341
1343
  r === void 0 && (r = {});
1342
1344
  const {
1343
1345
  ancestorScroll: o = !0,
@@ -1346,15 +1348,15 @@ function ri(e, t, n, r) {
1346
1348
  layoutShift: c = typeof IntersectionObserver == "function",
1347
1349
  animationFrame: a = !1
1348
1350
  } = r, u = sn(e), l = o || s ? [...u ? Le(u) : [], ...Le(t)] : [];
1349
- l.forEach((E) => {
1350
- o && E.addEventListener("scroll", n, {
1351
+ l.forEach((R) => {
1352
+ o && R.addEventListener("scroll", n, {
1351
1353
  passive: !0
1352
- }), s && E.addEventListener("resize", n);
1354
+ }), s && R.addEventListener("resize", n);
1353
1355
  });
1354
- const p = u && c ? yo(u, n) : null;
1356
+ const p = u && c ? Ro(u, n) : null;
1355
1357
  let g = -1, d = null;
1356
- i && (d = new ResizeObserver((E) => {
1357
- let [v] = E;
1358
+ i && (d = new ResizeObserver((R) => {
1359
+ let [v] = R;
1358
1360
  v && v.target === u && d && (d.unobserve(t), cancelAnimationFrame(g), g = requestAnimationFrame(() => {
1359
1361
  var x;
1360
1362
  (x = d) == null || x.observe(t);
@@ -1363,31 +1365,32 @@ function ri(e, t, n, r) {
1363
1365
  let h, m = a ? Ue(e) : null;
1364
1366
  a && y();
1365
1367
  function y() {
1366
- const E = Ue(e);
1367
- m && !dr(m, E) && n(), m = E, h = requestAnimationFrame(y);
1368
+ const R = Ue(e);
1369
+ m && !mr(m, R) && n(), m = R, h = requestAnimationFrame(y);
1368
1370
  }
1369
1371
  return n(), () => {
1370
- var E;
1372
+ var R;
1371
1373
  l.forEach((v) => {
1372
1374
  o && v.removeEventListener("scroll", n), s && v.removeEventListener("resize", n);
1373
- }), p == null || p(), (E = d) == null || E.disconnect(), d = null, a && cancelAnimationFrame(h);
1375
+ }), p == null || p(), (R = d) == null || R.disconnect(), d = null, a && cancelAnimationFrame(h);
1374
1376
  };
1375
1377
  }
1376
- const xo = to, wo = Qr, Ro = no, Eo = Zr, Io = ro, Co = (e, t, n) => {
1378
+ const Eo = oo, Co = to, Io = io, To = no, Oo = so, Ao = (e, t, n) => {
1377
1379
  const r = /* @__PURE__ */ new Map(), o = {
1378
- platform: bo,
1380
+ platform: wo,
1379
1381
  ...n
1380
1382
  }, s = {
1381
1383
  ...o.platform,
1382
1384
  _c: r
1383
1385
  };
1384
- return Xr(e, t, {
1386
+ return Zr(e, t, {
1385
1387
  ...o,
1386
1388
  platform: s
1387
1389
  });
1388
1390
  };
1389
- var xt = typeof document < "u" ? Vn : Wn;
1390
- function Ot(e, t) {
1391
+ var Mo = typeof document < "u", Po = function() {
1392
+ }, xt = Mo ? $n : Po;
1393
+ function Tt(e, t) {
1391
1394
  if (e === t)
1392
1395
  return !0;
1393
1396
  if (typeof e != typeof t)
@@ -1399,7 +1402,7 @@ function Ot(e, t) {
1399
1402
  if (Array.isArray(e)) {
1400
1403
  if (n = e.length, n !== t.length) return !1;
1401
1404
  for (r = n; r-- !== 0; )
1402
- if (!Ot(e[r], t[r]))
1405
+ if (!Tt(e[r], t[r]))
1403
1406
  return !1;
1404
1407
  return !0;
1405
1408
  }
@@ -1410,18 +1413,18 @@ function Ot(e, t) {
1410
1413
  return !1;
1411
1414
  for (r = n; r-- !== 0; ) {
1412
1415
  const s = o[r];
1413
- if (!(s === "_owner" && e.$$typeof) && !Ot(e[s], t[s]))
1416
+ if (!(s === "_owner" && e.$$typeof) && !Tt(e[s], t[s]))
1414
1417
  return !1;
1415
1418
  }
1416
1419
  return !0;
1417
1420
  }
1418
1421
  return e !== e && t !== t;
1419
1422
  }
1420
- function mr(e) {
1423
+ function pr(e) {
1421
1424
  return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1422
1425
  }
1423
1426
  function wn(e, t) {
1424
- const n = mr(e);
1427
+ const n = pr(e);
1425
1428
  return Math.round(t * n) / n;
1426
1429
  }
1427
1430
  function $t(e) {
@@ -1430,7 +1433,7 @@ function $t(e) {
1430
1433
  t.current = e;
1431
1434
  }), t;
1432
1435
  }
1433
- function Oo(e) {
1436
+ function So(e) {
1434
1437
  e === void 0 && (e = {});
1435
1438
  const {
1436
1439
  placement: t = "bottom",
@@ -1452,103 +1455,103 @@ function Oo(e) {
1452
1455
  middlewareData: {},
1453
1456
  isPositioned: !1
1454
1457
  }), [g, d] = f.useState(r);
1455
- Ot(g, r) || d(r);
1456
- const [h, m] = f.useState(null), [y, E] = f.useState(null), v = f.useCallback((b) => {
1458
+ Tt(g, r) || d(r);
1459
+ const [h, m] = f.useState(null), [y, R] = f.useState(null), v = f.useCallback((b) => {
1457
1460
  b !== k.current && (k.current = b, m(b));
1458
1461
  }, []), x = f.useCallback((b) => {
1459
- b !== L.current && (L.current = b, E(b));
1460
- }, []), I = s || h, A = i || y, k = f.useRef(null), L = f.useRef(null), M = f.useRef(l), F = a != null, N = $t(a), _ = $t(o), U = $t(u), V = f.useCallback(() => {
1461
- if (!k.current || !L.current)
1462
+ b !== N.current && (N.current = b, R(b));
1463
+ }, []), C = s || h, A = i || y, k = f.useRef(null), N = f.useRef(null), D = f.useRef(l), L = a != null, F = $t(a), _ = $t(o), U = $t(u), K = f.useCallback(() => {
1464
+ if (!k.current || !N.current)
1462
1465
  return;
1463
1466
  const b = {
1464
1467
  placement: t,
1465
1468
  strategy: n,
1466
1469
  middleware: g
1467
1470
  };
1468
- _.current && (b.platform = _.current), Co(k.current, L.current, b).then((R) => {
1469
- const S = {
1470
- ...R,
1471
+ _.current && (b.platform = _.current), Ao(k.current, N.current, b).then((E) => {
1472
+ const P = {
1473
+ ...E,
1471
1474
  // The floating element's position may be recomputed while it's closed
1472
1475
  // but still mounted (such as when transitioning out). To ensure
1473
1476
  // `isPositioned` will be `false` initially on the next open, avoid
1474
1477
  // setting it to `true` when `open === false` (must be specified).
1475
1478
  isPositioned: U.current !== !1
1476
1479
  };
1477
- T.current && !Ot(M.current, S) && (M.current = S, tn.flushSync(() => {
1478
- p(S);
1480
+ O.current && !Tt(D.current, P) && (D.current = P, tn.flushSync(() => {
1481
+ p(P);
1479
1482
  }));
1480
1483
  });
1481
1484
  }, [g, t, n, _, U]);
1482
1485
  xt(() => {
1483
- u === !1 && M.current.isPositioned && (M.current.isPositioned = !1, p((b) => ({
1486
+ u === !1 && D.current.isPositioned && (D.current.isPositioned = !1, p((b) => ({
1484
1487
  ...b,
1485
1488
  isPositioned: !1
1486
1489
  })));
1487
1490
  }, [u]);
1488
- const T = f.useRef(!1);
1489
- xt(() => (T.current = !0, () => {
1490
- T.current = !1;
1491
+ const O = f.useRef(!1);
1492
+ xt(() => (O.current = !0, () => {
1493
+ O.current = !1;
1491
1494
  }), []), xt(() => {
1492
- if (I && (k.current = I), A && (L.current = A), I && A) {
1493
- if (N.current)
1494
- return N.current(I, A, V);
1495
- V();
1495
+ if (C && (k.current = C), A && (N.current = A), C && A) {
1496
+ if (F.current)
1497
+ return F.current(C, A, K);
1498
+ K();
1496
1499
  }
1497
- }, [I, A, V, N, F]);
1500
+ }, [C, A, K, F, L]);
1498
1501
  const w = f.useMemo(() => ({
1499
1502
  reference: k,
1500
- floating: L,
1503
+ floating: N,
1501
1504
  setReference: v,
1502
1505
  setFloating: x
1503
- }), [v, x]), K = f.useMemo(() => ({
1504
- reference: I,
1506
+ }), [v, x]), W = f.useMemo(() => ({
1507
+ reference: C,
1505
1508
  floating: A
1506
- }), [I, A]), O = f.useMemo(() => {
1509
+ }), [C, A]), T = f.useMemo(() => {
1507
1510
  const b = {
1508
1511
  position: n,
1509
1512
  left: 0,
1510
1513
  top: 0
1511
1514
  };
1512
- if (!K.floating)
1515
+ if (!W.floating)
1513
1516
  return b;
1514
- const R = wn(K.floating, l.x), S = wn(K.floating, l.y);
1517
+ const E = wn(W.floating, l.x), P = wn(W.floating, l.y);
1515
1518
  return c ? {
1516
1519
  ...b,
1517
- transform: "translate(" + R + "px, " + S + "px)",
1518
- ...mr(K.floating) >= 1.5 && {
1520
+ transform: "translate(" + E + "px, " + P + "px)",
1521
+ ...pr(W.floating) >= 1.5 && {
1519
1522
  willChange: "transform"
1520
1523
  }
1521
1524
  } : {
1522
1525
  position: n,
1523
- left: R,
1524
- top: S
1526
+ left: E,
1527
+ top: P
1525
1528
  };
1526
- }, [n, c, K.floating, l.x, l.y]);
1529
+ }, [n, c, W.floating, l.x, l.y]);
1527
1530
  return f.useMemo(() => ({
1528
1531
  ...l,
1529
- update: V,
1532
+ update: K,
1530
1533
  refs: w,
1531
- elements: K,
1532
- floatingStyles: O
1533
- }), [l, V, w, K, O]);
1534
+ elements: W,
1535
+ floatingStyles: T
1536
+ }), [l, K, w, W, T]);
1534
1537
  }
1535
- const oi = (e, t) => ({
1536
- ...xo(e),
1537
- options: [e, t]
1538
- }), ii = (e, t) => ({
1539
- ...Ro(e),
1540
- options: [e, t]
1541
- }), si = (e, t) => ({
1538
+ const li = (e, t) => ({
1542
1539
  ...Eo(e),
1543
1540
  options: [e, t]
1544
- }), ci = (e, t) => ({
1541
+ }), ai = (e, t) => ({
1545
1542
  ...Io(e),
1546
1543
  options: [e, t]
1547
- }), ui = (e, t) => ({
1548
- ...wo(e),
1544
+ }), fi = (e, t) => ({
1545
+ ...To(e),
1546
+ options: [e, t]
1547
+ }), di = (e, t) => ({
1548
+ ...Oo(e),
1549
+ options: [e, t]
1550
+ }), mi = (e, t) => ({
1551
+ ...Co(e),
1549
1552
  options: [e, t]
1550
1553
  });
1551
- function To(e) {
1554
+ function Do(e) {
1552
1555
  const t = f.useRef(void 0), n = f.useCallback((r) => {
1553
1556
  const o = e.map((s) => {
1554
1557
  if (s != null) {
@@ -1571,7 +1574,7 @@ function To(e) {
1571
1574
  t.current && (t.current(), t.current = void 0), r != null && (t.current = n(r));
1572
1575
  }, e);
1573
1576
  }
1574
- function Ao(e, t) {
1577
+ function ko(e, t) {
1575
1578
  const n = e.compareDocumentPosition(t);
1576
1579
  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;
1577
1580
  }
@@ -1585,7 +1588,7 @@ const gr = /* @__PURE__ */ f.createContext({
1585
1588
  current: []
1586
1589
  }
1587
1590
  });
1588
- function Mo(e) {
1591
+ function Lo(e) {
1589
1592
  const {
1590
1593
  children: t,
1591
1594
  elementsRef: n,
@@ -1599,11 +1602,11 @@ function Mo(e) {
1599
1602
  });
1600
1603
  }, []), a = f.useMemo(() => {
1601
1604
  const u = /* @__PURE__ */ new Map();
1602
- return Array.from(o.keys()).sort(Ao).forEach((p, g) => {
1605
+ return Array.from(o.keys()).sort(ko).forEach((p, g) => {
1603
1606
  u.set(p, g);
1604
1607
  }), u;
1605
1608
  }, [o]);
1606
- return /* @__PURE__ */ me(gr.Provider, {
1609
+ return /* @__PURE__ */ ge(gr.Provider, {
1607
1610
  value: f.useMemo(() => ({
1608
1611
  register: i,
1609
1612
  unregister: c,
@@ -1614,7 +1617,7 @@ function Mo(e) {
1614
1617
  children: t
1615
1618
  });
1616
1619
  }
1617
- function So(e) {
1620
+ function Fo(e) {
1618
1621
  e === void 0 && (e = {});
1619
1622
  const {
1620
1623
  label: t
@@ -1645,17 +1648,17 @@ function So(e) {
1645
1648
  index: c ?? -1
1646
1649
  }), [c, l]);
1647
1650
  }
1648
- const Po = "data-floating-ui-focusable", Rn = "active", En = "selected", Ne = "ArrowLeft", _e = "ArrowRight", st = "ArrowUp", Fe = "ArrowDown";
1649
- function pr(e, t) {
1650
- return typeof e == "function" ? e(t) : e ? /* @__PURE__ */ f.cloneElement(e, t) : /* @__PURE__ */ me("div", {
1651
+ const No = "data-floating-ui-focusable", Rn = "active", En = "selected", Ne = "ArrowLeft", _e = "ArrowRight", st = "ArrowUp", Fe = "ArrowDown";
1652
+ function hr(e, t) {
1653
+ return typeof e == "function" ? e(t) : e ? /* @__PURE__ */ f.cloneElement(e, t) : /* @__PURE__ */ ge("div", {
1651
1654
  ...t
1652
1655
  });
1653
1656
  }
1654
- const hr = /* @__PURE__ */ f.createContext({
1657
+ const vr = /* @__PURE__ */ f.createContext({
1655
1658
  activeIndex: 0,
1656
1659
  onNavigate: () => {
1657
1660
  }
1658
- }), vr = [Ne, _e], br = [st, Fe], Bt = [...vr, ...br], li = /* @__PURE__ */ f.forwardRef(function(t, n) {
1661
+ }), br = [Ne, _e], yr = [st, Fe], Bt = [...br, ...yr], pi = /* @__PURE__ */ f.forwardRef(function(t, n) {
1659
1662
  const {
1660
1663
  render: r,
1661
1664
  orientation: o = "both",
@@ -1668,95 +1671,95 @@ const hr = /* @__PURE__ */ f.createContext({
1668
1671
  itemSizes: p,
1669
1672
  dense: g = !1,
1670
1673
  ...d
1671
- } = t, [h, m] = f.useState(0), y = u ?? h, E = ae(l ?? m), v = f.useRef([]), x = r && typeof r != "function" ? r.props : {}, I = f.useMemo(() => ({
1674
+ } = t, [h, m] = f.useState(0), y = u ?? h, R = se(l ?? m), v = f.useRef([]), x = r && typeof r != "function" ? r.props : {}, C = f.useMemo(() => ({
1672
1675
  activeIndex: y,
1673
- onNavigate: E
1674
- }), [y, E]), A = c > 1;
1675
- function k(M) {
1676
- if (!Bt.includes(M.key)) return;
1677
- let F = y;
1678
- const N = yt(v, a), _ = en(v, a), U = i ? Ne : _e, V = i ? _e : Ne;
1676
+ onNavigate: R
1677
+ }), [y, R]), A = c > 1;
1678
+ function k(D) {
1679
+ if (!Bt.includes(D.key)) return;
1680
+ let L = y;
1681
+ const F = yt(v, a), _ = en(v, a), U = i ? Ne : _e, K = i ? _e : Ne;
1679
1682
  if (A) {
1680
1683
  const b = p || Array.from({
1681
1684
  length: v.current.length
1682
1685
  }, () => ({
1683
1686
  width: 1,
1684
1687
  height: 1
1685
- })), R = tr(b, c, g), S = R.findIndex((W) => W != null && !He(v, W, a)), G = R.reduce((W, te, fe) => te != null && !He(v, te, a) ? fe : W, -1), C = R[er({
1686
- current: R.map((W) => W ? v.current[W] : null)
1688
+ })), E = nr(b, c, g), P = E.findIndex((V) => V != null && !He(v, V, a)), G = E.reduce((V, ee, ae) => ee != null && !He(v, ee, a) ? ae : V, -1), I = E[tr({
1689
+ current: E.map((V) => V ? v.current[V] : null)
1687
1690
  }, {
1688
- event: M,
1691
+ event: D,
1689
1692
  orientation: o,
1690
1693
  loop: s,
1691
1694
  rtl: i,
1692
1695
  cols: c,
1693
1696
  // treat undefined (empty grid spaces) as disabled indices so we
1694
1697
  // don't end up in them
1695
- disabledIndices: rr([...a || v.current.map((W, te) => He(v, te) ? te : void 0), void 0], R),
1696
- minIndex: S,
1698
+ disabledIndices: or([...(typeof a != "function" ? a : null) || v.current.map((V, ee) => He(v, ee, a) ? ee : void 0), void 0], E),
1699
+ minIndex: P,
1697
1700
  maxIndex: G,
1698
- prevIndex: nr(
1699
- y > _ ? N : y,
1701
+ prevIndex: rr(
1702
+ y > _ ? F : y,
1700
1703
  b,
1701
- R,
1704
+ E,
1702
1705
  c,
1703
1706
  // use a corner matching the edge closest to the direction we're
1704
1707
  // moving in so we don't end up in the same item. Prefer
1705
1708
  // top/left over bottom/right.
1706
- M.key === Fe ? "bl" : M.key === U ? "tr" : "tl"
1709
+ D.key === Fe ? "bl" : D.key === U ? "tr" : "tl"
1707
1710
  )
1708
1711
  })];
1709
- C != null && (F = C);
1712
+ I != null && (L = I);
1710
1713
  }
1711
- const T = {
1714
+ const O = {
1712
1715
  horizontal: [U],
1713
1716
  vertical: [Fe],
1714
1717
  both: [U, Fe]
1715
1718
  }[o], w = {
1716
- horizontal: [V],
1719
+ horizontal: [K],
1717
1720
  vertical: [st],
1718
- both: [V, st]
1719
- }[o], K = A ? Bt : {
1720
- horizontal: vr,
1721
- vertical: br,
1721
+ both: [K, st]
1722
+ }[o], W = A ? Bt : {
1723
+ horizontal: br,
1724
+ vertical: yr,
1722
1725
  both: Bt
1723
1726
  }[o];
1724
- if (F === y && [...T, ...w].includes(M.key) && (s && F === _ && T.includes(M.key) ? F = N : s && F === N && w.includes(M.key) ? F = _ : F = ue(v, {
1725
- startingIndex: F,
1726
- decrement: w.includes(M.key),
1727
+ if (L === y && [...O, ...w].includes(D.key) && (s && L === _ && O.includes(D.key) ? L = F : s && L === F && w.includes(D.key) ? L = _ : L = ue(v, {
1728
+ startingIndex: L,
1729
+ decrement: w.includes(D.key),
1727
1730
  disabledIndices: a
1728
- })), F !== y && !Xe(v, F)) {
1729
- var O;
1730
- M.stopPropagation(), K.includes(M.key) && M.preventDefault(), E(F), (O = v.current[F]) == null || O.focus();
1731
+ })), L !== y && !Ye(v, L)) {
1732
+ var T;
1733
+ D.stopPropagation(), W.includes(D.key) && D.preventDefault(), R(L), (T = v.current[L]) == null || T.focus();
1731
1734
  }
1732
1735
  }
1733
- const L = {
1736
+ const N = {
1734
1737
  ...d,
1735
1738
  ...x,
1736
1739
  ref: n,
1737
1740
  "aria-orientation": o === "both" ? void 0 : o,
1738
- onKeyDown(M) {
1739
- d.onKeyDown == null || d.onKeyDown(M), x.onKeyDown == null || x.onKeyDown(M), k(M);
1741
+ onKeyDown(D) {
1742
+ d.onKeyDown == null || d.onKeyDown(D), x.onKeyDown == null || x.onKeyDown(D), k(D);
1740
1743
  }
1741
1744
  };
1742
- return /* @__PURE__ */ me(hr.Provider, {
1743
- value: I,
1744
- children: /* @__PURE__ */ me(Mo, {
1745
+ return /* @__PURE__ */ ge(vr.Provider, {
1746
+ value: C,
1747
+ children: /* @__PURE__ */ ge(Lo, {
1745
1748
  elementsRef: v,
1746
- children: pr(r, L)
1749
+ children: hr(r, N)
1747
1750
  })
1748
1751
  });
1749
- }), ai = /* @__PURE__ */ f.forwardRef(function(t, n) {
1752
+ }), gi = /* @__PURE__ */ f.forwardRef(function(t, n) {
1750
1753
  const {
1751
1754
  render: r,
1752
1755
  ...o
1753
1756
  } = t, s = r && typeof r != "function" ? r.props : {}, {
1754
1757
  activeIndex: i,
1755
1758
  onNavigate: c
1756
- } = f.useContext(hr), {
1759
+ } = f.useContext(vr), {
1757
1760
  ref: a,
1758
1761
  index: u
1759
- } = So(), l = To([a, n, s.ref]), p = i === u, g = {
1762
+ } = Fo(), l = Do([a, n, s.ref]), p = i === u, g = {
1760
1763
  ...o,
1761
1764
  ...s,
1762
1765
  ref: l,
@@ -1766,25 +1769,25 @@ const hr = /* @__PURE__ */ f.createContext({
1766
1769
  o.onFocus == null || o.onFocus(d), s.onFocus == null || s.onFocus(d), c(u);
1767
1770
  }
1768
1771
  };
1769
- return pr(r, g);
1770
- }), Do = {
1772
+ return hr(r, g);
1773
+ }), _o = {
1771
1774
  ...f
1772
1775
  };
1773
- let In = !1, ko = 0;
1774
- const Cn = () => (
1776
+ let Cn = !1, Wo = 0;
1777
+ const In = () => (
1775
1778
  // Ensure the id is unique with multiple independent versions of Floating UI
1776
1779
  // on <React 18
1777
- "floating-ui-" + Math.random().toString(36).slice(2, 6) + ko++
1780
+ "floating-ui-" + Math.random().toString(36).slice(2, 6) + Wo++
1778
1781
  );
1779
- function Lo() {
1780
- const [e, t] = f.useState(() => In ? Cn() : void 0);
1782
+ function Ko() {
1783
+ const [e, t] = f.useState(() => Cn ? In() : void 0);
1781
1784
  return X(() => {
1782
- e == null && t(Cn());
1785
+ e == null && t(In());
1783
1786
  }, []), f.useEffect(() => {
1784
- In = !0;
1787
+ Cn = !0;
1785
1788
  }, []), e;
1786
1789
  }
1787
- const Fo = Do.useId, Lt = Fo || Lo;
1790
+ const Vo = _o.useId, Lt = Vo || Ko;
1788
1791
  let ct;
1789
1792
  process.env.NODE_ENV !== "production" && (ct = /* @__PURE__ */ new Set());
1790
1793
  function Ht() {
@@ -1796,7 +1799,7 @@ function Ht() {
1796
1799
  (s = ct) == null || s.add(o), console.warn(o);
1797
1800
  }
1798
1801
  }
1799
- function No() {
1802
+ function $o() {
1800
1803
  for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
1801
1804
  n[r] = arguments[r];
1802
1805
  const o = "Floating UI: " + n.join(" ");
@@ -1805,7 +1808,7 @@ function No() {
1805
1808
  (s = ct) == null || s.add(o), console.error(o);
1806
1809
  }
1807
1810
  }
1808
- function yr() {
1811
+ function xr() {
1809
1812
  const e = /* @__PURE__ */ new Map();
1810
1813
  return {
1811
1814
  emit(t, n) {
@@ -1821,11 +1824,11 @@ function yr() {
1821
1824
  }
1822
1825
  };
1823
1826
  }
1824
- const xr = /* @__PURE__ */ f.createContext(null), wr = /* @__PURE__ */ f.createContext(null), et = () => {
1827
+ const wr = /* @__PURE__ */ f.createContext(null), Rr = /* @__PURE__ */ f.createContext(null), et = () => {
1825
1828
  var e;
1826
- return ((e = f.useContext(xr)) == null ? void 0 : e.id) || null;
1827
- }, tt = () => f.useContext(wr);
1828
- function fi(e) {
1829
+ return ((e = f.useContext(wr)) == null ? void 0 : e.id) || null;
1830
+ }, tt = () => f.useContext(Rr);
1831
+ function hi(e) {
1829
1832
  const t = Lt(), n = tt(), o = et();
1830
1833
  return X(() => {
1831
1834
  if (!t) return;
@@ -1838,12 +1841,12 @@ function fi(e) {
1838
1841
  };
1839
1842
  }, [n, t, o]), t;
1840
1843
  }
1841
- function di(e) {
1844
+ function vi(e) {
1842
1845
  const {
1843
1846
  children: t,
1844
1847
  id: n
1845
1848
  } = e, r = et();
1846
- return /* @__PURE__ */ me(xr.Provider, {
1849
+ return /* @__PURE__ */ ge(wr.Provider, {
1847
1850
  value: f.useMemo(() => ({
1848
1851
  id: n,
1849
1852
  parentId: r
@@ -1851,15 +1854,15 @@ function di(e) {
1851
1854
  children: t
1852
1855
  });
1853
1856
  }
1854
- function mi(e) {
1857
+ function bi(e) {
1855
1858
  const {
1856
1859
  children: t
1857
1860
  } = e, n = f.useRef([]), r = f.useCallback((i) => {
1858
1861
  n.current = [...n.current, i];
1859
1862
  }, []), o = f.useCallback((i) => {
1860
1863
  n.current = n.current.filter((c) => c !== i);
1861
- }, []), [s] = f.useState(() => yr());
1862
- return /* @__PURE__ */ me(wr.Provider, {
1864
+ }, []), [s] = f.useState(() => xr());
1865
+ return /* @__PURE__ */ ge(Rr.Provider, {
1863
1866
  value: f.useMemo(() => ({
1864
1867
  nodesRef: n,
1865
1868
  addNode: r,
@@ -1872,10 +1875,10 @@ function mi(e) {
1872
1875
  function Ge(e) {
1873
1876
  return "data-floating-ui-" + e;
1874
1877
  }
1875
- function ye(e) {
1878
+ function ve(e) {
1876
1879
  e.current !== -1 && (clearTimeout(e.current), e.current = -1);
1877
1880
  }
1878
- const On = /* @__PURE__ */ Ge("safe-polygon");
1881
+ const Tn = /* @__PURE__ */ Ge("safe-polygon");
1879
1882
  function zt(e, t, n) {
1880
1883
  if (n && !it(n))
1881
1884
  return 0;
@@ -1890,7 +1893,7 @@ function zt(e, t, n) {
1890
1893
  function Ut(e) {
1891
1894
  return typeof e == "function" ? e() : e;
1892
1895
  }
1893
- function gi(e, t) {
1896
+ function yi(e, t) {
1894
1897
  t === void 0 && (t = {});
1895
1898
  const {
1896
1899
  open: n,
@@ -1905,148 +1908,148 @@ function gi(e, t) {
1905
1908
  mouseOnly: l = !1,
1906
1909
  restMs: p = 0,
1907
1910
  move: g = !0
1908
- } = t, d = tt(), h = et(), m = xe(u), y = xe(a), E = xe(n), v = xe(p), x = f.useRef(), I = f.useRef(-1), A = f.useRef(), k = f.useRef(-1), L = f.useRef(!0), M = f.useRef(!1), F = f.useRef(() => {
1909
- }), N = f.useRef(!1), _ = f.useCallback(() => {
1910
- var O;
1911
- const b = (O = o.current.openEvent) == null ? void 0 : O.type;
1911
+ } = t, d = tt(), h = et(), m = xe(u), y = xe(a), R = xe(n), v = xe(p), x = f.useRef(), C = f.useRef(-1), A = f.useRef(), k = f.useRef(-1), N = f.useRef(!0), D = f.useRef(!1), L = f.useRef(() => {
1912
+ }), F = f.useRef(!1), _ = se(() => {
1913
+ var T;
1914
+ const b = (T = o.current.openEvent) == null ? void 0 : T.type;
1912
1915
  return (b == null ? void 0 : b.includes("mouse")) && b !== "mousedown";
1913
- }, [o]);
1916
+ });
1914
1917
  f.useEffect(() => {
1915
1918
  if (!c) return;
1916
- function O(b) {
1919
+ function T(b) {
1917
1920
  let {
1918
- open: R
1921
+ open: E
1919
1922
  } = b;
1920
- R || (ye(I), ye(k), L.current = !0, N.current = !1);
1923
+ E || (ve(C), ve(k), N.current = !0, F.current = !1);
1921
1924
  }
1922
- return s.on("openchange", O), () => {
1923
- s.off("openchange", O);
1925
+ return s.on("openchange", T), () => {
1926
+ s.off("openchange", T);
1924
1927
  };
1925
1928
  }, [c, s]), f.useEffect(() => {
1926
1929
  if (!c || !m.current || !n) return;
1927
- function O(R) {
1928
- _() && r(!1, R, "hover");
1930
+ function T(E) {
1931
+ _() && r(!1, E, "hover");
1929
1932
  }
1930
1933
  const b = le(i.floating).documentElement;
1931
- return b.addEventListener("mouseleave", O), () => {
1932
- b.removeEventListener("mouseleave", O);
1934
+ return b.addEventListener("mouseleave", T), () => {
1935
+ b.removeEventListener("mouseleave", T);
1933
1936
  };
1934
1937
  }, [i.floating, n, r, c, m, _]);
1935
- const U = f.useCallback(function(O, b, R) {
1936
- b === void 0 && (b = !0), R === void 0 && (R = "hover");
1937
- const S = zt(y.current, "close", x.current);
1938
- S && !A.current ? (ye(I), I.current = window.setTimeout(() => r(!1, O, R), S)) : b && (ye(I), r(!1, O, R));
1939
- }, [y, r]), V = ae(() => {
1940
- F.current(), A.current = void 0;
1941
- }), T = ae(() => {
1942
- if (M.current) {
1943
- const O = le(i.floating).body;
1944
- O.style.pointerEvents = "", O.removeAttribute(On), M.current = !1;
1945
- }
1946
- }), w = ae(() => o.current.openEvent ? ["click", "mousedown"].includes(o.current.openEvent.type) : !1);
1938
+ const U = f.useCallback(function(T, b, E) {
1939
+ b === void 0 && (b = !0), E === void 0 && (E = "hover");
1940
+ const P = zt(y.current, "close", x.current);
1941
+ P && !A.current ? (ve(C), C.current = window.setTimeout(() => r(!1, T, E), P)) : b && (ve(C), r(!1, T, E));
1942
+ }, [y, r]), K = se(() => {
1943
+ L.current(), A.current = void 0;
1944
+ }), O = se(() => {
1945
+ if (D.current) {
1946
+ const T = le(i.floating).body;
1947
+ T.style.pointerEvents = "", T.removeAttribute(Tn), D.current = !1;
1948
+ }
1949
+ }), w = se(() => o.current.openEvent ? ["click", "mousedown"].includes(o.current.openEvent.type) : !1);
1947
1950
  f.useEffect(() => {
1948
1951
  if (!c) return;
1949
- function O(C) {
1950
- if (ye(I), L.current = !1, l && !it(x.current) || Ut(v.current) > 0 && !zt(y.current, "open"))
1952
+ function T(I) {
1953
+ if (ve(C), N.current = !1, l && !it(x.current) || Ut(v.current) > 0 && !zt(y.current, "open"))
1951
1954
  return;
1952
- const W = zt(y.current, "open", x.current);
1953
- W ? I.current = window.setTimeout(() => {
1954
- E.current || r(!0, C, "hover");
1955
- }, W) : n || r(!0, C, "hover");
1955
+ const V = zt(y.current, "open", x.current);
1956
+ V ? C.current = window.setTimeout(() => {
1957
+ R.current || r(!0, I, "hover");
1958
+ }, V) : n || r(!0, I, "hover");
1956
1959
  }
1957
- function b(C) {
1960
+ function b(I) {
1958
1961
  if (w()) {
1959
- T();
1962
+ O();
1960
1963
  return;
1961
1964
  }
1962
- F.current();
1963
- const W = le(i.floating);
1964
- if (ye(k), N.current = !1, m.current && o.current.floatingContext) {
1965
- n || ye(I), A.current = m.current({
1965
+ L.current();
1966
+ const V = le(i.floating);
1967
+ if (ve(k), F.current = !1, m.current && o.current.floatingContext) {
1968
+ n || ve(C), A.current = m.current({
1966
1969
  ...o.current.floatingContext,
1967
1970
  tree: d,
1968
- x: C.clientX,
1969
- y: C.clientY,
1971
+ x: I.clientX,
1972
+ y: I.clientY,
1970
1973
  onClose() {
1971
- T(), V(), w() || U(C, !0, "safe-polygon");
1974
+ O(), K(), w() || U(I, !0, "safe-polygon");
1972
1975
  }
1973
1976
  });
1974
- const fe = A.current;
1975
- W.addEventListener("mousemove", fe), F.current = () => {
1976
- W.removeEventListener("mousemove", fe);
1977
+ const ae = A.current;
1978
+ V.addEventListener("mousemove", ae), L.current = () => {
1979
+ V.removeEventListener("mousemove", ae);
1977
1980
  };
1978
1981
  return;
1979
1982
  }
1980
- (x.current === "touch" ? !ce(i.floating, C.relatedTarget) : !0) && U(C);
1983
+ (x.current === "touch" ? !ce(i.floating, I.relatedTarget) : !0) && U(I);
1981
1984
  }
1982
- function R(C) {
1985
+ function E(I) {
1983
1986
  w() || o.current.floatingContext && (m.current == null || m.current({
1984
1987
  ...o.current.floatingContext,
1985
1988
  tree: d,
1986
- x: C.clientX,
1987
- y: C.clientY,
1989
+ x: I.clientX,
1990
+ y: I.clientY,
1988
1991
  onClose() {
1989
- T(), V(), w() || U(C);
1992
+ O(), K(), w() || U(I);
1990
1993
  }
1991
- })(C));
1994
+ })(I));
1992
1995
  }
1993
- function S() {
1994
- ye(I);
1996
+ function P() {
1997
+ ve(C);
1995
1998
  }
1996
- function G(C) {
1997
- w() || U(C, !1);
1999
+ function G(I) {
2000
+ w() || U(I, !1);
1998
2001
  }
1999
- if (q(i.domReference)) {
2000
- const C = i.domReference, W = i.floating;
2001
- return n && C.addEventListener("mouseleave", R), g && C.addEventListener("mousemove", O, {
2002
+ if (Y(i.domReference)) {
2003
+ const I = i.domReference, V = i.floating;
2004
+ return n && I.addEventListener("mouseleave", E), g && I.addEventListener("mousemove", T, {
2002
2005
  once: !0
2003
- }), C.addEventListener("mouseenter", O), C.addEventListener("mouseleave", b), W && (W.addEventListener("mouseleave", R), W.addEventListener("mouseenter", S), W.addEventListener("mouseleave", G)), () => {
2004
- n && C.removeEventListener("mouseleave", R), g && C.removeEventListener("mousemove", O), C.removeEventListener("mouseenter", O), C.removeEventListener("mouseleave", b), W && (W.removeEventListener("mouseleave", R), W.removeEventListener("mouseenter", S), W.removeEventListener("mouseleave", G));
2006
+ }), I.addEventListener("mouseenter", T), I.addEventListener("mouseleave", b), V && (V.addEventListener("mouseleave", E), V.addEventListener("mouseenter", P), V.addEventListener("mouseleave", G)), () => {
2007
+ n && I.removeEventListener("mouseleave", E), g && I.removeEventListener("mousemove", T), I.removeEventListener("mouseenter", T), I.removeEventListener("mouseleave", b), V && (V.removeEventListener("mouseleave", E), V.removeEventListener("mouseenter", P), V.removeEventListener("mouseleave", G));
2005
2008
  };
2006
2009
  }
2007
- }, [i, c, e, l, g, U, V, T, r, n, E, d, y, m, o, w, v]), X(() => {
2008
- var O;
2009
- if (c && n && (O = m.current) != null && O.__options.blockPointerEvents && _()) {
2010
- M.current = !0;
2011
- const R = i.floating;
2012
- if (q(i.domReference) && R) {
2010
+ }, [i, c, e, l, g, U, K, O, r, n, R, d, y, m, o, w, v]), X(() => {
2011
+ var T;
2012
+ if (c && n && (T = m.current) != null && (T = T.__options) != null && T.blockPointerEvents && _()) {
2013
+ D.current = !0;
2014
+ const E = i.floating;
2015
+ if (Y(i.domReference) && E) {
2013
2016
  var b;
2014
- const S = le(i.floating).body;
2015
- S.setAttribute(On, "");
2016
- const G = i.domReference, C = d == null || (b = d.nodesRef.current.find((W) => W.id === h)) == null || (b = b.context) == null ? void 0 : b.elements.floating;
2017
- return C && (C.style.pointerEvents = ""), S.style.pointerEvents = "none", G.style.pointerEvents = "auto", R.style.pointerEvents = "auto", () => {
2018
- S.style.pointerEvents = "", G.style.pointerEvents = "", R.style.pointerEvents = "";
2017
+ const P = le(i.floating).body;
2018
+ P.setAttribute(Tn, "");
2019
+ const G = i.domReference, I = d == null || (b = d.nodesRef.current.find((V) => V.id === h)) == null || (b = b.context) == null ? void 0 : b.elements.floating;
2020
+ return I && (I.style.pointerEvents = ""), P.style.pointerEvents = "none", G.style.pointerEvents = "auto", E.style.pointerEvents = "auto", () => {
2021
+ P.style.pointerEvents = "", G.style.pointerEvents = "", E.style.pointerEvents = "";
2019
2022
  };
2020
2023
  }
2021
2024
  }
2022
2025
  }, [c, n, h, i, d, m, _]), X(() => {
2023
- n || (x.current = void 0, N.current = !1, V(), T());
2024
- }, [n, V, T]), f.useEffect(() => () => {
2025
- V(), ye(I), ye(k), T();
2026
- }, [c, i.domReference, V, T]);
2027
- const K = f.useMemo(() => {
2028
- function O(b) {
2026
+ n || (x.current = void 0, F.current = !1, K(), O());
2027
+ }, [n, K, O]), f.useEffect(() => () => {
2028
+ K(), ve(C), ve(k), O();
2029
+ }, [c, i.domReference, K, O]);
2030
+ const W = f.useMemo(() => {
2031
+ function T(b) {
2029
2032
  x.current = b.pointerType;
2030
2033
  }
2031
2034
  return {
2032
- onPointerDown: O,
2033
- onPointerEnter: O,
2035
+ onPointerDown: T,
2036
+ onPointerEnter: T,
2034
2037
  onMouseMove(b) {
2035
2038
  const {
2036
- nativeEvent: R
2039
+ nativeEvent: E
2037
2040
  } = b;
2038
- function S() {
2039
- !L.current && !E.current && r(!0, R, "hover");
2041
+ function P() {
2042
+ !N.current && !R.current && r(!0, E, "hover");
2040
2043
  }
2041
- l && !it(x.current) || n || Ut(v.current) === 0 || N.current && b.movementX ** 2 + b.movementY ** 2 < 2 || (ye(k), x.current === "touch" ? S() : (N.current = !0, k.current = window.setTimeout(S, Ut(v.current))));
2044
+ l && !it(x.current) || n || Ut(v.current) === 0 || F.current && b.movementX ** 2 + b.movementY ** 2 < 2 || (ve(k), x.current === "touch" ? P() : (F.current = !0, k.current = window.setTimeout(P, Ut(v.current))));
2042
2045
  }
2043
2046
  };
2044
- }, [l, r, n, E, v]);
2047
+ }, [l, r, n, R, v]);
2045
2048
  return f.useMemo(() => c ? {
2046
- reference: K
2047
- } : {}, [c, K]);
2049
+ reference: W
2050
+ } : {}, [c, W]);
2048
2051
  }
2049
- let Tn = 0;
2052
+ let On = 0;
2050
2053
  function $e(e, t) {
2051
2054
  t === void 0 && (t = {});
2052
2055
  const {
@@ -2054,24 +2057,32 @@ function $e(e, t) {
2054
2057
  cancelPrevious: r = !0,
2055
2058
  sync: o = !1
2056
2059
  } = t;
2057
- r && cancelAnimationFrame(Tn);
2060
+ r && cancelAnimationFrame(On);
2058
2061
  const s = () => e == null ? void 0 : e.focus({
2059
2062
  preventScroll: n
2060
2063
  });
2061
- o ? s() : Tn = requestAnimationFrame(s);
2064
+ o ? s() : On = requestAnimationFrame(s);
2062
2065
  }
2063
- function _o(e) {
2066
+ function Bo(e) {
2064
2067
  return (e == null ? void 0 : e.ownerDocument) || document;
2065
2068
  }
2066
- let je = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakSet(), ht = {}, Gt = 0;
2067
- const Ko = () => typeof HTMLElement < "u" && "inert" in HTMLElement.prototype, Rr = (e) => e && (e.host || Rr(e.parentNode)), Vo = (e, t) => t.map((n) => {
2069
+ const Je = {
2070
+ inert: /* @__PURE__ */ new WeakMap(),
2071
+ "aria-hidden": /* @__PURE__ */ new WeakMap(),
2072
+ none: /* @__PURE__ */ new WeakMap()
2073
+ };
2074
+ function An(e) {
2075
+ return e === "inert" ? Je.inert : e === "aria-hidden" ? Je["aria-hidden"] : Je.none;
2076
+ }
2077
+ let gt = /* @__PURE__ */ new WeakSet(), ht = {}, Gt = 0;
2078
+ const Ho = () => typeof HTMLElement < "u" && "inert" in HTMLElement.prototype, Er = (e) => e && (e.host || Er(e.parentNode)), zo = (e, t) => t.map((n) => {
2068
2079
  if (e.contains(n))
2069
2080
  return n;
2070
- const r = Rr(n);
2081
+ const r = Er(n);
2071
2082
  return e.contains(r) ? r : null;
2072
2083
  }).filter((n) => n != null);
2073
- function Wo(e, t, n, r) {
2074
- const o = "data-floating-ui-inert", s = r ? "inert" : n ? "aria-hidden" : null, i = Vo(t, e), c = /* @__PURE__ */ new Set(), a = new Set(i), u = [];
2084
+ function Uo(e, t, n, r) {
2085
+ const o = "data-floating-ui-inert", s = r ? "inert" : n ? "aria-hidden" : null, i = zo(t, e), c = /* @__PURE__ */ new Set(), a = new Set(i), u = [];
2075
2086
  ht[o] || (ht[o] = /* @__PURE__ */ new WeakMap());
2076
2087
  const l = ht[o];
2077
2088
  i.forEach(p), g(t), c.clear();
@@ -2080,26 +2091,26 @@ function Wo(e, t, n, r) {
2080
2091
  }
2081
2092
  function g(d) {
2082
2093
  !d || a.has(d) || [].forEach.call(d.children, (h) => {
2083
- if (Ke(h) !== "script")
2094
+ if (We(h) !== "script")
2084
2095
  if (c.has(h))
2085
2096
  g(h);
2086
2097
  else {
2087
- const m = s ? h.getAttribute(s) : null, y = m !== null && m !== "false", E = je.get(h) || 0, v = s ? E + 1 : E, x = (l.get(h) || 0) + 1;
2088
- je.set(h, v), l.set(h, x), u.push(h), v === 1 && y && pt.add(h), x === 1 && h.setAttribute(o, ""), !y && s && h.setAttribute(s, s === "inert" ? "" : "true");
2098
+ const m = s ? h.getAttribute(s) : null, y = m !== null && m !== "false", R = An(s), v = (R.get(h) || 0) + 1, x = (l.get(h) || 0) + 1;
2099
+ R.set(h, v), l.set(h, x), u.push(h), v === 1 && y && gt.add(h), x === 1 && h.setAttribute(o, ""), !y && s && h.setAttribute(s, s === "inert" ? "" : "true");
2089
2100
  }
2090
2101
  });
2091
2102
  }
2092
2103
  return Gt++, () => {
2093
2104
  u.forEach((d) => {
2094
- const h = je.get(d) || 0, m = s ? h - 1 : h, y = (l.get(d) || 0) - 1;
2095
- je.set(d, m), l.set(d, y), m || (!pt.has(d) && s && d.removeAttribute(s), pt.delete(d)), y || d.removeAttribute(o);
2096
- }), Gt--, Gt || (je = /* @__PURE__ */ new WeakMap(), je = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakSet(), ht = {});
2105
+ const h = An(s), y = (h.get(d) || 0) - 1, R = (l.get(d) || 0) - 1;
2106
+ h.set(d, y), l.set(d, R), y || (!gt.has(d) && s && d.removeAttribute(s), gt.delete(d)), R || d.removeAttribute(o);
2107
+ }), Gt--, Gt || (Je.inert = /* @__PURE__ */ new WeakMap(), Je["aria-hidden"] = /* @__PURE__ */ new WeakMap(), Je.none = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakSet(), ht = {});
2097
2108
  };
2098
2109
  }
2099
- function An(e, t, n) {
2110
+ function Mn(e, t, n) {
2100
2111
  t === void 0 && (t = !1), n === void 0 && (n = !1);
2101
- const r = _o(e[0]).body;
2102
- return Wo(e.concat(Array.from(r.querySelectorAll("[aria-live]"))), r, t, n);
2112
+ const r = Bo(e[0]).body;
2113
+ return Uo(e.concat(Array.from(r.querySelectorAll("[aria-live]"))), r, t, n);
2103
2114
  }
2104
2115
  const Ft = {
2105
2116
  border: 0,
@@ -2113,10 +2124,10 @@ const Ft = {
2113
2124
  width: "1px",
2114
2125
  top: 0,
2115
2126
  left: 0
2116
- }, Tt = /* @__PURE__ */ f.forwardRef(function(t, n) {
2127
+ }, Ot = /* @__PURE__ */ f.forwardRef(function(t, n) {
2117
2128
  const [r, o] = f.useState();
2118
2129
  X(() => {
2119
- Xn() && o("button");
2130
+ Jn() && o("button");
2120
2131
  }, []);
2121
2132
  const s = {
2122
2133
  ref: n,
@@ -2127,12 +2138,12 @@ const Ft = {
2127
2138
  [Ge("focus-guard")]: "",
2128
2139
  style: Ft
2129
2140
  };
2130
- return /* @__PURE__ */ me("span", {
2141
+ return /* @__PURE__ */ ge("span", {
2131
2142
  ...t,
2132
2143
  ...s
2133
2144
  });
2134
- }), Er = /* @__PURE__ */ f.createContext(null), Mn = /* @__PURE__ */ Ge("portal");
2135
- function $o(e) {
2145
+ }), Cr = /* @__PURE__ */ f.createContext(null), Pn = /* @__PURE__ */ Ge("portal");
2146
+ function Go(e) {
2136
2147
  e === void 0 && (e = {});
2137
2148
  const {
2138
2149
  id: t,
@@ -2147,24 +2158,24 @@ function $o(e) {
2147
2158
  const a = t ? document.getElementById(t) : null;
2148
2159
  if (!a) return;
2149
2160
  const u = document.createElement("div");
2150
- u.id = r, u.setAttribute(Mn, ""), a.appendChild(u), c.current = u, i(u);
2161
+ u.id = r, u.setAttribute(Pn, ""), a.appendChild(u), c.current = u, i(u);
2151
2162
  }, [t, r]), X(() => {
2152
2163
  if (n === null || !r || c.current) return;
2153
2164
  let a = n || (o == null ? void 0 : o.portalNode);
2154
- a && !q(a) && (a = a.current), a = a || document.body;
2165
+ a && !Y(a) && (a = a.current), a = a || document.body;
2155
2166
  let u = null;
2156
2167
  t && (u = document.createElement("div"), u.id = t, a.appendChild(u));
2157
2168
  const l = document.createElement("div");
2158
- l.id = r, l.setAttribute(Mn, ""), a = u || a, a.appendChild(l), c.current = l, i(l);
2169
+ l.id = r, l.setAttribute(Pn, ""), a = u || a, a.appendChild(l), c.current = l, i(l);
2159
2170
  }, [t, n, r, o]), s;
2160
2171
  }
2161
- function pi(e) {
2172
+ function xi(e) {
2162
2173
  const {
2163
2174
  children: t,
2164
2175
  id: n,
2165
2176
  root: r,
2166
2177
  preserveTabOrder: o = !0
2167
- } = e, s = $o({
2178
+ } = e, s = Go({
2168
2179
  id: n,
2169
2180
  root: r
2170
2181
  }), [i, c] = f.useState(null), a = f.useRef(null), u = f.useRef(null), l = f.useRef(null), p = f.useRef(null), g = i == null ? void 0 : i.modal, d = i == null ? void 0 : i.open, h = (
@@ -2178,14 +2189,14 @@ function pi(e) {
2178
2189
  if (!s || !o || g)
2179
2190
  return;
2180
2191
  function m(y) {
2181
- s && ot(y) && (y.type === "focusin" ? vn : Yr)(s);
2192
+ s && ot(y) && (y.type === "focusin" ? vn : Qr)(s);
2182
2193
  }
2183
2194
  return s.addEventListener("focusin", m, !0), s.addEventListener("focusout", m, !0), () => {
2184
2195
  s.removeEventListener("focusin", m, !0), s.removeEventListener("focusout", m, !0);
2185
2196
  };
2186
2197
  }, [s, o, g]), f.useEffect(() => {
2187
2198
  s && (d || vn(s));
2188
- }, [d, s]), /* @__PURE__ */ Bn(Er.Provider, {
2199
+ }, [d, s]), /* @__PURE__ */ Hn(Cr.Provider, {
2189
2200
  value: f.useMemo(() => ({
2190
2201
  preserveTabOrder: o,
2191
2202
  beforeOutsideRef: a,
@@ -2195,7 +2206,7 @@ function pi(e) {
2195
2206
  portalNode: s,
2196
2207
  setFocusManagerState: c
2197
2208
  }), [o, s]),
2198
- children: [h && s && /* @__PURE__ */ me(Tt, {
2209
+ children: [h && s && /* @__PURE__ */ ge(Ot, {
2199
2210
  "data-type": "outside",
2200
2211
  ref: a,
2201
2212
  onFocus: (m) => {
@@ -2203,14 +2214,14 @@ function pi(e) {
2203
2214
  var y;
2204
2215
  (y = l.current) == null || y.focus();
2205
2216
  } else {
2206
- const E = i ? i.domReference : null, v = sr(E);
2217
+ const R = i ? i.domReference : null, v = cr(R);
2207
2218
  v == null || v.focus();
2208
2219
  }
2209
2220
  }
2210
- }), h && s && /* @__PURE__ */ me("span", {
2221
+ }), h && s && /* @__PURE__ */ ge("span", {
2211
2222
  "aria-owns": s.id,
2212
2223
  style: Ft
2213
- }), s && /* @__PURE__ */ tn.createPortal(t, s), h && s && /* @__PURE__ */ me(Tt, {
2224
+ }), s && /* @__PURE__ */ tn.createPortal(t, s), h && s && /* @__PURE__ */ ge(Ot, {
2214
2225
  "data-type": "outside",
2215
2226
  ref: u,
2216
2227
  onFocus: (m) => {
@@ -2218,14 +2229,14 @@ function pi(e) {
2218
2229
  var y;
2219
2230
  (y = p.current) == null || y.focus();
2220
2231
  } else {
2221
- const E = i ? i.domReference : null, v = ir(E);
2232
+ const R = i ? i.domReference : null, v = sr(R);
2222
2233
  v == null || v.focus(), i != null && i.closeOnFocusOut && (i == null || i.onOpenChange(!1, m.nativeEvent, "focus-out"));
2223
2234
  }
2224
2235
  }
2225
2236
  })]
2226
2237
  });
2227
2238
  }
2228
- const Ir = () => f.useContext(Er);
2239
+ const Ir = () => f.useContext(Cr);
2229
2240
  function Sn(e) {
2230
2241
  return f.useMemo(() => (t) => {
2231
2242
  e.forEach((n) => {
@@ -2233,30 +2244,30 @@ function Sn(e) {
2233
2244
  });
2234
2245
  }, e);
2235
2246
  }
2236
- const Bo = 20;
2247
+ const jo = 20;
2237
2248
  let Be = [];
2238
- function Ho(e) {
2239
- Be = Be.filter((t) => t.isConnected), e && Ke(e) !== "body" && (Be.push(e), Be.length > Bo && (Be = Be.slice(-20)));
2249
+ function qo(e) {
2250
+ Be = Be.filter((t) => t.isConnected), e && We(e) !== "body" && (Be.push(e), Be.length > jo && (Be = Be.slice(-20)));
2240
2251
  }
2241
- function Pn() {
2252
+ function Dn() {
2242
2253
  return Be.slice().reverse().find((e) => e.isConnected);
2243
2254
  }
2244
- function zo(e) {
2255
+ function Yo(e) {
2245
2256
  const t = lt();
2246
- return $n(e, t) ? e : At(e, t)[0] || e;
2257
+ return Bn(e, t) ? e : At(e, t)[0] || e;
2247
2258
  }
2248
- function Dn(e, t) {
2259
+ function kn(e, t) {
2249
2260
  var n;
2250
2261
  if (!t.current.includes("floating") && !((n = e.getAttribute("role")) != null && n.includes("dialog")))
2251
2262
  return;
2252
2263
  const r = lt(), s = Or(e, r).filter((c) => {
2253
2264
  const a = c.getAttribute("data-tabindex") || "";
2254
- return $n(c, r) || c.hasAttribute("data-tabindex") && !a.startsWith("-");
2265
+ return Bn(c, r) || c.hasAttribute("data-tabindex") && !a.startsWith("-");
2255
2266
  }), i = e.getAttribute("tabindex");
2256
2267
  t.current.includes("floating") || s.length === 0 ? i !== "0" && e.setAttribute("tabindex", "0") : (i !== "-1" || e.hasAttribute("data-tabindex") && e.getAttribute("data-tabindex") !== "-1") && (e.setAttribute("tabindex", "-1"), e.setAttribute("data-tabindex", "-1"));
2257
2268
  }
2258
- const Uo = /* @__PURE__ */ f.forwardRef(function(t, n) {
2259
- return /* @__PURE__ */ me("button", {
2269
+ const Xo = /* @__PURE__ */ f.forwardRef(function(t, n) {
2270
+ return /* @__PURE__ */ ge("button", {
2260
2271
  ...t,
2261
2272
  type: "button",
2262
2273
  ref: n,
@@ -2264,7 +2275,7 @@ const Uo = /* @__PURE__ */ f.forwardRef(function(t, n) {
2264
2275
  style: Ft
2265
2276
  });
2266
2277
  });
2267
- function hi(e) {
2278
+ function wi(e) {
2268
2279
  const {
2269
2280
  context: t,
2270
2281
  children: n,
@@ -2283,149 +2294,152 @@ function hi(e) {
2283
2294
  open: h,
2284
2295
  onOpenChange: m,
2285
2296
  events: y,
2286
- dataRef: E,
2297
+ dataRef: R,
2287
2298
  elements: {
2288
2299
  domReference: v,
2289
2300
  floating: x
2290
2301
  }
2291
- } = t, I = ae(() => {
2292
- var $;
2293
- return ($ = E.current.floatingContext) == null ? void 0 : $.nodeId;
2294
- }), A = ae(d), k = typeof i == "number" && i < 0, L = Zt(v) && k, M = Ko(), F = M ? s : !0, N = !F || M && g, _ = xe(o), U = xe(i), V = xe(c), T = tt(), w = Ir(), K = f.useRef(null), O = f.useRef(null), b = f.useRef(!1), R = f.useRef(!1), S = f.useRef(-1), G = w != null, C = Ct(x), W = ae(function($) {
2295
- return $ === void 0 && ($ = C), $ ? At($, lt()) : [];
2296
- }), te = ae(($) => {
2297
- const H = W($);
2298
- return _.current.map((B) => v && B === "reference" ? v : C && B === "floating" ? C : H).filter(Boolean).flat();
2302
+ } = t, C = se(() => {
2303
+ var H;
2304
+ return (H = R.current.floatingContext) == null ? void 0 : H.nodeId;
2305
+ }), A = se(d), k = typeof i == "number" && i < 0, N = Zt(v) && k, D = Ho(), L = D ? s : !0, F = !L || D && g, _ = xe(o), U = xe(i), K = xe(c), O = tt(), w = Ir(), W = f.useRef(null), T = f.useRef(null), b = f.useRef(!1), E = f.useRef(!1), P = f.useRef(-1), G = w != null, I = It(x), V = se(function(H) {
2306
+ return H === void 0 && (H = I), H ? At(H, lt()) : [];
2307
+ }), ee = se((H) => {
2308
+ const z = V(H);
2309
+ return _.current.map(($) => v && $ === "reference" ? v : I && $ === "floating" ? I : z).filter(Boolean).flat();
2299
2310
  });
2300
2311
  f.useEffect(() => {
2301
2312
  if (r || !u) return;
2302
- function $(B) {
2303
- if (B.key === "Tab") {
2304
- ce(C, Ee(le(C))) && W().length === 0 && !L && de(B);
2305
- const z = te(), J = ke(B);
2306
- _.current[0] === "reference" && J === v && (de(B), B.shiftKey ? $e(z[z.length - 1]) : $e(z[1])), _.current[1] === "floating" && J === C && B.shiftKey && (de(B), $e(z[0]));
2313
+ function H($) {
2314
+ if ($.key === "Tab") {
2315
+ ce(I, Ee(le(I))) && V().length === 0 && !N && pe($);
2316
+ const B = ee(), oe = Pe($);
2317
+ _.current[0] === "reference" && oe === v && (pe($), $.shiftKey ? $e(B[B.length - 1]) : $e(B[1])), _.current[1] === "floating" && oe === I && $.shiftKey && (pe($), $e(B[0]));
2307
2318
  }
2308
2319
  }
2309
- const H = le(C);
2310
- return H.addEventListener("keydown", $), () => {
2311
- H.removeEventListener("keydown", $);
2320
+ const z = le(I);
2321
+ return z.addEventListener("keydown", H), () => {
2322
+ z.removeEventListener("keydown", H);
2312
2323
  };
2313
- }, [r, v, C, u, _, L, W, te]), f.useEffect(() => {
2324
+ }, [r, v, I, u, _, N, V, ee]), f.useEffect(() => {
2314
2325
  if (r || !x) return;
2315
- function $(H) {
2316
- const B = ke(H), J = W().indexOf(B);
2317
- J !== -1 && (S.current = J);
2326
+ function H(z) {
2327
+ const $ = Pe(z), oe = V().indexOf($);
2328
+ oe !== -1 && (P.current = oe);
2318
2329
  }
2319
- return x.addEventListener("focusin", $), () => {
2320
- x.removeEventListener("focusin", $);
2330
+ return x.addEventListener("focusin", H), () => {
2331
+ x.removeEventListener("focusin", H);
2321
2332
  };
2322
- }, [r, x, W]), f.useEffect(() => {
2333
+ }, [r, x, V]), f.useEffect(() => {
2323
2334
  if (r || !p) return;
2324
- function $() {
2325
- R.current = !0, setTimeout(() => {
2326
- R.current = !1;
2335
+ function H() {
2336
+ E.current = !0, setTimeout(() => {
2337
+ E.current = !1;
2327
2338
  });
2328
2339
  }
2329
- function H(B) {
2330
- const z = B.relatedTarget, J = B.currentTarget;
2340
+ function z($) {
2341
+ const B = $.relatedTarget, oe = $.currentTarget, ne = Pe($);
2331
2342
  queueMicrotask(() => {
2332
- const ve = I(), re = !(ce(v, z) || ce(x, z) || ce(z, x) || ce(w == null ? void 0 : w.portalNode, z) || z != null && z.hasAttribute(Ge("focus-guard")) || T && (Ye(T.nodesRef.current, ve).find((oe) => {
2333
- var Y, Q;
2334
- return ce((Y = oe.context) == null ? void 0 : Y.elements.floating, z) || ce((Q = oe.context) == null ? void 0 : Q.elements.domReference, z);
2335
- }) || hn(T.nodesRef.current, ve).find((oe) => {
2336
- var Y, Q, Re;
2337
- return [(Y = oe.context) == null ? void 0 : Y.elements.floating, Ct((Q = oe.context) == null ? void 0 : Q.elements.floating)].includes(z) || ((Re = oe.context) == null ? void 0 : Re.elements.domReference) === z;
2343
+ const de = C(), me = !(ce(v, B) || ce(x, B) || ce(B, x) || ce(w == null ? void 0 : w.portalNode, B) || B != null && B.hasAttribute(Ge("focus-guard")) || O && (qe(O.nodesRef.current, de).find((q) => {
2344
+ var J, Re;
2345
+ return ce((J = q.context) == null ? void 0 : J.elements.floating, B) || ce((Re = q.context) == null ? void 0 : Re.elements.domReference, B);
2346
+ }) || hn(O.nodesRef.current, de).find((q) => {
2347
+ var J, Re, M;
2348
+ return [(J = q.context) == null ? void 0 : J.elements.floating, It((Re = q.context) == null ? void 0 : Re.elements.floating)].includes(B) || ((M = q.context) == null ? void 0 : M.elements.domReference) === B;
2338
2349
  })));
2339
- if (J === v && C && Dn(C, _), a && re && Ee(le(C)) === le(C).body) {
2340
- ie(C) && C.focus();
2341
- const oe = S.current, Y = W(), Q = Y[oe] || Y[Y.length - 1] || C;
2342
- ie(Q) && Q.focus();
2350
+ if (oe === v && I && kn(I, _), a && oe !== v && !(ne != null && ne.isConnected) && Ee(le(I)) === le(I).body) {
2351
+ re(I) && I.focus();
2352
+ const q = P.current, J = V(), Re = J[q] || J[J.length - 1] || I;
2353
+ re(Re) && Re.focus();
2354
+ }
2355
+ if (R.current.insideReactTree) {
2356
+ R.current.insideReactTree = !1;
2357
+ return;
2343
2358
  }
2344
- (L || !u) && z && re && !R.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
2345
- z !== Pn() && (b.current = !0, m(!1, B, "focus-out"));
2359
+ (N || !u) && B && me && !E.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
2360
+ B !== Dn() && (b.current = !0, m(!1, $, "focus-out"));
2346
2361
  });
2347
2362
  }
2348
- if (x && ie(v))
2349
- return v.addEventListener("focusout", H), v.addEventListener("pointerdown", $), x.addEventListener("focusout", H), () => {
2350
- v.removeEventListener("focusout", H), v.removeEventListener("pointerdown", $), x.removeEventListener("focusout", H);
2363
+ if (x && re(v))
2364
+ return v.addEventListener("focusout", z), v.addEventListener("pointerdown", H), x.addEventListener("focusout", z), () => {
2365
+ v.removeEventListener("focusout", z), v.removeEventListener("pointerdown", H), x.removeEventListener("focusout", z);
2351
2366
  };
2352
- }, [r, v, x, C, u, T, w, m, p, a, W, L, I, _]);
2353
- const fe = f.useRef(null), ne = f.useRef(null), pe = Sn([fe, w == null ? void 0 : w.beforeInsideRef]), Ae = Sn([ne, w == null ? void 0 : w.afterInsideRef]);
2367
+ }, [r, v, x, I, u, O, w, m, p, a, V, N, C, _, R]);
2368
+ const ae = f.useRef(null), te = f.useRef(null), fe = Sn([ae, w == null ? void 0 : w.beforeInsideRef]), Ae = Sn([te, w == null ? void 0 : w.afterInsideRef]);
2354
2369
  f.useEffect(() => {
2355
- var $, H;
2370
+ var H, z;
2356
2371
  if (r || !x) return;
2357
- const B = Array.from((w == null || ($ = w.portalNode) == null ? void 0 : $.querySelectorAll("[" + Ge("portal") + "]")) || []), z = T ? hn(T.nodesRef.current, I()) : [], J = T && !u ? z.map((Y) => {
2358
- var Q;
2359
- return (Q = Y.context) == null ? void 0 : Q.elements.floating;
2360
- }) : [], ve = (H = z.find((Y) => {
2361
- var Q;
2362
- return Zt(((Q = Y.context) == null ? void 0 : Q.elements.domReference) || null);
2363
- })) == null || (H = H.context) == null ? void 0 : H.elements.domReference, re = [x, ve, ...B, ...J, ...A(), K.current, O.current, fe.current, ne.current, w == null ? void 0 : w.beforeOutsideRef.current, w == null ? void 0 : w.afterOutsideRef.current, _.current.includes("reference") || L ? v : null].filter((Y) => Y != null), oe = u || L ? An(re, !N, N) : An(re);
2372
+ const $ = Array.from((w == null || (H = w.portalNode) == null ? void 0 : H.querySelectorAll("[" + Ge("portal") + "]")) || []), B = O ? hn(O.nodesRef.current, C()) : [], oe = O && !u ? B.map((q) => {
2373
+ var J;
2374
+ return (J = q.context) == null ? void 0 : J.elements.floating;
2375
+ }) : [], ne = (z = B.find((q) => {
2376
+ var J;
2377
+ return Zt(((J = q.context) == null ? void 0 : J.elements.domReference) || null);
2378
+ })) == null || (z = z.context) == null ? void 0 : z.elements.domReference, de = [x, ne, ...$, ...oe, ...A(), W.current, T.current, ae.current, te.current, w == null ? void 0 : w.beforeOutsideRef.current, w == null ? void 0 : w.afterOutsideRef.current, _.current.includes("reference") || N ? v : null].filter((q) => q != null), me = u || N ? Mn(de, !F, F) : Mn(de);
2364
2379
  return () => {
2365
- oe();
2380
+ me();
2366
2381
  };
2367
- }, [r, v, x, u, _, w, L, F, N, T, I, A]), X(() => {
2368
- if (r || !ie(C)) return;
2369
- const $ = le(C), H = Ee($);
2382
+ }, [r, v, x, u, _, w, N, L, F, O, C, A]), X(() => {
2383
+ if (r || !re(I)) return;
2384
+ const H = le(I), z = Ee(H);
2370
2385
  queueMicrotask(() => {
2371
- const B = te(C), z = U.current, J = (typeof z == "number" ? B[z] : z.current) || C, ve = ce(C, H);
2372
- !k && !ve && h && $e(J, {
2373
- preventScroll: J === C
2386
+ const $ = ee(I), B = U.current, oe = (typeof B == "number" ? $[B] : B.current) || I, ne = ce(I, z);
2387
+ !k && !ne && h && $e(oe, {
2388
+ preventScroll: oe === I
2374
2389
  });
2375
2390
  });
2376
- }, [r, h, C, k, te, U]), X(() => {
2377
- if (r || !C) return;
2378
- let $ = !1;
2379
- const H = le(C), B = Ee(H);
2380
- Ho(B);
2381
- function z(re) {
2391
+ }, [r, h, I, k, ee, U]), X(() => {
2392
+ if (r || !I) return;
2393
+ const H = le(I), z = Ee(H);
2394
+ qo(z);
2395
+ function $(ne) {
2382
2396
  let {
2383
- reason: oe,
2384
- event: Y,
2385
- nested: Q
2386
- } = re;
2387
- if (["hover", "safe-polygon"].includes(oe) && Y.type === "mouseleave" && (b.current = !0), oe === "outside-press")
2388
- if (Q)
2389
- b.current = !1, $ = !0;
2390
- else if (Qn(Y) || Zn(Y))
2397
+ reason: de,
2398
+ event: me,
2399
+ nested: q
2400
+ } = ne;
2401
+ if (["hover", "safe-polygon"].includes(de) && me.type === "mouseleave" && (b.current = !0), de === "outside-press")
2402
+ if (q)
2403
+ b.current = !1;
2404
+ else if (Zn(me) || er(me))
2391
2405
  b.current = !1;
2392
2406
  else {
2393
- let Re = !1;
2407
+ let J = !1;
2394
2408
  document.createElement("div").focus({
2395
2409
  get preventScroll() {
2396
- return Re = !0, !1;
2410
+ return J = !0, !1;
2397
2411
  }
2398
- }), Re ? (b.current = !1, $ = !0) : b.current = !0;
2412
+ }), J ? b.current = !1 : b.current = !0;
2399
2413
  }
2400
2414
  }
2401
- y.on("openchange", z);
2402
- const J = H.createElement("span");
2403
- J.setAttribute("tabindex", "-1"), J.setAttribute("aria-hidden", "true"), Object.assign(J.style, Ft), G && v && v.insertAdjacentElement("afterend", J);
2404
- function ve() {
2405
- if (typeof V.current == "boolean") {
2406
- const re = v || Pn();
2407
- return re && re.isConnected ? re : J;
2415
+ y.on("openchange", $);
2416
+ const B = H.createElement("span");
2417
+ B.setAttribute("tabindex", "-1"), B.setAttribute("aria-hidden", "true"), Object.assign(B.style, Ft), G && v && v.insertAdjacentElement("afterend", B);
2418
+ function oe() {
2419
+ if (typeof K.current == "boolean") {
2420
+ const ne = v || Dn();
2421
+ return ne && ne.isConnected ? ne : B;
2408
2422
  }
2409
- return V.current.current || J;
2423
+ return K.current.current || B;
2410
2424
  }
2411
2425
  return () => {
2412
- y.off("openchange", z);
2413
- const re = Ee(H), oe = ce(x, re) || T && Ye(T.nodesRef.current, I()).some((Q) => {
2414
- var Re;
2415
- return ce((Re = Q.context) == null ? void 0 : Re.elements.floating, re);
2416
- }), Y = ve();
2426
+ y.off("openchange", $);
2427
+ const ne = Ee(H), de = ce(x, ne) || O && qe(O.nodesRef.current, C()).some((q) => {
2428
+ var J;
2429
+ return ce((J = q.context) == null ? void 0 : J.elements.floating, ne);
2430
+ }), me = oe();
2417
2431
  queueMicrotask(() => {
2418
- const Q = zo(Y);
2432
+ const q = Yo(me);
2419
2433
  // eslint-disable-next-line react-hooks/exhaustive-deps
2420
- V.current && !b.current && ie(Q) && // If the focus moved somewhere else after mount, avoid returning focus
2434
+ K.current && !b.current && re(q) && // If the focus moved somewhere else after mount, avoid returning focus
2421
2435
  // since it likely entered a different element which should be
2422
2436
  // respected: https://github.com/floating-ui/floating-ui/issues/2607
2423
- (!(Q !== re && re !== H.body) || oe) && Q.focus({
2424
- preventScroll: $
2425
- }), J.remove();
2437
+ (!(q !== ne && ne !== H.body) || de) && q.focus({
2438
+ preventScroll: !0
2439
+ }), B.remove();
2426
2440
  });
2427
2441
  };
2428
- }, [r, x, C, V, E, y, T, G, v, I]), f.useEffect(() => {
2442
+ }, [r, x, I, K, R, y, O, G, v, C]), f.useEffect(() => {
2429
2443
  queueMicrotask(() => {
2430
2444
  b.current = !1;
2431
2445
  });
@@ -2441,89 +2455,91 @@ function hi(e) {
2441
2455
  w.setFocusManagerState(null);
2442
2456
  };
2443
2457
  }, [r, w, u, h, m, p, v]), X(() => {
2444
- r || C && Dn(C, _);
2445
- }, [r, C, _]);
2446
- function Ve($) {
2447
- return r || !l || !u ? null : /* @__PURE__ */ me(Uo, {
2448
- ref: $ === "start" ? K : O,
2449
- onClick: (H) => m(!1, H.nativeEvent),
2458
+ r || I && kn(I, _);
2459
+ }, [r, I, _]);
2460
+ function Ke(H) {
2461
+ return r || !l || !u ? null : /* @__PURE__ */ ge(Xo, {
2462
+ ref: H === "start" ? W : T,
2463
+ onClick: (z) => m(!1, z.nativeEvent),
2450
2464
  children: typeof l == "string" ? l : "Dismiss"
2451
2465
  });
2452
2466
  }
2453
- const Me = !r && F && (u ? !L : !0) && (G || u);
2454
- return /* @__PURE__ */ Bn(Tr, {
2455
- children: [Me && /* @__PURE__ */ me(Tt, {
2467
+ const Me = !r && L && (u ? !N : !0) && (G || u);
2468
+ return /* @__PURE__ */ Hn(Ar, {
2469
+ children: [Me && /* @__PURE__ */ ge(Ot, {
2456
2470
  "data-type": "inside",
2457
- ref: pe,
2458
- onFocus: ($) => {
2471
+ ref: fe,
2472
+ onFocus: (H) => {
2459
2473
  if (u) {
2460
- const B = te();
2461
- $e(o[0] === "reference" ? B[0] : B[B.length - 1]);
2474
+ const $ = ee();
2475
+ $e(o[0] === "reference" ? $[0] : $[$.length - 1]);
2462
2476
  } else if (w != null && w.preserveTabOrder && w.portalNode)
2463
- if (b.current = !1, ot($, w.portalNode)) {
2464
- const B = ir(v);
2465
- B == null || B.focus();
2477
+ if (b.current = !1, ot(H, w.portalNode)) {
2478
+ const $ = sr(v);
2479
+ $ == null || $.focus();
2466
2480
  } else {
2467
- var H;
2468
- (H = w.beforeOutsideRef.current) == null || H.focus();
2481
+ var z;
2482
+ (z = w.beforeOutsideRef.current) == null || z.focus();
2469
2483
  }
2470
2484
  }
2471
- }), !L && Ve("start"), n, Ve("end"), Me && /* @__PURE__ */ me(Tt, {
2485
+ }), !N && Ke("start"), n, Ke("end"), Me && /* @__PURE__ */ ge(Ot, {
2472
2486
  "data-type": "inside",
2473
2487
  ref: Ae,
2474
- onFocus: ($) => {
2488
+ onFocus: (H) => {
2475
2489
  if (u)
2476
- $e(te()[0]);
2490
+ $e(ee()[0]);
2477
2491
  else if (w != null && w.preserveTabOrder && w.portalNode)
2478
- if (p && (b.current = !0), ot($, w.portalNode)) {
2479
- const B = sr(v);
2480
- B == null || B.focus();
2492
+ if (p && (b.current = !0), ot(H, w.portalNode)) {
2493
+ const $ = cr(v);
2494
+ $ == null || $.focus();
2481
2495
  } else {
2482
- var H;
2483
- (H = w.afterOutsideRef.current) == null || H.focus();
2496
+ var z;
2497
+ (z = w.afterOutsideRef.current) == null || z.focus();
2484
2498
  }
2485
2499
  }
2486
2500
  })]
2487
2501
  });
2488
2502
  }
2489
2503
  let vt = 0;
2490
- function Go() {
2491
- const e = /iP(hone|ad|od)|iOS/.test(rn()), t = document.body.style, r = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft ? "paddingLeft" : "paddingRight", o = window.innerWidth - document.documentElement.clientWidth, s = t.left ? parseFloat(t.left) : window.scrollX, i = t.top ? parseFloat(t.top) : window.scrollY;
2492
- if (t.overflow = "hidden", o && (t[r] = o + "px"), e) {
2493
- var c, a;
2494
- const u = ((c = window.visualViewport) == null ? void 0 : c.offsetLeft) || 0, l = ((a = window.visualViewport) == null ? void 0 : a.offsetTop) || 0;
2495
- Object.assign(t, {
2504
+ const Ln = "--floating-ui-scrollbar-width";
2505
+ function Jo() {
2506
+ const e = rn(), t = /iP(hone|ad|od)|iOS/.test(e) || // iPads can claim to be MacIntel
2507
+ e === "MacIntel" && navigator.maxTouchPoints > 1, n = document.body.style, o = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft ? "paddingLeft" : "paddingRight", s = window.innerWidth - document.documentElement.clientWidth, i = n.left ? parseFloat(n.left) : window.scrollX, c = n.top ? parseFloat(n.top) : window.scrollY;
2508
+ if (n.overflow = "hidden", n.setProperty(Ln, s + "px"), s && (n[o] = s + "px"), t) {
2509
+ var a, u;
2510
+ const l = ((a = window.visualViewport) == null ? void 0 : a.offsetLeft) || 0, p = ((u = window.visualViewport) == null ? void 0 : u.offsetTop) || 0;
2511
+ Object.assign(n, {
2496
2512
  position: "fixed",
2497
- top: -(i - Math.floor(l)) + "px",
2498
- left: -(s - Math.floor(u)) + "px",
2513
+ top: -(c - Math.floor(p)) + "px",
2514
+ left: -(i - Math.floor(l)) + "px",
2499
2515
  right: "0"
2500
2516
  });
2501
2517
  }
2502
2518
  return () => {
2503
- Object.assign(t, {
2519
+ Object.assign(n, {
2504
2520
  overflow: "",
2505
- [r]: ""
2506
- }), e && (Object.assign(t, {
2521
+ [o]: ""
2522
+ }), n.removeProperty(Ln), t && (Object.assign(n, {
2507
2523
  position: "",
2508
2524
  top: "",
2509
2525
  left: "",
2510
2526
  right: ""
2511
- }), window.scrollTo(s, i));
2527
+ }), window.scrollTo(i, c));
2512
2528
  };
2513
2529
  }
2514
- let kn = () => {
2530
+ let Fn = () => {
2515
2531
  };
2516
- const vi = /* @__PURE__ */ f.forwardRef(function(t, n) {
2532
+ const Ri = /* @__PURE__ */ f.forwardRef(function(t, n) {
2517
2533
  const {
2518
2534
  lockScroll: r = !1,
2519
2535
  ...o
2520
2536
  } = t;
2521
2537
  return X(() => {
2522
2538
  if (r)
2523
- return vt++, vt === 1 && (kn = Go()), () => {
2524
- vt--, vt === 0 && kn();
2539
+ return vt++, vt === 1 && (Fn = Jo()), () => {
2540
+ vt--, vt === 0 && Fn();
2525
2541
  };
2526
- }, [r]), /* @__PURE__ */ me("div", {
2542
+ }, [r]), /* @__PURE__ */ ge("div", {
2527
2543
  ref: n,
2528
2544
  ...o,
2529
2545
  style: {
@@ -2537,16 +2553,16 @@ const vi = /* @__PURE__ */ f.forwardRef(function(t, n) {
2537
2553
  }
2538
2554
  });
2539
2555
  });
2540
- function Ln(e) {
2541
- return ie(e.target) && e.target.tagName === "BUTTON";
2556
+ function Nn(e) {
2557
+ return re(e.target) && e.target.tagName === "BUTTON";
2542
2558
  }
2543
- function jo(e) {
2544
- return ie(e.target) && e.target.tagName === "A";
2559
+ function Qo(e) {
2560
+ return re(e.target) && e.target.tagName === "A";
2545
2561
  }
2546
- function Fn(e) {
2562
+ function _n(e) {
2547
2563
  return on(e);
2548
2564
  }
2549
- function bi(e, t) {
2565
+ function Ei(e, t) {
2550
2566
  t === void 0 && (t = {});
2551
2567
  const {
2552
2568
  open: n,
@@ -2579,32 +2595,32 @@ function bi(e, t) {
2579
2595
  it(y, !0) && u || (n && a && (!(o.current.openEvent && p) || o.current.openEvent.type === "click") ? r(!1, m.nativeEvent, "click") : r(!0, m.nativeEvent, "click"));
2580
2596
  },
2581
2597
  onKeyDown(m) {
2582
- g.current = void 0, !(m.defaultPrevented || !l || Ln(m)) && (m.key === " " && !Fn(s) && (m.preventDefault(), d.current = !0), !jo(m) && m.key === "Enter" && r(!(n && a), m.nativeEvent, "click"));
2598
+ g.current = void 0, !(m.defaultPrevented || !l || Nn(m)) && (m.key === " " && !_n(s) && (m.preventDefault(), d.current = !0), !Qo(m) && m.key === "Enter" && r(!(n && a), m.nativeEvent, "click"));
2583
2599
  },
2584
2600
  onKeyUp(m) {
2585
- m.defaultPrevented || !l || Ln(m) || Fn(s) || m.key === " " && d.current && (d.current = !1, r(!(n && a), m.nativeEvent, "click"));
2601
+ m.defaultPrevented || !l || Nn(m) || _n(s) || m.key === " " && d.current && (d.current = !1, r(!(n && a), m.nativeEvent, "click"));
2586
2602
  }
2587
2603
  }), [o, s, c, u, l, r, n, p, a]);
2588
2604
  return f.useMemo(() => i ? {
2589
2605
  reference: h
2590
2606
  } : {}, [i, h]);
2591
2607
  }
2592
- const qo = {
2608
+ const Zo = {
2593
2609
  pointerdown: "onPointerDown",
2594
2610
  mousedown: "onMouseDown",
2595
2611
  click: "onClick"
2596
- }, Yo = {
2612
+ }, ei = {
2597
2613
  pointerdown: "onPointerDownCapture",
2598
2614
  mousedown: "onMouseDownCapture",
2599
2615
  click: "onClickCapture"
2600
- }, Nn = (e) => {
2616
+ }, Wn = (e) => {
2601
2617
  var t, n;
2602
2618
  return {
2603
2619
  escapeKey: typeof e == "boolean" ? e : (t = e == null ? void 0 : e.escapeKey) != null ? t : !1,
2604
2620
  outsidePress: typeof e == "boolean" ? e : (n = e == null ? void 0 : e.outsidePress) != null ? n : !0
2605
2621
  };
2606
2622
  };
2607
- function yi(e, t) {
2623
+ function Ci(e, t) {
2608
2624
  t === void 0 && (t = {});
2609
2625
  const {
2610
2626
  open: n,
@@ -2621,131 +2637,131 @@ function yi(e, t) {
2621
2637
  ancestorScroll: g = !1,
2622
2638
  bubbles: d,
2623
2639
  capture: h
2624
- } = t, m = tt(), y = ae(typeof a == "function" ? a : () => !1), E = typeof a == "function" ? y : a, v = f.useRef(!1), x = f.useRef(!1), {
2625
- escapeKey: I,
2626
- outsidePress: A
2627
- } = Nn(d), {
2628
- escapeKey: k,
2629
- outsidePress: L
2630
- } = Nn(h), M = f.useRef(!1), F = ae((w) => {
2631
- var K;
2632
- if (!n || !i || !c || w.key !== "Escape" || M.current)
2640
+ } = t, m = tt(), y = se(typeof a == "function" ? a : () => !1), R = typeof a == "function" ? y : a, v = f.useRef(!1), {
2641
+ escapeKey: x,
2642
+ outsidePress: C
2643
+ } = Wn(d), {
2644
+ escapeKey: A,
2645
+ outsidePress: k
2646
+ } = Wn(h), N = f.useRef(!1), D = f.useRef(-1), L = se((w) => {
2647
+ var W;
2648
+ if (!n || !i || !c || w.key !== "Escape" || N.current)
2633
2649
  return;
2634
- const O = (K = s.current.floatingContext) == null ? void 0 : K.nodeId, b = m ? Ye(m.nodesRef.current, O) : [];
2635
- if (!I && (w.stopPropagation(), b.length > 0)) {
2636
- let R = !0;
2637
- if (b.forEach((S) => {
2650
+ const T = (W = s.current.floatingContext) == null ? void 0 : W.nodeId, b = m ? qe(m.nodesRef.current, T) : [];
2651
+ if (!x && (w.stopPropagation(), b.length > 0)) {
2652
+ let E = !0;
2653
+ if (b.forEach((P) => {
2638
2654
  var G;
2639
- if ((G = S.context) != null && G.open && !S.context.dataRef.current.__escapeKeyBubbles) {
2640
- R = !1;
2655
+ if ((G = P.context) != null && G.open && !P.context.dataRef.current.__escapeKeyBubbles) {
2656
+ E = !1;
2641
2657
  return;
2642
2658
  }
2643
- }), !R)
2659
+ }), !E)
2644
2660
  return;
2645
2661
  }
2646
- r(!1, Ur(w) ? w.nativeEvent : w, "escape-key");
2647
- }), N = ae((w) => {
2648
- var K;
2649
- const O = () => {
2662
+ r(!1, Gr(w) ? w.nativeEvent : w, "escape-key");
2663
+ }), F = se((w) => {
2664
+ var W;
2665
+ const T = () => {
2650
2666
  var b;
2651
- F(w), (b = ke(w)) == null || b.removeEventListener("keydown", O);
2667
+ L(w), (b = Pe(w)) == null || b.removeEventListener("keydown", T);
2652
2668
  };
2653
- (K = ke(w)) == null || K.addEventListener("keydown", O);
2654
- }), _ = ae((w) => {
2655
- var K;
2656
- const O = v.current;
2657
- v.current = !1;
2658
- const b = x.current;
2659
- if (x.current = !1, u === "click" && b || O || typeof E == "function" && !E(w))
2669
+ (W = Pe(w)) == null || W.addEventListener("keydown", T);
2670
+ }), _ = se((w) => {
2671
+ var W;
2672
+ const T = s.current.insideReactTree;
2673
+ s.current.insideReactTree = !1;
2674
+ const b = v.current;
2675
+ if (v.current = !1, u === "click" && b || T || typeof R == "function" && !R(w))
2660
2676
  return;
2661
- const R = ke(w), S = "[" + Ge("inert") + "]", G = le(o.floating).querySelectorAll(S);
2662
- let C = q(R) ? R : null;
2663
- for (; C && !Se(C); ) {
2664
- const ne = Pe(C);
2665
- if (Se(ne) || !q(ne))
2677
+ const E = Pe(w), P = "[" + Ge("inert") + "]", G = le(o.floating).querySelectorAll(P);
2678
+ let I = Y(E) ? E : null;
2679
+ for (; I && !Se(I); ) {
2680
+ const te = De(I);
2681
+ if (Se(te) || !Y(te))
2666
2682
  break;
2667
- C = ne;
2683
+ I = te;
2668
2684
  }
2669
- if (G.length && q(R) && !Br(R) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
2670
- !ce(R, o.floating) && // If the target root element contains none of the markers, then the
2685
+ if (G.length && Y(E) && !Hr(E) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
2686
+ !ce(E, o.floating) && // If the target root element contains none of the markers, then the
2671
2687
  // element was injected after the floating element rendered.
2672
- Array.from(G).every((ne) => !ce(C, ne)))
2688
+ Array.from(G).every((te) => !ce(I, te)))
2673
2689
  return;
2674
- if (ie(R) && T) {
2675
- const ne = Se(R), pe = we(R), Ae = /auto|scroll/, Ve = ne || Ae.test(pe.overflowX), Me = ne || Ae.test(pe.overflowY), $ = Ve && R.clientWidth > 0 && R.scrollWidth > R.clientWidth, H = Me && R.clientHeight > 0 && R.scrollHeight > R.clientHeight, B = pe.direction === "rtl", z = H && (B ? w.offsetX <= R.offsetWidth - R.clientWidth : w.offsetX > R.clientWidth), J = $ && w.offsetY > R.clientHeight;
2676
- if (z || J)
2690
+ if (re(E) && O) {
2691
+ const te = Se(E), fe = we(E), Ae = /auto|scroll/, Ke = te || Ae.test(fe.overflowX), Me = te || Ae.test(fe.overflowY), H = Ke && E.clientWidth > 0 && E.scrollWidth > E.clientWidth, z = Me && E.clientHeight > 0 && E.scrollHeight > E.clientHeight, $ = fe.direction === "rtl", B = z && ($ ? w.offsetX <= E.offsetWidth - E.clientWidth : w.offsetX > E.clientWidth), oe = H && w.offsetY > E.clientHeight;
2692
+ if (B || oe)
2677
2693
  return;
2678
2694
  }
2679
- const W = (K = s.current.floatingContext) == null ? void 0 : K.nodeId, te = m && Ye(m.nodesRef.current, W).some((ne) => {
2680
- var pe;
2681
- return Vt(w, (pe = ne.context) == null ? void 0 : pe.elements.floating);
2695
+ const V = (W = s.current.floatingContext) == null ? void 0 : W.nodeId, ee = m && qe(m.nodesRef.current, V).some((te) => {
2696
+ var fe;
2697
+ return Kt(w, (fe = te.context) == null ? void 0 : fe.elements.floating);
2682
2698
  });
2683
- if (Vt(w, o.floating) || Vt(w, o.domReference) || te)
2699
+ if (Kt(w, o.floating) || Kt(w, o.domReference) || ee)
2684
2700
  return;
2685
- const fe = m ? Ye(m.nodesRef.current, W) : [];
2686
- if (fe.length > 0) {
2687
- let ne = !0;
2688
- if (fe.forEach((pe) => {
2701
+ const ae = m ? qe(m.nodesRef.current, V) : [];
2702
+ if (ae.length > 0) {
2703
+ let te = !0;
2704
+ if (ae.forEach((fe) => {
2689
2705
  var Ae;
2690
- if ((Ae = pe.context) != null && Ae.open && !pe.context.dataRef.current.__outsidePressBubbles) {
2691
- ne = !1;
2706
+ if ((Ae = fe.context) != null && Ae.open && !fe.context.dataRef.current.__outsidePressBubbles) {
2707
+ te = !1;
2692
2708
  return;
2693
2709
  }
2694
- }), !ne)
2710
+ }), !te)
2695
2711
  return;
2696
2712
  }
2697
2713
  r(!1, w, "outside-press");
2698
- }), U = ae((w) => {
2699
- var K;
2700
- const O = () => {
2714
+ }), U = se((w) => {
2715
+ var W;
2716
+ const T = () => {
2701
2717
  var b;
2702
- _(w), (b = ke(w)) == null || b.removeEventListener(u, O);
2718
+ _(w), (b = Pe(w)) == null || b.removeEventListener(u, T);
2703
2719
  };
2704
- (K = ke(w)) == null || K.addEventListener(u, O);
2720
+ (W = Pe(w)) == null || W.addEventListener(u, T);
2705
2721
  });
2706
2722
  f.useEffect(() => {
2707
2723
  if (!n || !i)
2708
2724
  return;
2709
- s.current.__escapeKeyBubbles = I, s.current.__outsidePressBubbles = A;
2725
+ s.current.__escapeKeyBubbles = x, s.current.__outsidePressBubbles = C;
2710
2726
  let w = -1;
2711
- function K(G) {
2727
+ function W(G) {
2712
2728
  r(!1, G, "ancestor-scroll");
2713
2729
  }
2714
- function O() {
2715
- window.clearTimeout(w), M.current = !0;
2730
+ function T() {
2731
+ window.clearTimeout(w), N.current = !0;
2716
2732
  }
2717
2733
  function b() {
2718
2734
  w = window.setTimeout(
2719
2735
  () => {
2720
- M.current = !1;
2736
+ N.current = !1;
2721
2737
  },
2722
2738
  // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
2723
2739
  // Only apply to WebKit for the test to remain 0ms.
2724
- Pt() ? 5 : 0
2740
+ St() ? 5 : 0
2725
2741
  );
2726
2742
  }
2727
- const R = le(o.floating);
2728
- c && (R.addEventListener("keydown", k ? N : F, k), R.addEventListener("compositionstart", O), R.addEventListener("compositionend", b)), E && R.addEventListener(u, L ? U : _, L);
2729
- let S = [];
2730
- return g && (q(o.domReference) && (S = Le(o.domReference)), q(o.floating) && (S = S.concat(Le(o.floating))), !q(o.reference) && o.reference && o.reference.contextElement && (S = S.concat(Le(o.reference.contextElement)))), S = S.filter((G) => {
2731
- var C;
2732
- return G !== ((C = R.defaultView) == null ? void 0 : C.visualViewport);
2733
- }), S.forEach((G) => {
2734
- G.addEventListener("scroll", K, {
2743
+ const E = le(o.floating);
2744
+ c && (E.addEventListener("keydown", A ? F : L, A), E.addEventListener("compositionstart", T), E.addEventListener("compositionend", b)), R && E.addEventListener(u, k ? U : _, k);
2745
+ let P = [];
2746
+ return g && (Y(o.domReference) && (P = Le(o.domReference)), Y(o.floating) && (P = P.concat(Le(o.floating))), !Y(o.reference) && o.reference && o.reference.contextElement && (P = P.concat(Le(o.reference.contextElement)))), P = P.filter((G) => {
2747
+ var I;
2748
+ return G !== ((I = E.defaultView) == null ? void 0 : I.visualViewport);
2749
+ }), P.forEach((G) => {
2750
+ G.addEventListener("scroll", W, {
2735
2751
  passive: !0
2736
2752
  });
2737
2753
  }), () => {
2738
- c && (R.removeEventListener("keydown", k ? N : F, k), R.removeEventListener("compositionstart", O), R.removeEventListener("compositionend", b)), E && R.removeEventListener(u, L ? U : _, L), S.forEach((G) => {
2739
- G.removeEventListener("scroll", K);
2754
+ c && (E.removeEventListener("keydown", A ? F : L, A), E.removeEventListener("compositionstart", T), E.removeEventListener("compositionend", b)), R && E.removeEventListener(u, k ? U : _, k), P.forEach((G) => {
2755
+ G.removeEventListener("scroll", W);
2740
2756
  }), window.clearTimeout(w);
2741
2757
  };
2742
- }, [s, o, c, E, u, n, r, g, i, I, A, F, k, N, _, L, U]), f.useEffect(() => {
2743
- v.current = !1;
2744
- }, [E, u]);
2745
- const V = f.useMemo(() => ({
2746
- onKeyDown: F,
2758
+ }, [s, o, c, R, u, n, r, g, i, x, C, L, A, F, _, k, U]), f.useEffect(() => {
2759
+ s.current.insideReactTree = !1;
2760
+ }, [s, R, u]);
2761
+ const K = f.useMemo(() => ({
2762
+ onKeyDown: L,
2747
2763
  ...l && {
2748
- [qo[p]]: (w) => {
2764
+ [Zo[p]]: (w) => {
2749
2765
  r(!1, w.nativeEvent, "reference-press");
2750
2766
  },
2751
2767
  ...p !== "click" && {
@@ -2754,34 +2770,39 @@ function yi(e, t) {
2754
2770
  }
2755
2771
  }
2756
2772
  }
2757
- }), [F, r, l, p]), T = f.useMemo(() => ({
2758
- onKeyDown: F,
2773
+ }), [L, r, l, p]), O = f.useMemo(() => ({
2774
+ onKeyDown: L,
2759
2775
  onMouseDown() {
2760
- x.current = !0;
2776
+ v.current = !0;
2761
2777
  },
2762
2778
  onMouseUp() {
2763
- x.current = !0;
2764
- },
2765
- [Yo[u]]: () => {
2766
2779
  v.current = !0;
2780
+ },
2781
+ [ei[u]]: () => {
2782
+ s.current.insideReactTree = !0;
2783
+ },
2784
+ onBlurCapture() {
2785
+ m || (ve(D), s.current.insideReactTree = !0, D.current = window.setTimeout(() => {
2786
+ s.current.insideReactTree = !1;
2787
+ }));
2767
2788
  }
2768
- }), [F, u]);
2789
+ }), [L, u, s, m]);
2769
2790
  return f.useMemo(() => i ? {
2770
- reference: V,
2771
- floating: T
2772
- } : {}, [i, V, T]);
2791
+ reference: K,
2792
+ floating: O
2793
+ } : {}, [i, K, O]);
2773
2794
  }
2774
- function Xo(e) {
2795
+ function ti(e) {
2775
2796
  const {
2776
2797
  open: t = !1,
2777
2798
  onOpenChange: n,
2778
2799
  elements: r
2779
- } = e, o = Lt(), s = f.useRef({}), [i] = f.useState(() => yr()), c = et() != null;
2800
+ } = e, o = Lt(), s = f.useRef({}), [i] = f.useState(() => xr()), c = et() != null;
2780
2801
  if (process.env.NODE_ENV !== "production") {
2781
2802
  const d = r.reference;
2782
- d && !q(d) && No("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
2803
+ d && !Y(d) && $o("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
2783
2804
  }
2784
- const [a, u] = f.useState(r.reference), l = ae((d, h, m) => {
2805
+ const [a, u] = f.useState(r.reference), l = se((d, h, m) => {
2785
2806
  s.current.openEvent = d ? h : void 0, i.emit("openchange", {
2786
2807
  open: d,
2787
2808
  event: h,
@@ -2805,11 +2826,11 @@ function Xo(e) {
2805
2826
  refs: p
2806
2827
  }), [t, l, g, i, o, p]);
2807
2828
  }
2808
- function xi(e) {
2829
+ function Ii(e) {
2809
2830
  e === void 0 && (e = {});
2810
2831
  const {
2811
2832
  nodeId: t
2812
- } = e, n = Xo({
2833
+ } = e, n = ti({
2813
2834
  ...e,
2814
2835
  elements: {
2815
2836
  reference: null,
@@ -2820,7 +2841,7 @@ function xi(e) {
2820
2841
  X(() => {
2821
2842
  l && (p.current = l);
2822
2843
  }, [l]);
2823
- const d = Oo({
2844
+ const d = So({
2824
2845
  ...e,
2825
2846
  elements: {
2826
2847
  ...o,
@@ -2829,47 +2850,47 @@ function xi(e) {
2829
2850
  }
2830
2851
  }
2831
2852
  }), h = f.useCallback((x) => {
2832
- const I = q(x) ? {
2853
+ const C = Y(x) ? {
2833
2854
  getBoundingClientRect: () => x.getBoundingClientRect(),
2834
2855
  getClientRects: () => x.getClientRects(),
2835
2856
  contextElement: x
2836
2857
  } : x;
2837
- a(I), d.refs.setReference(I);
2858
+ a(C), d.refs.setReference(C);
2838
2859
  }, [d.refs]), m = f.useCallback((x) => {
2839
- (q(x) || x === null) && (p.current = x, i(x)), (q(d.refs.reference.current) || d.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
2860
+ (Y(x) || x === null) && (p.current = x, i(x)), (Y(d.refs.reference.current) || d.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
2840
2861
  // `null` to support `positionReference` + an unstable `reference`
2841
2862
  // callback ref.
2842
- x !== null && !q(x)) && d.refs.setReference(x);
2863
+ x !== null && !Y(x)) && d.refs.setReference(x);
2843
2864
  }, [d.refs]), y = f.useMemo(() => ({
2844
2865
  ...d.refs,
2845
2866
  setReference: m,
2846
2867
  setPositionReference: h,
2847
2868
  domReference: p
2848
- }), [d.refs, m, h]), E = f.useMemo(() => ({
2869
+ }), [d.refs, m, h]), R = f.useMemo(() => ({
2849
2870
  ...d.elements,
2850
2871
  domReference: l
2851
2872
  }), [d.elements, l]), v = f.useMemo(() => ({
2852
2873
  ...d,
2853
2874
  ...r,
2854
2875
  refs: y,
2855
- elements: E,
2876
+ elements: R,
2856
2877
  nodeId: t
2857
- }), [d, y, E, t, r]);
2878
+ }), [d, y, R, t, r]);
2858
2879
  return X(() => {
2859
2880
  r.dataRef.current.floatingContext = v;
2860
- const x = g == null ? void 0 : g.nodesRef.current.find((I) => I.id === t);
2881
+ const x = g == null ? void 0 : g.nodesRef.current.find((C) => C.id === t);
2861
2882
  x && (x.context = v);
2862
2883
  }), f.useMemo(() => ({
2863
2884
  ...d,
2864
2885
  context: v,
2865
2886
  refs: y,
2866
- elements: E
2867
- }), [d, y, E, v]);
2887
+ elements: R
2888
+ }), [d, y, R, v]);
2868
2889
  }
2869
2890
  function jt() {
2870
- return Kr() && Xn();
2891
+ return Kr() && Jn();
2871
2892
  }
2872
- function wi(e, t) {
2893
+ function Ti(e, t) {
2873
2894
  t === void 0 && (t = {});
2874
2895
  const {
2875
2896
  open: n,
@@ -2883,9 +2904,9 @@ function wi(e, t) {
2883
2904
  } = t, u = f.useRef(!1), l = f.useRef(-1), p = f.useRef(!0);
2884
2905
  f.useEffect(() => {
2885
2906
  if (!c) return;
2886
- const d = ge(i.domReference);
2907
+ const d = he(i.domReference);
2887
2908
  function h() {
2888
- !n && ie(i.domReference) && i.domReference === Ee(le(i.domReference)) && (u.current = !0);
2909
+ !n && re(i.domReference) && i.domReference === Ee(le(i.domReference)) && (u.current = !0);
2889
2910
  }
2890
2911
  function m() {
2891
2912
  p.current = !0;
@@ -2908,7 +2929,7 @@ function wi(e, t) {
2908
2929
  o.off("openchange", d);
2909
2930
  };
2910
2931
  }, [o, c]), f.useEffect(() => () => {
2911
- ye(l);
2932
+ ve(l);
2912
2933
  }, []);
2913
2934
  const g = f.useMemo(() => ({
2914
2935
  onMouseLeave() {
@@ -2916,23 +2937,23 @@ function wi(e, t) {
2916
2937
  },
2917
2938
  onFocus(d) {
2918
2939
  if (u.current) return;
2919
- const h = ke(d.nativeEvent);
2920
- if (a && q(h)) {
2940
+ const h = Pe(d.nativeEvent);
2941
+ if (a && Y(h)) {
2921
2942
  if (jt() && !d.relatedTarget) {
2922
2943
  if (!p.current && !on(h))
2923
2944
  return;
2924
- } else if (!Hr(h))
2945
+ } else if (!zr(h))
2925
2946
  return;
2926
2947
  }
2927
2948
  r(!0, d.nativeEvent, "focus");
2928
2949
  },
2929
2950
  onBlur(d) {
2930
2951
  u.current = !1;
2931
- const h = d.relatedTarget, m = d.nativeEvent, y = q(h) && h.hasAttribute(Ge("focus-guard")) && h.getAttribute("data-type") === "outside";
2952
+ const h = d.relatedTarget, m = d.nativeEvent, y = Y(h) && h.hasAttribute(Ge("focus-guard")) && h.getAttribute("data-type") === "outside";
2932
2953
  l.current = window.setTimeout(() => {
2933
- var E;
2954
+ var R;
2934
2955
  const v = Ee(i.domReference ? i.domReference.ownerDocument : document);
2935
- !h && v === i.domReference || ce((E = s.current.floatingContext) == null ? void 0 : E.refs.floating.current, v) || ce(i.domReference, v) || y || r(!1, m, "focus");
2956
+ !h && v === i.domReference || ce((R = s.current.floatingContext) == null ? void 0 : R.refs.floating.current, v) || ce(i.domReference, v) || y || r(!1, m, "focus");
2936
2957
  });
2937
2958
  }
2938
2959
  }), [s, i.domReference, r, a]);
@@ -2954,7 +2975,7 @@ function qt(e, t, n) {
2954
2975
  return {
2955
2976
  ...n === "floating" && {
2956
2977
  tabIndex: -1,
2957
- [Po]: ""
2978
+ [No]: ""
2958
2979
  },
2959
2980
  ...s,
2960
2981
  ...t.map((i) => {
@@ -2977,7 +2998,7 @@ function qt(e, t, n) {
2977
2998
  }), i), {})
2978
2999
  };
2979
3000
  }
2980
- function Ri(e) {
3001
+ function Oi(e) {
2981
3002
  e === void 0 && (e = []);
2982
3003
  const t = e.map((c) => c == null ? void 0 : c.reference), n = e.map((c) => c == null ? void 0 : c.floating), r = e.map((c) => c == null ? void 0 : c.item), o = f.useCallback(
2983
3004
  (c) => qt(c, e, "reference"),
@@ -2998,7 +3019,7 @@ function Ri(e) {
2998
3019
  getItemProps: i
2999
3020
  }), [o, s, i]);
3000
3021
  }
3001
- const Jo = "Escape";
3022
+ const ni = "Escape";
3002
3023
  function Nt(e, t, n) {
3003
3024
  switch (e) {
3004
3025
  case "vertical":
@@ -3015,14 +3036,14 @@ function bt(e, t) {
3015
3036
  function Yt(e, t, n) {
3016
3037
  return Nt(t, e === Fe, n ? e === Ne : e === _e) || e === "Enter" || e === " " || e === "";
3017
3038
  }
3018
- function _n(e, t, n) {
3039
+ function Kn(e, t, n) {
3019
3040
  return Nt(t, n ? e === Ne : e === _e, e === Fe);
3020
3041
  }
3021
- function Kn(e, t, n, r) {
3042
+ function Vn(e, t, n, r) {
3022
3043
  const o = n ? e === _e : e === Ne, s = e === st;
3023
- return t === "both" || t === "horizontal" && r && r > 1 ? e === Jo : Nt(t, o, s);
3044
+ return t === "both" || t === "horizontal" && r && r > 1 ? e === ni : Nt(t, o, s);
3024
3045
  }
3025
- function Ei(e, t) {
3046
+ function Ai(e, t) {
3026
3047
  const {
3027
3048
  open: n,
3028
3049
  onOpenChange: r,
@@ -3041,242 +3062,242 @@ function Ei(e, t) {
3041
3062
  rtl: h = !1,
3042
3063
  virtual: m = !1,
3043
3064
  focusItemOnOpen: y = "auto",
3044
- focusItemOnHover: E = !0,
3065
+ focusItemOnHover: R = !0,
3045
3066
  openOnArrowKeyDown: v = !0,
3046
3067
  disabledIndices: x = void 0,
3047
- orientation: I = "vertical",
3068
+ orientation: C = "vertical",
3048
3069
  parentOrientation: A,
3049
3070
  cols: k = 1,
3050
- scrollItemIntoView: L = !0,
3051
- virtualItemRef: M,
3052
- itemSizes: F,
3053
- dense: N = !1
3071
+ scrollItemIntoView: N = !0,
3072
+ virtualItemRef: D,
3073
+ itemSizes: L,
3074
+ dense: F = !1
3054
3075
  } = t;
3055
- process.env.NODE_ENV !== "production" && (p && (g || Ht("`useListNavigation` looping must be enabled to allow escaping."), m || Ht("`useListNavigation` must be virtual to allow escaping.")), I === "vertical" && k > 1 && Ht("In grid list navigation mode (`cols` > 1), the `orientation` should", 'be either "horizontal" or "both".'));
3056
- const _ = Ct(o.floating), U = xe(_), V = et(), T = tt();
3076
+ process.env.NODE_ENV !== "production" && (p && (g || Ht("`useListNavigation` looping must be enabled to allow escaping."), m || Ht("`useListNavigation` must be virtual to allow escaping.")), C === "vertical" && k > 1 && Ht("In grid list navigation mode (`cols` > 1), the `orientation` should", 'be either "horizontal" or "both".'));
3077
+ const _ = It(o.floating), U = xe(_), K = et(), O = tt();
3057
3078
  X(() => {
3058
- e.dataRef.current.orientation = I;
3059
- }, [e, I]);
3060
- const w = ae(() => {
3079
+ e.dataRef.current.orientation = C;
3080
+ }, [e, C]);
3081
+ const w = se(() => {
3061
3082
  a(b.current === -1 ? null : b.current);
3062
- }), K = Zt(o.domReference), O = f.useRef(y), b = f.useRef(l ?? -1), R = f.useRef(null), S = f.useRef(!0), G = f.useRef(w), C = f.useRef(!!o.floating), W = f.useRef(n), te = f.useRef(!1), fe = f.useRef(!1), ne = xe(x), pe = xe(n), Ae = xe(L), Ve = xe(l), [Me, $] = f.useState(), [H, B] = f.useState(), z = ae(() => {
3063
- function D(ee) {
3083
+ }), W = Zt(o.domReference), T = f.useRef(y), b = f.useRef(l ?? -1), E = f.useRef(null), P = f.useRef(!0), G = f.useRef(w), I = f.useRef(!!o.floating), V = f.useRef(n), ee = f.useRef(!1), ae = f.useRef(!1), te = xe(x), fe = xe(n), Ae = xe(N), Ke = xe(l), [Me, H] = f.useState(), [z, $] = f.useState(), B = se(() => {
3084
+ function M(Z) {
3064
3085
  if (m) {
3065
- var se;
3066
- (se = ee.id) != null && se.endsWith("-fui-option") && (ee.id = s + "-" + Math.random().toString(16).slice(2, 10)), $(ee.id), T == null || T.events.emit("virtualfocus", ee), M && (M.current = ee);
3086
+ var ie;
3087
+ (ie = Z.id) != null && ie.endsWith("-fui-option") && (Z.id = s + "-" + Math.random().toString(16).slice(2, 10)), H(Z.id), O == null || O.events.emit("virtualfocus", Z), D && (D.current = Z);
3067
3088
  } else
3068
- $e(ee, {
3069
- sync: te.current,
3089
+ $e(Z, {
3090
+ sync: ee.current,
3070
3091
  preventScroll: !0
3071
3092
  });
3072
3093
  }
3073
- const j = i.current[b.current], P = fe.current;
3074
- j && D(j), (te.current ? (ee) => ee() : requestAnimationFrame)(() => {
3075
- const ee = i.current[b.current] || j;
3076
- if (!ee) return;
3077
- j || D(ee);
3078
- const se = Ae.current;
3079
- se && ve && (P || !S.current) && (ee.scrollIntoView == null || ee.scrollIntoView(typeof se == "boolean" ? {
3094
+ const j = i.current[b.current], S = ae.current;
3095
+ j && M(j), (ee.current ? (Z) => Z() : requestAnimationFrame)(() => {
3096
+ const Z = i.current[b.current] || j;
3097
+ if (!Z) return;
3098
+ j || M(Z);
3099
+ const ie = Ae.current;
3100
+ ie && ne && (S || !P.current) && (Z.scrollIntoView == null || Z.scrollIntoView(typeof ie == "boolean" ? {
3080
3101
  block: "nearest",
3081
3102
  inline: "nearest"
3082
- } : se));
3103
+ } : ie));
3083
3104
  });
3084
3105
  });
3085
3106
  X(() => {
3086
- u && (n && o.floating ? O.current && l != null && (fe.current = !0, b.current = l, w()) : C.current && (b.current = -1, G.current()));
3107
+ u && (n && o.floating ? T.current && l != null && (ae.current = !0, b.current = l, w()) : I.current && (b.current = -1, G.current()));
3087
3108
  }, [u, n, o.floating, l, w]), X(() => {
3088
3109
  if (u && n && o.floating)
3089
3110
  if (c == null) {
3090
- if (te.current = !1, Ve.current != null)
3111
+ if (ee.current = !1, Ke.current != null)
3091
3112
  return;
3092
- if (C.current && (b.current = -1, z()), (!W.current || !C.current) && O.current && (R.current != null || O.current === !0 && R.current == null)) {
3093
- let D = 0;
3113
+ if (I.current && (b.current = -1, B()), (!V.current || !I.current) && T.current && (E.current != null || T.current === !0 && E.current == null)) {
3114
+ let M = 0;
3094
3115
  const j = () => {
3095
- i.current[0] == null ? (D < 2 && (D ? requestAnimationFrame : queueMicrotask)(j), D++) : (b.current = R.current == null || Yt(R.current, I, h) || d ? yt(i, ne.current) : en(i, ne.current), R.current = null, w());
3116
+ i.current[0] == null ? (M < 2 && (M ? requestAnimationFrame : queueMicrotask)(j), M++) : (b.current = E.current == null || Yt(E.current, C, h) || d ? yt(i, te.current) : en(i, te.current), E.current = null, w());
3096
3117
  };
3097
3118
  j();
3098
3119
  }
3099
- } else Xe(i, c) || (b.current = c, z(), fe.current = !1);
3100
- }, [u, n, o.floating, c, Ve, d, i, I, h, w, z, ne]), X(() => {
3101
- var D;
3102
- if (!u || o.floating || !T || m || !C.current)
3120
+ } else Ye(i, c) || (b.current = c, B(), ae.current = !1);
3121
+ }, [u, n, o.floating, c, Ke, d, i, C, h, w, B, te]), X(() => {
3122
+ var M;
3123
+ if (!u || o.floating || !O || m || !I.current)
3103
3124
  return;
3104
- const j = T.nodesRef.current, P = (D = j.find((se) => se.id === V)) == null || (D = D.context) == null ? void 0 : D.elements.floating, Z = Ee(le(o.floating)), ee = j.some((se) => se.context && ce(se.context.elements.floating, Z));
3105
- P && !ee && S.current && P.focus({
3125
+ const j = O.nodesRef.current, S = (M = j.find((ie) => ie.id === K)) == null || (M = M.context) == null ? void 0 : M.elements.floating, Q = Ee(le(o.floating)), Z = j.some((ie) => ie.context && ce(ie.context.elements.floating, Q));
3126
+ S && !Z && P.current && S.focus({
3106
3127
  preventScroll: !0
3107
3128
  });
3108
- }, [u, o.floating, T, V, m]), X(() => {
3109
- if (!u || !T || !m || V) return;
3110
- function D(j) {
3111
- B(j.id), M && (M.current = j);
3129
+ }, [u, o.floating, O, K, m]), X(() => {
3130
+ if (!u || !O || !m || K) return;
3131
+ function M(j) {
3132
+ $(j.id), D && (D.current = j);
3112
3133
  }
3113
- return T.events.on("virtualfocus", D), () => {
3114
- T.events.off("virtualfocus", D);
3134
+ return O.events.on("virtualfocus", M), () => {
3135
+ O.events.off("virtualfocus", M);
3115
3136
  };
3116
- }, [u, T, m, V, M]), X(() => {
3117
- G.current = w, W.current = n, C.current = !!o.floating;
3137
+ }, [u, O, m, K, D]), X(() => {
3138
+ G.current = w, V.current = n, I.current = !!o.floating;
3118
3139
  }), X(() => {
3119
- n || (R.current = null);
3120
- }, [n]);
3121
- const J = c != null, ve = f.useMemo(() => {
3122
- function D(P) {
3123
- if (!n) return;
3124
- const Z = i.current.indexOf(P);
3125
- Z !== -1 && b.current !== Z && (b.current = Z, w());
3140
+ n || (E.current = null, T.current = y);
3141
+ }, [n, y]);
3142
+ const oe = c != null, ne = f.useMemo(() => {
3143
+ function M(S) {
3144
+ if (!fe.current) return;
3145
+ const Q = i.current.indexOf(S);
3146
+ Q !== -1 && b.current !== Q && (b.current = Q, w());
3126
3147
  }
3127
3148
  return {
3128
- onFocus(P) {
3149
+ onFocus(S) {
3129
3150
  let {
3130
- currentTarget: Z
3131
- } = P;
3132
- te.current = !0, D(Z);
3151
+ currentTarget: Q
3152
+ } = S;
3153
+ ee.current = !0, M(Q);
3133
3154
  },
3134
- onClick: (P) => {
3155
+ onClick: (S) => {
3135
3156
  let {
3136
- currentTarget: Z
3137
- } = P;
3138
- return Z.focus({
3157
+ currentTarget: Q
3158
+ } = S;
3159
+ return Q.focus({
3139
3160
  preventScroll: !0
3140
3161
  });
3141
3162
  },
3142
3163
  // Safari
3143
- ...E && {
3144
- onMouseMove(P) {
3164
+ ...R && {
3165
+ onMouseMove(S) {
3145
3166
  let {
3146
- currentTarget: Z
3147
- } = P;
3148
- te.current = !0, fe.current = !1, D(Z);
3167
+ currentTarget: Q
3168
+ } = S;
3169
+ ee.current = !0, ae.current = !1, M(Q);
3149
3170
  },
3150
- onPointerLeave(P) {
3171
+ onPointerLeave(S) {
3151
3172
  let {
3152
- pointerType: Z
3153
- } = P;
3154
- if (!(!S.current || Z === "touch") && (te.current = !0, b.current = -1, w(), !m)) {
3155
- var ee;
3156
- (ee = U.current) == null || ee.focus({
3173
+ pointerType: Q
3174
+ } = S;
3175
+ if (!(!P.current || Q === "touch") && (ee.current = !0, b.current = -1, w(), !m)) {
3176
+ var Z;
3177
+ (Z = U.current) == null || Z.focus({
3157
3178
  preventScroll: !0
3158
3179
  });
3159
3180
  }
3160
3181
  }
3161
3182
  }
3162
3183
  };
3163
- }, [n, U, E, i, w, m]), re = f.useCallback(() => {
3164
- var D;
3165
- return A ?? (T == null || (D = T.nodesRef.current.find((j) => j.id === V)) == null || (D = D.context) == null || (D = D.dataRef) == null ? void 0 : D.current.orientation);
3166
- }, [V, T, A]), oe = ae((D) => {
3167
- if (S.current = !1, te.current = !0, D.which === 229 || !pe.current && D.currentTarget === U.current)
3184
+ }, [fe, U, R, i, w, m]), de = f.useCallback(() => {
3185
+ var M;
3186
+ return A ?? (O == null || (M = O.nodesRef.current.find((j) => j.id === K)) == null || (M = M.context) == null || (M = M.dataRef) == null ? void 0 : M.current.orientation);
3187
+ }, [K, O, A]), me = se((M) => {
3188
+ if (P.current = !1, ee.current = !0, M.which === 229 || !fe.current && M.currentTarget === U.current)
3168
3189
  return;
3169
- if (d && Kn(D.key, I, h, k)) {
3170
- bt(D.key, re()) || de(D), r(!1, D.nativeEvent, "list-navigation"), ie(o.domReference) && (m ? T == null || T.events.emit("virtualfocus", o.domReference) : o.domReference.focus());
3190
+ if (d && Vn(M.key, C, h, k)) {
3191
+ bt(M.key, de()) || pe(M), r(!1, M.nativeEvent, "list-navigation"), re(o.domReference) && (m ? O == null || O.events.emit("virtualfocus", o.domReference) : o.domReference.focus());
3171
3192
  return;
3172
3193
  }
3173
- const j = b.current, P = yt(i, x), Z = en(i, x);
3174
- if (K || (D.key === "Home" && (de(D), b.current = P, w()), D.key === "End" && (de(D), b.current = Z, w())), k > 1) {
3175
- const ee = F || Array.from({
3194
+ const j = b.current, S = yt(i, x), Q = en(i, x);
3195
+ if (W || (M.key === "Home" && (pe(M), b.current = S, w()), M.key === "End" && (pe(M), b.current = Q, w())), k > 1) {
3196
+ const Z = L || Array.from({
3176
3197
  length: i.current.length
3177
3198
  }, () => ({
3178
3199
  width: 1,
3179
3200
  height: 1
3180
- })), se = tr(ee, k, N), nt = se.findIndex((be) => be != null && !He(i, be, x)), at = se.reduce((be, We, ft) => We != null && !He(i, We, x) ? ft : be, -1), rt = se[er({
3181
- current: se.map((be) => be != null ? i.current[be] : null)
3201
+ })), ie = nr(Z, k, F), nt = ie.findIndex((ye) => ye != null && !He(i, ye, x)), at = ie.reduce((ye, Ve, ft) => Ve != null && !He(i, Ve, x) ? ft : ye, -1), rt = ie[tr({
3202
+ current: ie.map((ye) => ye != null ? i.current[ye] : null)
3182
3203
  }, {
3183
- event: D,
3184
- orientation: I,
3204
+ event: M,
3205
+ orientation: C,
3185
3206
  loop: g,
3186
3207
  rtl: h,
3187
3208
  cols: k,
3188
3209
  // treat undefined (empty grid spaces) as disabled indices so we
3189
3210
  // don't end up in them
3190
- disabledIndices: rr([...x || i.current.map((be, We) => He(i, We) ? We : void 0), void 0], se),
3211
+ disabledIndices: or([...(typeof x != "function" ? x : null) || i.current.map((ye, Ve) => He(i, Ve, x) ? Ve : void 0), void 0], ie),
3191
3212
  minIndex: nt,
3192
3213
  maxIndex: at,
3193
- prevIndex: nr(
3194
- b.current > Z ? P : b.current,
3195
- ee,
3196
- se,
3214
+ prevIndex: rr(
3215
+ b.current > Q ? S : b.current,
3216
+ Z,
3217
+ ie,
3197
3218
  k,
3198
3219
  // use a corner matching the edge closest to the direction
3199
3220
  // we're moving in so we don't end up in the same item. Prefer
3200
3221
  // top/left over bottom/right.
3201
- D.key === Fe ? "bl" : D.key === (h ? Ne : _e) ? "tr" : "tl"
3222
+ M.key === Fe ? "bl" : M.key === (h ? Ne : _e) ? "tr" : "tl"
3202
3223
  ),
3203
3224
  stopEvent: !0
3204
3225
  })];
3205
- if (rt != null && (b.current = rt, w()), I === "both")
3226
+ if (rt != null && (b.current = rt, w()), C === "both")
3206
3227
  return;
3207
3228
  }
3208
- if (bt(D.key, I)) {
3209
- if (de(D), n && !m && Ee(D.currentTarget.ownerDocument) === D.currentTarget) {
3210
- b.current = Yt(D.key, I, h) ? P : Z, w();
3229
+ if (bt(M.key, C)) {
3230
+ if (pe(M), n && !m && Ee(M.currentTarget.ownerDocument) === M.currentTarget) {
3231
+ b.current = Yt(M.key, C, h) ? S : Q, w();
3211
3232
  return;
3212
3233
  }
3213
- Yt(D.key, I, h) ? g ? b.current = j >= Z ? p && j !== i.current.length ? -1 : P : ue(i, {
3234
+ Yt(M.key, C, h) ? g ? b.current = j >= Q ? p && j !== i.current.length ? -1 : S : ue(i, {
3214
3235
  startingIndex: j,
3215
3236
  disabledIndices: x
3216
- }) : b.current = Math.min(Z, ue(i, {
3237
+ }) : b.current = Math.min(Q, ue(i, {
3217
3238
  startingIndex: j,
3218
3239
  disabledIndices: x
3219
- })) : g ? b.current = j <= P ? p && j !== -1 ? i.current.length : Z : ue(i, {
3240
+ })) : g ? b.current = j <= S ? p && j !== -1 ? i.current.length : Q : ue(i, {
3220
3241
  startingIndex: j,
3221
3242
  decrement: !0,
3222
3243
  disabledIndices: x
3223
- }) : b.current = Math.max(P, ue(i, {
3244
+ }) : b.current = Math.max(S, ue(i, {
3224
3245
  startingIndex: j,
3225
3246
  decrement: !0,
3226
3247
  disabledIndices: x
3227
- })), Xe(i, b.current) && (b.current = -1), w();
3228
- }
3229
- }), Y = f.useMemo(() => m && n && J && {
3230
- "aria-activedescendant": H || Me
3231
- }, [m, n, J, H, Me]), Q = f.useMemo(() => ({
3232
- "aria-orientation": I === "both" ? void 0 : I,
3233
- ...K ? {} : Y,
3234
- onKeyDown: oe,
3248
+ })), Ye(i, b.current) && (b.current = -1), w();
3249
+ }
3250
+ }), q = f.useMemo(() => m && n && oe && {
3251
+ "aria-activedescendant": z || Me
3252
+ }, [m, n, oe, z, Me]), J = f.useMemo(() => ({
3253
+ "aria-orientation": C === "both" ? void 0 : C,
3254
+ ...W ? {} : q,
3255
+ onKeyDown: me,
3235
3256
  onPointerMove() {
3236
- S.current = !0;
3257
+ P.current = !0;
3237
3258
  }
3238
- }), [Y, oe, I, K]), Re = f.useMemo(() => {
3239
- function D(P) {
3240
- y === "auto" && Qn(P.nativeEvent) && (O.current = !0);
3259
+ }), [q, me, C, W]), Re = f.useMemo(() => {
3260
+ function M(S) {
3261
+ y === "auto" && Zn(S.nativeEvent) && (T.current = !0);
3241
3262
  }
3242
- function j(P) {
3243
- O.current = y, y === "auto" && Zn(P.nativeEvent) && (O.current = !0);
3263
+ function j(S) {
3264
+ T.current = y, y === "auto" && er(S.nativeEvent) && (T.current = !0);
3244
3265
  }
3245
3266
  return {
3246
- ...Y,
3247
- onKeyDown(P) {
3248
- S.current = !1;
3249
- const Z = P.key.startsWith("Arrow"), ee = ["Home", "End"].includes(P.key), se = Z || ee, nt = _n(P.key, I, h), at = Kn(P.key, I, h, k), rt = _n(P.key, re(), h), be = bt(P.key, I), We = (d ? rt : be) || P.key === "Enter" || P.key.trim() === "";
3267
+ ...q,
3268
+ onKeyDown(S) {
3269
+ P.current = !1;
3270
+ const Q = S.key.startsWith("Arrow"), Z = ["Home", "End"].includes(S.key), ie = Q || Z, nt = Kn(S.key, C, h), at = Vn(S.key, C, h, k), rt = Kn(S.key, de(), h), ye = bt(S.key, C), Ve = (d ? rt : ye) || S.key === "Enter" || S.key.trim() === "";
3250
3271
  if (m && n) {
3251
- const dt = T == null ? void 0 : T.nodesRef.current.find((mt) => mt.parentId == null), De = T && dt ? zr(T.nodesRef.current, dt.id) : null;
3252
- if (se && De && M) {
3272
+ const dt = O == null ? void 0 : O.nodesRef.current.find((mt) => mt.parentId == null), ke = O && dt ? Ur(O.nodesRef.current, dt.id) : null;
3273
+ if (ie && ke && D) {
3253
3274
  const mt = new KeyboardEvent("keydown", {
3254
- key: P.key,
3275
+ key: S.key,
3255
3276
  bubbles: !0
3256
3277
  });
3257
3278
  if (nt || at) {
3258
3279
  var ft, un;
3259
- const Cr = ((ft = De.context) == null ? void 0 : ft.elements.domReference) === P.currentTarget, an = at && !Cr ? (un = De.context) == null ? void 0 : un.elements.domReference : nt ? i.current.find((fn) => (fn == null ? void 0 : fn.id) === Me) : null;
3260
- an && (de(P), an.dispatchEvent(mt), B(void 0));
3280
+ const Tr = ((ft = ke.context) == null ? void 0 : ft.elements.domReference) === S.currentTarget, an = at && !Tr ? (un = ke.context) == null ? void 0 : un.elements.domReference : nt ? i.current.find((fn) => (fn == null ? void 0 : fn.id) === Me) : null;
3281
+ an && (pe(S), an.dispatchEvent(mt), $(void 0));
3261
3282
  }
3262
- if ((be || ee) && De.context && De.context.open && De.parentId && P.currentTarget !== De.context.elements.domReference) {
3283
+ if ((ye || Z) && ke.context && ke.context.open && ke.parentId && S.currentTarget !== ke.context.elements.domReference) {
3263
3284
  var ln;
3264
- de(P), (ln = De.context.elements.domReference) == null || ln.dispatchEvent(mt);
3285
+ pe(S), (ln = ke.context.elements.domReference) == null || ln.dispatchEvent(mt);
3265
3286
  return;
3266
3287
  }
3267
3288
  }
3268
- return oe(P);
3289
+ return me(S);
3269
3290
  }
3270
- if (!(!n && !v && Z)) {
3271
- if (We) {
3272
- const dt = bt(P.key, re());
3273
- R.current = d && dt ? null : P.key;
3291
+ if (!(!n && !v && Q)) {
3292
+ if (Ve) {
3293
+ const dt = bt(S.key, de());
3294
+ E.current = d && dt ? null : S.key;
3274
3295
  }
3275
3296
  if (d) {
3276
- rt && (de(P), n ? (b.current = yt(i, ne.current), w()) : r(!0, P.nativeEvent, "list-navigation"));
3297
+ rt && (pe(S), n ? (b.current = yt(i, te.current), w()) : r(!0, S.nativeEvent, "list-navigation"));
3277
3298
  return;
3278
3299
  }
3279
- be && (l != null && (b.current = l), de(P), !n && v ? r(!0, P.nativeEvent, "list-navigation") : oe(P), n && w());
3300
+ ye && (l != null && (b.current = l), pe(S), !n && v ? r(!0, S.nativeEvent, "list-navigation") : me(S), n && w());
3280
3301
  }
3281
3302
  },
3282
3303
  onFocus() {
@@ -3284,18 +3305,18 @@ function Ei(e, t) {
3284
3305
  },
3285
3306
  onPointerDown: j,
3286
3307
  onPointerEnter: j,
3287
- onMouseDown: D,
3288
- onClick: D
3308
+ onMouseDown: M,
3309
+ onClick: M
3289
3310
  };
3290
- }, [Me, Y, k, oe, ne, y, i, d, w, r, n, v, I, re, h, l, T, m, M]);
3311
+ }, [Me, q, k, me, te, y, i, d, w, r, n, v, C, de, h, l, O, m, D]);
3291
3312
  return f.useMemo(() => u ? {
3292
3313
  reference: Re,
3293
- floating: Q,
3294
- item: ve
3295
- } : {}, [u, Re, Q, ve]);
3314
+ floating: J,
3315
+ item: ne
3316
+ } : {}, [u, Re, J, ne]);
3296
3317
  }
3297
- const Qo = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
3298
- function Ii(e, t) {
3318
+ const ri = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
3319
+ function Mi(e, t) {
3299
3320
  var n, r;
3300
3321
  t === void 0 && (t = {});
3301
3322
  const {
@@ -3307,8 +3328,8 @@ function Ii(e, t) {
3307
3328
  role: a = "dialog"
3308
3329
  } = t, u = Lt(), l = ((n = s.domReference) == null ? void 0 : n.id) || u, p = f.useMemo(() => {
3309
3330
  var v;
3310
- return ((v = Ct(s.floating)) == null ? void 0 : v.id) || i;
3311
- }, [s.floating, i]), g = (r = Qo.get(a)) != null ? r : a, h = et() != null, m = f.useMemo(() => g === "tooltip" || a === "label" ? {
3331
+ return ((v = It(s.floating)) == null ? void 0 : v.id) || i;
3332
+ }, [s.floating, i]), g = (r = ri.get(a)) != null ? r : a, h = et() != null, m = f.useMemo(() => g === "tooltip" || a === "label" ? {
3312
3333
  ["aria-" + (a === "label" ? "labelledby" : "describedby")]: o ? p : void 0
3313
3334
  } : {
3314
3335
  "aria-expanded": o ? "true" : "false",
@@ -3342,10 +3363,10 @@ function Ii(e, t) {
3342
3363
  "aria-labelledby": l
3343
3364
  }
3344
3365
  };
3345
- }, [g, p, l, a]), E = f.useCallback((v) => {
3366
+ }, [g, p, l, a]), R = f.useCallback((v) => {
3346
3367
  let {
3347
3368
  active: x,
3348
- selected: I
3369
+ selected: C
3349
3370
  } = v;
3350
3371
  const A = {
3351
3372
  role: "option",
@@ -3357,12 +3378,12 @@ function Ii(e, t) {
3357
3378
  case "select":
3358
3379
  return {
3359
3380
  ...A,
3360
- "aria-selected": x && I
3381
+ "aria-selected": x && C
3361
3382
  };
3362
3383
  case "combobox":
3363
3384
  return {
3364
3385
  ...A,
3365
- "aria-selected": I
3386
+ "aria-selected": C
3366
3387
  };
3367
3388
  }
3368
3389
  return {};
@@ -3370,10 +3391,10 @@ function Ii(e, t) {
3370
3391
  return f.useMemo(() => c ? {
3371
3392
  reference: m,
3372
3393
  floating: y,
3373
- item: E
3374
- } : {}, [c, m, y, E]);
3394
+ item: R
3395
+ } : {}, [c, m, y, R]);
3375
3396
  }
3376
- function Zo(e, t) {
3397
+ function oi(e, t) {
3377
3398
  const [n, r] = f.useState(e);
3378
3399
  return e && !n && r(!0), f.useEffect(() => {
3379
3400
  if (!e && n) {
@@ -3382,7 +3403,7 @@ function Zo(e, t) {
3382
3403
  }
3383
3404
  }, [e, n, t]), n;
3384
3405
  }
3385
- function Ci(e, t) {
3406
+ function Pi(e, t) {
3386
3407
  t === void 0 && (t = {});
3387
3408
  const {
3388
3409
  open: n,
@@ -3391,7 +3412,7 @@ function Ci(e, t) {
3391
3412
  }
3392
3413
  } = e, {
3393
3414
  duration: o = 250
3394
- } = t, i = (typeof o == "number" ? o : o.close) || 0, [c, a] = f.useState("unmounted"), u = Zo(n, i);
3415
+ } = t, i = (typeof o == "number" ? o : o.close) || 0, [c, a] = f.useState("unmounted"), u = oi(n, i);
3395
3416
  return !u && c === "close" && a("unmounted"), X(() => {
3396
3417
  if (r) {
3397
3418
  if (n) {
@@ -3413,30 +3434,30 @@ function Ci(e, t) {
3413
3434
  };
3414
3435
  }
3415
3436
  export {
3416
- li as C,
3417
- mi as F,
3418
- ai as a,
3419
- ui as b,
3420
- ci as c,
3421
- xi as d,
3422
- bi as e,
3423
- si as f,
3424
- yi as g,
3425
- Ii as h,
3426
- Ri as i,
3427
- ri as j,
3428
- et as k,
3429
- fi as l,
3430
- di as m,
3431
- pi as n,
3432
- oi as o,
3433
- Mo as p,
3434
- hi as q,
3435
- Ei as r,
3436
- ii as s,
3437
- gi as t,
3438
- So as u,
3439
- wi as v,
3440
- Ci as w,
3441
- vi as x
3437
+ pi as C,
3438
+ bi as F,
3439
+ gi as a,
3440
+ et as b,
3441
+ hi as c,
3442
+ vi as d,
3443
+ xi as e,
3444
+ Lo as f,
3445
+ wi as g,
3446
+ fi as h,
3447
+ Ii as i,
3448
+ ui as j,
3449
+ Ci as k,
3450
+ Mi as l,
3451
+ Oi as m,
3452
+ Ai as n,
3453
+ li as o,
3454
+ mi as p,
3455
+ ai as q,
3456
+ yi as r,
3457
+ di as s,
3458
+ Ti as t,
3459
+ Fo as u,
3460
+ Ei as v,
3461
+ Pi as w,
3462
+ Ri as x
3442
3463
  };