@koide-labs/ui 0.0.14 → 0.1.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 (310) hide show
  1. package/dist/-utils.d.ts +2 -2
  2. package/dist/-utils.js +1 -1
  3. package/dist/{Button-DrPFFzo7.js → Button-BmcVHRRW.js} +2 -2
  4. package/dist/{CompositeRoot-CVk5a-pR.js → CompositeRoot-CCgh2M64.js} +6 -6
  5. package/dist/{FloatingPortal-tWyuKRSN.js → FloatingPortal-BQsQhvIr.js} +27 -27
  6. package/dist/{FloatingPortalLite-DVyq6YhV.js → FloatingPortalLite-_ECdFE7b.js} +1 -1
  7. package/dist/{InternalBackdrop-jYAiOJ8v.js → InternalBackdrop-BSMKU-hc.js} +13 -13
  8. package/dist/{LabelableContext-BMvjVwor.js → LabelableContext-Be1u-eFg.js} +2 -2
  9. package/dist/accordion.css +1 -0
  10. package/dist/alert-dialog.css +1 -0
  11. package/dist/anchor.css +1 -0
  12. package/dist/avatar.css +1 -0
  13. package/dist/badge.css +1 -0
  14. package/dist/button.css +1 -0
  15. package/dist/checkbox.css +1 -0
  16. package/dist/code.css +1 -0
  17. package/dist/collapse.css +1 -0
  18. package/dist/command.css +1 -0
  19. package/dist/components/accordion/accordion.d.ts +19 -0
  20. package/dist/components/accordion/accordion.js +701 -0
  21. package/dist/components/accordion/index.d.ts +1 -12
  22. package/dist/components/accordion/index.js +2 -697
  23. package/dist/components/alert-dialog/alert-dialog.d.ts +36 -0
  24. package/dist/components/alert-dialog/alert-dialog.js +138 -0
  25. package/dist/components/alert-dialog/index.d.ts +1 -26
  26. package/dist/components/alert-dialog/index.js +2 -134
  27. package/dist/components/anchor/anchor.d.ts +12 -0
  28. package/dist/components/anchor/anchor.js +21 -0
  29. package/dist/components/anchor/index.d.ts +1 -8
  30. package/dist/components/anchor/index.js +2 -19
  31. package/dist/components/avatar/avatar.d.ts +25 -0
  32. package/dist/components/avatar/avatar.js +161 -0
  33. package/dist/components/avatar/index.d.ts +1 -21
  34. package/dist/components/avatar/index.js +2 -159
  35. package/dist/components/badge/badge.d.ts +20 -0
  36. package/dist/components/badge/badge.js +42 -0
  37. package/dist/components/badge/index.d.ts +1 -16
  38. package/dist/components/badge/index.js +2 -40
  39. package/dist/components/button/button.d.ts +27 -0
  40. package/dist/components/button/button.js +47 -0
  41. package/dist/components/button/index.d.ts +1 -24
  42. package/dist/components/button/index.js +2 -45
  43. package/dist/components/checkbox/checkbox.d.ts +13 -0
  44. package/dist/components/checkbox/checkbox.js +269 -0
  45. package/dist/components/checkbox/index.d.ts +1 -9
  46. package/dist/components/checkbox/index.js +2 -267
  47. package/dist/components/code/code.d.ts +13 -0
  48. package/dist/components/code/code.js +1206 -0
  49. package/dist/components/code/index.d.ts +1 -9
  50. package/dist/components/code/index.js +2 -1204
  51. package/dist/components/collapse/collapse.d.ts +14 -0
  52. package/dist/components/collapse/collapse.js +35 -0
  53. package/dist/components/collapse/index.d.ts +1 -11
  54. package/dist/components/collapse/index.js +2 -33
  55. package/dist/components/command/command.d.ts +36 -0
  56. package/dist/components/command/command.js +1695 -0
  57. package/dist/components/command/index.d.ts +1 -15
  58. package/dist/components/command/index.js +2 -1693
  59. package/dist/components/context-menu/context-menu.d.ts +82 -0
  60. package/dist/components/context-menu/context-menu.js +1445 -0
  61. package/dist/components/context-menu/index.d.ts +1 -42
  62. package/dist/components/context-menu/index.js +2 -1442
  63. package/dist/components/dialog/dialog.d.ts +22 -0
  64. package/dist/components/dialog/dialog.js +140 -0
  65. package/dist/components/dialog/dialog.types.d.ts +38 -0
  66. package/dist/components/dialog/index.d.ts +1 -48
  67. package/dist/components/dialog/index.js +2 -136
  68. package/dist/components/heading/heading.d.ts +25 -0
  69. package/dist/components/heading/heading.js +36 -0
  70. package/dist/components/heading/index.d.ts +1 -44
  71. package/dist/components/heading/index.js +2 -49
  72. package/dist/components/icon/icon.d.ts +28 -0
  73. package/dist/components/icon/icon.js +43 -0
  74. package/dist/components/icon/{icon-names.d.ts → icon.types.d.ts} +4 -0
  75. package/dist/components/icon/icon.types.js +1 -0
  76. package/dist/components/icon/index.d.ts +2 -24
  77. package/dist/components/icon/index.js +2 -41
  78. package/dist/components/icon-button/icon-button.d.ts +16 -0
  79. package/dist/components/icon-button/icon-button.js +46 -0
  80. package/dist/components/icon-button/index.d.ts +1 -12
  81. package/dist/components/icon-button/index.js +2 -44
  82. package/dist/components/inline-code/index.d.ts +1 -6
  83. package/dist/components/inline-code/index.js +2 -20
  84. package/dist/components/inline-code/inline-code.d.ts +10 -0
  85. package/dist/components/inline-code/inline-code.js +25 -0
  86. package/dist/components/input/index.d.ts +1 -3
  87. package/dist/components/input/index.js +2 -117
  88. package/dist/components/input/input.d.ts +9 -0
  89. package/dist/components/input/input.js +126 -0
  90. package/dist/components/meter/index.d.ts +1 -18
  91. package/dist/components/meter/index.js +2 -163
  92. package/dist/components/meter/meter.d.ts +22 -0
  93. package/dist/components/meter/meter.js +165 -0
  94. package/dist/components/multiline-input/index.d.ts +1 -6
  95. package/dist/components/multiline-input/index.js +2 -98
  96. package/dist/components/multiline-input/multiline-input.d.ts +10 -0
  97. package/dist/components/multiline-input/multiline-input.js +100 -0
  98. package/dist/components/number-input/index.d.ts +1 -10
  99. package/dist/components/number-input/index.js +2 -1167
  100. package/dist/components/number-input/number-input.d.ts +14 -0
  101. package/dist/components/number-input/number-input.js +1169 -0
  102. package/dist/components/password-input/index.d.ts +1 -2
  103. package/dist/components/password-input/index.js +2 -27
  104. package/dist/components/password-input/password-input.d.ts +7 -0
  105. package/dist/components/password-input/password-input.js +29 -0
  106. package/dist/components/pill/index.d.ts +1 -13
  107. package/dist/components/pill/index.js +2 -36
  108. package/dist/components/pill/pill.d.ts +17 -0
  109. package/dist/components/pill/pill.js +38 -0
  110. package/dist/components/popover/index.d.ts +1 -21
  111. package/dist/components/popover/index.js +2 -634
  112. package/dist/components/popover/popover.d.ts +22 -0
  113. package/dist/components/popover/popover.js +634 -0
  114. package/dist/components/preview-card/index.d.ts +1 -17
  115. package/dist/components/preview-card/index.js +2 -400
  116. package/dist/components/preview-card/preview-card.d.ts +21 -0
  117. package/dist/components/preview-card/preview-card.js +402 -0
  118. package/dist/components/radio-group/index.d.ts +1 -0
  119. package/dist/components/radio-group/index.js +5 -0
  120. package/dist/components/radio-group/radio-group.d.ts +25 -0
  121. package/dist/components/{radio/index.js → radio-group/radio-group.js} +91 -90
  122. package/dist/components/search-bar/index.d.ts +1 -12
  123. package/dist/components/search-bar/index.js +2 -46
  124. package/dist/components/search-bar/search-bar.d.ts +16 -0
  125. package/dist/components/search-bar/search-bar.js +43 -0
  126. package/dist/components/select/index.d.ts +1 -16
  127. package/dist/components/select/index.js +2 -1261
  128. package/dist/components/select/select.d.ts +22 -0
  129. package/dist/components/select/select.js +1263 -0
  130. package/dist/components/separator/index.d.ts +1 -7
  131. package/dist/components/separator/index.js +2 -4
  132. package/dist/components/separator/separator.d.ts +10 -0
  133. package/dist/components/separator/separator.js +6 -0
  134. package/dist/components/slider/index.d.ts +1 -5
  135. package/dist/components/slider/index.js +2 -900
  136. package/dist/components/slider/slider.d.ts +10 -0
  137. package/dist/components/slider/slider.js +899 -0
  138. package/dist/components/spinner/index.d.ts +1 -2
  139. package/dist/components/spinner/index.js +2 -11
  140. package/dist/components/spinner/spinner.d.ts +7 -0
  141. package/dist/components/spinner/spinner.js +13 -0
  142. package/dist/components/stacked-avatars/index.d.ts +1 -14
  143. package/dist/components/stacked-avatars/index.js +2 -90
  144. package/dist/components/stacked-avatars/stacked-avatars.d.ts +18 -0
  145. package/dist/components/stacked-avatars/stacked-avatars.js +92 -0
  146. package/dist/components/status-banner/index.d.ts +1 -17
  147. package/dist/components/status-banner/index.js +2 -69
  148. package/dist/components/status-banner/status-banner.d.ts +22 -0
  149. package/dist/components/status-banner/status-banner.js +71 -0
  150. package/dist/components/surface/index.d.ts +2 -27
  151. package/dist/components/surface/index.js +2 -39
  152. package/dist/components/surface/surface.d.ts +26 -0
  153. package/dist/components/surface/surface.js +36 -0
  154. package/dist/components/surface/surface.types.d.ts +1 -0
  155. package/dist/components/surface/surface.types.js +1 -0
  156. package/dist/components/switch/index.d.ts +1 -5
  157. package/dist/components/switch/index.js +2 -194
  158. package/dist/components/switch/switch.d.ts +10 -0
  159. package/dist/components/switch/switch.js +193 -0
  160. package/dist/components/tabs/index.d.ts +1 -18
  161. package/dist/components/tabs/index.js +2 -507
  162. package/dist/components/tabs/tabs.d.ts +28 -0
  163. package/dist/components/tabs/tabs.js +511 -0
  164. package/dist/components/text/index.d.ts +1 -26
  165. package/dist/components/text/index.js +2 -46
  166. package/dist/components/text/text.d.ts +29 -0
  167. package/dist/components/text/text.js +48 -0
  168. package/dist/components/theme-provider/index.d.ts +1 -1
  169. package/dist/components/theme-provider/theme-provider.d.ts +8 -4
  170. package/dist/components/theme-provider/theme-provider.js +3 -3
  171. package/dist/components/timestamp/index.d.ts +1 -23
  172. package/dist/components/timestamp/index.js +2 -1390
  173. package/dist/components/timestamp/timestamp.d.ts +26 -0
  174. package/dist/components/timestamp/timestamp.js +1391 -0
  175. package/dist/components/toaster/index.d.ts +2 -0
  176. package/dist/components/toaster/index.js +7 -0
  177. package/dist/components/toaster/toaster.d.ts +7 -0
  178. package/dist/components/toaster/toaster.js +923 -0
  179. package/dist/components/{toast → toaster}/use-toast-manager.d.ts +3 -3
  180. package/dist/components/tooltip/index.d.ts +1 -14
  181. package/dist/components/tooltip/index.js +2 -710
  182. package/dist/components/tooltip/tooltip.d.ts +24 -0
  183. package/dist/components/tooltip/tooltip.js +9 -0
  184. package/dist/components/view/index.d.ts +2 -30
  185. package/dist/components/view/index.js +2 -79
  186. package/dist/components/view/view.d.ts +31 -0
  187. package/dist/components/view/view.js +83 -0
  188. package/dist/components/view/view.types.d.ts +5 -0
  189. package/dist/components/view/view.types.js +1 -0
  190. package/dist/components/visually-hidden/index.d.ts +5 -1
  191. package/dist/{composite-Bx7Szd_T.js → composite-BZzP-LlG.js} +3 -3
  192. package/dist/{composite-C9L5QmZL.js → composite-BwEK5cWH.js} +1 -1
  193. package/dist/context-menu.css +1 -0
  194. package/dist/{createBaseUIEventDetails-D8M2Yl-a.js → createBaseUIEventDetails-CCSfZ2vM.js} +7 -7
  195. package/dist/{detectBrowser-I-s3yzIE.js → detectBrowser-Bl8Ki_1I.js} +2 -2
  196. package/dist/dialog.css +1 -1
  197. package/dist/{dialog.module-BeF-6XAo.js → dialog.module-DsbQRp-d.js} +55 -55
  198. package/dist/{element-CZEOj04G.js → element-u5WgOZX1.js} +7 -7
  199. package/dist/{event-CKoGyQEJ.js → event-B89-Ng5h.js} +4 -4
  200. package/dist/{floating-ui.utils-C7pRWMZ_.js → floating-ui.utils-DUVaIF3G.js} +7 -7
  201. package/dist/{floating-ui.utils.dom-C7FS5id0.js → floating-ui.utils.dom-cbi420Pg.js} +4 -4
  202. package/dist/{getDisabledMountTransitionStyles-YfHPge6T.js → getDisabledMountTransitionStyles-E2x-_lte.js} +7 -7
  203. package/dist/heading.css +1 -0
  204. package/dist/icon-button.css +1 -0
  205. package/dist/icon.css +1 -0
  206. package/dist/index.d.ts +10 -10
  207. package/dist/index.js +86 -104
  208. package/dist/{inertValue-BCYGsdmf.js → inertValue-BTpPjX30.js} +1 -1
  209. package/dist/inline-code.css +1 -0
  210. package/dist/input.css +1 -1
  211. package/dist/input.module-CtE19OH8.js +8 -0
  212. package/dist/integrations/react-markdown/index.js +12 -12
  213. package/dist/meter.css +1 -0
  214. package/dist/number-input.css +1 -0
  215. package/dist/password-input.css +1 -0
  216. package/dist/pill.css +1 -0
  217. package/dist/popover.css +1 -0
  218. package/dist/preview-card.css +1 -0
  219. package/dist/radio-group.css +1 -0
  220. package/dist/safePolygon-DnkzOIur.js +558 -0
  221. package/dist/search-bar.css +1 -0
  222. package/dist/select.css +1 -0
  223. package/dist/{index-DVjyPAD4.js → separator-fh_wDZNf.js} +7 -11
  224. package/dist/separator.css +1 -0
  225. package/dist/slider.css +1 -0
  226. package/dist/spinner.css +1 -0
  227. package/dist/stacked-avatars.css +1 -0
  228. package/dist/status-banner.css +1 -0
  229. package/dist/styles/core.css +1 -1
  230. package/dist/surface.css +1 -0
  231. package/dist/switch.css +1 -0
  232. package/dist/tabs.css +1 -0
  233. package/dist/text.css +1 -0
  234. package/dist/timestamp.css +1 -0
  235. package/dist/toaster.css +1 -0
  236. package/dist/tooltip-oCp-elli.js +765 -0
  237. package/dist/tooltip.css +1 -0
  238. package/dist/transitions.css +1 -1
  239. package/dist/{transitions.module-CWX8e5cx.js → transitions.module-D9mMAtfI.js} +11 -11
  240. package/dist/{useAnimationFrame-451ugS_6.js → useAnimationFrame-DvK1s63A.js} +1 -1
  241. package/dist/{useButton-DfIwsdb8.js → useButton-d3_JgBNr.js} +3 -3
  242. package/dist/{useCompositeListItem-OkcAim_1.js → useCompositeListItem-CZp9WTnF.js} +2 -2
  243. package/dist/{useLabelableId-Ci_jDvmv.js → useLabelableId-CX4tcfzK.js} +3 -3
  244. package/dist/{useOpenChangeComplete-Dse9kY9E.js → useOpenChangeComplete-BHd-N7Ig.js} +5 -5
  245. package/dist/{useRender-CLx7dR_1.js → useRender-C3vlzS3t.js} +1 -1
  246. package/dist/{useRenderElement-DwToLA61.js → useRenderElement-DngNDu_P.js} +2 -2
  247. package/dist/{useRole-oDBdbuwQ.js → useRole-BD3OL1rr.js} +3 -3
  248. package/dist/{useStableCallback-CkTrVkNX.js → useStableCallback-DKZHlUAT.js} +1 -1
  249. package/dist/{useSyncedFloatingRootContext-Dorsv-jf.js → useSyncedFloatingRootContext-BB1vwkV-.js} +20 -20
  250. package/dist/{useTimeout-CflX-kz3.js → useTimeout-BNni6aw5.js} +1 -1
  251. package/dist/{useTransitionStatus-CUfcuGAV.js → useTransitionStatus-CmMyUh74.js} +1 -1
  252. package/dist/{useTypeahead-D85V2IUx.js → useTypeahead-BiL5IAVb.js} +11 -11
  253. package/dist/{useValueAsRef-HURLzret.js → useValueAsRef-B4EriRsI.js} +1 -1
  254. package/dist/{useValueChanged-DL757-yD.js → useValueChanged-MJRmEWz1.js} +1 -1
  255. package/dist/view.css +1 -1
  256. package/dist/view.module-Dj7wj0kk.js +6 -0
  257. package/dist/view2.css +1 -0
  258. package/package.json +16 -19
  259. package/dist/components/radio/index.d.ts +0 -13
  260. package/dist/components/toast/index.d.ts +0 -2
  261. package/dist/components/toast/index.js +0 -8
  262. package/dist/components/toast/toast.d.ts +0 -2
  263. package/dist/components/toast/toast.js +0 -921
  264. package/dist/components/tooltip/tooltip-arrow.d.ts +0 -3
  265. package/dist/components/tooltip/tooltip-arrow.js +0 -6
  266. package/dist/index10.css +0 -1
  267. package/dist/index11.css +0 -1
  268. package/dist/index12.css +0 -1
  269. package/dist/index13.css +0 -1
  270. package/dist/index14.css +0 -1
  271. package/dist/index15.css +0 -1
  272. package/dist/index16.css +0 -1
  273. package/dist/index17.css +0 -1
  274. package/dist/index18.css +0 -1
  275. package/dist/index19.css +0 -1
  276. package/dist/index20.css +0 -1
  277. package/dist/index21.css +0 -1
  278. package/dist/index22.css +0 -1
  279. package/dist/index23.css +0 -1
  280. package/dist/index24.css +0 -1
  281. package/dist/index25.css +0 -1
  282. package/dist/index26.css +0 -1
  283. package/dist/index27.css +0 -1
  284. package/dist/index28.css +0 -1
  285. package/dist/index29.css +0 -1
  286. package/dist/index3.css +0 -1
  287. package/dist/index30.css +0 -1
  288. package/dist/index31.css +0 -1
  289. package/dist/index32.css +0 -1
  290. package/dist/index33.css +0 -1
  291. package/dist/index34.css +0 -1
  292. package/dist/index35.css +0 -1
  293. package/dist/index36.css +0 -1
  294. package/dist/index37.css +0 -1
  295. package/dist/index4.css +0 -1
  296. package/dist/index5.css +0 -1
  297. package/dist/index6.css +0 -1
  298. package/dist/index7.css +0 -1
  299. package/dist/index8.css +0 -1
  300. package/dist/index9.css +0 -1
  301. package/dist/input.module-DDQY_Ij6.js +0 -7
  302. package/dist/safePolygon-DWy1dGKJ.js +0 -308
  303. package/dist/toast.css +0 -1
  304. package/dist/tooltip-arrow-cs6vjjqZ.js +0 -24
  305. package/dist/tooltip-arrow.css +0 -1
  306. package/dist/useHoverReferenceInteraction-SfOBPoXM.js +0 -264
  307. package/dist/usePopupAutoResize-CNR6Ekmx.js +0 -85
  308. package/dist/view.module-DfDLgJE0.js +0 -6
  309. /package/dist/components/{icon/icon-names.js → dialog/dialog.types.js} +0 -0
  310. /package/dist/components/{toast → toaster}/use-toast-manager.js +0 -0
@@ -0,0 +1,1263 @@
1
+ import { jsx as C, jsxs as Ae } from "react/jsx-runtime";
2
+ import { c as jt } from "../../clsx-OuTLNxxd.js";
3
+ import * as n from "react";
4
+ import { textify as $t } from "../../-utils.js";
5
+ import { c as E, S as Yt, l as p, d as Xt, e as Kt, i as Gt, f as Jt, p as yt, t as Zt } from "../../transitions.module-D9mMAtfI.js";
6
+ import { View as Qt } from "../view/view.js";
7
+ import { Icon as Rt } from "../icon/icon.js";
8
+ import { v as en } from "../../visuallyHidden-CpJ-mhai.js";
9
+ import { b as gt, a as tn, m as St, d as It, u as Re } from "../../useRenderElement-DngNDu_P.js";
10
+ import { u as ht } from "../../useControlled-Du4sJyMj.js";
11
+ import { u as fe } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
12
+ import { u as xe } from "../../useStableCallback-DKZHlUAT.js";
13
+ import { u as ct } from "../../useValueAsRef-B4EriRsI.js";
14
+ import { f as Ke } from "../../formatErrorMessage-BqPuTBN-.js";
15
+ import { c as nn, a as vt, u as Et, b as on, f as rn } from "../../LabelableContext-Be1u-eFg.js";
16
+ import { u as sn } from "../../useLabelableId-CX4tcfzK.js";
17
+ import { u as wt } from "../../useTransitionStatus-CmMyUh74.js";
18
+ import { c as ye, n as Mt, f as ln, v as cn, w as an, x as tt } from "../../createBaseUIEventDetails-CCSfZ2vM.js";
19
+ import { u as at, t as At } from "../../useOpenChangeComplete-BHd-N7Ig.js";
20
+ import { u as un } from "../../useValueChanged-MJRmEWz1.js";
21
+ import { u as dn, b as fn, a as pn, I as mn, F as gn } from "../../InternalBackdrop-BSMKU-hc.js";
22
+ import { u as hn, a as bn, g as xn } from "../../getDisabledMountTransitionStyles-E2x-_lte.js";
23
+ import { u as yn, a as Rn } from "../../useTypeahead-BiL5IAVb.js";
24
+ import { o as rt } from "../../owner-rKN292Q9.js";
25
+ import { u as _e } from "../../useTimeout-BNni6aw5.js";
26
+ import { u as Tt } from "../../useButton-d3_JgBNr.js";
27
+ import { g as Sn, f as bt } from "../../element-u5WgOZX1.js";
28
+ import { h as In, m as vn } from "../../FloatingPortal-BQsQhvIr.js";
29
+ import { i as En } from "../../inertValue-BTpPjX30.js";
30
+ import { C as wn, u as Mn, I as An } from "../../useCompositeListItem-CZp9WTnF.js";
31
+ import * as Tn from "react-dom";
32
+ import { d as Vn } from "../../detectBrowser-Bl8Ki_1I.js";
33
+ import { u as Cn } from "../../useAnimationFrame-DvK1s63A.js";
34
+ import { u as Nn } from "../../ToolbarRootContext-CvvL0Tk1.js";
35
+ import { C as _n } from "../../composite-BwEK5cWH.js";
36
+ import { g as xt } from "../../floating-ui.utils.dom-cbi420Pg.js";
37
+ import '../../select.css';function Pn(e) {
38
+ const t = n.useRef(!0);
39
+ t.current && (t.current = !1, e());
40
+ }
41
+ const On = (e, t) => Object.is(e, t);
42
+ function Oe(e, t, o) {
43
+ return e == null || t == null ? Object.is(e, t) : o(e, t);
44
+ }
45
+ function nt(e, t, o) {
46
+ return !e || e.length === 0 ? !1 : e.some((s) => s === void 0 ? !1 : Oe(s, t, o));
47
+ }
48
+ function st(e, t, o) {
49
+ return !e || e.length === 0 ? -1 : e.findIndex((s) => s === void 0 ? !1 : Oe(s, t, o));
50
+ }
51
+ function Dn(e, t, o) {
52
+ return e.filter((s) => !Oe(s, t, o));
53
+ }
54
+ function it(e) {
55
+ if (e == null)
56
+ return "";
57
+ if (typeof e == "string")
58
+ return e;
59
+ try {
60
+ return JSON.stringify(e);
61
+ } catch {
62
+ return String(e);
63
+ }
64
+ }
65
+ function Hn(e) {
66
+ return e != null && e.length > 0 && typeof e[0] == "object" && e[0] != null && "items" in e[0];
67
+ }
68
+ function ke(e, t) {
69
+ if (t && e != null)
70
+ return t(e) ?? "";
71
+ if (e && typeof e == "object") {
72
+ if ("label" in e && e.label != null)
73
+ return String(e.label);
74
+ if ("value" in e)
75
+ return String(e.value);
76
+ }
77
+ return it(e);
78
+ }
79
+ function Ne(e, t) {
80
+ return t && e != null ? t(e) ?? "" : e && typeof e == "object" && "value" in e && "label" in e ? it(e.value) : it(e);
81
+ }
82
+ function Fn(e, t, o) {
83
+ if (o && e != null)
84
+ return o(e);
85
+ if (e && typeof e == "object" && "label" in e && e.label != null)
86
+ return e.label;
87
+ if (t && !Array.isArray(t))
88
+ return t[e] ?? ke(e, o);
89
+ if (Array.isArray(t)) {
90
+ const s = Hn(t) ? t.flatMap((r) => r.items) : t;
91
+ if (e == null) {
92
+ const r = s.find((i) => i.value == null);
93
+ return r && r.label != null ? r.label : ke(e, o);
94
+ }
95
+ if (typeof e != "object") {
96
+ const r = s.find((i) => i && i.value === e);
97
+ return r && r.label != null ? r.label : ke(e, o);
98
+ }
99
+ if ("value" in e) {
100
+ const r = s.find((i) => i && i.value === e.value);
101
+ if (r && r.label != null)
102
+ return r.label;
103
+ }
104
+ }
105
+ return ke(e, o);
106
+ }
107
+ function Bn(e, t) {
108
+ return !Array.isArray(e) || e.length === 0 ? "" : e.map((o) => ke(o, t)).join(", ");
109
+ }
110
+ function Un(e) {
111
+ const t = e.getBoundingClientRect();
112
+ if (process.env.NODE_ENV === "test")
113
+ return t;
114
+ const o = window.getComputedStyle(e, "::before"), s = window.getComputedStyle(e, "::after");
115
+ if (!(o.content !== "none" || s.content !== "none"))
116
+ return t;
117
+ const i = parseFloat(o.width) || 0, m = parseFloat(o.height) || 0, d = parseFloat(s.width) || 0, F = parseFloat(s.height) || 0, w = Math.max(t.width, i, d), v = Math.max(t.height, m, F), R = w - t.width, b = v - t.height;
118
+ return {
119
+ left: t.left - R / 2,
120
+ right: t.right + R / 2,
121
+ top: t.top - b / 2,
122
+ bottom: t.bottom + b / 2
123
+ };
124
+ }
125
+ const $e = "base-ui-disable-scrollbar", lt = {
126
+ className: $e,
127
+ element: /* @__PURE__ */ C("style", {
128
+ href: $e,
129
+ precedence: "base-ui:low",
130
+ children: `.${$e}{scrollbar-width:none}.${$e}::-webkit-scrollbar{display:none}`
131
+ })
132
+ }, ut = /* @__PURE__ */ n.createContext(null);
133
+ process.env.NODE_ENV !== "production" && (ut.displayName = "SelectRootContext");
134
+ const dt = /* @__PURE__ */ n.createContext(null);
135
+ process.env.NODE_ENV !== "production" && (dt.displayName = "SelectFloatingContext");
136
+ function Se() {
137
+ const e = n.useContext(ut);
138
+ if (e === null)
139
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>." : Ke(60));
140
+ return e;
141
+ }
142
+ function Vt() {
143
+ const e = n.useContext(dt);
144
+ if (e === null)
145
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>." : Ke(61));
146
+ return e;
147
+ }
148
+ const a = {
149
+ id: E((e) => e.id),
150
+ modal: E((e) => e.modal),
151
+ multiple: E((e) => e.multiple),
152
+ items: E((e) => e.items),
153
+ itemToStringLabel: E((e) => e.itemToStringLabel),
154
+ itemToStringValue: E((e) => e.itemToStringValue),
155
+ isItemEqualToValue: E((e) => e.isItemEqualToValue),
156
+ value: E((e) => e.value),
157
+ open: E((e) => e.open),
158
+ mounted: E((e) => e.mounted),
159
+ forceMount: E((e) => e.forceMount),
160
+ transitionStatus: E((e) => e.transitionStatus),
161
+ openMethod: E((e) => e.openMethod),
162
+ activeIndex: E((e) => e.activeIndex),
163
+ selectedIndex: E((e) => e.selectedIndex),
164
+ isActive: E((e, t) => e.activeIndex === t),
165
+ isSelected: E((e, t, o) => {
166
+ const s = e.isItemEqualToValue, r = e.value;
167
+ return e.multiple ? Array.isArray(r) && r.some((i) => Oe(i, o, s)) : e.selectedIndex === t && e.selectedIndex !== null ? !0 : Oe(r, o, s);
168
+ }),
169
+ isSelectedByFocus: E((e, t) => e.selectedIndex === t),
170
+ popupProps: E((e) => e.popupProps),
171
+ triggerProps: E((e) => e.triggerProps),
172
+ triggerElement: E((e) => e.triggerElement),
173
+ positionerElement: E((e) => e.positionerElement),
174
+ listElement: E((e) => e.listElement),
175
+ scrollUpArrowVisible: E((e) => e.scrollUpArrowVisible),
176
+ scrollDownArrowVisible: E((e) => e.scrollDownArrowVisible),
177
+ hasScrollArrows: E((e) => e.hasScrollArrows),
178
+ serializedValue: E((e) => {
179
+ const {
180
+ multiple: t,
181
+ value: o,
182
+ itemToStringValue: s
183
+ } = e;
184
+ return t && Array.isArray(o) && o.length === 0 ? "" : Ne(o, s);
185
+ })
186
+ };
187
+ function Ln(e) {
188
+ const {
189
+ id: t,
190
+ value: o,
191
+ defaultValue: s = null,
192
+ onValueChange: r,
193
+ open: i,
194
+ defaultOpen: m = !1,
195
+ onOpenChange: d,
196
+ name: F,
197
+ disabled: w = !1,
198
+ readOnly: v = !1,
199
+ required: R = !1,
200
+ modal: b = !0,
201
+ actionsRef: q,
202
+ inputRef: M,
203
+ onOpenChangeComplete: U,
204
+ items: L,
205
+ multiple: I = !1,
206
+ itemToStringLabel: V,
207
+ itemToStringValue: f,
208
+ isItemEqualToValue: X = On,
209
+ highlightItemOnHover: se = !0,
210
+ children: ie
211
+ } = e, {
212
+ clearErrors: P
213
+ } = nn(), {
214
+ setDirty: N,
215
+ shouldValidateOnChange: ce,
216
+ validityData: j,
217
+ setFilled: S,
218
+ name: G,
219
+ disabled: $,
220
+ validation: x
221
+ } = vt(), {
222
+ controlId: l
223
+ } = Et(), A = sn({
224
+ id: t
225
+ }), B = $ || w, O = G ?? F, [u, K] = ht({
226
+ controlled: o,
227
+ default: I ? s ?? gt : s,
228
+ name: "Select",
229
+ state: "value"
230
+ }), [T, Q] = ht({
231
+ controlled: i,
232
+ default: m,
233
+ name: "Select",
234
+ state: "open"
235
+ }), ee = n.useRef([]), te = n.useRef([]), z = n.useRef(null), c = n.useRef(null), g = n.useRef(0), D = n.useRef(null), H = n.useRef([]), Z = n.useRef(!1), le = n.useRef(!1), ne = n.useRef(null), oe = n.useRef({
236
+ allowSelectedMouseUp: !1,
237
+ allowUnselectedMouseUp: !1
238
+ }), Ie = n.useRef(!1), {
239
+ mounted: re,
240
+ setMounted: _,
241
+ transitionStatus: ae
242
+ } = wt(T), {
243
+ openMethod: pe,
244
+ triggerProps: k,
245
+ reset: W
246
+ } = dn(T), h = tn(() => new Yt({
247
+ id: A,
248
+ modal: b,
249
+ multiple: I,
250
+ itemToStringLabel: V,
251
+ itemToStringValue: f,
252
+ isItemEqualToValue: X,
253
+ value: u,
254
+ open: T,
255
+ mounted: re,
256
+ transitionStatus: ae,
257
+ items: L,
258
+ forceMount: !1,
259
+ openMethod: null,
260
+ activeIndex: null,
261
+ selectedIndex: null,
262
+ popupProps: {},
263
+ triggerProps: {},
264
+ triggerElement: null,
265
+ positionerElement: null,
266
+ listElement: null,
267
+ scrollUpArrowVisible: !1,
268
+ scrollDownArrowVisible: !1,
269
+ hasScrollArrows: !1
270
+ })).current, ue = p(h, a.activeIndex), me = p(h, a.selectedIndex), ge = p(h, a.triggerElement), J = p(h, a.positionerElement), De = n.useMemo(() => I && Array.isArray(u) && u.length === 0 ? "" : Ne(u, f), [I, u, f]), Ge = n.useMemo(() => I && Array.isArray(u) ? u.map((y) => Ne(y, f)) : Ne(u, f), [I, u, f]), We = ct(h.state.triggerElement);
271
+ on({
272
+ id: A,
273
+ commit: x.commit,
274
+ value: u,
275
+ controlRef: We,
276
+ name: O,
277
+ getValue: () => Ge
278
+ });
279
+ const He = n.useRef(u);
280
+ fe(() => {
281
+ u !== He.current && h.set("forceMount", !0);
282
+ }, [h, u]), fe(() => {
283
+ S(u !== null);
284
+ }, [u, S]), fe(function() {
285
+ if (T)
286
+ return;
287
+ const Y = H.current;
288
+ if (I) {
289
+ const we = Array.isArray(u) ? u : [];
290
+ if (we.length === 0) {
291
+ h.set("selectedIndex", null);
292
+ return;
293
+ }
294
+ const be = we[we.length - 1], je = st(Y, be, X);
295
+ h.set("selectedIndex", je === -1 ? null : je);
296
+ return;
297
+ }
298
+ const Ee = st(Y, u, X);
299
+ h.set("selectedIndex", Ee === -1 ? null : Ee);
300
+ }, [I, T, u, H, X, h]), un(u, () => {
301
+ P(O), N(u !== j.initialValue), ce() ? x.commit(u) : x.commit(u, !0);
302
+ });
303
+ const Te = xe((y, Y) => {
304
+ if (d?.(y, Y), !Y.isCanceled && (Q(y), !y && h.state.activeIndex !== null)) {
305
+ const Ee = ee.current[h.state.activeIndex];
306
+ queueMicrotask(() => {
307
+ Ee?.setAttribute("tabindex", "-1");
308
+ });
309
+ }
310
+ }), Ve = xe(() => {
311
+ _(!1), h.set("activeIndex", null), W(), U?.(!1);
312
+ });
313
+ at({
314
+ enabled: !q,
315
+ open: T,
316
+ ref: z,
317
+ onComplete() {
318
+ T || Ve();
319
+ }
320
+ }), n.useImperativeHandle(q, () => ({
321
+ unmount: Ve
322
+ }), [Ve]);
323
+ const ve = xe((y, Y) => {
324
+ r?.(y, Y), !Y.isCanceled && K(y);
325
+ }), de = xe(() => {
326
+ const y = h.state.listElement || z.current;
327
+ if (!y)
328
+ return;
329
+ const Y = y.scrollTop, Ee = y.scrollTop + y.clientHeight, we = Y > 1, be = Ee < y.scrollHeight - 1;
330
+ h.state.scrollUpArrowVisible !== we && h.set("scrollUpArrowVisible", we), h.state.scrollDownArrowVisible !== be && h.set("scrollDownArrowVisible", be);
331
+ }), he = hn({
332
+ open: T,
333
+ onOpenChange: Te,
334
+ elements: {
335
+ reference: ge,
336
+ floating: J
337
+ }
338
+ }), Fe = fn(he, {
339
+ enabled: !v && !B,
340
+ event: "mousedown"
341
+ }), ze = Xt(he, {
342
+ bubbles: !1
343
+ }), Je = yn(he, {
344
+ enabled: !v && !B,
345
+ listRef: ee,
346
+ activeIndex: ue,
347
+ selectedIndex: me,
348
+ disabledIndices: gt,
349
+ onNavigate(y) {
350
+ y === null && !T || h.set("activeIndex", y);
351
+ },
352
+ // Implement our own listeners since `onPointerLeave` on each option fires while scrolling with
353
+ // the `alignItemWithTrigger=true`, causing a performance issue on Chrome.
354
+ focusItemOnHover: !1
355
+ }), Ze = Rn(he, {
356
+ enabled: !v && !B && (T || !I),
357
+ listRef: te,
358
+ activeIndex: ue,
359
+ selectedIndex: me,
360
+ onMatch(y) {
361
+ T ? h.set("activeIndex", y) : ve(H.current[y], ye("none"));
362
+ },
363
+ onTypingChange(y) {
364
+ Z.current = y;
365
+ }
366
+ }), {
367
+ getReferenceProps: Be,
368
+ getFloatingProps: Ce,
369
+ getItemProps: qe
370
+ } = Kt([Fe, ze, Je, Ze]), Ue = n.useMemo(() => St(Be(), k), [Be, k]);
371
+ Pn(() => {
372
+ h.update({
373
+ popupProps: Ce(),
374
+ triggerProps: Ue
375
+ });
376
+ }), fe(() => {
377
+ h.update({
378
+ id: A,
379
+ modal: b,
380
+ multiple: I,
381
+ value: u,
382
+ open: T,
383
+ mounted: re,
384
+ transitionStatus: ae,
385
+ popupProps: Ce(),
386
+ triggerProps: Ue,
387
+ items: L,
388
+ itemToStringLabel: V,
389
+ itemToStringValue: f,
390
+ isItemEqualToValue: X,
391
+ openMethod: pe
392
+ });
393
+ }, [h, A, b, I, u, T, re, ae, Ce, Ue, L, V, f, X, pe]);
394
+ const Me = n.useMemo(() => ({
395
+ store: h,
396
+ name: O,
397
+ required: R,
398
+ disabled: B,
399
+ readOnly: v,
400
+ multiple: I,
401
+ itemToStringLabel: V,
402
+ itemToStringValue: f,
403
+ highlightItemOnHover: se,
404
+ setValue: ve,
405
+ setOpen: Te,
406
+ listRef: ee,
407
+ popupRef: z,
408
+ scrollHandlerRef: c,
409
+ handleScrollArrowVisibility: de,
410
+ scrollArrowsMountedCountRef: g,
411
+ getItemProps: qe,
412
+ events: he.context.events,
413
+ valueRef: D,
414
+ valuesRef: H,
415
+ labelsRef: te,
416
+ typingRef: Z,
417
+ selectionRef: oe,
418
+ selectedItemTextRef: ne,
419
+ validation: x,
420
+ onOpenChangeComplete: U,
421
+ keyboardActiveRef: le,
422
+ alignItemWithTriggerActiveRef: Ie,
423
+ initialValueRef: He
424
+ }), [h, O, R, B, v, I, V, f, se, ve, Te, qe, he.context.events, x, U, de]), Le = It(M, x.inputRef), Qe = I && Array.isArray(u) && u.length > 0, et = n.useMemo(() => !I || !Array.isArray(u) || !O ? null : u.map((y) => {
425
+ const Y = Ne(y, f);
426
+ return /* @__PURE__ */ C("input", {
427
+ type: "hidden",
428
+ name: O,
429
+ value: Y
430
+ }, Y);
431
+ }), [I, u, O, f]);
432
+ return /* @__PURE__ */ C(ut.Provider, {
433
+ value: Me,
434
+ children: /* @__PURE__ */ Ae(dt.Provider, {
435
+ value: he,
436
+ children: [ie, /* @__PURE__ */ C("input", {
437
+ ...x.getInputValidationProps({
438
+ onFocus() {
439
+ h.state.triggerElement?.focus();
440
+ },
441
+ // Handle browser autofill.
442
+ onChange(y) {
443
+ if (y.nativeEvent.defaultPrevented)
444
+ return;
445
+ const Y = y.target.value, Ee = ye(Mt, y.nativeEvent);
446
+ function we() {
447
+ if (I)
448
+ return;
449
+ const be = H.current.find((je) => Ne(je, f).toLowerCase() === Y.toLowerCase());
450
+ be != null && (N(be !== j.initialValue), ve(be, Ee), ce() && x.commit(be));
451
+ }
452
+ h.set("forceMount", !0), queueMicrotask(we);
453
+ }
454
+ }),
455
+ id: t || l || void 0,
456
+ name: I ? void 0 : O,
457
+ value: De,
458
+ disabled: B,
459
+ required: R && !Qe,
460
+ readOnly: v,
461
+ ref: Le,
462
+ style: en,
463
+ tabIndex: -1,
464
+ "aria-hidden": !0
465
+ }), et]
466
+ })
467
+ });
468
+ }
469
+ const Ye = 2, kn = {
470
+ ...Gt,
471
+ ...rn,
472
+ value: () => null
473
+ }, Ct = /* @__PURE__ */ n.forwardRef(function(t, o) {
474
+ const {
475
+ render: s,
476
+ className: r,
477
+ disabled: i = !1,
478
+ nativeButton: m = !0,
479
+ ...d
480
+ } = t, {
481
+ setTouched: F,
482
+ setFocused: w,
483
+ validationMode: v,
484
+ state: R,
485
+ disabled: b
486
+ } = vt(), {
487
+ labelId: q
488
+ } = Et(), {
489
+ store: M,
490
+ setOpen: U,
491
+ selectionRef: L,
492
+ validation: I,
493
+ readOnly: V,
494
+ alignItemWithTriggerActiveRef: f,
495
+ disabled: X,
496
+ keyboardActiveRef: se
497
+ } = Se(), ie = b || X || i, P = p(M, a.open), N = p(M, a.value), ce = p(M, a.triggerProps), j = p(M, a.positionerElement), S = p(M, a.listElement), G = p(M, a.serializedValue), $ = ct(j), x = n.useRef(null), l = _e(), A = _e(), {
498
+ getButtonProps: B,
499
+ buttonRef: O
500
+ } = Tt({
501
+ disabled: ie,
502
+ native: m
503
+ }), u = xe((c) => {
504
+ M.set("triggerElement", c);
505
+ }), K = It(o, x, O, u), T = _e(), Q = _e();
506
+ n.useEffect(() => {
507
+ if (P)
508
+ return Q.start(200, () => {
509
+ L.current.allowUnselectedMouseUp = !0, T.start(200, () => {
510
+ L.current.allowSelectedMouseUp = !0;
511
+ });
512
+ }), () => {
513
+ T.clear(), Q.clear();
514
+ };
515
+ L.current = {
516
+ allowSelectedMouseUp: !1,
517
+ allowUnselectedMouseUp: !1
518
+ }, A.clear();
519
+ }, [P, L, A, T, Q]);
520
+ const ee = n.useMemo(() => S?.id ?? Sn(j)?.id, [S, j]), te = St(ce, {
521
+ role: "combobox",
522
+ "aria-expanded": P ? "true" : "false",
523
+ "aria-haspopup": "listbox",
524
+ "aria-controls": P ? ee : void 0,
525
+ "aria-labelledby": q,
526
+ "aria-readonly": V || void 0,
527
+ tabIndex: ie ? -1 : 0,
528
+ ref: K,
529
+ onFocus(c) {
530
+ w(!0), P && f.current && U(!1, ye(ln, c.nativeEvent)), l.start(0, () => {
531
+ M.set("forceMount", !0);
532
+ });
533
+ },
534
+ onBlur() {
535
+ F(!0), w(!1), v === "onBlur" && I.commit(N);
536
+ },
537
+ onPointerMove() {
538
+ se.current = !1;
539
+ },
540
+ onKeyDown() {
541
+ se.current = !0;
542
+ },
543
+ onMouseDown(c) {
544
+ if (P)
545
+ return;
546
+ const g = rt(c.currentTarget);
547
+ function D(H) {
548
+ if (!x.current)
549
+ return;
550
+ const Z = H.target;
551
+ if (bt(x.current, Z) || bt($.current, Z) || Z === x.current)
552
+ return;
553
+ const le = Un(x.current);
554
+ H.clientX >= le.left - Ye && H.clientX <= le.right + Ye && H.clientY >= le.top - Ye && H.clientY <= le.bottom + Ye || U(!1, ye(cn, H));
555
+ }
556
+ A.start(0, () => {
557
+ g.addEventListener("mouseup", D, {
558
+ once: !0
559
+ });
560
+ });
561
+ }
562
+ }, I.getValidationProps, d, B);
563
+ te.role = "combobox";
564
+ const z = n.useMemo(() => ({
565
+ ...R,
566
+ open: P,
567
+ disabled: ie,
568
+ value: N,
569
+ readOnly: V,
570
+ placeholder: !G
571
+ }), [R, P, ie, N, V, G]);
572
+ return Re("button", t, {
573
+ ref: [o, x],
574
+ state: z,
575
+ stateAttributesMapping: kn,
576
+ props: te
577
+ });
578
+ });
579
+ process.env.NODE_ENV !== "production" && (Ct.displayName = "SelectTrigger");
580
+ const Wn = {
581
+ value: () => null
582
+ }, Nt = /* @__PURE__ */ n.forwardRef(function(t, o) {
583
+ const {
584
+ className: s,
585
+ render: r,
586
+ children: i,
587
+ ...m
588
+ } = t, {
589
+ store: d,
590
+ valueRef: F
591
+ } = Se(), w = p(d, a.value), v = p(d, a.items), R = p(d, a.itemToStringLabel), b = p(d, a.serializedValue), q = n.useMemo(() => ({
592
+ value: w,
593
+ placeholder: !b
594
+ }), [w, b]), M = typeof i == "function" ? i(w) : i ?? (Array.isArray(w) ? Bn(w, R) : Fn(w, v, R));
595
+ return Re("span", t, {
596
+ state: q,
597
+ ref: [o, F],
598
+ props: [{
599
+ children: M
600
+ }, m],
601
+ stateAttributesMapping: Wn
602
+ });
603
+ });
604
+ process.env.NODE_ENV !== "production" && (Nt.displayName = "SelectValue");
605
+ const _t = /* @__PURE__ */ n.forwardRef(function(t, o) {
606
+ const {
607
+ className: s,
608
+ render: r,
609
+ ...i
610
+ } = t, {
611
+ store: m
612
+ } = Se(), d = p(m, a.open), F = n.useMemo(() => ({
613
+ open: d
614
+ }), [d]);
615
+ return Re("span", t, {
616
+ state: F,
617
+ ref: o,
618
+ props: [{
619
+ "aria-hidden": !0,
620
+ children: "▼"
621
+ }, i],
622
+ stateAttributesMapping: Jt
623
+ });
624
+ });
625
+ process.env.NODE_ENV !== "production" && (_t.displayName = "SelectIcon");
626
+ const Pt = /* @__PURE__ */ n.createContext(void 0);
627
+ process.env.NODE_ENV !== "production" && (Pt.displayName = "SelectPortalContext");
628
+ const Ot = /* @__PURE__ */ n.forwardRef(function(t, o) {
629
+ const {
630
+ store: s
631
+ } = Se(), r = p(s, a.mounted), i = p(s, a.forceMount);
632
+ return r || i ? /* @__PURE__ */ C(Pt.Provider, {
633
+ value: !0,
634
+ children: /* @__PURE__ */ C(In, {
635
+ ref: o,
636
+ ...t
637
+ })
638
+ }) : null;
639
+ });
640
+ process.env.NODE_ENV !== "production" && (Ot.displayName = "SelectPortal");
641
+ const ft = /* @__PURE__ */ n.createContext(void 0);
642
+ process.env.NODE_ENV !== "production" && (ft.displayName = "SelectPositionerContext");
643
+ function Dt() {
644
+ const e = n.useContext(ft);
645
+ if (!e)
646
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>." : Ke(59));
647
+ return e;
648
+ }
649
+ function Xe(e, t) {
650
+ e && Object.assign(e.style, t);
651
+ }
652
+ const Ht = {
653
+ position: "relative",
654
+ maxHeight: "100%",
655
+ overflowX: "hidden",
656
+ overflowY: "auto"
657
+ }, zn = {
658
+ position: "fixed"
659
+ }, Ft = /* @__PURE__ */ n.forwardRef(function(t, o) {
660
+ const {
661
+ anchor: s,
662
+ positionMethod: r = "absolute",
663
+ className: i,
664
+ render: m,
665
+ side: d = "bottom",
666
+ align: F = "center",
667
+ sideOffset: w = 0,
668
+ alignOffset: v = 0,
669
+ collisionBoundary: R = "clipping-ancestors",
670
+ collisionPadding: b,
671
+ arrowPadding: q = 5,
672
+ sticky: M = !1,
673
+ disableAnchorTracking: U,
674
+ alignItemWithTrigger: L = !0,
675
+ collisionAvoidance: I = vn,
676
+ ...V
677
+ } = t, {
678
+ store: f,
679
+ listRef: X,
680
+ labelsRef: se,
681
+ alignItemWithTriggerActiveRef: ie,
682
+ selectedItemTextRef: P,
683
+ valuesRef: N,
684
+ initialValueRef: ce,
685
+ popupRef: j,
686
+ setValue: S
687
+ } = Se(), G = Vt(), $ = p(f, a.open), x = p(f, a.mounted), l = p(f, a.modal), A = p(f, a.value), B = p(f, a.openMethod), O = p(f, a.positionerElement), u = p(f, a.triggerElement), K = p(f, a.isItemEqualToValue), T = n.useRef(null), Q = n.useRef(null), [ee, te] = n.useState(L), z = x && ee && B !== "touch";
688
+ !x && ee !== L && te(L), fe(() => {
689
+ x || (a.scrollUpArrowVisible(f.state) && f.set("scrollUpArrowVisible", !1), a.scrollDownArrowVisible(f.state) && f.set("scrollDownArrowVisible", !1));
690
+ }, [f, x]), n.useImperativeHandle(ie, () => z), pn((z || l) && $ && B !== "touch", u);
691
+ const c = bn({
692
+ anchor: s,
693
+ floatingRootContext: G,
694
+ positionMethod: r,
695
+ mounted: x,
696
+ side: d,
697
+ sideOffset: w,
698
+ align: F,
699
+ alignOffset: v,
700
+ arrowPadding: q,
701
+ collisionBoundary: R,
702
+ collisionPadding: b,
703
+ sticky: M,
704
+ disableAnchorTracking: U ?? z,
705
+ collisionAvoidance: I,
706
+ keepMounted: !0
707
+ }), g = z ? "none" : c.side, D = z ? zn : c.positionerStyles, H = n.useMemo(() => {
708
+ const _ = {};
709
+ return $ || (_.pointerEvents = "none"), {
710
+ role: "presentation",
711
+ hidden: !x,
712
+ style: {
713
+ ...D,
714
+ ..._
715
+ }
716
+ };
717
+ }, [$, x, D]), Z = n.useMemo(() => ({
718
+ open: $,
719
+ side: g,
720
+ align: c.align,
721
+ anchorHidden: c.anchorHidden
722
+ }), [$, g, c.align, c.anchorHidden]), le = xe((_) => {
723
+ f.set("positionerElement", _);
724
+ }), ne = Re("div", t, {
725
+ ref: [o, le],
726
+ state: Z,
727
+ stateAttributesMapping: yt,
728
+ props: [H, V]
729
+ }), oe = n.useRef(0), Ie = xe((_) => {
730
+ if (_.size === 0 && oe.current === 0 || N.current.length === 0)
731
+ return;
732
+ const ae = oe.current;
733
+ if (oe.current = _.size, _.size === ae)
734
+ return;
735
+ const pe = ye(Mt);
736
+ if (ae !== 0 && !f.state.multiple && A !== null && st(N.current, A, K) === -1) {
737
+ const W = ce.current, ue = W != null && nt(N.current, W, K) ? W : null;
738
+ S(ue, pe), ue === null && (f.set("selectedIndex", null), P.current = null);
739
+ }
740
+ if (ae !== 0 && f.state.multiple && Array.isArray(A)) {
741
+ const k = A.filter((W) => nt(N.current, W, K));
742
+ (k.length !== A.length || k.some((W) => !nt(A, W, K))) && (S(k, pe), k.length === 0 && (f.set("selectedIndex", null), P.current = null));
743
+ }
744
+ if ($ && z) {
745
+ f.update({
746
+ scrollUpArrowVisible: !1,
747
+ scrollDownArrowVisible: !1
748
+ });
749
+ const k = {
750
+ height: ""
751
+ };
752
+ Xe(O, k), Xe(j.current, k);
753
+ }
754
+ }), re = n.useMemo(() => ({
755
+ ...c,
756
+ side: g,
757
+ alignItemWithTriggerActive: z,
758
+ setControlledAlignItemWithTrigger: te,
759
+ scrollUpArrowRef: T,
760
+ scrollDownArrowRef: Q
761
+ }), [c, g, z, te]);
762
+ return /* @__PURE__ */ C(wn, {
763
+ elementsRef: X,
764
+ labelsRef: se,
765
+ onMapChange: Ie,
766
+ children: /* @__PURE__ */ Ae(ft.Provider, {
767
+ value: re,
768
+ children: [x && l && /* @__PURE__ */ C(mn, {
769
+ inert: En(!$),
770
+ cutout: u
771
+ }), ne]
772
+ })
773
+ });
774
+ });
775
+ process.env.NODE_ENV !== "production" && (Ft.displayName = "SelectPositioner");
776
+ function Bt(e) {
777
+ const t = e.currentTarget.getBoundingClientRect();
778
+ return t.top + 1 <= e.clientY && e.clientY <= t.bottom - 1 && t.left + 1 <= e.clientX && e.clientX <= t.right - 1;
779
+ }
780
+ const qn = {
781
+ ...yt,
782
+ ...At
783
+ }, Ut = /* @__PURE__ */ n.forwardRef(function(t, o) {
784
+ const {
785
+ render: s,
786
+ className: r,
787
+ ...i
788
+ } = t, {
789
+ store: m,
790
+ popupRef: d,
791
+ onOpenChangeComplete: F,
792
+ setOpen: w,
793
+ valueRef: v,
794
+ selectedItemTextRef: R,
795
+ keyboardActiveRef: b,
796
+ multiple: q,
797
+ handleScrollArrowVisibility: M,
798
+ scrollHandlerRef: U
799
+ } = Se(), {
800
+ side: L,
801
+ align: I,
802
+ alignItemWithTriggerActive: V,
803
+ setControlledAlignItemWithTrigger: f,
804
+ scrollDownArrowRef: X,
805
+ scrollUpArrowRef: se
806
+ } = Dt(), ie = Nn() != null, P = Vt(), N = _e(), ce = p(m, a.id), j = p(m, a.open), S = p(m, a.mounted), G = p(m, a.popupProps), $ = p(m, a.transitionStatus), x = p(m, a.triggerElement), l = p(m, a.positionerElement), A = p(m, a.listElement), B = n.useRef(0), O = n.useRef(!1), u = n.useRef(0), K = n.useRef(!1), T = n.useRef({}), Q = Cn(), ee = xe((g) => {
807
+ if (!l || !d.current || !K.current)
808
+ return;
809
+ if (O.current || !V) {
810
+ M();
811
+ return;
812
+ }
813
+ const D = l.style.top === "0px", H = l.style.bottom === "0px", Z = l.getBoundingClientRect().height, le = rt(l), ne = getComputedStyle(l), oe = parseFloat(ne.marginTop), Ie = parseFloat(ne.marginBottom), re = le.documentElement.clientHeight - oe - Ie, _ = g.scrollTop, ae = g.scrollHeight, pe = g.clientHeight, k = ae - pe;
814
+ let W = null, h = null, ue = !1;
815
+ if (D) {
816
+ const me = k - _, ge = Z + me, J = Math.min(ge, re);
817
+ W = J, J !== re ? h = k : ue = !0;
818
+ } else if (H) {
819
+ const me = _ - 0, ge = Z + me, J = Math.min(ge, re), De = ge - re;
820
+ W = J, J !== re ? h = 0 : (ue = !0, _ < k && (h = _ - (me - De)));
821
+ }
822
+ W != null && (l.style.height = `${W}px`), h != null && (g.scrollTop = h), ue && (O.current = !0), M();
823
+ });
824
+ n.useImperativeHandle(U, () => ee, [ee]), at({
825
+ open: j,
826
+ ref: d,
827
+ onComplete() {
828
+ j && F?.(!0);
829
+ }
830
+ });
831
+ const te = n.useMemo(() => ({
832
+ open: j,
833
+ transitionStatus: $,
834
+ side: L,
835
+ align: I
836
+ }), [j, $, L, I]);
837
+ fe(() => {
838
+ !l || !d.current || Object.keys(T.current).length || (T.current = {
839
+ top: l.style.top || "0",
840
+ left: l.style.left || "0",
841
+ right: l.style.right,
842
+ height: l.style.height,
843
+ bottom: l.style.bottom,
844
+ minHeight: l.style.minHeight,
845
+ maxHeight: l.style.maxHeight,
846
+ marginTop: l.style.marginTop,
847
+ marginBottom: l.style.marginBottom
848
+ });
849
+ }, [d, l]), fe(() => {
850
+ S || V || (K.current = !1, O.current = !1, B.current = 0, u.current = 0, Xe(l, T.current));
851
+ }, [S, V, l, d]), fe(() => {
852
+ const g = d.current;
853
+ if (!(!S || !x || !l || !g)) {
854
+ if (!V) {
855
+ K.current = !0, Q.request(M);
856
+ return;
857
+ }
858
+ queueMicrotask(() => {
859
+ const D = getComputedStyle(l), H = getComputedStyle(g), Z = rt(x), le = xt(l), ne = x.getBoundingClientRect(), oe = l.getBoundingClientRect(), Ie = ne.left, re = ne.height, _ = A || g, ae = _.scrollHeight, pe = parseFloat(H.borderBottomWidth), k = parseFloat(D.marginTop) || 10, W = parseFloat(D.marginBottom) || 10, h = parseFloat(D.minHeight) || 100, ue = 5, me = 5, ge = 20, J = Z.documentElement.clientHeight - k - W, De = Z.documentElement.clientWidth, Ge = J - ne.bottom + re, We = R.current, He = v.current;
860
+ let Te = 0, Ve = 0;
861
+ if (We && He) {
862
+ const Me = He.getBoundingClientRect(), Le = We.getBoundingClientRect(), Qe = Me.left - Ie, et = Le.left - oe.left, y = Me.top - ne.top + Me.height / 2, Y = Le.top - oe.top + Le.height / 2;
863
+ Te = Qe - et, Ve = Y - y;
864
+ }
865
+ const ve = Ge + Ve + W + pe;
866
+ let de = Math.min(J, ve);
867
+ const he = J - k - W, Fe = ve - de, ze = Math.max(ue, Ie + Te), Je = De - me, Ze = Math.max(0, ze + oe.width - Je);
868
+ l.style.left = `${ze - Ze}px`, l.style.height = `${de}px`, l.style.maxHeight = "auto", l.style.marginTop = `${k}px`, l.style.marginBottom = `${W}px`, g.style.height = "100%";
869
+ const Be = _.scrollHeight - _.clientHeight, Ce = Fe >= Be;
870
+ Ce && (de = Math.min(J, oe.height) - (Fe - Be));
871
+ const qe = ne.top < ge || ne.bottom > J - ge || de < Math.min(ae, h), Ue = (le.visualViewport?.scale ?? 1) !== 1 && Vn;
872
+ if (qe || Ue) {
873
+ K.current = !0, Xe(l, T.current), Tn.flushSync(() => f(!1));
874
+ return;
875
+ }
876
+ if (Ce) {
877
+ const Me = Math.max(0, J - ve);
878
+ l.style.top = oe.height >= he ? "0" : `${Me}px`, l.style.height = `${de}px`, _.scrollTop = _.scrollHeight - _.clientHeight, B.current = Math.max(h, de);
879
+ } else
880
+ l.style.bottom = "0", B.current = Math.max(h, de), _.scrollTop = Fe;
881
+ B.current === J && (O.current = !0), M(), setTimeout(() => {
882
+ K.current = !0;
883
+ });
884
+ });
885
+ }
886
+ }, [m, S, l, x, v, R, d, M, V, f, Q, X, se, A]), n.useEffect(() => {
887
+ if (!V || !l || !S)
888
+ return;
889
+ const g = xt(l);
890
+ function D(H) {
891
+ w(!1, ye(an, H));
892
+ }
893
+ return g.addEventListener("resize", D), () => {
894
+ g.removeEventListener("resize", D);
895
+ };
896
+ }, [w, V, l, S]);
897
+ const z = {
898
+ ...A ? {
899
+ role: "presentation",
900
+ "aria-orientation": void 0
901
+ } : {
902
+ role: "listbox",
903
+ "aria-multiselectable": q || void 0,
904
+ id: `${ce}-list`
905
+ },
906
+ onKeyDown(g) {
907
+ b.current = !0, ie && _n.has(g.key) && g.stopPropagation();
908
+ },
909
+ onMouseMove() {
910
+ b.current = !1;
911
+ },
912
+ onPointerLeave(g) {
913
+ if (Bt(g) || g.pointerType === "touch")
914
+ return;
915
+ const D = g.currentTarget;
916
+ N.start(0, () => {
917
+ m.set("activeIndex", null), D.focus({
918
+ preventScroll: !0
919
+ });
920
+ });
921
+ },
922
+ onScroll(g) {
923
+ A || U.current?.(g.currentTarget);
924
+ },
925
+ ...V && {
926
+ style: A ? {
927
+ height: "100%"
928
+ } : Ht
929
+ }
930
+ }, c = Re("div", t, {
931
+ ref: [o, d],
932
+ state: te,
933
+ stateAttributesMapping: qn,
934
+ props: [G, z, xn($), {
935
+ className: !A && V ? lt.className : void 0
936
+ }, i]
937
+ });
938
+ return /* @__PURE__ */ Ae(n.Fragment, {
939
+ children: [lt.element, /* @__PURE__ */ C(gn, {
940
+ context: P,
941
+ modal: !1,
942
+ disabled: !S,
943
+ restoreFocus: !0,
944
+ children: c
945
+ })]
946
+ });
947
+ });
948
+ process.env.NODE_ENV !== "production" && (Ut.displayName = "SelectPopup");
949
+ const Lt = /* @__PURE__ */ n.forwardRef(function(t, o) {
950
+ const {
951
+ className: s,
952
+ render: r,
953
+ ...i
954
+ } = t, {
955
+ store: m,
956
+ scrollHandlerRef: d
957
+ } = Se(), {
958
+ alignItemWithTriggerActive: F
959
+ } = Dt(), w = p(m, a.hasScrollArrows), v = p(m, a.openMethod), R = p(m, a.multiple), q = {
960
+ id: `${p(m, a.id)}-list`,
961
+ role: "listbox",
962
+ "aria-multiselectable": R || void 0,
963
+ onScroll(U) {
964
+ d.current?.(U.currentTarget);
965
+ },
966
+ ...F && {
967
+ style: Ht
968
+ },
969
+ className: w && v !== "touch" ? lt.className : void 0
970
+ }, M = xe((U) => {
971
+ m.set("listElement", U);
972
+ });
973
+ return Re("div", t, {
974
+ ref: [o, M],
975
+ props: [q, i]
976
+ });
977
+ });
978
+ process.env.NODE_ENV !== "production" && (Lt.displayName = "SelectList");
979
+ const pt = /* @__PURE__ */ n.createContext(void 0);
980
+ process.env.NODE_ENV !== "production" && (pt.displayName = "SelectItemContext");
981
+ function mt() {
982
+ const e = n.useContext(pt);
983
+ if (!e)
984
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>." : Ke(57));
985
+ return e;
986
+ }
987
+ const kt = /* @__PURE__ */ n.memo(/* @__PURE__ */ n.forwardRef(function(t, o) {
988
+ const {
989
+ render: s,
990
+ className: r,
991
+ value: i = null,
992
+ label: m,
993
+ disabled: d = !1,
994
+ nativeButton: F = !1,
995
+ ...w
996
+ } = t, v = n.useRef(null), R = Mn({
997
+ label: m,
998
+ textRef: v,
999
+ indexGuessBehavior: An.GuessFromOrder
1000
+ }), {
1001
+ store: b,
1002
+ getItemProps: q,
1003
+ setOpen: M,
1004
+ setValue: U,
1005
+ selectionRef: L,
1006
+ typingRef: I,
1007
+ valuesRef: V,
1008
+ keyboardActiveRef: f,
1009
+ multiple: X,
1010
+ highlightItemOnHover: se
1011
+ } = Se(), ie = _e(), P = p(b, a.isActive, R.index), N = p(b, a.isSelected, R.index, i), ce = p(b, a.isSelectedByFocus, R.index), j = p(b, a.isItemEqualToValue), S = R.index, G = S !== -1, $ = n.useRef(null), x = ct(S);
1012
+ fe(() => {
1013
+ if (!G)
1014
+ return;
1015
+ const c = V.current;
1016
+ return c[S] = i, () => {
1017
+ delete c[S];
1018
+ };
1019
+ }, [G, S, i, V]), fe(() => {
1020
+ if (!G)
1021
+ return;
1022
+ const c = b.state.value;
1023
+ let g = c;
1024
+ X && Array.isArray(c) && c.length > 0 && (g = c[c.length - 1]), g !== void 0 && Oe(g, i, j) && b.set("selectedIndex", S);
1025
+ }, [G, S, X, j, b, i]);
1026
+ const l = n.useMemo(() => ({
1027
+ disabled: d,
1028
+ selected: N,
1029
+ highlighted: P
1030
+ }), [d, N, P]), A = q({
1031
+ active: P,
1032
+ selected: N
1033
+ });
1034
+ A.onFocus = void 0, A.id = void 0;
1035
+ const B = n.useRef(null), O = n.useRef("mouse"), u = n.useRef(!1), {
1036
+ getButtonProps: K,
1037
+ buttonRef: T
1038
+ } = Tt({
1039
+ disabled: d,
1040
+ focusableWhenDisabled: !0,
1041
+ native: F
1042
+ });
1043
+ function Q(c) {
1044
+ const g = b.state.value;
1045
+ if (X) {
1046
+ const D = Array.isArray(g) ? g : [], H = N ? Dn(D, i, j) : [...D, i];
1047
+ U(H, ye(tt, c));
1048
+ } else
1049
+ U(i, ye(tt, c)), M(!1, ye(tt, c));
1050
+ }
1051
+ const ee = {
1052
+ role: "option",
1053
+ "aria-selected": N,
1054
+ "aria-disabled": d || void 0,
1055
+ tabIndex: P ? 0 : -1,
1056
+ onFocus() {
1057
+ b.set("activeIndex", S);
1058
+ },
1059
+ onMouseEnter() {
1060
+ !f.current && b.state.selectedIndex === null && b.set("activeIndex", S);
1061
+ },
1062
+ onMouseMove() {
1063
+ se && b.set("activeIndex", S);
1064
+ },
1065
+ onMouseLeave(c) {
1066
+ !se || f.current || Bt(c) || ie.start(0, () => {
1067
+ b.state.activeIndex === S && b.set("activeIndex", null);
1068
+ });
1069
+ },
1070
+ onTouchStart() {
1071
+ L.current = {
1072
+ allowSelectedMouseUp: !1,
1073
+ allowUnselectedMouseUp: !1
1074
+ };
1075
+ },
1076
+ onKeyDown(c) {
1077
+ B.current = c.key, b.set("activeIndex", S);
1078
+ },
1079
+ onClick(c) {
1080
+ u.current = !1, !(c.type === "keydown" && B.current === null) && (d || B.current === " " && I.current || O.current !== "touch" && !P || (B.current = null, Q(c.nativeEvent)));
1081
+ },
1082
+ onPointerEnter(c) {
1083
+ O.current = c.pointerType;
1084
+ },
1085
+ onPointerDown(c) {
1086
+ O.current = c.pointerType, u.current = !0;
1087
+ },
1088
+ onMouseUp(c) {
1089
+ if (d)
1090
+ return;
1091
+ if (u.current) {
1092
+ u.current = !1;
1093
+ return;
1094
+ }
1095
+ const g = !L.current.allowSelectedMouseUp && N, D = !L.current.allowUnselectedMouseUp && !N;
1096
+ g || D || O.current !== "touch" && !P || Q(c.nativeEvent);
1097
+ }
1098
+ }, te = Re("div", t, {
1099
+ ref: [T, o, R.ref, $],
1100
+ state: l,
1101
+ props: [A, ee, w, K]
1102
+ }), z = n.useMemo(() => ({
1103
+ selected: N,
1104
+ indexRef: x,
1105
+ textRef: v,
1106
+ selectedByFocus: ce,
1107
+ hasRegistered: G
1108
+ }), [N, x, v, ce, G]);
1109
+ return /* @__PURE__ */ C(pt.Provider, {
1110
+ value: z,
1111
+ children: te
1112
+ });
1113
+ }));
1114
+ process.env.NODE_ENV !== "production" && (kt.displayName = "SelectItem");
1115
+ const Wt = /* @__PURE__ */ n.forwardRef(function(t, o) {
1116
+ const s = t.keepMounted ?? !1, {
1117
+ selected: r
1118
+ } = mt();
1119
+ return s || r ? /* @__PURE__ */ C(zt, {
1120
+ ...t,
1121
+ ref: o
1122
+ }) : null;
1123
+ });
1124
+ process.env.NODE_ENV !== "production" && (Wt.displayName = "SelectItemIndicator");
1125
+ const zt = /* @__PURE__ */ n.memo(/* @__PURE__ */ n.forwardRef((e, t) => {
1126
+ const {
1127
+ render: o,
1128
+ className: s,
1129
+ keepMounted: r,
1130
+ ...i
1131
+ } = e, {
1132
+ selected: m
1133
+ } = mt(), d = n.useRef(null), {
1134
+ transitionStatus: F,
1135
+ setMounted: w
1136
+ } = wt(m), v = n.useMemo(() => ({
1137
+ selected: m,
1138
+ transitionStatus: F
1139
+ }), [m, F]), R = Re("span", e, {
1140
+ ref: [t, d],
1141
+ state: v,
1142
+ props: [{
1143
+ "aria-hidden": !0,
1144
+ children: "✔️"
1145
+ }, i],
1146
+ stateAttributesMapping: At
1147
+ });
1148
+ return at({
1149
+ open: m,
1150
+ ref: d,
1151
+ onComplete() {
1152
+ m || w(!1);
1153
+ }
1154
+ }), R;
1155
+ }));
1156
+ process.env.NODE_ENV !== "production" && (zt.displayName = "Inner");
1157
+ const qt = /* @__PURE__ */ n.memo(/* @__PURE__ */ n.forwardRef(function(t, o) {
1158
+ const {
1159
+ indexRef: s,
1160
+ textRef: r,
1161
+ selectedByFocus: i,
1162
+ hasRegistered: m
1163
+ } = mt(), {
1164
+ selectedItemTextRef: d
1165
+ } = Se(), {
1166
+ className: F,
1167
+ render: w,
1168
+ ...v
1169
+ } = t, R = n.useCallback((q) => {
1170
+ if (!q || !m)
1171
+ return;
1172
+ const M = d.current === null || !d.current.isConnected;
1173
+ (i || M && s.current === 0) && (d.current = q);
1174
+ }, [d, s, i, m]);
1175
+ return Re("div", t, {
1176
+ ref: [R, o, r],
1177
+ props: v
1178
+ });
1179
+ }));
1180
+ process.env.NODE_ENV !== "production" && (qt.displayName = "SelectItemText");
1181
+ const jn = "_select__trigger_4x1b0_2", $n = "_select__list_4x1b0_21", Yn = "_select__item_4x1b0_33", Pe = {
1182
+ select__trigger: jn,
1183
+ "select__trigger-icon": "_select__trigger-icon_4x1b0_17",
1184
+ select__list: $n,
1185
+ select__item: Yn,
1186
+ "select__item-indicator": "_select__item-indicator_4x1b0_58",
1187
+ "select__item-text": "_select__item-text_4x1b0_62"
1188
+ };
1189
+ function No({
1190
+ placeholder: e,
1191
+ className: t,
1192
+ style: o,
1193
+ ...s
1194
+ }) {
1195
+ return /* @__PURE__ */ Ae(Ln, { ...s, children: [
1196
+ /* @__PURE__ */ Ae(
1197
+ Qt,
1198
+ {
1199
+ interactive: "fill-outline",
1200
+ render: /* @__PURE__ */ C(Ct, {}),
1201
+ style: o,
1202
+ className: jt(Pe.select__trigger, t),
1203
+ children: [
1204
+ /* @__PURE__ */ C(Nt, { children: Xn(e, s.items) }),
1205
+ /* @__PURE__ */ C(_t, { children: /* @__PURE__ */ C(
1206
+ Rt,
1207
+ {
1208
+ name: "arrow-down-s-line",
1209
+ className: Pe["select__trigger-icon"]
1210
+ }
1211
+ ) })
1212
+ ]
1213
+ }
1214
+ ),
1215
+ /* @__PURE__ */ C(Ot, { children: /* @__PURE__ */ C(Ft, { sideOffset: 4, alignItemWithTrigger: !1, children: /* @__PURE__ */ C(
1216
+ Ut,
1217
+ {
1218
+ className: Zt.transition_scale,
1219
+ children: /* @__PURE__ */ Ae(Lt, { className: Pe.select__list, children: [
1220
+ e && !s.multiple ? /* @__PURE__ */ C(ot, { value: null, label: e }) : null,
1221
+ Array.isArray(s.items) ? s.items.map(({ value: r, label: i }) => /* @__PURE__ */ C(ot, { value: r, label: i }, r)) : typeof s.items == "object" ? Object.entries(s.items).map(([r, i]) => /* @__PURE__ */ C(ot, { value: r, label: i }, r)) : null
1222
+ ] })
1223
+ }
1224
+ ) }) })
1225
+ ] });
1226
+ }
1227
+ function ot(e) {
1228
+ return /* @__PURE__ */ Ae(
1229
+ kt,
1230
+ {
1231
+ className: Pe.select__item,
1232
+ value: e.value,
1233
+ children: [
1234
+ /* @__PURE__ */ C(
1235
+ Wt,
1236
+ {
1237
+ className: Pe["select__item-indicator"],
1238
+ children: /* @__PURE__ */ C(Rt, { name: "check-line" })
1239
+ }
1240
+ ),
1241
+ /* @__PURE__ */ C(qt, { className: Pe["select__item-text"], children: $t(e.label) })
1242
+ ]
1243
+ }
1244
+ );
1245
+ }
1246
+ function Xn(e, t) {
1247
+ function o(r) {
1248
+ if (Array.isArray(t))
1249
+ return t.find((i) => i.value === r)?.label;
1250
+ if (typeof t == "object" && r in t)
1251
+ return t[r];
1252
+ }
1253
+ function s(r) {
1254
+ return !r || !t || r.length === 0 ? e : typeof r == "string" ? o(r) : [
1255
+ o(r[0]) || r[0],
1256
+ r.length > 1 ? ` (+${r.length - 1} more)` : ""
1257
+ ];
1258
+ }
1259
+ return s;
1260
+ }
1261
+ export {
1262
+ No as Select
1263
+ };