@servicetitan/anvil2 1.2.7 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/{Alert-2e4d9ed5.js → Alert-49d915aa.js} +3 -3
  2. package/{Alert-2e4d9ed5.js.map → Alert-49d915aa.js.map} +1 -1
  3. package/{Alert-94c37437.cjs → Alert-e48c196e.cjs} +2 -2
  4. package/{Alert-94c37437.cjs.map → Alert-e48c196e.cjs.map} +1 -1
  5. package/Alert.cjs +1 -1
  6. package/Alert.js +1 -1
  7. package/{Announcement-2058bd02.cjs → Announcement-d598ea11.cjs} +2 -2
  8. package/{Announcement-2058bd02.cjs.map → Announcement-d598ea11.cjs.map} +1 -1
  9. package/{Announcement-1db4ac33.js → Announcement-eb5fd003.js} +3 -3
  10. package/{Announcement-1db4ac33.js.map → Announcement-eb5fd003.js.map} +1 -1
  11. package/Announcement.cjs +1 -1
  12. package/Announcement.js +1 -1
  13. package/Avatar.cjs +1 -1
  14. package/Avatar.js +1 -1
  15. package/{Button-3b93bd5d.js → Button-855c7b85.js} +2 -2
  16. package/{Button-3b93bd5d.js.map → Button-855c7b85.js.map} +1 -1
  17. package/{Button-30b35802.cjs → Button-8fe1ed7f.cjs} +2 -2
  18. package/{Button-30b35802.cjs.map → Button-8fe1ed7f.cjs.map} +1 -1
  19. package/Button.cjs +1 -1
  20. package/Button.cjs.map +1 -1
  21. package/Button.js +24 -23
  22. package/Button.js.map +1 -1
  23. package/ButtonCompound.cjs +1 -1
  24. package/ButtonCompound.cjs.map +1 -1
  25. package/ButtonCompound.js +24 -23
  26. package/ButtonCompound.js.map +1 -1
  27. package/ButtonLink.cjs +1 -1
  28. package/ButtonLink.cjs.map +1 -1
  29. package/ButtonLink.js +24 -23
  30. package/ButtonLink.js.map +1 -1
  31. package/ButtonToggle.cjs +1 -1
  32. package/ButtonToggle.cjs.map +1 -1
  33. package/ButtonToggle.js +24 -23
  34. package/ButtonToggle.js.map +1 -1
  35. package/{Calendar-ec151b3b.cjs → Calendar-21727a1d.cjs} +2 -2
  36. package/{Calendar-ec151b3b.cjs.map → Calendar-21727a1d.cjs.map} +1 -1
  37. package/{Calendar-cbfe3c06.js → Calendar-6af49637.js} +2 -2
  38. package/{Calendar-cbfe3c06.js.map → Calendar-6af49637.js.map} +1 -1
  39. package/Calendar.cjs +1 -1
  40. package/Calendar.js +1 -1
  41. package/{Checkbox-d325d851.cjs → Checkbox-28412a96.cjs} +2 -2
  42. package/{Checkbox-d325d851.cjs.map → Checkbox-28412a96.cjs.map} +1 -1
  43. package/{Checkbox-3de9628c.js → Checkbox-54ecbd70.js} +2 -2
  44. package/{Checkbox-3de9628c.js.map → Checkbox-54ecbd70.js.map} +1 -1
  45. package/Checkbox.cjs +1 -1
  46. package/Checkbox.js +1 -1
  47. package/Chip-6dbdbc2e.js +91 -0
  48. package/Chip-6dbdbc2e.js.map +1 -0
  49. package/Chip-de78e3f6.cjs +2 -0
  50. package/Chip-de78e3f6.cjs.map +1 -0
  51. package/Chip.cjs +1 -1
  52. package/Chip.css +1 -1
  53. package/Chip.js +1 -1
  54. package/Combobox.cjs +1 -1
  55. package/Combobox.cjs.map +1 -1
  56. package/Combobox.js +24 -23
  57. package/Combobox.js.map +1 -1
  58. package/Details.cjs +1 -1
  59. package/Details.cjs.map +1 -1
  60. package/Details.js +24 -23
  61. package/Details.js.map +1 -1
  62. package/Dialog.cjs +1 -1
  63. package/Dialog.cjs.map +1 -1
  64. package/Dialog.js +37 -36
  65. package/Dialog.js.map +1 -1
  66. package/Drawer-45208baf.cjs +2 -0
  67. package/Drawer-45208baf.cjs.map +1 -0
  68. package/Drawer-f95784bb.js +209 -0
  69. package/Drawer-f95784bb.js.map +1 -0
  70. package/Drawer.cjs +1 -1
  71. package/Drawer.js +1 -1
  72. package/{Helper-74a1f07f-60547798.js → Helper-74a1f07f-092263c4.js} +2 -2
  73. package/{Helper-74a1f07f-60547798.js.map → Helper-74a1f07f-092263c4.js.map} +1 -1
  74. package/{Helper-74a1f07f-30e4fd46.cjs → Helper-74a1f07f-61317df2.cjs} +2 -2
  75. package/{Helper-74a1f07f-30e4fd46.cjs.map → Helper-74a1f07f-61317df2.cjs.map} +1 -1
  76. package/Icon-57c31c9b.cjs +2 -0
  77. package/Icon-57c31c9b.cjs.map +1 -0
  78. package/{Icon-b443eea4.js → Icon-b94f924c.js} +8 -8
  79. package/Icon-b94f924c.js.map +1 -0
  80. package/Icon.cjs +1 -1
  81. package/Icon.css +1 -1
  82. package/Icon.js +1 -1
  83. package/Link.cjs +1 -1
  84. package/Link.cjs.map +1 -1
  85. package/Link.js +24 -23
  86. package/Link.js.map +1 -1
  87. package/{ListView-482c54ad.js → ListView-ad64a337.js} +3 -3
  88. package/{ListView-482c54ad.js.map → ListView-ad64a337.js.map} +1 -1
  89. package/{ListView-43bbc290.cjs → ListView-fcd88dd1.cjs} +2 -2
  90. package/{ListView-43bbc290.cjs.map → ListView-fcd88dd1.cjs.map} +1 -1
  91. package/ListView.cjs +1 -1
  92. package/ListView.js +1 -1
  93. package/{Listbox-b110c64d.js → Listbox-030b2993.js} +2 -2
  94. package/{Listbox-b110c64d.js.map → Listbox-030b2993.js.map} +1 -1
  95. package/{Listbox-8c610bf2.cjs → Listbox-cd5c4185.cjs} +2 -2
  96. package/{Listbox-8c610bf2.cjs.map → Listbox-cd5c4185.cjs.map} +1 -1
  97. package/Listbox.cjs +1 -1
  98. package/Listbox.js +1 -1
  99. package/Menu.cjs +1 -1
  100. package/Menu.cjs.map +1 -1
  101. package/Menu.js +1 -1
  102. package/Overflow.cjs +1 -1
  103. package/Overflow.cjs.map +1 -1
  104. package/Overflow.js +26 -25
  105. package/Overflow.js.map +1 -1
  106. package/Popover.cjs +1 -1
  107. package/Popover.cjs.map +1 -1
  108. package/Popover.js +29 -28
  109. package/Popover.js.map +1 -1
  110. package/PortalProvider.cjs +2 -0
  111. package/PortalProvider.cjs.map +1 -0
  112. package/PortalProvider.d.ts +15 -0
  113. package/PortalProvider.js +16 -0
  114. package/PortalProvider.js.map +1 -0
  115. package/ProgressBar-0c2b3852.cjs +2 -0
  116. package/ProgressBar-0c2b3852.cjs.map +1 -0
  117. package/{ProgressBar-91240dab.js → ProgressBar-f54440d6.js} +116 -112
  118. package/ProgressBar-f54440d6.js.map +1 -0
  119. package/ProgressBar.cjs +1 -1
  120. package/ProgressBar.css +1 -1
  121. package/ProgressBar.js +1 -1
  122. package/{Radio-ed00ea9d.cjs → Radio-845d1fe6.cjs} +2 -2
  123. package/{Radio-ed00ea9d.cjs.map → Radio-845d1fe6.cjs.map} +1 -1
  124. package/{Radio-a747c89a.js → Radio-8f8e771e.js} +2 -2
  125. package/{Radio-a747c89a.js.map → Radio-8f8e771e.js.map} +1 -1
  126. package/Radio.cjs +1 -1
  127. package/Radio.js +1 -1
  128. package/SegmentedControl-d223643c.js +108 -0
  129. package/SegmentedControl-d223643c.js.map +1 -0
  130. package/SegmentedControl-e5e48c23.cjs +2 -0
  131. package/SegmentedControl-e5e48c23.cjs.map +1 -0
  132. package/SegmentedControl.cjs +2 -0
  133. package/SegmentedControl.cjs.map +1 -0
  134. package/SegmentedControl.css +1 -0
  135. package/SegmentedControl.d.ts +36 -0
  136. package/SegmentedControl.js +16 -0
  137. package/SegmentedControl.js.map +1 -0
  138. package/{SideNav-dbcdf7cb.cjs → SideNav-47435e45.cjs} +3 -3
  139. package/{SideNav-dbcdf7cb.cjs.map → SideNav-47435e45.cjs.map} +1 -1
  140. package/{SideNav-b5ef91d4.js → SideNav-80e5ce2f.js} +68 -68
  141. package/{SideNav-b5ef91d4.js.map → SideNav-80e5ce2f.js.map} +1 -1
  142. package/SideNav.cjs +1 -1
  143. package/SideNav.js +1 -1
  144. package/SrOnly-864bd4cb.js.map +1 -1
  145. package/SrOnly-88e8fca6.cjs.map +1 -1
  146. package/Stepper-51ada533.cjs +2 -0
  147. package/Stepper-51ada533.cjs.map +1 -0
  148. package/Stepper-85a93af9.js +633 -0
  149. package/Stepper-85a93af9.js.map +1 -0
  150. package/Stepper.cjs +1 -1
  151. package/Stepper.css +1 -1
  152. package/Stepper.d.ts +2 -2
  153. package/Stepper.js +10 -10
  154. package/{Switch-c0bea091.cjs → Switch-7bfb6be6.cjs} +2 -2
  155. package/{Switch-c0bea091.cjs.map → Switch-7bfb6be6.cjs.map} +1 -1
  156. package/{Switch-39010760.js → Switch-917c699a.js} +2 -2
  157. package/{Switch-39010760.js.map → Switch-917c699a.js.map} +1 -1
  158. package/Switch.cjs +1 -1
  159. package/Switch.js +1 -1
  160. package/{Tab-f636d6c5.js → Tab-68267c78.js} +2 -2
  161. package/{Tab-f636d6c5.js.map → Tab-68267c78.js.map} +1 -1
  162. package/{Tab-0bcbe9c7.cjs → Tab-9d3d7922.cjs} +2 -2
  163. package/{Tab-0bcbe9c7.cjs.map → Tab-9d3d7922.cjs.map} +1 -1
  164. package/Tab.cjs +1 -1
  165. package/Tab.js +1 -1
  166. package/Text-465104f6.js.map +1 -1
  167. package/Text-631c229a.cjs.map +1 -1
  168. package/TextField.cjs +1 -1
  169. package/TextField.cjs.map +1 -1
  170. package/TextField.js +24 -23
  171. package/TextField.js.map +1 -1
  172. package/Textarea.cjs +1 -1
  173. package/Textarea.cjs.map +1 -1
  174. package/Textarea.js +24 -23
  175. package/Textarea.js.map +1 -1
  176. package/{Toast-36679136.js → Toast-330e28fb.js} +3 -3
  177. package/{Toast-36679136.js.map → Toast-330e28fb.js.map} +1 -1
  178. package/{Toast-44e3ff94.cjs → Toast-f154bebc.cjs} +2 -2
  179. package/{Toast-44e3ff94.cjs.map → Toast-f154bebc.cjs.map} +1 -1
  180. package/Toast.cjs +1 -1
  181. package/Toast.js +1 -1
  182. package/Tooltip.cjs +1 -1
  183. package/Tooltip.cjs.map +1 -1
  184. package/Tooltip.js +29 -28
  185. package/Tooltip.js.map +1 -1
  186. package/anvil2.cjs +1 -1
  187. package/anvil2.d.ts +42 -16
  188. package/anvil2.js +176 -172
  189. package/anvil2.js.map +1 -1
  190. package/getKeyboardFocusableElements-ea0e208d-58a00025.js +14 -0
  191. package/getKeyboardFocusableElements-ea0e208d-58a00025.js.map +1 -0
  192. package/getKeyboardFocusableElements-ea0e208d-aba1bd01.cjs +2 -0
  193. package/getKeyboardFocusableElements-ea0e208d-aba1bd01.cjs.map +1 -0
  194. package/index-09cb022c-28ca3469.js +520 -0
  195. package/index-09cb022c-28ca3469.js.map +1 -0
  196. package/index-09cb022c-f4ddfd52.cjs +2 -0
  197. package/index-09cb022c-f4ddfd52.cjs.map +1 -0
  198. package/index-09cb022c.css +1 -0
  199. package/index-671f29a9.cjs +23 -0
  200. package/index-671f29a9.cjs.map +1 -0
  201. package/index-6ad2779a.js +4227 -0
  202. package/index-6ad2779a.js.map +1 -0
  203. package/index-f7658447-d8b2b888.js +121 -0
  204. package/index-f7658447-d8b2b888.js.map +1 -0
  205. package/index-f7658447-d9ca2747.cjs +2 -0
  206. package/index-f7658447-d9ca2747.cjs.map +1 -0
  207. package/index-f7658447.css +1 -0
  208. package/index3.css +1 -1
  209. package/package.json +2 -2
  210. package/useAccessibleColor.cjs +1 -1
  211. package/useAccessibleColor.js +24 -23
  212. package/useAccessibleColor.js.map +1 -1
  213. package/useLinkStyles.cjs +1 -1
  214. package/useLinkStyles.js +23 -22
  215. package/useLinkStyles.js.map +1 -1
  216. package/useMergeRefs.cjs +1 -1
  217. package/useMergeRefs.js +24 -23
  218. package/useMergeRefs.js.map +1 -1
  219. package/usePrefersColorScheme.cjs +1 -1
  220. package/usePrefersColorScheme.js +24 -23
  221. package/usePrefersColorScheme.js.map +1 -1
  222. package/useSwipe.cjs +1 -1
  223. package/useSwipe.js +24 -23
  224. package/useSwipe.js.map +1 -1
  225. package/Chip-95370241.cjs +0 -2
  226. package/Chip-95370241.cjs.map +0 -1
  227. package/Chip-c0f71a26.js +0 -90
  228. package/Chip-c0f71a26.js.map +0 -1
  229. package/Drawer-9775ed75.js +0 -219
  230. package/Drawer-9775ed75.js.map +0 -1
  231. package/Drawer-dff5abf1.cjs +0 -2
  232. package/Drawer-dff5abf1.cjs.map +0 -1
  233. package/Icon-43ce0e6c.cjs +0 -2
  234. package/Icon-43ce0e6c.cjs.map +0 -1
  235. package/Icon-b443eea4.js.map +0 -1
  236. package/ProgressBar-91240dab.js.map +0 -1
  237. package/ProgressBar-b25b2493.cjs +0 -2
  238. package/ProgressBar-b25b2493.cjs.map +0 -1
  239. package/Stepper-7c787b24.js +0 -391
  240. package/Stepper-7c787b24.js.map +0 -1
  241. package/Stepper-e08b9998.cjs +0 -2
  242. package/Stepper-e08b9998.cjs.map +0 -1
  243. package/index-1dc4c6d3.js +0 -4662
  244. package/index-1dc4c6d3.js.map +0 -1
  245. package/index-25ea279e.cjs +0 -23
  246. package/index-25ea279e.cjs.map +0 -1
  247. package/index-afacb017-0ced4668.cjs +0 -2
  248. package/index-afacb017-0ced4668.cjs.map +0 -1
  249. package/index-afacb017-e81aec1d.js +0 -310
  250. package/index-afacb017-e81aec1d.js.map +0 -1
  251. package/index-afacb017.css +0 -1
  252. package/index-f91265d9-04a0345c.cjs +0 -2
  253. package/index-f91265d9-04a0345c.cjs.map +0 -1
  254. package/index-f91265d9-3d747651.js +0 -121
  255. package/index-f91265d9-3d747651.js.map +0 -1
  256. package/index-f91265d9.css +0 -1
package/index-1dc4c6d3.js DELETED
@@ -1,4662 +0,0 @@
1
- import "./index3.css";
2
- import "./Alert-2e4d9ed5.js";
3
- import "./Announcement-1db4ac33.js";
4
- import "./index-f91265d9-3d747651.js";
5
- import "./Badge-df96f15a.js";
6
- import { B as We, l as Vr } from "./Button-3b93bd5d.js";
7
- import "./Calendar-cbfe3c06.js";
8
- import "./Card-bb358803.js";
9
- import { r as Ar } from "./Checkbox-3de9628c.js";
10
- import { $ as ln } from "./Chip-c0f71a26.js";
11
- import "./Divider-b3bff73a.js";
12
- import { a as Hr } from "./Drawer-9775ed75.js";
13
- import { j as vt } from "./Flex-d338e855.js";
14
- import "./Grid-5bad450f.js";
15
- import { C as xt } from "./Icon-b443eea4.js";
16
- import { j as bt } from "./ProgressBar-91240dab.js";
17
- import { i as kn } from "./Listbox-b110c64d.js";
18
- import { t as _t } from "./ListView-482c54ad.js";
19
- import "./index-afacb017-e81aec1d.js";
20
- import "./Radio-a747c89a.js";
21
- import { P as y, _ as $, b as ve, a as jr } from "./SideNav-b5ef91d4.js";
22
- import { p as Mn } from "./SrOnly-864bd4cb.js";
23
- import { f as v } from "./jsx-runtime-944c88e2-e73fa629.js";
24
- import { c as se } from "./index-e0f6271a.js";
25
- import "./Stepper-7c787b24.js";
26
- import "./Switch-39010760.js";
27
- import "./Tab-f636d6c5.js";
28
- import { $ as Tn } from "./Text-465104f6.js";
29
- import "./Toast-36679136.js";
30
- import "./index-06c0bdf0.js";
31
- import { J as Se } from "./useLayoutPropsUtil-e307abc7-cbe2fb6d.js";
32
- import { U as Kr, T as $r } from "./index-d46fa8de-8695742b.js";
33
- import "./usePrefersColorScheme-129544ad-cab6fc3f.js";
34
- import * as _e from "react";
35
- import st, { useRef as Q, useCallback as ee, useEffect as de, useMemo as Te, cloneElement as Fr, Component as Lr, useLayoutEffect as wt, useReducer as Br, createContext as dt, forwardRef as ce, useContext as Ve, useState as J, useId as Ie } from "react";
36
- import "./index-439b5871.js";
37
- import "./LocalizationProvider.js";
38
- import { u as Be, v as Ur, w as qr, z as zr, e as Wr, h as Yr, o as Gr, g as Xr, f as Jr, s as Qr, l as Zr, B as eo, k as to, i as no, j as ro, n as oo, m as io, r as so } from "./floating-ui.react-8d61182d.js";
39
- import { g as ao } from "./_commonjsHelpers-c5d32002.js";
40
- import { a as Vn } from "./close-064c8acc-7e0b4df7.js";
41
- import { a as lo } from "./check-5f087ea0-b5474547.js";
42
- import { v as Et } from "./Helper-74a1f07f-60547798.js";
43
- /* empty css */import "./useSwipe-82769b09-835234e6.js";
44
- function un(e) {
45
- if (e === void 0)
46
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
47
- return e;
48
- }
49
- var It = { exports: {} }, G = {};
50
- /**
51
- * @license React
52
- * react-is.production.min.js
53
- *
54
- * Copyright (c) Facebook, Inc. and its affiliates.
55
- *
56
- * This source code is licensed under the MIT license found in the
57
- * LICENSE file in the root directory of this source tree.
58
- */
59
- var dn;
60
- function uo() {
61
- if (dn)
62
- return G;
63
- dn = 1;
64
- var e = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), t = Symbol.for("react.provider"), s = Symbol.for("react.context"), l = Symbol.for("react.server_context"), d = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), a = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), x;
65
- x = Symbol.for("react.module.reference");
66
- function S(g) {
67
- if (typeof g == "object" && g !== null) {
68
- var D = g.$$typeof;
69
- switch (D) {
70
- case e:
71
- switch (g = g.type, g) {
72
- case r:
73
- case o:
74
- case i:
75
- case u:
76
- case a:
77
- return g;
78
- default:
79
- switch (g = g && g.$$typeof, g) {
80
- case l:
81
- case s:
82
- case d:
83
- case b:
84
- case h:
85
- case t:
86
- return g;
87
- default:
88
- return D;
89
- }
90
- }
91
- case n:
92
- return D;
93
- }
94
- }
95
- }
96
- return G.ContextConsumer = s, G.ContextProvider = t, G.Element = e, G.ForwardRef = d, G.Fragment = r, G.Lazy = b, G.Memo = h, G.Portal = n, G.Profiler = o, G.StrictMode = i, G.Suspense = u, G.SuspenseList = a, G.isAsyncMode = function() {
97
- return !1;
98
- }, G.isConcurrentMode = function() {
99
- return !1;
100
- }, G.isContextConsumer = function(g) {
101
- return S(g) === s;
102
- }, G.isContextProvider = function(g) {
103
- return S(g) === t;
104
- }, G.isElement = function(g) {
105
- return typeof g == "object" && g !== null && g.$$typeof === e;
106
- }, G.isForwardRef = function(g) {
107
- return S(g) === d;
108
- }, G.isFragment = function(g) {
109
- return S(g) === r;
110
- }, G.isLazy = function(g) {
111
- return S(g) === b;
112
- }, G.isMemo = function(g) {
113
- return S(g) === h;
114
- }, G.isPortal = function(g) {
115
- return S(g) === n;
116
- }, G.isProfiler = function(g) {
117
- return S(g) === o;
118
- }, G.isStrictMode = function(g) {
119
- return S(g) === i;
120
- }, G.isSuspense = function(g) {
121
- return S(g) === u;
122
- }, G.isSuspenseList = function(g) {
123
- return S(g) === a;
124
- }, G.isValidElementType = function(g) {
125
- return typeof g == "string" || typeof g == "function" || g === r || g === o || g === i || g === u || g === a || g === _ || typeof g == "object" && g !== null && (g.$$typeof === b || g.$$typeof === h || g.$$typeof === t || g.$$typeof === s || g.$$typeof === d || g.$$typeof === x || g.getModuleId !== void 0);
126
- }, G.typeOf = S, G;
127
- }
128
- var X = {};
129
- /**
130
- * @license React
131
- * react-is.development.js
132
- *
133
- * Copyright (c) Facebook, Inc. and its affiliates.
134
- *
135
- * This source code is licensed under the MIT license found in the
136
- * LICENSE file in the root directory of this source tree.
137
- */
138
- var cn;
139
- function co() {
140
- return cn || (cn = 1, process.env.NODE_ENV !== "production" && function() {
141
- var e = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), t = Symbol.for("react.provider"), s = Symbol.for("react.context"), l = Symbol.for("react.server_context"), d = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), a = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), x = !1, S = !1, g = !1, D = !1, c = !1, f;
142
- f = Symbol.for("react.module.reference");
143
- function p(C) {
144
- return !!(typeof C == "string" || typeof C == "function" || C === r || C === o || c || C === i || C === u || C === a || D || C === _ || x || S || g || typeof C == "object" && C !== null && (C.$$typeof === b || C.$$typeof === h || C.$$typeof === t || C.$$typeof === s || C.$$typeof === d || // This needs to include all possible module reference object
145
- // types supported by any Flight configuration anywhere since
146
- // we don't know which Flight build this will end up being used
147
- // with.
148
- C.$$typeof === f || C.getModuleId !== void 0));
149
- }
150
- function I(C) {
151
- if (typeof C == "object" && C !== null) {
152
- var he = C.$$typeof;
153
- switch (he) {
154
- case e:
155
- var ie = C.type;
156
- switch (ie) {
157
- case r:
158
- case o:
159
- case i:
160
- case u:
161
- case a:
162
- return ie;
163
- default:
164
- var Ae = ie && ie.$$typeof;
165
- switch (Ae) {
166
- case l:
167
- case s:
168
- case d:
169
- case b:
170
- case h:
171
- case t:
172
- return Ae;
173
- default:
174
- return he;
175
- }
176
- }
177
- case n:
178
- return he;
179
- }
180
- }
181
- }
182
- var m = s, N = t, E = e, k = d, M = r, O = b, P = h, V = n, R = o, F = i, L = u, K = a, U = !1, Z = !1;
183
- function j(C) {
184
- return U || (U = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")), !1;
185
- }
186
- function z(C) {
187
- return Z || (Z = !0, console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")), !1;
188
- }
189
- function Y(C) {
190
- return I(C) === s;
191
- }
192
- function oe(C) {
193
- return I(C) === t;
194
- }
195
- function T(C) {
196
- return typeof C == "object" && C !== null && C.$$typeof === e;
197
- }
198
- function A(C) {
199
- return I(C) === d;
200
- }
201
- function w(C) {
202
- return I(C) === r;
203
- }
204
- function H(C) {
205
- return I(C) === b;
206
- }
207
- function q(C) {
208
- return I(C) === h;
209
- }
210
- function W(C) {
211
- return I(C) === n;
212
- }
213
- function B(C) {
214
- return I(C) === o;
215
- }
216
- function ae(C) {
217
- return I(C) === i;
218
- }
219
- function le(C) {
220
- return I(C) === u;
221
- }
222
- function ue(C) {
223
- return I(C) === a;
224
- }
225
- X.ContextConsumer = m, X.ContextProvider = N, X.Element = E, X.ForwardRef = k, X.Fragment = M, X.Lazy = O, X.Memo = P, X.Portal = V, X.Profiler = R, X.StrictMode = F, X.Suspense = L, X.SuspenseList = K, X.isAsyncMode = j, X.isConcurrentMode = z, X.isContextConsumer = Y, X.isContextProvider = oe, X.isElement = T, X.isForwardRef = A, X.isFragment = w, X.isLazy = H, X.isMemo = q, X.isPortal = W, X.isProfiler = B, X.isStrictMode = ae, X.isSuspense = le, X.isSuspenseList = ue, X.isValidElementType = p, X.typeOf = I;
226
- }()), X;
227
- }
228
- process.env.NODE_ENV === "production" ? It.exports = uo() : It.exports = co();
229
- var pn = It.exports;
230
- const fn = (e) => typeof e == "object" && e != null && e.nodeType === 1, hn = (e, n) => (!n || e !== "hidden") && e !== "visible" && e !== "clip", gt = (e, n) => {
231
- if (e.clientHeight < e.scrollHeight || e.clientWidth < e.scrollWidth) {
232
- const r = getComputedStyle(e, null);
233
- return hn(r.overflowY, n) || hn(r.overflowX, n) || ((i) => {
234
- const o = ((t) => {
235
- if (!t.ownerDocument || !t.ownerDocument.defaultView)
236
- return null;
237
- try {
238
- return t.ownerDocument.defaultView.frameElement;
239
- } catch {
240
- return null;
241
- }
242
- })(i);
243
- return !!o && (o.clientHeight < i.scrollHeight || o.clientWidth < i.scrollWidth);
244
- })(e);
245
- }
246
- return !1;
247
- }, nt = (e, n, r, i, o, t, s, l) => t < e && s > n || t > e && s < n ? 0 : t <= e && l <= r || s >= n && l >= r ? t - e - i : s > n && l < r || t < e && l > r ? s - n + o : 0, po = (e) => {
248
- const n = e.parentElement;
249
- return n ?? (e.getRootNode().host || null);
250
- }, fo = (e, n) => {
251
- var r, i, o, t;
252
- if (typeof document > "u")
253
- return [];
254
- const { scrollMode: s, block: l, inline: d, boundary: u, skipOverflowHiddenElements: a } = n, h = typeof u == "function" ? u : (L) => L !== u;
255
- if (!fn(e))
256
- throw new TypeError("Invalid target");
257
- const b = document.scrollingElement || document.documentElement, _ = [];
258
- let x = e;
259
- for (; fn(x) && h(x); ) {
260
- if (x = po(x), x === b) {
261
- _.push(x);
262
- break;
263
- }
264
- x != null && x === document.body && gt(x) && !gt(document.documentElement) || x != null && gt(x, a) && _.push(x);
265
- }
266
- const S = (i = (r = window.visualViewport) == null ? void 0 : r.width) != null ? i : innerWidth, g = (t = (o = window.visualViewport) == null ? void 0 : o.height) != null ? t : innerHeight, { scrollX: D, scrollY: c } = window, { height: f, width: p, top: I, right: m, bottom: N, left: E } = e.getBoundingClientRect(), { top: k, right: M, bottom: O, left: P } = ((L) => {
267
- const K = window.getComputedStyle(L);
268
- return { top: parseFloat(K.scrollMarginTop) || 0, right: parseFloat(K.scrollMarginRight) || 0, bottom: parseFloat(K.scrollMarginBottom) || 0, left: parseFloat(K.scrollMarginLeft) || 0 };
269
- })(e);
270
- let V = l === "start" || l === "nearest" ? I - k : l === "end" ? N + O : I + f / 2 - k + O, R = d === "center" ? E + p / 2 - P + M : d === "end" ? m + M : E - P;
271
- const F = [];
272
- for (let L = 0; L < _.length; L++) {
273
- const K = _[L], { height: U, width: Z, top: j, right: z, bottom: Y, left: oe } = K.getBoundingClientRect();
274
- if (s === "if-needed" && I >= 0 && E >= 0 && N <= g && m <= S && I >= j && N <= Y && E >= oe && m <= z)
275
- return F;
276
- const T = getComputedStyle(K), A = parseInt(T.borderLeftWidth, 10), w = parseInt(T.borderTopWidth, 10), H = parseInt(T.borderRightWidth, 10), q = parseInt(T.borderBottomWidth, 10);
277
- let W = 0, B = 0;
278
- const ae = "offsetWidth" in K ? K.offsetWidth - K.clientWidth - A - H : 0, le = "offsetHeight" in K ? K.offsetHeight - K.clientHeight - w - q : 0, ue = "offsetWidth" in K ? K.offsetWidth === 0 ? 0 : Z / K.offsetWidth : 0, C = "offsetHeight" in K ? K.offsetHeight === 0 ? 0 : U / K.offsetHeight : 0;
279
- if (b === K)
280
- W = l === "start" ? V : l === "end" ? V - g : l === "nearest" ? nt(c, c + g, g, w, q, c + V, c + V + f, f) : V - g / 2, B = d === "start" ? R : d === "center" ? R - S / 2 : d === "end" ? R - S : nt(D, D + S, S, A, H, D + R, D + R + p, p), W = Math.max(0, W + c), B = Math.max(0, B + D);
281
- else {
282
- W = l === "start" ? V - j - w : l === "end" ? V - Y + q + le : l === "nearest" ? nt(j, Y, U, w, q + le, V, V + f, f) : V - (j + U / 2) + le / 2, B = d === "start" ? R - oe - A : d === "center" ? R - (oe + Z / 2) + ae / 2 : d === "end" ? R - z + H + ae : nt(oe, z, Z, A, H + ae, R, R + p, p);
283
- const { scrollLeft: he, scrollTop: ie } = K;
284
- W = C === 0 ? 0 : Math.max(0, Math.min(ie + W / C, K.scrollHeight - U / C + le)), B = ue === 0 ? 0 : Math.max(0, Math.min(he + B / ue, K.scrollWidth - Z / ue + ae)), V += ie - W, R += he - B;
285
- }
286
- F.push({ el: K, top: W, left: B });
287
- }
288
- return F;
289
- };
290
- var Fe = function() {
291
- return Fe = Object.assign || function(n) {
292
- for (var r, i = 1, o = arguments.length; i < o; i++) {
293
- r = arguments[i];
294
- for (var t in r)
295
- Object.prototype.hasOwnProperty.call(r, t) && (n[t] = r[t]);
296
- }
297
- return n;
298
- }, Fe.apply(this, arguments);
299
- };
300
- var ho = 0;
301
- function gn(e) {
302
- return typeof e == "function" ? e : me;
303
- }
304
- function me() {
305
- }
306
- function An(e, n) {
307
- if (e) {
308
- var r = fo(e, {
309
- boundary: n,
310
- block: "nearest",
311
- scrollMode: "if-needed"
312
- });
313
- r.forEach(function(i) {
314
- var o = i.el, t = i.top, s = i.left;
315
- o.scrollTop = t, o.scrollLeft = s;
316
- });
317
- }
318
- }
319
- function mn(e, n, r) {
320
- var i = e === n || n instanceof r.Node && e.contains && e.contains(n);
321
- return i;
322
- }
323
- function Ct(e, n) {
324
- var r;
325
- function i() {
326
- r && clearTimeout(r);
327
- }
328
- function o() {
329
- for (var t = arguments.length, s = new Array(t), l = 0; l < t; l++)
330
- s[l] = arguments[l];
331
- i(), r = setTimeout(function() {
332
- r = null, e.apply(void 0, s);
333
- }, n);
334
- }
335
- return o.cancel = i, o;
336
- }
337
- function re() {
338
- for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++)
339
- n[r] = arguments[r];
340
- return function(i) {
341
- for (var o = arguments.length, t = new Array(o > 1 ? o - 1 : 0), s = 1; s < o; s++)
342
- t[s - 1] = arguments[s];
343
- return n.some(function(l) {
344
- return l && l.apply(void 0, [i].concat(t)), i.preventDownshiftDefault || i.hasOwnProperty("nativeEvent") && i.nativeEvent.preventDownshiftDefault;
345
- });
346
- };
347
- }
348
- function Re() {
349
- for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++)
350
- n[r] = arguments[r];
351
- return function(i) {
352
- n.forEach(function(o) {
353
- typeof o == "function" ? o(i) : o && (o.current = i);
354
- });
355
- };
356
- }
357
- function Hn() {
358
- return String(ho++);
359
- }
360
- function jn(e) {
361
- var n = e.isOpen, r = e.resultCount, i = e.previousResultCount;
362
- return n ? r ? r !== i ? r + " result" + (r === 1 ? " is" : "s are") + " available, use up and down arrow keys to navigate. Press Enter key to select." : "" : "No results are available." : "";
363
- }
364
- function vn(e, n) {
365
- return e = Array.isArray(e) ? (
366
- /* istanbul ignore next (preact) */
367
- e[0]
368
- ) : e, !e && n ? n : e;
369
- }
370
- function Kn(e) {
371
- return typeof e.type == "string";
372
- }
373
- function $n(e) {
374
- return e.props;
375
- }
376
- function go(e, n) {
377
- console.error('The property "' + n + '" is required in "' + e + '"');
378
- }
379
- var mo = ["highlightedIndex", "inputValue", "isOpen", "selectedItem", "type"];
380
- function rt(e) {
381
- e === void 0 && (e = {});
382
- var n = {};
383
- return mo.forEach(function(r) {
384
- e.hasOwnProperty(r) && (n[r] = e[r]);
385
- }), n;
386
- }
387
- function Ye(e, n) {
388
- return !e || !n ? e : Object.keys(e).reduce(function(r, i) {
389
- return r[i] = at(n, i) ? n[i] : e[i], r;
390
- }, {});
391
- }
392
- function at(e, n) {
393
- return e[n] !== void 0;
394
- }
395
- function Ge(e) {
396
- var n = e.key, r = e.keyCode;
397
- return r >= 37 && r <= 40 && n.indexOf("Arrow") !== 0 ? "Arrow" + n : n;
398
- }
399
- function vo(e) {
400
- return Object.prototype.toString.call(e) === "[object Object]";
401
- }
402
- function ke(e, n, r, i, o) {
403
- o === void 0 && (o = !1);
404
- var t = r.length;
405
- if (t === 0)
406
- return -1;
407
- var s = t - 1;
408
- (typeof e != "number" || e < 0 || e > s) && (e = n > 0 ? -1 : s + 1);
409
- var l = e + n;
410
- l < 0 ? l = o ? s : 0 : l > s && (l = o ? 0 : s);
411
- var d = Le(l, n < 0, r, i, o);
412
- return d === -1 ? e >= t ? -1 : e : d;
413
- }
414
- function Le(e, n, r, i, o) {
415
- o === void 0 && (o = !1);
416
- var t = r.length;
417
- if (n) {
418
- for (var s = e; s >= 0; s--)
419
- if (!i(r[s], s))
420
- return s;
421
- } else
422
- for (var l = e; l < t; l++)
423
- if (!i(r[l], l))
424
- return l;
425
- return o ? Le(n ? t - 1 : 0, n, r, i) : -1;
426
- }
427
- function lt(e, n, r, i) {
428
- return i === void 0 && (i = !0), r && n.some(function(o) {
429
- return o && (mn(o, e, r) || i && mn(o, r.document.activeElement, r));
430
- });
431
- }
432
- var St = me;
433
- process.env.NODE_ENV !== "production" && (St = function(n, r, i) {
434
- var o = "This prop should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled Downshift element for the lifetime of the component. More info: https://github.com/downshift-js/downshift#control-props";
435
- Object.keys(n).forEach(function(t) {
436
- r[t] !== void 0 && i[t] === void 0 ? console.error('downshift: A component has changed the controlled prop "' + t + '" to be uncontrolled. ' + o) : r[t] === void 0 && i[t] !== void 0 && console.error('downshift: A component has changed the uncontrolled prop "' + t + '" to be controlled. ' + o);
437
- });
438
- });
439
- var _o = Ct(function(e) {
440
- Fn(e).textContent = "";
441
- }, 500);
442
- function Fn(e) {
443
- var n = e.getElementById("a11y-status-message");
444
- return n || (n = e.createElement("div"), n.setAttribute("id", "a11y-status-message"), n.setAttribute("role", "status"), n.setAttribute("aria-live", "polite"), n.setAttribute("aria-relevant", "additions text"), Object.assign(n.style, {
445
- border: "0",
446
- clip: "rect(0 0 0 0)",
447
- height: "1px",
448
- margin: "-1px",
449
- overflow: "hidden",
450
- padding: "0",
451
- position: "absolute",
452
- width: "1px"
453
- }), e.body.appendChild(n), n);
454
- }
455
- function Ot(e, n) {
456
- if (!(!e || !n)) {
457
- var r = Fn(n);
458
- r.textContent = e, _o(n);
459
- }
460
- }
461
- var Ln = process.env.NODE_ENV !== "production" ? "__autocomplete_unknown__" : 0, Bn = process.env.NODE_ENV !== "production" ? "__autocomplete_mouseup__" : 1, Un = process.env.NODE_ENV !== "production" ? "__autocomplete_item_mouseenter__" : 2, ot = process.env.NODE_ENV !== "production" ? "__autocomplete_keydown_arrow_up__" : 3, it = process.env.NODE_ENV !== "production" ? "__autocomplete_keydown_arrow_down__" : 4, qn = process.env.NODE_ENV !== "production" ? "__autocomplete_keydown_escape__" : 5, zn = process.env.NODE_ENV !== "production" ? "__autocomplete_keydown_enter__" : 6, Wn = process.env.NODE_ENV !== "production" ? "__autocomplete_keydown_home__" : 7, Yn = process.env.NODE_ENV !== "production" ? "__autocomplete_keydown_end__" : 8, Gn = process.env.NODE_ENV !== "production" ? "__autocomplete_click_item__" : 9, Xn = process.env.NODE_ENV !== "production" ? "__autocomplete_blur_input__" : 10, Jn = process.env.NODE_ENV !== "production" ? "__autocomplete_change_input__" : 11, Qn = process.env.NODE_ENV !== "production" ? "__autocomplete_keydown_space_button__" : 12, yt = process.env.NODE_ENV !== "production" ? "__autocomplete_click_button__" : 13, Zn = process.env.NODE_ENV !== "production" ? "__autocomplete_blur_button__" : 14, er = process.env.NODE_ENV !== "production" ? "__autocomplete_controlled_prop_updated_selected_item__" : 15, tr = process.env.NODE_ENV !== "production" ? "__autocomplete_touchend__" : 16, Io = /* @__PURE__ */ Object.freeze({
462
- __proto__: null,
463
- unknown: Ln,
464
- mouseUp: Bn,
465
- itemMouseEnter: Un,
466
- keyDownArrowUp: ot,
467
- keyDownArrowDown: it,
468
- keyDownEscape: qn,
469
- keyDownEnter: zn,
470
- keyDownHome: Wn,
471
- keyDownEnd: Yn,
472
- clickItem: Gn,
473
- blurInput: Xn,
474
- changeInput: Jn,
475
- keyDownSpaceButton: Qn,
476
- clickButton: yt,
477
- blurButton: Zn,
478
- controlledPropUpdatedSelectedItem: er,
479
- touchEnd: tr
480
- }), yo = ["refKey", "ref"], xo = ["onClick", "onPress", "onKeyDown", "onKeyUp", "onBlur"], bo = ["onKeyDown", "onBlur", "onChange", "onInput", "onChangeText"], wo = ["refKey", "ref"], Eo = ["onMouseMove", "onMouseDown", "onClick", "onPress", "index", "item"], Co = /* @__PURE__ */ function() {
481
- var e = /* @__PURE__ */ function(n) {
482
- jr(r, n);
483
- function r(o) {
484
- var t;
485
- t = n.call(this, o) || this, t.id = t.props.id || "downshift-" + Hn(), t.menuId = t.props.menuId || t.id + "-menu", t.labelId = t.props.labelId || t.id + "-label", t.inputId = t.props.inputId || t.id + "-input", t.getItemId = t.props.getItemId || function(c) {
486
- return t.id + "-item-" + c;
487
- }, t.items = [], t.itemCount = null, t.previousResultCount = 0, t.timeoutIds = [], t.internalSetTimeout = function(c, f) {
488
- var p = setTimeout(function() {
489
- t.timeoutIds = t.timeoutIds.filter(function(I) {
490
- return I !== p;
491
- }), c();
492
- }, f);
493
- t.timeoutIds.push(p);
494
- }, t.setItemCount = function(c) {
495
- t.itemCount = c;
496
- }, t.unsetItemCount = function() {
497
- t.itemCount = null;
498
- }, t.isItemDisabled = function(c, f) {
499
- var p = t.getItemNodeFromIndex(f);
500
- return p && p.hasAttribute("disabled");
501
- }, t.setHighlightedIndex = function(c, f) {
502
- c === void 0 && (c = t.props.defaultHighlightedIndex), f === void 0 && (f = {}), f = rt(f), t.internalSetState($({
503
- highlightedIndex: c
504
- }, f));
505
- }, t.clearSelection = function(c) {
506
- t.internalSetState({
507
- selectedItem: null,
508
- inputValue: "",
509
- highlightedIndex: t.props.defaultHighlightedIndex,
510
- isOpen: t.props.defaultIsOpen
511
- }, c);
512
- }, t.selectItem = function(c, f, p) {
513
- f = rt(f), t.internalSetState($({
514
- isOpen: t.props.defaultIsOpen,
515
- highlightedIndex: t.props.defaultHighlightedIndex,
516
- selectedItem: c,
517
- inputValue: t.props.itemToString(c)
518
- }, f), p);
519
- }, t.selectItemAtIndex = function(c, f, p) {
520
- var I = t.items[c];
521
- I != null && t.selectItem(I, f, p);
522
- }, t.selectHighlightedItem = function(c, f) {
523
- return t.selectItemAtIndex(t.getState().highlightedIndex, c, f);
524
- }, t.internalSetState = function(c, f) {
525
- var p, I, m = {}, N = typeof c == "function";
526
- return !N && c.hasOwnProperty("inputValue") && t.props.onInputValueChange(c.inputValue, $({}, t.getStateAndHelpers(), c)), t.setState(function(E) {
527
- var k;
528
- E = t.getState(E);
529
- var M = N ? c(E) : c;
530
- M = t.props.stateReducer(E, M), p = M.hasOwnProperty("selectedItem");
531
- var O = {};
532
- return p && M.selectedItem !== E.selectedItem && (I = M.selectedItem), (k = M).type || (k.type = Ln), Object.keys(M).forEach(function(P) {
533
- E[P] !== M[P] && (m[P] = M[P]), P !== "type" && (M[P], at(t.props, P) || (O[P] = M[P]));
534
- }), N && M.hasOwnProperty("inputValue") && t.props.onInputValueChange(M.inputValue, $({}, t.getStateAndHelpers(), M)), O;
535
- }, function() {
536
- gn(f)();
537
- var E = Object.keys(m).length > 1;
538
- E && t.props.onStateChange(m, t.getStateAndHelpers()), p && t.props.onSelect(c.selectedItem, t.getStateAndHelpers()), I !== void 0 && t.props.onChange(I, t.getStateAndHelpers()), t.props.onUserAction(m, t.getStateAndHelpers());
539
- });
540
- }, t.rootRef = function(c) {
541
- return t._rootNode = c;
542
- }, t.getRootProps = function(c, f) {
543
- var p, I = c === void 0 ? {} : c, m = I.refKey, N = m === void 0 ? "ref" : m, E = I.ref, k = ve(I, yo), M = f === void 0 ? {} : f, O = M.suppressRefError, P = O === void 0 ? !1 : O;
544
- t.getRootProps.called = !0, t.getRootProps.refKey = N, t.getRootProps.suppressRefError = P;
545
- var V = t.getState(), R = V.isOpen;
546
- return $((p = {}, p[N] = Re(E, t.rootRef), p.role = "combobox", p["aria-expanded"] = R, p["aria-haspopup"] = "listbox", p["aria-owns"] = R ? t.menuId : void 0, p["aria-labelledby"] = t.labelId, p), k);
547
- }, t.keyDownHandlers = {
548
- ArrowDown: function(f) {
549
- var p = this;
550
- if (f.preventDefault(), this.getState().isOpen) {
551
- var I = f.shiftKey ? 5 : 1;
552
- this.moveHighlightedIndex(I, {
553
- type: it
554
- });
555
- } else
556
- this.internalSetState({
557
- isOpen: !0,
558
- type: it
559
- }, function() {
560
- var m = p.getItemCount();
561
- if (m > 0) {
562
- var N = p.getState(), E = N.highlightedIndex, k = ke(E, 1, {
563
- length: m
564
- }, p.isItemDisabled, !0);
565
- p.setHighlightedIndex(k, {
566
- type: it
567
- });
568
- }
569
- });
570
- },
571
- ArrowUp: function(f) {
572
- var p = this;
573
- if (f.preventDefault(), this.getState().isOpen) {
574
- var I = f.shiftKey ? -5 : -1;
575
- this.moveHighlightedIndex(I, {
576
- type: ot
577
- });
578
- } else
579
- this.internalSetState({
580
- isOpen: !0,
581
- type: ot
582
- }, function() {
583
- var m = p.getItemCount();
584
- if (m > 0) {
585
- var N = p.getState(), E = N.highlightedIndex, k = ke(E, -1, {
586
- length: m
587
- }, p.isItemDisabled, !0);
588
- p.setHighlightedIndex(k, {
589
- type: ot
590
- });
591
- }
592
- });
593
- },
594
- Enter: function(f) {
595
- if (f.which !== 229) {
596
- var p = this.getState(), I = p.isOpen, m = p.highlightedIndex;
597
- if (I && m != null) {
598
- f.preventDefault();
599
- var N = this.items[m], E = this.getItemNodeFromIndex(m);
600
- if (N == null || E && E.hasAttribute("disabled"))
601
- return;
602
- this.selectHighlightedItem({
603
- type: zn
604
- });
605
- }
606
- }
607
- },
608
- Escape: function(f) {
609
- f.preventDefault(), this.reset($({
610
- type: qn
611
- }, !this.state.isOpen && {
612
- selectedItem: null,
613
- inputValue: ""
614
- }));
615
- }
616
- }, t.buttonKeyDownHandlers = $({}, t.keyDownHandlers, {
617
- " ": function(f) {
618
- f.preventDefault(), this.toggleMenu({
619
- type: Qn
620
- });
621
- }
622
- }), t.inputKeyDownHandlers = $({}, t.keyDownHandlers, {
623
- Home: function(f) {
624
- var p = this.getState(), I = p.isOpen;
625
- if (I) {
626
- f.preventDefault();
627
- var m = this.getItemCount();
628
- if (!(m <= 0 || !I)) {
629
- var N = Le(0, !1, {
630
- length: m
631
- }, this.isItemDisabled);
632
- this.setHighlightedIndex(N, {
633
- type: Wn
634
- });
635
- }
636
- }
637
- },
638
- End: function(f) {
639
- var p = this.getState(), I = p.isOpen;
640
- if (I) {
641
- f.preventDefault();
642
- var m = this.getItemCount();
643
- if (!(m <= 0 || !I)) {
644
- var N = Le(m - 1, !0, {
645
- length: m
646
- }, this.isItemDisabled);
647
- this.setHighlightedIndex(N, {
648
- type: Yn
649
- });
650
- }
651
- }
652
- }
653
- }), t.getToggleButtonProps = function(c) {
654
- var f = c === void 0 ? {} : c, p = f.onClick;
655
- f.onPress;
656
- var I = f.onKeyDown, m = f.onKeyUp, N = f.onBlur, E = ve(f, xo), k = t.getState(), M = k.isOpen, O = {
657
- onClick: re(p, t.buttonHandleClick),
658
- onKeyDown: re(I, t.buttonHandleKeyDown),
659
- onKeyUp: re(m, t.buttonHandleKeyUp),
660
- onBlur: re(N, t.buttonHandleBlur)
661
- }, P = E.disabled ? {} : O;
662
- return $({
663
- type: "button",
664
- role: "button",
665
- "aria-label": M ? "close menu" : "open menu",
666
- "aria-haspopup": !0,
667
- "data-toggle": !0
668
- }, P, E);
669
- }, t.buttonHandleKeyUp = function(c) {
670
- c.preventDefault();
671
- }, t.buttonHandleKeyDown = function(c) {
672
- var f = Ge(c);
673
- t.buttonKeyDownHandlers[f] && t.buttonKeyDownHandlers[f].call(un(t), c);
674
- }, t.buttonHandleClick = function(c) {
675
- if (c.preventDefault(), t.props.environment) {
676
- var f = t.props.environment.document, p = f.body, I = f.activeElement;
677
- p && p === I && c.target.focus();
678
- }
679
- process.env.NODE_ENV === "test" ? t.toggleMenu({
680
- type: yt
681
- }) : t.internalSetTimeout(function() {
682
- return t.toggleMenu({
683
- type: yt
684
- });
685
- });
686
- }, t.buttonHandleBlur = function(c) {
687
- var f = c.target;
688
- t.internalSetTimeout(function() {
689
- if (!(t.isMouseDown || !t.props.environment)) {
690
- var p = t.props.environment.document.activeElement;
691
- (p == null || p.id !== t.inputId) && p !== f && t.reset({
692
- type: Zn
693
- });
694
- }
695
- });
696
- }, t.getLabelProps = function(c) {
697
- return $({
698
- htmlFor: t.inputId,
699
- id: t.labelId
700
- }, c);
701
- }, t.getInputProps = function(c) {
702
- var f = c === void 0 ? {} : c, p = f.onKeyDown, I = f.onBlur, m = f.onChange, N = f.onInput;
703
- f.onChangeText;
704
- var E = ve(f, bo), k, M = {};
705
- k = "onChange";
706
- var O = t.getState(), P = O.inputValue, V = O.isOpen, R = O.highlightedIndex;
707
- if (!E.disabled) {
708
- var F;
709
- M = (F = {}, F[k] = re(m, N, t.inputHandleChange), F.onKeyDown = re(p, t.inputHandleKeyDown), F.onBlur = re(I, t.inputHandleBlur), F);
710
- }
711
- return $({
712
- "aria-autocomplete": "list",
713
- "aria-activedescendant": V && typeof R == "number" && R >= 0 ? t.getItemId(R) : void 0,
714
- "aria-controls": V ? t.menuId : void 0,
715
- "aria-labelledby": E && E["aria-label"] ? void 0 : t.labelId,
716
- // https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion
717
- // revert back since autocomplete="nope" is ignored on latest Chrome and Opera
718
- autoComplete: "off",
719
- value: P,
720
- id: t.inputId
721
- }, M, E);
722
- }, t.inputHandleKeyDown = function(c) {
723
- var f = Ge(c);
724
- f && t.inputKeyDownHandlers[f] && t.inputKeyDownHandlers[f].call(un(t), c);
725
- }, t.inputHandleChange = function(c) {
726
- t.internalSetState({
727
- type: Jn,
728
- isOpen: !0,
729
- inputValue: c.target.value,
730
- highlightedIndex: t.props.defaultHighlightedIndex
731
- });
732
- }, t.inputHandleBlur = function() {
733
- t.internalSetTimeout(function() {
734
- var c;
735
- if (!(t.isMouseDown || !t.props.environment)) {
736
- var f = t.props.environment.document.activeElement, p = (f == null || (c = f.dataset) == null ? void 0 : c.toggle) && t._rootNode && t._rootNode.contains(f);
737
- p || t.reset({
738
- type: Xn
739
- });
740
- }
741
- });
742
- }, t.menuRef = function(c) {
743
- t._menuNode = c;
744
- }, t.getMenuProps = function(c, f) {
745
- var p, I = c === void 0 ? {} : c, m = I.refKey, N = m === void 0 ? "ref" : m, E = I.ref, k = ve(I, wo), M = f === void 0 ? {} : f, O = M.suppressRefError, P = O === void 0 ? !1 : O;
746
- return t.getMenuProps.called = !0, t.getMenuProps.refKey = N, t.getMenuProps.suppressRefError = P, $((p = {}, p[N] = Re(E, t.menuRef), p.role = "listbox", p["aria-labelledby"] = k && k["aria-label"] ? void 0 : t.labelId, p.id = t.menuId, p), k);
747
- }, t.getItemProps = function(c) {
748
- var f, p = c === void 0 ? {} : c, I = p.onMouseMove, m = p.onMouseDown, N = p.onClick;
749
- p.onPress;
750
- var E = p.index, k = p.item, M = k === void 0 ? process.env.NODE_ENV === "production" ? (
751
- /* istanbul ignore next */
752
- void 0
753
- ) : go("getItemProps", "item") : k, O = ve(p, Eo);
754
- E === void 0 ? (t.items.push(M), E = t.items.indexOf(M)) : t.items[E] = M;
755
- var P = "onClick", V = N, R = (f = {
756
- // onMouseMove is used over onMouseEnter here. onMouseMove
757
- // is only triggered on actual mouse movement while onMouseEnter
758
- // can fire on DOM changes, interrupting keyboard navigation
759
- onMouseMove: re(I, function() {
760
- E !== t.getState().highlightedIndex && (t.setHighlightedIndex(E, {
761
- type: Un
762
- }), t.avoidScrolling = !0, t.internalSetTimeout(function() {
763
- return t.avoidScrolling = !1;
764
- }, 250));
765
- }),
766
- onMouseDown: re(m, function(L) {
767
- L.preventDefault();
768
- })
769
- }, f[P] = re(V, function() {
770
- t.selectItemAtIndex(E, {
771
- type: Gn
772
- });
773
- }), f), F = O.disabled ? {
774
- onMouseDown: R.onMouseDown
775
- } : R;
776
- return $({
777
- id: t.getItemId(E),
778
- role: "option",
779
- "aria-selected": t.getState().highlightedIndex === E
780
- }, F, O);
781
- }, t.clearItems = function() {
782
- t.items = [];
783
- }, t.reset = function(c, f) {
784
- c === void 0 && (c = {}), c = rt(c), t.internalSetState(function(p) {
785
- var I = p.selectedItem;
786
- return $({
787
- isOpen: t.props.defaultIsOpen,
788
- highlightedIndex: t.props.defaultHighlightedIndex,
789
- inputValue: t.props.itemToString(I)
790
- }, c);
791
- }, f);
792
- }, t.toggleMenu = function(c, f) {
793
- c === void 0 && (c = {}), c = rt(c), t.internalSetState(function(p) {
794
- var I = p.isOpen;
795
- return $({
796
- isOpen: !I
797
- }, I && {
798
- highlightedIndex: t.props.defaultHighlightedIndex
799
- }, c);
800
- }, function() {
801
- var p = t.getState(), I = p.isOpen, m = p.highlightedIndex;
802
- I && t.getItemCount() > 0 && typeof m == "number" && t.setHighlightedIndex(m, c), gn(f)();
803
- });
804
- }, t.openMenu = function(c) {
805
- t.internalSetState({
806
- isOpen: !0
807
- }, c);
808
- }, t.closeMenu = function(c) {
809
- t.internalSetState({
810
- isOpen: !1
811
- }, c);
812
- }, t.updateStatus = Ct(function() {
813
- var c;
814
- if ((c = t.props) != null && (c = c.environment) != null && c.document) {
815
- var f = t.getState(), p = t.items[f.highlightedIndex], I = t.getItemCount(), m = t.props.getA11yStatusMessage($({
816
- itemToString: t.props.itemToString,
817
- previousResultCount: t.previousResultCount,
818
- resultCount: I,
819
- highlightedItem: p
820
- }, f));
821
- t.previousResultCount = I, Ot(m, t.props.environment.document);
822
- }
823
- }, 200);
824
- var s = t.props, l = s.defaultHighlightedIndex, d = s.initialHighlightedIndex, u = d === void 0 ? l : d, a = s.defaultIsOpen, h = s.initialIsOpen, b = h === void 0 ? a : h, _ = s.initialInputValue, x = _ === void 0 ? "" : _, S = s.initialSelectedItem, g = S === void 0 ? null : S, D = t.getState({
825
- highlightedIndex: u,
826
- isOpen: b,
827
- inputValue: x,
828
- selectedItem: g
829
- });
830
- return D.selectedItem != null && t.props.initialInputValue === void 0 && (D.inputValue = t.props.itemToString(D.selectedItem)), t.state = D, t;
831
- }
832
- var i = r.prototype;
833
- return i.internalClearTimeouts = function() {
834
- this.timeoutIds.forEach(function(t) {
835
- clearTimeout(t);
836
- }), this.timeoutIds = [];
837
- }, i.getState = function(t) {
838
- return t === void 0 && (t = this.state), Ye(t, this.props);
839
- }, i.getItemCount = function() {
840
- var t = this.items.length;
841
- return this.itemCount != null ? t = this.itemCount : this.props.itemCount !== void 0 && (t = this.props.itemCount), t;
842
- }, i.getItemNodeFromIndex = function(t) {
843
- return this.props.environment ? this.props.environment.document.getElementById(this.getItemId(t)) : null;
844
- }, i.scrollHighlightedItemIntoView = function() {
845
- {
846
- var t = this.getItemNodeFromIndex(this.getState().highlightedIndex);
847
- this.props.scrollIntoView(t, this._menuNode);
848
- }
849
- }, i.moveHighlightedIndex = function(t, s) {
850
- var l = this.getItemCount(), d = this.getState(), u = d.highlightedIndex;
851
- if (l > 0) {
852
- var a = ke(u, t, {
853
- length: l
854
- }, this.isItemDisabled, !0);
855
- this.setHighlightedIndex(a, s);
856
- }
857
- }, i.getStateAndHelpers = function() {
858
- var t = this.getState(), s = t.highlightedIndex, l = t.inputValue, d = t.selectedItem, u = t.isOpen, a = this.props.itemToString, h = this.id, b = this.getRootProps, _ = this.getToggleButtonProps, x = this.getLabelProps, S = this.getMenuProps, g = this.getInputProps, D = this.getItemProps, c = this.openMenu, f = this.closeMenu, p = this.toggleMenu, I = this.selectItem, m = this.selectItemAtIndex, N = this.selectHighlightedItem, E = this.setHighlightedIndex, k = this.clearSelection, M = this.clearItems, O = this.reset, P = this.setItemCount, V = this.unsetItemCount, R = this.internalSetState;
859
- return {
860
- // prop getters
861
- getRootProps: b,
862
- getToggleButtonProps: _,
863
- getLabelProps: x,
864
- getMenuProps: S,
865
- getInputProps: g,
866
- getItemProps: D,
867
- // actions
868
- reset: O,
869
- openMenu: c,
870
- closeMenu: f,
871
- toggleMenu: p,
872
- selectItem: I,
873
- selectItemAtIndex: m,
874
- selectHighlightedItem: N,
875
- setHighlightedIndex: E,
876
- clearSelection: k,
877
- clearItems: M,
878
- setItemCount: P,
879
- unsetItemCount: V,
880
- setState: R,
881
- // props
882
- itemToString: a,
883
- // derived
884
- id: h,
885
- // state
886
- highlightedIndex: s,
887
- inputValue: l,
888
- isOpen: u,
889
- selectedItem: d
890
- };
891
- }, i.componentDidMount = function() {
892
- var t = this;
893
- if (process.env.NODE_ENV !== "production" && this.getMenuProps.called && !this.getMenuProps.suppressRefError && _n(this._menuNode, this.getMenuProps), !this.props.environment)
894
- this.cleanup = function() {
895
- t.internalClearTimeouts();
896
- };
897
- else {
898
- var s = function() {
899
- t.isMouseDown = !0;
900
- }, l = function(_) {
901
- t.isMouseDown = !1;
902
- var x = lt(_.target, [t._rootNode, t._menuNode], t.props.environment);
903
- !x && t.getState().isOpen && t.reset({
904
- type: Bn
905
- }, function() {
906
- return t.props.onOuterClick(t.getStateAndHelpers());
907
- });
908
- }, d = function() {
909
- t.isTouchMove = !1;
910
- }, u = function() {
911
- t.isTouchMove = !0;
912
- }, a = function(_) {
913
- var x = lt(_.target, [t._rootNode, t._menuNode], t.props.environment, !1);
914
- !t.isTouchMove && !x && t.getState().isOpen && t.reset({
915
- type: tr
916
- }, function() {
917
- return t.props.onOuterClick(t.getStateAndHelpers());
918
- });
919
- }, h = this.props.environment;
920
- h.addEventListener("mousedown", s), h.addEventListener("mouseup", l), h.addEventListener("touchstart", d), h.addEventListener("touchmove", u), h.addEventListener("touchend", a), this.cleanup = function() {
921
- t.internalClearTimeouts(), t.updateStatus.cancel(), h.removeEventListener("mousedown", s), h.removeEventListener("mouseup", l), h.removeEventListener("touchstart", d), h.removeEventListener("touchmove", u), h.removeEventListener("touchend", a);
922
- };
923
- }
924
- }, i.shouldScroll = function(t, s) {
925
- var l = this.props.highlightedIndex === void 0 ? this.getState() : this.props, d = l.highlightedIndex, u = s.highlightedIndex === void 0 ? t : s, a = u.highlightedIndex, h = d && this.getState().isOpen && !t.isOpen, b = d !== a;
926
- return h || b;
927
- }, i.componentDidUpdate = function(t, s) {
928
- process.env.NODE_ENV !== "production" && (St(this.state, t, this.props), this.getMenuProps.called && !this.getMenuProps.suppressRefError && _n(this._menuNode, this.getMenuProps)), at(this.props, "selectedItem") && this.props.selectedItemChanged(t.selectedItem, this.props.selectedItem) && this.internalSetState({
929
- type: er,
930
- inputValue: this.props.itemToString(this.props.selectedItem)
931
- }), !this.avoidScrolling && this.shouldScroll(s, t) && this.scrollHighlightedItemIntoView(), this.updateStatus();
932
- }, i.componentWillUnmount = function() {
933
- this.cleanup();
934
- }, i.render = function() {
935
- var t = vn(this.props.children, me);
936
- this.clearItems(), this.getRootProps.called = !1, this.getRootProps.refKey = void 0, this.getRootProps.suppressRefError = void 0, this.getMenuProps.called = !1, this.getMenuProps.refKey = void 0, this.getMenuProps.suppressRefError = void 0, this.getLabelProps.called = !1, this.getInputProps.called = !1;
937
- var s = vn(t(this.getStateAndHelpers()));
938
- if (!s)
939
- return null;
940
- if (this.getRootProps.called || this.props.suppressRefError)
941
- return process.env.NODE_ENV !== "production" && !this.getRootProps.suppressRefError && !this.props.suppressRefError && So(s, this.getRootProps), s;
942
- if (Kn(s))
943
- return /* @__PURE__ */ Fr(s, this.getRootProps($n(s)));
944
- if (process.env.NODE_ENV !== "production")
945
- throw new Error("downshift: If you return a non-DOM element, you must apply the getRootProps function");
946
- }, r;
947
- }(Lr);
948
- return e.defaultProps = {
949
- defaultHighlightedIndex: null,
950
- defaultIsOpen: !1,
951
- getA11yStatusMessage: jn,
952
- itemToString: function(r) {
953
- return r == null ? "" : (process.env.NODE_ENV !== "production" && vo(r) && !r.hasOwnProperty("toString") && console.warn("downshift: An object was passed to the default implementation of `itemToString`. You should probably provide your own `itemToString` implementation. Please refer to the `itemToString` API documentation.", "The object that was passed:", r), String(r));
954
- },
955
- onStateChange: me,
956
- onInputValueChange: me,
957
- onUserAction: me,
958
- onChange: me,
959
- onSelect: me,
960
- onOuterClick: me,
961
- selectedItemChanged: function(r, i) {
962
- return r !== i;
963
- },
964
- environment: (
965
- /* istanbul ignore next (ssr) */
966
- typeof window > "u" ? void 0 : window
967
- ),
968
- stateReducer: function(r, i) {
969
- return i;
970
- },
971
- suppressRefError: !1,
972
- scrollIntoView: An
973
- }, e.stateChangeTypes = Io, e;
974
- }();
975
- process.env.NODE_ENV !== "production" && (Co.propTypes = {
976
- children: y.func,
977
- defaultHighlightedIndex: y.number,
978
- defaultIsOpen: y.bool,
979
- initialHighlightedIndex: y.number,
980
- initialSelectedItem: y.any,
981
- initialInputValue: y.string,
982
- initialIsOpen: y.bool,
983
- getA11yStatusMessage: y.func,
984
- itemToString: y.func,
985
- onChange: y.func,
986
- onSelect: y.func,
987
- onStateChange: y.func,
988
- onInputValueChange: y.func,
989
- onUserAction: y.func,
990
- onOuterClick: y.func,
991
- selectedItemChanged: y.func,
992
- stateReducer: y.func,
993
- itemCount: y.number,
994
- id: y.string,
995
- environment: y.shape({
996
- addEventListener: y.func.isRequired,
997
- removeEventListener: y.func.isRequired,
998
- document: y.shape({
999
- createElement: y.func.isRequired,
1000
- getElementById: y.func.isRequired,
1001
- activeElement: y.any.isRequired,
1002
- body: y.any.isRequired
1003
- }).isRequired,
1004
- Node: y.func.isRequired
1005
- }),
1006
- suppressRefError: y.bool,
1007
- scrollIntoView: y.func,
1008
- // things we keep in state for uncontrolled components
1009
- // but can accept as props for controlled components
1010
- /* eslint-disable react/no-unused-prop-types */
1011
- selectedItem: y.any,
1012
- isOpen: y.bool,
1013
- inputValue: y.string,
1014
- highlightedIndex: y.number,
1015
- labelId: y.string,
1016
- inputId: y.string,
1017
- menuId: y.string,
1018
- getItemId: y.func
1019
- /* eslint-enable react/no-unused-prop-types */
1020
- });
1021
- function _n(e, n) {
1022
- var r = n.refKey;
1023
- e || console.error('downshift: The ref prop "' + r + '" from getMenuProps was not applied correctly on your menu element.');
1024
- }
1025
- function So(e, n) {
1026
- var r = n.refKey, i = r !== "ref", o = !Kn(e);
1027
- o && !i && !pn.isForwardRef(e) ? console.error("downshift: You returned a non-DOM element. You must specify a refKey in getRootProps") : !o && i && console.error('downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified "' + r + '"'), !pn.isForwardRef(e) && !$n(e)[r] && console.error('downshift: You must apply the ref prop "' + r + '" from getRootProps onto your root element.');
1028
- }
1029
- var Oo = ["highlightedIndex", "items", "environment"], nr = {
1030
- highlightedIndex: -1,
1031
- isOpen: !1,
1032
- selectedItem: null,
1033
- inputValue: ""
1034
- };
1035
- function Do(e, n, r) {
1036
- var i = e.props, o = e.type, t = {};
1037
- Object.keys(n).forEach(function(s) {
1038
- No(s, e, n, r), r[s] !== n[s] && (t[s] = r[s]);
1039
- }), i.onStateChange && Object.keys(t).length && i.onStateChange($({
1040
- type: o
1041
- }, t));
1042
- }
1043
- function No(e, n, r, i) {
1044
- var o = n.props, t = n.type, s = "on" + Dt(e) + "Change";
1045
- o[s] && i[e] !== void 0 && i[e] !== r[e] && o[s]($({
1046
- type: t
1047
- }, i));
1048
- }
1049
- function Ro(e, n) {
1050
- return n.changes;
1051
- }
1052
- function Po(e) {
1053
- var n = e.selectedItem, r = e.itemToString;
1054
- return n ? r(n) + " has been selected." : "";
1055
- }
1056
- var ko = Ct(function(e, n) {
1057
- Ot(e(), n);
1058
- }, 200), Mo = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? wt : de, To = "useId" in st ? function(n) {
1059
- var r = n.id, i = n.labelId, o = n.menuId, t = n.getItemId, s = n.toggleButtonId, l = n.inputId, d = "downshift-" + st.useId();
1060
- r || (r = d);
1061
- var u = Q({
1062
- labelId: i || r + "-label",
1063
- menuId: o || r + "-menu",
1064
- getItemId: t || function(a) {
1065
- return r + "-item-" + a;
1066
- },
1067
- toggleButtonId: s || r + "-toggle-button",
1068
- inputId: l || r + "-input"
1069
- });
1070
- return u.current;
1071
- } : function(n) {
1072
- var r = n.id, i = r === void 0 ? "downshift-" + Hn() : r, o = n.labelId, t = n.menuId, s = n.getItemId, l = n.toggleButtonId, d = n.inputId, u = Q({
1073
- labelId: o || i + "-label",
1074
- menuId: t || i + "-menu",
1075
- getItemId: s || function(a) {
1076
- return i + "-item-" + a;
1077
- },
1078
- toggleButtonId: l || i + "-toggle-button",
1079
- inputId: d || i + "-input"
1080
- });
1081
- return u.current;
1082
- };
1083
- function rr(e, n, r, i) {
1084
- var o, t;
1085
- if (e === void 0) {
1086
- if (n === void 0)
1087
- throw new Error(i);
1088
- o = r[n], t = n;
1089
- } else
1090
- t = n === void 0 ? r.indexOf(e) : n, o = e;
1091
- return [o, t];
1092
- }
1093
- function Dt(e) {
1094
- return "" + e.slice(0, 1).toUpperCase() + e.slice(1);
1095
- }
1096
- function Nt(e) {
1097
- var n = Q(e);
1098
- return n.current = e, n;
1099
- }
1100
- function or(e, n, r, i) {
1101
- var o = Q(), t = Q(), s = ee(function(_, x) {
1102
- t.current = x, _ = Ye(_, x.props);
1103
- var S = e(_, x), g = x.props.stateReducer(_, $({}, x, {
1104
- changes: S
1105
- }));
1106
- return g;
1107
- }, [e]), l = Br(s, n, r), d = l[0], u = l[1], a = Nt(n), h = ee(function(_) {
1108
- return u($({
1109
- props: a.current
1110
- }, _));
1111
- }, [a]), b = t.current;
1112
- return de(function() {
1113
- var _ = Ye(o.current, b == null ? void 0 : b.props), x = b && o.current && !i(_, d);
1114
- x && Do(b, _, d), o.current = d;
1115
- }, [d, b, i]), [d, h];
1116
- }
1117
- function Vo(e, n, r, i) {
1118
- var o = or(e, n, r, i), t = o[0], s = o[1];
1119
- return [Ye(t, n), s];
1120
- }
1121
- var je = {
1122
- itemToString: function(n) {
1123
- return n ? String(n) : "";
1124
- },
1125
- itemToKey: function(n) {
1126
- return n;
1127
- },
1128
- stateReducer: Ro,
1129
- getA11ySelectionMessage: Po,
1130
- scrollIntoView: An,
1131
- environment: (
1132
- /* istanbul ignore next (ssr) */
1133
- typeof window > "u" ? void 0 : window
1134
- )
1135
- };
1136
- function be(e, n, r) {
1137
- r === void 0 && (r = nr);
1138
- var i = e["default" + Dt(n)];
1139
- return i !== void 0 ? i : r[n];
1140
- }
1141
- function Ke(e, n, r) {
1142
- r === void 0 && (r = nr);
1143
- var i = e[n];
1144
- if (i !== void 0)
1145
- return i;
1146
- var o = e["initial" + Dt(n)];
1147
- return o !== void 0 ? o : be(e, n, r);
1148
- }
1149
- function Ao(e) {
1150
- var n = Ke(e, "selectedItem"), r = Ke(e, "isOpen"), i = Ke(e, "highlightedIndex"), o = Ke(e, "inputValue");
1151
- return {
1152
- highlightedIndex: i < 0 && n && r ? e.items.findIndex(function(t) {
1153
- return e.itemToKey(t) === e.itemToKey(n);
1154
- }) : i,
1155
- isOpen: r,
1156
- selectedItem: n,
1157
- inputValue: o
1158
- };
1159
- }
1160
- function ze(e, n, r) {
1161
- var i = e.items, o = e.initialHighlightedIndex, t = e.defaultHighlightedIndex, s = e.itemToKey, l = n.selectedItem, d = n.highlightedIndex;
1162
- return i.length === 0 ? -1 : o !== void 0 && d === o ? o : t !== void 0 ? t : l ? i.findIndex(function(u) {
1163
- return s(l) === s(u);
1164
- }) : r === 0 ? -1 : r < 0 ? i.length - 1 : 0;
1165
- }
1166
- function Ho(e, n, r) {
1167
- var i = Q({
1168
- isMouseDown: !1,
1169
- isTouchMove: !1,
1170
- isTouchEnd: !1
1171
- });
1172
- return de(function() {
1173
- if (!e)
1174
- return me;
1175
- var o = n.map(function(a) {
1176
- return a.current;
1177
- });
1178
- function t() {
1179
- i.current.isTouchEnd = !1, i.current.isMouseDown = !0;
1180
- }
1181
- function s(a) {
1182
- i.current.isMouseDown = !1, lt(a.target, o, e) || r();
1183
- }
1184
- function l() {
1185
- i.current.isTouchEnd = !1, i.current.isTouchMove = !1;
1186
- }
1187
- function d() {
1188
- i.current.isTouchMove = !0;
1189
- }
1190
- function u(a) {
1191
- i.current.isTouchEnd = !0, !i.current.isTouchMove && !lt(a.target, o, e, !1) && r();
1192
- }
1193
- return e.addEventListener("mousedown", t), e.addEventListener("mouseup", s), e.addEventListener("touchstart", l), e.addEventListener("touchmove", d), e.addEventListener("touchend", u), function() {
1194
- e.removeEventListener("mousedown", t), e.removeEventListener("mouseup", s), e.removeEventListener("touchstart", l), e.removeEventListener("touchmove", d), e.removeEventListener("touchend", u);
1195
- };
1196
- }, [e, r]), i.current;
1197
- }
1198
- var Rt = function() {
1199
- return me;
1200
- };
1201
- process.env.NODE_ENV !== "production" && (Rt = function() {
1202
- for (var n = Q(!0), r = arguments.length, i = new Array(r), o = 0; o < r; o++)
1203
- i[o] = arguments[o];
1204
- var t = Q(i.reduce(function(l, d) {
1205
- return l[d] = {}, l;
1206
- }, {}));
1207
- de(function() {
1208
- Object.keys(t.current).forEach(function(l) {
1209
- var d = t.current[l];
1210
- if (n.current && !Object.keys(d).length) {
1211
- console.error("downshift: You forgot to call the " + l + " getter function on your component / element.");
1212
- return;
1213
- }
1214
- var u = d.suppressRefError, a = d.refKey, h = d.elementRef;
1215
- (!h || !h.current) && !u && console.error('downshift: The ref prop "' + a + '" from ' + l + " was not applied correctly on your element.");
1216
- }), n.current = !1;
1217
- });
1218
- var s = ee(function(l, d, u, a) {
1219
- t.current[l] = {
1220
- suppressRefError: d,
1221
- refKey: u,
1222
- elementRef: a
1223
- };
1224
- }, []);
1225
- return s;
1226
- });
1227
- function In(e, n, r) {
1228
- var i = r.highlightedIndex, o = r.items, t = r.environment, s = ve(r, Oo), l = Xe();
1229
- de(function() {
1230
- l || !(t != null && t.document) || ko(function() {
1231
- return e($({
1232
- highlightedIndex: i,
1233
- highlightedItem: o[i],
1234
- resultCount: o.length
1235
- }, s));
1236
- }, t.document);
1237
- }, n);
1238
- }
1239
- function jo(e) {
1240
- var n = e.highlightedIndex, r = e.isOpen, i = e.itemRefs, o = e.getItemNodeFromIndex, t = e.menuElement, s = e.scrollIntoView, l = Q(!0);
1241
- return Mo(function() {
1242
- n < 0 || !r || !Object.keys(i.current).length || (l.current === !1 ? l.current = !0 : s(o(n), t));
1243
- }, [n]), l;
1244
- }
1245
- var Pt = me;
1246
- process.env.NODE_ENV !== "production" && (Pt = function(n) {
1247
- var r = n.props, i = n.state, o = Q(r), t = Xe();
1248
- de(function() {
1249
- t || (St(i, o.current, r), o.current = r);
1250
- }, [i, r, t]);
1251
- });
1252
- function yn(e, n, r) {
1253
- var i;
1254
- r === void 0 && (r = !0);
1255
- var o = ((i = e.items) == null ? void 0 : i.length) && n >= 0;
1256
- return $({
1257
- isOpen: !1,
1258
- highlightedIndex: -1
1259
- }, o && $({
1260
- selectedItem: e.items[n],
1261
- isOpen: be(e, "isOpen"),
1262
- highlightedIndex: be(e, "highlightedIndex")
1263
- }, r && {
1264
- inputValue: e.itemToString(e.items[n])
1265
- }));
1266
- }
1267
- function Ko(e, n) {
1268
- return e.isOpen === n.isOpen && e.inputValue === n.inputValue && e.highlightedIndex === n.highlightedIndex && e.selectedItem === n.selectedItem;
1269
- }
1270
- function Xe() {
1271
- var e = st.useRef(!0);
1272
- return st.useEffect(function() {
1273
- return e.current = !1, function() {
1274
- e.current = !0;
1275
- };
1276
- }, []), e.current;
1277
- }
1278
- var ir = {
1279
- environment: y.shape({
1280
- addEventListener: y.func.isRequired,
1281
- removeEventListener: y.func.isRequired,
1282
- document: y.shape({
1283
- createElement: y.func.isRequired,
1284
- getElementById: y.func.isRequired,
1285
- activeElement: y.any.isRequired,
1286
- body: y.any.isRequired
1287
- }).isRequired,
1288
- Node: y.func.isRequired
1289
- }),
1290
- itemToString: y.func,
1291
- itemToKey: y.func,
1292
- stateReducer: y.func
1293
- }, sr = $({}, ir, {
1294
- getA11yStatusMessage: y.func,
1295
- highlightedIndex: y.number,
1296
- defaultHighlightedIndex: y.number,
1297
- initialHighlightedIndex: y.number,
1298
- isOpen: y.bool,
1299
- defaultIsOpen: y.bool,
1300
- initialIsOpen: y.bool,
1301
- selectedItem: y.any,
1302
- initialSelectedItem: y.any,
1303
- defaultSelectedItem: y.any,
1304
- id: y.string,
1305
- labelId: y.string,
1306
- menuId: y.string,
1307
- getItemId: y.func,
1308
- toggleButtonId: y.string,
1309
- onSelectedItemChange: y.func,
1310
- onHighlightedIndexChange: y.func,
1311
- onStateChange: y.func,
1312
- onIsOpenChange: y.func,
1313
- scrollIntoView: y.func
1314
- });
1315
- function $o(e, n, r) {
1316
- var i = n.type, o = n.props, t;
1317
- switch (i) {
1318
- case r.ItemMouseMove:
1319
- t = {
1320
- highlightedIndex: n.disabled ? -1 : n.index
1321
- };
1322
- break;
1323
- case r.MenuMouseLeave:
1324
- t = {
1325
- highlightedIndex: -1
1326
- };
1327
- break;
1328
- case r.ToggleButtonClick:
1329
- case r.FunctionToggleMenu:
1330
- t = {
1331
- isOpen: !e.isOpen,
1332
- highlightedIndex: e.isOpen ? -1 : ze(o, e, 0)
1333
- };
1334
- break;
1335
- case r.FunctionOpenMenu:
1336
- t = {
1337
- isOpen: !0,
1338
- highlightedIndex: ze(o, e, 0)
1339
- };
1340
- break;
1341
- case r.FunctionCloseMenu:
1342
- t = {
1343
- isOpen: !1
1344
- };
1345
- break;
1346
- case r.FunctionSetHighlightedIndex:
1347
- t = {
1348
- highlightedIndex: n.highlightedIndex
1349
- };
1350
- break;
1351
- case r.FunctionSetInputValue:
1352
- t = {
1353
- inputValue: n.inputValue
1354
- };
1355
- break;
1356
- case r.FunctionReset:
1357
- t = {
1358
- highlightedIndex: be(o, "highlightedIndex"),
1359
- isOpen: be(o, "isOpen"),
1360
- selectedItem: be(o, "selectedItem"),
1361
- inputValue: be(o, "inputValue")
1362
- };
1363
- break;
1364
- default:
1365
- throw new Error("Reducer called without proper action type.");
1366
- }
1367
- return $({}, e, t);
1368
- }
1369
- Fe(Fe({}, sr), { items: y.array.isRequired, isItemDisabled: y.func, getA11ySelectionMessage: y.func });
1370
- function Fo(e) {
1371
- var n = e.isOpen, r = e.resultCount, i = e.previousResultCount;
1372
- return n ? r ? r !== i ? "".concat(r, " result").concat(r === 1 ? " is" : "s are", " available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.") : "" : "No results are available." : "";
1373
- }
1374
- Fe(Fe({}, je), { getA11yStatusMessage: Fo, isItemDisabled: function() {
1375
- return !1;
1376
- } });
1377
- process.env.NODE_ENV;
1378
- process.env.NODE_ENV;
1379
- process.env.NODE_ENV;
1380
- process.env.NODE_ENV;
1381
- process.env.NODE_ENV;
1382
- process.env.NODE_ENV;
1383
- process.env.NODE_ENV;
1384
- process.env.NODE_ENV;
1385
- process.env.NODE_ENV;
1386
- process.env.NODE_ENV;
1387
- process.env.NODE_ENV;
1388
- process.env.NODE_ENV;
1389
- process.env.NODE_ENV;
1390
- process.env.NODE_ENV;
1391
- process.env.NODE_ENV;
1392
- process.env.NODE_ENV;
1393
- process.env.NODE_ENV;
1394
- process.env.NODE_ENV;
1395
- process.env.NODE_ENV;
1396
- process.env.NODE_ENV;
1397
- process.env.NODE_ENV;
1398
- process.env.NODE_ENV;
1399
- process.env.NODE_ENV;
1400
- var kt = process.env.NODE_ENV !== "production" ? "__input_keydown_arrow_down__" : 0, Mt = process.env.NODE_ENV !== "production" ? "__input_keydown_arrow_up__" : 1, Tt = process.env.NODE_ENV !== "production" ? "__input_keydown_escape__" : 2, Vt = process.env.NODE_ENV !== "production" ? "__input_keydown_home__" : 3, At = process.env.NODE_ENV !== "production" ? "__input_keydown_end__" : 4, Ht = process.env.NODE_ENV !== "production" ? "__input_keydown_page_up__" : 5, jt = process.env.NODE_ENV !== "production" ? "__input_keydown_page_down__" : 6, Kt = process.env.NODE_ENV !== "production" ? "__input_keydown_enter__" : 7, $t = process.env.NODE_ENV !== "production" ? "__input_change__" : 8, ut = process.env.NODE_ENV !== "production" ? "__input_blur__" : 9, Ft = process.env.NODE_ENV !== "production" ? "__input_click__" : 10, ar = process.env.NODE_ENV !== "production" ? "__menu_mouse_leave__" : 11, lr = process.env.NODE_ENV !== "production" ? "__item_mouse_move__" : 12, Lt = process.env.NODE_ENV !== "production" ? "__item_click__" : 13, ur = process.env.NODE_ENV !== "production" ? "__togglebutton_click__" : 14, dr = process.env.NODE_ENV !== "production" ? "__function_toggle_menu__" : 15, cr = process.env.NODE_ENV !== "production" ? "__function_open_menu__" : 16, pr = process.env.NODE_ENV !== "production" ? "__function_close_menu__" : 17, fr = process.env.NODE_ENV !== "production" ? "__function_set_highlighted_index__" : 18, Bt = process.env.NODE_ENV !== "production" ? "__function_select_item__" : 19, hr = process.env.NODE_ENV !== "production" ? "__function_set_input_value__" : 20, gr = process.env.NODE_ENV !== "production" ? "__function_reset__" : 21, Ut = process.env.NODE_ENV !== "production" ? "__controlled_prop_updated_selected_item__" : 22, mr = /* @__PURE__ */ Object.freeze({
1401
- __proto__: null,
1402
- InputKeyDownArrowDown: kt,
1403
- InputKeyDownArrowUp: Mt,
1404
- InputKeyDownEscape: Tt,
1405
- InputKeyDownHome: Vt,
1406
- InputKeyDownEnd: At,
1407
- InputKeyDownPageUp: Ht,
1408
- InputKeyDownPageDown: jt,
1409
- InputKeyDownEnter: Kt,
1410
- InputChange: $t,
1411
- InputBlur: ut,
1412
- InputClick: Ft,
1413
- MenuMouseLeave: ar,
1414
- ItemMouseMove: lr,
1415
- ItemClick: Lt,
1416
- ToggleButtonClick: ur,
1417
- FunctionToggleMenu: dr,
1418
- FunctionOpenMenu: cr,
1419
- FunctionCloseMenu: pr,
1420
- FunctionSetHighlightedIndex: fr,
1421
- FunctionSelectItem: Bt,
1422
- FunctionSetInputValue: hr,
1423
- FunctionReset: gr,
1424
- ControlledPropUpdatedSelectedItem: Ut
1425
- });
1426
- function Lo(e) {
1427
- var n = Ao(e), r = n.selectedItem, i = n.inputValue;
1428
- return i === "" && r && e.defaultInputValue === void 0 && e.initialInputValue === void 0 && e.inputValue === void 0 && (i = e.itemToString(r)), $({}, n, {
1429
- inputValue: i
1430
- });
1431
- }
1432
- var Bo = $({}, sr, {
1433
- items: y.array.isRequired,
1434
- isItemDisabled: y.func,
1435
- selectedItemChanged: y.func,
1436
- getA11ySelectionMessage: y.func,
1437
- inputValue: y.string,
1438
- defaultInputValue: y.string,
1439
- initialInputValue: y.string,
1440
- inputId: y.string,
1441
- onInputValueChange: y.func
1442
- });
1443
- function Uo(e, n, r, i) {
1444
- var o = Q(), t = or(e, n, r, i), s = t[0], l = t[1], d = Xe();
1445
- return de(function() {
1446
- if (at(n, "selectedItem")) {
1447
- if (!d) {
1448
- var u;
1449
- n.selectedItemChanged === void 0 ? u = n.itemToKey(n.selectedItem) !== n.itemToKey(o.current) : (console.warn('The "selectedItemChanged" is deprecated. Please use "itemToKey instead". https://github.com/downshift-js/downshift/blob/master/src/hooks/useCombobox/README.md#selecteditemchanged'), u = n.selectedItemChanged(o.current, n.selectedItem)), u && l({
1450
- type: Ut,
1451
- inputValue: n.itemToString(n.selectedItem)
1452
- });
1453
- }
1454
- o.current = s.selectedItem === o.current ? n.selectedItem : s.selectedItem;
1455
- }
1456
- }, [s.selectedItem, n.selectedItem]), [Ye(s, n), l];
1457
- }
1458
- var vr = me;
1459
- process.env.NODE_ENV !== "production" && (vr = function(n, r) {
1460
- y.checkPropTypes(Bo, n, "prop", r.name);
1461
- });
1462
- var qo = $({}, je, {
1463
- getA11yStatusMessage: jn,
1464
- isItemDisabled: function() {
1465
- return !1;
1466
- }
1467
- });
1468
- function zo(e, n) {
1469
- var r, i = n.type, o = n.props, t = n.altKey, s;
1470
- switch (i) {
1471
- case Lt:
1472
- s = {
1473
- isOpen: be(o, "isOpen"),
1474
- highlightedIndex: be(o, "highlightedIndex"),
1475
- selectedItem: o.items[n.index],
1476
- inputValue: o.itemToString(o.items[n.index])
1477
- };
1478
- break;
1479
- case kt:
1480
- e.isOpen ? s = {
1481
- highlightedIndex: ke(e.highlightedIndex, 1, o.items, o.isItemDisabled, !0)
1482
- } : s = {
1483
- highlightedIndex: t && e.selectedItem == null ? -1 : ze(o, e, 1),
1484
- isOpen: o.items.length >= 0
1485
- };
1486
- break;
1487
- case Mt:
1488
- e.isOpen ? t ? s = yn(o, e.highlightedIndex) : s = {
1489
- highlightedIndex: ke(e.highlightedIndex, -1, o.items, o.isItemDisabled, !0)
1490
- } : s = {
1491
- highlightedIndex: ze(o, e, -1),
1492
- isOpen: o.items.length >= 0
1493
- };
1494
- break;
1495
- case Kt:
1496
- s = yn(o, e.highlightedIndex);
1497
- break;
1498
- case Tt:
1499
- s = $({
1500
- isOpen: !1,
1501
- highlightedIndex: -1
1502
- }, !e.isOpen && {
1503
- selectedItem: null,
1504
- inputValue: ""
1505
- });
1506
- break;
1507
- case Ht:
1508
- s = {
1509
- highlightedIndex: ke(e.highlightedIndex, -10, o.items, o.isItemDisabled, !0)
1510
- };
1511
- break;
1512
- case jt:
1513
- s = {
1514
- highlightedIndex: ke(e.highlightedIndex, 10, o.items, o.isItemDisabled, !0)
1515
- };
1516
- break;
1517
- case Vt:
1518
- s = {
1519
- highlightedIndex: Le(0, !1, o.items, o.isItemDisabled)
1520
- };
1521
- break;
1522
- case At:
1523
- s = {
1524
- highlightedIndex: Le(o.items.length - 1, !0, o.items, o.isItemDisabled)
1525
- };
1526
- break;
1527
- case ut:
1528
- s = $({
1529
- isOpen: !1,
1530
- highlightedIndex: -1
1531
- }, e.highlightedIndex >= 0 && ((r = o.items) == null ? void 0 : r.length) && n.selectItem && {
1532
- selectedItem: o.items[e.highlightedIndex],
1533
- inputValue: o.itemToString(o.items[e.highlightedIndex])
1534
- });
1535
- break;
1536
- case $t:
1537
- s = {
1538
- isOpen: !0,
1539
- highlightedIndex: be(o, "highlightedIndex"),
1540
- inputValue: n.inputValue
1541
- };
1542
- break;
1543
- case Ft:
1544
- s = {
1545
- isOpen: !e.isOpen,
1546
- highlightedIndex: e.isOpen ? -1 : ze(o, e, 0)
1547
- };
1548
- break;
1549
- case Bt:
1550
- s = {
1551
- selectedItem: n.selectedItem,
1552
- inputValue: o.itemToString(n.selectedItem)
1553
- };
1554
- break;
1555
- case Ut:
1556
- s = {
1557
- inputValue: n.inputValue
1558
- };
1559
- break;
1560
- default:
1561
- return $o(e, n, mr);
1562
- }
1563
- return $({}, e, s);
1564
- }
1565
- var Wo = ["onMouseLeave", "refKey", "ref"], Yo = ["item", "index", "refKey", "ref", "onMouseMove", "onMouseDown", "onClick", "onPress", "disabled"], Go = ["onClick", "onPress", "refKey", "ref"], Xo = ["onKeyDown", "onChange", "onInput", "onBlur", "onChangeText", "onClick", "refKey", "ref"];
1566
- ge.stateChangeTypes = mr;
1567
- function ge(e) {
1568
- e === void 0 && (e = {}), vr(e, ge);
1569
- var n = $({}, qo, e), r = n.items, i = n.scrollIntoView, o = n.environment, t = n.getA11yStatusMessage, s = n.getA11ySelectionMessage, l = n.itemToString, d = Uo(zo, n, Lo, Ko), u = d[0], a = d[1], h = u.isOpen, b = u.highlightedIndex, _ = u.selectedItem, x = u.inputValue, S = Q(null), g = Q({}), D = Q(null), c = Q(null), f = Xe(), p = To(n), I = Q(), m = Nt({
1570
- state: u,
1571
- props: n
1572
- }), N = ee(function(T) {
1573
- return g.current[p.getItemId(T)];
1574
- }, [p]);
1575
- In(t, [h, b, x, r], $({
1576
- previousResultCount: I.current,
1577
- items: r,
1578
- environment: o,
1579
- itemToString: l
1580
- }, u)), In(s, [_], $({
1581
- previousResultCount: I.current,
1582
- items: r,
1583
- environment: o,
1584
- itemToString: l
1585
- }, u));
1586
- var E = jo({
1587
- menuElement: S.current,
1588
- highlightedIndex: b,
1589
- isOpen: h,
1590
- itemRefs: g,
1591
- scrollIntoView: i,
1592
- getItemNodeFromIndex: N
1593
- });
1594
- Pt({
1595
- props: n,
1596
- state: u
1597
- }), de(function() {
1598
- var T = Ke(n, "isOpen");
1599
- T && D.current && D.current.focus();
1600
- }, []), de(function() {
1601
- f || (I.current = r.length);
1602
- });
1603
- var k = Ho(o, [c, S, D], ee(function() {
1604
- m.current.state.isOpen && a({
1605
- type: ut,
1606
- selectItem: !1
1607
- });
1608
- }, [a, m])), M = Rt("getInputProps", "getMenuProps");
1609
- de(function() {
1610
- h || (g.current = {});
1611
- }, [h]), de(function() {
1612
- var T;
1613
- !h || !(o != null && o.document) || !(D != null && (T = D.current) != null && T.focus) || o.document.activeElement !== D.current && D.current.focus();
1614
- }, [h, o]);
1615
- var O = Te(function() {
1616
- return {
1617
- ArrowDown: function(A) {
1618
- A.preventDefault(), a({
1619
- type: kt,
1620
- altKey: A.altKey
1621
- });
1622
- },
1623
- ArrowUp: function(A) {
1624
- A.preventDefault(), a({
1625
- type: Mt,
1626
- altKey: A.altKey
1627
- });
1628
- },
1629
- Home: function(A) {
1630
- m.current.state.isOpen && (A.preventDefault(), a({
1631
- type: Vt
1632
- }));
1633
- },
1634
- End: function(A) {
1635
- m.current.state.isOpen && (A.preventDefault(), a({
1636
- type: At
1637
- }));
1638
- },
1639
- Escape: function(A) {
1640
- var w = m.current.state;
1641
- (w.isOpen || w.inputValue || w.selectedItem || w.highlightedIndex > -1) && (A.preventDefault(), a({
1642
- type: Tt
1643
- }));
1644
- },
1645
- Enter: function(A) {
1646
- var w = m.current.state;
1647
- !w.isOpen || A.which === 229 || (A.preventDefault(), a({
1648
- type: Kt
1649
- }));
1650
- },
1651
- PageUp: function(A) {
1652
- m.current.state.isOpen && (A.preventDefault(), a({
1653
- type: Ht
1654
- }));
1655
- },
1656
- PageDown: function(A) {
1657
- m.current.state.isOpen && (A.preventDefault(), a({
1658
- type: jt
1659
- }));
1660
- }
1661
- };
1662
- }, [a, m]), P = ee(function(T) {
1663
- return $({
1664
- id: p.labelId,
1665
- htmlFor: p.inputId
1666
- }, T);
1667
- }, [p]), V = ee(function(T, A) {
1668
- var w, H = T === void 0 ? {} : T, q = H.onMouseLeave, W = H.refKey, B = W === void 0 ? "ref" : W, ae = H.ref, le = ve(H, Wo), ue = A === void 0 ? {} : A, C = ue.suppressRefError, he = C === void 0 ? !1 : C;
1669
- return M("getMenuProps", he, B, S), $((w = {}, w[B] = Re(ae, function(ie) {
1670
- S.current = ie;
1671
- }), w.id = p.menuId, w.role = "listbox", w["aria-labelledby"] = le && le["aria-label"] ? void 0 : "" + p.labelId, w.onMouseLeave = re(q, function() {
1672
- a({
1673
- type: ar
1674
- });
1675
- }), w), le);
1676
- }, [a, M, p]), R = ee(function(T) {
1677
- var A, w, H = T === void 0 ? {} : T, q = H.item, W = H.index, B = H.refKey, ae = B === void 0 ? "ref" : B, le = H.ref, ue = H.onMouseMove, C = H.onMouseDown, he = H.onClick;
1678
- H.onPress;
1679
- var ie = H.disabled, Ae = ve(H, Yo);
1680
- ie !== void 0 && console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');
1681
- var Ue = m.current, Ze = Ue.props, we = Ue.state, et = rr(q, W, Ze.items, "Pass either item or index to getItemProps!"), ft = et[0], Ee = et[1], qe = Ze.isItemDisabled(ft, Ee), ht = "onClick", tt = he, Oe = function() {
1682
- k.isTouchEnd || Ee === we.highlightedIndex || (E.current = !1, a({
1683
- type: lr,
1684
- index: Ee,
1685
- disabled: qe
1686
- }));
1687
- }, Pe = function() {
1688
- a({
1689
- type: Lt,
1690
- index: Ee
1691
- });
1692
- }, De = function(Tr) {
1693
- return Tr.preventDefault();
1694
- };
1695
- return $((A = {}, A[ae] = Re(le, function(ye) {
1696
- ye && (g.current[p.getItemId(Ee)] = ye);
1697
- }), A["aria-disabled"] = qe, A["aria-selected"] = "" + (Ee === we.highlightedIndex), A.id = p.getItemId(Ee), A.role = "option", A), !qe && (w = {}, w[ht] = re(tt, Pe), w), {
1698
- onMouseMove: re(ue, Oe),
1699
- onMouseDown: re(C, De)
1700
- }, Ae);
1701
- }, [a, p, m, k, E]), F = ee(function(T) {
1702
- var A, w = T === void 0 ? {} : T, H = w.onClick;
1703
- w.onPress;
1704
- var q = w.refKey, W = q === void 0 ? "ref" : q, B = w.ref, ae = ve(w, Go), le = m.current.state, ue = function() {
1705
- a({
1706
- type: ur
1707
- });
1708
- };
1709
- return $((A = {}, A[W] = Re(B, function(C) {
1710
- c.current = C;
1711
- }), A["aria-controls"] = p.menuId, A["aria-expanded"] = le.isOpen, A.id = p.toggleButtonId, A.tabIndex = -1, A), !ae.disabled && $({}, {
1712
- onClick: re(H, ue)
1713
- }), ae);
1714
- }, [a, m, p]), L = ee(function(T, A) {
1715
- var w, H = T === void 0 ? {} : T, q = H.onKeyDown, W = H.onChange, B = H.onInput, ae = H.onBlur;
1716
- H.onChangeText;
1717
- var le = H.onClick, ue = H.refKey, C = ue === void 0 ? "ref" : ue, he = H.ref, ie = ve(H, Xo), Ae = A === void 0 ? {} : A, Ue = Ae.suppressRefError, Ze = Ue === void 0 ? !1 : Ue;
1718
- M("getInputProps", Ze, C, D);
1719
- var we = m.current.state, et = function(De) {
1720
- var ye = Ge(De);
1721
- ye && O[ye] && O[ye](De);
1722
- }, ft = function(De) {
1723
- a({
1724
- type: $t,
1725
- inputValue: De.target.value
1726
- });
1727
- }, Ee = function(De) {
1728
- if (o != null && o.document && we.isOpen && !k.isMouseDown) {
1729
- var ye = De.relatedTarget === null && o.document.activeElement !== o.document.body;
1730
- a({
1731
- type: ut,
1732
- selectItem: !ye
1733
- });
1734
- }
1735
- }, qe = function() {
1736
- a({
1737
- type: Ft
1738
- });
1739
- }, ht = "onChange", tt = {};
1740
- if (!ie.disabled) {
1741
- var Oe;
1742
- tt = (Oe = {}, Oe[ht] = re(W, B, ft), Oe.onKeyDown = re(q, et), Oe.onBlur = re(ae, Ee), Oe.onClick = re(le, qe), Oe);
1743
- }
1744
- return $((w = {}, w[C] = Re(he, function(Pe) {
1745
- D.current = Pe;
1746
- }), w["aria-activedescendant"] = we.isOpen && we.highlightedIndex > -1 ? p.getItemId(we.highlightedIndex) : "", w["aria-autocomplete"] = "list", w["aria-controls"] = p.menuId, w["aria-expanded"] = we.isOpen, w["aria-labelledby"] = ie && ie["aria-label"] ? void 0 : p.labelId, w.autoComplete = "off", w.id = p.inputId, w.role = "combobox", w.value = we.inputValue, w), tt, ie);
1747
- }, [a, p, o, O, m, k, M]), K = ee(function() {
1748
- a({
1749
- type: dr
1750
- });
1751
- }, [a]), U = ee(function() {
1752
- a({
1753
- type: pr
1754
- });
1755
- }, [a]), Z = ee(function() {
1756
- a({
1757
- type: cr
1758
- });
1759
- }, [a]), j = ee(function(T) {
1760
- a({
1761
- type: fr,
1762
- highlightedIndex: T
1763
- });
1764
- }, [a]), z = ee(function(T) {
1765
- a({
1766
- type: Bt,
1767
- selectedItem: T
1768
- });
1769
- }, [a]), Y = ee(function(T) {
1770
- a({
1771
- type: hr,
1772
- inputValue: T
1773
- });
1774
- }, [a]), oe = ee(function() {
1775
- a({
1776
- type: gr
1777
- });
1778
- }, [a]);
1779
- return {
1780
- // prop getters.
1781
- getItemProps: R,
1782
- getLabelProps: P,
1783
- getMenuProps: V,
1784
- getInputProps: L,
1785
- getToggleButtonProps: F,
1786
- // actions.
1787
- toggleMenu: K,
1788
- openMenu: Z,
1789
- closeMenu: U,
1790
- setHighlightedIndex: j,
1791
- setInputValue: Y,
1792
- selectItem: z,
1793
- reset: oe,
1794
- // state.
1795
- highlightedIndex: b,
1796
- isOpen: h,
1797
- selectedItem: _,
1798
- inputValue: x
1799
- };
1800
- }
1801
- var _r = {
1802
- activeIndex: -1,
1803
- selectedItems: []
1804
- };
1805
- function xn(e, n) {
1806
- return Ke(e, n, _r);
1807
- }
1808
- function bn(e, n) {
1809
- return be(e, n, _r);
1810
- }
1811
- function Jo(e) {
1812
- var n = xn(e, "activeIndex"), r = xn(e, "selectedItems");
1813
- return {
1814
- activeIndex: n,
1815
- selectedItems: r
1816
- };
1817
- }
1818
- function wn(e) {
1819
- if (e.shiftKey || e.metaKey || e.ctrlKey || e.altKey)
1820
- return !1;
1821
- var n = e.target;
1822
- return !(n instanceof HTMLInputElement && // if element is a text input
1823
- n.value !== "" && // and we have text in it
1824
- // and cursor is either not at the start or is currently highlighting text.
1825
- (n.selectionStart !== 0 || n.selectionEnd !== 0));
1826
- }
1827
- function Qo(e) {
1828
- var n = e.removedSelectedItem, r = e.itemToString;
1829
- return r(n) + " has been removed.";
1830
- }
1831
- function Zo(e, n) {
1832
- return e.selectedItems === n.selectedItems && e.activeIndex === n.activeIndex;
1833
- }
1834
- var ei = $({}, ir, {
1835
- selectedItems: y.array,
1836
- initialSelectedItems: y.array,
1837
- defaultSelectedItems: y.array,
1838
- getA11yRemovalMessage: y.func,
1839
- activeIndex: y.number,
1840
- initialActiveIndex: y.number,
1841
- defaultActiveIndex: y.number,
1842
- onActiveIndexChange: y.func,
1843
- onSelectedItemsChange: y.func,
1844
- keyNavigationNext: y.string,
1845
- keyNavigationPrevious: y.string
1846
- }), ti = {
1847
- itemToString: je.itemToString,
1848
- itemToKey: je.itemToKey,
1849
- stateReducer: je.stateReducer,
1850
- environment: je.environment,
1851
- getA11yRemovalMessage: Qo,
1852
- keyNavigationNext: "ArrowRight",
1853
- keyNavigationPrevious: "ArrowLeft"
1854
- }, Ir = me;
1855
- process.env.NODE_ENV !== "production" && (Ir = function(n, r) {
1856
- y.checkPropTypes(ei, n, "prop", r.name);
1857
- });
1858
- var qt = process.env.NODE_ENV !== "production" ? "__selected_item_click__" : 0, zt = process.env.NODE_ENV !== "production" ? "__selected_item_keydown_delete__" : 1, Wt = process.env.NODE_ENV !== "production" ? "__selected_item_keydown_backspace__" : 2, Yt = process.env.NODE_ENV !== "production" ? "__selected_item_keydown_navigation_next__" : 3, Gt = process.env.NODE_ENV !== "production" ? "__selected_item_keydown_navigation_previous__" : 4, Xt = process.env.NODE_ENV !== "production" ? "__dropdown_keydown_navigation_previous__" : 5, Jt = process.env.NODE_ENV !== "production" ? "__dropdown_keydown_backspace__" : 6, Qt = process.env.NODE_ENV !== "production" ? "__dropdown_click__" : 7, Zt = process.env.NODE_ENV !== "production" ? "__function_add_selected_item__" : 8, en = process.env.NODE_ENV !== "production" ? "__function_remove_selected_item__" : 9, tn = process.env.NODE_ENV !== "production" ? "__function_set_selected_items__" : 10, nn = process.env.NODE_ENV !== "production" ? "__function_set_active_index__" : 11, rn = process.env.NODE_ENV !== "production" ? "__function_reset__" : 12, ni = /* @__PURE__ */ Object.freeze({
1859
- __proto__: null,
1860
- SelectedItemClick: qt,
1861
- SelectedItemKeyDownDelete: zt,
1862
- SelectedItemKeyDownBackspace: Wt,
1863
- SelectedItemKeyDownNavigationNext: Yt,
1864
- SelectedItemKeyDownNavigationPrevious: Gt,
1865
- DropdownKeyDownNavigationPrevious: Xt,
1866
- DropdownKeyDownBackspace: Jt,
1867
- DropdownClick: Qt,
1868
- FunctionAddSelectedItem: Zt,
1869
- FunctionRemoveSelectedItem: en,
1870
- FunctionSetSelectedItems: tn,
1871
- FunctionSetActiveIndex: nn,
1872
- FunctionReset: rn
1873
- });
1874
- function ri(e, n) {
1875
- var r = n.type, i = n.index, o = n.props, t = n.selectedItem, s = e.activeIndex, l = e.selectedItems, d;
1876
- switch (r) {
1877
- case qt:
1878
- d = {
1879
- activeIndex: i
1880
- };
1881
- break;
1882
- case Gt:
1883
- d = {
1884
- activeIndex: s - 1 < 0 ? 0 : s - 1
1885
- };
1886
- break;
1887
- case Yt:
1888
- d = {
1889
- activeIndex: s + 1 >= l.length ? -1 : s + 1
1890
- };
1891
- break;
1892
- case Wt:
1893
- case zt: {
1894
- if (s < 0)
1895
- break;
1896
- var u = s;
1897
- l.length === 1 ? u = -1 : s === l.length - 1 && (u = l.length - 2), d = $({
1898
- selectedItems: [].concat(l.slice(0, s), l.slice(s + 1))
1899
- }, {
1900
- activeIndex: u
1901
- });
1902
- break;
1903
- }
1904
- case Xt:
1905
- d = {
1906
- activeIndex: l.length - 1
1907
- };
1908
- break;
1909
- case Jt:
1910
- d = {
1911
- selectedItems: l.slice(0, l.length - 1)
1912
- };
1913
- break;
1914
- case Zt:
1915
- d = {
1916
- selectedItems: [].concat(l, [t])
1917
- };
1918
- break;
1919
- case Qt:
1920
- d = {
1921
- activeIndex: -1
1922
- };
1923
- break;
1924
- case en: {
1925
- var a = s, h = l.findIndex(function(x) {
1926
- return o.itemToKey(x) === o.itemToKey(t);
1927
- });
1928
- if (h < 0)
1929
- break;
1930
- l.length === 1 ? a = -1 : h === l.length - 1 && (a = l.length - 2), d = {
1931
- selectedItems: [].concat(l.slice(0, h), l.slice(h + 1)),
1932
- activeIndex: a
1933
- };
1934
- break;
1935
- }
1936
- case tn: {
1937
- var b = n.selectedItems;
1938
- d = {
1939
- selectedItems: b
1940
- };
1941
- break;
1942
- }
1943
- case nn: {
1944
- var _ = n.activeIndex;
1945
- d = {
1946
- activeIndex: _
1947
- };
1948
- break;
1949
- }
1950
- case rn:
1951
- d = {
1952
- activeIndex: bn(o, "activeIndex"),
1953
- selectedItems: bn(o, "selectedItems")
1954
- };
1955
- break;
1956
- default:
1957
- throw new Error("Reducer called without proper action type.");
1958
- }
1959
- return $({}, e, d);
1960
- }
1961
- var oi = ["refKey", "ref", "onClick", "onKeyDown", "selectedItem", "index"], ii = ["refKey", "ref", "onKeyDown", "onClick", "preventKeyAction"];
1962
- Ne.stateChangeTypes = ni;
1963
- function Ne(e) {
1964
- e === void 0 && (e = {}), Ir(e, Ne);
1965
- var n = $({}, ti, e), r = n.getA11yRemovalMessage, i = n.itemToString, o = n.environment, t = n.keyNavigationNext, s = n.keyNavigationPrevious, l = Vo(ri, n, Jo, Zo), d = l[0], u = l[1], a = d.activeIndex, h = d.selectedItems, b = Xe(), _ = Q(null), x = Q(h), S = Q();
1966
- S.current = [];
1967
- var g = Nt({
1968
- state: d,
1969
- props: n
1970
- });
1971
- de(function() {
1972
- if (!(b || !(o != null && o.document))) {
1973
- if (h.length < x.current.length) {
1974
- var O = x.current.find(function(P) {
1975
- return h.findIndex(function(V) {
1976
- return n.itemToKey(V) === n.itemToKey(P);
1977
- }) < 0;
1978
- });
1979
- Ot(r({
1980
- itemToString: i,
1981
- resultCount: h.length,
1982
- removedSelectedItem: O,
1983
- activeIndex: a,
1984
- activeSelectedItem: h[a]
1985
- }), o.document);
1986
- }
1987
- x.current = h;
1988
- }
1989
- }, [h.length]), de(function() {
1990
- b || (a === -1 && _.current ? _.current.focus() : S.current[a] && S.current[a].focus());
1991
- }, [a]), Pt({
1992
- props: n,
1993
- state: d
1994
- });
1995
- var D = Rt("getDropdownProps"), c = Te(function() {
1996
- var O;
1997
- return O = {}, O[s] = function() {
1998
- u({
1999
- type: Gt
2000
- });
2001
- }, O[t] = function() {
2002
- u({
2003
- type: Yt
2004
- });
2005
- }, O.Delete = function() {
2006
- u({
2007
- type: zt
2008
- });
2009
- }, O.Backspace = function() {
2010
- u({
2011
- type: Wt
2012
- });
2013
- }, O;
2014
- }, [u, t, s]), f = Te(function() {
2015
- var O;
2016
- return O = {}, O[s] = function(P) {
2017
- wn(P) && u({
2018
- type: Xt
2019
- });
2020
- }, O.Backspace = function(V) {
2021
- wn(V) && u({
2022
- type: Jt
2023
- });
2024
- }, O;
2025
- }, [u, s]), p = ee(function(O) {
2026
- var P, V = O === void 0 ? {} : O, R = V.refKey, F = R === void 0 ? "ref" : R, L = V.ref, K = V.onClick, U = V.onKeyDown, Z = V.selectedItem, j = V.index, z = ve(V, oi), Y = g.current.state, oe = rr(Z, j, Y.selectedItems, "Pass either item or index to getSelectedItemProps!"), T = oe[1], A = T > -1 && T === Y.activeIndex, w = function() {
2027
- u({
2028
- type: qt,
2029
- index: T
2030
- });
2031
- }, H = function(W) {
2032
- var B = Ge(W);
2033
- B && c[B] && c[B](W);
2034
- };
2035
- return $((P = {}, P[F] = Re(L, function(q) {
2036
- q && S.current.push(q);
2037
- }), P.tabIndex = A ? 0 : -1, P.onClick = re(K, w), P.onKeyDown = re(U, H), P), z);
2038
- }, [u, g, c]), I = ee(function(O, P) {
2039
- var V, R = O === void 0 ? {} : O, F = R.refKey, L = F === void 0 ? "ref" : F, K = R.ref, U = R.onKeyDown, Z = R.onClick, j = R.preventKeyAction, z = j === void 0 ? !1 : j, Y = ve(R, ii), oe = P === void 0 ? {} : P, T = oe.suppressRefError, A = T === void 0 ? !1 : T;
2040
- D("getDropdownProps", A, L, _);
2041
- var w = function(W) {
2042
- var B = Ge(W);
2043
- B && f[B] && f[B](W);
2044
- }, H = function() {
2045
- u({
2046
- type: Qt
2047
- });
2048
- };
2049
- return $((V = {}, V[L] = Re(K, function(q) {
2050
- q && (_.current = q);
2051
- }), V), !z && {
2052
- onKeyDown: re(U, w),
2053
- onClick: re(Z, H)
2054
- }, Y);
2055
- }, [u, f, D]), m = ee(function(O) {
2056
- u({
2057
- type: Zt,
2058
- selectedItem: O
2059
- });
2060
- }, [u]), N = ee(function(O) {
2061
- u({
2062
- type: en,
2063
- selectedItem: O
2064
- });
2065
- }, [u]), E = ee(function(O) {
2066
- u({
2067
- type: tn,
2068
- selectedItems: O
2069
- });
2070
- }, [u]), k = ee(function(O) {
2071
- u({
2072
- type: nn,
2073
- activeIndex: O
2074
- });
2075
- }, [u]), M = ee(function() {
2076
- u({
2077
- type: rn
2078
- });
2079
- }, [u]);
2080
- return {
2081
- getSelectedItemProps: p,
2082
- getDropdownProps: I,
2083
- addSelectedItem: m,
2084
- removeSelectedItem: N,
2085
- setSelectedItems: E,
2086
- setActiveIndex: k,
2087
- reset: M,
2088
- selectedItems: h,
2089
- activeIndex: a
2090
- };
2091
- }
2092
- var ct = { exports: {} }, yr = {
2093
- À: "A",
2094
- Á: "A",
2095
- Â: "A",
2096
- Ã: "A",
2097
- Ä: "A",
2098
- Å: "A",
2099
- Ấ: "A",
2100
- Ắ: "A",
2101
- Ẳ: "A",
2102
- Ẵ: "A",
2103
- Ặ: "A",
2104
- Æ: "AE",
2105
- Ầ: "A",
2106
- Ằ: "A",
2107
- Ȃ: "A",
2108
- Ả: "A",
2109
- Ạ: "A",
2110
- Ẩ: "A",
2111
- Ẫ: "A",
2112
- Ậ: "A",
2113
- Ç: "C",
2114
- Ḉ: "C",
2115
- È: "E",
2116
- É: "E",
2117
- Ê: "E",
2118
- Ë: "E",
2119
- Ế: "E",
2120
- Ḗ: "E",
2121
- Ề: "E",
2122
- Ḕ: "E",
2123
- Ḝ: "E",
2124
- Ȇ: "E",
2125
- Ẻ: "E",
2126
- Ẽ: "E",
2127
- Ẹ: "E",
2128
- Ể: "E",
2129
- Ễ: "E",
2130
- Ệ: "E",
2131
- Ì: "I",
2132
- Í: "I",
2133
- Î: "I",
2134
- Ï: "I",
2135
- Ḯ: "I",
2136
- Ȋ: "I",
2137
- Ỉ: "I",
2138
- Ị: "I",
2139
- Ð: "D",
2140
- Ñ: "N",
2141
- Ò: "O",
2142
- Ó: "O",
2143
- Ô: "O",
2144
- Õ: "O",
2145
- Ö: "O",
2146
- Ø: "O",
2147
- Ố: "O",
2148
- Ṍ: "O",
2149
- Ṓ: "O",
2150
- Ȏ: "O",
2151
- Ỏ: "O",
2152
- Ọ: "O",
2153
- Ổ: "O",
2154
- Ỗ: "O",
2155
- Ộ: "O",
2156
- Ờ: "O",
2157
- Ở: "O",
2158
- Ỡ: "O",
2159
- Ớ: "O",
2160
- Ợ: "O",
2161
- Ù: "U",
2162
- Ú: "U",
2163
- Û: "U",
2164
- Ü: "U",
2165
- Ủ: "U",
2166
- Ụ: "U",
2167
- Ử: "U",
2168
- Ữ: "U",
2169
- Ự: "U",
2170
- Ý: "Y",
2171
- à: "a",
2172
- á: "a",
2173
- â: "a",
2174
- ã: "a",
2175
- ä: "a",
2176
- å: "a",
2177
- ấ: "a",
2178
- ắ: "a",
2179
- ẳ: "a",
2180
- ẵ: "a",
2181
- ặ: "a",
2182
- æ: "ae",
2183
- ầ: "a",
2184
- ằ: "a",
2185
- ȃ: "a",
2186
- ả: "a",
2187
- ạ: "a",
2188
- ẩ: "a",
2189
- ẫ: "a",
2190
- ậ: "a",
2191
- ç: "c",
2192
- ḉ: "c",
2193
- è: "e",
2194
- é: "e",
2195
- ê: "e",
2196
- ë: "e",
2197
- ế: "e",
2198
- ḗ: "e",
2199
- ề: "e",
2200
- ḕ: "e",
2201
- ḝ: "e",
2202
- ȇ: "e",
2203
- ẻ: "e",
2204
- ẽ: "e",
2205
- ẹ: "e",
2206
- ể: "e",
2207
- ễ: "e",
2208
- ệ: "e",
2209
- ì: "i",
2210
- í: "i",
2211
- î: "i",
2212
- ï: "i",
2213
- ḯ: "i",
2214
- ȋ: "i",
2215
- ỉ: "i",
2216
- ị: "i",
2217
- ð: "d",
2218
- ñ: "n",
2219
- ò: "o",
2220
- ó: "o",
2221
- ô: "o",
2222
- õ: "o",
2223
- ö: "o",
2224
- ø: "o",
2225
- ố: "o",
2226
- ṍ: "o",
2227
- ṓ: "o",
2228
- ȏ: "o",
2229
- ỏ: "o",
2230
- ọ: "o",
2231
- ổ: "o",
2232
- ỗ: "o",
2233
- ộ: "o",
2234
- ờ: "o",
2235
- ở: "o",
2236
- ỡ: "o",
2237
- ớ: "o",
2238
- ợ: "o",
2239
- ù: "u",
2240
- ú: "u",
2241
- û: "u",
2242
- ü: "u",
2243
- ủ: "u",
2244
- ụ: "u",
2245
- ử: "u",
2246
- ữ: "u",
2247
- ự: "u",
2248
- ý: "y",
2249
- ÿ: "y",
2250
- Ā: "A",
2251
- ā: "a",
2252
- Ă: "A",
2253
- ă: "a",
2254
- Ą: "A",
2255
- ą: "a",
2256
- Ć: "C",
2257
- ć: "c",
2258
- Ĉ: "C",
2259
- ĉ: "c",
2260
- Ċ: "C",
2261
- ċ: "c",
2262
- Č: "C",
2263
- č: "c",
2264
- C̆: "C",
2265
- c̆: "c",
2266
- Ď: "D",
2267
- ď: "d",
2268
- Đ: "D",
2269
- đ: "d",
2270
- Ē: "E",
2271
- ē: "e",
2272
- Ĕ: "E",
2273
- ĕ: "e",
2274
- Ė: "E",
2275
- ė: "e",
2276
- Ę: "E",
2277
- ę: "e",
2278
- Ě: "E",
2279
- ě: "e",
2280
- Ĝ: "G",
2281
- Ǵ: "G",
2282
- ĝ: "g",
2283
- ǵ: "g",
2284
- Ğ: "G",
2285
- ğ: "g",
2286
- Ġ: "G",
2287
- ġ: "g",
2288
- Ģ: "G",
2289
- ģ: "g",
2290
- Ĥ: "H",
2291
- ĥ: "h",
2292
- Ħ: "H",
2293
- ħ: "h",
2294
- Ḫ: "H",
2295
- ḫ: "h",
2296
- Ĩ: "I",
2297
- ĩ: "i",
2298
- Ī: "I",
2299
- ī: "i",
2300
- Ĭ: "I",
2301
- ĭ: "i",
2302
- Į: "I",
2303
- į: "i",
2304
- İ: "I",
2305
- ı: "i",
2306
- IJ: "IJ",
2307
- ij: "ij",
2308
- Ĵ: "J",
2309
- ĵ: "j",
2310
- Ķ: "K",
2311
- ķ: "k",
2312
- Ḱ: "K",
2313
- ḱ: "k",
2314
- K̆: "K",
2315
- k̆: "k",
2316
- Ĺ: "L",
2317
- ĺ: "l",
2318
- Ļ: "L",
2319
- ļ: "l",
2320
- Ľ: "L",
2321
- ľ: "l",
2322
- Ŀ: "L",
2323
- ŀ: "l",
2324
- Ł: "l",
2325
- ł: "l",
2326
- Ḿ: "M",
2327
- ḿ: "m",
2328
- M̆: "M",
2329
- m̆: "m",
2330
- Ń: "N",
2331
- ń: "n",
2332
- Ņ: "N",
2333
- ņ: "n",
2334
- Ň: "N",
2335
- ň: "n",
2336
- ʼn: "n",
2337
- N̆: "N",
2338
- n̆: "n",
2339
- Ō: "O",
2340
- ō: "o",
2341
- Ŏ: "O",
2342
- ŏ: "o",
2343
- Ő: "O",
2344
- ő: "o",
2345
- Œ: "OE",
2346
- œ: "oe",
2347
- P̆: "P",
2348
- p̆: "p",
2349
- Ŕ: "R",
2350
- ŕ: "r",
2351
- Ŗ: "R",
2352
- ŗ: "r",
2353
- Ř: "R",
2354
- ř: "r",
2355
- R̆: "R",
2356
- r̆: "r",
2357
- Ȓ: "R",
2358
- ȓ: "r",
2359
- Ś: "S",
2360
- ś: "s",
2361
- Ŝ: "S",
2362
- ŝ: "s",
2363
- Ş: "S",
2364
- Ș: "S",
2365
- ș: "s",
2366
- ş: "s",
2367
- Š: "S",
2368
- š: "s",
2369
- Ţ: "T",
2370
- ţ: "t",
2371
- ț: "t",
2372
- Ț: "T",
2373
- Ť: "T",
2374
- ť: "t",
2375
- Ŧ: "T",
2376
- ŧ: "t",
2377
- T̆: "T",
2378
- t̆: "t",
2379
- Ũ: "U",
2380
- ũ: "u",
2381
- Ū: "U",
2382
- ū: "u",
2383
- Ŭ: "U",
2384
- ŭ: "u",
2385
- Ů: "U",
2386
- ů: "u",
2387
- Ű: "U",
2388
- ű: "u",
2389
- Ų: "U",
2390
- ų: "u",
2391
- Ȗ: "U",
2392
- ȗ: "u",
2393
- V̆: "V",
2394
- v̆: "v",
2395
- Ŵ: "W",
2396
- ŵ: "w",
2397
- Ẃ: "W",
2398
- ẃ: "w",
2399
- X̆: "X",
2400
- x̆: "x",
2401
- Ŷ: "Y",
2402
- ŷ: "y",
2403
- Ÿ: "Y",
2404
- Y̆: "Y",
2405
- y̆: "y",
2406
- Ź: "Z",
2407
- ź: "z",
2408
- Ż: "Z",
2409
- ż: "z",
2410
- Ž: "Z",
2411
- ž: "z",
2412
- ſ: "s",
2413
- ƒ: "f",
2414
- Ơ: "O",
2415
- ơ: "o",
2416
- Ư: "U",
2417
- ư: "u",
2418
- Ǎ: "A",
2419
- ǎ: "a",
2420
- Ǐ: "I",
2421
- ǐ: "i",
2422
- Ǒ: "O",
2423
- ǒ: "o",
2424
- Ǔ: "U",
2425
- ǔ: "u",
2426
- Ǖ: "U",
2427
- ǖ: "u",
2428
- Ǘ: "U",
2429
- ǘ: "u",
2430
- Ǚ: "U",
2431
- ǚ: "u",
2432
- Ǜ: "U",
2433
- ǜ: "u",
2434
- Ứ: "U",
2435
- ứ: "u",
2436
- Ṹ: "U",
2437
- ṹ: "u",
2438
- Ǻ: "A",
2439
- ǻ: "a",
2440
- Ǽ: "AE",
2441
- ǽ: "ae",
2442
- Ǿ: "O",
2443
- ǿ: "o",
2444
- Þ: "TH",
2445
- þ: "th",
2446
- Ṕ: "P",
2447
- ṕ: "p",
2448
- Ṥ: "S",
2449
- ṥ: "s",
2450
- X́: "X",
2451
- x́: "x",
2452
- Ѓ: "Г",
2453
- ѓ: "г",
2454
- Ќ: "К",
2455
- ќ: "к",
2456
- A̋: "A",
2457
- a̋: "a",
2458
- E̋: "E",
2459
- e̋: "e",
2460
- I̋: "I",
2461
- i̋: "i",
2462
- Ǹ: "N",
2463
- ǹ: "n",
2464
- Ồ: "O",
2465
- ồ: "o",
2466
- Ṑ: "O",
2467
- ṑ: "o",
2468
- Ừ: "U",
2469
- ừ: "u",
2470
- Ẁ: "W",
2471
- ẁ: "w",
2472
- Ỳ: "Y",
2473
- ỳ: "y",
2474
- Ȁ: "A",
2475
- ȁ: "a",
2476
- Ȅ: "E",
2477
- ȅ: "e",
2478
- Ȉ: "I",
2479
- ȉ: "i",
2480
- Ȍ: "O",
2481
- ȍ: "o",
2482
- Ȑ: "R",
2483
- ȑ: "r",
2484
- Ȕ: "U",
2485
- ȕ: "u",
2486
- B̌: "B",
2487
- b̌: "b",
2488
- Č̣: "C",
2489
- č̣: "c",
2490
- Ê̌: "E",
2491
- ê̌: "e",
2492
- F̌: "F",
2493
- f̌: "f",
2494
- Ǧ: "G",
2495
- ǧ: "g",
2496
- Ȟ: "H",
2497
- ȟ: "h",
2498
- J̌: "J",
2499
- ǰ: "j",
2500
- Ǩ: "K",
2501
- ǩ: "k",
2502
- M̌: "M",
2503
- m̌: "m",
2504
- P̌: "P",
2505
- p̌: "p",
2506
- Q̌: "Q",
2507
- q̌: "q",
2508
- Ř̩: "R",
2509
- ř̩: "r",
2510
- Ṧ: "S",
2511
- ṧ: "s",
2512
- V̌: "V",
2513
- v̌: "v",
2514
- W̌: "W",
2515
- w̌: "w",
2516
- X̌: "X",
2517
- x̌: "x",
2518
- Y̌: "Y",
2519
- y̌: "y",
2520
- A̧: "A",
2521
- a̧: "a",
2522
- B̧: "B",
2523
- b̧: "b",
2524
- Ḑ: "D",
2525
- ḑ: "d",
2526
- Ȩ: "E",
2527
- ȩ: "e",
2528
- Ɛ̧: "E",
2529
- ɛ̧: "e",
2530
- Ḩ: "H",
2531
- ḩ: "h",
2532
- I̧: "I",
2533
- i̧: "i",
2534
- Ɨ̧: "I",
2535
- ɨ̧: "i",
2536
- M̧: "M",
2537
- m̧: "m",
2538
- O̧: "O",
2539
- o̧: "o",
2540
- Q̧: "Q",
2541
- q̧: "q",
2542
- U̧: "U",
2543
- u̧: "u",
2544
- X̧: "X",
2545
- x̧: "x",
2546
- Z̧: "Z",
2547
- z̧: "z",
2548
- й: "и",
2549
- Й: "И",
2550
- ё: "е",
2551
- Ё: "Е"
2552
- }, xr = Object.keys(yr).join("|"), si = new RegExp(xr, "g"), ai = new RegExp(xr, "");
2553
- function li(e) {
2554
- return yr[e];
2555
- }
2556
- var br = function(e) {
2557
- return e.replace(si, li);
2558
- }, ui = function(e) {
2559
- return !!e.match(ai);
2560
- };
2561
- ct.exports = br;
2562
- ct.exports.has = ui;
2563
- ct.exports.remove = br;
2564
- var di = ct.exports;
2565
- const ci = /* @__PURE__ */ ao(di);
2566
- /**
2567
- * @name match-sorter
2568
- * @license MIT license.
2569
- * @copyright (c) 2020 Kent C. Dodds
2570
- * @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
2571
- */
2572
- const fe = {
2573
- CASE_SENSITIVE_EQUAL: 7,
2574
- EQUAL: 6,
2575
- STARTS_WITH: 5,
2576
- WORD_STARTS_WITH: 4,
2577
- CONTAINS: 3,
2578
- ACRONYM: 2,
2579
- MATCHES: 1,
2580
- NO_MATCH: 0
2581
- }, pi = (e, n) => String(e.rankedValue).localeCompare(String(n.rankedValue));
2582
- function on(e, n, r) {
2583
- r === void 0 && (r = {});
2584
- const {
2585
- keys: i,
2586
- threshold: o = fe.MATCHES,
2587
- baseSort: t = pi,
2588
- sorter: s = (u) => u.sort((a, h) => mi(a, h, t))
2589
- } = r, l = e.reduce(d, []);
2590
- return s(l).map((u) => {
2591
- let {
2592
- item: a
2593
- } = u;
2594
- return a;
2595
- });
2596
- function d(u, a, h) {
2597
- const b = fi(a, i, n, r), {
2598
- rank: _,
2599
- keyThreshold: x = o
2600
- } = b;
2601
- return _ >= x && u.push({
2602
- ...b,
2603
- item: a,
2604
- index: h
2605
- }), u;
2606
- }
2607
- }
2608
- on.rankings = fe;
2609
- function fi(e, n, r, i) {
2610
- if (!n) {
2611
- const t = e;
2612
- return {
2613
- // ends up being duplicate of 'item' in matches but consistent
2614
- rankedValue: t,
2615
- rank: En(t, r, i),
2616
- keyIndex: -1,
2617
- keyThreshold: i.threshold
2618
- };
2619
- }
2620
- return Ii(e, n).reduce((t, s, l) => {
2621
- let {
2622
- rank: d,
2623
- rankedValue: u,
2624
- keyIndex: a,
2625
- keyThreshold: h
2626
- } = t, {
2627
- itemValue: b,
2628
- attributes: _
2629
- } = s, x = En(b, r, i), S = u;
2630
- const {
2631
- minRanking: g,
2632
- maxRanking: D,
2633
- threshold: c
2634
- } = _;
2635
- return x < g && x >= fe.MATCHES ? x = g : x > D && (x = D), x > d && (d = x, a = l, h = c, S = b), {
2636
- rankedValue: S,
2637
- rank: d,
2638
- keyIndex: a,
2639
- keyThreshold: h
2640
- };
2641
- }, {
2642
- rankedValue: e,
2643
- rank: fe.NO_MATCH,
2644
- keyIndex: -1,
2645
- keyThreshold: i.threshold
2646
- });
2647
- }
2648
- function En(e, n, r) {
2649
- return e = Cn(e, r), n = Cn(n, r), n.length > e.length ? fe.NO_MATCH : e === n ? fe.CASE_SENSITIVE_EQUAL : (e = e.toLowerCase(), n = n.toLowerCase(), e === n ? fe.EQUAL : e.startsWith(n) ? fe.STARTS_WITH : e.includes(` ${n}`) ? fe.WORD_STARTS_WITH : e.includes(n) ? fe.CONTAINS : n.length === 1 ? fe.NO_MATCH : hi(e).includes(n) ? fe.ACRONYM : gi(e, n));
2650
- }
2651
- function hi(e) {
2652
- let n = "";
2653
- return e.split(" ").forEach((i) => {
2654
- i.split("-").forEach((t) => {
2655
- n += t.substr(0, 1);
2656
- });
2657
- }), n;
2658
- }
2659
- function gi(e, n) {
2660
- let r = 0, i = 0;
2661
- function o(d, u, a) {
2662
- for (let h = a, b = u.length; h < b; h++)
2663
- if (u[h] === d)
2664
- return r += 1, h + 1;
2665
- return -1;
2666
- }
2667
- function t(d) {
2668
- const u = 1 / d, a = r / n.length;
2669
- return fe.MATCHES + a * u;
2670
- }
2671
- const s = o(n[0], e, 0);
2672
- if (s < 0)
2673
- return fe.NO_MATCH;
2674
- i = s;
2675
- for (let d = 1, u = n.length; d < u; d++) {
2676
- const a = n[d];
2677
- if (i = o(a, e, i), !(i > -1))
2678
- return fe.NO_MATCH;
2679
- }
2680
- const l = i - s;
2681
- return t(l);
2682
- }
2683
- function mi(e, n, r) {
2684
- const {
2685
- rank: t,
2686
- keyIndex: s
2687
- } = e, {
2688
- rank: l,
2689
- keyIndex: d
2690
- } = n;
2691
- return t === l ? s === d ? r(e, n) : s < d ? -1 : 1 : t > l ? -1 : 1;
2692
- }
2693
- function Cn(e, n) {
2694
- let {
2695
- keepDiacritics: r
2696
- } = n;
2697
- return e = `${e}`, r || (e = ci(e)), e;
2698
- }
2699
- function vi(e, n) {
2700
- typeof n == "object" && (n = n.key);
2701
- let r;
2702
- if (typeof n == "function")
2703
- r = n(e);
2704
- else if (e == null)
2705
- r = null;
2706
- else if (Object.hasOwnProperty.call(e, n))
2707
- r = e[n];
2708
- else {
2709
- if (n.includes("."))
2710
- return _i(n, e);
2711
- r = null;
2712
- }
2713
- return r == null ? [] : Array.isArray(r) ? r : [String(r)];
2714
- }
2715
- function _i(e, n) {
2716
- const r = e.split(".");
2717
- let i = [n];
2718
- for (let o = 0, t = r.length; o < t; o++) {
2719
- const s = r[o];
2720
- let l = [];
2721
- for (let d = 0, u = i.length; d < u; d++) {
2722
- const a = i[d];
2723
- if (a != null)
2724
- if (Object.hasOwnProperty.call(a, s)) {
2725
- const h = a[s];
2726
- h != null && l.push(h);
2727
- } else
2728
- s === "*" && (l = l.concat(a));
2729
- }
2730
- i = l;
2731
- }
2732
- return Array.isArray(i[0]) ? [].concat(...i) : i;
2733
- }
2734
- function Ii(e, n) {
2735
- const r = [];
2736
- for (let i = 0, o = n.length; i < o; i++) {
2737
- const t = n[i], s = yi(t), l = vi(e, t);
2738
- for (let d = 0, u = l.length; d < u; d++)
2739
- r.push({
2740
- itemValue: l[d],
2741
- attributes: s
2742
- });
2743
- }
2744
- return r;
2745
- }
2746
- const Sn = {
2747
- maxRanking: 1 / 0,
2748
- minRanking: -1 / 0
2749
- };
2750
- function yi(e) {
2751
- return typeof e == "string" ? Sn : {
2752
- ...Sn,
2753
- ...e
2754
- };
2755
- }
2756
- function xi({
2757
- defaultOpen: e,
2758
- placement: n = "bottom",
2759
- modal: r,
2760
- open: i,
2761
- onOpenChange: o,
2762
- onClose: t,
2763
- disableCloseOnClickOutside: s,
2764
- disableCloseOnEscape: l,
2765
- openOnHover: d,
2766
- fillAvailableHeight: u,
2767
- matchReferenceWidth: a,
2768
- fixedWidth: h,
2769
- disableCaret: b,
2770
- noPadding: _,
2771
- disableShift: x,
2772
- disableFlip: S,
2773
- disableFlipFallback: g,
2774
- disableAutoUpdate: D,
2775
- disableFocusLock: c
2776
- } = {}) {
2777
- const [f, p] = J(e), [I, m] = J(), [N, E] = J(), k = i ?? f, M = o ?? p, O = Q(null), P = Wr({
2778
- placement: n,
2779
- open: k,
2780
- onOpenChange: M,
2781
- whileElementsMounted: D ? void 0 : Yr,
2782
- middleware: [
2783
- Gr(8),
2784
- Xr({
2785
- padding: 5,
2786
- apply({ rects: Z, availableHeight: j, elements: z }) {
2787
- Object.assign(z.floating.style, {
2788
- ...a ? { width: `${Z.reference.width}px` } : h ? { width: "40dvw" } : {},
2789
- ...u ? (
2790
- // { maxHeight: "60dvh" }
2791
- // Minimum height is 236px before flip
2792
- { maxHeight: `${Math.max(236, j - 20)}px` }
2793
- ) : {},
2794
- zIndex: 1
2795
- });
2796
- }
2797
- }),
2798
- Jr({
2799
- mainAxis: !S,
2800
- crossAxis: !1,
2801
- fallbackAxisSideDirection: g ? "none" : "end",
2802
- padding: 5
2803
- }),
2804
- Qr({
2805
- padding: 5,
2806
- mainAxis: !x,
2807
- crossAxis: !1,
2808
- limiter: Zr({
2809
- mainAxis: !x
2810
- })
2811
- }),
2812
- eo({ element: b ? null : O, padding: 5 })
2813
- ]
2814
- }), V = P.context, R = to(V, {
2815
- enabled: i == null && !d
2816
- }), F = no(V, {
2817
- enabled: i == null && !!d,
2818
- handleClose: ro()
2819
- }), L = oo(V, {
2820
- escapeKey: !l,
2821
- outsidePress: () => s ? !1 : (t == null || t(), !0)
2822
- }), K = io(V), U = so([R, F, L, K]);
2823
- return Te(
2824
- () => ({
2825
- open: k,
2826
- setOpen: M,
2827
- onClose: t,
2828
- ...U,
2829
- ...P,
2830
- modal: r,
2831
- labelId: I,
2832
- descriptionId: N,
2833
- setLabelId: m,
2834
- setDescriptionId: E,
2835
- arrowRef: O,
2836
- disableCaret: b,
2837
- noPadding: _,
2838
- fillAvailableHeight: u,
2839
- matchReferenceWidth: a,
2840
- fixedWidth: h,
2841
- disableFlipFallback: g,
2842
- disableAutoUpdate: D,
2843
- disableFocusLock: c
2844
- }),
2845
- [
2846
- k,
2847
- M,
2848
- t,
2849
- U,
2850
- P,
2851
- r,
2852
- I,
2853
- N,
2854
- b,
2855
- _,
2856
- u,
2857
- a,
2858
- h,
2859
- g,
2860
- D,
2861
- c
2862
- ]
2863
- );
2864
- }
2865
- const wr = dt(null), Je = () => {
2866
- const e = Ve(wr);
2867
- if (e == null)
2868
- throw new Error("Popover components must be wrapped in <Popover />");
2869
- return e;
2870
- }, bi = function(e) {
2871
- const { children: n } = e, r = Je(), i = Q(null), o = Be([r.refs.setReference, i]);
2872
- return n({
2873
- "data-state": r.open ? "open" : "closed",
2874
- "data-anv": "popover-trigger",
2875
- ...r.getReferenceProps({ ref: o })
2876
- });
2877
- }, wi = "_content_x4y1q_4", Ei = "_arrow_x4y1q_26", mt = {
2878
- content: wi,
2879
- arrow: Ei,
2880
- "no-padding": "_no-padding_x4y1q_37"
2881
- }, Ci = ce(
2882
- function({ className: e, style: n, ...r }, i) {
2883
- const {
2884
- context: o,
2885
- theme: t,
2886
- mode: s,
2887
- disableCaret: l,
2888
- noPadding: d,
2889
- onClose: u,
2890
- disableFocusLock: a,
2891
- ...h
2892
- } = Je(), b = Be([h.refs.setFloating, i]);
2893
- if (!o.open)
2894
- return null;
2895
- const _ = se(e, mt.content, {
2896
- [mt["no-padding"]]: d
2897
- }), x = (S) => {
2898
- S.code === "Escape" && (u == null || u());
2899
- };
2900
- return /* @__PURE__ */ v.jsx(Ur, { children: /* @__PURE__ */ v.jsx(
2901
- qr,
2902
- {
2903
- context: o,
2904
- modal: h.modal,
2905
- order: ["reference", "content"],
2906
- disabled: a,
2907
- children: /* @__PURE__ */ v.jsx(Kr, { theme: t, mode: s, children: /* @__PURE__ */ v.jsxs(
2908
- "div",
2909
- {
2910
- ref: b,
2911
- "data-anv": "popover-content",
2912
- style: { ...h.floatingStyles, ...n },
2913
- "aria-labelledby": h.labelId,
2914
- "aria-describedby": h.descriptionId,
2915
- className: _,
2916
- ...h.getFloatingProps(r),
2917
- onKeyDown: x,
2918
- role: "presentation",
2919
- children: [
2920
- !l && /* @__PURE__ */ v.jsx(
2921
- zr,
2922
- {
2923
- ref: h.arrowRef,
2924
- context: o,
2925
- className: mt.arrow
2926
- }
2927
- ),
2928
- r.children
2929
- ]
2930
- }
2931
- ) })
2932
- }
2933
- ) });
2934
- }
2935
- ), Si = ce(
2936
- function(e, n) {
2937
- const { setOpen: r, onClose: i } = Je();
2938
- return /* @__PURE__ */ v.jsx(
2939
- We,
2940
- {
2941
- ref: n,
2942
- "data-anv": "popover-close",
2943
- ...e,
2944
- onClick: (o) => {
2945
- var t;
2946
- (t = e.onClick) == null || t.call(e, o), i == null || i(), r(!1);
2947
- }
2948
- }
2949
- );
2950
- }
2951
- ), Oi = ce(
2952
- function(e, n) {
2953
- const { children: r, size: i, ...o } = e, t = Je(), s = r.ref, l = Be([
2954
- t.refs.setReference,
2955
- n,
2956
- s
2957
- ]);
2958
- return /* @__PURE__ */ v.jsx(
2959
- We,
2960
- {
2961
- ref: l,
2962
- size: i,
2963
- "data-state": t.open ? "open" : "closed",
2964
- "data-anv": "popover-button",
2965
- ...t.getReferenceProps(o),
2966
- children: r
2967
- }
2968
- );
2969
- }
2970
- );
2971
- function Di({
2972
- children: e,
2973
- modal: n,
2974
- ...r
2975
- }) {
2976
- const i = xi({ modal: n, ...r }), { theme: o, mode: t = "light" } = Ve($r), s = Te(
2977
- () => ({ ...i, theme: o, mode: t }),
2978
- [t, i, o]
2979
- );
2980
- return /* @__PURE__ */ v.jsx(wr.Provider, { value: s, children: e });
2981
- }
2982
- const sn = Object.assign(Di, {
2983
- Trigger: bi,
2984
- Close: Si,
2985
- Content: Ci,
2986
- Button: Oi
2987
- }), Er = (e) => /* @__PURE__ */ _e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...e }, /* @__PURE__ */ _e.createElement("path", { d: "M9.29 6.71a.996.996 0 0 0 0 1.41L13.17 12l-3.88 3.88a.996.996 0 1 0 1.41 1.41l4.59-4.59a.996.996 0 0 0 0-1.41L10.7 6.7c-.38-.38-1.02-.38-1.41.01z" })), Ni = "_combobox_1jt3w_2", Ri = "_input_1jt3w_30", Pi = "_error_1jt3w_61", ki = "_small_1jt3w_86", Mi = "_large_1jt3w_89", Ti = "_disabled_1jt3w_113", Vi = "_chip_1jt3w_162", Ai = "_prefix_1jt3w_217", Hi = "_suffix_1jt3w_218", ji = "_empty_1jt3w_260", te = {
2988
- combobox: Ni,
2989
- "search-field": "_search-field_1jt3w_6",
2990
- "popover-content": "_popover-content_1jt3w_21",
2991
- "input-wrapper": "_input-wrapper_1jt3w_30",
2992
- input: Ri,
2993
- error: Pi,
2994
- "buttons-wrapper": "_buttons-wrapper_1jt3w_69",
2995
- small: ki,
2996
- large: Mi,
2997
- "close-button-wrapper": "_close-button-wrapper_1jt3w_93",
2998
- "close-button": "_close-button_1jt3w_93",
2999
- "loading-infinite": "_loading-infinite_1jt3w_113",
3000
- "loading-progress": "_loading-progress_1jt3w_113",
3001
- disabled: Ti,
3002
- "toggle-button-wrapper": "_toggle-button-wrapper_1jt3w_117",
3003
- "toggle-button": "_toggle-button_1jt3w_117",
3004
- "rows-wrapper": "_rows-wrapper_1jt3w_151",
3005
- "chip-wrapper": "_chip-wrapper_1jt3w_162",
3006
- chip: Vi,
3007
- prefix: Ai,
3008
- suffix: Hi,
3009
- "listview-option": "_listview-option_1jt3w_255",
3010
- empty: ji
3011
- }, an = dt(null), Qe = function() {
3012
- const e = Ve(
3013
- an
3014
- );
3015
- if (e == null)
3016
- throw new Error("useCombobox must be wrapped in <Combobox />");
3017
- return e;
3018
- }, Ki = function(e) {
3019
- const { multiple: n = !1, ...r } = e;
3020
- return n ? /* @__PURE__ */ v.jsx(Fi, { ...r }) : /* @__PURE__ */ v.jsx($i, { ...r });
3021
- }, $i = function(e) {
3022
- const { layoutStyles: n, componentProps: r } = Se(e), {
3023
- className: i,
3024
- style: o,
3025
- children: t,
3026
- open: s,
3027
- items: l,
3028
- itemToString: d,
3029
- onChange: u,
3030
- onSelectedItemChange: a,
3031
- disableCloseOnClickOutside: h = !1,
3032
- filterOptions: b,
3033
- ..._
3034
- } = r, [x, S] = J(l), [g, D] = J(!1), [c, f] = J(!1), [p, I] = J(!1), [m, N] = J([]);
3035
- function E(j) {
3036
- return d && j ? d(j) : j ? String(j) : "";
3037
- }
3038
- const {
3039
- isOpen: k,
3040
- getLabelProps: M,
3041
- getInputProps: O,
3042
- getToggleButtonProps: P,
3043
- getMenuProps: V,
3044
- getItemProps: R,
3045
- highlightedIndex: F,
3046
- selectedItem: L,
3047
- selectItem: K,
3048
- setInputValue: U,
3049
- inputValue: Z
3050
- } = ge({
3051
- ..._,
3052
- items: x,
3053
- itemToString(j) {
3054
- return E(j);
3055
- },
3056
- onInputValueChange({ inputValue: j, type: z }) {
3057
- z === ge.stateChangeTypes.InputKeyDownEnter || z === ge.stateChangeTypes.ItemClick ? S(l) : j != null && j !== "" ? S(on(l, j, b)) : S(l);
3058
- },
3059
- onSelectedItemChange({ selectedItem: j, ...z }) {
3060
- u != null && u(j || null), a != null && a({ selectedItem: j, ...z });
3061
- },
3062
- onIsOpenChange({ isOpen: j, inputValue: z, selectedItem: Y }) {
3063
- j === !1 && z === "" ? K(null) : j === !1 && U(Y != null ? E(Y) : "");
3064
- },
3065
- stateReducer(j, { type: z, changes: Y }) {
3066
- switch (z) {
3067
- case ge.stateChangeTypes.InputBlur:
3068
- return h ? {
3069
- ...Y,
3070
- isOpen: j.isOpen,
3071
- highlightedIndex: j.highlightedIndex
3072
- } : Y;
3073
- default:
3074
- return Y;
3075
- }
3076
- },
3077
- isItemDisabled(j) {
3078
- return g || !!(j && j instanceof Object && "disabled" in j && j.disabled || j && j instanceof Object && "readOnly" in j && j.readOnly || m.includes(j));
3079
- }
3080
- });
3081
- return /* @__PURE__ */ v.jsx(
3082
- an.Provider,
3083
- {
3084
- value: {
3085
- multiple: !1,
3086
- items: x,
3087
- itemToString: E,
3088
- isOpen: k,
3089
- getLabelProps: M,
3090
- getInputProps: O,
3091
- getToggleButtonProps: P,
3092
- getMenuProps: V,
3093
- getItemProps: R,
3094
- highlightedIndex: F,
3095
- selectedItem: L,
3096
- selectedItems: [],
3097
- disabledItems: m,
3098
- setDisabledItems: N,
3099
- getSelectedItemProps: void 0,
3100
- getDropdownProps: void 0,
3101
- reset: void 0,
3102
- removeSelectedItem: void 0,
3103
- selectItem: K,
3104
- inputValue: Z,
3105
- isDisabledOrReadOnly: g,
3106
- setIsDisabledOrReadOnly: D,
3107
- hasDisabledPopover: c,
3108
- setHasDisabledPopover: f,
3109
- hasEmpty: p,
3110
- setHasEmpty: I
3111
- },
3112
- children: /* @__PURE__ */ v.jsx(
3113
- "div",
3114
- {
3115
- className: i,
3116
- "data-anv": "combobox",
3117
- style: { ...o, ...n },
3118
- children: /* @__PURE__ */ v.jsx(
3119
- sn,
3120
- {
3121
- open: s === !0 ? s : k,
3122
- noPadding: !0,
3123
- disableCaret: !0,
3124
- fillAvailableHeight: !0,
3125
- disableFlipFallback: !0,
3126
- matchReferenceWidth: !0,
3127
- children: t
3128
- }
3129
- )
3130
- }
3131
- )
3132
- }
3133
- );
3134
- }, Fi = function(e) {
3135
- const { layoutStyles: n, componentProps: r } = Se(e), {
3136
- className: i,
3137
- style: o,
3138
- children: t,
3139
- open: s,
3140
- items: l,
3141
- itemToString: d,
3142
- onChange: u,
3143
- onSelectedItemChange: a,
3144
- disableCloseOnClickOutside: h = !1,
3145
- filterOptions: b,
3146
- ..._
3147
- } = r, [x, S] = J(l), [g, D] = J(!1), [c, f] = J(!1), [p, I] = J(!1), [m, N] = J(""), [E, k] = J([]), [M, O] = J([]), { getSelectedItemProps: P, getDropdownProps: V, reset: R, removeSelectedItem: F } = Ne({
3148
- selectedItems: E,
3149
- onStateChange({ selectedItems: w, type: H }) {
3150
- switch (H) {
3151
- case Ne.stateChangeTypes.SelectedItemKeyDownBackspace:
3152
- case Ne.stateChangeTypes.SelectedItemKeyDownDelete:
3153
- case Ne.stateChangeTypes.DropdownKeyDownBackspace:
3154
- case Ne.stateChangeTypes.FunctionRemoveSelectedItem:
3155
- u != null && u(w ?? []), k(w ?? []);
3156
- break;
3157
- case Ne.stateChangeTypes.FunctionReset:
3158
- u != null && u([]), k([]), N("");
3159
- break;
3160
- }
3161
- }
3162
- });
3163
- function L(w) {
3164
- return d && w ? d(w) : w ? String(w) : "";
3165
- }
3166
- const {
3167
- isOpen: K,
3168
- getLabelProps: U,
3169
- getInputProps: Z,
3170
- getToggleButtonProps: j,
3171
- getMenuProps: z,
3172
- getItemProps: Y,
3173
- highlightedIndex: oe,
3174
- selectedItem: T,
3175
- selectItem: A
3176
- } = ge({
3177
- ..._,
3178
- items: x,
3179
- itemToString(w) {
3180
- return L(w);
3181
- },
3182
- selectedItem: null,
3183
- inputValue: m,
3184
- onInputValueChange({ inputValue: w, type: H }) {
3185
- H === ge.stateChangeTypes.InputKeyDownEnter || H === ge.stateChangeTypes.ItemClick ? S(l) : w != null && w !== "" ? S(on(l, w, b)) : S(l);
3186
- },
3187
- onIsOpenChange({ isOpen: w }) {
3188
- w === !1 && N("");
3189
- },
3190
- stateReducer(w, { type: H, changes: q }) {
3191
- switch (H) {
3192
- case ge.stateChangeTypes.InputBlur:
3193
- return h ? {
3194
- ...q,
3195
- isOpen: w.isOpen,
3196
- highlightedIndex: w.highlightedIndex
3197
- } : q;
3198
- default:
3199
- return q;
3200
- }
3201
- },
3202
- isItemDisabled(w) {
3203
- return g || !!(w && w instanceof Object && "disabled" in w && w.disabled || w && w instanceof Object && "readOnly" in w && w.readOnly || M.includes(w));
3204
- },
3205
- onStateChange({
3206
- inputValue: w = "",
3207
- type: H,
3208
- selectedItem: q
3209
- }) {
3210
- switch (H) {
3211
- case ge.stateChangeTypes.InputKeyDownEnter:
3212
- case ge.stateChangeTypes.ItemClick:
3213
- case ge.stateChangeTypes.InputBlur:
3214
- if (q) {
3215
- const W = E.includes(q) ? E.filter((B) => B !== q) : [...E, q];
3216
- u != null && u(W), k(W), N("");
3217
- }
3218
- break;
3219
- case ge.stateChangeTypes.InputChange:
3220
- N(w);
3221
- break;
3222
- }
3223
- }
3224
- });
3225
- return /* @__PURE__ */ v.jsx(
3226
- an.Provider,
3227
- {
3228
- value: {
3229
- multiple: !0,
3230
- items: x,
3231
- itemToString: L,
3232
- isOpen: K,
3233
- getLabelProps: U,
3234
- getInputProps: Z,
3235
- getToggleButtonProps: j,
3236
- getMenuProps: z,
3237
- getItemProps: Y,
3238
- highlightedIndex: oe,
3239
- selectedItem: T,
3240
- selectedItems: E,
3241
- disabledItems: M,
3242
- setDisabledItems: O,
3243
- getSelectedItemProps: P,
3244
- getDropdownProps: V,
3245
- reset: R,
3246
- removeSelectedItem: F,
3247
- selectItem: A,
3248
- inputValue: m,
3249
- isDisabledOrReadOnly: g,
3250
- setIsDisabledOrReadOnly: D,
3251
- hasDisabledPopover: c,
3252
- setHasDisabledPopover: f,
3253
- hasEmpty: p,
3254
- setHasEmpty: I
3255
- },
3256
- children: /* @__PURE__ */ v.jsx("div", { className: i, style: { ...o, ...n }, children: /* @__PURE__ */ v.jsx(
3257
- sn,
3258
- {
3259
- open: s === !0 ? s : K,
3260
- noPadding: !0,
3261
- disableCaret: !0,
3262
- fillAvailableHeight: !0,
3263
- disableFlipFallback: !0,
3264
- matchReferenceWidth: !0,
3265
- children: t
3266
- }
3267
- ) })
3268
- }
3269
- );
3270
- }, Li = ({
3271
- className: e,
3272
- label: n,
3273
- size: r,
3274
- error: i,
3275
- hint: o,
3276
- description: t,
3277
- required: s,
3278
- moreInfo: l,
3279
- openMoreInfo: d,
3280
- disabled: u,
3281
- readOnly: a,
3282
- prefix: h,
3283
- suffix: b,
3284
- maxRows: _,
3285
- ...x
3286
- }) => {
3287
- const {
3288
- isOpen: S,
3289
- itemToString: g,
3290
- getLabelProps: D,
3291
- getInputProps: c,
3292
- getToggleButtonProps: f,
3293
- selectedItems: p,
3294
- getSelectedItemProps: I,
3295
- getDropdownProps: m,
3296
- reset: N,
3297
- removeSelectedItem: E,
3298
- selectItem: k,
3299
- inputValue: M,
3300
- setIsDisabledOrReadOnly: O,
3301
- hasDisabledPopover: P
3302
- } = Qe(), V = Je(), R = se(te["input-wrapper"], {
3303
- [te.small]: r === "small",
3304
- [te.large]: r === "large"
3305
- }), F = Ie(), L = Ie(), K = se(te.input, e, {
3306
- [te.error]: i
3307
- });
3308
- de(() => (O(!!(u || a)), () => {
3309
- O(!1);
3310
- }), [u, a, O]);
3311
- let U = `label${F} `;
3312
- U += ` helper${L}`;
3313
- const Z = typeof i != "boolean" ? i : void 0, j = Q(null), [z, Y] = J(!1), [oe, T] = J(!1), [A, w] = J(
3314
- null
3315
- ), [H, q] = J(0);
3316
- wt(() => {
3317
- var B, ae;
3318
- if (_ !== void 0) {
3319
- if (z === !1)
3320
- Y(!0), T(!1), w(null), q((le) => le + 1);
3321
- else if ((B = j == null ? void 0 : j.current) != null && B.children) {
3322
- const le = (ae = j == null ? void 0 : j.current) == null ? void 0 : ae.children, ue = Array.from(le).reduce(
3323
- (C, he) => {
3324
- const ie = he.getBoundingClientRect().top;
3325
- return C.length ? C[C.length - 1].top === ie ? [
3326
- ...C.slice(0, -1),
3327
- { count: C[C.length - 1].count + 1, top: ie }
3328
- ] : C[C.length - 1].top !== ie ? [...C, { count: 1, top: ie }] : C : [{ count: 1, top: ie }];
3329
- },
3330
- []
3331
- );
3332
- if (!ue[1] || A === 0)
3333
- Y(!1);
3334
- else {
3335
- if (T(!0), A == null) {
3336
- const C = Math.max(
3337
- ue[0].count + ue[1].count - 2,
3338
- 0
3339
- );
3340
- w(C);
3341
- } else
3342
- w(A - 1);
3343
- q((C) => C + 1);
3344
- }
3345
- }
3346
- }
3347
- }, [p.length, _, H]);
3348
- const W = oe && _ != null && A !== null ? A : p.length;
3349
- return /* @__PURE__ */ v.jsxs("div", { className: te["search-field"], "data-anv": "combobox-searchfield", children: [
3350
- /* @__PURE__ */ v.jsxs("div", { children: [
3351
- /* @__PURE__ */ v.jsx(
3352
- bt,
3353
- {
3354
- ...D({
3355
- id: F,
3356
- required: s,
3357
- moreInfo: l,
3358
- openMoreInfo: d
3359
- }),
3360
- children: n
3361
- }
3362
- ),
3363
- /* @__PURE__ */ v.jsxs(
3364
- "div",
3365
- {
3366
- className: R,
3367
- ref: V.refs.setReference,
3368
- children: [
3369
- /* @__PURE__ */ v.jsxs("div", { className: te["buttons-wrapper"], children: [
3370
- M || p.length ? /* @__PURE__ */ v.jsx("div", { className: te["close-button-wrapper"], children: /* @__PURE__ */ v.jsx(
3371
- We,
3372
- {
3373
- "aria-label": "clear selection",
3374
- appearance: "ghost",
3375
- size: "small",
3376
- icon: Vn,
3377
- className: te["close-button"],
3378
- onClick: () => {
3379
- N != null ? N() : k(null);
3380
- },
3381
- tabIndex: -1,
3382
- disabled: u || a
3383
- }
3384
- ) }) : null,
3385
- P ? null : /* @__PURE__ */ v.jsx("div", { className: te["toggle-button-wrapper"], children: /* @__PURE__ */ v.jsx(
3386
- We,
3387
- {
3388
- "aria-label": "toggle menu",
3389
- ...f({
3390
- icon: Er,
3391
- className: te["toggle-button"],
3392
- disabled: u || a
3393
- }),
3394
- appearance: "ghost",
3395
- size: "small"
3396
- }
3397
- ) })
3398
- ] }),
3399
- /* @__PURE__ */ v.jsxs("div", { className: te["rows-wrapper"], ref: j, children: [
3400
- p.length && E != null && I != null ? p.slice(0, W).map((B, ae) => {
3401
- const { onClick: le, ...ue } = I({
3402
- selectedItem: B,
3403
- index: ae
3404
- });
3405
- return /* @__PURE__ */ v.jsx(
3406
- "div",
3407
- {
3408
- className: te["chip-wrapper"],
3409
- children: /* @__PURE__ */ v.jsx(
3410
- ln,
3411
- {
3412
- ...ue,
3413
- label: g(B),
3414
- onClose: () => E(B),
3415
- className: te.chip,
3416
- title: g(B)
3417
- }
3418
- )
3419
- },
3420
- `selected-item-${ae}`
3421
- );
3422
- }) : null,
3423
- oe && _ != null ? /* @__PURE__ */ v.jsx("div", { className: te["chip-wrapper"], children: /* @__PURE__ */ v.jsx(
3424
- ln,
3425
- {
3426
- label: `+${p.length - W}`,
3427
- className: te.chip,
3428
- title: p.slice(W).map((B) => g(B)).join(", ")
3429
- }
3430
- ) }) : null,
3431
- /* @__PURE__ */ v.jsxs(
3432
- vt,
3433
- {
3434
- flex: "1 1 100px",
3435
- alignItems: "center",
3436
- style: { width: "100px" },
3437
- children: [
3438
- h ? /* @__PURE__ */ v.jsx("div", { className: te.prefix, children: h }) : null,
3439
- /* @__PURE__ */ v.jsx(
3440
- "input",
3441
- {
3442
- ...m != null ? c(
3443
- m({
3444
- ...x,
3445
- className: K,
3446
- disabled: u,
3447
- readOnly: a,
3448
- required: s,
3449
- autoComplete: "off",
3450
- "aria-labelledby": U,
3451
- preventKeyAction: S
3452
- })
3453
- ) : c({
3454
- ...x,
3455
- className: K,
3456
- disabled: u,
3457
- readOnly: a,
3458
- required: s,
3459
- autoComplete: "off",
3460
- "aria-labelledby": U
3461
- })
3462
- }
3463
- ),
3464
- b ? /* @__PURE__ */ v.jsx("div", { className: te.suffix, children: b }) : null
3465
- ]
3466
- }
3467
- )
3468
- ] })
3469
- ]
3470
- }
3471
- )
3472
- ] }),
3473
- o || Z || t ? /* @__PURE__ */ v.jsx(
3474
- Et,
3475
- {
3476
- id: L,
3477
- errorMessage: Z,
3478
- hint: o,
3479
- description: t
3480
- }
3481
- ) : null
3482
- ] });
3483
- }, Bi = function({
3484
- children: e,
3485
- className: n,
3486
- disablePopover: r = !1,
3487
- ...i
3488
- }) {
3489
- const {
3490
- items: o,
3491
- highlightedIndex: t,
3492
- selectedItem: s,
3493
- selectedItems: l,
3494
- setHasDisabledPopover: d,
3495
- getMenuProps: u,
3496
- getItemProps: a,
3497
- isDisabledOrReadOnly: h
3498
- } = Qe(), b = se(
3499
- te["popover-content"],
3500
- n
3501
- );
3502
- return de(() => (d(r), () => {
3503
- d(!1);
3504
- }), [r, d]), r ? /* @__PURE__ */ v.jsx("div", { ...i, className: b, children: e ? e({
3505
- items: o,
3506
- highlightedIndex: t,
3507
- selectedItem: s,
3508
- getMenuProps: u,
3509
- getItemProps: a,
3510
- listProps: {
3511
- ...u({}, { suppressRefError: !0 }),
3512
- style: {
3513
- display: o.length ? "" : "none",
3514
- overflow: "auto"
3515
- }
3516
- },
3517
- options: o.map((_, x) => ({
3518
- optionProps: {
3519
- ...a({
3520
- item: _,
3521
- index: x
3522
- }),
3523
- selected: s === _ || l.includes(_),
3524
- disabled: h
3525
- // also see "isItemDisabled" function
3526
- },
3527
- item: _,
3528
- index: x
3529
- }))
3530
- }) : null }) : /* @__PURE__ */ v.jsx(
3531
- sn.Content,
3532
- {
3533
- "data-anv": "combobox-content",
3534
- ...i,
3535
- className: b,
3536
- children: e ? e({
3537
- items: o,
3538
- highlightedIndex: t,
3539
- selectedItem: s,
3540
- getMenuProps: u,
3541
- getItemProps: a,
3542
- listProps: {
3543
- ...u({}, { suppressRefError: !0 }),
3544
- style: {
3545
- display: o.length ? void 0 : "none",
3546
- overflow: "auto"
3547
- }
3548
- },
3549
- options: o.map((_, x) => ({
3550
- optionProps: {
3551
- ...a({
3552
- item: _,
3553
- index: x
3554
- }),
3555
- selected: s === _ || l.includes(_),
3556
- disabled: h
3557
- // also see "isItemDisabled" function
3558
- },
3559
- item: _,
3560
- index: x
3561
- }))
3562
- }) : null
3563
- }
3564
- );
3565
- }, Ui = function({
3566
- children: e,
3567
- ...n
3568
- }) {
3569
- const { getMenuProps: r, multiple: i, items: o, hasEmpty: t } = Qe();
3570
- return i ? /* @__PURE__ */ v.jsx(
3571
- "div",
3572
- {
3573
- ...r(n),
3574
- "data-anv": "combobox-list",
3575
- className: _t.listview,
3576
- style: {
3577
- display: o.length ? void 0 : "none",
3578
- overflow: "scroll"
3579
- },
3580
- children: e
3581
- }
3582
- ) : /* @__PURE__ */ v.jsxs(v.Fragment, { children: [
3583
- /* @__PURE__ */ v.jsx(
3584
- "ul",
3585
- {
3586
- ...r(n),
3587
- className: kn.listbox,
3588
- style: {
3589
- display: o.length ? void 0 : "none",
3590
- overflow: "scroll"
3591
- },
3592
- children: e
3593
- }
3594
- ),
3595
- !o.length && !t ? /* @__PURE__ */ v.jsx("div", { className: te.empty, children: /* @__PURE__ */ v.jsx(Tn, { subdued: !0, size: "small", children: "No results found" }) }) : null
3596
- ] });
3597
- }, qi = function({
3598
- children: e,
3599
- disabled: n,
3600
- item: r,
3601
- index: i,
3602
- ...o
3603
- }) {
3604
- const {
3605
- getItemProps: t,
3606
- multiple: s,
3607
- selectedItem: l,
3608
- selectedItems: d,
3609
- disabledItems: u,
3610
- setDisabledItems: a
3611
- } = Qe(), h = n || r && r instanceof Object && "disabled" in r && r.disabled;
3612
- return de(() => (n && !u.includes(r) ? a([...u, r]) : u.includes(r) && a(u.filter((b) => b === r)), () => {
3613
- u.includes(r) && a(u.filter((b) => b === r));
3614
- }), [r, n, a]), s ? /* @__PURE__ */ v.jsx(
3615
- "div",
3616
- {
3617
- "data-anv": "combobox-item",
3618
- ...t({
3619
- item: r,
3620
- index: i,
3621
- ...o
3622
- }),
3623
- className: se(
3624
- te["listview-option"],
3625
- _t["listview-option"]
3626
- ),
3627
- children: /* @__PURE__ */ v.jsxs("div", { className: se(te.cell, _t.cell), children: [
3628
- /* @__PURE__ */ v.jsx(
3629
- Ar,
3630
- {
3631
- checked: d.includes(r),
3632
- "aria-label": "Select",
3633
- ...h ? { disabled: !0 } : {}
3634
- }
3635
- ),
3636
- e
3637
- ] })
3638
- }
3639
- ) : /* @__PURE__ */ v.jsxs(
3640
- "li",
3641
- {
3642
- ...t({
3643
- item: r,
3644
- index: i,
3645
- ...o
3646
- }),
3647
- className: kn.option,
3648
- ...h ? { "aria-disabled": !0 } : {},
3649
- children: [
3650
- /* @__PURE__ */ v.jsx("span", { children: e }),
3651
- /* @__PURE__ */ v.jsx(
3652
- xt,
3653
- {
3654
- "aria-hidden": !0,
3655
- svg: lo,
3656
- inherit: !0,
3657
- className: te.Icon,
3658
- style: { opacity: l === r ? 1 : 0 }
3659
- }
3660
- )
3661
- ]
3662
- }
3663
- );
3664
- }, zi = function({
3665
- children: e
3666
- }) {
3667
- const { items: n, setHasEmpty: r } = Qe();
3668
- return de(() => (r(!0), () => {
3669
- r(!1);
3670
- })), n.length ? null : e;
3671
- }, $a = Object.assign(Ki, {
3672
- SearchField: Li,
3673
- Content: Bi,
3674
- List: Ui,
3675
- Item: qi,
3676
- Empty: zi
3677
- });
3678
- const Wi = "_details_1sjr5_4", Yi = "_summary_1sjr5_17", Gi = "_arrow_1sjr5_66", Xi = "_content_1sjr5_30", Ji = "_expanded_1sjr5_111", Me = {
3679
- details: Wi,
3680
- summary: Yi,
3681
- "content-wrapper": "_content-wrapper_1sjr5_30",
3682
- arrow: Gi,
3683
- content: Xi,
3684
- "is-expanded": "_is-expanded_1sjr5_108",
3685
- expanded: Ji
3686
- }, pt = dt({
3687
- id: "",
3688
- isExpanded: !1,
3689
- expanded: () => {
3690
- },
3691
- close: () => {
3692
- },
3693
- toggle: () => {
3694
- }
3695
- }), Qi = ce(
3696
- function(e, n) {
3697
- const { layoutStyles: r, componentProps: i } = Se(e), {
3698
- children: o,
3699
- id: t,
3700
- expanded: s,
3701
- defaultExpanded: l = !1,
3702
- style: d,
3703
- className: u,
3704
- ...a
3705
- } = i, h = Ie(), [b, _] = J(l);
3706
- function x() {
3707
- _(!0);
3708
- }
3709
- function S() {
3710
- _(!1);
3711
- }
3712
- function g() {
3713
- _((f) => !f);
3714
- }
3715
- const D = {
3716
- ...d,
3717
- ...r
3718
- }, c = Te(
3719
- () => ({
3720
- id: t ?? h,
3721
- isExpanded: s ?? b,
3722
- expanded: x,
3723
- close: S,
3724
- toggle: g
3725
- }),
3726
- [h, t, b, s]
3727
- );
3728
- return /* @__PURE__ */ v.jsx(pt.Provider, { value: c, children: /* @__PURE__ */ v.jsx(
3729
- "div",
3730
- {
3731
- "data-anv": "details",
3732
- ref: n,
3733
- className: se(Me.details, u),
3734
- style: D,
3735
- ...a,
3736
- children: o
3737
- }
3738
- ) });
3739
- }
3740
- ), Zi = ce(function({ children: e, onClick: n, className: r, ...i }, o) {
3741
- const { id: t, isExpanded: s, toggle: l } = Ve(pt), d = (...a) => {
3742
- n == null || n(...a), l();
3743
- }, u = se(Me.summary, r);
3744
- return /* @__PURE__ */ v.jsxs(
3745
- "button",
3746
- {
3747
- "data-anv": "details-summary",
3748
- "aria-controls": t,
3749
- "aria-expanded": s,
3750
- className: u,
3751
- onClick: d,
3752
- ref: o,
3753
- ...i,
3754
- children: [
3755
- /* @__PURE__ */ v.jsx(es, {}),
3756
- " ",
3757
- /* @__PURE__ */ v.jsx("span", { children: e })
3758
- ]
3759
- }
3760
- );
3761
- }), es = ce(
3762
- function({ className: e, ...n }, r) {
3763
- const { isExpanded: i } = Ve(pt), o = se(
3764
- Me.arrow,
3765
- { [Me["is-expanded"]]: i },
3766
- e
3767
- );
3768
- return /* @__PURE__ */ v.jsx("span", { className: o, ref: r, ...n, children: /* @__PURE__ */ v.jsx(xt, { size: "large", svg: Er }) });
3769
- }
3770
- ), ts = ce(
3771
- function({
3772
- className: e,
3773
- children: n,
3774
- height: r,
3775
- maxHeight: i,
3776
- style: o,
3777
- ...t
3778
- }, s) {
3779
- const { id: l, isExpanded: d } = Ve(pt), u = {
3780
- height: r,
3781
- maxHeight: i,
3782
- ...r || i ? { overflow: "auto" } : {},
3783
- ...o
3784
- };
3785
- return /* @__PURE__ */ v.jsx(
3786
- "div",
3787
- {
3788
- "data-anv": "details-content",
3789
- id: l,
3790
- className: se(Me["content-wrapper"], {
3791
- [Me.expanded]: d
3792
- }),
3793
- ref: s,
3794
- children: /* @__PURE__ */ v.jsx("div", { className: Me.content, children: /* @__PURE__ */ v.jsx("div", { className: e, style: u, ...t, children: n }) })
3795
- }
3796
- );
3797
- }
3798
- ), Fa = Object.assign(Qi, {
3799
- Summary: Zi,
3800
- Content: ts
3801
- });
3802
- const ns = "_dialog_1yq7p_4", rs = "_container_1yq7p_20", os = "_content_1yq7p_30", is = "_remove_1yq7p_43", ss = "_header_1yq7p_53", as = "_footer_1yq7p_72", ls = "_large_1yq7p_82", us = "_fullscreen_1yq7p_82", ds = "_sticky_1yq7p_98", xe = {
3803
- dialog: ns,
3804
- "close-dialog": "_close-dialog_1yq7p_1",
3805
- container: rs,
3806
- content: os,
3807
- "open-dialog": "_open-dialog_1yq7p_1",
3808
- "open-backdrop": "_open-backdrop_1yq7p_1",
3809
- remove: is,
3810
- "close-backdrop": "_close-backdrop_1yq7p_1",
3811
- header: ss,
3812
- "close-container": "_close-container_1yq7p_65",
3813
- footer: as,
3814
- large: ls,
3815
- fullscreen: us,
3816
- sticky: ds,
3817
- "close-button": "_close-button_1yq7p_104"
3818
- }, Cr = ce((e, n) => {
3819
- const { onClick: r, ...i } = e, { close: o } = cs(), t = (s) => {
3820
- o(), r == null || r(s);
3821
- };
3822
- return /* @__PURE__ */ v.jsx(
3823
- We,
3824
- {
3825
- "aria-label": "Close dialog",
3826
- "data-anv": "dialog-cancel-button",
3827
- onClick: t,
3828
- ref: n,
3829
- ...i
3830
- }
3831
- );
3832
- });
3833
- Cr.displayName = "DialogCancelButton";
3834
- const Sr = ce(
3835
- (e, n) => {
3836
- const { children: r, ...i } = e;
3837
- return /* @__PURE__ */ v.jsxs(
3838
- "header",
3839
- {
3840
- className: xe.header,
3841
- "data-anv": "dialog-header",
3842
- ref: n,
3843
- ...i,
3844
- children: [
3845
- /* @__PURE__ */ v.jsx(Tn, { variant: "headline", el: "h1", children: r }),
3846
- /* @__PURE__ */ v.jsx("span", { className: xe["close-container"], children: /* @__PURE__ */ v.jsx(
3847
- Cr,
3848
- {
3849
- className: xe["close-button"],
3850
- size: "small",
3851
- appearance: "ghost",
3852
- "aria-label": "Close dialog",
3853
- icon: Vn
3854
- }
3855
- ) })
3856
- ]
3857
- }
3858
- );
3859
- }
3860
- );
3861
- Sr.displayName = "DialogHeader";
3862
- const Or = ce(
3863
- (e, n) => {
3864
- const { children: r, sticky: i = !1, ...o } = e, t = se(xe.footer, {
3865
- [xe.sticky]: i
3866
- });
3867
- return /* @__PURE__ */ v.jsx(
3868
- "footer",
3869
- {
3870
- className: t,
3871
- "data-anv": "dialog-footer",
3872
- ref: n,
3873
- ...o,
3874
- children: r
3875
- }
3876
- );
3877
- }
3878
- );
3879
- Or.displayName = "DialogFooter";
3880
- const Dr = ce(
3881
- (e, n) => {
3882
- const { children: r, ...i } = e, o = se(xe.content, {});
3883
- return /* @__PURE__ */ v.jsx(
3884
- "div",
3885
- {
3886
- className: o,
3887
- "data-anv": "dialog-content",
3888
- ref: n,
3889
- ...i,
3890
- children: r
3891
- }
3892
- );
3893
- }
3894
- );
3895
- Dr.displayName = "DialogContent";
3896
- const Nr = dt(null), Rr = ce(
3897
- (e, n) => {
3898
- const {
3899
- className: r,
3900
- open: i = !1,
3901
- children: o,
3902
- onOpen: t,
3903
- onClose: s,
3904
- onCancel: l,
3905
- onClick: d,
3906
- onKeyDown: u,
3907
- fullScreen: a = !1,
3908
- disableCloseOnEscape: h = !1,
3909
- disableCloseOnClickOutside: b = !1,
3910
- size: _,
3911
- ...x
3912
- } = e, S = Q(null), g = Q(null), D = Q(null), c = Ie(), [f, p] = J(!1), I = se([xe.dialog], r, {
3913
- [xe.fullscreen]: a,
3914
- [xe.remove]: f,
3915
- [xe.large]: _ === "large"
3916
- }), m = Hr(S.current), N = m[0], E = m[m.length - 1], k = ee(() => {
3917
- var R;
3918
- if (D.current) {
3919
- const F = (D.current.dataset.dialogsOpen ? D.current.dataset.dialogsOpen.split(" ") : []).filter((L) => L !== c);
3920
- F.length === 0 ? (D.current.removeAttribute("data-dialogs-open"), (R = D.current) == null || R.classList.remove("dialog-open")) : D.current.dataset.dialogsOpen = F.join(" ");
3921
- }
3922
- }, [c]);
3923
- de(() => {
3924
- var R, F, L, K;
3925
- if (i) {
3926
- if (t == null || t(), (R = S.current) == null || R.showModal(), !D.current) {
3927
- const U = document.body ?? ((F = S.current) == null ? void 0 : F.closest("body"));
3928
- U && (D.current = U);
3929
- }
3930
- if (!((L = S.current) != null && L.querySelector(":focus")) && (N == null || N.focus()), (K = D.current) == null || K.classList.add("dialog-open"), D.current) {
3931
- const U = D.current.dataset.dialogsOpen ? D.current.dataset.dialogsOpen.split(" ") : [];
3932
- if (U.includes(c))
3933
- return;
3934
- U.push(c), D.current.dataset.dialogsOpen = U.join(" ");
3935
- }
3936
- return;
3937
- }
3938
- p(!0), setTimeout(() => {
3939
- var U;
3940
- (U = S.current) == null || U.close(), k(), p(!1);
3941
- }, 200);
3942
- }, [N, c, t, i, k]);
3943
- const M = (R) => {
3944
- R.preventDefault(), !h && (s == null || s());
3945
- }, O = (R) => {
3946
- var F;
3947
- d == null || d(R);
3948
- const L = R.target;
3949
- if (!((F = g.current) != null && F.contains(L))) {
3950
- if (R.preventDefault(), b)
3951
- return;
3952
- s == null || s();
3953
- }
3954
- }, P = (R) => {
3955
- if (u == null || u(R), R.code === "Tab") {
3956
- if (R.shiftKey && R.target === N) {
3957
- R.preventDefault(), E == null || E.focus();
3958
- return;
3959
- }
3960
- if (R.target === E && !R.shiftKey) {
3961
- R.preventDefault(), N == null || N.focus();
3962
- return;
3963
- }
3964
- }
3965
- }, V = Te(() => ({ close: () => {
3966
- p(!0), setTimeout(() => {
3967
- var R;
3968
- k(), (R = S.current) == null || R.close(), s == null || s();
3969
- }, 200);
3970
- } }), [s, k]);
3971
- return (
3972
- // dialog element does seem to be interactive on MDN guideline
3973
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
3974
- /* @__PURE__ */ v.jsx(
3975
- "dialog",
3976
- {
3977
- className: I,
3978
- "data-anv": "dialog",
3979
- ref: Be([n, S]),
3980
- onCancel: M,
3981
- onClick: O,
3982
- onKeyDown: P,
3983
- ...x,
3984
- children: /* @__PURE__ */ v.jsx(Nr.Provider, { value: V, children: /* @__PURE__ */ v.jsx("section", { ref: g, className: xe.container, children: o }) })
3985
- }
3986
- )
3987
- );
3988
- }
3989
- );
3990
- function cs() {
3991
- const e = Ve(Nr);
3992
- if (!e)
3993
- throw new Error(
3994
- "useDialogContext must be used within a DialogContextProvider"
3995
- );
3996
- return e;
3997
- }
3998
- Rr.displayName = "Dialog";
3999
- const La = Object.assign(Rr, {
4000
- Header: Sr,
4001
- Footer: Or,
4002
- Content: Dr
4003
- });
4004
- const ps = "_link_1ur2o_4", fs = "_secondary_1ur2o_36", hs = "_quiet_1ur2o_45", $e = {
4005
- link: ps,
4006
- secondary: fs,
4007
- quiet: hs
4008
- }, gs = (e) => /* @__PURE__ */ _e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...e }, /* @__PURE__ */ _e.createElement("path", { d: "M18 19H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h5c.55 0 1-.45 1-1s-.45-1-1-1H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6c0-.55-.45-1-1-1s-1 .45-1 1v5c0 .55-.45 1-1 1zM14 4c0 .55.45 1 1 1h2.59l-9.13 9.13a.996.996 0 1 0 1.41 1.41L19 6.41V9c0 .55.45 1 1 1s1-.45 1-1V4c0-.55-.45-1-1-1h-5c-.55 0-1 .45-1 1z" })), ms = ce((e, n) => {
4009
- const { layoutStyles: r, componentProps: i } = Se(e), {
4010
- children: o,
4011
- className: t,
4012
- appearance: s = "primary",
4013
- quiet: l,
4014
- style: d,
4015
- ...u
4016
- } = i, a = se([$e.link], t, {
4017
- [$e.quiet]: l,
4018
- [$e.secondary]: s === "secondary"
4019
- }), h = {
4020
- ...d,
4021
- ...r
4022
- };
4023
- return /* @__PURE__ */ v.jsxs(
4024
- "a",
4025
- {
4026
- className: a,
4027
- rel: "noopener noreferrer",
4028
- "data-anv": "link",
4029
- ref: n,
4030
- style: h,
4031
- ...u,
4032
- children: [
4033
- o,
4034
- u.target === "_blank" && /* @__PURE__ */ v.jsx(xt, { inherit: !0, svg: gs })
4035
- ]
4036
- }
4037
- );
4038
- });
4039
- ms.displayName = "Link";
4040
- const Ba = (e) => {
4041
- const { layoutStyles: n, componentProps: r } = Se(e), { className: i, appearance: o = "primary", quiet: t, style: s } = r, l = se([$e.link], i, {
4042
- [$e.quiet]: t,
4043
- [$e.secondary]: o === "secondary"
4044
- }), d = Object.assign({}, s, n);
4045
- return { linkClassNames: l, styleCombined: d };
4046
- };
4047
- const vs = "_overflow_l5ucx_2", _s = "_expanded_l5ucx_2", Is = "_content_l5ucx_55", ys = "_horizontal_l5ucx_96", xs = "_truncate_l5ucx_99", ne = {
4048
- overflow: vs,
4049
- expanded: _s,
4050
- "shadow-top": "_shadow-top_l5ucx_2",
4051
- "shadow-right": "_shadow-right_l5ucx_6",
4052
- "shadow-bottom": "_shadow-bottom_l5ucx_10",
4053
- "shadow-left": "_shadow-left_l5ucx_14",
4054
- "overflow-text": "_overflow-text_l5ucx_21",
4055
- "expand-button": "_expand-button_l5ucx_34",
4056
- content: Is,
4057
- horizontal: ys,
4058
- truncate: xs
4059
- }, Pr = ce(
4060
- (e, n) => {
4061
- const { rows: r = 1, ...i } = e, { layoutStyles: o, componentProps: t } = Se(i), [s, l] = J(!1), { className: d, style: u, children: a, ...h } = t, b = {
4062
- ...u,
4063
- ...o,
4064
- "--overflow-text-row": s ? "initial" : r
4065
- };
4066
- if ("expandable" in e && e.expandable === !0) {
4067
- const {
4068
- expandable: x,
4069
- expandText: S,
4070
- collapseText: g,
4071
- onExpand: D,
4072
- onCollapse: c,
4073
- ...f
4074
- } = h, p = S ?? "Show more...", I = g ?? "Show less...", m = (E) => {
4075
- if (l((k) => !k), s) {
4076
- c == null || c(E);
4077
- return;
4078
- }
4079
- D == null || D(E);
4080
- }, N = se(
4081
- [ne["overflow-text"]],
4082
- [ne.expandable],
4083
- {
4084
- [ne.expanded]: s
4085
- }
4086
- );
4087
- return /* @__PURE__ */ v.jsxs(
4088
- "div",
4089
- {
4090
- ref: n,
4091
- className: N,
4092
- style: b,
4093
- "data-anv": "overflow-text",
4094
- ...f,
4095
- children: [
4096
- /* @__PURE__ */ v.jsx("div", { className: ne.content, children: a }),
4097
- /* @__PURE__ */ v.jsx(
4098
- "button",
4099
- {
4100
- className: ne["expand-button"],
4101
- onClick: m,
4102
- "aria-hidden": !0,
4103
- children: s ? I : p
4104
- }
4105
- )
4106
- ]
4107
- }
4108
- );
4109
- }
4110
- const _ = se([ne["overflow-text"]]);
4111
- return /* @__PURE__ */ v.jsx(
4112
- "div",
4113
- {
4114
- ref: n,
4115
- className: _,
4116
- style: b,
4117
- "data-anv": "overflow-text",
4118
- ...h,
4119
- children: /* @__PURE__ */ v.jsx("div", { className: ne.content, children: a })
4120
- }
4121
- );
4122
- }
4123
- );
4124
- Pr.displayName = "OverflowText";
4125
- const kr = ce(
4126
- (e, n) => {
4127
- const { layoutStyles: r, componentProps: i } = Se(e), {
4128
- children: o,
4129
- className: t,
4130
- direction: s = "column",
4131
- style: l,
4132
- height: d,
4133
- width: u,
4134
- truncate: a,
4135
- gap: h,
4136
- ...b
4137
- } = i, _ = Q(null), [x, S] = J(!1), [g, D] = J({
4138
- left: !1,
4139
- right: !1,
4140
- top: !1,
4141
- bottom: !1
4142
- });
4143
- de(() => {
4144
- if (!_.current)
4145
- return;
4146
- if (s === "row") {
4147
- const N = _.current.offsetWidth < _.current.scrollWidth;
4148
- D((E) => ({
4149
- ...E,
4150
- right: N
4151
- }));
4152
- return;
4153
- }
4154
- const m = _.current.offsetHeight < _.current.scrollHeight;
4155
- D((N) => ({
4156
- ...N,
4157
- bottom: m
4158
- }));
4159
- }, [s]);
4160
- const c = () => {
4161
- if (!_.current)
4162
- return;
4163
- const m = _.current;
4164
- if (s === "row") {
4165
- const k = m.scrollLeft > 0, M = m.scrollLeft < m.scrollWidth - m.offsetWidth;
4166
- D({
4167
- left: k,
4168
- right: M,
4169
- top: !1,
4170
- bottom: !1
4171
- });
4172
- return;
4173
- }
4174
- const N = m.scrollTop > 0, E = m.scrollTop < m.scrollHeight - m.offsetHeight;
4175
- D({
4176
- top: N,
4177
- bottom: E,
4178
- left: !1,
4179
- right: !1
4180
- });
4181
- }, f = se([ne.overflow], {
4182
- [ne.vertical]: s === "column",
4183
- [ne.horizontal]: s === "row",
4184
- [ne.truncate]: !!a,
4185
- [ne.expanded]: x
4186
- });
4187
- if (a) {
4188
- const m = {
4189
- ...l,
4190
- ...r
4191
- }, N = {
4192
- minHeight: d ?? void 0
4193
- }, E = typeof a == "object" ? a.expandText : "Show more...", k = typeof a == "object" ? a.collapseText : "Show less...", M = (O) => {
4194
- var P, V;
4195
- if (S((R) => !R), setTimeout(() => {
4196
- c();
4197
- }, 100), typeof a == "object") {
4198
- if (x) {
4199
- (P = a.onCollapse) == null || P.call(a, O);
4200
- return;
4201
- }
4202
- (V = a.onExpand) == null || V.call(a, O);
4203
- }
4204
- };
4205
- return /* @__PURE__ */ v.jsxs(
4206
- "div",
4207
- {
4208
- ref: n,
4209
- style: m,
4210
- className: f,
4211
- "data-anv": "overflow",
4212
- ...b,
4213
- children: [
4214
- g.top && !a ? /* @__PURE__ */ v.jsx("div", { className: ne["shadow-top"] }) : null,
4215
- g.left && !a ? /* @__PURE__ */ v.jsx("div", { className: ne["shadow-left"] }) : null,
4216
- /* @__PURE__ */ v.jsx(
4217
- vt,
4218
- {
4219
- className: ne.content,
4220
- onScroll: c,
4221
- style: N,
4222
- ref: _,
4223
- direction: s,
4224
- gap: h,
4225
- tabIndex: 0,
4226
- children: o
4227
- }
4228
- ),
4229
- g.bottom && !a ? /* @__PURE__ */ v.jsx("div", { className: ne["shadow-bottom"] }) : null,
4230
- g.right && !a ? /* @__PURE__ */ v.jsx("div", { className: ne["shadow-right"] }) : null,
4231
- /* @__PURE__ */ v.jsx(
4232
- "button",
4233
- {
4234
- className: ne["expand-button"],
4235
- onClick: M,
4236
- children: x ? k : E
4237
- }
4238
- )
4239
- ]
4240
- }
4241
- );
4242
- }
4243
- const p = {
4244
- ...l,
4245
- ...r
4246
- }, I = {
4247
- minHeight: d ?? void 0
4248
- };
4249
- return /* @__PURE__ */ v.jsxs(
4250
- "div",
4251
- {
4252
- ref: n,
4253
- style: p,
4254
- className: f,
4255
- "data-anv": "overflow",
4256
- ...b,
4257
- children: [
4258
- g.left ? /* @__PURE__ */ v.jsx("div", { className: ne["shadow-left"] }) : null,
4259
- g.top ? /* @__PURE__ */ v.jsx("div", { className: ne["shadow-top"] }) : null,
4260
- /* @__PURE__ */ v.jsx(
4261
- vt,
4262
- {
4263
- className: ne.content,
4264
- onScroll: c,
4265
- ref: _,
4266
- style: I,
4267
- direction: s,
4268
- gap: h,
4269
- tabIndex: 0,
4270
- children: o
4271
- }
4272
- ),
4273
- g.bottom ? /* @__PURE__ */ v.jsx("div", { className: ne["shadow-bottom"] }) : null,
4274
- g.right ? /* @__PURE__ */ v.jsx("div", { className: ne["shadow-right"] }) : null
4275
- ]
4276
- }
4277
- );
4278
- }
4279
- );
4280
- kr.displayName = "Overflow";
4281
- const Ua = Object.assign(kr, {
4282
- Text: Pr
4283
- });
4284
- var bs = wt, ws = function(n) {
4285
- var r = _e.useRef(n);
4286
- return bs(function() {
4287
- r.current = n;
4288
- }), r;
4289
- }, On = function(n, r) {
4290
- if (typeof n == "function") {
4291
- n(r);
4292
- return;
4293
- }
4294
- n.current = r;
4295
- }, Es = function(n, r) {
4296
- var i = Q();
4297
- return ee(function(o) {
4298
- n.current = o, i.current && On(i.current, null), i.current = r, r && On(r, o);
4299
- }, [r]);
4300
- }, Dn = {
4301
- "min-height": "0",
4302
- "max-height": "none",
4303
- height: "0",
4304
- visibility: "hidden",
4305
- overflow: "hidden",
4306
- position: "absolute",
4307
- "z-index": "-1000",
4308
- top: "0",
4309
- right: "0"
4310
- }, Cs = function(n) {
4311
- Object.keys(Dn).forEach(function(r) {
4312
- n.style.setProperty(r, Dn[r], "important");
4313
- });
4314
- }, Nn = Cs, pe = null, Rn = function(n, r) {
4315
- var i = n.scrollHeight;
4316
- return r.sizingStyle.boxSizing === "border-box" ? i + r.borderSize : i - r.paddingSize;
4317
- };
4318
- function Ss(e, n, r, i) {
4319
- r === void 0 && (r = 1), i === void 0 && (i = 1 / 0), pe || (pe = document.createElement("textarea"), pe.setAttribute("tabindex", "-1"), pe.setAttribute("aria-hidden", "true"), Nn(pe)), pe.parentNode === null && document.body.appendChild(pe);
4320
- var o = e.paddingSize, t = e.borderSize, s = e.sizingStyle, l = s.boxSizing;
4321
- Object.keys(s).forEach(function(b) {
4322
- var _ = b;
4323
- pe.style[_] = s[_];
4324
- }), Nn(pe), pe.value = n;
4325
- var d = Rn(pe, e);
4326
- pe.value = n, d = Rn(pe, e), pe.value = "x";
4327
- var u = pe.scrollHeight - o, a = u * r;
4328
- l === "border-box" && (a = a + o + t), d = Math.max(a, d);
4329
- var h = u * i;
4330
- return l === "border-box" && (h = h + o + t), d = Math.min(h, d), [d, u];
4331
- }
4332
- var Pn = function() {
4333
- }, Os = function(n, r) {
4334
- return n.reduce(function(i, o) {
4335
- return i[o] = r[o], i;
4336
- }, {});
4337
- }, Ds = [
4338
- "borderBottomWidth",
4339
- "borderLeftWidth",
4340
- "borderRightWidth",
4341
- "borderTopWidth",
4342
- "boxSizing",
4343
- "fontFamily",
4344
- "fontSize",
4345
- "fontStyle",
4346
- "fontWeight",
4347
- "letterSpacing",
4348
- "lineHeight",
4349
- "paddingBottom",
4350
- "paddingLeft",
4351
- "paddingRight",
4352
- "paddingTop",
4353
- // non-standard
4354
- "tabSize",
4355
- "textIndent",
4356
- // non-standard
4357
- "textRendering",
4358
- "textTransform",
4359
- "width",
4360
- "wordBreak"
4361
- ], Ns = !!document.documentElement.currentStyle, Rs = function(n) {
4362
- var r = window.getComputedStyle(n);
4363
- if (r === null)
4364
- return null;
4365
- var i = Os(Ds, r), o = i.boxSizing;
4366
- if (o === "")
4367
- return null;
4368
- Ns && o === "border-box" && (i.width = parseFloat(i.width) + parseFloat(i.borderRightWidth) + parseFloat(i.borderLeftWidth) + parseFloat(i.paddingRight) + parseFloat(i.paddingLeft) + "px");
4369
- var t = parseFloat(i.paddingBottom) + parseFloat(i.paddingTop), s = parseFloat(i.borderBottomWidth) + parseFloat(i.borderTopWidth);
4370
- return {
4371
- sizingStyle: i,
4372
- paddingSize: t,
4373
- borderSize: s
4374
- };
4375
- }, Ps = Rs;
4376
- function Mr(e, n, r) {
4377
- var i = ws(r);
4378
- _e.useLayoutEffect(function() {
4379
- var o = function(s) {
4380
- return i.current(s);
4381
- };
4382
- if (e)
4383
- return e.addEventListener(n, o), function() {
4384
- return e.removeEventListener(n, o);
4385
- };
4386
- }, []);
4387
- }
4388
- var ks = function(n) {
4389
- Mr(window, "resize", n);
4390
- }, Ms = function(n) {
4391
- Mr(document.fonts, "loadingdone", n);
4392
- }, Ts = ["cacheMeasurements", "maxRows", "minRows", "onChange", "onHeightChange"], Vs = function(n, r) {
4393
- var i = n.cacheMeasurements, o = n.maxRows, t = n.minRows, s = n.onChange, l = s === void 0 ? Pn : s, d = n.onHeightChange, u = d === void 0 ? Pn : d, a = ve(n, Ts), h = a.value !== void 0, b = _e.useRef(null), _ = Es(b, r), x = _e.useRef(0), S = _e.useRef(), g = function() {
4394
- var f = b.current, p = i && S.current ? S.current : Ps(f);
4395
- if (p) {
4396
- S.current = p;
4397
- var I = Ss(p, f.value || f.placeholder || "x", t, o), m = I[0], N = I[1];
4398
- x.current !== m && (x.current = m, f.style.setProperty("height", m + "px", "important"), u(m, {
4399
- rowHeight: N
4400
- }));
4401
- }
4402
- }, D = function(f) {
4403
- h || g(), l(f);
4404
- };
4405
- return _e.useLayoutEffect(g), ks(g), Ms(g), /* @__PURE__ */ _e.createElement("textarea", $({}, a, {
4406
- onChange: D,
4407
- ref: _
4408
- }));
4409
- }, As = /* @__PURE__ */ _e.forwardRef(Vs);
4410
- const Hs = "_textarea_1bgqi_4", js = "_counter_1bgqi_50", Ks = "_error_1bgqi_62", $s = "_disabled_1bgqi_69", Fs = "_readonly_1bgqi_79", He = {
4411
- textarea: Hs,
4412
- "has-cols": "_has-cols_1bgqi_23",
4413
- counter: js,
4414
- error: Ks,
4415
- disabled: $s,
4416
- "disable-resize": "_disable-resize_1bgqi_76",
4417
- readonly: Fs
4418
- }, Ls = ce(
4419
- (e, n) => {
4420
- const { layoutStyles: r, componentProps: i } = Se(e), {
4421
- className: o,
4422
- disableResize: t,
4423
- error: s,
4424
- // errorAriaLive: errorAriaLiveProp = "assertive",
4425
- hint: l,
4426
- description: d,
4427
- label: u,
4428
- moreInfo: a,
4429
- onChange: h,
4430
- required: b,
4431
- showCounter: _,
4432
- onFocus: x,
4433
- onBlur: S,
4434
- id: g,
4435
- maxLength: D,
4436
- autoHeight: c,
4437
- labelProps: f,
4438
- placeholder: p,
4439
- style: I,
4440
- ...m
4441
- } = i, N = Q(null), [E, k] = J(0), [M, O] = J(!1), [P, V] = J(!1), [R, F] = J("off");
4442
- de(() => {
4443
- var H;
4444
- k(((H = N.current) == null ? void 0 : H.defaultValue.length) ?? 0);
4445
- }, []);
4446
- const L = (H) => {
4447
- h == null || h(H, { value: H.target.value }), E !== H.target.value.length && O(!0), k(H.target.value.length);
4448
- }, K = (H) => {
4449
- x == null || x(H), V(!0);
4450
- }, U = (H) => {
4451
- S == null || S(H), V(!1), F("off"), O(!1);
4452
- }, Z = Ie(), j = g ?? Z, z = Ie(), Y = Ie(), oe = typeof s != "boolean" ? s : void 0, T = se([He.textarea], o, {
4453
- [He.error]: s,
4454
- [He["disable-resize"]]: t,
4455
- [He.disabled]: m.disabled,
4456
- [He.readonly]: m.readOnly,
4457
- [He["has-cols"]]: m.cols != null
4458
- }), A = { ...I, ...r }, w = c ? As : "textarea";
4459
- return /* @__PURE__ */ v.jsxs(
4460
- "div",
4461
- {
4462
- className: T,
4463
- "data-anv": "textarea",
4464
- style: A,
4465
- children: [
4466
- u ? /* @__PURE__ */ v.jsx(
4467
- bt,
4468
- {
4469
- htmlFor: j,
4470
- moreInfo: a,
4471
- openMoreInfo: P,
4472
- required: b,
4473
- ...f,
4474
- children: u
4475
- }
4476
- ) : null,
4477
- /* @__PURE__ */ v.jsx(
4478
- w,
4479
- {
4480
- rows: 3,
4481
- onChange: L,
4482
- onFocus: K,
4483
- onBlur: U,
4484
- ref: Be([n, N]),
4485
- required: b,
4486
- maxLength: D,
4487
- id: j,
4488
- placeholder: p,
4489
- ...m,
4490
- "aria-describedby": [Y, z].join(" "),
4491
- "aria-invalid": s ? !!s : void 0
4492
- }
4493
- ),
4494
- l || _ || oe || d ? /* @__PURE__ */ v.jsx(
4495
- Et,
4496
- {
4497
- id: z,
4498
- hint: l,
4499
- maxLength: D,
4500
- inputLength: E,
4501
- isTyping: M,
4502
- showCounter: _,
4503
- errorMessage: oe,
4504
- errorAriaLive: R,
4505
- description: d
4506
- }
4507
- ) : null,
4508
- /* @__PURE__ */ v.jsx(Mn, { "aria-hidden": !0, id: Y, children: p })
4509
- ]
4510
- }
4511
- );
4512
- }
4513
- );
4514
- Ls.displayName = "Textarea";
4515
- const Bs = "_textfield_1acx5_4", Us = "_input_1acx5_17", qs = "_prefix_1acx5_43", zs = "_suffix_1acx5_44", Ws = "_small_1acx5_101", Ys = "_large_1acx5_104", Gs = "_error_1acx5_113", Ce = {
4516
- textfield: Bs,
4517
- input: Us,
4518
- "input-wrapper": "_input-wrapper_1acx5_30",
4519
- prefix: qs,
4520
- suffix: zs,
4521
- "loading-spinner": "_loading-spinner_1acx5_63",
4522
- small: Ws,
4523
- large: Ys,
4524
- error: Gs
4525
- }, Xs = ce(
4526
- function(e, n) {
4527
- const { layoutStyles: r, componentProps: i } = Se(e), {
4528
- className: o,
4529
- error: t,
4530
- errorAriaLive: s = "assertive",
4531
- label: l,
4532
- moreInfo: d,
4533
- prefix: u,
4534
- suffix: a,
4535
- size: h,
4536
- type: b = "text",
4537
- required: _,
4538
- onFocus: x,
4539
- onBlur: S,
4540
- id: g,
4541
- description: D,
4542
- hint: c,
4543
- loading: f,
4544
- disabled: p,
4545
- labelProps: I,
4546
- style: m,
4547
- placeholder: N,
4548
- ...E
4549
- } = i, [k, M] = J(!1), [O, P] = J("off"), V = (T) => {
4550
- x == null || x(T), M(!0), P(s);
4551
- }, R = (T) => {
4552
- S == null || S(T), M(!1), P("off");
4553
- }, F = Ie(), L = g ?? F, K = Ie(), U = Ie(), Z = Ie(), j = Ie(), z = Q(null), Y = typeof t != "boolean" ? t : void 0, oe = { ...m, ...r };
4554
- return /* @__PURE__ */ v.jsxs(
4555
- "div",
4556
- {
4557
- className: se(Ce.textfield, o),
4558
- "data-anv": "textfield",
4559
- style: oe,
4560
- children: [
4561
- l ? /* @__PURE__ */ v.jsx(
4562
- bt,
4563
- {
4564
- moreInfo: d,
4565
- openMoreInfo: k,
4566
- required: _,
4567
- htmlFor: L,
4568
- ...I,
4569
- children: l
4570
- }
4571
- ) : null,
4572
- /* @__PURE__ */ v.jsxs(
4573
- "div",
4574
- {
4575
- className: se(Ce["input-wrapper"], {
4576
- [Ce.small]: h === "small",
4577
- [Ce.large]: h === "large"
4578
- }),
4579
- role: "presentation",
4580
- onClick: () => {
4581
- var T;
4582
- return (T = z.current) == null ? void 0 : T.focus();
4583
- },
4584
- children: [
4585
- u ? /* @__PURE__ */ v.jsx(
4586
- "div",
4587
- {
4588
- "aria-hidden": !0,
4589
- className: Ce.prefix,
4590
- id: `prefix${K}`,
4591
- children: u
4592
- }
4593
- ) : null,
4594
- /* @__PURE__ */ v.jsx(
4595
- "input",
4596
- {
4597
- id: L,
4598
- className: se(Ce.input, {
4599
- [Ce.error]: t
4600
- }),
4601
- onFocus: V,
4602
- onBlur: R,
4603
- ref: Be([n, z]),
4604
- required: _,
4605
- placeholder: N,
4606
- type: b,
4607
- disabled: p,
4608
- ...E,
4609
- "aria-describedby": [j, Z].join(" "),
4610
- "aria-invalid": t ? !!t : void 0
4611
- }
4612
- ),
4613
- f ? /* @__PURE__ */ v.jsx(Vr, { className: Ce["loading-spinner"] }) : null,
4614
- a ? /* @__PURE__ */ v.jsx(
4615
- "div",
4616
- {
4617
- className: Ce.suffix,
4618
- "aria-hidden": !0,
4619
- id: `suffix${U}`,
4620
- children: a
4621
- }
4622
- ) : null
4623
- ]
4624
- }
4625
- ),
4626
- c || Y || D ? /* @__PURE__ */ v.jsx(
4627
- Et,
4628
- {
4629
- id: Z,
4630
- hint: c,
4631
- errorMessage: Y,
4632
- errorAriaLive: O,
4633
- description: D
4634
- }
4635
- ) : null,
4636
- /* @__PURE__ */ v.jsx(Mn, { "aria-hidden": !0, id: j, children: N })
4637
- ]
4638
- }
4639
- );
4640
- }
4641
- ), qa = Object.assign(Xs, {});
4642
- export {
4643
- $a as C,
4644
- Dr as E,
4645
- Fa as H,
4646
- Pr as I,
4647
- Cr as R,
4648
- Ba as V,
4649
- Or as a,
4650
- sn as b,
4651
- qa as c,
4652
- Ls as d,
4653
- Ci as h,
4654
- Oi as j,
4655
- La as k,
4656
- Ua as o,
4657
- ms as q,
4658
- bi as v,
4659
- Sr as w,
4660
- Si as y
4661
- };
4662
- //# sourceMappingURL=index-1dc4c6d3.js.map