@konstructio/ui 0.1.2-alpha.103 → 0.1.2-alpha.104

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 (248) hide show
  1. package/README.md +15 -21
  2. package/dist/{AdditionalOptions-Cj29eeMF.js → AdditionalOptions-D0BAS2HG.js} +1 -1
  3. package/dist/{AlertDialogTrigger-CgcsW_ta.js → AlertDialogTrigger-BGo_acd5.js} +3 -3
  4. package/dist/{Checkbox-DzAx7n67.js → Checkbox-B_ngk9Dj.js} +56 -56
  5. package/dist/{Combination-cjXRJS03.js → Combination-CnMM05mt.js} +51 -45
  6. package/dist/{CommandInput-BnvRMfLI.js → CommandInput-BLq69pOT.js} +1 -1
  7. package/dist/Counter-BV680M5r.js +195 -0
  8. package/dist/DropdownButton-DfNojmCW.js +493 -0
  9. package/dist/{FlagSelectorList-BoYG-_It.js → FlagSelectorList-CkTR3j6O.js} +222 -218
  10. package/dist/{HamburgerTrigger-1vOTrm8-.js → HamburgerTrigger-DRylBL2d.js} +1 -1
  11. package/dist/{ImageUpload-DZTm4SBB.js → ImageUpload-DiwymQcU.js} +1 -1
  12. package/dist/{Input-CW0VwW2T.js → Input-Cf44DzfE.js} +18 -18
  13. package/dist/{Loading-fD0Xiyeq.js → Loading-DUh9PMJN.js} +3 -1
  14. package/dist/Modal-Dyn088X7.js +81 -0
  15. package/dist/Sidebar.css +1 -1
  16. package/dist/{Spinner-Lw9mZYhg.js → Spinner-CUwE2bLm.js} +1 -1
  17. package/dist/{Switch-WBRr8uOJ.js → Switch-aPhL5rNG.js} +4 -4
  18. package/dist/{Toast-ByH-l4XK.js → Toast-3NEz7LLa.js} +149 -148
  19. package/dist/Wrapper-BhqUVI1G.js +171 -0
  20. package/dist/Wrapper-CVJSuYWx.js +114 -0
  21. package/dist/{Wrapper-XeeD3av7.js → Wrapper-DP6Sxngx.js} +185 -180
  22. package/dist/components/Alert/Alert.js +21 -21
  23. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  24. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  25. package/dist/components/AlertDialog/components/index.js +1 -1
  26. package/dist/components/AlertDialog/hooks/useAlertDialog.js +14 -10
  27. package/dist/components/Autocomplete/components/List/List.js +22 -26
  28. package/dist/components/Autocomplete/components/List/List.variants.js +7 -19
  29. package/dist/components/Autocomplete/hooks/useAutocomplete.js +39 -38
  30. package/dist/components/Autocomplete/hooks/useNavigationList.js +2 -1
  31. package/dist/components/Badge/Badge.js +37 -36
  32. package/dist/components/Button/Button.js +1 -1
  33. package/dist/components/Checkbox/Checkbox.js +1 -1
  34. package/dist/components/Command/Command.js +2 -2
  35. package/dist/components/Command/components/Command.js +6 -6
  36. package/dist/components/Command/components/CommandEmpty.js +1 -1
  37. package/dist/components/Command/components/CommandGroup.js +1 -1
  38. package/dist/components/Command/components/CommandInput.js +1 -1
  39. package/dist/components/Command/components/CommandItem.js +1 -1
  40. package/dist/components/Command/components/CommandList.js +2 -2
  41. package/dist/components/Command/components/CommandSeparator.js +1 -1
  42. package/dist/components/Command/components/DialogContent.js +2 -2
  43. package/dist/components/Command/components/DialogOverlay.js +1 -1
  44. package/dist/components/Command/components/index.js +1 -1
  45. package/dist/components/Command/contexts/Command.provider.js +16 -12
  46. package/dist/components/Counter/Counter.js +1 -1
  47. package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +1 -1
  48. package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +57 -58
  49. package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +42 -43
  50. package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +1 -1
  51. package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +1 -1
  52. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +1 -1
  53. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +42 -50
  54. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +61 -79
  55. package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +1 -1
  56. package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +1 -1
  57. package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +1 -1
  58. package/dist/components/DateRangePicker/components/DateTimeInputs/hooks/useDateTimeInputs.js +89 -122
  59. package/dist/components/Datepicker/DatePicker.js +13 -13
  60. package/dist/components/Drawer/Drawer.js +54 -49
  61. package/dist/components/Drawer/hooks/useDrawer.js +39 -44
  62. package/dist/components/DropdownButton/DropdownButton.js +1 -1
  63. package/dist/components/Filter/Filter.js +23 -22
  64. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +42 -56
  65. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
  66. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +30 -43
  67. package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +36 -49
  68. package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +1 -1
  69. package/dist/components/Filter/components/ResetButton/ResetButton.js +21 -18
  70. package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +1 -1
  71. package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +31 -45
  72. package/dist/components/Filter/contexts/filter.provider.js +15 -10
  73. package/dist/components/Filter/events/index.js +26 -5
  74. package/dist/components/Filter/hooks/index.js +4 -0
  75. package/dist/components/Filter/hooks/useFilterDropdownSync.js +26 -0
  76. package/dist/components/ImageUpload/ImageUpload.js +1 -1
  77. package/dist/components/Input/Input.js +1 -1
  78. package/dist/components/Loading/Loading.js +1 -1
  79. package/dist/components/Modal/Modal.js +1 -1
  80. package/dist/components/Modal/components/Body/Body.js +1 -1
  81. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  82. package/dist/components/Modal/components/Header/Header.js +1 -1
  83. package/dist/components/Modal/components/Wrapper/Wrapper.js +1 -1
  84. package/dist/components/Modal/components/index.js +1 -1
  85. package/dist/components/Modal/contexts/Modal.provider.js +26 -19
  86. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +1 -1
  87. package/dist/components/MultiSelectDropdown/components/List/List.js +1 -1
  88. package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +1 -1
  89. package/dist/components/MultiSelectDropdown/components/index.js +1 -1
  90. package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +14 -13
  91. package/dist/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
  92. package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +6 -4
  93. package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +1 -1
  94. package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +16 -16
  95. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
  96. package/dist/components/PhoneNumberInput/components/Wrapper.js +1 -1
  97. package/dist/components/PhoneNumberInput/components/index.js +2 -2
  98. package/dist/components/PieChart/PieChart.js +33 -32
  99. package/dist/components/ProgressBar/ProgressBar.js +26 -20
  100. package/dist/components/Radio/Radio.js +28 -30
  101. package/dist/components/RadioCardGroup/RadioCardGroup.js +18 -18
  102. package/dist/components/RadioGroup/RadioGroup.js +24 -24
  103. package/dist/components/Range/Range.js +15 -13
  104. package/dist/components/Select/Select.js +2 -2
  105. package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.js +1 -1
  106. package/dist/components/Select/components/List/List.js +2 -2
  107. package/dist/components/Select/components/ListItem/ListItem.js +30 -30
  108. package/dist/components/Select/components/Wrapper.js +1 -1
  109. package/dist/components/Select/components/index.js +2 -2
  110. package/dist/components/Select/hooks/useSelect.js +39 -38
  111. package/dist/components/Sidebar/Sidebar.js +21 -18
  112. package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.js +30 -0
  113. package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.variants.js +20 -0
  114. package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
  115. package/dist/components/Sidebar/components/Logo/Logo.js +14 -10
  116. package/dist/components/Sidebar/components/Logo/Logo.variants.js +14 -4
  117. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +41 -37
  118. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +4 -5
  119. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +75 -68
  120. package/dist/components/Sidebar/components/index.js +17 -15
  121. package/dist/components/Sidebar/contexts/SidebarContext.js +8 -5
  122. package/dist/components/Slider/Slider.js +17 -15
  123. package/dist/components/Spinner/Spinner.js +1 -1
  124. package/dist/components/Stepper/Stepper.variants.js +6 -6
  125. package/dist/components/Stepper/hooks/useStepItemLogic.js +12 -17
  126. package/dist/components/Switch/Switch.js +1 -1
  127. package/dist/components/Table/components/Filter.js +1 -1
  128. package/dist/components/Tabs/Tabs.js +1 -1
  129. package/dist/components/Tabs/Tabs.variants.js +1 -1
  130. package/dist/components/Tabs/components/Content.js +1 -1
  131. package/dist/components/Tabs/components/List.js +1 -1
  132. package/dist/components/Tabs/components/Trigger.js +1 -1
  133. package/dist/components/Tag/Tag.js +1 -1
  134. package/dist/components/Tag/Tag.variants.js +17 -17
  135. package/dist/components/TagSelect/TagSelect.js +1 -1
  136. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +1 -1
  137. package/dist/components/TagSelect/components/index.js +1 -1
  138. package/dist/components/TagSelect/hooks/useTagSelect.js +12 -11
  139. package/dist/components/TimePicker/components/HoursList/HoursList.js +34 -38
  140. package/dist/components/TimePicker/components/MeridianList/MeridianList.js +25 -29
  141. package/dist/components/TimePicker/components/MinutesList/MinutesList.js +33 -33
  142. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +91 -99
  143. package/dist/components/TimePicker/components/WrapperList/WrapperList.js +29 -30
  144. package/dist/components/TimePicker/contexts/time-picker.provider.js +10 -10
  145. package/dist/components/Toast/Toast.js +1 -1
  146. package/dist/components/Toast/Toast.variants.js +1 -1
  147. package/dist/components/Tooltip/Tooltip.js +1 -1
  148. package/dist/components/VirtualizedTable/VirtualizedTable.js +32 -29
  149. package/dist/components/VirtualizedTable/components/Actions/Actions.js +0 -2
  150. package/dist/components/VirtualizedTable/components/Body/Body.js +5 -5
  151. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +1 -1
  152. package/dist/components/VirtualizedTable/components/Filter/Filter.js +55 -53
  153. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +1 -1
  154. package/dist/components/VirtualizedTable/components/Header/Header.js +1 -1
  155. package/dist/components/VirtualizedTable/contexts/index.js +1 -1
  156. package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
  157. package/dist/components/VirtualizedTable/events/filters/filters.js +7 -0
  158. package/dist/components/VirtualizedTable/events/index.js +10 -25
  159. package/dist/components/VirtualizedTable/events/refresh/refresh.js +7 -0
  160. package/dist/components/VirtualizedTable/events/row/row.js +22 -0
  161. package/dist/components/VirtualizedTable/utils/get-table-id.js +4 -0
  162. package/dist/components/VirtualizedTable/utils/index.js +4 -2
  163. package/dist/components/index.js +95 -89
  164. package/dist/{components-BIHlj4yH.js → components-Cf345jTv.js} +45 -41
  165. package/dist/constants-CxJJRVK3.js +31 -0
  166. package/dist/{dist-DISvWx7U.js → dist-BUocnzkM.js} +1 -1
  167. package/dist/{dist-Dse3gSmZ.js → dist-BZNE2Tnx.js} +4 -4
  168. package/dist/{dist-2bGlmy8N2.js → dist-BaPW7qXd2.js} +27 -26
  169. package/dist/dist-BdobXn93.js +192 -0
  170. package/dist/dist-BlPTJNIm.js +118 -0
  171. package/dist/{dist-BiJrNvNo.js → dist-C3YVLapk.js} +29 -28
  172. package/dist/dist-C4j75TwZ.js +20 -0
  173. package/dist/dist-CCdbu9GU.js +46 -0
  174. package/dist/dist-CzKqHuqJ2.js +427 -0
  175. package/dist/dist-D-yS0HN8.js +228 -0
  176. package/dist/dist-D5XYRjmR.js +15 -0
  177. package/dist/dist-DDck_2lb.js +451 -0
  178. package/dist/{dist-C2aTw0m62.js → dist-DFCz63oC2.js} +5 -5
  179. package/dist/dist-DGOjiAnB2.js +14 -0
  180. package/dist/dist-DKryKPmP.js +193 -0
  181. package/dist/{dist-CTvBzxW8.js → dist-DX0sBG3Q.js} +1 -1
  182. package/dist/dist-DYIabsrY.js +17 -0
  183. package/dist/dist-pWlMx4Fi2.js +36 -0
  184. package/dist/{dist-CVDFmWf2.js → dist-tGUUcv8n.js} +17 -16
  185. package/dist/dist-xCbHbMLA.js +116 -0
  186. package/dist/{es2015-BWf6xQHm.js → es2015-CoHq2g4y.js} +95 -86
  187. package/dist/es2015-DigR3dar.js +795 -0
  188. package/dist/events.types-BG1Uh8i6.js +6 -0
  189. package/dist/hooks/index.js +6 -4
  190. package/dist/hooks/useClickOutside.js +14 -0
  191. package/dist/index.js +146 -138
  192. package/dist/lib/components/Autocomplete/components/List/List.variants.d.ts +0 -1
  193. package/dist/lib/components/DropdownButton/DropdownButton.d.ts +5 -6
  194. package/dist/lib/components/DropdownButton/DropdownButton.types.d.ts +2 -0
  195. package/dist/lib/components/Filter/Filter.types.d.ts +2 -0
  196. package/dist/lib/components/Filter/contexts/filter.context.d.ts +1 -0
  197. package/dist/lib/components/Filter/events/index.d.ts +10 -2
  198. package/dist/lib/components/Filter/hooks/index.d.ts +1 -0
  199. package/dist/lib/components/Filter/hooks/useFilterDropdownSync.d.ts +2 -0
  200. package/dist/lib/components/Filter/hooks/useFilterDropdownSync.types.d.ts +5 -0
  201. package/dist/lib/components/PieChart/PieChart.types.d.ts +4 -4
  202. package/dist/lib/components/ProgressBar/ProgressBar.types.d.ts +2 -0
  203. package/dist/lib/components/Select/hooks/useSelect.d.ts +2 -1
  204. package/dist/lib/components/Sidebar/Sidebar.d.ts +2 -2
  205. package/dist/lib/components/Sidebar/Sidebar.types.d.ts +6 -5
  206. package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.d.ts +4 -0
  207. package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.types.d.ts +4 -0
  208. package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.variants.d.ts +1 -0
  209. package/dist/lib/components/Sidebar/components/Logo/Logo.types.d.ts +8 -0
  210. package/dist/lib/components/Sidebar/components/Logo/Logo.variants.d.ts +3 -1
  211. package/dist/lib/components/Sidebar/components/index.d.ts +2 -0
  212. package/dist/lib/components/Sidebar/contexts/SidebarContext.d.ts +12 -0
  213. package/dist/lib/components/VirtualizedTable/VirtualizedTable.d.ts +1 -0
  214. package/dist/lib/components/VirtualizedTable/events/events.types.d.ts +11 -0
  215. package/dist/lib/components/VirtualizedTable/events/filters/filters.d.ts +1 -0
  216. package/dist/lib/components/VirtualizedTable/events/index.d.ts +4 -14
  217. package/dist/lib/components/VirtualizedTable/events/refresh/refresh.d.ts +2 -0
  218. package/dist/lib/components/VirtualizedTable/events/refresh/refresh.types.d.ts +3 -0
  219. package/dist/lib/components/VirtualizedTable/events/row/row.d.ts +3 -0
  220. package/dist/lib/components/VirtualizedTable/utils/get-table-id.d.ts +1 -0
  221. package/dist/lib/components/VirtualizedTable/utils/index.d.ts +1 -0
  222. package/dist/lib/components/index.d.ts +2 -2
  223. package/dist/lib/hooks/index.d.ts +1 -0
  224. package/dist/lib/hooks/useClickOutside.d.ts +2 -0
  225. package/dist/package.json +24 -24
  226. package/dist/styles.css +1 -1
  227. package/dist/{table.provider-2sAkE7z_.js → table.provider-B0BafHuU.js} +395 -381
  228. package/dist/ui/civo-theme.css +4 -0
  229. package/dist/ui/kubefirst-theme.css +4 -0
  230. package/package.json +24 -24
  231. package/dist/Counter-CY0xGnVM.js +0 -208
  232. package/dist/DropdownButton-DnlwdPmb.js +0 -92
  233. package/dist/Modal-Bfzggwlr.js +0 -76
  234. package/dist/Wrapper-ClJ_Mham.js +0 -110
  235. package/dist/Wrapper-DNEn4fef.js +0 -161
  236. package/dist/constants-DXrF9vV4.js +0 -31
  237. package/dist/dist-B-Aoze_D.js +0 -10
  238. package/dist/dist-BuFiu480.js +0 -13
  239. package/dist/dist-C2s4VX-42.js +0 -31
  240. package/dist/dist-CT6d9xe7.js +0 -441
  241. package/dist/dist-CVy-ulDZ.js +0 -42
  242. package/dist/dist-D4FePjTS.js +0 -194
  243. package/dist/dist-Db6UeFo4.js +0 -291
  244. package/dist/dist-DqKFpce5.js +0 -98
  245. package/dist/dist-j7FOUrFU.js +0 -206
  246. package/dist/dist-l-aDnQZC.js +0 -62
  247. package/dist/dist-ppXKUlVt.js +0 -10
  248. /package/dist/{x-a_LpoXzG.js → x-a_LpoXzG2.js} +0 -0
@@ -1,5 +1,5 @@
1
- import { t as j } from "./utils-Cx-WzRZF.js";
2
- import { Typography as L } from "./components/Typography/Typography.js";
1
+ import { t as N } from "./utils-Cx-WzRZF.js";
2
+ import { Typography as W } from "./components/Typography/Typography.js";
3
3
  import { usePhoneNumberContext as K } from "./components/PhoneNumberInput/contexts/phone-number.hook.js";
4
4
  import { TruncateText as $ } from "./components/PhoneNumberInput/components/TruncateText/TruncateText.js";
5
5
  import * as M from "react";
@@ -10,23 +10,23 @@ function G(l, t, e) {
10
10
  const s = new Array(l);
11
11
  return new Proxy(s, { get(i, n, o) {
12
12
  if (typeof n == "string") {
13
- const c = n.charCodeAt(0);
14
- if (c >= 48 && c <= 57) {
15
- const r = +n;
16
- if (Number.isInteger(r) && r >= 0 && r < l) {
17
- let h = i[r];
18
- if (!h) {
19
- const u = t[r * 2];
20
- h = i[r] = {
21
- index: r,
22
- key: e(r),
23
- start: u,
24
- size: t[r * 2 + 1],
25
- end: u + t[r * 2 + 1],
13
+ const h = n.charCodeAt(0);
14
+ if (h >= 48 && h <= 57) {
15
+ const a = +n;
16
+ if (Number.isInteger(a) && a >= 0 && a < l) {
17
+ let d = i[a];
18
+ if (!d) {
19
+ const c = t[a * 2];
20
+ d = i[a] = {
21
+ index: a,
22
+ key: e(a),
23
+ start: c,
24
+ size: t[a * 2 + 1],
25
+ end: c + t[a * 2 + 1],
26
26
  lane: 0
27
27
  };
28
28
  }
29
- return h;
29
+ return d;
30
30
  }
31
31
  }
32
32
  if (n === "length") return l;
@@ -37,31 +37,31 @@ function G(l, t, e) {
37
37
  function I(l, t, e) {
38
38
  let s = e.initialDeps ?? [], i, n = !0;
39
39
  function o() {
40
- var c;
41
- const r = process.env.NODE_ENV !== "production" && !!e.key && !!((c = e.debug) != null && c.call(e));
42
- let h = 0;
43
- r && (h = Date.now());
44
- const u = l();
45
- if (!(u.length !== s.length || u.some((f, g) => s[g] !== f))) return i;
46
- s = u;
47
- let a = 0;
48
- if (r && (a = Date.now()), i = t(...u), r) {
49
- const f = Math.round((Date.now() - h) * 100) / 100, g = Math.round((Date.now() - a) * 100) / 100, p = g / 16, v = (d, m) => {
50
- for (d = String(d); d.length < m; ) d = " " + d;
51
- return d;
40
+ var h;
41
+ const a = process.env.NODE_ENV !== "production" && !!e.key && !!((h = e.debug) != null && h.call(e));
42
+ let d = 0;
43
+ a && (d = Date.now());
44
+ const c = l();
45
+ if (!(c.length !== s.length || c.some((f, m) => s[m] !== f))) return i;
46
+ s = c;
47
+ let r = 0;
48
+ if (a && (r = Date.now()), i = t(...c), a) {
49
+ const f = Math.round((Date.now() - d) * 100) / 100, m = Math.round((Date.now() - r) * 100) / 100, S = m / 16, p = (u, g) => {
50
+ for (u = String(u); u.length < g; ) u = " " + u;
51
+ return u;
52
52
  };
53
- console.info(`%c⏱ ${v(g, 5)} /${v(f, 5)} ms`, `
53
+ console.info(`%c⏱ ${p(m, 5)} /${p(f, 5)} ms`, `
54
54
  font-size: .6rem;
55
55
  font-weight: bold;
56
- color: hsl(${Math.max(0, Math.min(120 - 120 * p, 120))}deg 100% 31%);`, e?.key);
56
+ color: hsl(${Math.max(0, Math.min(120 - 120 * S, 120))}deg 100% 31%);`, e?.key);
57
57
  }
58
58
  return e?.onChange && !(n && e.skipInitialOnChange) && e.onChange(i), n = !1, i;
59
59
  }
60
- return o.updateDeps = (c) => {
61
- s = c;
60
+ return o.updateDeps = (h) => {
61
+ s = h;
62
62
  }, o;
63
63
  }
64
- function V(l, t) {
64
+ function L(l, t) {
65
65
  if (l === void 0) throw new Error(`Unexpected undefined${t ? `: ${t}` : ""}`);
66
66
  return l;
67
67
  }
@@ -76,7 +76,7 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
76
76
  if (/iP(hone|od|ad)/.test(navigator.userAgent)) return T = !0;
77
77
  const l = navigator.maxTouchPoints;
78
78
  return T = navigator.platform === "MacIntel" && l !== void 0 && l > 0;
79
- }, W = (l) => {
79
+ }, V = (l) => {
80
80
  const { offsetWidth: t, offsetHeight: e } = l;
81
81
  return {
82
82
  width: t,
@@ -92,30 +92,30 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
92
92
  const s = l.targetWindow;
93
93
  if (!s) return;
94
94
  const i = (o) => {
95
- const { width: c, height: r } = o;
95
+ const { width: h, height: a } = o;
96
96
  t({
97
- width: Math.round(c),
98
- height: Math.round(r)
97
+ width: Math.round(h),
98
+ height: Math.round(a)
99
99
  });
100
100
  };
101
- if (i(W(e)), !s.ResizeObserver) return () => {
101
+ if (i(V(e)), !s.ResizeObserver) return () => {
102
102
  };
103
103
  const n = new s.ResizeObserver((o) => {
104
- const c = () => {
105
- const r = o[0];
106
- if (r?.borderBoxSize) {
107
- const h = r.borderBoxSize[0];
108
- if (h) {
104
+ const h = () => {
105
+ const a = o[0];
106
+ if (a?.borderBoxSize) {
107
+ const d = a.borderBoxSize[0];
108
+ if (d) {
109
109
  i({
110
- width: h.inlineSize,
111
- height: h.blockSize
110
+ width: d.inlineSize,
111
+ height: d.blockSize
112
112
  });
113
113
  return;
114
114
  }
115
115
  }
116
- i(W(e));
116
+ i(V(e));
117
117
  };
118
- l.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(c) : c();
118
+ l.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(h) : h();
119
119
  });
120
120
  return n.observe(e, { box: "border-box" }), () => {
121
121
  n.unobserve(e);
@@ -127,11 +127,11 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
127
127
  if (!i) return;
128
128
  const n = l.options.useScrollendEvent && et;
129
129
  let o = 0;
130
- const c = n ? null : X(i, () => t(o, !1), l.options.isScrollingResetDelay), r = (a) => () => {
131
- o = e(s), c?.(), t(o, a);
132
- }, h = r(!0), u = r(!1);
133
- return s.addEventListener("scroll", h, C), n && s.addEventListener("scrollend", u, C), () => {
134
- s.removeEventListener("scroll", h), n && s.removeEventListener("scrollend", u);
130
+ const h = n ? null : X(i, () => t(o, !1), l.options.isScrollingResetDelay), a = (r) => () => {
131
+ o = e(s), h?.(), t(o, r);
132
+ }, d = a(!0), c = a(!1);
133
+ return s.addEventListener("scroll", d, C), n && s.addEventListener("scrollend", c, C), () => {
134
+ s.removeEventListener("scroll", d), n && s.removeEventListener("scrollend", c);
135
135
  };
136
136
  }, it = (l, t) => st(l, t, (e) => {
137
137
  const { horizontal: s, isRtl: i } = l.options;
@@ -166,16 +166,16 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
166
166
  const e = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((s) => {
167
167
  s.forEach((i) => {
168
168
  const n = () => {
169
- const o = i.target, c = this.indexFromElement(o);
169
+ const o = i.target, h = this.indexFromElement(o);
170
170
  if (!o.isConnected) {
171
171
  this.observer.unobserve(o);
172
- for (const [r, h] of this.elementsCache) if (h === o) {
173
- this.elementsCache.delete(r);
172
+ for (const [a, d] of this.elementsCache) if (d === o) {
173
+ this.elementsCache.delete(a);
174
174
  break;
175
175
  }
176
176
  return;
177
177
  }
178
- this.shouldMeasureDuringScroll(c) && this.resizeItem(c, this.options.measureElement(o, i, this));
178
+ this.shouldMeasureDuringScroll(h) && this.resizeItem(h, this.options.measureElement(o, i, this));
179
179
  };
180
180
  this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(n) : n();
181
181
  });
@@ -230,41 +230,41 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
230
230
  laneAssignmentMode: "estimate",
231
231
  useCachedMeasurements: !1
232
232
  };
233
- for (const a in t) {
234
- const f = t[a];
235
- f !== void 0 && (i[a] = f);
233
+ for (const r in t) {
234
+ const f = t[r];
235
+ f !== void 0 && (i[r] = f);
236
236
  }
237
237
  const n = this.options;
238
- let o = null, c = null, r = !1;
238
+ let o = null, h = null, a = !1;
239
239
  if (n !== void 0 && n.enabled && i.enabled && i.anchorTo === "end" && this.scrollElement !== null) {
240
- const a = n.count, f = i.count, g = this.getMeasurements(), p = a > 0 ? ((e = g[0]) == null ? void 0 : e.key) ?? n.getItemKey(0) : null, v = a > 0 ? ((s = g[a - 1]) == null ? void 0 : s.key) ?? n.getItemKey(a - 1) : null;
241
- if (f !== a || a > 0 && f > 0 && (i.getItemKey(0) !== p || i.getItemKey(f - 1) !== v)) {
242
- r = !0;
243
- const d = a > 0 ? this.getVirtualItemForOffset(this.getScrollOffset()) ?? g[0] : null;
244
- d && (o = [d.key, this.getScrollOffset() - d.start]);
245
- const m = i.followOnAppend === !0 ? "auto" : i.followOnAppend || null;
246
- m && f > a && this.isAtEnd(n.scrollEndThreshold) && (a === 0 || i.getItemKey(f - 1) !== v) && (c = m);
240
+ const r = n.count, f = i.count, m = this.getMeasurements(), S = r > 0 ? ((e = m[0]) == null ? void 0 : e.key) ?? n.getItemKey(0) : null, p = r > 0 ? ((s = m[r - 1]) == null ? void 0 : s.key) ?? n.getItemKey(r - 1) : null;
241
+ if (f !== r || r > 0 && f > 0 && (i.getItemKey(0) !== S || i.getItemKey(f - 1) !== p)) {
242
+ a = !0;
243
+ const u = r > 0 ? this.getVirtualItemForOffset(this.getScrollOffset()) ?? m[0] : null;
244
+ u && (o = [u.key, this.getScrollOffset() - u.start]);
245
+ const g = i.followOnAppend === !0 ? "auto" : i.followOnAppend || null;
246
+ g && f > r && this.isAtEnd(n.scrollEndThreshold) && (r === 0 || i.getItemKey(f - 1) !== p) && (h = g);
247
247
  }
248
248
  }
249
- this.options = i, r && (this.pendingMin = 0, this.itemSizeCacheVersion++);
250
- let h = !1, u = 0;
249
+ this.options = i, a && (this.pendingMin = 0, this.itemSizeCacheVersion++);
250
+ let d = !1, c = 0;
251
251
  if (o && this.scrollOffset !== null) {
252
- const [a, f] = o, g = this.getMeasurements(), { count: p, getItemKey: v } = this.options;
253
- let d = 0;
254
- for (; d < p && v(d) !== a; ) d++;
255
- if (d < p) {
256
- const m = g[d];
257
- if (m) {
258
- const E = Math.max(0, m.start + f);
259
- E !== this.scrollOffset && (u = E - this.scrollOffset, this.scrollOffset = E, h = !0);
252
+ const [r, f] = o, m = this.getMeasurements(), { count: S, getItemKey: p } = this.options;
253
+ let u = 0;
254
+ for (; u < S && p(u) !== r; ) u++;
255
+ if (u < S) {
256
+ const g = m[u];
257
+ if (g) {
258
+ const E = Math.max(0, g.start + f);
259
+ E !== this.scrollOffset && (c = E - this.scrollOffset, this.scrollOffset = E, d = !0);
260
260
  }
261
261
  }
262
262
  }
263
- (h || c) && (this.pendingScrollAnchor = [
264
- h ? o[0] : null,
265
- h ? o[1] : 0,
266
- c,
267
- u
263
+ (d || h) && (this.pendingScrollAnchor = [
264
+ d ? o[0] : null,
265
+ d ? o[1] : 0,
266
+ h,
267
+ c
268
268
  ]);
269
269
  }, this.notify = (t) => {
270
270
  var e, s;
@@ -323,8 +323,8 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
323
323
  }
324
324
  const s = this.pendingScrollAnchor;
325
325
  if (this.pendingScrollAnchor = null, s && this.scrollElement && this.options.enabled) {
326
- const [i, n, o, c] = s;
327
- i !== null && !o && (D() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded) ? c !== 0 && (this._iosDeferredAdjustment += c) : this._scrollToOffset(this.getScrollOffset(), {
326
+ const [i, n, o, h] = s;
327
+ i !== null && !o && (D() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded) ? h !== 0 && (this._iosDeferredAdjustment += h) : this._scrollToOffset(this.getScrollOffset(), {
328
328
  adjustments: void 0,
329
329
  behavior: void 0
330
330
  })), o && this.scrollToEnd({ behavior: o });
@@ -351,77 +351,77 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
351
351
  this.options.lanes,
352
352
  this.options.laneAssignmentMode,
353
353
  this.options.gap
354
- ], (t, e, s, i, n, o, c, r) => (this.prevLanes !== void 0 && this.prevLanes !== o && (this.lanesChangedFlag = !0), this.prevLanes = o, this.pendingMin = null, {
354
+ ], (t, e, s, i, n, o, h, a) => (this.prevLanes !== void 0 && this.prevLanes !== o && (this.lanesChangedFlag = !0), this.prevLanes = o, this.pendingMin = null, {
355
355
  count: t,
356
356
  paddingStart: e,
357
357
  scrollMargin: s,
358
358
  getItemKey: i,
359
359
  enabled: n,
360
360
  lanes: o,
361
- laneAssignmentMode: c,
362
- gap: r
363
- }), { key: !1 }), this.getMeasurements = I(() => [this.getMeasurementOptions(), this.itemSizeCacheVersion], ({ count: t, paddingStart: e, scrollMargin: s, getItemKey: i, enabled: n, lanes: o, laneAssignmentMode: c, gap: r }, h) => {
364
- const u = this.itemSizeCache;
361
+ laneAssignmentMode: h,
362
+ gap: a
363
+ }), { key: !1 }), this.getMeasurements = I(() => [this.getMeasurementOptions(), this.itemSizeCacheVersion], ({ count: t, paddingStart: e, scrollMargin: s, getItemKey: i, enabled: n, lanes: o, laneAssignmentMode: h, gap: a }, d) => {
364
+ const c = this.itemSizeCache;
365
365
  if (!n)
366
366
  return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
367
367
  if (this.laneAssignments.size > t)
368
- for (const d of this.laneAssignments.keys()) d >= t && this.laneAssignments.delete(d);
369
- this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMin = null), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((d) => {
370
- this.itemSizeCache.set(d.key, d.size);
368
+ for (const u of this.laneAssignments.keys()) u >= t && this.laneAssignments.delete(u);
369
+ this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMin = null), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((u) => {
370
+ this.itemSizeCache.set(u.key, u.size);
371
371
  }));
372
- const a = this.lanesSettling ? 0 : this.pendingMin ?? 0;
372
+ const r = this.lanesSettling ? 0 : this.pendingMin ?? 0;
373
373
  if (this.pendingMin = null, this.lanesSettling && this.measurementsCache.length === t && (this.lanesSettling = !1), o === 1) {
374
- const d = t * 2;
375
- let m = this._flatMeasurements;
376
- if (!m || m.length < d) {
377
- const b = new Float64Array(d);
378
- m && a > 0 && b.set(m.subarray(0, a * 2)), m = b, this._flatMeasurements = m;
374
+ const u = t * 2;
375
+ let g = this._flatMeasurements;
376
+ if (!g || g.length < u) {
377
+ const b = new Float64Array(u);
378
+ g && r > 0 && b.set(g.subarray(0, r * 2)), g = b, this._flatMeasurements = g;
379
379
  }
380
380
  let E;
381
- if (a === 0) E = e + s;
381
+ if (r === 0) E = e + s;
382
382
  else {
383
- const b = a - 1;
384
- E = m[b * 2] + m[b * 2 + 1] + r;
383
+ const b = r - 1;
384
+ E = g[b * 2] + g[b * 2 + 1] + a;
385
385
  }
386
- for (let b = a; b < t; b++) {
387
- const A = i(b), w = u.get(A), z = typeof w == "number" ? w : this.options.estimateSize(b);
388
- m[b * 2] = E, m[b * 2 + 1] = z, E += z + r;
386
+ for (let b = r; b < t; b++) {
387
+ const A = i(b), z = c.get(A), w = typeof z == "number" ? z : this.options.estimateSize(b);
388
+ g[b * 2] = E, g[b * 2 + 1] = w, E += w + a;
389
389
  }
390
- const S = G(t, m, i);
391
- return this.measurementsCache = S, S;
390
+ const v = G(t, g, i);
391
+ return this.measurementsCache = v, v;
392
392
  }
393
- const f = this.measurementsCache.slice(0, a), g = new Array(o).fill(void 0), p = new Float64Array(o);
394
- let v = 0;
395
- for (let d = 0; d < a; d++) {
396
- const m = f[d];
397
- m && (g[m.lane] === void 0 && v++, g[m.lane] = d, p[m.lane] = m.end);
393
+ const f = this.measurementsCache.slice(0, r), m = new Array(o).fill(void 0), S = new Float64Array(o);
394
+ let p = 0;
395
+ for (let u = 0; u < r; u++) {
396
+ const g = f[u];
397
+ g && (m[g.lane] === void 0 && p++, m[g.lane] = u, S[g.lane] = g.end);
398
398
  }
399
- for (let d = a; d < t; d++) {
400
- const m = i(d), E = this.laneAssignments.get(d);
401
- let S, b;
402
- const A = c === "estimate" || u.has(m);
399
+ for (let u = r; u < t; u++) {
400
+ const g = i(u), E = this.laneAssignments.get(u);
401
+ let v, b;
402
+ const A = h === "estimate" || c.has(g);
403
403
  if (E !== void 0 && this.options.lanes > 1) {
404
- S = E;
405
- const _ = g[S], y = _ !== void 0 ? f[_] : void 0;
406
- b = y ? y.end + r : e + s;
407
- } else if (v === o) {
408
- let _ = 0, y = p[0], N = g[0];
404
+ v = E;
405
+ const _ = m[v], y = _ !== void 0 ? f[_] : void 0;
406
+ b = y ? y.end + a : e + s;
407
+ } else if (p === o) {
408
+ let _ = 0, y = S[0], j = m[0];
409
409
  for (let O = 1; O < o; O++) {
410
- const R = p[O];
411
- (R < y || R === y && g[O] < N) && (_ = O, y = R, N = g[O]);
410
+ const R = S[O];
411
+ (R < y || R === y && m[O] < j) && (_ = O, y = R, j = m[O]);
412
412
  }
413
- S = _, b = y + r, A && this.laneAssignments.set(d, S);
413
+ v = _, b = y + a, A && this.laneAssignments.set(u, v);
414
414
  } else
415
- S = d % this.options.lanes, b = e + s, A && this.laneAssignments.set(d, S);
416
- const w = u.get(m), z = typeof w == "number" ? w : this.options.estimateSize(d), k = b + z;
417
- f[d] = {
418
- index: d,
415
+ v = u % this.options.lanes, b = e + s, A && this.laneAssignments.set(u, v);
416
+ const z = c.get(g), w = typeof z == "number" ? z : this.options.estimateSize(u), k = b + w;
417
+ f[u] = {
418
+ index: u,
419
419
  start: b,
420
- size: z,
420
+ size: w,
421
421
  end: k,
422
- key: m,
423
- lane: S
424
- }, g[S] === void 0 && v++, g[S] = d, p[S] = k;
422
+ key: g,
423
+ lane: v
424
+ }, m[v] === void 0 && p++, m[v] = u, S[v] = k;
425
425
  }
426
426
  return this.measurementsCache = f, f;
427
427
  }, {
@@ -481,26 +481,26 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
481
481
  }, this.resizeItem = (t, e) => {
482
482
  var s, i;
483
483
  if (t < 0 || t >= this.options.count) return;
484
- let n, o, c;
485
- const r = this._flatMeasurements;
486
- if (this.options.lanes === 1 && r !== null)
487
- c = this.options.getItemKey(t), o = r[t * 2], n = r[t * 2 + 1];
484
+ let n, o, h;
485
+ const a = this._flatMeasurements;
486
+ if (this.options.lanes === 1 && a !== null)
487
+ h = this.options.getItemKey(t), o = a[t * 2], n = a[t * 2 + 1];
488
488
  else {
489
- const u = this.measurementsCache[t];
490
- if (!u) return;
491
- c = u.key, o = u.start, n = u.size;
489
+ const r = this.measurementsCache[t];
490
+ if (!r) return;
491
+ h = r.key, o = r.start, n = r.size;
492
492
  }
493
- const h = e - (this.itemSizeCache.get(c) ?? n);
494
- if (h !== 0) {
495
- const u = this.options.anchorTo === "end" && ((s = this.scrollState) == null ? void 0 : s.behavior) !== "smooth" && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold, a = u ? this.getTotalSize() : 0, f = ((i = this.scrollState) == null ? void 0 : i.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t] ?? {
493
+ const d = this.itemSizeCache.get(h) ?? n, c = e - d;
494
+ if (c !== 0) {
495
+ const r = this.options.anchorTo === "end" && ((s = this.scrollState) == null ? void 0 : s.behavior) !== "smooth" && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold, f = r ? this.getTotalSize() : 0, m = this.getScrollOffset() + this.scrollAdjustments, S = this.itemSizeCache.has(h) ? o + d <= m && this.scrollDirection !== "backward" : o < m, p = ((i = this.scrollState) == null ? void 0 : i.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t] ?? {
496
496
  index: t,
497
- key: c,
497
+ key: h,
498
498
  start: o,
499
499
  size: n,
500
500
  end: o + n,
501
501
  lane: 0
502
- }, h, this) : o < this.getScrollOffset() + this.scrollAdjustments && (!this.itemSizeCache.has(c) || this.scrollDirection !== "backward"));
503
- (this.pendingMin === null || t < this.pendingMin) && (this.pendingMin = t), this.itemSizeCache.set(c, e), this.itemSizeCacheVersion++, u ? this.applyScrollAdjustment(this.getTotalSize() - a) : f && this.applyScrollAdjustment(h), this.notify(!1);
502
+ }, c, this) : S);
503
+ (this.pendingMin === null || t < this.pendingMin) && (this.pendingMin = t), this.itemSizeCache.set(h, e), this.itemSizeCacheVersion++, r ? this.applyScrollAdjustment(this.getTotalSize() - f) : p && this.applyScrollAdjustment(c), this.notify(!1);
504
504
  }
505
505
  }, this.getVirtualItems = I(() => [this.getVirtualIndexes(), this.getMeasurements()], (t, e) => {
506
506
  const s = [];
@@ -516,7 +516,7 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
516
516
  const e = this.getMeasurements();
517
517
  if (e.length === 0) return;
518
518
  const s = this._flatMeasurements, i = this.options.lanes === 1 && s != null;
519
- return V(e[P(0, e.length - 1, i ? (n) => s[n * 2] : (n) => V(e[n]).start, t)]);
519
+ return L(e[P(0, e.length - 1, i ? (n) => s[n * 2] : (n) => L(e[n]).start, t)]);
520
520
  }, this.getMaxScrollOffset = () => {
521
521
  if (!this.scrollElement) return 0;
522
522
  if ("scrollHeight" in this.scrollElement) return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
@@ -558,12 +558,12 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
558
558
  this._iosDeferredAdjustment = 0, t = Math.max(0, Math.min(t, this.options.count - 1));
559
559
  const i = this.getOffsetForIndex(t, e);
560
560
  if (!i) return;
561
- const [n, o] = i, c = this.now();
561
+ const [n, o] = i, h = this.now();
562
562
  this.scrollState = {
563
563
  index: t,
564
564
  align: o,
565
565
  behavior: s,
566
- startedAt: c,
566
+ startedAt: h,
567
567
  lastTargetOffset: n,
568
568
  stableFrames: 0
569
569
  }, this._scrollToOffset(n, {
@@ -697,38 +697,38 @@ function ht(l, t, e, s, i) {
697
697
  endIndex: n
698
698
  };
699
699
  if (s === 1 && i !== null) {
700
- const h = at(i, n, e);
701
- let u = h;
702
- const a = e + t;
703
- for (; u < n && i[u * 2] + i[u * 2 + 1] < a; ) u++;
700
+ const d = at(i, n, e);
701
+ let c = d;
702
+ const r = e + t;
703
+ for (; c < n && i[c * 2] + i[c * 2 + 1] < r; ) c++;
704
704
  return {
705
- startIndex: h,
706
- endIndex: u
705
+ startIndex: d,
706
+ endIndex: c
707
707
  };
708
708
  }
709
- let c = P(0, n, (h) => l[h].start, e), r = c;
710
- if (s === 1) for (; r < n && l[r].end < e + t; ) r++;
709
+ let h = P(0, n, (d) => l[d].start, e), a = h;
710
+ if (s === 1) for (; a < n && l[a].end < e + t; ) a++;
711
711
  else if (s > 1) {
712
- const h = Array(s).fill(0);
713
- for (; r < n && h.some((a) => a < e + t); ) {
714
- const a = l[r];
715
- h[a.lane] = a.end, r++;
712
+ const d = Array(s).fill(0);
713
+ for (; a < n && d.some((r) => r < e + t); ) {
714
+ const r = l[a];
715
+ d[r.lane] = r.end, a++;
716
716
  }
717
- const u = Array(s).fill(e + t);
718
- for (; c >= 0 && u.some((a) => a >= e); ) {
719
- const a = l[c];
720
- u[a.lane] = a.start, c--;
717
+ const c = Array(s).fill(e + t);
718
+ for (; h >= 0 && c.some((r) => r >= e); ) {
719
+ const r = l[h];
720
+ c[r.lane] = r.start, h--;
721
721
  }
722
- c = Math.max(0, c - c % s), r = Math.min(n, r + (s - 1 - r % s));
722
+ h = Math.max(0, h - h % s), a = Math.min(n, a + (s - 1 - a % s));
723
723
  }
724
724
  return {
725
- startIndex: c,
726
- endIndex: r
725
+ startIndex: h,
726
+ endIndex: a
727
727
  };
728
728
  }
729
729
  var F = typeof document < "u" ? M.useLayoutEffect : M.useEffect;
730
730
  function ct({ useFlushSync: l = !0, directDomUpdates: t = !1, directDomUpdatesMode: e = "transform", ...s }) {
731
- const i = M.useReducer((h) => h + 1, 0)[1], n = M.useRef({
731
+ const i = M.useReducer((c) => c + 1, 0)[1], n = M.useRef({
732
732
  enabled: t,
733
733
  mode: e,
734
734
  container: null,
@@ -737,52 +737,56 @@ function ct({ useFlushSync: l = !0, directDomUpdates: t = !1, directDomUpdatesMo
737
737
  prevRange: null
738
738
  });
739
739
  n.current.enabled = t, n.current.mode = e;
740
- const o = (h) => {
741
- const u = n.current;
742
- if (!u.enabled || !u.container) return;
743
- const a = h.getTotalSize();
744
- if (a !== u.lastSize) {
745
- u.lastSize = a;
746
- const m = h.options.horizontal ? "width" : "height";
747
- u.container.style[m] = `${a}px`;
740
+ const o = (c) => {
741
+ const r = n.current;
742
+ if (!r.enabled || !r.container) return;
743
+ const f = c.getTotalSize();
744
+ if (f !== r.lastSize) {
745
+ r.lastSize = f;
746
+ const m = c.options.horizontal ? "width" : "height";
747
+ r.container.style[m] = `${f}px`;
748
748
  }
749
- const f = !!h.options.horizontal, g = u.mode === "transform", p = f ? "left" : "top", v = h.options.scrollMargin, d = h.getVirtualItems();
750
- for (const m of d) {
751
- const E = m.start - v, S = h.elementsCache.get(m.key);
752
- S && u.lastPositions.get(S) !== E && (u.lastPositions.set(S, E), g ? S.style.transform = f ? `translate3d(${E}px, 0, 0)` : `translate3d(0, ${E}px, 0)` : S.style[p] = `${E}px`);
749
+ }, h = (c) => {
750
+ const r = n.current;
751
+ if (!r.enabled || !r.container) return;
752
+ o(c);
753
+ const f = !!c.options.horizontal, m = r.mode === "transform", S = f ? "left" : "top", p = c.options.scrollMargin, u = c.getVirtualItems();
754
+ for (const g of u) {
755
+ const E = g.start - p, v = c.elementsCache.get(g.key);
756
+ v && r.lastPositions.get(v) !== E && (r.lastPositions.set(v, E), m ? v.style.transform = f ? `translate3d(${E}px, 0, 0)` : `translate3d(0, ${E}px, 0)` : v.style[S] = `${E}px`);
753
757
  }
754
- }, c = {
758
+ }, a = {
755
759
  ...s,
756
- onChange: (h, u) => {
757
- var a;
758
- const f = n.current;
759
- let g = !0;
760
- if (f.enabled) {
761
- o(h);
762
- const p = h.range, v = f.prevRange;
763
- g = !v || v.isScrolling !== h.isScrolling || v.startIndex !== p?.startIndex || v.endIndex !== p?.endIndex, g && (f.prevRange = p ? {
760
+ onChange: (c, r) => {
761
+ var f;
762
+ const m = n.current;
763
+ let S = !0;
764
+ if (m.enabled) {
765
+ h(c);
766
+ const p = c.range, u = m.prevRange;
767
+ S = !u || u.isScrolling !== c.isScrolling || u.startIndex !== p?.startIndex || u.endIndex !== p?.endIndex, S && (m.prevRange = p ? {
764
768
  startIndex: p.startIndex,
765
769
  endIndex: p.endIndex,
766
- isScrolling: h.isScrolling
770
+ isScrolling: c.isScrolling
767
771
  } : null);
768
772
  }
769
- g && (l && u ? q(i) : i()), (a = s.onChange) == null || a.call(s, h, u);
773
+ S && (l && r ? q(i) : i()), (f = s.onChange) == null || f.call(s, c, r);
770
774
  }
771
- }, [r] = M.useState(() => {
772
- const h = new rt(c);
773
- return Object.assign(h, { containerRef: (u) => {
774
- const a = n.current;
775
- if (a.container = u, a.lastSize = null, u && a.enabled) {
776
- const f = h.getTotalSize();
777
- a.lastSize = f;
778
- const g = h.options.horizontal ? "width" : "height";
779
- u.style[g] = `${f}px`;
775
+ }, [d] = M.useState(() => {
776
+ const c = new rt(a);
777
+ return Object.assign(c, { containerRef: (r) => {
778
+ const f = n.current;
779
+ if (f.container = r, f.lastSize = null, r && f.enabled) {
780
+ const m = c.getTotalSize();
781
+ f.lastSize = m;
782
+ const S = c.options.horizontal ? "width" : "height";
783
+ r.style[S] = `${m}px`;
780
784
  }
781
785
  } });
782
786
  });
783
- return r.setOptions(c), F(() => r._didMount(), []), F(() => r._willUpdate()), F(() => {
784
- o(r);
785
- }), r;
787
+ return d.setOptions(a), F(() => d._didMount(), []), F(() => (o(d), d._willUpdate())), F(() => {
788
+ h(d);
789
+ }), d;
786
790
  }
787
791
  function ut(l) {
788
792
  return ct({
@@ -793,21 +797,21 @@ function ut(l) {
793
797
  });
794
798
  }
795
799
  var bt = ({ showFlagOnSearch: l, showNameOnSearch: t }) => {
796
- const e = J(null), { termOfSearch: s, countries: i, handleSelectCountry: n } = K(), o = H(() => i.filter((r) => r.name.toLocaleLowerCase().includes(s.toLowerCase())), [s]), c = ut({
800
+ const e = J(null), { termOfSearch: s, countries: i, handleSelectCountry: n } = K(), o = H(() => i.filter((a) => a.name.toLocaleLowerCase().includes(s.toLowerCase())), [s]), h = ut({
797
801
  count: o.length,
798
802
  overscan: 5,
799
803
  getScrollElement: () => e.current,
800
804
  estimateSize: () => 40
801
805
  });
802
806
  return B(() => {
803
- o.length > 0 && c.scrollToIndex(0);
804
- }, [s, c]), o.length === 0 ? /* @__PURE__ */ x("div", {
807
+ o.length > 0 && h.scrollToIndex(0);
808
+ }, [s, h]), o.length === 0 ? /* @__PURE__ */ x("div", {
805
809
  className: "overflow-y-auto max-h-60 snap-y snap-mandatory",
806
810
  children: /* @__PURE__ */ x("ul", {
807
811
  className: "relative",
808
812
  children: /* @__PURE__ */ x("li", {
809
813
  className: "w-full flex items-center h-10 select-none px-6",
810
- children: /* @__PURE__ */ x(L, {
814
+ children: /* @__PURE__ */ x(W, {
811
815
  variant: "body2",
812
816
  component: "span",
813
817
  className: "flex gap-2 items-center text-left",
@@ -820,29 +824,29 @@ var bt = ({ showFlagOnSearch: l, showNameOnSearch: t }) => {
820
824
  className: "overflow-y-auto max-h-60 snap-y snap-mandatory scrollbar",
821
825
  children: /* @__PURE__ */ x("ul", {
822
826
  className: "relative",
823
- style: { height: c.getTotalSize() },
824
- children: c.getVirtualItems().map((r) => {
825
- const h = o[r.index], { flag: u, name: a, prefix: f } = h;
827
+ style: { height: h.getTotalSize() },
828
+ children: h.getVirtualItems().map((a) => {
829
+ const d = o[a.index], { flag: c, name: r, prefix: f } = d;
826
830
  return /* @__PURE__ */ x("li", {
827
- className: j("absolute", "w-full", "snap-start", "snap-always", "scroll-m-0", "flex", "items-center", "h-10"),
831
+ className: N("absolute", "w-full", "snap-start", "snap-always", "scroll-m-0", "flex", "items-center", "h-10"),
828
832
  style: {
829
- top: r.start,
830
- height: r.size
833
+ top: a.start,
834
+ height: a.size
831
835
  },
832
836
  children: /* @__PURE__ */ x("button", {
833
- className: j("w-full", "h-full", "cursor-pointer", "px-6", "hover:bg-gray-50", "transition-colors", "duration-150", "focus-visible:outline-0", "hover:outline-gray-100", "focus:bg-gray-50", "dark:hover:bg-metal-700"),
834
- onClick: () => n(h),
835
- children: /* @__PURE__ */ U(L, {
837
+ className: N("w-full", "h-full", "cursor-pointer", "px-6", "hover:bg-gray-50", "transition-colors", "duration-150", "focus-visible:outline-0", "hover:outline-gray-100", "focus:bg-gray-50", "dark:hover:bg-metal-700"),
838
+ onClick: () => n(d),
839
+ children: /* @__PURE__ */ U(W, {
836
840
  variant: "body2",
837
841
  component: "span",
838
842
  className: "flex gap-2 items-center text-left",
839
- children: [l && /* @__PURE__ */ x(u, {}), t && /* @__PURE__ */ x($, {
840
- text: a,
843
+ children: [l && /* @__PURE__ */ x(c, {}), t && /* @__PURE__ */ x($, {
844
+ text: r,
841
845
  prefix: f
842
846
  })]
843
847
  })
844
848
  })
845
- }, r.key);
849
+ }, a.key);
846
850
  })
847
851
  })
848
852
  });