@konstructio/ui 0.1.2-alpha.105 → 0.1.2-alpha.107

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 (263) hide show
  1. package/README.md +118 -31
  2. package/dist/{AdditionalOptions-D0BAS2HG.js → AdditionalOptions-Crcnz0_g.js} +1 -1
  3. package/dist/{AlertDialogTrigger-BGo_acd5.js → AlertDialogTrigger-ouMGAlJW.js} +39 -39
  4. package/dist/{Breadcrumb-Cp3abB2w.js → Breadcrumb-MrF1Z6w2.js} +3 -3
  5. package/dist/{Checkbox-B_ngk9Dj.js → Checkbox-8KnRLpQG.js} +60 -61
  6. package/dist/{CommandInput-BLq69pOT.js → CommandInput-CGnqfudl.js} +4 -4
  7. package/dist/{Counter-BV680M5r.js → Counter-CDXdP1Af.js} +3 -3
  8. package/dist/{DayPicker-kweJz134.js → DayPicker-C22j0Y-u.js} +539 -518
  9. package/dist/{DropdownButton-DfNojmCW.js → DropdownButton-D4QlKGg7.js} +7 -7
  10. package/dist/{FlagSelectorList-CkTR3j6O.js → FlagSelectorList-tYZNl-tz.js} +31 -24
  11. package/dist/{HamburgerTrigger-DRylBL2d.js → HamburgerTrigger-B_NGSZ2r.js} +20 -20
  12. package/dist/{ImageUpload-DiwymQcU.js → ImageUpload-D7HKSXK8.js} +71 -66
  13. package/dist/Input-is8n7emP.js +195 -0
  14. package/dist/{Loading-DUh9PMJN.js → Loading-DO8JOWBV.js} +1 -1
  15. package/dist/{Modal-Dyn088X7.js → Modal-Dq9BHD_9.js} +4 -4
  16. package/dist/{Spinner-CUwE2bLm.js → Spinner-BJE79VTl.js} +1 -1
  17. package/dist/{StepIndicatorContent-CjbjVjS1.js → StepIndicatorContent-BGDvxLzV.js} +1 -1
  18. package/dist/Switch-C7286Bcu.js +199 -0
  19. package/dist/{Toast-3NEz7LLa.js → Toast-jSx3Lao8.js} +8 -7
  20. package/dist/Wrapper-2AUlYAHQ.js +195 -0
  21. package/dist/{Wrapper-CVJSuYWx.js → Wrapper-CyHxGs4E.js} +4 -4
  22. package/dist/{Wrapper-DP6Sxngx.js → Wrapper-a7RVCcrn.js} +248 -242
  23. package/dist/components/Alert/Alert.js +2 -2
  24. package/dist/components/AlertDialog/AlertDialog.js +2 -2
  25. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  26. package/dist/components/AlertDialog/components/index.js +1 -1
  27. package/dist/components/Autocomplete/Autocomplete.js +1 -1
  28. package/dist/components/Autocomplete/components/List/List.js +1 -1
  29. package/dist/components/Autocomplete/hooks/useAutocomplete.js +27 -25
  30. package/dist/components/Autocomplete/hooks/useNavigationList.js +2 -3
  31. package/dist/components/Badge/Badge.js +2 -2
  32. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  33. package/dist/components/Breadcrumb/components/BackButton/BackButton.js +2 -2
  34. package/dist/components/Breadcrumb/components/Item/Item.js +2 -2
  35. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  36. package/dist/components/Button/Button.js +1 -1
  37. package/dist/components/ButtonGroup/ButtonGroup.js +65 -60
  38. package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +2 -2
  39. package/dist/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.js +10 -9
  40. package/dist/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.js +8 -6
  41. package/dist/components/Card/Card.js +25 -22
  42. package/dist/components/Checkbox/Checkbox.js +1 -1
  43. package/dist/components/Command/Command.js +2 -2
  44. package/dist/components/Command/components/Command.js +1 -1
  45. package/dist/components/Command/components/CommandEmpty.js +1 -1
  46. package/dist/components/Command/components/CommandGroup.js +2 -2
  47. package/dist/components/Command/components/CommandInput.js +1 -1
  48. package/dist/components/Command/components/CommandItem.js +2 -2
  49. package/dist/components/Command/components/CommandList.js +2 -2
  50. package/dist/components/Command/components/CommandSeparator.js +2 -2
  51. package/dist/components/Command/components/CommandShortcut.js +1 -1
  52. package/dist/components/Command/components/DialogContent.js +3 -3
  53. package/dist/components/Command/components/DialogOverlay.js +2 -2
  54. package/dist/components/Command/components/index.js +1 -1
  55. package/dist/components/Counter/Counter.js +1 -1
  56. package/dist/components/DateRangePicker/DateRangePicker.js +1 -1
  57. package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarDivider/CalendarDivider.js +1 -1
  58. package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +3 -3
  59. package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +3 -3
  60. package/dist/components/DateRangePicker/components/CalendarPanel/components/NavigationButton/NavigationButton.js +1 -1
  61. package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +2 -2
  62. package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +1 -1
  63. package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +1 -1
  64. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +1 -1
  65. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +30 -28
  66. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +23 -21
  67. package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +1 -1
  68. package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.js +1 -1
  69. package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +48 -41
  70. package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +48 -41
  71. package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.js +1 -1
  72. package/dist/components/Datepicker/DatePicker.js +2 -2
  73. package/dist/components/Divider/Divider.js +7 -7
  74. package/dist/components/Drawer/Drawer.js +28 -26
  75. package/dist/components/Drawer/components/Body/Body.js +1 -1
  76. package/dist/components/Drawer/components/Footer/Footer.js +1 -1
  77. package/dist/components/Drawer/components/Header/Header.js +1 -1
  78. package/dist/components/DropdownButton/DropdownButton.js +1 -1
  79. package/dist/components/Filter/Filter.js +1 -1
  80. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +51 -36
  81. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +40 -38
  82. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +1 -1
  83. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
  84. package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +1 -1
  85. package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.js +1 -1
  86. package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +2 -2
  87. package/dist/components/Filter/components/ResetButton/ResetButton.js +1 -1
  88. package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +43 -41
  89. package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +1 -1
  90. package/dist/components/Filter/utils/index.js +1 -1
  91. package/dist/components/ImageUpload/ImageUpload.js +1 -1
  92. package/dist/components/Input/Input.js +1 -1
  93. package/dist/components/LineChart/LineChart.js +2 -2
  94. package/dist/components/Loading/Loading.js +1 -1
  95. package/dist/components/Modal/Modal.js +1 -1
  96. package/dist/components/Modal/components/Body/Body.js +1 -1
  97. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  98. package/dist/components/Modal/components/Header/Header.js +1 -1
  99. package/dist/components/Modal/components/Wrapper/Wrapper.js +1 -1
  100. package/dist/components/Modal/components/index.js +1 -1
  101. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +1 -1
  102. package/dist/components/MultiSelectDropdown/components/Item/Item.js +1 -1
  103. package/dist/components/MultiSelectDropdown/components/List/List.js +1 -1
  104. package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +1 -1
  105. package/dist/components/MultiSelectDropdown/components/index.js +1 -1
  106. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +4 -3
  107. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +17 -16
  108. package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +11 -11
  109. package/dist/components/PhoneNumberInput/PhoneNumberInput.js +2 -2
  110. package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +1 -1
  111. package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +1 -1
  112. package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +3 -3
  113. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +3 -3
  114. package/dist/components/PhoneNumberInput/components/Wrapper.js +1 -1
  115. package/dist/components/PhoneNumberInput/components/index.js +2 -2
  116. package/dist/components/PhoneNumberInput/contexts/index.js +1 -1
  117. package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +1 -1
  118. package/dist/components/PhoneNumberInput/utils/index.js +1 -1
  119. package/dist/components/PieChart/PieChart.js +31 -28
  120. package/dist/components/ProgressBar/ProgressBar.js +1 -1
  121. package/dist/components/Radio/Radio.js +1 -1
  122. package/dist/components/RadioCard/RadioCard.js +1 -1
  123. package/dist/components/RadioCardGroup/RadioCardGroup.js +1 -1
  124. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  125. package/dist/components/Range/Range.js +2 -2
  126. package/dist/components/Select/Select.js +43 -36
  127. package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.js +1 -1
  128. package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.variants.js +1 -1
  129. package/dist/components/Select/components/List/List.js +78 -67
  130. package/dist/components/Select/components/ListItem/ListItem.js +1 -1
  131. package/dist/components/Select/components/Wrapper.js +1 -1
  132. package/dist/components/Select/components/index.js +2 -2
  133. package/dist/components/Select/hooks/useNavigationList.js +2 -3
  134. package/dist/components/Select/hooks/useSelect.js +8 -8
  135. package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.js +1 -1
  136. package/dist/components/Sidebar/components/Footer/Footer.js +1 -1
  137. package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
  138. package/dist/components/Sidebar/components/Label/Label.js +1 -1
  139. package/dist/components/Sidebar/components/Logo/Logo.js +1 -1
  140. package/dist/components/Sidebar/components/Navigation/Navigation.js +1 -1
  141. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +1 -1
  142. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +2 -2
  143. package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +1 -1
  144. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +1 -1
  145. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +25 -24
  146. package/dist/components/Sidebar/components/index.js +1 -1
  147. package/dist/components/Slider/Slider.js +2 -2
  148. package/dist/components/Spinner/Spinner.js +1 -1
  149. package/dist/components/Stepper/Stepper.js +1 -1
  150. package/dist/components/Stepper/components/HorizontalStepItem/HorizontalStepItem.js +2 -2
  151. package/dist/components/Stepper/components/StepConnector/StepConnector.js +1 -1
  152. package/dist/components/Stepper/components/StepIndicatorContent/StepIndicatorContent.js +1 -1
  153. package/dist/components/Stepper/components/VerticalStepItem/VerticalStepItem.js +2 -2
  154. package/dist/components/Switch/Switch.js +1 -1
  155. package/dist/components/Switch/Switch.variants.js +15 -7
  156. package/dist/components/Table/Table.js +1 -1
  157. package/dist/components/Table/components/Body.js +1 -1
  158. package/dist/components/Table/components/Filter.js +1 -1
  159. package/dist/components/Table/components/Head.js +1 -1
  160. package/dist/components/Table/components/Row.js +1 -1
  161. package/dist/components/Tabs/Tabs.js +2 -2
  162. package/dist/components/Tabs/components/Content.js +2 -2
  163. package/dist/components/Tabs/components/List.js +2 -2
  164. package/dist/components/Tabs/components/Trigger.js +2 -2
  165. package/dist/components/Tag/Tag.js +8 -8
  166. package/dist/components/TagSelect/TagSelect.js +1 -1
  167. package/dist/components/TagSelect/components/Item/Item.js +1 -1
  168. package/dist/components/TagSelect/components/List/List.js +1 -1
  169. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +1 -1
  170. package/dist/components/TagSelect/components/index.js +1 -1
  171. package/dist/components/TagSelect/hooks/useTagSelect.js +11 -11
  172. package/dist/components/TextArea/TextArea.js +71 -26
  173. package/dist/components/TextArea/TextArea.variants.js +49 -13
  174. package/dist/components/TimePicker/components/HoursList/HoursList.js +1 -1
  175. package/dist/components/TimePicker/components/MeridianList/MeridianList.js +1 -1
  176. package/dist/components/TimePicker/components/MinutesList/MinutesList.js +1 -1
  177. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +114 -99
  178. package/dist/components/TimePicker/components/WrapperList/WrapperList.js +19 -18
  179. package/dist/components/Toast/Toast.js +1 -1
  180. package/dist/components/Tooltip/Tooltip.js +2 -2
  181. package/dist/components/Typography/Typography.js +19 -16
  182. package/dist/components/VirtualizedTable/VirtualizedTable.js +2 -2
  183. package/dist/components/VirtualizedTable/components/Actions/Actions.js +1 -1
  184. package/dist/components/VirtualizedTable/components/Body/Body.js +2 -2
  185. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +1 -1
  186. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +2 -2
  187. package/dist/components/VirtualizedTable/components/ExpandableRow/ExpandableRow.js +1 -1
  188. package/dist/components/VirtualizedTable/components/Filter/Filter.js +4 -4
  189. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +1 -1
  190. package/dist/components/VirtualizedTable/components/Header/Header.js +2 -2
  191. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +1 -1
  192. package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +1 -1
  193. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +3 -3
  194. package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +1 -1
  195. package/dist/components/VirtualizedTable/contexts/index.js +1 -1
  196. package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
  197. package/dist/components/index.js +12 -12
  198. package/dist/{components-Cf345jTv.js → components-CaEW5ge4.js} +32 -32
  199. package/dist/{constants-CxJJRVK3.js → constants-HQIXhj2t.js} +2 -2
  200. package/dist/contexts/index.js +1 -1
  201. package/dist/contexts/theme.provider.js +1 -1
  202. package/dist/{debounce-C5Ycjilj.js → debounce-BdyZeJQk.js} +2 -2
  203. package/dist/{dist-DFCz63oC2.js → dist-9WbMf_jT.js} +158 -159
  204. package/dist/{dist-tGUUcv8n.js → dist-AxOGvL82.js} +114 -115
  205. package/dist/{dist-DDck_2lb.js → dist-BIBFLVt1.js} +117 -116
  206. package/dist/{dist-BZNE2Tnx.js → dist-BbX4Nrk2.js} +1 -1
  207. package/dist/{dist-BaPW7qXd2.js → dist-BnCbAI-c.js} +1 -1
  208. package/dist/{dist-BdobXn93.js → dist-CszFjHAP.js} +2 -2
  209. package/dist/{dist-C3YVLapk.js → dist-DO3apbIh.js} +24 -24
  210. package/dist/{dist-CzKqHuqJ2.js → dist-DwxO2RoR.js} +38 -38
  211. package/dist/{dist-AihTpWdF.js → dist-iUAHw-3y.js} +272 -272
  212. package/dist/{dist-BlPTJNIm.js → dist-pxvIAJzo.js} +2 -2
  213. package/dist/es2015-B_07N-UL.js +796 -0
  214. package/dist/hooks/useMediaQuery.js +1 -1
  215. package/dist/index.js +14 -14
  216. package/dist/{isObject-BeFFiVJK.js → isObject-pLoSfdr0.js} +1 -1
  217. package/dist/lib/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.types.d.ts +1 -1
  218. package/dist/lib/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.types.d.ts +2 -0
  219. package/dist/lib/components/Card/Card.types.d.ts +1 -0
  220. package/dist/lib/components/Checkbox/Checkbox.d.ts +1 -1
  221. package/dist/lib/components/Checkbox/Checkbox.types.d.ts +2 -1
  222. package/dist/lib/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.types.d.ts +1 -0
  223. package/dist/lib/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.types.d.ts +1 -0
  224. package/dist/lib/components/Divider/Divider.d.ts +3 -2
  225. package/dist/lib/components/Divider/Divider.types.d.ts +4 -0
  226. package/dist/lib/components/Input/Input.types.d.ts +4 -0
  227. package/dist/lib/components/MultiSelectDropdown/MultiSelectDropdown.types.d.ts +2 -0
  228. package/dist/lib/components/MultiSelectDropdown/contexts/MultiSelectDropdown.types.d.ts +2 -0
  229. package/dist/lib/components/Select/Select.types.d.ts +2 -0
  230. package/dist/lib/components/Select/components/List/List.types.d.ts +3 -0
  231. package/dist/lib/components/Select/components/Wrapper.d.ts +2 -0
  232. package/dist/lib/components/Sidebar/Sidebar.types.d.ts +2 -0
  233. package/dist/lib/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.types.d.ts +2 -0
  234. package/dist/lib/components/Switch/Switch.variants.d.ts +3 -1
  235. package/dist/lib/components/Tag/Tag.types.d.ts +1 -0
  236. package/dist/lib/components/TextArea/TextArea.d.ts +6 -0
  237. package/dist/lib/components/TextArea/TextArea.types.d.ts +13 -2
  238. package/dist/lib/components/TextArea/TextArea.variants.d.ts +4 -1
  239. package/dist/lib/components/TimePicker/TimePicker.types.d.ts +4 -0
  240. package/dist/lib/components/TimePicker/components/WrapperList/WrapperList.types.d.ts +1 -0
  241. package/dist/lib/utils/index.d.ts +1 -0
  242. package/dist/{libphonenumber-hGupNnJu.js → libphonenumber-BMq3Thej.js} +356 -347
  243. package/dist/package.json +27 -27
  244. package/dist/{phone-number.provider-BxQCTxp8.js → phone-number.provider-Dkq_p1Gi.js} +2 -2
  245. package/dist/{prop-types-CfEYxTbR.js → prop-types-BCUW56rg.js} +1 -1
  246. package/dist/{react-CvUtBTMg.js → react-7zQ6bvbE.js} +837 -828
  247. package/dist/{rolldown-runtime-Ck3dxwZt.js → rolldown-runtime-Dw9YIBcH.js} +1 -1
  248. package/dist/styles.css +1 -1
  249. package/dist/{table.provider-B0BafHuU.js → table.provider-CWzODR1t.js} +96 -96
  250. package/dist/{theme.provider-Dw4O3ocC.js → theme.provider-CSL1WCYG.js} +1 -1
  251. package/dist/{useBreadcrumb-DYfZL_2p.js → useBreadcrumb-Ds_9BeFz.js} +7 -6
  252. package/dist/utils/index.js +6 -5
  253. package/dist/{utils-Cx-WzRZF.js → utils-B-6R7kNE.js} +8 -4
  254. package/dist/{utils-B-BTGYA5.js → utils-DVYdP0CJ.js} +2 -3
  255. package/dist/{x-BI9jmc7e.js → x-Ierxf0uI.js} +2 -2
  256. package/package.json +27 -27
  257. package/dist/Input-Cf44DzfE.js +0 -188
  258. package/dist/Switch-aPhL5rNG.js +0 -196
  259. package/dist/Wrapper-R8fik3ah.js +0 -182
  260. package/dist/es2015-DigR3dar.js +0 -795
  261. /package/dist/{dist-DGOjiAnB2.js → dist-DGOjiAnB.js} +0 -0
  262. /package/dist/{dist-pWlMx4Fi2.js → dist-pWlMx4Fi.js} +0 -0
  263. /package/dist/{x-a_LpoXzG2.js → x-a_LpoXzG.js} +0 -0
@@ -1,795 +0,0 @@
1
- import { o as Sr } from "./rolldown-runtime-Ck3dxwZt.js";
2
- import { t as Nr } from "./prop-types-CfEYxTbR.js";
3
- import { i as Tr, n as ie, r as Pr } from "./Combination-CnMM05mt.js";
4
- import O, { Fragment as Ce, PureComponent as _r, createContext as Ar, forwardRef as Le, useCallback as L, useEffect as Dr, useMemo as Mr, useRef as X, useState as Z } from "react";
5
- function Cr(e, r) {
6
- if (e == null) return {};
7
- var t = {};
8
- for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
9
- if (r.indexOf(n) !== -1) continue;
10
- t[n] = e[n];
11
- }
12
- return t;
13
- }
14
- function W() {
15
- return W = Object.assign ? Object.assign.bind() : function(e) {
16
- for (var r = 1; r < arguments.length; r++) {
17
- var t = arguments[r];
18
- for (var n in t) ({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
19
- }
20
- return e;
21
- }, W.apply(null, arguments);
22
- }
23
- var ne = "data-focus-lock", ke = "data-focus-lock-disabled", Lr = "data-no-focus-lock", kr = "data-autofocus-inside", Rr = "data-no-autofocus", d = /* @__PURE__ */ Sr(Nr()), R = {
24
- width: "1px",
25
- height: "0px",
26
- padding: 0,
27
- overflow: "hidden",
28
- position: "fixed",
29
- top: "1px",
30
- left: "1px"
31
- }, Wr = function(r) {
32
- var t = r.children, n = t === void 0 ? null : t;
33
- return /* @__PURE__ */ O.createElement(Ce, null, /* @__PURE__ */ O.createElement("div", {
34
- key: "guard-first",
35
- "data-focus-guard": !0,
36
- "data-focus-auto-guard": !0,
37
- style: R
38
- }), n, n && /* @__PURE__ */ O.createElement("div", {
39
- key: "guard-last",
40
- "data-focus-guard": !0,
41
- "data-focus-auto-guard": !0,
42
- style: R
43
- }));
44
- };
45
- Wr.propTypes = process.env.NODE_ENV !== "production" ? { children: d.default.node } : {};
46
- var Re = ie({}, function(e) {
47
- return {
48
- target: e.target,
49
- currentTarget: e.currentTarget
50
- };
51
- }), We = ie(), Ur = ie(), Br = Pr({
52
- async: !0,
53
- ssr: typeof document < "u"
54
- }), Gr = /* @__PURE__ */ Ar(void 0), jr = [], ce = /* @__PURE__ */ Le(function(r, t) {
55
- var n, o = Z(), u = o[0], a = o[1], f = X(), v = X(!1), c = X(null), m = Z({})[1], s = r.children, i = r.disabled, l = i === void 0 ? !1 : i, p = r.noFocusGuards, h = p === void 0 ? !1 : p, F = r.persistentFocus, x = F === void 0 ? !1 : F, b = r.crossFrame, y = b === void 0 ? !0 : b, E = r.autoFocus, S = E === void 0 ? !0 : E, H = r.allowTextSelection, V = r.group, Y = r.className, sr = r.whiteList, dr = r.hasPositiveIndices, ge = r.shards, z = ge === void 0 ? jr : ge, Fe = r.as, Ee = Fe === void 0 ? "div" : Fe, Oe = r.lockProps, lr = Oe === void 0 ? {} : Oe, vr = r.sideCar, xe = r.returnFocus, q = xe === void 0 ? !1 : xe, mr = r.focusOptions, J = r.onActivation, Q = r.onDeactivation, pr = Z({})[0], br = L(function(I) {
56
- var _ = I.captureFocusRestore;
57
- if (!c.current) {
58
- var A, N = (A = document) == null ? void 0 : A.activeElement;
59
- c.current = N, N !== document.body && (c.current = _(N));
60
- }
61
- f.current && J && J(f.current), v.current = !0, m();
62
- }, [J]), hr = L(function() {
63
- v.current = !1, Q && Q(f.current), m();
64
- }, [Q]), yr = L(function(I) {
65
- var _ = c.current;
66
- if (_) {
67
- var A = (typeof _ == "function" ? _() : _) || document.body, N = typeof q == "function" ? q(A) : q;
68
- if (N) {
69
- var Ie = typeof N == "object" ? N : void 0;
70
- c.current = null, I ? Promise.resolve().then(function() {
71
- return A.focus(Ie);
72
- }) : A.focus(Ie);
73
- }
74
- }
75
- }, [q]), gr = L(function(I) {
76
- v.current && Re.useMedium(I);
77
- }, []), Fr = We.useMedium, Er = L(function(I) {
78
- f.current !== I && (f.current = I, a(I));
79
- }, []);
80
- process.env.NODE_ENV !== "production" && (typeof H < "u" && console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"), Dr(function() {
81
- !f.current && typeof Ee != "string" && console.error("FocusLock: could not obtain ref to internal node");
82
- }, []));
83
- var Or = W((n = {}, n[ke] = l && "disabled", n[ne] = V, n), lr), we = h !== !0, xr = we && h !== "tail", wr = Tr([t, Er]), Ir = Mr(function() {
84
- return {
85
- observed: f,
86
- shards: z,
87
- enabled: !l,
88
- get active() {
89
- return v.current;
90
- }
91
- };
92
- }, [
93
- l,
94
- v,
95
- z,
96
- f
97
- ]);
98
- return /* @__PURE__ */ O.createElement(Ce, null, we && [/* @__PURE__ */ O.createElement("div", {
99
- key: "guard-first",
100
- "data-focus-guard": !0,
101
- tabIndex: l ? -1 : 0,
102
- style: R
103
- }), dr ? /* @__PURE__ */ O.createElement("div", {
104
- key: "guard-nearest",
105
- "data-focus-guard": !0,
106
- tabIndex: l ? -1 : 1,
107
- style: R
108
- }) : null], !l && /* @__PURE__ */ O.createElement(vr, {
109
- id: pr,
110
- sideCar: Br,
111
- observed: u,
112
- disabled: l,
113
- persistentFocus: x,
114
- crossFrame: y,
115
- autoFocus: S,
116
- whiteList: sr,
117
- shards: z,
118
- onActivation: br,
119
- onDeactivation: hr,
120
- returnFocus: yr,
121
- focusOptions: mr,
122
- noFocusGuards: h
123
- }), /* @__PURE__ */ O.createElement(Ee, W({ ref: wr }, Or, {
124
- className: Y,
125
- onBlur: Fr,
126
- onFocus: gr
127
- }), /* @__PURE__ */ O.createElement(Gr.Provider, { value: Ir }, s)), xr && /* @__PURE__ */ O.createElement("div", {
128
- "data-focus-guard": !0,
129
- tabIndex: l ? -1 : 0,
130
- style: R
131
- }));
132
- });
133
- ce.propTypes = process.env.NODE_ENV !== "production" ? {
134
- children: d.node,
135
- disabled: d.bool,
136
- returnFocus: (0, d.oneOfType)([
137
- d.bool,
138
- d.object,
139
- d.func
140
- ]),
141
- focusOptions: d.object,
142
- noFocusGuards: d.bool,
143
- hasPositiveIndices: d.bool,
144
- allowTextSelection: d.bool,
145
- autoFocus: d.bool,
146
- persistentFocus: d.bool,
147
- crossFrame: d.bool,
148
- group: d.string,
149
- className: d.string,
150
- whiteList: d.func,
151
- shards: (0, d.arrayOf)(d.any),
152
- as: (0, d.oneOfType)([
153
- d.string,
154
- d.func,
155
- d.object
156
- ]),
157
- lockProps: d.object,
158
- onActivation: d.func,
159
- onDeactivation: d.func,
160
- sideCar: d.any.isRequired
161
- } : {};
162
- function oe(e, r) {
163
- return oe = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, n) {
164
- return t.__proto__ = n, t;
165
- }, oe(e, r);
166
- }
167
- function Hr(e, r) {
168
- e.prototype = Object.create(r.prototype), e.prototype.constructor = e, oe(e, r);
169
- }
170
- function U(e) {
171
- "@babel/helpers - typeof";
172
- return U = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
173
- return typeof r;
174
- } : function(r) {
175
- return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
176
- }, U(e);
177
- }
178
- function Vr(e, r) {
179
- if (U(e) != "object" || !e) return e;
180
- var t = e[Symbol.toPrimitive];
181
- if (t !== void 0) {
182
- var n = t.call(e, r || "default");
183
- if (U(n) != "object") return n;
184
- throw new TypeError("@@toPrimitive must return a primitive value.");
185
- }
186
- return (r === "string" ? String : Number)(e);
187
- }
188
- function qr(e) {
189
- var r = Vr(e, "string");
190
- return U(r) == "symbol" ? r : r + "";
191
- }
192
- function $r(e, r, t) {
193
- return (r = qr(r)) in e ? Object.defineProperty(e, r, {
194
- value: t,
195
- enumerable: !0,
196
- configurable: !0,
197
- writable: !0
198
- }) : e[r] = t, e;
199
- }
200
- function Kr(e, r) {
201
- if (process.env.NODE_ENV !== "production") {
202
- if (typeof e != "function") throw new Error("Expected reducePropsToState to be a function.");
203
- if (typeof r != "function") throw new Error("Expected handleStateChangeOnClient to be a function.");
204
- }
205
- function t(n) {
206
- return n.displayName || n.name || "Component";
207
- }
208
- return function(o) {
209
- if (process.env.NODE_ENV !== "production" && typeof o != "function")
210
- throw new Error("Expected WrappedComponent to be a React component.");
211
- var u = [], a;
212
- function f() {
213
- a = e(u.map(function(c) {
214
- return c.props;
215
- })), r(a);
216
- }
217
- var v = /* @__PURE__ */ (function(c) {
218
- Hr(m, c);
219
- function m() {
220
- return c.apply(this, arguments) || this;
221
- }
222
- m.peek = function() {
223
- return a;
224
- };
225
- var s = m.prototype;
226
- return s.componentDidMount = function() {
227
- u.push(this), f();
228
- }, s.componentDidUpdate = function() {
229
- f();
230
- }, s.componentWillUnmount = function() {
231
- var l = u.indexOf(this);
232
- u.splice(l, 1), f();
233
- }, s.render = function() {
234
- return /* @__PURE__ */ O.createElement(o, this.props);
235
- }, m;
236
- })(_r);
237
- return $r(v, "displayName", "SideEffect(" + t(o) + ")"), v;
238
- };
239
- }
240
- var w = function(e) {
241
- for (var r = Array(e.length), t = 0; t < e.length; ++t) r[t] = e[t];
242
- return r;
243
- }, P = function(e) {
244
- return Array.isArray(e) ? e : [e];
245
- }, Ue = function(e) {
246
- return Array.isArray(e) ? e[0] : e;
247
- }, Yr = function(e) {
248
- if (e.nodeType !== Node.ELEMENT_NODE) return !1;
249
- var r = window.getComputedStyle(e, null);
250
- return !r || !r.getPropertyValue ? !1 : r.getPropertyValue("display") === "none" || r.getPropertyValue("visibility") === "hidden";
251
- }, Be = function(e) {
252
- return e.parentNode && e.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? e.parentNode.host : e.parentNode;
253
- }, Ge = function(e) {
254
- return e === document || e && e.nodeType === Node.DOCUMENT_NODE;
255
- }, zr = function(e) {
256
- return e.hasAttribute("inert");
257
- }, Jr = function(e, r) {
258
- return !e || Ge(e) || !Yr(e) && !zr(e) && r(Be(e));
259
- }, je = function(e, r) {
260
- var t = e.get(r);
261
- if (t !== void 0) return t;
262
- var n = Jr(r, je.bind(void 0, e));
263
- return e.set(r, n), n;
264
- }, Qr = function(e, r) {
265
- return e && !Ge(e) ? et(e) ? r(Be(e)) : !1 : !0;
266
- }, He = function(e, r) {
267
- var t = e.get(r);
268
- if (t !== void 0) return t;
269
- var n = Qr(r, He.bind(void 0, e));
270
- return e.set(r, n), n;
271
- }, Ve = function(e) {
272
- return e.dataset;
273
- }, Xr = function(e) {
274
- return e.tagName === "BUTTON";
275
- }, qe = function(e) {
276
- return e.tagName === "INPUT";
277
- }, $e = function(e) {
278
- return qe(e) && e.type === "radio";
279
- }, Zr = function(e) {
280
- return !((qe(e) || Xr(e)) && (e.type === "hidden" || e.disabled));
281
- }, et = function(e) {
282
- var r = e.getAttribute(Rr);
283
- return ![
284
- !0,
285
- "true",
286
- ""
287
- ].includes(r);
288
- }, fe = function(e) {
289
- var r;
290
- return !!(e && (!((r = Ve(e)) === null || r === void 0) && r.focusGuard));
291
- }, ue = function(e) {
292
- return !fe(e);
293
- }, rt = function(e) {
294
- return !!e;
295
- }, tt = function(e, r) {
296
- var t = Math.max(0, e.tabIndex), n = Math.max(0, r.tabIndex), o = t - n, u = e.index - r.index;
297
- if (o) {
298
- if (!t) return 1;
299
- if (!n) return -1;
300
- }
301
- return o || u;
302
- }, nt = function(e) {
303
- return e.tabIndex < 0 && !e.hasAttribute("tabindex") ? 0 : e.tabIndex;
304
- }, se = function(e, r, t) {
305
- return w(e).map(function(n, o) {
306
- var u = nt(n);
307
- return {
308
- node: n,
309
- index: o,
310
- tabIndex: t && u === -1 ? (n.dataset || {}).focusGuard ? 0 : -1 : u
311
- };
312
- }).filter(function(n) {
313
- return !r || n.tabIndex >= 0;
314
- }).sort(tt);
315
- }, ot = [
316
- "button:enabled",
317
- "select:enabled",
318
- "textarea:enabled",
319
- "input:enabled",
320
- "a[href]",
321
- "area[href]",
322
- "summary",
323
- "iframe",
324
- "object",
325
- "embed",
326
- "audio[controls]",
327
- "video[controls]",
328
- "[tabindex]",
329
- "[contenteditable]",
330
- "[autofocus]"
331
- ], de = ot.join(","), ut = "".concat(de, ", [data-focus-guard]"), Ke = function(e, r) {
332
- return w((e.shadowRoot || e).children).reduce(function(t, n) {
333
- return t.concat(n.matches(r ? ut : de) ? [n] : [], Ke(n));
334
- }, []);
335
- }, at = function(e, r) {
336
- var t;
337
- return e instanceof HTMLIFrameElement && (!((t = e.contentDocument) === null || t === void 0) && t.body) ? C([e.contentDocument.body], r) : [e];
338
- }, C = function(e, r) {
339
- return e.reduce(function(t, n) {
340
- var o, u = Ke(n, r), a = (o = []).concat.apply(o, u.map(function(f) {
341
- return at(f, r);
342
- }));
343
- return t.concat(a, n.parentNode ? w(n.parentNode.querySelectorAll(de)).filter(function(f) {
344
- return f === n;
345
- }) : []);
346
- }, []);
347
- }, it = function(e) {
348
- return w(e.querySelectorAll("[".concat(kr, "]"))).map(function(r) {
349
- return C([r]);
350
- }).reduce(function(r, t) {
351
- return r.concat(t);
352
- }, []);
353
- }, le = function(e, r) {
354
- return w(e).filter(function(t) {
355
- return je(r, t);
356
- }).filter(function(t) {
357
- return Zr(t);
358
- });
359
- }, Se = function(e, r) {
360
- return r === void 0 && (r = /* @__PURE__ */ new Map()), w(e).filter(function(t) {
361
- return He(r, t);
362
- });
363
- }, ve = function(e, r, t) {
364
- return se(le(C(e, t), r), !0, t);
365
- }, B = function(e, r) {
366
- return se(le(C(e), r), !1);
367
- }, ct = function(e, r) {
368
- return le(it(e), r);
369
- }, T = function(e, r) {
370
- return e.shadowRoot ? T(e.shadowRoot, r) : Object.getPrototypeOf(e).contains !== void 0 && Object.getPrototypeOf(e).contains.call(e, r) ? !0 : w(e.children).some(function(t) {
371
- var n;
372
- if (t instanceof HTMLIFrameElement) {
373
- var o = (n = t.contentDocument) === null || n === void 0 ? void 0 : n.body;
374
- return o ? T(o, r) : !1;
375
- }
376
- return T(t, r);
377
- });
378
- }, ft = function(e) {
379
- for (var r = /* @__PURE__ */ new Set(), t = e.length, n = 0; n < t; n += 1) for (var o = n + 1; o < t; o += 1) {
380
- var u = e[n].compareDocumentPosition(e[o]);
381
- (u & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0 && r.add(o), (u & Node.DOCUMENT_POSITION_CONTAINS) > 0 && r.add(n);
382
- }
383
- return e.filter(function(a, f) {
384
- return !r.has(f);
385
- });
386
- }, Ye = function(e) {
387
- return e.parentNode ? Ye(e.parentNode) : e;
388
- }, me = function(e) {
389
- return P(e).filter(Boolean).reduce(function(r, t) {
390
- var n = t.getAttribute(ne);
391
- return r.push.apply(r, n ? ft(w(Ye(t).querySelectorAll("[".concat(ne, '="').concat(n, '"]:not([').concat(ke, '="disabled"])')))) : [t]), r;
392
- }, []);
393
- }, st = function(e) {
394
- try {
395
- return e();
396
- } catch {
397
- return;
398
- }
399
- }, G = function(e) {
400
- if (e === void 0 && (e = document), !(!e || !e.activeElement)) {
401
- var r = e.activeElement;
402
- return r.shadowRoot ? G(r.shadowRoot) : r instanceof HTMLIFrameElement && st(function() {
403
- return r.contentWindow.document;
404
- }) ? G(r.contentWindow.document) : r;
405
- }
406
- }, dt = function(e, r) {
407
- return e === r;
408
- }, lt = function(e, r) {
409
- return !!w(e.querySelectorAll("iframe")).some(function(t) {
410
- return dt(t, r);
411
- });
412
- }, ze = function(e, r) {
413
- return r === void 0 && (r = G(Ue(e).ownerDocument)), !r || r.dataset && r.dataset.focusGuard ? !1 : me(e).some(function(t) {
414
- return T(t, r) || lt(t, r);
415
- });
416
- }, vt = function(e) {
417
- e === void 0 && (e = document);
418
- var r = G(e);
419
- return r ? w(e.querySelectorAll("[".concat(Lr, "]"))).some(function(t) {
420
- return T(t, r);
421
- }) : !1;
422
- }, mt = function(e, r) {
423
- return r.filter($e).filter(function(t) {
424
- return t.name === e.name;
425
- }).filter(function(t) {
426
- return t.checked;
427
- })[0] || e;
428
- }, pe = function(e, r) {
429
- return $e(e) && e.name ? mt(e, r) : e;
430
- }, pt = function(e) {
431
- var r = /* @__PURE__ */ new Set();
432
- return e.forEach(function(t) {
433
- return r.add(pe(t, e));
434
- }), e.filter(function(t) {
435
- return r.has(t);
436
- });
437
- }, Ne = function(e) {
438
- return e[0] && e.length > 1 ? pe(e[0], e) : e[0];
439
- }, Te = function(e, r) {
440
- return e.indexOf(pe(r, e));
441
- }, Pe = "NEW_FOCUS", bt = function(e, r, t, n, o) {
442
- var u = e.length, a = e[0], f = e[u - 1], v = fe(n);
443
- if (!(n && e.indexOf(n) >= 0)) {
444
- var c = n !== void 0 ? t.indexOf(n) : -1, m = o ? t.indexOf(o) : c, s = o ? e.indexOf(o) : -1;
445
- if (c === -1)
446
- return s !== -1 ? s : Pe;
447
- if (s === -1) return Pe;
448
- var i = c - m, l = t.indexOf(a), p = t.indexOf(f), h = pt(t), F = n !== void 0 ? h.indexOf(n) : -1, x = o ? h.indexOf(o) : F, b = h.filter(function(Y) {
449
- return Y.tabIndex >= 0;
450
- }), y = n !== void 0 ? b.indexOf(n) : -1, E = o ? b.indexOf(o) : y, S = y >= 0 && E >= 0 ? E - y : x - F;
451
- if (!i && s >= 0 || r.length === 0) return s;
452
- var H = Te(e, r[0]), V = Te(e, r[r.length - 1]);
453
- if (c <= l && v && Math.abs(i) > 1) return V;
454
- if (c >= p && v && Math.abs(i) > 1) return H;
455
- if (i && Math.abs(S) > 1) return s;
456
- if (c <= l) return V;
457
- if (c > p) return H;
458
- if (i)
459
- return Math.abs(i) > 1 ? s : (u + s + i) % u;
460
- }
461
- }, ht = function(e) {
462
- return function(r) {
463
- var t, n = (t = Ve(r)) === null || t === void 0 ? void 0 : t.autofocus;
464
- return r.autofocus || n !== void 0 && n !== "false" || e.indexOf(r) >= 0;
465
- };
466
- }, _e = function(e, r, t) {
467
- var n = Se(e.map(function(o) {
468
- return o.node;
469
- }).filter(ht(t)));
470
- return n && n.length ? Ne(n) : Ne(Se(r));
471
- }, ae = function(e, r) {
472
- return r === void 0 && (r = []), r.push(e), e.parentNode && ae(e.parentNode.host || e.parentNode, r), r;
473
- }, ee = function(e, r) {
474
- for (var t = ae(e), n = ae(r), o = 0; o < t.length; o += 1) {
475
- var u = t[o];
476
- if (n.indexOf(u) >= 0) return u;
477
- }
478
- return !1;
479
- }, Je = function(e, r, t) {
480
- var n = P(e), o = P(r), u = n[0], a = !1;
481
- return o.filter(Boolean).forEach(function(f) {
482
- a = ee(a || f, f) || a, t.filter(Boolean).forEach(function(v) {
483
- var c = ee(u, v);
484
- c && (!a || T(c, a) ? a = c : a = ee(c, a));
485
- });
486
- }), a;
487
- }, Ae = function(e, r) {
488
- return e.reduce(function(t, n) {
489
- return t.concat(ct(n, r));
490
- }, []);
491
- }, yt = function(e, r) {
492
- var t = /* @__PURE__ */ new Map();
493
- return r.forEach(function(n) {
494
- return t.set(n.node, n);
495
- }), e.map(function(n) {
496
- return t.get(n);
497
- }).filter(rt);
498
- }, gt = function(e, r) {
499
- var t = G(P(e).length > 0 ? document : Ue(e).ownerDocument), n = me(e).filter(ue), o = Je(t || e, e, n), u = /* @__PURE__ */ new Map(), a = B(n, u), f = a.filter(function(p) {
500
- var h = p.node;
501
- return ue(h);
502
- });
503
- if (f[0]) {
504
- var v = B([o], u).map(function(p) {
505
- return p.node;
506
- }), c = yt(v, f), m = c.map(function(p) {
507
- return p.node;
508
- }), s = c.filter(function(p) {
509
- return p.tabIndex >= 0;
510
- }).map(function(p) {
511
- return p.node;
512
- }), i = bt(m, s, v, t, r);
513
- if (i === "NEW_FOCUS") {
514
- var l = _e(a, s, Ae(n, u)) || _e(a, m, Ae(n, u));
515
- if (l) return { node: l };
516
- console.warn("focus-lock: cannot find any node to move focus into");
517
- return;
518
- }
519
- return i === void 0 ? i : c[i];
520
- }
521
- }, Ft = function(e) {
522
- var r = me(e).filter(ue), t = se(C([Je(e, e, r)], !0), !0, !0), n = C(r, !1);
523
- return t.map(function(o) {
524
- var u = o.node;
525
- return {
526
- node: u,
527
- index: o.index,
528
- lockItem: n.indexOf(u) >= 0,
529
- guard: fe(u)
530
- };
531
- });
532
- }, be = function(e, r) {
533
- e && ("focus" in e && e.focus(r), "contentWindow" in e && e.contentWindow && e.contentWindow.focus());
534
- }, re = 0, te = !1, Qe = function(e, r, t) {
535
- t === void 0 && (t = {});
536
- var n = gt(e, r);
537
- if (!te && n) {
538
- if (re > 2) {
539
- console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"), te = !0, setTimeout(function() {
540
- te = !1;
541
- }, 1);
542
- return;
543
- }
544
- re++, be(n.node, t.focusOptions), re--;
545
- }
546
- };
547
- function k(e) {
548
- if (!e) return null;
549
- if (typeof WeakRef > "u") return function() {
550
- return e || null;
551
- };
552
- var r = e ? new WeakRef(e) : null;
553
- return function() {
554
- return r?.deref() || null;
555
- };
556
- }
557
- var Et = function(e) {
558
- if (!e) return null;
559
- for (var r = [], t = e; t && t !== document.body; )
560
- r.push({
561
- current: k(t),
562
- parent: k(t.parentElement),
563
- left: k(t.previousElementSibling),
564
- right: k(t.nextElementSibling)
565
- }), t = t.parentElement;
566
- return {
567
- element: k(e),
568
- stack: r,
569
- ownerDocument: e.ownerDocument
570
- };
571
- }, Ot = function(e) {
572
- var r, t, n, o, u;
573
- if (e)
574
- for (var a = e.stack, f = e.ownerDocument, v = /* @__PURE__ */ new Map(), c = 0, m = a; c < m.length; c++) {
575
- var s = m[c], i = (r = s.parent) === null || r === void 0 ? void 0 : r.call(s);
576
- if (i && f.contains(i)) {
577
- for (var l = (t = s.left) === null || t === void 0 ? void 0 : t.call(s), p = s.current(), h = i.contains(p) ? p : void 0, F = (n = s.right) === null || n === void 0 ? void 0 : n.call(s), x = ve([i], v), b = (u = (o = h ?? l?.nextElementSibling) !== null && o !== void 0 ? o : F) !== null && u !== void 0 ? u : l; b; ) {
578
- for (var y = 0, E = x; y < E.length; y++) {
579
- var S = E[y];
580
- if (b?.contains(S.node)) return S.node;
581
- }
582
- b = b.nextElementSibling;
583
- }
584
- if (x.length) return x[0].node;
585
- }
586
- }
587
- }, Xe = function(e) {
588
- var r = Et(e);
589
- return function() {
590
- return Ot(r);
591
- };
592
- }, xt = function(e, r, t) {
593
- if (!e || !r)
594
- return console.error("no element or scope given"), {};
595
- var n = P(r);
596
- if (n.every(function(a) {
597
- return !T(a, e);
598
- }))
599
- return console.error("Active element is not contained in the scope"), {};
600
- var o = t ? ve(n, /* @__PURE__ */ new Map()) : B(n, /* @__PURE__ */ new Map()), u = o.findIndex(function(a) {
601
- return a.node === e;
602
- });
603
- if (u !== -1)
604
- return {
605
- prev: o[u - 1],
606
- next: o[u + 1],
607
- first: o[0],
608
- last: o[o.length - 1]
609
- };
610
- }, wt = function(e, r) {
611
- var t = r ? ve(P(e), /* @__PURE__ */ new Map()) : B(P(e), /* @__PURE__ */ new Map());
612
- return {
613
- first: t[0],
614
- last: t[t.length - 1]
615
- };
616
- }, It = function(e) {
617
- return Object.assign({
618
- scope: document.body,
619
- cycle: !0,
620
- onlyTabbable: !0
621
- }, e);
622
- }, Ze = function(e, r, t) {
623
- r === void 0 && (r = {});
624
- var n = It(r), o = xt(e, n.scope, n.onlyTabbable);
625
- if (o) {
626
- var u = t(o, n.cycle);
627
- u && be(u.node, n.focusOptions);
628
- }
629
- }, St = function(e, r) {
630
- r === void 0 && (r = {}), Ze(e, r, function(t, n) {
631
- var o = t.next, u = t.first;
632
- return o || n && u;
633
- });
634
- }, Nt = function(e, r) {
635
- r === void 0 && (r = {}), Ze(e, r, function(t, n) {
636
- var o = t.prev, u = t.last;
637
- return o || n && u;
638
- });
639
- }, er = function(e, r, t) {
640
- var n, o = wt(e, (n = r.onlyTabbable) !== null && n !== void 0 ? n : !0)[t];
641
- o && be(o.node, r.focusOptions);
642
- }, Tt = function(e, r) {
643
- r === void 0 && (r = {}), er(e, r, "first");
644
- }, Pt = function(e, r) {
645
- r === void 0 && (r = {}), er(e, r, "last");
646
- };
647
- function he(e) {
648
- setTimeout(e, 1);
649
- }
650
- var _t = function(r) {
651
- return r && "current" in r ? r.current : r;
652
- }, rr = function() {
653
- return document && document.activeElement === document.body;
654
- }, At = function() {
655
- return rr() || vt();
656
- }, D = null, g = null, De = function() {
657
- return null;
658
- }, M = null, j = !1, ye = !1, Dt = function() {
659
- return !0;
660
- }, Mt = function(r) {
661
- return (D.whiteList || Dt)(r);
662
- }, Ct = function(r, t) {
663
- M = {
664
- observerNode: r,
665
- portaledElement: t
666
- };
667
- }, Lt = function(r) {
668
- return M && M.portaledElement === r;
669
- };
670
- function Me(e, r, t, n) {
671
- var o = null, u = e;
672
- do {
673
- var a = n[u];
674
- if (a.guard)
675
- a.node.dataset.focusAutoGuard && (o = a);
676
- else if (a.lockItem) {
677
- if (u !== e) return;
678
- o = null;
679
- } else break;
680
- } while ((u += t) !== r);
681
- o && (o.node.tabIndex = 0);
682
- }
683
- var kt = function(r) {
684
- return r ? !!j : j === "meanwhile";
685
- }, Rt = function e(r, t, n) {
686
- return t && (t.host === r && (!t.activeElement || n.contains(t.activeElement)) || t.parentNode && e(r, t.parentNode, n));
687
- }, Wt = function(r, t) {
688
- return t.some(function(n) {
689
- return Rt(r, n, n);
690
- });
691
- }, tr = function(r) {
692
- return B(r, /* @__PURE__ */ new Map());
693
- }, Ut = function(r) {
694
- return !tr([r.parentNode]).some(function(t) {
695
- return t.node === r;
696
- });
697
- }, $ = function() {
698
- var r = !1;
699
- if (D) {
700
- var t = D, n = t.observed, o = t.persistentFocus, u = t.autoFocus, a = t.shards, f = t.crossFrame, v = t.focusOptions, c = t.noFocusGuards, m = n || M && M.portaledElement;
701
- if (rr() && g && g !== document.body && (!document.body.contains(g) || Ut(g))) {
702
- var s = De();
703
- s && s.focus();
704
- }
705
- var i = document && document.activeElement;
706
- if (m) {
707
- var l = [m].concat(a.map(_t).filter(Boolean)), p = function() {
708
- if (!kt(f) || !c || !g || ye) return !1;
709
- var y = tr(l), E = y.findIndex(function(S) {
710
- return S.node === g;
711
- });
712
- return E === 0 || E === y.length - 1;
713
- };
714
- if ((!i || Mt(i)) && (o || p() || !At() || !g && u) && (m && !(ze(l) || i && Wt(i, l) || Lt(i, m)) && (document && !g && i && !u ? (i.blur && i.blur(), document.body.focus()) : (r = Qe(l, g, { focusOptions: v }), M = {})), g = document && document.activeElement, g !== document.body && (De = Xe(g)), j = !1), document && i !== document.activeElement && document.querySelector("[data-focus-auto-guard]")) {
715
- var h = document && document.activeElement, F = Ft(l), x = F.map(function(b) {
716
- return b.node;
717
- }).indexOf(h);
718
- x > -1 && (F.filter(function(b) {
719
- var y = b.guard, E = b.node;
720
- return y && E.dataset.focusAutoGuard;
721
- }).forEach(function(b) {
722
- return b.node.removeAttribute("tabIndex");
723
- }), Me(x, F.length, 1, F), Me(x, -1, -1, F));
724
- }
725
- }
726
- }
727
- return r;
728
- }, nr = function(r) {
729
- $() && r && (r.stopPropagation(), r.preventDefault());
730
- }, K = function() {
731
- return he($);
732
- }, or = function(r) {
733
- var t = r.target, n = r.currentTarget;
734
- n.contains(t) || Ct(n, t);
735
- }, Bt = function() {
736
- return null;
737
- }, Gt = function(r) {
738
- var t = r.children;
739
- return /* @__PURE__ */ O.createElement("div", {
740
- onBlur: K,
741
- onFocus: or
742
- }, t);
743
- };
744
- Gt.propTypes = process.env.NODE_ENV !== "production" ? { children: d.default.node.isRequired } : {};
745
- var ur = function() {
746
- ye = !0;
747
- }, ar = function() {
748
- ye = !1, j = "just", he(function() {
749
- j = "meanwhile";
750
- });
751
- }, jt = function() {
752
- document.addEventListener("focusin", nr), document.addEventListener("focusout", K), window.addEventListener("focus", ur), window.addEventListener("blur", ar);
753
- }, Ht = function() {
754
- document.removeEventListener("focusin", nr), document.removeEventListener("focusout", K), window.removeEventListener("focus", ur), window.removeEventListener("blur", ar);
755
- };
756
- function Vt(e) {
757
- return e.filter(function(r) {
758
- return !r.disabled;
759
- });
760
- }
761
- var ir = {
762
- moveFocusInside: Qe,
763
- focusInside: ze,
764
- focusNextElement: St,
765
- focusPrevElement: Nt,
766
- focusFirstElement: Tt,
767
- focusLastElement: Pt,
768
- captureFocusRestore: Xe
769
- };
770
- function qt(e) {
771
- var r = e.slice(-1)[0];
772
- r && !D && jt();
773
- var t = D, n = t && r && r.id === t.id;
774
- D = r, t && !n && (t.onDeactivation(), e.filter(function(o) {
775
- return o.id === t.id;
776
- }).length || t.returnFocus(!r)), r ? (g = null, (!n || t.observed !== r.observed) && r.onActivation(ir), $(!0), he($)) : (Ht(), g = null);
777
- }
778
- Re.assignSyncMedium(or);
779
- We.assignMedium(K);
780
- Ur.assignMedium(function(e) {
781
- return e(ir);
782
- });
783
- var $t = Kr(Vt, qt)(Bt), cr = /* @__PURE__ */ Le(function(r, t) {
784
- return /* @__PURE__ */ O.createElement(ce, W({
785
- sideCar: $t,
786
- ref: t
787
- }, r));
788
- }), fr = ce.propTypes || {};
789
- fr.sideCar;
790
- var Kt = Cr(fr, ["sideCar"]);
791
- cr.propTypes = process.env.NODE_ENV !== "production" ? Kt : {};
792
- var Xt = cr;
793
- export {
794
- Xt as t
795
- };