@servicetitan/anvil2 1.3.1 → 1.3.3

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