@rpcbase/ui 0.175.0 → 0.177.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/dist/components/DayPickerField/index.d.ts.map +1 -1
  2. package/dist/components/HourPickerField/index.d.ts.map +1 -1
  3. package/dist/index10.js +1 -1
  4. package/dist/index100.js +3 -3
  5. package/dist/index100.js.map +1 -1
  6. package/dist/index101.js +6 -4
  7. package/dist/index101.js.map +1 -1
  8. package/dist/index102.js +145 -6
  9. package/dist/index102.js.map +1 -1
  10. package/dist/index103.js +38 -144
  11. package/dist/index103.js.map +1 -1
  12. package/dist/index104.js +4 -39
  13. package/dist/index104.js.map +1 -1
  14. package/dist/index105.js +7 -4
  15. package/dist/index105.js.map +1 -1
  16. package/dist/index106.js +12 -6
  17. package/dist/index106.js.map +1 -1
  18. package/dist/index107.js +13 -13
  19. package/dist/index107.js.map +1 -1
  20. package/dist/index108.js +7 -13
  21. package/dist/index108.js.map +1 -1
  22. package/dist/index109.js +30 -6
  23. package/dist/index109.js.map +1 -1
  24. package/dist/index11.js +55 -59
  25. package/dist/index11.js.map +1 -1
  26. package/dist/index110.js +10 -31
  27. package/dist/index110.js.map +1 -1
  28. package/dist/index111.js +10 -10
  29. package/dist/index111.js.map +1 -1
  30. package/dist/index112.js +8 -10
  31. package/dist/index112.js.map +1 -1
  32. package/dist/index113.js +13 -8
  33. package/dist/index113.js.map +1 -1
  34. package/dist/index114.js +101 -13
  35. package/dist/index114.js.map +1 -1
  36. package/dist/index115.js +20 -102
  37. package/dist/index115.js.map +1 -1
  38. package/dist/index116.js +54 -20
  39. package/dist/index116.js.map +1 -1
  40. package/dist/index117.js +70 -51
  41. package/dist/index117.js.map +1 -1
  42. package/dist/index118.js +9 -72
  43. package/dist/index118.js.map +1 -1
  44. package/dist/index119.js +20 -9
  45. package/dist/index119.js.map +1 -1
  46. package/dist/index12.js +1 -1
  47. package/dist/index120.js +16 -20
  48. package/dist/index120.js.map +1 -1
  49. package/dist/index121.js +23 -16
  50. package/dist/index121.js.map +1 -1
  51. package/dist/index122.js +6 -23
  52. package/dist/index122.js.map +1 -1
  53. package/dist/index123.js +5 -6
  54. package/dist/index123.js.map +1 -1
  55. package/dist/index124.js +23 -5
  56. package/dist/index124.js.map +1 -1
  57. package/dist/index125.js +35 -24
  58. package/dist/index125.js.map +1 -1
  59. package/dist/index126.js +16 -35
  60. package/dist/index126.js.map +1 -1
  61. package/dist/index127.js +7 -16
  62. package/dist/index127.js.map +1 -1
  63. package/dist/index128.js +4 -6
  64. package/dist/index128.js.map +1 -1
  65. package/dist/index129.js +4 -4
  66. package/dist/index129.js.map +1 -1
  67. package/dist/index13.js +2 -2
  68. package/dist/index130.js +4 -4
  69. package/dist/index130.js.map +1 -1
  70. package/dist/index131.js +4 -4
  71. package/dist/index131.js.map +1 -1
  72. package/dist/index132.js +3 -4
  73. package/dist/index132.js.map +1 -1
  74. package/dist/index133.js +6 -3
  75. package/dist/index133.js.map +1 -1
  76. package/dist/index134.js +24 -7
  77. package/dist/index134.js.map +1 -1
  78. package/dist/index135.js +8 -24
  79. package/dist/index135.js.map +1 -1
  80. package/dist/index136.js +6 -7
  81. package/dist/index136.js.map +1 -1
  82. package/dist/index137.js +5 -6
  83. package/dist/index137.js.map +1 -1
  84. package/dist/index138.js +3 -5
  85. package/dist/index138.js.map +1 -1
  86. package/dist/index139.js +3 -3
  87. package/dist/index139.js.map +1 -1
  88. package/dist/index14.js +4 -4
  89. package/dist/index140.js +4 -3
  90. package/dist/index140.js.map +1 -1
  91. package/dist/index141.js +3 -4
  92. package/dist/index141.js.map +1 -1
  93. package/dist/index142.js +4 -3
  94. package/dist/index142.js.map +1 -1
  95. package/dist/index143.js +3 -4
  96. package/dist/index143.js.map +1 -1
  97. package/dist/index144.js +3 -3
  98. package/dist/index144.js.map +1 -1
  99. package/dist/index145.js +3 -3
  100. package/dist/index145.js.map +1 -1
  101. package/dist/index146.js +46 -3
  102. package/dist/index146.js.map +1 -1
  103. package/dist/index147.js +51 -44
  104. package/dist/index147.js.map +1 -1
  105. package/dist/index148.js +1 -1
  106. package/dist/index15.js +1 -1
  107. package/dist/index150.js +1 -1
  108. package/dist/index153.js +2 -2
  109. package/dist/index16.js +1 -1
  110. package/dist/index17.js +1 -1
  111. package/dist/index175.js +57 -15
  112. package/dist/index175.js.map +1 -1
  113. package/dist/index176.js +8 -5
  114. package/dist/index176.js.map +1 -1
  115. package/dist/index177.js +65 -4
  116. package/dist/index177.js.map +1 -1
  117. package/dist/index178.js +18 -57
  118. package/dist/index178.js.map +1 -1
  119. package/dist/index179.js +14 -64
  120. package/dist/index179.js.map +1 -1
  121. package/dist/index18.js +328 -331
  122. package/dist/index18.js.map +1 -1
  123. package/dist/index180.js +5 -6
  124. package/dist/index180.js.map +1 -1
  125. package/dist/index181.js +5 -4
  126. package/dist/index181.js.map +1 -1
  127. package/dist/index182.js +6 -7
  128. package/dist/index182.js.map +1 -1
  129. package/dist/index183.js +4 -17
  130. package/dist/index183.js.map +1 -1
  131. package/dist/index184.js +7 -5
  132. package/dist/index184.js.map +1 -1
  133. package/dist/index185.js +17 -5
  134. package/dist/index185.js.map +1 -1
  135. package/dist/index186.js +5 -13
  136. package/dist/index186.js.map +1 -1
  137. package/dist/index187.js +5 -10
  138. package/dist/index187.js.map +1 -1
  139. package/dist/index188.js +13 -14
  140. package/dist/index188.js.map +1 -1
  141. package/dist/index189.js +10 -14
  142. package/dist/index189.js.map +1 -1
  143. package/dist/index19.js +7 -7
  144. package/dist/index190.js +14 -5
  145. package/dist/index190.js.map +1 -1
  146. package/dist/index191.js +14 -6
  147. package/dist/index191.js.map +1 -1
  148. package/dist/index192.js +5 -7
  149. package/dist/index192.js.map +1 -1
  150. package/dist/index193.js +5 -5
  151. package/dist/index193.js.map +1 -1
  152. package/dist/index194.js +7 -9
  153. package/dist/index194.js.map +1 -1
  154. package/dist/index195.js +6 -5
  155. package/dist/index195.js.map +1 -1
  156. package/dist/index196.js +9 -5
  157. package/dist/index196.js.map +1 -1
  158. package/dist/index197.js +5 -9
  159. package/dist/index197.js.map +1 -1
  160. package/dist/index198.js +5 -5
  161. package/dist/index198.js.map +1 -1
  162. package/dist/index199.js +9 -5
  163. package/dist/index199.js.map +1 -1
  164. package/dist/index20.js +2 -2
  165. package/dist/index200.js +5 -4
  166. package/dist/index200.js.map +1 -1
  167. package/dist/index201.js +5 -11
  168. package/dist/index201.js.map +1 -1
  169. package/dist/index202.js +4 -10
  170. package/dist/index202.js.map +1 -1
  171. package/dist/index203.js +9 -8
  172. package/dist/index203.js.map +1 -1
  173. package/dist/index204.js +10 -11
  174. package/dist/index204.js.map +1 -1
  175. package/dist/index205.js +10 -11
  176. package/dist/index205.js.map +1 -1
  177. package/dist/index206.js +11 -10
  178. package/dist/index206.js.map +1 -1
  179. package/dist/index207.js +10 -6
  180. package/dist/index207.js.map +1 -1
  181. package/dist/index208.js +10 -6
  182. package/dist/index208.js.map +1 -1
  183. package/dist/index209.js +7 -5
  184. package/dist/index209.js.map +1 -1
  185. package/dist/index21.js +1 -1
  186. package/dist/index210.js +5 -5
  187. package/dist/index210.js.map +1 -1
  188. package/dist/index211.js +5 -7
  189. package/dist/index211.js.map +1 -1
  190. package/dist/index212.js +6 -6
  191. package/dist/index212.js.map +1 -1
  192. package/dist/index213.js +7 -55
  193. package/dist/index213.js.map +1 -1
  194. package/dist/index214.js +6 -8
  195. package/dist/index214.js.map +1 -1
  196. package/dist/index215.js +54 -18
  197. package/dist/index215.js.map +1 -1
  198. package/dist/index22.js +1 -1
  199. package/dist/index220.js +3 -3
  200. package/dist/index226.js +1 -1
  201. package/dist/index227.js +2 -2
  202. package/dist/index229.js +1 -1
  203. package/dist/index23.js +1 -1
  204. package/dist/index231.js +1 -1
  205. package/dist/index232.js +1 -1
  206. package/dist/index233.js +4 -4
  207. package/dist/index234.js +2 -2
  208. package/dist/index239.js +1 -1
  209. package/dist/index24.js +1 -1
  210. package/dist/index240.js +1 -1
  211. package/dist/index27.js +3 -37
  212. package/dist/index27.js.map +1 -1
  213. package/dist/index270.js +1 -1
  214. package/dist/index272.js +4 -4
  215. package/dist/index28.js +125 -3
  216. package/dist/index28.js.map +1 -1
  217. package/dist/index285.js +2 -2
  218. package/dist/index288.js +1 -1
  219. package/dist/index289.js +2 -2
  220. package/dist/index29.js +227 -120
  221. package/dist/index29.js.map +1 -1
  222. package/dist/index291.js +1 -1
  223. package/dist/index292.js +1 -1
  224. package/dist/index293.js +1 -1
  225. package/dist/index294.js +1 -1
  226. package/dist/index295.js +69 -65
  227. package/dist/index295.js.map +1 -1
  228. package/dist/index296.js +8 -68
  229. package/dist/index296.js.map +1 -1
  230. package/dist/index297.js +14 -9
  231. package/dist/index297.js.map +1 -1
  232. package/dist/index298.js +66 -14
  233. package/dist/index298.js.map +1 -1
  234. package/dist/index299.js +64 -65
  235. package/dist/index299.js.map +1 -1
  236. package/dist/index30.js +21 -229
  237. package/dist/index30.js.map +1 -1
  238. package/dist/index31.js +50 -23
  239. package/dist/index31.js.map +1 -1
  240. package/dist/index32.js +2640 -50
  241. package/dist/index32.js.map +1 -1
  242. package/dist/index33.js +351 -2598
  243. package/dist/index33.js.map +1 -1
  244. package/dist/index34.js +214 -375
  245. package/dist/index34.js.map +1 -1
  246. package/dist/index35.js +19 -230
  247. package/dist/index35.js.map +1 -1
  248. package/dist/index36.js +138 -18
  249. package/dist/index36.js.map +1 -1
  250. package/dist/index37.js +170 -125
  251. package/dist/index37.js.map +1 -1
  252. package/dist/index38.js +64 -174
  253. package/dist/index38.js.map +1 -1
  254. package/dist/index39.js +88 -74
  255. package/dist/index39.js.map +1 -1
  256. package/dist/index40.js +5 -90
  257. package/dist/index40.js.map +1 -1
  258. package/dist/index41.js +843 -5
  259. package/dist/index41.js.map +1 -1
  260. package/dist/index42.js +54 -832
  261. package/dist/index42.js.map +1 -1
  262. package/dist/index43.js +37 -66
  263. package/dist/index43.js.map +1 -1
  264. package/dist/index46.js +1 -1
  265. package/dist/index47.js +1 -1
  266. package/dist/index48.js +1 -1
  267. package/dist/index5.js +1 -1
  268. package/dist/index50.js +2 -2
  269. package/dist/index55.js +1 -1
  270. package/dist/index56.js +1 -1
  271. package/dist/index57.js +1 -1
  272. package/dist/index59.js +1 -1
  273. package/dist/index61.js +1 -1
  274. package/dist/index62.js +1 -1
  275. package/dist/index63.js +1 -1
  276. package/dist/index67.js +1 -1
  277. package/dist/index70.js +2 -54
  278. package/dist/index70.js.map +1 -1
  279. package/dist/index71.js +2 -2
  280. package/dist/index72.js +6 -2
  281. package/dist/index72.js.map +1 -1
  282. package/dist/index73.js +7 -5
  283. package/dist/index73.js.map +1 -1
  284. package/dist/index74.js +5 -7
  285. package/dist/index74.js.map +1 -1
  286. package/dist/index75.js +52 -6
  287. package/dist/index75.js.map +1 -1
  288. package/dist/index76.js +5 -52
  289. package/dist/index76.js.map +1 -1
  290. package/dist/index77.js +4 -4
  291. package/dist/index77.js.map +1 -1
  292. package/dist/index78.js +15 -4
  293. package/dist/index78.js.map +1 -1
  294. package/dist/index79.js +5 -15
  295. package/dist/index79.js.map +1 -1
  296. package/dist/index8.js +1 -1
  297. package/dist/index80.js +7 -5
  298. package/dist/index80.js.map +1 -1
  299. package/dist/index81.js +15 -6
  300. package/dist/index81.js.map +1 -1
  301. package/dist/index82.js +4 -16
  302. package/dist/index82.js.map +1 -1
  303. package/dist/index83.js +1 -1
  304. package/dist/index83.js.map +1 -1
  305. package/dist/index84.js +5 -4
  306. package/dist/index84.js.map +1 -1
  307. package/dist/index85.js +4 -4
  308. package/dist/index85.js.map +1 -1
  309. package/dist/index86.js +4 -5
  310. package/dist/index86.js.map +1 -1
  311. package/dist/index87.js +2 -2
  312. package/dist/index87.js.map +1 -1
  313. package/dist/index88.js +5 -3
  314. package/dist/index88.js.map +1 -1
  315. package/dist/index89.js +24 -6
  316. package/dist/index89.js.map +1 -1
  317. package/dist/index9.js +1 -1
  318. package/dist/index90.js +6 -24
  319. package/dist/index90.js.map +1 -1
  320. package/dist/index91.js +4 -6
  321. package/dist/index91.js.map +1 -1
  322. package/dist/index92.js +5 -3
  323. package/dist/index92.js.map +1 -1
  324. package/dist/index93.js +5 -6
  325. package/dist/index93.js.map +1 -1
  326. package/dist/index94.js +4 -5
  327. package/dist/index94.js.map +1 -1
  328. package/dist/index95.js +4 -3
  329. package/dist/index95.js.map +1 -1
  330. package/dist/index96.js +4 -5
  331. package/dist/index96.js.map +1 -1
  332. package/dist/index97.js +8 -4
  333. package/dist/index97.js.map +1 -1
  334. package/dist/index98.js +5 -8
  335. package/dist/index98.js.map +1 -1
  336. package/dist/index99.js +4 -5
  337. package/dist/index99.js.map +1 -1
  338. package/package.json +1 -1
package/dist/index18.js CHANGED
@@ -1,112 +1,112 @@
1
- import { j as a } from "./index28.js";
2
- import { Check as ue, ChevronDown as ne, ChevronUp as ae } from "lucide-react";
3
- import * as n from "react";
4
- import { DismissableLayerBranch as fe } from "./index29.js";
1
+ import { j as f } from "./index27.js";
2
+ import { Check as ue, ChevronDown as oe, ChevronUp as ae } from "lucide-react";
3
+ import * as r from "react";
4
+ import { DismissableLayerBranch as fe } from "./index28.js";
5
5
  import { createPortal as de } from "react-dom";
6
6
  import { IMaskInput as me } from "react-imask";
7
7
  import pe, { InputMask as he } from "imask";
8
8
  import { Select as ve, SelectTrigger as be, SelectValue as ge, SelectContent as xe, SelectItem as we } from "./index20.js";
9
9
  import { useIsTouchDevice as ke } from "./index4.js";
10
10
  import { cn as q } from "./index2.js";
11
- const ee = pe;
12
- typeof ee.InputMask != "function" && (ee.InputMask = he);
13
- function Q(d) {
14
- return String(d).padStart(2, "0");
11
+ const te = pe;
12
+ typeof te.InputMask != "function" && (te.InputMask = he);
13
+ function Z(m) {
14
+ return String(m).padStart(2, "0");
15
15
  }
16
- function ye(d) {
17
- const f = d.trim();
18
- if (!f) return null;
19
- const r = /^(\d{1,2}):(\d{2})$/.exec(f);
20
- if (!r)
16
+ function ye(m) {
17
+ const d = m.trim();
18
+ if (!d) return null;
19
+ const n = /^(\d{1,2}):(\d{2})$/.exec(d);
20
+ if (!n)
21
21
  return null;
22
- const i = Number(r[1]), o = Number(r[2]);
23
- return !Number.isFinite(i) || !Number.isFinite(o) || i < 0 || i > 23 || o < 0 || o > 59 ? null : `${Q(i)}:${Q(o)}`;
22
+ const i = Number(n[1]), o = Number(n[2]);
23
+ return !Number.isFinite(i) || !Number.isFinite(o) || i < 0 || i > 23 || o < 0 || o > 59 ? null : `${Z(i)}:${Z(o)}`;
24
24
  }
25
- function J(d, f) {
26
- const r = ye(d);
27
- if (!r) return null;
28
- const i = f.find((o) => o.value === r);
29
- return z(i) ? { parsed: r, selectableValue: r } : { parsed: r, selectableValue: null };
25
+ function Q(m, d) {
26
+ const n = ye(m);
27
+ if (!n) return null;
28
+ const i = d.find((o) => o.value === n);
29
+ return B(i) ? { parsed: n, selectableValue: n } : { parsed: n, selectableValue: null };
30
30
  }
31
- function Z(d) {
32
- const f = /^(\d{2}):(\d{2})$/.exec(d);
33
- if (!f)
31
+ function U(m) {
32
+ const d = /^(\d{2}):(\d{2})$/.exec(m);
33
+ if (!d)
34
34
  return null;
35
- const r = Number(f[1]), i = Number(f[2]);
36
- return !Number.isFinite(r) || !Number.isFinite(i) ? null : r * 60 + i;
35
+ const n = Number(d[1]), i = Number(d[2]);
36
+ return !Number.isFinite(n) || !Number.isFinite(i) ? null : n * 60 + i;
37
37
  }
38
- function z(d) {
39
- return d ? !d.disabled : !1;
38
+ function B(m) {
39
+ return m ? !m.disabled : !1;
40
40
  }
41
- function te(d, f) {
42
- let r = null, i = Number.POSITIVE_INFINITY, o = Number.NEGATIVE_INFINITY;
43
- for (const g of f) {
44
- if (!z(g)) continue;
45
- const b = Z(g.value);
46
- if (b == null) continue;
47
- const N = Math.abs(b - d);
48
- (N < i || N === i && b > o) && (r = g, i = N, o = b);
41
+ function re(m, d) {
42
+ let n = null, i = Number.POSITIVE_INFINITY, o = Number.NEGATIVE_INFINITY;
43
+ for (const v of d) {
44
+ if (!B(v)) continue;
45
+ const g = U(v.value);
46
+ if (g == null) continue;
47
+ const N = Math.abs(g - m);
48
+ (N < i || N === i && g > o) && (n = v, i = N, o = g);
49
49
  }
50
- return r;
50
+ return n;
51
51
  }
52
- function re({
53
- direction: d,
54
- viewportRef: f,
55
- speed: r = 400,
52
+ function ne({
53
+ direction: m,
54
+ viewportRef: d,
55
+ speed: n = 400,
56
56
  className: i
57
57
  }) {
58
- const [o, g] = n.useState(!0), b = n.useRef(void 0), N = n.useRef(void 0), p = n.useRef(!1), h = n.useCallback(() => {
59
- const T = f.current;
60
- if (!T) {
61
- g(!0);
58
+ const [o, v] = r.useState(!0), g = r.useRef(void 0), N = r.useRef(void 0), p = r.useRef(!1), h = r.useCallback(() => {
59
+ const y = d.current;
60
+ if (!y) {
61
+ v(!0);
62
62
  return;
63
63
  }
64
- const { scrollTop: x, scrollHeight: v, clientHeight: M } = T, w = 2, A = x > w, D = x < v - M - w;
65
- if (!(v > M + w)) {
66
- g(!0);
64
+ const { scrollTop: x, scrollHeight: b, clientHeight: M } = y, w = 2, F = x > w, D = x < b - M - w;
65
+ if (!(b > M + w)) {
66
+ v(!0);
67
67
  return;
68
68
  }
69
- g(d === "up" ? !A : !D);
70
- }, [d, f]);
71
- n.useEffect(() => {
72
- const T = f.current;
73
- if (!T) return;
69
+ v(m === "up" ? !F : !D);
70
+ }, [m, d]);
71
+ r.useEffect(() => {
72
+ const y = d.current;
73
+ if (!y) return;
74
74
  h();
75
- const x = () => h(), v = () => h();
76
- T.addEventListener("scroll", x, { passive: !0 });
77
- const M = new ResizeObserver(v);
78
- M.observe(T);
79
- const w = new MutationObserver(v);
80
- return w.observe(T, { childList: !0, subtree: !0 }), () => {
81
- T.removeEventListener("scroll", x), M.disconnect(), w.disconnect();
75
+ const x = () => h(), b = () => h();
76
+ y.addEventListener("scroll", x, { passive: !0 });
77
+ const M = new ResizeObserver(b);
78
+ M.observe(y);
79
+ const w = new MutationObserver(b);
80
+ return w.observe(y, { childList: !0, subtree: !0 }), () => {
81
+ y.removeEventListener("scroll", x), M.disconnect(), w.disconnect();
82
82
  };
83
- }, [f, h]);
84
- const j = n.useCallback(() => {
85
- b.current && (cancelAnimationFrame(b.current), b.current = void 0), p.current = !1, N.current = void 0;
86
- }, []), P = n.useCallback(
87
- (T) => {
88
- const x = f.current;
83
+ }, [d, h]);
84
+ const I = r.useCallback(() => {
85
+ g.current && (cancelAnimationFrame(g.current), g.current = void 0), p.current = !1, N.current = void 0;
86
+ }, []), C = r.useCallback(
87
+ (y) => {
88
+ const x = d.current;
89
89
  if (!x || o || !p.current) {
90
- j();
90
+ I();
91
91
  return;
92
92
  }
93
- N.current || (N.current = T);
94
- const v = T - N.current, M = r * v / 1e3;
93
+ N.current || (N.current = y);
94
+ const b = y - N.current, M = n * b / 1e3;
95
95
  if (M < 0.1) {
96
- b.current = requestAnimationFrame(P);
96
+ g.current = requestAnimationFrame(C);
97
97
  return;
98
98
  }
99
- const w = x.scrollTop, A = x.scrollHeight - x.clientHeight;
99
+ const w = x.scrollTop, F = x.scrollHeight - x.clientHeight;
100
100
  let D;
101
- d === "up" ? D = Math.max(0, w - M) : D = Math.min(A, w + M), x.scrollTop = D, N.current = T;
102
- const I = 1;
103
- (d === "up" ? D > I : D < A - I) && Math.abs(D - w) > 0.01 ? b.current = requestAnimationFrame(P) : (j(), setTimeout(h, 16));
101
+ m === "up" ? D = Math.max(0, w - M) : D = Math.min(F, w + M), x.scrollTop = D, N.current = y;
102
+ const R = 1;
103
+ (m === "up" ? D > R : D < F - R) && Math.abs(D - w) > 0.01 ? g.current = requestAnimationFrame(C) : (I(), setTimeout(h, 16));
104
104
  },
105
- [h, d, o, r, j, f]
106
- ), O = n.useCallback(() => {
107
- o || !f.current || p.current || (p.current = !0, N.current = void 0, b.current = requestAnimationFrame(P));
108
- }, [o, P, f]);
109
- return n.useEffect(() => j, [j]), /* @__PURE__ */ a.jsx(
105
+ [h, m, o, n, I, d]
106
+ ), V = r.useCallback(() => {
107
+ o || !d.current || p.current || (p.current = !0, N.current = void 0, g.current = requestAnimationFrame(C));
108
+ }, [o, C, d]);
109
+ return r.useEffect(() => I, [I]), /* @__PURE__ */ f.jsx(
110
110
  "div",
111
111
  {
112
112
  className: q(
@@ -115,246 +115,236 @@ function re({
115
115
  i
116
116
  ),
117
117
  onPointerEnter: () => {
118
- o || O();
118
+ o || V();
119
119
  },
120
120
  onPointerMove: () => {
121
- !o && !p.current && O();
121
+ !o && !p.current && V();
122
122
  },
123
123
  onPointerLeave: () => {
124
- j();
124
+ I();
125
125
  },
126
- children: d === "up" ? /* @__PURE__ */ a.jsx(ae, { "aria-hidden": !0, className: "h-4 w-4 opacity-50" }) : /* @__PURE__ */ a.jsx(ne, { "aria-hidden": !0, className: "h-4 w-4 opacity-50" })
126
+ children: m === "up" ? /* @__PURE__ */ f.jsx(ae, { "aria-hidden": !0, className: "h-4 w-4 opacity-50" }) : /* @__PURE__ */ f.jsx(oe, { "aria-hidden": !0, className: "h-4 w-4 opacity-50" })
127
127
  }
128
128
  );
129
129
  }
130
- function oe({
131
- id: d,
132
- value: f,
133
- onChange: r,
130
+ function se({
131
+ id: m,
132
+ value: d,
133
+ onChange: n,
134
134
  onValueUpdate: i,
135
135
  options: o,
136
- placeholder: g = "Select time",
137
- className: b,
136
+ placeholder: v = "Select time",
137
+ className: g,
138
138
  inputClassName: N,
139
139
  disabled: p,
140
140
  readOnly: h,
141
- open: j,
142
- onOpenChange: P,
143
- triggerTestId: O,
144
- contentTestId: T,
141
+ open: I,
142
+ onOpenChange: C,
143
+ triggerTestId: V,
144
+ contentTestId: y,
145
145
  isHydrated: x
146
146
  }) {
147
- const v = n.useId(), M = d ?? `hours-picker-${v}`, w = n.useRef(null), A = n.useRef(null), D = n.useRef(null), I = n.useRef(!1), [F, K] = n.useState(null), R = n.useRef(null), _ = n.useRef(null), V = n.useRef(null), [t, l] = n.useState(() => ({
147
+ const b = r.useId(), M = m ?? `hours-picker-${b}`, w = r.useRef(null), F = r.useRef(null), D = r.useRef(null), R = r.useRef(!1), [L, W] = r.useState(null), j = r.useRef(null), _ = r.useRef(null), z = r.useRef(null), [t, l] = r.useState(() => ({
148
148
  left: 0,
149
149
  top: 0,
150
150
  width: 0
151
- })), [k, S] = n.useState(!1), m = j ?? k, B = P ?? S, se = typeof window > "u" ? n.useEffect : n.useLayoutEffect;
152
- n.useEffect(() => {
153
- if (!m || p || h)
151
+ })), [k, S] = r.useState(!1), u = I ?? k, H = C ?? S, X = typeof window > "u" ? r.useEffect : r.useLayoutEffect;
152
+ r.useEffect(() => {
153
+ if (!u || p || h)
154
154
  return;
155
155
  const e = w.current;
156
156
  e instanceof HTMLInputElement && (typeof document < "u" && document.activeElement === e || e.focus({ preventScroll: !0 }));
157
- }, [p, m, h]);
158
- const W = n.useCallback((e) => {
159
- D.current = e, K(e);
160
- }, []), ie = n.useCallback(() => {
161
- I.current = !0;
157
+ }, [p, u, h]);
158
+ const $ = r.useCallback((e) => {
159
+ D.current = e, W(e);
160
+ }, []), ie = r.useCallback(() => {
161
+ R.current = !0;
162
162
  }, []);
163
- n.useEffect(() => {
164
- if (!m) return;
165
- const e = o.find((c) => c.value === f);
166
- if (e && z(e)) {
167
- W(e.value);
163
+ r.useEffect(() => {
164
+ if (!u) return;
165
+ const e = o.find((c) => c.value === d);
166
+ if (e && B(e)) {
167
+ $(e.value);
168
168
  return;
169
169
  }
170
- const s = o.find((c) => z(c));
171
- W(s?.value ?? null);
172
- }, [m, o, W, f]);
173
- const ce = n.useCallback(
170
+ const s = o.find((c) => B(c));
171
+ $(s?.value ?? null);
172
+ }, [u, o, $, d]);
173
+ const ce = r.useCallback(
174
174
  (e) => {
175
175
  if (e === null) {
176
- if (i) {
177
- i(null);
178
- return;
179
- }
180
- r(null);
176
+ i && i(null);
181
177
  return;
182
178
  }
183
179
  const s = o.find((c) => c.value === e);
184
- if (z(s)) {
185
- if (i) {
186
- i(e);
187
- return;
188
- }
189
- r(e);
190
- }
180
+ B(s) && i && i(e);
191
181
  },
192
- [r, i, o]
193
- ), U = n.useCallback(
182
+ [i, o]
183
+ ), ee = r.useCallback(
194
184
  (e) => {
195
185
  if (e === null) {
196
- i && i(null), r(null);
186
+ i && i(null), n(null);
197
187
  return;
198
188
  }
199
189
  const s = o.find((c) => c.value === e);
200
- z(s) && (i && i(e), r(e));
190
+ B(s) && (i && i(e), n(e));
201
191
  },
202
- [r, i, o]
192
+ [n, i, o]
203
193
  );
204
- n.useEffect(() => {
205
- if (!m) return;
194
+ r.useEffect(() => {
195
+ if (!u) return;
206
196
  const e = (s) => {
207
197
  const c = s.target;
208
198
  if (!(c instanceof Node))
209
199
  return;
210
- const u = R.current;
211
- !u || u.contains(c) || _.current?.contains(c) || B(!1);
200
+ const a = j.current;
201
+ !a || a.contains(c) || _.current?.contains(c) || H(!1);
212
202
  };
213
203
  return document.addEventListener("pointerdown", e, !0), () => {
214
204
  document.removeEventListener("pointerdown", e, !0);
215
205
  };
216
- }, [m, B]), n.useEffect(() => {
217
- if (!m)
206
+ }, [u, H]), r.useEffect(() => {
207
+ if (!u)
218
208
  return;
219
209
  const e = _.current;
220
210
  if (!e)
221
211
  return;
222
212
  const s = (c) => {
223
- const u = V.current;
224
- if (!u)
213
+ const a = z.current;
214
+ if (!a)
225
215
  return;
226
216
  const E = c.deltaY;
227
217
  if (E === 0)
228
218
  return;
229
- const C = Math.max(0, u.scrollHeight - u.clientHeight), y = u.scrollTop <= 0, G = u.scrollTop >= C, L = c.target;
230
- if (L instanceof Node && u.contains(L)) {
231
- (E < 0 && y || E > 0 && G) && c.preventDefault();
219
+ const A = Math.max(0, a.scrollHeight - a.clientHeight), T = a.scrollTop <= 0, G = a.scrollTop >= A, O = c.target;
220
+ if (O instanceof Node && a.contains(O)) {
221
+ (E < 0 && T || E > 0 && G) && c.preventDefault();
232
222
  return;
233
223
  }
234
224
  c.preventDefault();
235
- const Y = Math.min(C, Math.max(0, u.scrollTop + E));
236
- u.scrollTop = Y;
225
+ const K = Math.min(A, Math.max(0, a.scrollTop + E));
226
+ a.scrollTop = K;
237
227
  };
238
228
  return e.addEventListener("wheel", s, { passive: !1 }), () => {
239
229
  e.removeEventListener("wheel", s);
240
230
  };
241
- }, [m]), n.useEffect(() => {
242
- if (!m || j !== void 0 && !P || typeof window > "u" || !("IntersectionObserver" in window))
231
+ }, [u]), r.useEffect(() => {
232
+ if (!u || I !== void 0 && !C || typeof window > "u" || !("IntersectionObserver" in window))
243
233
  return;
244
234
  const e = w.current;
245
235
  if (!(e instanceof HTMLElement))
246
236
  return;
247
237
  let s = !0;
248
- const c = new IntersectionObserver((u) => {
238
+ const c = new IntersectionObserver((a) => {
249
239
  if (!s)
250
240
  return;
251
- const E = u[0];
252
- E && !E.isIntersecting && B(!1);
241
+ const E = a[0];
242
+ E && !E.isIntersecting && H(!1);
253
243
  });
254
244
  return c.observe(e), () => {
255
245
  s = !1, c.disconnect();
256
246
  };
257
- }, [P, m, j, B]);
258
- const $ = n.useCallback(() => {
247
+ }, [C, u, I, H]);
248
+ const Y = r.useCallback(() => {
259
249
  if (typeof window > "u") return;
260
250
  const e = w.current, s = _.current;
261
251
  if (!(e instanceof HTMLElement) || !s) return;
262
- const c = e.getBoundingClientRect(), u = s.offsetHeight, E = window.innerWidth ?? 0, C = window.innerHeight ?? 0, y = 8, G = c.width;
263
- let L = c.left;
264
- L + G > E - y && (L = Math.max(y, E - G - y)), L < y && (L = y);
265
- let H = c.bottom + y;
266
- const Y = H + u > C - y, X = c.top - u - y;
267
- Y && X >= y && (H = X), H < y && (H = y), H + u > C - y && (H = Math.max(y, C - u - y)), l({ left: L, top: H, width: G });
252
+ const c = e.getBoundingClientRect(), a = s.offsetHeight, E = window.innerWidth ?? 0, A = window.innerHeight ?? 0, T = 8, G = c.width;
253
+ let O = c.left;
254
+ O + G > E - T && (O = Math.max(T, E - G - T)), O < T && (O = T);
255
+ let P = c.bottom + T;
256
+ const K = P + a > A - T, J = c.top - a - T;
257
+ K && J >= T && (P = J), P < T && (P = T), P + a > A - T && (P = Math.max(T, A - a - T)), l({ left: O, top: P, width: G });
268
258
  }, []);
269
- return se(() => {
270
- if (!m || p || typeof window > "u") return;
271
- $();
272
- const e = window.requestAnimationFrame($);
273
- return window.addEventListener("scroll", $, !0), window.addEventListener("resize", $), () => {
274
- window.cancelAnimationFrame(e), window.removeEventListener("scroll", $, !0), window.removeEventListener("resize", $);
259
+ return X(() => {
260
+ if (!u || p || typeof window > "u") return;
261
+ Y();
262
+ const e = window.requestAnimationFrame(Y);
263
+ return window.addEventListener("scroll", Y, !0), window.addEventListener("resize", Y), () => {
264
+ window.cancelAnimationFrame(e), window.removeEventListener("scroll", Y, !0), window.removeEventListener("resize", Y);
275
265
  };
276
- }, [p, m, $]), n.useEffect(() => {
277
- if (!m) return;
278
- const e = V.current;
266
+ }, [p, u, Y]), r.useEffect(() => {
267
+ if (!u) return;
268
+ const e = z.current;
279
269
  if (!e) return;
280
270
  const c = requestAnimationFrame(() => {
281
- const u = e.querySelector('[role="option"][data-state="checked"]');
282
- if (u instanceof HTMLElement) {
283
- const Y = u.offsetTop - 8, X = u.offsetTop + u.offsetHeight + 8;
284
- if (Y < e.scrollTop) {
285
- e.scrollTop = Math.max(0, Y);
271
+ const a = e.querySelector('[role="option"][data-state="checked"]');
272
+ if (a instanceof HTMLElement) {
273
+ const K = a.offsetTop - 8, J = a.offsetTop + a.offsetHeight + 8;
274
+ if (K < e.scrollTop) {
275
+ e.scrollTop = Math.max(0, K);
286
276
  return;
287
277
  }
288
278
  const le = e.scrollTop + e.clientHeight;
289
- X > le && (e.scrollTop = Math.max(0, X - e.clientHeight));
279
+ J > le && (e.scrollTop = Math.max(0, J - e.clientHeight));
290
280
  return;
291
281
  }
292
282
  const E = Array.from(e.querySelectorAll('[role="option"]'));
293
283
  if (!E.length) return;
294
- let C, y;
295
- for (const H of E) {
296
- if (!H.hasAttribute("data-disabled")) {
297
- C = H;
284
+ let A, T;
285
+ for (const P of E) {
286
+ if (!P.hasAttribute("data-disabled")) {
287
+ A = P;
298
288
  break;
299
289
  }
300
- y = H;
290
+ T = P;
301
291
  }
302
- if (!C) return;
303
- const L = Math.max(0, (y || C).offsetTop - 8);
304
- e.scrollTop = L;
292
+ if (!A) return;
293
+ const O = Math.max(0, (T || A).offsetTop - 8);
294
+ e.scrollTop = O;
305
295
  });
306
296
  return () => cancelAnimationFrame(c);
307
- }, [m, o]), n.useEffect(() => {
308
- if (!m || !F || !I.current) return;
309
- const e = V.current;
297
+ }, [u, o]), r.useEffect(() => {
298
+ if (!u || !L || !R.current) return;
299
+ const e = z.current;
310
300
  if (!e) return;
311
- const s = e.querySelector(`[role="option"][data-value="${F}"]`);
301
+ const s = e.querySelector(`[role="option"][data-value="${L}"]`);
312
302
  if (!(s instanceof HTMLElement)) return;
313
- const c = 8, u = s.offsetTop - c, E = s.offsetTop + s.offsetHeight + c;
314
- if (u < e.scrollTop) {
315
- e.scrollTop = Math.max(0, u);
303
+ const c = 8, a = s.offsetTop - c, E = s.offsetTop + s.offsetHeight + c;
304
+ if (a < e.scrollTop) {
305
+ e.scrollTop = Math.max(0, a);
316
306
  return;
317
307
  }
318
- const C = e.scrollTop + e.clientHeight;
319
- E > C && (e.scrollTop = Math.max(0, E - e.clientHeight));
320
- }, [F, m]), /* @__PURE__ */ a.jsx(
308
+ const A = e.scrollTop + e.clientHeight;
309
+ E > A && (e.scrollTop = Math.max(0, E - e.clientHeight));
310
+ }, [L, u]), /* @__PURE__ */ f.jsx(
321
311
  "div",
322
312
  {
323
313
  "data-slot": "hours-picker-input",
324
- className: q("w-[150px]", b),
325
- ref: R,
326
- children: /* @__PURE__ */ a.jsxs("div", { className: "relative", children: [
327
- /* @__PURE__ */ a.jsx(
314
+ className: q("w-[150px]", g),
315
+ ref: j,
316
+ children: /* @__PURE__ */ f.jsxs("div", { className: "relative", children: [
317
+ /* @__PURE__ */ f.jsx(
328
318
  Ee,
329
319
  {
330
320
  id: M,
331
- placeholder: g,
332
- value: f,
321
+ placeholder: v,
322
+ value: d,
333
323
  onValueUpdate: ce,
334
- onCommit: U,
324
+ onCommit: ee,
335
325
  options: o,
336
326
  disabled: p,
337
327
  readOnly: h,
338
- open: m,
339
- setOpen: B,
328
+ open: u,
329
+ setOpen: H,
340
330
  inputClassName: N,
341
- triggerTestId: O,
331
+ triggerTestId: V,
342
332
  isHydrated: x,
343
333
  highlightedValueRef: D,
344
- setHighlightedValue: W,
334
+ setHighlightedValue: $,
345
335
  markKeyboardNavigation: ie,
346
336
  inputRef: (e) => {
347
337
  w.current = e;
348
338
  },
349
- setDraftValueRef: A
339
+ setDraftValueRef: F
350
340
  }
351
341
  ),
352
- m ? (() => {
353
- const e = /* @__PURE__ */ a.jsx(fe, { children: /* @__PURE__ */ a.jsxs(
342
+ u ? (() => {
343
+ const e = /* @__PURE__ */ f.jsx(fe, { children: /* @__PURE__ */ f.jsxs(
354
344
  "div",
355
345
  {
356
346
  ref: _,
357
- "data-testid": T,
347
+ "data-testid": y,
358
348
  "data-state": "open",
359
349
  className: q(
360
350
  "pointer-events-auto fixed z-[60] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
@@ -366,22 +356,22 @@ function oe({
366
356
  width: t.width
367
357
  },
368
358
  children: [
369
- /* @__PURE__ */ a.jsx(
370
- re,
359
+ /* @__PURE__ */ f.jsx(
360
+ ne,
371
361
  {
372
362
  direction: "up",
373
- viewportRef: V
363
+ viewportRef: z
374
364
  }
375
365
  ),
376
- /* @__PURE__ */ a.jsx(
366
+ /* @__PURE__ */ f.jsx(
377
367
  "div",
378
368
  {
379
- ref: V,
369
+ ref: z,
380
370
  role: "listbox",
381
371
  className: "max-h-64 overflow-y-auto p-1 [overscroll-behavior:contain] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
382
372
  children: o.map((s) => {
383
- const c = s.value === f;
384
- return /* @__PURE__ */ a.jsxs(
373
+ const c = s.value === d;
374
+ return /* @__PURE__ */ f.jsxs(
385
375
  "div",
386
376
  {
387
377
  role: "option",
@@ -392,25 +382,25 @@ function oe({
392
382
  className: q(
393
383
  "relative flex w-full select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none cursor-pointer",
394
384
  s.disabled && "pointer-events-none opacity-50",
395
- F === s.value && "bg-accent text-accent-foreground"
385
+ L === s.value && "bg-accent text-accent-foreground"
396
386
  ),
397
- onMouseDown: (u) => {
398
- u.preventDefault();
387
+ onMouseDown: (a) => {
388
+ a.preventDefault();
399
389
  },
400
390
  onClick: () => {
401
- s.disabled || (A.current?.(s.value), W(s.value), w.current?.focus({ preventScroll: !0 }), U(s.value), B(!1));
391
+ s.disabled || (F.current?.(s.value), $(s.value), w.current?.focus({ preventScroll: !0 }), ee(s.value), H(!1));
402
392
  },
403
393
  onPointerEnter: () => {
404
- I.current || (I.current = !1, W(s.value));
394
+ R.current || (R.current = !1, $(s.value));
405
395
  },
406
- onPointerMove: (u) => {
407
- I.current && u.movementX === 0 && u.movementY === 0 || (I.current = !1, W(s.value));
396
+ onPointerMove: (a) => {
397
+ R.current && a.movementX === 0 && a.movementY === 0 || (R.current = !1, $(s.value));
408
398
  },
409
399
  children: [
410
- /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: c ? /* @__PURE__ */ a.jsx(ue, { "aria-hidden": !0, className: "h-4 w-4" }) : null }),
411
- /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col", children: [
412
- /* @__PURE__ */ a.jsx("span", { children: s.label }),
413
- s.description != null ? /* @__PURE__ */ a.jsx("span", { "data-slot": "description", className: "text-xs text-muted-foreground", children: s.description }) : null
400
+ /* @__PURE__ */ f.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: c ? /* @__PURE__ */ f.jsx(ue, { "aria-hidden": !0, className: "h-4 w-4" }) : null }),
401
+ /* @__PURE__ */ f.jsxs("div", { className: "flex flex-col", children: [
402
+ /* @__PURE__ */ f.jsx("span", { children: s.label }),
403
+ s.description != null ? /* @__PURE__ */ f.jsx("span", { "data-slot": "description", className: "text-xs text-muted-foreground", children: s.description }) : null
414
404
  ] })
415
405
  ]
416
406
  },
@@ -419,11 +409,11 @@ function oe({
419
409
  })
420
410
  }
421
411
  ),
422
- /* @__PURE__ */ a.jsx(
423
- re,
412
+ /* @__PURE__ */ f.jsx(
413
+ ne,
424
414
  {
425
415
  direction: "down",
426
- viewportRef: V
416
+ viewportRef: z
427
417
  }
428
418
  )
429
419
  ]
@@ -435,72 +425,72 @@ function oe({
435
425
  }
436
426
  );
437
427
  }
438
- oe.displayName = "HourPickerInput";
428
+ se.displayName = "HourPickerInput";
439
429
  function Te({
440
- id: d,
441
- value: f,
442
- onChange: r,
430
+ id: m,
431
+ value: d,
432
+ onChange: n,
443
433
  onValueUpdate: i,
444
434
  options: o,
445
- placeholder: g = "Select time",
446
- className: b,
435
+ placeholder: v = "Select time",
436
+ className: g,
447
437
  inputClassName: N,
448
438
  disabled: p,
449
439
  open: h,
450
- onOpenChange: j,
451
- triggerTestId: P,
452
- contentTestId: O,
453
- isHydrated: T
440
+ onOpenChange: I,
441
+ triggerTestId: C,
442
+ contentTestId: V,
443
+ isHydrated: y
454
444
  }) {
455
- const x = n.useCallback(
456
- (v) => {
457
- const M = o.find((w) => w.value === v);
458
- z(M) && (i && i(v), r(v));
445
+ const x = r.useCallback(
446
+ (b) => {
447
+ const M = o.find((w) => w.value === b);
448
+ B(M) && (i && i(b), n(b));
459
449
  },
460
- [r, i, o]
450
+ [n, i, o]
461
451
  );
462
- return /* @__PURE__ */ a.jsx("div", { "data-slot": "hours-picker-field", className: q("w-[150px]", b), children: /* @__PURE__ */ a.jsxs(
452
+ return /* @__PURE__ */ f.jsx("div", { "data-slot": "hours-picker-field", className: q("w-[150px]", g), children: /* @__PURE__ */ f.jsxs(
463
453
  ve,
464
454
  {
465
455
  disabled: p,
466
456
  open: h,
467
- onOpenChange: j,
468
- value: f ?? "",
469
- onValueChange: (v) => x(v),
457
+ onOpenChange: I,
458
+ value: d ?? "",
459
+ onValueChange: (b) => x(b),
470
460
  children: [
471
- /* @__PURE__ */ a.jsx(
461
+ /* @__PURE__ */ f.jsx(
472
462
  be,
473
463
  {
474
- id: d,
475
- "data-testid": P,
476
- "data-hydrated": T ? "true" : void 0,
464
+ id: m,
465
+ "data-testid": C,
466
+ "data-hydrated": y ? "true" : void 0,
477
467
  className: q(
478
468
  "transition-colors hover:bg-accent hover:text-accent-foreground",
479
- !f && "text-muted-foreground",
469
+ !d && "text-muted-foreground",
480
470
  h && "ring-2 ring-primary ring-offset-2",
481
471
  "[&_[data-slot='description']]:hidden",
482
472
  N
483
473
  ),
484
- children: /* @__PURE__ */ a.jsx(ge, { placeholder: g })
474
+ children: /* @__PURE__ */ f.jsx(ge, { placeholder: v })
485
475
  }
486
476
  ),
487
- /* @__PURE__ */ a.jsx(
477
+ /* @__PURE__ */ f.jsx(
488
478
  xe,
489
479
  {
490
- "data-testid": O,
480
+ "data-testid": V,
491
481
  autoScroll: "firstEnabledWithContext",
492
482
  className: "max-h-64 overflow-y-auto",
493
- children: o.map((v) => /* @__PURE__ */ a.jsxs(
483
+ children: o.map((b) => /* @__PURE__ */ f.jsxs(
494
484
  we,
495
485
  {
496
- value: v.value,
497
- disabled: v.disabled,
486
+ value: b.value,
487
+ disabled: b.disabled,
498
488
  children: [
499
- /* @__PURE__ */ a.jsx("span", { children: v.label }),
500
- v.description != null ? /* @__PURE__ */ a.jsx("span", { "data-slot": "description", className: "block text-xs text-muted-foreground", children: v.description }) : null
489
+ /* @__PURE__ */ f.jsx("span", { children: b.label }),
490
+ b.description != null ? /* @__PURE__ */ f.jsx("span", { "data-slot": "description", className: "block text-xs text-muted-foreground", children: b.description }) : null
501
491
  ]
502
492
  },
503
- v.value
493
+ b.value
504
494
  ))
505
495
  }
506
496
  )
@@ -508,71 +498,71 @@ function Te({
508
498
  }
509
499
  ) });
510
500
  }
511
- function Se(d) {
512
- return ke() ? /* @__PURE__ */ a.jsx(Te, { ...d }) : /* @__PURE__ */ a.jsx(oe, { ...d });
501
+ function Se(m) {
502
+ return ke() ? /* @__PURE__ */ f.jsx(Te, { ...m }) : /* @__PURE__ */ f.jsx(se, { ...m });
513
503
  }
514
504
  Se.displayName = "HourPickerField";
515
505
  function Ee({
516
- id: d,
517
- placeholder: f,
518
- value: r,
506
+ id: m,
507
+ placeholder: d,
508
+ value: n,
519
509
  onValueUpdate: i,
520
510
  onCommit: o,
521
- options: g,
522
- disabled: b,
511
+ options: v,
512
+ disabled: g,
523
513
  readOnly: N,
524
514
  open: p,
525
515
  setOpen: h,
526
- inputClassName: j,
527
- triggerTestId: P,
528
- isHydrated: O,
529
- highlightedValueRef: T,
516
+ inputClassName: I,
517
+ triggerTestId: C,
518
+ isHydrated: V,
519
+ highlightedValueRef: y,
530
520
  setHighlightedValue: x,
531
- markKeyboardNavigation: v,
521
+ markKeyboardNavigation: b,
532
522
  inputRef: M,
533
523
  setDraftValueRef: w
534
524
  }) {
535
- const A = n.useRef(!1), D = n.useRef(!1), I = n.useRef(!1), F = n.useRef(null), [K, R] = n.useState(() => r || "");
536
- n.useEffect(() => (w.current = (t) => {
537
- R(t);
525
+ const F = r.useRef(!1), D = r.useRef(!1), R = r.useRef(!1), L = r.useRef(null), [W, j] = r.useState(() => n || "");
526
+ r.useEffect(() => (w.current = (t) => {
527
+ j(t);
538
528
  }, () => {
539
529
  w.current = null;
540
530
  }), [w]);
541
- const _ = n.useCallback(
531
+ const _ = r.useCallback(
542
532
  (t) => {
543
- const l = T.current ?? r ?? "";
544
- let k = g.findIndex((S) => S.value === l);
545
- k === -1 && (k = t === 1 ? -1 : g.length);
546
- for (let S = k + t; S >= 0 && S < g.length; S += t) {
547
- const m = g[S];
548
- if (z(m)) {
549
- x(m.value), F.current = m.value, R(m.value), i(m.value);
533
+ const l = y.current ?? n ?? "";
534
+ let k = v.findIndex((S) => S.value === l);
535
+ k === -1 && (k = t === 1 ? -1 : v.length);
536
+ for (let S = k + t; S >= 0 && S < v.length; S += t) {
537
+ const u = v[S];
538
+ if (B(u)) {
539
+ x(u.value), L.current = u.value, j(u.value), i(u.value);
550
540
  return;
551
541
  }
552
542
  }
553
543
  },
554
- [T, i, g, x, r]
544
+ [y, i, v, x, n]
555
545
  );
556
- n.useEffect(() => {
557
- A.current || R(r || "");
558
- }, [r]);
559
- const V = q(
546
+ r.useEffect(() => {
547
+ F.current || j(n || "");
548
+ }, [n]);
549
+ const z = q(
560
550
  "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 pr-10 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
561
551
  "transition-colors group-hover:bg-accent group-hover:text-accent-foreground",
562
- !K && "text-muted-foreground",
552
+ !W && "text-muted-foreground",
563
553
  p && "ring-2 ring-primary ring-offset-2",
564
554
  "[&_[data-slot='description']]:hidden",
565
- j
555
+ I
566
556
  );
567
- return /* @__PURE__ */ a.jsxs("div", { className: "relative group", children: [
568
- /* @__PURE__ */ a.jsx(
557
+ return /* @__PURE__ */ f.jsxs("div", { className: "relative group", children: [
558
+ /* @__PURE__ */ f.jsx(
569
559
  me,
570
560
  {
571
- id: d,
572
- "data-testid": P,
573
- "data-hydrated": O ? "true" : void 0,
561
+ id: m,
562
+ "data-testid": C,
563
+ "data-hydrated": V ? "true" : void 0,
574
564
  type: "text",
575
- disabled: b,
565
+ disabled: g,
576
566
  readOnly: N,
577
567
  inputRef: M,
578
568
  autoComplete: "off",
@@ -583,48 +573,48 @@ function Ee({
583
573
  dispatch: (t, l) => {
584
574
  const k = (l.value + t).replace(/\D/g, "");
585
575
  if (k.length <= 2 || k.length >= 4) return l.compiledMasks[0];
586
- const S = Q(Number(k.slice(0, 2)));
587
- return g.some((B) => B.value.startsWith(`${S}:`)) ? l.compiledMasks[0] : l.compiledMasks[1];
576
+ const S = Z(Number(k.slice(0, 2)));
577
+ return v.some((H) => H.value.startsWith(`${S}:`)) ? l.compiledMasks[0] : l.compiledMasks[1];
588
578
  },
589
- placeholder: f,
590
- value: K,
591
- className: V,
579
+ placeholder: d,
580
+ value: W,
581
+ className: z,
592
582
  onAccept: (t) => {
593
583
  const l = typeof t == "string" ? t : String(t ?? "");
594
- R(l), l.replace(/\D/g, "").length === 0 && r && o(null);
584
+ j(l), l.replace(/\D/g, "").length === 0 && n && o(null);
595
585
  },
596
586
  onComplete: (t) => {
597
587
  const l = typeof t == "string" ? t : String(t ?? "");
598
- if (F.current === l) {
599
- F.current = null;
588
+ if (L.current === l) {
589
+ L.current = null;
600
590
  return;
601
591
  }
602
- const k = J(l, g);
592
+ const k = Q(l, v);
603
593
  if (!k)
604
594
  return;
605
595
  if (k.selectableValue) {
606
- if (x(k.selectableValue), R(k.selectableValue), r === k.selectableValue)
596
+ if (x(k.selectableValue), j(k.selectableValue), n === k.selectableValue)
607
597
  return;
608
598
  o(k.selectableValue);
609
599
  return;
610
600
  }
611
- const S = Z(k.parsed);
601
+ const S = U(k.parsed);
612
602
  if (S == null)
613
603
  return;
614
- const m = te(S, g);
615
- m && x(m.value);
604
+ const u = re(S, v);
605
+ u && x(u.value);
616
606
  },
617
607
  onPointerDown: () => {
618
- D.current = !0, !b && (p || h(!0));
608
+ D.current = !0, !g && (p || h(!0));
619
609
  },
620
610
  onMouseDown: (t) => {
621
- D.current = !0, I.current = typeof document < "u" && document.activeElement === t.currentTarget, !b && (p || h(!0));
611
+ D.current = !0, R.current = typeof document < "u" && document.activeElement === t.currentTarget, !g && (p || h(!0));
622
612
  },
623
613
  onClick: () => {
624
- b || p || h(!0);
614
+ g || p || h(!0);
625
615
  },
626
616
  onKeyDown: (t) => {
627
- if (!b) {
617
+ if (!g) {
628
618
  if (t.key === "Tab" && p && !t.defaultPrevented) {
629
619
  h(!1);
630
620
  return;
@@ -636,7 +626,7 @@ function Ee({
636
626
  return;
637
627
  }
638
628
  if (!p && !t.defaultPrevented && (t.key.length === 1 || t.key === "Backspace" || t.key === "Delete") && !t.ctrlKey && !t.metaKey && !t.altKey && h(!0), t.key === "ArrowDown" || t.key === "ArrowUp") {
639
- if (v(), t.preventDefault(), !p) {
629
+ if (b(), t.preventDefault(), !p) {
640
630
  h(!0);
641
631
  return;
642
632
  }
@@ -644,59 +634,66 @@ function Ee({
644
634
  return;
645
635
  }
646
636
  if (t.key === "Enter") {
647
- v();
648
- const l = J(K, g);
649
- if (!l)
637
+ b();
638
+ const l = Q(W, v);
639
+ if (!l) {
640
+ if (!p || W.trim() !== "")
641
+ return;
642
+ const u = v.find((X) => X.value === y.current), H = (B(u) ? u?.value : void 0) ?? v.find((X) => B(X))?.value;
643
+ if (!H)
644
+ return;
645
+ t.preventDefault(), x(H), j(H), o(H), h(!1);
650
646
  return;
647
+ }
651
648
  if (l.selectableValue) {
652
- t.preventDefault(), x(l.selectableValue), R(l.selectableValue), o(l.selectableValue), h(!1);
649
+ t.preventDefault(), x(l.selectableValue), j(l.selectableValue), o(l.selectableValue), h(!1);
653
650
  return;
654
651
  }
655
- const k = Z(l.parsed);
652
+ const k = U(l.parsed);
656
653
  if (k == null)
657
654
  return;
658
- const S = te(k, g);
655
+ const S = re(k, v);
659
656
  if (!S)
660
657
  return;
661
- t.preventDefault(), x(S.value), R(S.value), o(S.value), h(!1);
658
+ t.preventDefault(), x(S.value), j(S.value), o(S.value), h(!1);
662
659
  return;
663
660
  }
664
661
  }
665
662
  },
666
663
  onFocus: (t) => {
667
- const l = !D.current || !I.current;
668
- if (D.current = !1, I.current = !1, A.current = !0, l) {
664
+ const l = !D.current || !R.current;
665
+ if (D.current = !1, R.current = !1, F.current = !0, l) {
669
666
  const k = t.currentTarget;
670
667
  requestAnimationFrame(() => k.select());
671
668
  }
672
- b || p || h(!0);
669
+ g || p || h(!0);
673
670
  },
674
671
  onBlur: () => {
675
- A.current = !1;
676
- const t = K.trim();
672
+ F.current = !1;
673
+ const t = W.trim();
677
674
  if (!t) {
678
- R(r || "");
675
+ j(n || "");
679
676
  return;
680
677
  }
681
- const l = J(t, g);
678
+ const l = Q(t, v);
682
679
  if (!l) {
683
- R(r || "");
680
+ j(n || "");
684
681
  return;
685
682
  }
686
683
  if (!l.selectableValue) {
687
- R(r || "");
684
+ j(n || "");
688
685
  return;
689
686
  }
690
- R(l.selectableValue), r !== l.selectableValue && o(l.selectableValue);
687
+ j(l.selectableValue), n !== l.selectableValue && o(l.selectableValue);
691
688
  }
692
689
  }
693
690
  ),
694
- /* @__PURE__ */ a.jsx(
691
+ /* @__PURE__ */ f.jsx(
695
692
  "button",
696
693
  {
697
694
  type: "button",
698
695
  tabIndex: -1,
699
- disabled: b,
696
+ disabled: g,
700
697
  "data-slot": "hours-picker-input-toggle",
701
698
  className: q(
702
699
  "absolute right-1 top-1/2 inline-flex size-8 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
@@ -709,15 +706,15 @@ function Ee({
709
706
  t.preventDefault();
710
707
  },
711
708
  onClick: () => {
712
- b || h(!p);
709
+ g || h(!p);
713
710
  },
714
- children: /* @__PURE__ */ a.jsx(ne, { "aria-hidden": !0, className: "size-4" })
711
+ children: /* @__PURE__ */ f.jsx(oe, { "aria-hidden": !0, className: "size-4" })
715
712
  }
716
713
  )
717
714
  ] });
718
715
  }
719
716
  export {
720
717
  Se as HourPickerField,
721
- oe as HourPickerInput
718
+ se as HourPickerInput
722
719
  };
723
720
  //# sourceMappingURL=index18.js.map