brd-ui-kit 0.1.75 → 0.1.77

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 (501) hide show
  1. package/dist/brd-ui-kit.css +1 -1
  2. package/dist/calendar-PqChui7l.cjs +2 -0
  3. package/dist/{calendar-DReGV_22.cjs.map → calendar-PqChui7l.cjs.map} +1 -1
  4. package/dist/{calendar-C0DXP3T-.js → calendar-XWqEaWHP.js} +267 -272
  5. package/dist/{calendar-C0DXP3T-.js.map → calendar-XWqEaWHP.js.map} +1 -1
  6. package/dist/{calendar-locale-CP2pxhFK.cjs → calendar-locale-CosU_VZY.cjs} +2 -2
  7. package/dist/{calendar-locale-CP2pxhFK.cjs.map → calendar-locale-CosU_VZY.cjs.map} +1 -1
  8. package/dist/{calendar-locale-DJf03PI9.js → calendar-locale-DqQZymBn.js} +2 -2
  9. package/dist/{calendar-locale-DJf03PI9.js.map → calendar-locale-DqQZymBn.js.map} +1 -1
  10. package/dist/chart-9H_9wEfR.cjs +63 -0
  11. package/dist/{chart-C69jBlXa.cjs.map → chart-9H_9wEfR.cjs.map} +1 -1
  12. package/dist/{chart-CAPCe8o5.js → chart-DFbmMKiQ.js} +2956 -2951
  13. package/dist/{chart-CAPCe8o5.js.map → chart-DFbmMKiQ.js.map} +1 -1
  14. package/dist/components/app-sidebar/app-sidebar.d.ts +2 -2
  15. package/dist/components/basic-chart/basic-chart.d.ts +1 -1
  16. package/dist/components/basic-table/basic-table.d.ts +5 -5
  17. package/dist/components/data-table/data-table-actions-column.d.ts +3 -3
  18. package/dist/components/data-table/data-table-bulk-actions.d.ts +3 -3
  19. package/dist/components/data-table/data-table-column-visibility.d.ts +2 -2
  20. package/dist/components/data-table/data-table-filter.d.ts +2 -2
  21. package/dist/components/data-table/data-table-row-actions-column.d.ts +5 -5
  22. package/dist/components/data-table/use-data-table-editable-rows.d.ts +5 -5
  23. package/dist/components/files-uploader/files-uploader.d.ts +2 -2
  24. package/dist/components/icons/ArrowCounterClockwise.d.ts +1 -0
  25. package/dist/components/icons/BoundingBox.d.ts +1 -0
  26. package/dist/components/icons/Briefcase.d.ts +1 -0
  27. package/dist/components/icons/Building.d.ts +1 -0
  28. package/dist/components/icons/Buildings.d.ts +1 -0
  29. package/dist/components/icons/CaretDown.d.ts +1 -0
  30. package/dist/components/icons/CaretLeft.d.ts +1 -0
  31. package/dist/components/icons/CaretRight.d.ts +1 -0
  32. package/dist/components/icons/CaretUp.d.ts +1 -0
  33. package/dist/components/icons/CaretUpDown.d.ts +1 -0
  34. package/dist/components/icons/ChartLine.d.ts +1 -0
  35. package/dist/components/icons/Check.d.ts +1 -0
  36. package/dist/components/icons/CheckCircle.d.ts +1 -0
  37. package/dist/components/icons/Clock.d.ts +1 -0
  38. package/dist/components/icons/CreditCard.d.ts +1 -0
  39. package/dist/components/icons/DotsThree.d.ts +1 -0
  40. package/dist/components/icons/DownloadSimple.d.ts +1 -0
  41. package/dist/components/icons/EnvelopeSimple.d.ts +1 -0
  42. package/dist/components/icons/Eye.d.ts +1 -0
  43. package/dist/components/icons/EyeSlash.d.ts +1 -0
  44. package/dist/components/icons/FileText.d.ts +1 -0
  45. package/dist/components/icons/Folder.d.ts +1 -0
  46. package/dist/components/icons/Funnel.d.ts +1 -0
  47. package/dist/components/icons/Gear.d.ts +1 -0
  48. package/dist/components/icons/Info.d.ts +1 -0
  49. package/dist/components/icons/LockKey.d.ts +1 -0
  50. package/dist/components/icons/MagnifyingGlass.d.ts +1 -0
  51. package/dist/components/icons/MaxLogo.d.ts +1 -0
  52. package/dist/components/icons/Package.d.ts +1 -0
  53. package/dist/components/icons/Pencil.d.ts +1 -0
  54. package/dist/components/icons/Phone.d.ts +1 -0
  55. package/dist/components/icons/Plus.d.ts +1 -0
  56. package/dist/components/icons/PresentationChart.d.ts +1 -0
  57. package/dist/components/icons/SpinnerGap.d.ts +1 -0
  58. package/dist/components/icons/TelegramLogo.d.ts +1 -0
  59. package/dist/components/icons/Trash.d.ts +1 -0
  60. package/dist/components/icons/UserCircleGear.d.ts +1 -0
  61. package/dist/components/icons/Users.d.ts +1 -0
  62. package/dist/components/icons/UsersFour.d.ts +1 -0
  63. package/dist/components/icons/Warning.d.ts +1 -0
  64. package/dist/components/icons/WarningCircle.d.ts +1 -0
  65. package/dist/components/icons/WhatsAppLogoFilled.d.ts +1 -0
  66. package/dist/components/icons/Wrench.d.ts +1 -0
  67. package/dist/components/icons/X.d.ts +1 -0
  68. package/dist/components/icons/XCircle.d.ts +1 -0
  69. package/dist/components/icons/index.d.ts +50 -0
  70. package/dist/components/icons/stroke-icon.d.ts +19 -0
  71. package/dist/components/icons.d.ts +2 -0
  72. package/dist/components/input-field/input-field.d.ts +3 -3
  73. package/dist/components/input-password/input-password.d.ts +1 -1
  74. package/dist/components/input-phone/input-phone.d.ts +4 -4
  75. package/dist/components/popover-modal/popover-modal.d.ts +4 -4
  76. package/dist/components/select-field/select-field.d.ts +2 -2
  77. package/dist/components/ui/avatar/avatar.d.ts +7 -7
  78. package/dist/components/ui/badge/badge.d.ts +2 -2
  79. package/dist/components/ui/button/button.d.ts +3 -3
  80. package/dist/components/ui/calendar/calendar.d.ts +6 -6
  81. package/dist/components/ui/calendar/calendar.styles.d.ts +1 -1
  82. package/dist/components/ui/card/card.d.ts +13 -13
  83. package/dist/components/ui/chart/chart.d.ts +23 -21
  84. package/dist/components/ui/checkbox/checkbox.d.ts +4 -4
  85. package/dist/components/ui/combobox/combobox.d.ts +6 -6
  86. package/dist/components/ui/dialog/dialog.d.ts +11 -11
  87. package/dist/components/ui/drawer/drawer.d.ts +11 -11
  88. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +42 -42
  89. package/dist/components/ui/icon/icon-map.d.ts +68 -0
  90. package/dist/components/ui/icon/icon.d.ts +6 -6
  91. package/dist/components/ui/icon/index.d.ts +3 -1
  92. package/dist/components/ui/input/input.d.ts +2 -2
  93. package/dist/components/ui/input-group/input-group.d.ts +7 -7
  94. package/dist/components/ui/label/label.d.ts +4 -4
  95. package/dist/components/ui/pagination/pagination.d.ts +8 -8
  96. package/dist/components/ui/popover/popover.d.ts +8 -8
  97. package/dist/components/ui/progress/progress.d.ts +4 -4
  98. package/dist/components/ui/radio-group/radio-group.d.ts +7 -7
  99. package/dist/components/ui/select/select.d.ts +11 -11
  100. package/dist/components/ui/select-calendar-menu/select-calendar-menu.d.ts +4 -4
  101. package/dist/components/ui/separator/separator.d.ts +4 -4
  102. package/dist/components/ui/switch/switch.d.ts +4 -4
  103. package/dist/components/ui/table/table.d.ts +17 -17
  104. package/dist/components/ui/tabs/tabs.d.ts +8 -8
  105. package/dist/components/ui/toggle-group/toggle-group.styles.d.ts +1 -1
  106. package/dist/components/ui/tooltip/tooltip.d.ts +8 -8
  107. package/dist/components/ui/typography/typography.d.ts +174 -174
  108. package/dist/components-app-pagination-app-pagination.cjs +1 -1
  109. package/dist/components-app-pagination-app-pagination.cjs.map +1 -1
  110. package/dist/components-app-pagination-app-pagination.js +34 -32
  111. package/dist/components-app-pagination-app-pagination.js.map +1 -1
  112. package/dist/components-app-sidebar-app-sidebar.cjs +1 -1
  113. package/dist/components-app-sidebar-app-sidebar.cjs.map +1 -1
  114. package/dist/components-app-sidebar-app-sidebar.js +33 -32
  115. package/dist/components-app-sidebar-app-sidebar.js.map +1 -1
  116. package/dist/components-avatar-uploader-avatar-uploader.cjs +2 -2
  117. package/dist/components-avatar-uploader-avatar-uploader.cjs.map +1 -1
  118. package/dist/components-avatar-uploader-avatar-uploader.js +54 -36
  119. package/dist/components-avatar-uploader-avatar-uploader.js.map +1 -1
  120. package/dist/components-basic-avatar-basic-avatar.cjs +2 -2
  121. package/dist/components-basic-avatar-basic-avatar.cjs.map +1 -1
  122. package/dist/components-basic-avatar-basic-avatar.js +25 -5
  123. package/dist/components-basic-avatar-basic-avatar.js.map +1 -1
  124. package/dist/components-basic-chart-basic-chart.cjs +2 -2
  125. package/dist/components-basic-chart-basic-chart.cjs.map +1 -1
  126. package/dist/components-basic-chart-basic-chart.js +106 -108
  127. package/dist/components-basic-chart-basic-chart.js.map +1 -1
  128. package/dist/components-basic-table-basic-table.cjs +2 -2
  129. package/dist/components-basic-table-basic-table.cjs.map +1 -1
  130. package/dist/components-basic-table-basic-table.js +232 -231
  131. package/dist/components-basic-table-basic-table.js.map +1 -1
  132. package/dist/components-data-table-data-table-actions-column.cjs +1 -1
  133. package/dist/components-data-table-data-table-actions-column.cjs.map +1 -1
  134. package/dist/components-data-table-data-table-actions-column.js +1 -1
  135. package/dist/components-data-table-data-table-actions-column.js.map +1 -1
  136. package/dist/components-data-table-data-table-bulk-actions.cjs +1 -1
  137. package/dist/components-data-table-data-table-bulk-actions.cjs.map +1 -1
  138. package/dist/components-data-table-data-table-bulk-actions.js +9 -9
  139. package/dist/components-data-table-data-table-bulk-actions.js.map +1 -1
  140. package/dist/components-data-table-data-table-column-visibility.cjs +1 -1
  141. package/dist/components-data-table-data-table-column-visibility.cjs.map +1 -1
  142. package/dist/components-data-table-data-table-column-visibility.js +11 -10
  143. package/dist/components-data-table-data-table-column-visibility.js.map +1 -1
  144. package/dist/components-data-table-data-table-filter.cjs +1 -1
  145. package/dist/components-data-table-data-table-filter.cjs.map +1 -1
  146. package/dist/components-data-table-data-table-filter.js +15 -15
  147. package/dist/components-data-table-data-table-filter.js.map +1 -1
  148. package/dist/components-data-table-data-table-row-actions-column.cjs +1 -1
  149. package/dist/components-data-table-data-table-row-actions-column.cjs.map +1 -1
  150. package/dist/components-data-table-data-table-row-actions-column.js +1 -1
  151. package/dist/components-data-table-data-table-row-actions-column.js.map +1 -1
  152. package/dist/components-data-table-use-data-table-editable-rows.cjs +1 -1
  153. package/dist/components-data-table-use-data-table-editable-rows.cjs.map +1 -1
  154. package/dist/components-data-table-use-data-table-editable-rows.js +88 -90
  155. package/dist/components-data-table-use-data-table-editable-rows.js.map +1 -1
  156. package/dist/components-files-uploader-files-uploader.cjs +3 -3
  157. package/dist/components-files-uploader-files-uploader.cjs.map +1 -1
  158. package/dist/components-files-uploader-files-uploader.js +41 -38
  159. package/dist/components-files-uploader-files-uploader.js.map +1 -1
  160. package/dist/components-icons-ArrowCounterClockwise.cjs +2 -0
  161. package/dist/components-icons-ArrowCounterClockwise.cjs.map +1 -0
  162. package/dist/components-icons-ArrowCounterClockwise.js +5 -0
  163. package/dist/components-icons-ArrowCounterClockwise.js.map +1 -0
  164. package/dist/components-icons-BoundingBox.cjs +2 -0
  165. package/dist/components-icons-BoundingBox.cjs.map +1 -0
  166. package/dist/components-icons-BoundingBox.js +5 -0
  167. package/dist/components-icons-BoundingBox.js.map +1 -0
  168. package/dist/components-icons-Briefcase.cjs +2 -0
  169. package/dist/components-icons-Briefcase.cjs.map +1 -0
  170. package/dist/components-icons-Briefcase.js +5 -0
  171. package/dist/components-icons-Briefcase.js.map +1 -0
  172. package/dist/components-icons-Building.cjs +2 -0
  173. package/dist/components-icons-Building.cjs.map +1 -0
  174. package/dist/components-icons-Building.js +5 -0
  175. package/dist/components-icons-Building.js.map +1 -0
  176. package/dist/components-icons-Buildings.cjs +2 -0
  177. package/dist/components-icons-Buildings.cjs.map +1 -0
  178. package/dist/components-icons-Buildings.js +5 -0
  179. package/dist/components-icons-Buildings.js.map +1 -0
  180. package/dist/components-icons-CaretDown.cjs +2 -0
  181. package/dist/components-icons-CaretDown.cjs.map +1 -0
  182. package/dist/components-icons-CaretDown.js +5 -0
  183. package/dist/components-icons-CaretDown.js.map +1 -0
  184. package/dist/components-icons-CaretLeft.cjs +2 -0
  185. package/dist/components-icons-CaretLeft.cjs.map +1 -0
  186. package/dist/components-icons-CaretLeft.js +5 -0
  187. package/dist/components-icons-CaretLeft.js.map +1 -0
  188. package/dist/components-icons-CaretRight.cjs +2 -0
  189. package/dist/components-icons-CaretRight.cjs.map +1 -0
  190. package/dist/components-icons-CaretRight.js +5 -0
  191. package/dist/components-icons-CaretRight.js.map +1 -0
  192. package/dist/components-icons-CaretUp.cjs +2 -0
  193. package/dist/components-icons-CaretUp.cjs.map +1 -0
  194. package/dist/components-icons-CaretUp.js +5 -0
  195. package/dist/components-icons-CaretUp.js.map +1 -0
  196. package/dist/components-icons-CaretUpDown.cjs +2 -0
  197. package/dist/components-icons-CaretUpDown.cjs.map +1 -0
  198. package/dist/components-icons-CaretUpDown.js +5 -0
  199. package/dist/components-icons-CaretUpDown.js.map +1 -0
  200. package/dist/components-icons-ChartLine.cjs +2 -0
  201. package/dist/components-icons-ChartLine.cjs.map +1 -0
  202. package/dist/components-icons-ChartLine.js +5 -0
  203. package/dist/components-icons-ChartLine.js.map +1 -0
  204. package/dist/components-icons-Check.cjs +2 -0
  205. package/dist/components-icons-Check.cjs.map +1 -0
  206. package/dist/components-icons-Check.js +5 -0
  207. package/dist/components-icons-Check.js.map +1 -0
  208. package/dist/components-icons-CheckCircle.cjs +2 -0
  209. package/dist/components-icons-CheckCircle.cjs.map +1 -0
  210. package/dist/components-icons-CheckCircle.js +5 -0
  211. package/dist/components-icons-CheckCircle.js.map +1 -0
  212. package/dist/components-icons-Clock.cjs +2 -0
  213. package/dist/components-icons-Clock.cjs.map +1 -0
  214. package/dist/components-icons-Clock.js +5 -0
  215. package/dist/components-icons-Clock.js.map +1 -0
  216. package/dist/components-icons-CreditCard.cjs +2 -0
  217. package/dist/components-icons-CreditCard.cjs.map +1 -0
  218. package/dist/components-icons-CreditCard.js +5 -0
  219. package/dist/components-icons-CreditCard.js.map +1 -0
  220. package/dist/components-icons-DotsThree.cjs +2 -0
  221. package/dist/components-icons-DotsThree.cjs.map +1 -0
  222. package/dist/components-icons-DotsThree.js +5 -0
  223. package/dist/components-icons-DotsThree.js.map +1 -0
  224. package/dist/components-icons-DownloadSimple.cjs +2 -0
  225. package/dist/components-icons-DownloadSimple.cjs.map +1 -0
  226. package/dist/components-icons-DownloadSimple.js +5 -0
  227. package/dist/components-icons-DownloadSimple.js.map +1 -0
  228. package/dist/components-icons-EnvelopeSimple.cjs +2 -0
  229. package/dist/components-icons-EnvelopeSimple.cjs.map +1 -0
  230. package/dist/components-icons-EnvelopeSimple.js +5 -0
  231. package/dist/components-icons-EnvelopeSimple.js.map +1 -0
  232. package/dist/components-icons-Eye.cjs +2 -0
  233. package/dist/components-icons-Eye.cjs.map +1 -0
  234. package/dist/components-icons-Eye.js +5 -0
  235. package/dist/components-icons-Eye.js.map +1 -0
  236. package/dist/components-icons-EyeSlash.cjs +2 -0
  237. package/dist/components-icons-EyeSlash.cjs.map +1 -0
  238. package/dist/components-icons-EyeSlash.js +5 -0
  239. package/dist/components-icons-EyeSlash.js.map +1 -0
  240. package/dist/components-icons-FileText.cjs +2 -0
  241. package/dist/components-icons-FileText.cjs.map +1 -0
  242. package/dist/components-icons-FileText.js +5 -0
  243. package/dist/components-icons-FileText.js.map +1 -0
  244. package/dist/components-icons-Folder.cjs +2 -0
  245. package/dist/components-icons-Folder.cjs.map +1 -0
  246. package/dist/components-icons-Folder.js +5 -0
  247. package/dist/components-icons-Folder.js.map +1 -0
  248. package/dist/components-icons-Funnel.cjs +2 -0
  249. package/dist/components-icons-Funnel.cjs.map +1 -0
  250. package/dist/components-icons-Funnel.js +5 -0
  251. package/dist/components-icons-Funnel.js.map +1 -0
  252. package/dist/components-icons-Gear.cjs +2 -0
  253. package/dist/components-icons-Gear.cjs.map +1 -0
  254. package/dist/components-icons-Gear.js +5 -0
  255. package/dist/components-icons-Gear.js.map +1 -0
  256. package/dist/components-icons-Info.cjs +2 -0
  257. package/dist/components-icons-Info.cjs.map +1 -0
  258. package/dist/components-icons-Info.js +5 -0
  259. package/dist/components-icons-Info.js.map +1 -0
  260. package/dist/components-icons-LockKey.cjs +2 -0
  261. package/dist/components-icons-LockKey.cjs.map +1 -0
  262. package/dist/components-icons-LockKey.js +5 -0
  263. package/dist/components-icons-LockKey.js.map +1 -0
  264. package/dist/components-icons-MagnifyingGlass.cjs +2 -0
  265. package/dist/components-icons-MagnifyingGlass.cjs.map +1 -0
  266. package/dist/components-icons-MagnifyingGlass.js +5 -0
  267. package/dist/components-icons-MagnifyingGlass.js.map +1 -0
  268. package/dist/components-icons-MaxLogo.cjs +2 -0
  269. package/dist/components-icons-MaxLogo.cjs.map +1 -0
  270. package/dist/components-icons-MaxLogo.js +5 -0
  271. package/dist/components-icons-MaxLogo.js.map +1 -0
  272. package/dist/components-icons-Package.cjs +2 -0
  273. package/dist/components-icons-Package.cjs.map +1 -0
  274. package/dist/components-icons-Package.js +5 -0
  275. package/dist/components-icons-Package.js.map +1 -0
  276. package/dist/components-icons-Pencil.cjs +2 -0
  277. package/dist/components-icons-Pencil.cjs.map +1 -0
  278. package/dist/components-icons-Pencil.js +5 -0
  279. package/dist/components-icons-Pencil.js.map +1 -0
  280. package/dist/components-icons-Phone.cjs +2 -0
  281. package/dist/components-icons-Phone.cjs.map +1 -0
  282. package/dist/components-icons-Phone.js +5 -0
  283. package/dist/components-icons-Phone.js.map +1 -0
  284. package/dist/components-icons-Plus.cjs +2 -0
  285. package/dist/components-icons-Plus.cjs.map +1 -0
  286. package/dist/components-icons-Plus.js +5 -0
  287. package/dist/components-icons-Plus.js.map +1 -0
  288. package/dist/components-icons-PresentationChart.cjs +2 -0
  289. package/dist/components-icons-PresentationChart.cjs.map +1 -0
  290. package/dist/components-icons-PresentationChart.js +5 -0
  291. package/dist/components-icons-PresentationChart.js.map +1 -0
  292. package/dist/components-icons-SpinnerGap.cjs +2 -0
  293. package/dist/components-icons-SpinnerGap.cjs.map +1 -0
  294. package/dist/components-icons-SpinnerGap.js +5 -0
  295. package/dist/components-icons-SpinnerGap.js.map +1 -0
  296. package/dist/components-icons-TelegramLogo.cjs +2 -0
  297. package/dist/components-icons-TelegramLogo.cjs.map +1 -0
  298. package/dist/components-icons-TelegramLogo.js +5 -0
  299. package/dist/components-icons-TelegramLogo.js.map +1 -0
  300. package/dist/components-icons-Trash.cjs +2 -0
  301. package/dist/components-icons-Trash.cjs.map +1 -0
  302. package/dist/components-icons-Trash.js +5 -0
  303. package/dist/components-icons-Trash.js.map +1 -0
  304. package/dist/components-icons-UserCircleGear.cjs +2 -0
  305. package/dist/components-icons-UserCircleGear.cjs.map +1 -0
  306. package/dist/components-icons-UserCircleGear.js +5 -0
  307. package/dist/components-icons-UserCircleGear.js.map +1 -0
  308. package/dist/components-icons-Users.cjs +2 -0
  309. package/dist/components-icons-Users.cjs.map +1 -0
  310. package/dist/components-icons-Users.js +5 -0
  311. package/dist/components-icons-Users.js.map +1 -0
  312. package/dist/components-icons-UsersFour.cjs +2 -0
  313. package/dist/components-icons-UsersFour.cjs.map +1 -0
  314. package/dist/components-icons-UsersFour.js +5 -0
  315. package/dist/components-icons-UsersFour.js.map +1 -0
  316. package/dist/components-icons-Warning.cjs +2 -0
  317. package/dist/components-icons-Warning.cjs.map +1 -0
  318. package/dist/components-icons-Warning.js +5 -0
  319. package/dist/components-icons-Warning.js.map +1 -0
  320. package/dist/components-icons-WarningCircle.cjs +2 -0
  321. package/dist/components-icons-WarningCircle.cjs.map +1 -0
  322. package/dist/components-icons-WarningCircle.js +5 -0
  323. package/dist/components-icons-WarningCircle.js.map +1 -0
  324. package/dist/components-icons-WhatsAppLogoFilled.cjs +2 -0
  325. package/dist/components-icons-WhatsAppLogoFilled.cjs.map +1 -0
  326. package/dist/components-icons-WhatsAppLogoFilled.js +5 -0
  327. package/dist/components-icons-WhatsAppLogoFilled.js.map +1 -0
  328. package/dist/components-icons-Wrench.cjs +2 -0
  329. package/dist/components-icons-Wrench.cjs.map +1 -0
  330. package/dist/components-icons-Wrench.js +5 -0
  331. package/dist/components-icons-Wrench.js.map +1 -0
  332. package/dist/components-icons-X.cjs +2 -0
  333. package/dist/components-icons-X.cjs.map +1 -0
  334. package/dist/components-icons-X.js +5 -0
  335. package/dist/components-icons-X.js.map +1 -0
  336. package/dist/components-icons-XCircle.cjs +2 -0
  337. package/dist/components-icons-XCircle.cjs.map +1 -0
  338. package/dist/components-icons-XCircle.js +5 -0
  339. package/dist/components-icons-XCircle.js.map +1 -0
  340. package/dist/components-icons-stroke-icon.cjs +2 -0
  341. package/dist/components-icons-stroke-icon.cjs.map +1 -0
  342. package/dist/components-icons-stroke-icon.js +39 -0
  343. package/dist/components-icons-stroke-icon.js.map +1 -0
  344. package/dist/components-icons.cjs +2 -0
  345. package/dist/components-icons.cjs.map +1 -0
  346. package/dist/components-icons.js +97 -0
  347. package/dist/components-icons.js.map +1 -0
  348. package/dist/components-input-contact-input-contact.cjs +4 -4
  349. package/dist/components-input-contact-input-contact.cjs.map +1 -1
  350. package/dist/components-input-contact-input-contact.js +104 -75
  351. package/dist/components-input-contact-input-contact.js.map +1 -1
  352. package/dist/components-input-field-input-field.cjs +1 -1
  353. package/dist/components-input-field-input-field.cjs.map +1 -1
  354. package/dist/components-input-field-input-field.js +18 -19
  355. package/dist/components-input-field-input-field.js.map +1 -1
  356. package/dist/components-input-password-input-password.cjs +1 -1
  357. package/dist/components-input-password-input-password.cjs.map +1 -1
  358. package/dist/components-input-password-input-password.js +14 -52
  359. package/dist/components-input-password-input-password.js.map +1 -1
  360. package/dist/components-input-phone-input-phone.cjs.map +1 -1
  361. package/dist/components-input-phone-input-phone.js.map +1 -1
  362. package/dist/components-popover-modal-popover-modal.cjs +1 -1
  363. package/dist/components-popover-modal-popover-modal.cjs.map +1 -1
  364. package/dist/components-popover-modal-popover-modal.js +40 -29
  365. package/dist/components-popover-modal-popover-modal.js.map +1 -1
  366. package/dist/components-select-field-select-field.cjs.map +1 -1
  367. package/dist/components-select-field-select-field.js.map +1 -1
  368. package/dist/components-ui-avatar-avatar.cjs +1 -1
  369. package/dist/components-ui-avatar-avatar.cjs.map +1 -1
  370. package/dist/components-ui-avatar-avatar.js +12 -13
  371. package/dist/components-ui-avatar-avatar.js.map +1 -1
  372. package/dist/components-ui-badge-badge.cjs +1 -1
  373. package/dist/components-ui-badge-badge.cjs.map +1 -1
  374. package/dist/components-ui-badge-badge.js +10 -11
  375. package/dist/components-ui-badge-badge.js.map +1 -1
  376. package/dist/components-ui-button-button.cjs +1 -1
  377. package/dist/components-ui-button-button.cjs.map +1 -1
  378. package/dist/components-ui-button-button.js +10 -11
  379. package/dist/components-ui-button-button.js.map +1 -1
  380. package/dist/components-ui-button-button.styles.cjs +4 -4
  381. package/dist/components-ui-button-button.styles.cjs.map +1 -1
  382. package/dist/components-ui-button-button.styles.js +4 -4
  383. package/dist/components-ui-button-button.styles.js.map +1 -1
  384. package/dist/components-ui-calendar-calendar.cjs +1 -1
  385. package/dist/components-ui-calendar-calendar.js +4 -3
  386. package/dist/components-ui-calendar-calendar.js.map +1 -1
  387. package/dist/components-ui-calendar-calendar.styles.cjs +1 -1
  388. package/dist/components-ui-calendar-calendar.styles.cjs.map +1 -1
  389. package/dist/components-ui-calendar-calendar.styles.js +1 -1
  390. package/dist/components-ui-calendar-calendar.styles.js.map +1 -1
  391. package/dist/components-ui-calendar.cjs +1 -1
  392. package/dist/components-ui-calendar.js +2 -2
  393. package/dist/components-ui-card-card.cjs +1 -1
  394. package/dist/components-ui-card-card.cjs.map +1 -1
  395. package/dist/components-ui-card-card.js +10 -11
  396. package/dist/components-ui-card-card.js.map +1 -1
  397. package/dist/components-ui-chart-chart.cjs +1 -1
  398. package/dist/components-ui-chart-chart.js +1 -1
  399. package/dist/components-ui-chart.cjs +1 -1
  400. package/dist/components-ui-chart.js +1 -1
  401. package/dist/components-ui-checkbox-checkbox.cjs +1 -1
  402. package/dist/components-ui-checkbox-checkbox.cjs.map +1 -1
  403. package/dist/components-ui-checkbox-checkbox.js +13 -13
  404. package/dist/components-ui-checkbox-checkbox.js.map +1 -1
  405. package/dist/components-ui-combobox-combobox.cjs +5 -5
  406. package/dist/components-ui-combobox-combobox.cjs.map +1 -1
  407. package/dist/components-ui-combobox-combobox.js +1478 -1479
  408. package/dist/components-ui-combobox-combobox.js.map +1 -1
  409. package/dist/components-ui-dialog-dialog.cjs +1 -1
  410. package/dist/components-ui-dialog-dialog.cjs.map +1 -1
  411. package/dist/components-ui-dialog-dialog.js +23 -23
  412. package/dist/components-ui-dialog-dialog.js.map +1 -1
  413. package/dist/components-ui-drawer-drawer.cjs +2 -2
  414. package/dist/components-ui-drawer-drawer.cjs.map +1 -1
  415. package/dist/components-ui-drawer-drawer.js +16 -19
  416. package/dist/components-ui-drawer-drawer.js.map +1 -1
  417. package/dist/components-ui-dropdown-menu-dropdown-menu.cjs +1 -1
  418. package/dist/components-ui-dropdown-menu-dropdown-menu.cjs.map +1 -1
  419. package/dist/components-ui-dropdown-menu-dropdown-menu.js +1 -1
  420. package/dist/components-ui-dropdown-menu-dropdown-menu.js.map +1 -1
  421. package/dist/components-ui-icon-icon-map.cjs +2 -0
  422. package/dist/components-ui-icon-icon-map.cjs.map +1 -0
  423. package/dist/components-ui-icon-icon-map.js +71 -0
  424. package/dist/components-ui-icon-icon-map.js.map +1 -0
  425. package/dist/components-ui-icon-icon.cjs +1 -1
  426. package/dist/components-ui-icon-icon.cjs.map +1 -1
  427. package/dist/components-ui-icon-icon.js +29 -61735
  428. package/dist/components-ui-icon-icon.js.map +1 -1
  429. package/dist/components-ui-icon.cjs +1 -1
  430. package/dist/components-ui-icon.js +3 -1
  431. package/dist/components-ui-icon.js.map +1 -1
  432. package/dist/components-ui-input-group-input-group.cjs +1 -1
  433. package/dist/components-ui-input-group-input-group.cjs.map +1 -1
  434. package/dist/components-ui-input-group-input-group.js +12 -13
  435. package/dist/components-ui-input-group-input-group.js.map +1 -1
  436. package/dist/components-ui-input-input.cjs +1 -1
  437. package/dist/components-ui-input-input.cjs.map +1 -1
  438. package/dist/components-ui-input-input.js +2 -3
  439. package/dist/components-ui-input-input.js.map +1 -1
  440. package/dist/components-ui-label-label.cjs +1 -1
  441. package/dist/components-ui-label-label.cjs.map +1 -1
  442. package/dist/components-ui-label-label.js +1 -1
  443. package/dist/components-ui-label-label.js.map +1 -1
  444. package/dist/components-ui-pagination-pagination.cjs +2 -2
  445. package/dist/components-ui-pagination-pagination.cjs.map +1 -1
  446. package/dist/components-ui-pagination-pagination.js +48 -46
  447. package/dist/components-ui-pagination-pagination.js.map +1 -1
  448. package/dist/components-ui-popover-popover.cjs +1 -1
  449. package/dist/components-ui-popover-popover.cjs.map +1 -1
  450. package/dist/components-ui-popover-popover.js +14 -19
  451. package/dist/components-ui-popover-popover.js.map +1 -1
  452. package/dist/components-ui-progress-progress.cjs +1 -1
  453. package/dist/components-ui-progress-progress.cjs.map +1 -1
  454. package/dist/components-ui-progress-progress.js +1 -1
  455. package/dist/components-ui-progress-progress.js.map +1 -1
  456. package/dist/components-ui-radio-group-radio-group.cjs +1 -1
  457. package/dist/components-ui-radio-group-radio-group.cjs.map +1 -1
  458. package/dist/components-ui-radio-group-radio-group.js +0 -1
  459. package/dist/components-ui-radio-group-radio-group.js.map +1 -1
  460. package/dist/components-ui-select-calendar-menu-select-calendar-menu.cjs +1 -1
  461. package/dist/components-ui-select-calendar-menu-select-calendar-menu.cjs.map +1 -1
  462. package/dist/components-ui-select-calendar-menu-select-calendar-menu.js +54 -47
  463. package/dist/components-ui-select-calendar-menu-select-calendar-menu.js.map +1 -1
  464. package/dist/components-ui-select-select.cjs +1 -1
  465. package/dist/components-ui-select-select.cjs.map +1 -1
  466. package/dist/components-ui-select-select.js +36 -36
  467. package/dist/components-ui-select-select.js.map +1 -1
  468. package/dist/components-ui-separator-separator.cjs +1 -1
  469. package/dist/components-ui-separator-separator.cjs.map +1 -1
  470. package/dist/components-ui-separator-separator.js +11 -12
  471. package/dist/components-ui-separator-separator.js.map +1 -1
  472. package/dist/components-ui-sonner-sonner.cjs +1 -1
  473. package/dist/components-ui-sonner-sonner.cjs.map +1 -1
  474. package/dist/components-ui-sonner-sonner.js +38 -32
  475. package/dist/components-ui-sonner-sonner.js.map +1 -1
  476. package/dist/components-ui-switch-switch.cjs +1 -1
  477. package/dist/components-ui-switch-switch.cjs.map +1 -1
  478. package/dist/components-ui-switch-switch.js +6 -7
  479. package/dist/components-ui-switch-switch.js.map +1 -1
  480. package/dist/components-ui-table-table.cjs +1 -1
  481. package/dist/components-ui-table-table.cjs.map +1 -1
  482. package/dist/components-ui-table-table.js +0 -1
  483. package/dist/components-ui-table-table.js.map +1 -1
  484. package/dist/components-ui-tabs-tabs.cjs +2 -2
  485. package/dist/components-ui-tabs-tabs.cjs.map +1 -1
  486. package/dist/components-ui-tabs-tabs.js +16 -16
  487. package/dist/components-ui-tabs-tabs.js.map +1 -1
  488. package/dist/components-ui-tooltip-tooltip.cjs +1 -1
  489. package/dist/components-ui-tooltip-tooltip.cjs.map +1 -1
  490. package/dist/components-ui-tooltip-tooltip.js +9 -10
  491. package/dist/components-ui-tooltip-tooltip.js.map +1 -1
  492. package/dist/components-ui-typography-typography.cjs +1 -1
  493. package/dist/components-ui-typography-typography.cjs.map +1 -1
  494. package/dist/components-ui-typography-typography.js +7 -7
  495. package/dist/components-ui-typography-typography.js.map +1 -1
  496. package/dist/index.cjs +1 -1
  497. package/dist/index.js +234 -233
  498. package/dist/index.js.map +1 -1
  499. package/package.json +10 -1
  500. package/dist/calendar-DReGV_22.cjs +0 -2
  501. package/dist/chart-C69jBlXa.cjs +0 -63
@@ -1,7 +1,7 @@
1
- "use strict";var Cc=Object.defineProperty;var wc=(e,t,n)=>t in e?Cc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>wc(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react/jsx-runtime"),qn=require("react"),Ze=require("./lib-utils.cjs"),Rc=require("./components-ui-button-button.cjs");require("./components-ui-button-button.styles.cjs");const kn=require("./components-ui-field-field.cjs"),sr=require("./components-ui-icon-icon.cjs"),Un=require("./components-ui-input-group-input-group.cjs"),He=require("./components-ui-combobox-combobox.styles.cjs"),Kn=require("./with-selector-DSbfqgSY.cjs"),Ic=require("react-dom");function Is(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const a=Is(qn),zt=Is(Ic);function ko({controlled:e,default:t,name:n,state:o="value"}){const{current:r}=a.useRef(e!==void 0),[s,i]=a.useState(t),c=r?e:s;if(process.env.NODE_ENV!=="production"){a.useEffect(()=>{r!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${r?"":"un"}controlled ${o} state of ${n} to be ${r?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
2
- `))},[o,n,e]);const{current:l}=a.useRef(t);a.useEffect(()=>{!r&&JSON.stringify(l)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${o} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
3
- `))},[JSON.stringify(t)])}const u=a.useCallback(l=>{r||i(l)},[]);return[c,u]}const Wr={};function at(e,t){const n=a.useRef(Wr);return n.current===Wr&&(n.current=e(t)),n}const Mo=a[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Sc=Mo&&Mo!==a.useLayoutEffect?Mo:e=>e();function Y(e){const t=at(Oc).current;return t.next=e,Sc(t.effect),t.trampoline}function Oc(){const e={next:void 0,callback:Pc,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Pc(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const Ac=()=>{},Q=typeof document<"u"?a.useLayoutEffect:Ac,ir=a.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});process.env.NODE_ENV!=="production"&&(ir.displayName="CompositeListContext");function Tc(){return a.useContext(ir)}function Ss(e){const{children:t,elementsRef:n,labelsRef:o,onMapChange:r}=e,s=Y(r),i=a.useRef(0),c=at(kc).current,u=at(Nc).current,[l,d]=a.useState(0),f=a.useRef(l),g=Y((b,m)=>{u.set(b,m??null),f.current+=1,d(f.current)}),p=Y(b=>{u.delete(b),f.current+=1,d(f.current)}),x=a.useMemo(()=>{const b=new Map;return Array.from(u.keys()).filter(w=>w.isConnected).sort(Mc).forEach((w,v)=>{const E=u.get(w)??{};b.set(w,{...E,index:v})}),b},[u,l]);Q(()=>{if(typeof MutationObserver!="function"||x.size===0)return;const b=new MutationObserver(m=>{const w=new Set,v=E=>w.has(E)?w.delete(E):w.add(E);m.forEach(E=>{E.removedNodes.forEach(v),E.addedNodes.forEach(v)}),w.size===0&&(f.current+=1,d(f.current))});return x.forEach((m,w)=>{w.parentElement&&b.observe(w.parentElement,{childList:!0})}),()=>{b.disconnect()}},[x]),Q(()=>{f.current===l&&(n.current.length!==x.size&&(n.current.length=x.size),o&&o.current.length!==x.size&&(o.current.length=x.size),i.current=x.size),s(x)},[s,x,n,o,l]),Q(()=>()=>{n.current=[]},[n]),Q(()=>()=>{o&&(o.current=[])},[o]);const y=Y(b=>(c.add(b),()=>{c.delete(b)}));Q(()=>{c.forEach(b=>b(x))},[c,x]);const h=a.useMemo(()=>({register:g,unregister:p,subscribeMapChange:y,elementsRef:n,labelsRef:o,nextIndexRef:i}),[g,p,y,n,o,i]);return j.jsx(ir.Provider,{value:h,children:t})}function Nc(){return new Map}function kc(){return new Set}function Mc(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Os=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Os.displayName="DirectionContext");function Ps(){return a.useContext(Os)?.direction??"ltr"}function gt(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(o=>n.searchParams.append("args[]",o)),`Base UI error #${e}; visit ${n} for the full message.`}function yn(e,t,n,o){const r=at(As).current;return Vc(r,e,t,n,o)&&Ts(r,[e,t,n,o]),r.callback}function Dc(e){const t=at(As).current;return Lc(t,e)&&Ts(t,e),t.callback}function As(){return{callback:null,cleanup:null,refs:[]}}function Vc(e,t,n,o,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==o||e.refs[3]!==r}function Lc(e,t){return e.refs.length!==t.length||e.refs.some((n,o)=>n!==t[o])}function Ts(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const o=Array(t.length).fill(null);for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(o[r]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=o[r];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}const Fc=parseInt(a.version,10);function cr(e){return Fc>=e}function Gr(e){if(!a.isValidElement(e))return null;const t=e,n=t.props;return(cr(19)?n?.ref:t.ref)??null}function Ho(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function _c(e,t){const n={};for(const o in e){const r=e[o];if(t?.hasOwnProperty(o)){const s=t[o](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${o.toLowerCase()}`]="":r&&(n[`data-${o.toLowerCase()}`]=r.toString())}return n}function Bc(e,t){return typeof e=="function"?e(t):e}function jc(e,t){return typeof e=="function"?e(t):e}const pn={};function Ns(e,t,n,o,r){let s={...Uo(e,pn)};return t&&(s=Wn(s,t)),n&&(s=Wn(s,n)),o&&(s=Wn(s,o)),s}function $c(e){if(e.length===0)return pn;if(e.length===1)return Uo(e[0],pn);let t={...Uo(e[0],pn)};for(let n=1;n<e.length;n+=1)t=Wn(t,e[n]);return t}function Wn(e,t){return ks(t)?t(e):Hc(e,t)}function Hc(e,t){if(!t)return e;for(const n in t){const o=t[n];switch(n){case"style":{e[n]=Ho(e.style,o);break}case"className":{e[n]=Ms(e.className,o);break}default:Uc(n,o)?e[n]=Wc(e[n],o):e[n]=o}}return e}function Uc(e,t){const n=e.charCodeAt(0),o=e.charCodeAt(1),r=e.charCodeAt(2);return n===111&&o===110&&r>=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function ks(e){return typeof e=="function"}function Uo(e,t){return ks(e)?e(t):e??pn}function Wc(e,t){return t?e?n=>{if(Gc(n)){const r=n;Wo(r);const s=t(r);return r.baseUIHandlerPrevented||e?.(r),s}const o=t(n);return e?.(n),o}:t:e}function Wo(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Ms(e,t){return t?e?t+" "+e:t:e}function Gc(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Re(){}const Mn=Object.freeze([]),We=Object.freeze({}),qc={style:{transition:"none"}},Kc="data-base-ui-click-trigger",zc={fallbackAxisSide:"none"},Yc={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Ge(e,t,n={}){const o=t.render,r=Xc(t,n);if(n.enabled===!1)return null;const s=n.state??We;return Qc(e,o,r,s)}function Xc(e,t={}){const{className:n,style:o,render:r}=e,{state:s=We,ref:i,props:c,stateAttributesMapping:u,enabled:l=!0}=t,d=l?Bc(n,s):void 0,f=l?jc(o,s):void 0,g=l?_c(s,u):We,p=l?Ho(g,Array.isArray(c)?$c(c):c)??We:We;return typeof document<"u"&&(l?Array.isArray(i)?p.ref=Dc([p.ref,Gr(r),...i]):p.ref=yn(p.ref,Gr(r),i):yn(null,null)),l?(d!==void 0&&(p.className=Ms(p.className,d)),f!==void 0&&(p.style=Ho(p.style,f)),p):We}const Jc=Symbol.for("react.lazy");function Qc(e,t,n,o){if(t){if(typeof t=="function")return t(n,o);const r=Ns(n,t.props);r.ref=n.ref;let s=t;if(s?.$$typeof===Jc&&(s=a.Children.toArray(t)[0]),process.env.NODE_ENV!=="production"&&!a.isValidElement(s))throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.","https://base-ui.com/r/invalid-render-prop"].join(`
4
- `));return a.cloneElement(s,r)}if(e&&typeof e=="string")return Zc(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":gt(8))}function Zc(e,t){return e==="button"?qn.createElement("button",{type:"button",...t,key:t.key}):e==="img"?qn.createElement("img",{alt:"",...t,key:t.key}):a.createElement(e,t)}const it="none",Go="trigger-press",el="trigger-hover",lr="outside-press",tl="item-press",qr="clear-press",nl="chip-remove-press",Jt="input-change",Nt="input-clear",ol="input-press",so="focus-out",Ds="escape-key",mn="list-navigation";function ce(e,t,n,o){let r=!1,s=!1;const i=We;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...i}}function un(e,t,n){const o=n??We;return{reason:e,event:t??new Event("base-ui"),...o}}const qo={...a};let Kr=0;function rl(e,t="mui"){const[n,o]=a.useState(e),r=e||n;return a.useEffect(()=>{n==null&&(Kr+=1,o(`${t}-${Kr}`))},[n,t]),r}const zr=qo.useId;function ar(e,t){if(zr!==void 0){const n=zr();return e??(t?`${t}-${n}`:n)}return rl(e,t)}function ur(e){return ar(e,"base-ui")}const sl=[];function Vs(e){a.useEffect(e,sl)}const Dn=null;let Yr=globalThis.requestAnimationFrame;class il{constructor(){Pe(this,"callbacks",[]);Pe(this,"callbacksCount",0);Pe(this,"nextId",1);Pe(this,"startId",1);Pe(this,"isScheduled",!1);Pe(this,"tick",t=>{this.isScheduled=!1;const n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<n.length;r+=1)n[r]?.(t)})}request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const o=process.env.NODE_ENV!=="production"&&Yr!==requestAnimationFrame&&(Yr=requestAnimationFrame,!0);return(!this.isScheduled||o)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Vn=new il;class xt{constructor(){Pe(this,"currentId",Dn);Pe(this,"cancel",()=>{this.currentId!==Dn&&(Vn.cancel(this.currentId),this.currentId=Dn)});Pe(this,"disposeEffect",()=>this.cancel)}static create(){return new xt}static request(t){return Vn.request(t)}static cancel(t){return Vn.cancel(t)}request(t){this.cancel(),this.currentId=Vn.request(()=>{this.currentId=Dn,t()})}}function fr(){const e=at(xt.create).current;return Vs(e.disposeEffect),e}function Ct(e){return e==null?e:"current"in e?e.current:e}let vn=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const cl={[vn.startingStyle]:""},ll={[vn.endingStyle]:""},Ls={transitionStatus(e){return e==="starting"?cl:e==="ending"?ll:null}};function al(e,t=!1,n=!0){const o=fr();return Y((r,s=null)=>{o.cancel();function i(){zt.flushSync(r)}const c=Ct(e);if(c==null)return;const u=c;if(typeof u.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let l=function(){const f=vn.startingStyle;if(!u.hasAttribute(f)){o.request(d);return}const g=new MutationObserver(()=>{u.hasAttribute(f)||(g.disconnect(),d())});g.observe(u,{attributes:!0,attributeFilter:[f]}),s?.addEventListener("abort",()=>g.disconnect(),{once:!0})},d=function(){Promise.all(u.getAnimations().map(f=>f.finished)).then(()=>{s?.aborted||i()}).catch(()=>{const f=u.getAnimations();if(n){if(s?.aborted)return;i()}else f.length>0&&f.some(g=>g.pending||g.playState!=="finished")&&d()})};if(t){l();return}o.request(d)}})}function Fs(e,t=!1,n=!1){const[o,r]=a.useState(e&&t?"idle":void 0),[s,i]=a.useState(e);return e&&!s&&(i(!0),r("starting")),!e&&s&&o!=="ending"&&!n&&r("ending"),!e&&!s&&o==="ending"&&r(void 0),Q(()=>{if(!e&&s&&o!=="ending"&&n){const c=xt.request(()=>{r("ending")});return()=>{xt.cancel(c)}}},[e,s,o,n]),Q(()=>{if(!e||t)return;const c=xt.request(()=>{r(void 0)});return()=>{xt.cancel(c)}},[t,e]),Q(()=>{if(!e||!t)return;e&&s&&o!=="idle"&&r("starting");const c=xt.request(()=>{r("idle")});return()=>{xt.cancel(c)}},[t,e,s,r,o]),a.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:o}),[s,o])}let _s=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Bs(e={}){const{label:t,metadata:n,textRef:o,indexGuessBehavior:r,index:s}=e,{register:i,unregister:c,subscribeMapChange:u,elementsRef:l,labelsRef:d,nextIndexRef:f}=Tc(),g=a.useRef(-1),[p,x]=a.useState(s??(r===_s.GuessFromOrder?()=>{if(g.current===-1){const b=f.current;f.current+=1,g.current=b}return g.current}:-1)),y=a.useRef(null),h=a.useCallback(b=>{if(y.current=b,p!==-1&&b!==null&&(l.current[p]=b,d)){const m=t!==void 0;d.current[p]=m?t:o?.current?.textContent??b.textContent}},[p,l,d,t,o]);return Q(()=>{if(s!=null)return;const b=y.current;if(b)return i(b,n),()=>{c(b)}},[s,i,c,n]),Q(()=>{if(s==null)return u(b=>{const m=y.current?b.get(y.current)?.index:null;m!=null&&x(m)})},[s,u,x]),a.useMemo(()=>({ref:h,index:p}),[p,h])}function io(){return typeof window<"u"}function Lt(e){return dr(e)?(e.nodeName||"").toLowerCase():"#document"}function _e(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vt(e){var t;return(t=(dr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dr(e){return io()?e instanceof Node||e instanceof _e(e).Node:!1}function Ce(e){return io()?e instanceof Element||e instanceof _e(e).Element:!1}function ke(e){return io()?e instanceof HTMLElement||e instanceof _e(e).HTMLElement:!1}function Ko(e){return!io()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _e(e).ShadowRoot}function Ft(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=rt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function ul(e){return/^(table|td|th)$/.test(Lt(e))}function co(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const fl=/transform|translate|scale|rotate|perspective|filter/,dl=/paint|layout|strict|content/,Ut=e=>!!e&&e!=="none";let Do;function pr(e){const t=Ce(e)?rt(e):e;return Ut(t.transform)||Ut(t.translate)||Ut(t.scale)||Ut(t.rotate)||Ut(t.perspective)||!lo()&&(Ut(t.backdropFilter)||Ut(t.filter))||fl.test(t.willChange||"")||dl.test(t.contain||"")}function pl(e){let t=It(e);for(;ke(t)&&!Rt(t);){if(pr(t))return t;if(co(t))return null;t=It(t)}return null}function lo(){return Do==null&&(Do=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Do}function Rt(e){return/^(html|body|#document)$/.test(Lt(e))}function rt(e){return _e(e).getComputedStyle(e)}function ao(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function It(e){if(Lt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ko(e)&&e.host||vt(e);return Ko(t)?t.host:t}function js(e){const t=It(e);return Rt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ke(t)&&Ft(t)?t:js(t)}function Mt(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=js(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=_e(r);if(s){const c=zo(i);return t.concat(i,i.visualViewport||[],Ft(r)?r:[],c&&n?Mt(c):[])}else return t.concat(r,Mt(r,[],n))}function zo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}let Yo;process.env.NODE_ENV!=="production"&&(Yo=new Set);function Xr(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");Yo.has(t)||(Yo.add(t),console.error(`Base UI: ${t}`))}}const $s=a.createContext(void 0);process.env.NODE_ENV!=="production"&&($s.displayName="CompositeRootContext");function ml(e=!1){const t=a.useContext($s);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":gt(16));return t}function hl(e){const{focusableWhenDisabled:t,disabled:n,composite:o=!1,tabIndex:r=0,isNativeButton:s}=e,i=o&&t!==!1,c=o&&t===!1;return{props:a.useMemo(()=>{const l={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return o||(l.tabIndex=r,!s&&n&&(l.tabIndex=t?r:-1)),(s&&(t||i)||!s&&n)&&(l["aria-disabled"]=n),s&&(!t||c)&&(l.disabled=n),l},[o,n,t,i,c,s,r])}}function uo(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:o=0,native:r=!0}=e,s=a.useRef(null),i=ml(!0)!==void 0,c=Y(()=>{const g=s.current;return!!(g?.tagName==="A"&&g?.href)}),{props:u}=hl({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:o,isNativeButton:r});process.env.NODE_ENV!=="production"&&a.useEffect(()=>{if(!s.current)return;const g=s.current.tagName==="BUTTON";if(r){if(!g){const p=qo.captureOwnerStack?.()||"";Xr(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${p}`)}}else if(g){const p=qo.captureOwnerStack?.()||"";Xr(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${p}`)}},[r]);const l=a.useCallback(()=>{const g=s.current;gl(g)&&i&&t&&u.disabled===void 0&&g.disabled&&(g.disabled=!1)},[t,u.disabled,i]);Q(l,[l]);const d=a.useCallback((g={})=>{const{onClick:p,onMouseDown:x,onKeyUp:y,onKeyDown:h,onPointerDown:b,...m}=g;return Ns({type:r?"button":void 0,onClick(v){if(t){v.preventDefault();return}p?.(v)},onMouseDown(v){t||x?.(v)},onKeyDown(v){if(t||(Wo(v),h?.(v)),v.baseUIHandlerPrevented)return;const E=v.target===v.currentTarget&&!r&&!c()&&!t,S=v.key==="Enter",R=v.key===" ";E&&((R||S)&&v.preventDefault(),S&&p?.(v))},onKeyUp(v){t||(Wo(v),y?.(v)),!v.baseUIHandlerPrevented&&v.target===v.currentTarget&&!r&&!t&&v.key===" "&&p?.(v)},onPointerDown(v){if(t){v.preventDefault();return}b?.(v)}},r?void 0:{role:"button"},u,m)},[t,u,r,c]),f=Y(g=>{s.current=g,l()});return{getButtonProps:d,buttonRef:f}}function gl(e){return ke(e)&&e.tagName==="BUTTON"}const Yt=typeof navigator<"u",Vo=yl(),Hs=El(),mr=vl(),Us=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),Ws=Vo.platform==="MacIntel"&&Vo.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Vo.platform),Jr=Yt&&/firefox/i.test(mr),bl=Yt&&/apple/i.test(navigator.vendor),zn=Yt&&/android/i.test(Hs)||/android/i.test(mr);Yt&&Hs.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const xl=mr.includes("jsdom/");function yl(){if(!Yt)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function vl(){if(!Yt)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function El(){if(!Yt)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Xo="data-base-ui-focusable",Gs="active",qs="selected",Cl="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Dt="ArrowLeft",Vt="ArrowRight",hr="ArrowUp",Cn="ArrowDown";function wt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function me(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Ko(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Qe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ht(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function wl(e){return e.matches("html,body")}function gr(e){return ke(e)&&e.matches(Cl)}function Jo(e){return e?e.getAttribute("role")==="combobox"&&gr(e):!1}function Qo(e){return e?e.hasAttribute(Xo)?e:e.querySelector(`[${Xo}]`)||e:null}function Zt(e,t,n=!0){return e.filter(r=>r.parentId===t&&(!n||r.context?.open)).flatMap(r=>[r,...Zt(e,r.id,n)])}function Qr(e,t){let n=[],o=e.find(r=>r.id===t)?.parentId;for(;o;){const r=e.find(s=>s.id===o);o=r?.parentId,r&&(n=n.concat(r))}return n}function Ee(e){e.preventDefault(),e.stopPropagation()}function Rl(e){return"nativeEvent"in e}function Ks(e){return e.pointerType===""&&e.isTrusted?!0:zn&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function zs(e){return xl?!1:!zn&&e.width===0&&e.height===0||zn&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Zr(e,t){return["mouse","pen"].includes(e)}function Ys(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Il=["top","right","bottom","left"],nn=Math.min,nt=Math.max,Yn=Math.round,Qt=Math.floor,yt=e=>({x:e,y:e}),Sl={left:"right",right:"left",bottom:"top",top:"bottom"};function Zo(e,t,n){return nt(e,nn(t,n))}function St(e,t){return typeof e=="function"?e(t):e}function ot(e){return e.split("-")[0]}function _t(e){return e.split("-")[1]}function br(e){return e==="x"?"y":"x"}function xr(e){return e==="y"?"height":"width"}function lt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function yr(e){return br(lt(e))}function Ol(e,t,n){n===void 0&&(n=!1);const o=_t(e),r=yr(e),s=xr(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Xn(i)),[i,Xn(i)]}function Pl(e){const t=Xn(e);return[er(e),t,er(t)]}function er(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const es=["left","right"],ts=["right","left"],Al=["top","bottom"],Tl=["bottom","top"];function Nl(e,t,n){switch(e){case"top":case"bottom":return n?t?ts:es:t?es:ts;case"left":case"right":return t?Al:Tl;default:return[]}}function kl(e,t,n,o){const r=_t(e);let s=Nl(ot(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(er)))),s}function Xn(e){const t=ot(e);return Sl[t]+e.slice(t.length)}function Ml(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xs(e){return typeof e!="number"?Ml(e):{top:e,right:e,bottom:e,left:e}}function Jn(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Ln(e,t,n){return Math.floor(e/t)!==n}function hn(e,t){return t<0||t>=e.current.length}function Lo(e,t){return $e(e,{disabledIndices:t})}function ns(e,t){return $e(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function $e(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:o,amount:r=1}={}){let s=t;do s+=n?-r:r;while(s>=0&&s<=e.current.length-1&&gn(e,s,o));return s}function Dl(e,{event:t,orientation:n,loopFocus:o,rtl:r,cols:s,disabledIndices:i,minIndex:c,maxIndex:u,prevIndex:l,stopEvent:d=!1}){let f=l;const g=[],p={};let x=!1;{let b=null,m=-1;e.current.forEach((w,v)=>{if(w==null)return;const E=w.closest('[role="row"]');E&&(x=!0),(E!==b||m===-1)&&(b=E,m+=1,g[m]=[]),g[m].push(v),p[v]=m})}const y=x&&g.length>0&&g.some(b=>b.length!==s);function h(b){if(!y||l===-1)return;const m=p[l];if(m==null)return;const w=g[m].indexOf(l);let v=b==="up"?m-1:m+1;o&&(v<0?v=g.length-1:v>=g.length&&(v=0));const E=new Set;for(;v>=0&&v<g.length&&!E.has(v);){E.add(v);const S=g[v];if(S.length===0){v=b==="up"?v-1:v+1;continue}const R=Math.min(w,S.length-1);for(let I=R;I>=0;I-=1){const G=S[I];if(!gn(e,G,i))return G}v=b==="up"?v-1:v+1,o&&(v<0?v=g.length-1:v>=g.length&&(v=0))}}if(t.key===hr){const b=h("up");if(b!==void 0)d&&Ee(t),f=b;else{if(d&&Ee(t),l===-1)f=u;else if(f=$e(e,{startingIndex:f,amount:s,decrement:!0,disabledIndices:i}),o&&(l-s<c||f<0)){const m=l%s,w=u%s,v=u-(w-m);w===m?f=u:f=w>m?v:v-s}hn(e,f)&&(f=l)}}if(t.key===Cn){const b=h("down");b!==void 0?(d&&Ee(t),f=b):(d&&Ee(t),l===-1?f=c:(f=$e(e,{startingIndex:l,amount:s,disabledIndices:i}),o&&l+s>u&&(f=$e(e,{startingIndex:l%s-s,amount:s,disabledIndices:i}))),hn(e,f)&&(f=l))}if(n==="both"){const b=Qt(l/s);t.key===(r?Dt:Vt)&&(d&&Ee(t),l%s!==s-1?(f=$e(e,{startingIndex:l,disabledIndices:i}),o&&Ln(f,s,b)&&(f=$e(e,{startingIndex:l-l%s-1,disabledIndices:i}))):o&&(f=$e(e,{startingIndex:l-l%s-1,disabledIndices:i})),Ln(f,s,b)&&(f=l)),t.key===(r?Vt:Dt)&&(d&&Ee(t),l%s!==0?(f=$e(e,{startingIndex:l,decrement:!0,disabledIndices:i}),o&&Ln(f,s,b)&&(f=$e(e,{startingIndex:l+(s-l%s),decrement:!0,disabledIndices:i}))):o&&(f=$e(e,{startingIndex:l+(s-l%s),decrement:!0,disabledIndices:i})),Ln(f,s,b)&&(f=l));const m=Qt(u/s)===b;hn(e,f)&&(o&&m?f=t.key===(r?Vt:Dt)?u:$e(e,{startingIndex:l-l%s-1,disabledIndices:i}):f=l)}return f}function Vl(e,t,n){const o=[];let r=0;return e.forEach(({width:s,height:i},c)=>{if(s>t&&process.env.NODE_ENV!=="production")throw new Error(`[Floating UI]: Invalid grid - item width at index ${c} is greater than grid columns`);let u=!1;for(;!u;){const l=[];for(let d=0;d<s;d+=1)for(let f=0;f<i;f+=1)l.push(r+d+f*t);r%t+s<=t&&l.every(d=>o[d]==null)?(l.forEach(d=>{o[d]=c}),u=!0):r+=1}}),[...o]}function Ll(e,t,n,o,r){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(r){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*o:s;case"br":return n.lastIndexOf(e);default:return-1}}function Fl(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function gn(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const o=e.current[t];return o?o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true":!1}var _l=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Qn=_l.join(","),Js=typeof Element>"u",on=Js?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Zn=!Js&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},eo=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),s=r===""||r==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):eo(t.parentNode));return i},Bl=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},Qs=function(t,n,o){if(eo(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(Qn));return n&&on.call(t,Qn)&&r.unshift(t),r=r.filter(o),r},to=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var i=s.shift();if(!eo(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),u=c.length?c:i.children,l=to(u,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{var d=on.call(i,Qn);d&&o.filter(i)&&(n||!t.includes(i))&&r.push(i);var f=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),g=!eo(f,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(f&&g){var p=to(f===!0?i.children:f.children,!0,o);o.flatten?r.push.apply(r,p):r.push({scopeParent:i,candidates:p})}else s.unshift.apply(s,i.children)}}return r},Zs=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ei=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Bl(t))&&!Zs(t)?0:t.tabIndex},jl=function(t,n){var o=ei(t);return o<0&&n&&!Zs(t)?0:o},$l=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ti=function(t){return t.tagName==="INPUT"},Hl=function(t){return ti(t)&&t.type==="hidden"},Ul=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Wl=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Gl=function(t){if(!t.name)return!0;var n=t.form||Zn(t),o=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Wl(r,t.form);return!s||s===t},ql=function(t){return ti(t)&&t.type==="radio"},Kl=function(t){return ql(t)&&!Gl(t)},zl=function(t){var n,o=t&&Zn(t),r=(n=o)===null||n===void 0?void 0:n.host,s=!1;if(o&&o!==t){var i,c,u;for(s=!!((i=r)!==null&&i!==void 0&&(c=i.ownerDocument)!==null&&c!==void 0&&c.contains(r)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!s&&r;){var l,d,f;o=Zn(r),r=(l=o)===null||l===void 0?void 0:l.host,s=!!((d=r)!==null&&d!==void 0&&(f=d.ownerDocument)!==null&&f!==void 0&&f.contains(r))}}return s},os=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},Yl=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=on.call(t,"details>summary:first-of-type"),c=i?t.parentElement:t;if(on.call(c,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var u=t;t;){var l=t.parentElement,d=Zn(t);if(l&&!l.shadowRoot&&r(l)===!0)return os(t);t.assignedSlot?t=t.assignedSlot:!l&&d!==t.ownerDocument?t=d.host:t=l}t=u}if(zl(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return os(t);return!1},Xl=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return on.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},tr=function(t,n){return!(n.disabled||Hl(n)||Yl(n,t)||Ul(n)||Xl(n))},nr=function(t,n){return!(Kl(n)||ei(n)<0||!tr(t,n))},Jl=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},ni=function(t){var n=[],o=[];return t.forEach(function(r,s){var i=!!r.scopeParent,c=i?r.scopeParent:r,u=jl(c,i),l=i?ni(r.candidates):c;u===0?i?n.push.apply(n,l):n.push(c):o.push({documentOrder:s,tabIndex:u,item:r,isScope:i,content:l})}),o.sort($l).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},fo=function(t,n){n=n||{};var o;return n.getShadowRoot?o=to([t],n.includeContainer,{filter:nr.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Jl}):o=Qs(t,n.includeContainer,nr.bind(null,n)),ni(o)},Ql=function(t,n){n=n||{};var o;return n.getShadowRoot?o=to([t],n.includeContainer,{filter:tr.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=Qs(t,n.includeContainer,tr.bind(null,n)),o},oi=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return on.call(t,Qn)===!1?!1:nr(n,t)};function Ne(e){return e?.ownerDocument||document}const wn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ri(e,t){const n=fo(e,wn()),o=n.length;if(o===0)return;const r=wt(Ne(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function si(e){return ri(Ne(e).body,1)||e}function ii(e){return ri(Ne(e).body,-1)||e}function bn(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!me(n,o)}function Zl(e){fo(e,wn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function rs(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}function vr(e){const{enabled:t=!0,open:n,ref:o,onComplete:r}=e,s=Y(r),i=al(o,n,!1);a.useEffect(()=>{if(!t)return;const c=new AbortController;return i(s,c.signal),()=>{c.abort()}},[t,n,s,i])}const fn=0;class rn{constructor(){Pe(this,"currentId",fn);Pe(this,"clear",()=>{this.currentId!==fn&&(clearTimeout(this.currentId),this.currentId=fn)});Pe(this,"disposeEffect",()=>this.clear)}static create(){return new rn}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=fn,n()},t)}isStarted(){return this.currentId!==fn}}function Gt(){const e=at(rn.create).current;return Vs(e.disposeEffect),e}let ss={},is={},cs="";function ea(e){if(typeof document>"u")return!1;const t=Ne(e);return _e(t).innerWidth-t.documentElement.clientWidth>0}function ta(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Ne(e),o=n.documentElement,r=n.body,s=Ft(o)?o:r,i=s.style.overflowY,c=o.style.scrollbarGutter;o.style.scrollbarGutter="stable",s.style.overflowY="scroll";const u=s.offsetWidth;s.style.overflowY="hidden";const l=s.offsetWidth;return s.style.overflowY=i,o.style.scrollbarGutter=c,u===l}function na(e){const t=Ne(e),n=t.documentElement,o=t.body,r=Ft(n)?n:o,s={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,s)}}function oa(e){const t=Ne(e),n=t.documentElement,o=t.body,r=_e(n);let s=0,i=0,c=!1;const u=xt.create();if(Us&&(r.visualViewport?.scale??1)!==1)return()=>{};function l(){const g=r.getComputedStyle(n),p=r.getComputedStyle(o),h=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,ss={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},cs=n.style.scrollBehavior,is={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,m=n.scrollWidth>n.clientWidth,w=g.overflowY==="scroll"||p.overflowY==="scroll",v=g.overflowX==="scroll"||p.overflowX==="scroll",E=Math.max(0,r.innerWidth-o.clientWidth),S=Math.max(0,r.innerHeight-o.clientHeight),R=parseFloat(p.marginTop)+parseFloat(p.marginBottom),I=parseFloat(p.marginLeft)+parseFloat(p.marginRight),G=Ft(n)?n:o;if(c=ta(e),c){n.style.scrollbarGutter=h,G.style.overflowY="hidden",G.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:h,overflowY:"hidden",overflowX:"hidden"}),(b||w)&&(n.style.overflowY="scroll"),(m||v)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:R||S?`calc(100dvh - ${R+S}px)`:"100dvh",width:I||E?`calc(100vw - ${I+E}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=s,o.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,ss),Object.assign(o.style,is),c||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=cs)}function f(){d(),u.request(l)}return l(),r.addEventListener("resize",f),()=>{u.cancel(),d(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",f)}}class ra{constructor(){Pe(this,"lockCount",0);Pe(this,"restore",null);Pe(this,"timeoutLock",rn.create());Pe(this,"timeoutUnlock",rn.create());Pe(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Pe(this,"unlock",()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const o=Ne(t).documentElement,r=_e(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=Re;return}const s=Ws||!ea(t);this.restore=s?na(t):oa(t)}}const sa=new ra;function ia(e=!0,t=null){Q(()=>{if(e)return sa.acquire(t)},[e,t])}function ct(e){const t=at(ca,e).current;return t.next=e,Q(t.effect),t}function ca(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function la(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}const ci=a.createContext(null);process.env.NODE_ENV!=="production"&&(ci.displayName="FloatingNodeContext");const li=a.createContext(null);process.env.NODE_ENV!=="production"&&(li.displayName="FloatingTreeContext");const ai=()=>a.useContext(ci)?.id||null,po=e=>{const t=a.useContext(li);return e??t};function no(e){return`data-base-ui-${e}`}const ui={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Er={...ui,position:"fixed",top:0,left:0},aa={...ui,position:"absolute"},En=a.forwardRef(function(t,n){const[o,r]=a.useState();Q(()=>{bl&&r("button")},[]);const s={tabIndex:0,role:o};return j.jsx("span",{...t,ref:n,style:Er,"aria-hidden":o?void 0:!0,...s,"data-base-ui-focus-guard":""})});process.env.NODE_ENV!=="production"&&(En.displayName="FocusGuard");let ls=0;function xn(e,t={}){const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(ls);const s=()=>e?.focus({preventScroll:n});r?s():ls=requestAnimationFrame(s)}const en={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function as(e){return e==="inert"?en.inert:e==="aria-hidden"?en["aria-hidden"]:en.none}let Fn=new WeakSet,_n={},Fo=0;const fi=e=>e&&(e.host||fi(e.parentNode)),ua=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=fi(n);return e.contains(o)?o:null}).filter(n=>n!=null);function fa(e,t,n,o){const r="data-base-ui-inert",s=o?"inert":n?"aria-hidden":null,i=ua(t,e),c=new Set,u=new Set(i),l=[];_n[r]||(_n[r]=new WeakMap);const d=_n[r];i.forEach(f),g(t),c.clear();function f(p){!p||c.has(p)||(c.add(p),p.parentNode&&f(p.parentNode))}function g(p){!p||u.has(p)||[].forEach.call(p.children,x=>{if(Lt(x)!=="script")if(c.has(x))g(x);else{const y=s?x.getAttribute(s):null,h=y!==null&&y!=="false",b=as(s),m=(b.get(x)||0)+1,w=(d.get(x)||0)+1;b.set(x,m),d.set(x,w),l.push(x),m===1&&h&&Fn.add(x),w===1&&x.setAttribute(r,""),!h&&s&&x.setAttribute(s,s==="inert"?"":"true")}})}return Fo+=1,()=>{l.forEach(p=>{const x=as(s),h=(x.get(p)||0)-1,b=(d.get(p)||0)-1;x.set(p,h),d.set(p,b),h||(!Fn.has(p)&&s&&p.removeAttribute(s),Fn.delete(p)),b||p.removeAttribute(r)}),Fo-=1,Fo||(en.inert=new WeakMap,en["aria-hidden"]=new WeakMap,en.none=new WeakMap,Fn=new WeakSet,_n={})}}function da(e,t=!1,n=!1){const o=Ne(e[0]).body;return fa(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const Cr=a.createContext(null);process.env.NODE_ENV!=="production"&&(Cr.displayName="PortalContext");const di=()=>a.useContext(Cr),pa=no("portal");function ma(e={}){const{ref:t,container:n,componentProps:o=We,elementProps:r}=e,s=ar(),c=di()?.portalNode,[u,l]=a.useState(null),[d,f]=a.useState(null),g=Y(h=>{h!==null&&f(h)}),p=a.useRef(null);Q(()=>{if(n===null){p.current&&(p.current=null,f(null),l(null));return}if(s==null)return;const h=(n&&(dr(n)?n:n.current))??c??document.body;if(h==null){p.current&&(p.current=null,f(null),l(null));return}p.current!==h&&(p.current=h,f(null),l(h))},[n,c,s]);const x=Ge("div",o,{ref:[t,g],props:[{id:s,[pa]:""},r]});return{portalNode:d,portalSubtree:u&&x?zt.createPortal(x,u):null}}const pi=a.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,renderGuards:c,...u}=t,{portalNode:l,portalSubtree:d}=ma({container:r,ref:n,componentProps:t,elementProps:u}),f=a.useRef(null),g=a.useRef(null),p=a.useRef(null),x=a.useRef(null),[y,h]=a.useState(null),b=y?.modal,m=y?.open,w=typeof c=="boolean"?c:!!y&&!y.modal&&y.open&&!!l;a.useEffect(()=>{if(!l||b)return;function E(S){l&&S.relatedTarget&&bn(S)&&(S.type==="focusin"?rs:Zl)(l)}return l.addEventListener("focusin",E,!0),l.addEventListener("focusout",E,!0),()=>{l.removeEventListener("focusin",E,!0),l.removeEventListener("focusout",E,!0)}},[l,b]),a.useEffect(()=>{!l||m||rs(l)},[m,l]);const v=a.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:g,beforeInsideRef:p,afterInsideRef:x,portalNode:l,setFocusManagerState:h}),[l]);return j.jsxs(a.Fragment,{children:[d,j.jsxs(Cr.Provider,{value:v,children:[w&&l&&j.jsx(En,{"data-type":"outside",ref:f,onFocus:E=>{if(bn(E,l))p.current?.focus();else{const S=y?y.domReference:null;ii(S)?.focus()}}}),w&&l&&j.jsx("span",{"aria-owns":l.id,style:Yc}),l&&zt.createPortal(o,l),w&&l&&j.jsx(En,{"data-type":"outside",ref:g,onFocus:E=>{if(bn(E,l))x.current?.focus();else{const S=y?y.domReference:null;si(S)?.focus(),y?.closeOnFocusOut&&y?.onOpenChange(!1,ce(so,E.nativeEvent))}}})]})]})});process.env.NODE_ENV!=="production"&&(pi.displayName="FloatingPortal");function ha(e,t){const n=_e(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const us=20;let kt=[];function wr(){kt=kt.filter(e=>e.deref()?.isConnected)}function ga(e){wr(),e&&Lt(e)!=="body"&&(kt.push(new WeakRef(e)),kt.length>us&&(kt=kt.slice(-us)))}function _o(){return wr(),kt[kt.length-1]?.deref()}function ba(e){if(!e)return null;const t=wn();return oi(e,t)?e:fo(e,t)[0]||e}function xa(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():rt(e).display!=="none"}function fs(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=wn(),r=Ql(e,n).filter(i=>{const c=i.getAttribute("data-tabindex")||"";return oi(i,n)||i.hasAttribute("data-tabindex")&&!c.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function ya(e){const{context:t,children:n,disabled:o=!1,initialFocus:r=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:l="",nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:g,externalTree:p}=e,x="rootStore"in t?t.rootStore:t,y=x.useState("open"),h=x.useState("domReferenceElement"),b=x.useState("floatingElement"),{events:m,dataRef:w}=x.context,v=Y(()=>w.current.floatingContext?.nodeId),E=r===!1,S=Jo(h)&&E,R=a.useRef(["content"]),I=ct(r),G=ct(s),K=ct(l),q=po(p),D=di(),X=a.useRef(null),Z=a.useRef(null),B=a.useRef(!1),M=a.useRef(!1),U=a.useRef(!1),F=a.useRef(-1),J=a.useRef(""),ne=a.useRef(""),ye=a.useRef(null),ue=a.useRef(null),he=yn(ye,g,D?.beforeInsideRef),se=yn(ue,D?.afterInsideRef),pe=Gt(),Me=Gt(),Ie=fr(),we=D!=null,re=Qo(b),fe=Y((k=re)=>k?fo(k,wn()):[]),xe=Y(k=>{const V=fe(k);return R.current.map(()=>V).filter(Boolean).flat()});a.useEffect(()=>{if(o||!c)return;function k(ie){ie.key==="Tab"&&me(re,wt(Ne(re)))&&fe().length===0&&!S&&Ee(ie)}const V=Ne(re);return V.addEventListener("keydown",k),()=>{V.removeEventListener("keydown",k)}},[o,h,re,c,R,S,fe,xe]),a.useEffect(()=>{if(o||!y)return;const k=Ne(re);function V(){U.current=!1}function ie(L){const _=Qe(L),P=me(b,_)||me(h,_)||me(D?.portalNode,_);U.current=!P,ne.current=L.pointerType||"keyboard",_?.closest(`[${Kc}]`)&&(M.current=!0)}function C(){ne.current="keyboard"}return k.addEventListener("pointerdown",ie,!0),k.addEventListener("pointerup",V,!0),k.addEventListener("pointercancel",V,!0),k.addEventListener("keydown",C,!0),()=>{k.removeEventListener("pointerdown",ie,!0),k.removeEventListener("pointerup",V,!0),k.removeEventListener("pointercancel",V,!0),k.removeEventListener("keydown",C,!0)}},[o,b,h,re,y,D]),a.useEffect(()=>{if(o||!u)return;const k=Ne(re);function V(){M.current=!0,Me.start(0,()=>{M.current=!1})}function ie($){const T=Qe($),te=fe().indexOf(T);te!==-1&&(F.current=te)}function C($){const T=$.relatedTarget,W=$.currentTarget,te=Qe($);queueMicrotask(()=>{const ae=v(),De=x.context.triggerElements,qe=T?.hasAttribute(no("focus-guard"))&&[ye.current,ue.current,D?.beforeInsideRef.current,D?.afterInsideRef.current,D?.beforeOutsideRef.current,D?.afterOutsideRef.current,Ct(f),Ct(d)].includes(T),Se=!(me(h,T)||me(b,T)||me(T,b)||me(D?.portalNode,T)||T!=null&&De.hasElement(T)||De.hasMatchingElement(ge=>me(ge,T))||qe||q&&(Zt(q.nodesRef.current,ae).find(ge=>me(ge.context?.elements.floating,T)||me(ge.context?.elements.domReference,T))||Qr(q.nodesRef.current,ae).find(ge=>[ge.context?.elements.floating,Qo(ge.context?.elements.floating)].includes(T)||ge.context?.elements.domReference===T)));if(W===h&&re&&fs(re,R),i&&W!==h&&!xa(te)&&wt(k)===k.body){if(ke(re)&&(re.focus(),i==="popup")){Ie.request(()=>{re.focus()});return}const ge=F.current,Ae=fe(),Ke=Ae[ge]||Ae[Ae.length-1]||re;ke(Ke)&&Ke.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(S||!c)&&T&&Se&&!M.current&&(S||T!==_o())&&(B.current=!0,x.setOpen(!1,ce(so,$)))})}function L(){U.current||(w.current.insideReactTree=!0,pe.start(0,()=>{w.current.insideReactTree=!1}))}const _=ke(h)?h:null,P=[];if(!(!b&&!_))return _&&(_.addEventListener("focusout",C),_.addEventListener("pointerdown",V),P.push(()=>{_.removeEventListener("focusout",C),_.removeEventListener("pointerdown",V)})),b&&(b.addEventListener("focusin",ie),b.addEventListener("focusout",C),D&&(b.addEventListener("focusout",L,!0),P.push(()=>{b.removeEventListener("focusout",L,!0)})),P.push(()=>{b.removeEventListener("focusin",ie),b.removeEventListener("focusout",C)})),()=>{P.forEach($=>{$()})}},[o,h,b,re,c,q,D,x,u,i,fe,S,v,R,w,pe,Me,Ie,d,f]),a.useEffect(()=>{if(o||!b||!y)return;const k=Array.from(D?.portalNode?.querySelectorAll(`[${no("portal")}]`)||[]),ie=(q?Qr(q.nodesRef.current,v()):[]).find(L=>Jo(L.context?.elements.domReference||null))?.context?.elements.domReference,C=[b,ie,...k,X.current,Z.current,ye.current,ue.current,D?.beforeOutsideRef.current,D?.afterOutsideRef.current,Ct(f),Ct(d),S?h:null].filter(L=>L!=null);return da(C,c||S)},[y,o,h,b,c,R,D,S,q,v,d,f]),Q(()=>{if(!y||o||!ke(re))return;const k=Ne(re),V=wt(k);queueMicrotask(()=>{const ie=xe(re),C=I.current,L=typeof C=="function"?C(K.current||""):C;if(L===void 0||L===!1)return;let _;L===!0||L===null?_=ie[0]||re:_=Ct(L),_=_||ie[0]||re,!me(re,V)&&xn(_,{preventScroll:_===re})})},[o,y,re,E,xe,I,K]),Q(()=>{if(o||!re)return;const k=Ne(re),V=wt(k);ga(V);function ie(_){if(_.open||(J.current=ha(_.nativeEvent,ne.current)),_.reason===el&&_.nativeEvent.type==="mouseleave"&&(B.current=!0),_.reason===lr)if(_.nested)B.current=!1;else if(Ks(_.nativeEvent)||zs(_.nativeEvent))B.current=!1;else{let P=!1;document.createElement("div").focus({get preventScroll(){return P=!0,!1}}),P?B.current=!1:B.current=!0}}m.on("openchange",ie);const C=k.createElement("span");C.setAttribute("tabindex","-1"),C.setAttribute("aria-hidden","true"),Object.assign(C.style,Er),we&&h&&h.insertAdjacentElement("afterend",C);function L(){const _=G.current;let P=typeof _=="function"?_(J.current):_;if(P===void 0||P===!1)return null;if(P===null&&(P=!0),typeof P=="boolean"){const T=h||_o();return T&&T.isConnected?T:C}const $=h||_o()||C;return Ct(P)||$}return()=>{m.off("openchange",ie);const _=wt(k),P=me(b,_)||q&&Zt(q.nodesRef.current,v(),!1).some(T=>me(T.context?.elements.floating,_)),$=L();queueMicrotask(()=>{const T=ba($),W=typeof G.current!="boolean";G.current&&!B.current&&ke(T)&&(!(!W&&T!==_&&_!==k.body)||P)&&T.focus({preventScroll:!0}),C.remove(),B.current=!1})}},[o,b,re,G,w,m,q,we,h,v]),Q(()=>{if(!Us||y||!b)return;const k=wt(Ne(b));!ke(k)||!gr(k)||me(b,k)&&k.blur()},[y,b]),Q(()=>{if(!(o||!D))return D.setFocusManagerState({modal:c,closeOnFocusOut:u,open:y,onOpenChange:x.setOpen,domReference:h}),()=>{D.setFocusManagerState(null)}},[o,D,c,y,x,u,h]),Q(()=>{if(!(o||!re))return fs(re,R),()=>{queueMicrotask(wr)}},[o,re,R]);const O=!o&&(c?!S:!0)&&(we||c);return j.jsxs(a.Fragment,{children:[O&&j.jsx(En,{"data-type":"inside",ref:he,onFocus:k=>{if(c){const V=xe();xn(V[V.length-1])}else D?.portalNode&&(B.current=!1,bn(k,D.portalNode)?si(h)?.focus():Ct(f??D.beforeOutsideRef)?.focus())}}),n,O&&j.jsx(En,{"data-type":"inside",ref:se,onFocus:k=>{c?xn(xe()[0]):D?.portalNode&&(u&&(B.current=!0),bn(k,D.portalNode)?ii(h)?.focus():Ct(d??D.afterOutsideRef)?.focus())}})]})}function mi(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:r=!0,event:s="click",toggle:i=!0,ignoreMouse:c=!1,stickIfOpen:u=!0,touchOpenDelay:l=0,reason:d=Go}=t,f=a.useRef(void 0),g=fr(),p=Gt(),x=a.useMemo(()=>({onPointerDown(y){f.current=y.pointerType},onMouseDown(y){const h=f.current,b=y.nativeEvent,m=n.select("open");if(y.button!==0||s==="click"||Zr(h)&&c)return;const w=o.current.openEvent,v=w?.type,E=n.select("domReferenceElement")!==y.currentTarget,S=m&&E||!(m&&i&&(!(w&&u)||v==="click"||v==="mousedown"));if(gr(b.target)){const I=ce(d,b,b.target);S&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,I)}):n.setOpen(S,I);return}const R=y.currentTarget;g.request(()=>{const I=ce(d,b,R);S&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,I)}):n.setOpen(S,I)})},onClick(y){if(s==="mousedown-only")return;const h=f.current;if(s==="mousedown"&&h){f.current=void 0;return}if(Zr(h)&&c)return;const b=n.select("open"),m=o.current.openEvent,w=n.select("domReferenceElement")!==y.currentTarget,v=b&&w||!(b&&i&&(!(m&&u)||Ys(m))),E=ce(d,y.nativeEvent,y.currentTarget);v&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,E)}):n.setOpen(v,E)},onKeyDown(){f.current=void 0}}),[o,s,c,n,u,i,g,p,l,d]);return a.useMemo(()=>r?{reference:x}:We,[r,x])}function ds(e,t,n){let{reference:o,floating:r}=e;const s=lt(t),i=yr(t),c=xr(i),u=ot(t),l=s==="y",d=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,g=o[c]/2-r[c]/2;let p;switch(u){case"top":p={x:d,y:o.y-r.height};break;case"bottom":p={x:d,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-r.width,y:f};break;default:p={x:o.x,y:o.y}}switch(_t(t)){case"start":p[i]-=g*(n&&l?-1:1);break;case"end":p[i]+=g*(n&&l?-1:1);break}return p}async function va(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=St(t,e),x=Xs(p),h=c[g?f==="floating"?"reference":"floating":f],b=Jn(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(h)))==null||n?h:h.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:d,strategy:u})),m=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),v=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},E=Jn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:m,offsetParent:w,strategy:u}):m);return{top:(b.top-E.top+x.top)/v.y,bottom:(E.bottom-b.bottom+x.bottom)/v.y,left:(b.left-E.left+x.left)/v.x,right:(E.right-b.right+x.right)/v.x}}const Ea=50,Ca=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:va},u=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=ds(l,o,u),g=o,p=0;const x={};for(let y=0;y<s.length;y++){const h=s[y];if(!h)continue;const{name:b,fn:m}=h,{x:w,y:v,data:E,reset:S}=await m({x:d,y:f,initialPlacement:o,placement:g,strategy:r,middlewareData:x,rects:l,platform:c,elements:{reference:e,floating:t}});d=w??d,f=v??f,x[b]={...x[b],...E},S&&p<Ea&&(p++,typeof S=="object"&&(S.placement&&(g=S.placement),S.rects&&(l=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):S.rects),{x:d,y:f}=ds(l,g,u)),y=-1)}return{x:d,y:f,placement:g,strategy:r,middlewareData:x}},wa=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:u,elements:l}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...h}=St(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=ot(r),m=lt(c),w=ot(c)===c,v=await(u.isRTL==null?void 0:u.isRTL(l.floating)),E=g||(w||!y?[Xn(c)]:Pl(c)),S=x!=="none";!g&&S&&E.push(...kl(c,y,x,v));const R=[c,...E],I=await u.detectOverflow(t,h),G=[];let K=((o=s.flip)==null?void 0:o.overflows)||[];if(d&&G.push(I[b]),f){const Z=Ol(r,i,v);G.push(I[Z[0]],I[Z[1]])}if(K=[...K,{placement:r,overflows:G}],!G.every(Z=>Z<=0)){var q,D;const Z=(((q=s.flip)==null?void 0:q.index)||0)+1,B=R[Z];if(B&&(!(f==="alignment"?m!==lt(B):!1)||K.every(F=>lt(F.placement)===m?F.overflows[0]>0:!0)))return{data:{index:Z,overflows:K},reset:{placement:B}};let M=(D=K.filter(U=>U.overflows[0]<=0).sort((U,F)=>U.overflows[1]-F.overflows[1])[0])==null?void 0:D.placement;if(!M)switch(p){case"bestFit":{var X;const U=(X=K.filter(F=>{if(S){const J=lt(F.placement);return J===m||J==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(J=>J>0).reduce((J,ne)=>J+ne,0)]).sort((F,J)=>F[1]-J[1])[0])==null?void 0:X[0];U&&(M=U);break}case"initialPlacement":M=c;break}if(r!==M)return{reset:{placement:M}}}return{}}}};function ps(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ms(e){return Il.some(t=>e[t]>=0)}const Ra=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=St(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),c=ps(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:ms(c)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),c=ps(i,n.floating);return{data:{escapedOffsets:c,escaped:ms(c)}}}default:return{}}}}},hi=new Set(["left","top"]);async function Ia(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=ot(n),c=_t(n),u=lt(n)==="y",l=hi.has(i)?-1:1,d=s&&u?-1:1,f=St(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof x=="number"&&(p=c==="end"?x*-1:x),u?{x:p*d,y:g*l}:{x:g*l,y:p*d}}const Sa=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=t,u=await Ia(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+u.x,y:s+u.y,data:{...u,placement:i}}}}},Oa=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:u={fn:b=>{let{x:m,y:w}=b;return{x:m,y:w}}},...l}=St(e,t),d={x:n,y:o},f=await s.detectOverflow(t,l),g=lt(ot(r)),p=br(g);let x=d[p],y=d[g];if(i){const b=p==="y"?"top":"left",m=p==="y"?"bottom":"right",w=x+f[b],v=x-f[m];x=Zo(w,x,v)}if(c){const b=g==="y"?"top":"left",m=g==="y"?"bottom":"right",w=y+f[b],v=y-f[m];y=Zo(w,y,v)}const h=u.fn({...t,[p]:x,[g]:y});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[p]:i,[g]:c}}}}}},Pa=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:u=!0,crossAxis:l=!0}=St(e,t),d={x:n,y:o},f=lt(r),g=br(f);let p=d[g],x=d[f];const y=St(c,t),h=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(u){const w=g==="y"?"height":"width",v=s.reference[g]-s.floating[w]+h.mainAxis,E=s.reference[g]+s.reference[w]-h.mainAxis;p<v?p=v:p>E&&(p=E)}if(l){var b,m;const w=g==="y"?"width":"height",v=hi.has(ot(r)),E=s.reference[f]-s.floating[w]+(v&&((b=i.offset)==null?void 0:b[f])||0)+(v?0:h.crossAxis),S=s.reference[f]+s.reference[w]+(v?0:((m=i.offset)==null?void 0:m[f])||0)-(v?h.crossAxis:0);x<E?x=E:x>S&&(x=S)}return{[g]:p,[f]:x}}}},Aa=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:c}=t,{apply:u=()=>{},...l}=St(e,t),d=await i.detectOverflow(t,l),f=ot(r),g=_t(r),p=lt(r)==="y",{width:x,height:y}=s.floating;let h,b;f==="top"||f==="bottom"?(h=f,b=g===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(b=f,h=g==="end"?"top":"bottom");const m=y-d.top-d.bottom,w=x-d.left-d.right,v=nn(y-d[h],m),E=nn(x-d[b],w),S=!t.middlewareData.shift;let R=v,I=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=w),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(R=m),S&&!g){const K=nt(d.left,0),q=nt(d.right,0),D=nt(d.top,0),X=nt(d.bottom,0);p?I=x-2*(K!==0||q!==0?K+q:nt(d.left,d.right)):R=y-2*(D!==0||X!==0?D+X:nt(d.top,d.bottom))}await u({...t,availableWidth:I,availableHeight:R});const G=await i.getDimensions(c.floating);return x!==G.width||y!==G.height?{reset:{rects:!0}}:{}}}};function gi(e){const t=rt(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ke(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,c=Yn(n)!==s||Yn(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function Rr(e){return Ce(e)?e:e.contextElement}function tn(e){const t=Rr(e);if(!ke(t))return yt(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=gi(t);let i=(s?Yn(n.width):n.width)/o,c=(s?Yn(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Ta=yt(0);function bi(e){const t=_e(e);return!lo()||!t.visualViewport?Ta:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Na(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_e(e)?!1:t}function qt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Rr(e);let i=yt(1);t&&(o?Ce(o)&&(i=tn(o)):i=tn(e));const c=Na(s,n,o)?bi(s):yt(0);let u=(r.left+c.x)/i.x,l=(r.top+c.y)/i.y,d=r.width/i.x,f=r.height/i.y;if(s){const g=_e(s),p=o&&Ce(o)?_e(o):o;let x=g,y=zo(x);for(;y&&o&&p!==x;){const h=tn(y),b=y.getBoundingClientRect(),m=rt(y),w=b.left+(y.clientLeft+parseFloat(m.paddingLeft))*h.x,v=b.top+(y.clientTop+parseFloat(m.paddingTop))*h.y;u*=h.x,l*=h.y,d*=h.x,f*=h.y,u+=w,l+=v,x=_e(y),y=zo(x)}}return Jn({width:d,height:f,x:u,y:l})}function mo(e,t){const n=ao(e).scrollLeft;return t?t.left+n:qt(vt(e)).left+n}function xi(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-mo(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function ka(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=vt(o),c=t?co(t.floating):!1;if(o===i||c&&s)return n;let u={scrollLeft:0,scrollTop:0},l=yt(1);const d=yt(0),f=ke(o);if((f||!f&&!s)&&((Lt(o)!=="body"||Ft(i))&&(u=ao(o)),f)){const p=qt(o);l=tn(o),d.x=p.x+o.clientLeft,d.y=p.y+o.clientTop}const g=i&&!f&&!s?xi(i,u):yt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+d.x+g.x,y:n.y*l.y-u.scrollTop*l.y+d.y+g.y}}function Ma(e){return Array.from(e.getClientRects())}function Da(e){const t=vt(e),n=ao(e),o=e.ownerDocument.body,r=nt(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=nt(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+mo(e);const c=-n.scrollTop;return rt(o).direction==="rtl"&&(i+=nt(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:c}}const hs=25;function Va(e,t){const n=_e(e),o=vt(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,c=0,u=0;if(r){s=r.width,i=r.height;const d=lo();(!d||d&&t==="fixed")&&(c=r.offsetLeft,u=r.offsetTop)}const l=mo(o);if(l<=0){const d=o.ownerDocument,f=d.body,g=getComputedStyle(f),p=d.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,x=Math.abs(o.clientWidth-f.clientWidth-p);x<=hs&&(s-=x)}else l<=hs&&(s+=l);return{width:s,height:i,x:c,y:u}}function La(e,t){const n=qt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=ke(e)?tn(e):yt(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,u=r*s.x,l=o*s.y;return{width:i,height:c,x:u,y:l}}function gs(e,t,n){let o;if(t==="viewport")o=Va(e,n);else if(t==="document")o=Da(vt(e));else if(Ce(t))o=La(t,n);else{const r=bi(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Jn(o)}function yi(e,t){const n=It(e);return n===t||!Ce(n)||Rt(n)?!1:rt(n).position==="fixed"||yi(n,t)}function Fa(e,t){const n=t.get(e);if(n)return n;let o=Mt(e,[],!1).filter(c=>Ce(c)&&Lt(c)!=="body"),r=null;const s=rt(e).position==="fixed";let i=s?It(e):e;for(;Ce(i)&&!Rt(i);){const c=rt(i),u=pr(i);!u&&c.position==="fixed"&&(r=null),(s?!u&&!r:!u&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Ft(i)&&!u&&yi(e,i))?o=o.filter(d=>d!==i):r=c,i=It(i)}return t.set(e,o),o}function _a(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?co(t)?[]:Fa(t,this._c):[].concat(n),o],c=gs(t,i[0],r);let u=c.top,l=c.right,d=c.bottom,f=c.left;for(let g=1;g<i.length;g++){const p=gs(t,i[g],r);u=nt(p.top,u),l=nn(p.right,l),d=nn(p.bottom,d),f=nt(p.left,f)}return{width:l-f,height:d-u,x:f,y:u}}function Ba(e){const{width:t,height:n}=gi(e);return{width:t,height:n}}function ja(e,t,n){const o=ke(t),r=vt(t),s=n==="fixed",i=qt(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const u=yt(0);function l(){u.x=mo(r)}if(o||!o&&!s)if((Lt(t)!=="body"||Ft(r))&&(c=ao(t)),o){const p=qt(t,!0,s,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else r&&l();s&&!o&&r&&l();const d=r&&!o&&!s?xi(r,c):yt(0),f=i.left+c.scrollLeft-u.x-d.x,g=i.top+c.scrollTop-u.y-d.y;return{x:f,y:g,width:i.width,height:i.height}}function Bo(e){return rt(e).position==="static"}function bs(e,t){if(!ke(e)||rt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return vt(e)===n&&(n=n.ownerDocument.body),n}function vi(e,t){const n=_e(e);if(co(e))return n;if(!ke(e)){let r=It(e);for(;r&&!Rt(r);){if(Ce(r)&&!Bo(r))return r;r=It(r)}return n}let o=bs(e,t);for(;o&&ul(o)&&Bo(o);)o=bs(o,t);return o&&Rt(o)&&Bo(o)&&!pr(o)?n:o||pl(e)||n}const $a=async function(e){const t=this.getOffsetParent||vi,n=this.getDimensions,o=await n(e.floating);return{reference:ja(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ha(e){return rt(e).direction==="rtl"}const Ua={convertOffsetParentRelativeRectToViewportRelativeRect:ka,getDocumentElement:vt,getClippingRect:_a,getOffsetParent:vi,getElementRects:$a,getClientRects:Ma,getDimensions:Ba,getScale:tn,isElement:Ce,isRTL:Ha};function Ei(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Wa(e,t){let n=null,o;const r=vt(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function i(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),s();const l=e.getBoundingClientRect(),{left:d,top:f,width:g,height:p}=l;if(c||t(),!g||!p)return;const x=Qt(f),y=Qt(r.clientWidth-(d+g)),h=Qt(r.clientHeight-(f+p)),b=Qt(d),w={rootMargin:-x+"px "+-y+"px "+-h+"px "+-b+"px",threshold:nt(0,nn(1,u))||1};let v=!0;function E(S){const R=S[0].intersectionRatio;if(R!==u){if(!v)return i();R?i(!1,R):o=setTimeout(()=>{i(!1,1e-7)},1e3)}R===1&&!Ei(l,e.getBoundingClientRect())&&i(),v=!1}try{n=new IntersectionObserver(E,{...w,root:r.ownerDocument})}catch{n=new IntersectionObserver(E,w)}n.observe(e)}return i(!0),s}function xs(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,l=Rr(e),d=r||s?[...l?Mt(l):[],...t?Mt(t):[]]:[];d.forEach(b=>{r&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const f=l&&c?Wa(l,n):null;let g=-1,p=null;i&&(p=new ResizeObserver(b=>{let[m]=b;m&&m.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),l&&!u&&p.observe(l),t&&p.observe(t));let x,y=u?qt(e):null;u&&h();function h(){const b=qt(e);y&&!Ei(y,b)&&n(),y=b,x=requestAnimationFrame(h)}return n(),()=>{var b;d.forEach(m=>{r&&m.removeEventListener("scroll",n),s&&m.removeEventListener("resize",n)}),f?.(),(b=p)==null||b.disconnect(),p=null,u&&cancelAnimationFrame(x)}}const Ga=Sa,qa=Oa,Ka=wa,za=Aa,Ya=Ra,Xa=Pa,Ja=(e,t,n)=>{const o=new Map,r={platform:Ua,...n},s={...r.platform,_c:o};return Ca(e,t,{...r,platform:s})};var Qa=typeof document<"u",Za=function(){},Gn=Qa?qn.useLayoutEffect:Za;function oo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!oo(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!oo(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ci(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ys(e,t){const n=Ci(e);return Math.round(t*n)/n}function jo(e){const t=a.useRef(e);return Gn(()=>{t.current=e}),t}function eu(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:u,open:l}=e,[d,f]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=a.useState(o);oo(g,o)||p(o);const[x,y]=a.useState(null),[h,b]=a.useState(null),m=a.useCallback(F=>{F!==S.current&&(S.current=F,y(F))},[]),w=a.useCallback(F=>{F!==R.current&&(R.current=F,b(F))},[]),v=s||x,E=i||h,S=a.useRef(null),R=a.useRef(null),I=a.useRef(d),G=u!=null,K=jo(u),q=jo(r),D=jo(l),X=a.useCallback(()=>{if(!S.current||!R.current)return;const F={placement:t,strategy:n,middleware:g};q.current&&(F.platform=q.current),Ja(S.current,R.current,F).then(J=>{const ne={...J,isPositioned:D.current!==!1};Z.current&&!oo(I.current,ne)&&(I.current=ne,zt.flushSync(()=>{f(ne)}))})},[g,t,n,q,D]);Gn(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(F=>({...F,isPositioned:!1})))},[l]);const Z=a.useRef(!1);Gn(()=>(Z.current=!0,()=>{Z.current=!1}),[]),Gn(()=>{if(v&&(S.current=v),E&&(R.current=E),v&&E){if(K.current)return K.current(v,E,X);X()}},[v,E,X,K,G]);const B=a.useMemo(()=>({reference:S,floating:R,setReference:m,setFloating:w}),[m,w]),M=a.useMemo(()=>({reference:v,floating:E}),[v,E]),U=a.useMemo(()=>{const F={position:n,left:0,top:0};if(!M.floating)return F;const J=ys(M.floating,d.x),ne=ys(M.floating,d.y);return c?{...F,transform:"translate("+J+"px, "+ne+"px)",...Ci(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:ne}},[n,c,M.floating,d.x,d.y]);return a.useMemo(()=>({...d,update:X,refs:B,elements:M,floatingStyles:U}),[d,X,B,M,U])}const tu=(e,t)=>{const n=Ga(e);return{name:n.name,fn:n.fn,options:[e,t]}},nu=(e,t)=>{const n=qa(e);return{name:n.name,fn:n.fn,options:[e,t]}},ou=(e,t)=>({fn:Xa(e).fn,options:[e,t]}),ru=(e,t)=>{const n=Ka(e);return{name:n.name,fn:n.fn,options:[e,t]}},su=(e,t)=>{const n=za(e);return{name:n.name,fn:n.fn,options:[e,t]}},iu=(e,t)=>{const n=Ya(e);return{name:n.name,fn:n.fn,options:[e,t]}},cu={intentional:"onClick",sloppy:"onPointerDown"};function lu(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function au(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:c,dataRef:u}=n.context,{enabled:l=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:g="sloppy",referencePress:p=!1,referencePressEvent:x="sloppy",ancestorScroll:y=!1,bubbles:h,externalTree:b}=t,m=po(b),w=Y(typeof f=="function"?f:()=>!1),v=typeof f=="function"?w:f,E=a.useRef(!1),{escapeKey:S,outsidePress:R}=lu(h),I=a.useRef(null),G=Gt(),K=Gt(),q=Y(()=>{K.clear(),u.current.insideReactTree=!1}),D=a.useRef(!1),X=a.useRef(""),Z=Y(O=>{X.current=O.pointerType}),B=Y(()=>{const O=X.current,k=O==="pen"||!O?"mouse":O,V=typeof g=="function"?g():g;return typeof V=="string"?V:V[k]}),M=Y(O=>{if(!o||!l||!d||O.key!=="Escape"||D.current)return;const k=u.current.floatingContext?.nodeId,V=m?Zt(m.nodesRef.current,k):[];if(!S&&V.length>0){let L=!0;if(V.forEach(_=>{_.context?.open&&!_.context.dataRef.current.__escapeKeyBubbles&&(L=!1)}),!L)return}const ie=Rl(O)?O.nativeEvent:O,C=ce(Ds,ie);n.setOpen(!1,C),!S&&!C.isPropagationAllowed&&O.stopPropagation()}),U=Y(O=>{const k=B();return k==="intentional"&&O.type!=="click"||k==="sloppy"&&O.type==="click"}),F=Y(()=>{u.current.insideReactTree=!0,K.start(0,q)}),J=Y((O,k=!1)=>{if(U(O)){q();return}if(u.current.insideReactTree){q();return}if(B()==="intentional"&&k||typeof v=="function"&&!v(O))return;const V=Qe(O),ie=`[${no("inert")}]`,C=Ne(n.select("floatingElement")).querySelectorAll(ie),L=n.context.triggerElements;if(V&&(L.hasElement(V)||L.hasMatchingElement(W=>me(W,V))))return;let _=Ce(V)?V:null;for(;_&&!Rt(_);){const W=It(_);if(Rt(W)||!Ce(W))break;_=W}if(C.length&&Ce(V)&&!wl(V)&&!me(V,n.select("floatingElement"))&&Array.from(C).every(W=>!me(_,W)))return;if(ke(V)&&!("touches"in O)){const W=Rt(V),te=rt(V),ae=/auto|scroll/,De=W||ae.test(te.overflowX),qe=W||ae.test(te.overflowY),Se=De&&V.clientWidth>0&&V.scrollWidth>V.clientWidth,ge=qe&&V.clientHeight>0&&V.scrollHeight>V.clientHeight,Ae=te.direction==="rtl",Ke=ge&&(Ae?O.offsetX<=V.offsetWidth-V.clientWidth:O.offsetX>V.clientWidth),Ue=Se&&O.offsetY>V.clientHeight;if(Ke||Ue)return}const P=u.current.floatingContext?.nodeId,$=m&&Zt(m.nodesRef.current,P).some(W=>ht(O,W.context?.elements.floating));if(ht(O,n.select("floatingElement"))||ht(O,n.select("domReferenceElement"))||$)return;const T=m?Zt(m.nodesRef.current,P):[];if(T.length>0){let W=!0;if(T.forEach(te=>{te.context?.open&&!te.context.dataRef.current.__outsidePressBubbles&&(W=!1)}),!W)return}n.setOpen(!1,ce(lr,O)),q()}),ne=Y(O=>{B()!=="sloppy"||O.pointerType==="touch"||!n.select("open")||!l||ht(O,n.select("floatingElement"))||ht(O,n.select("domReferenceElement"))||J(O)}),ye=Y(O=>{if(B()!=="sloppy"||!n.select("open")||!l||ht(O,n.select("floatingElement"))||ht(O,n.select("domReferenceElement")))return;const k=O.touches[0];k&&(I.current={startTime:Date.now(),startX:k.clientX,startY:k.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},G.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}),ue=Y(O=>{const k=Qe(O);function V(){ye(O),k?.removeEventListener(O.type,V)}k?.addEventListener(O.type,V)}),he=Y(O=>{const k=E.current;if(E.current=!1,G.clear(),O.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const V=Qe(O);function ie(){O.type==="pointerdown"?ne(O):J(O,k),V?.removeEventListener(O.type,ie)}V?.addEventListener(O.type,ie)}),se=Y(O=>{if(B()!=="sloppy"||!I.current||ht(O,n.select("floatingElement"))||ht(O,n.select("domReferenceElement")))return;const k=O.touches[0];if(!k)return;const V=Math.abs(k.clientX-I.current.startX),ie=Math.abs(k.clientY-I.current.startY),C=Math.sqrt(V*V+ie*ie);C>5&&(I.current.dismissOnTouchEnd=!0),C>10&&(J(O),G.clear(),I.current=null)}),pe=Y(O=>{const k=Qe(O);function V(){se(O),k?.removeEventListener(O.type,V)}k?.addEventListener(O.type,V)}),Me=Y(O=>{B()!=="sloppy"||!I.current||ht(O,n.select("floatingElement"))||ht(O,n.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&J(O),G.clear(),I.current=null)}),Ie=Y(O=>{const k=Qe(O);function V(){Me(O),k?.removeEventListener(O.type,V)}k?.addEventListener(O.type,V)});a.useEffect(()=>{if(!o||!l)return;u.current.__escapeKeyBubbles=S,u.current.__outsidePressBubbles=R;const O=new rn;function k(_){n.setOpen(!1,ce(it,_))}function V(){O.clear(),D.current=!0}function ie(){O.start(lo()?5:0,()=>{D.current=!1})}const C=Ne(r);C.addEventListener("pointerdown",Z,!0),d&&(C.addEventListener("keydown",M),C.addEventListener("compositionstart",V),C.addEventListener("compositionend",ie)),v&&(C.addEventListener("click",he,!0),C.addEventListener("pointerdown",he,!0),C.addEventListener("touchstart",ue,!0),C.addEventListener("touchmove",pe,!0),C.addEventListener("touchend",Ie,!0),C.addEventListener("mousedown",he,!0));let L=[];return y&&(Ce(i)&&(L=Mt(i)),Ce(r)&&(L=L.concat(Mt(r))),!Ce(s)&&s&&s.contextElement&&(L=L.concat(Mt(s.contextElement)))),L=L.filter(_=>_!==C.defaultView?.visualViewport),L.forEach(_=>{_.addEventListener("scroll",k,{passive:!0})}),()=>{C.removeEventListener("pointerdown",Z,!0),d&&(C.removeEventListener("keydown",M),C.removeEventListener("compositionstart",V),C.removeEventListener("compositionend",ie)),v&&(C.removeEventListener("click",he,!0),C.removeEventListener("pointerdown",he,!0),C.removeEventListener("touchstart",ue,!0),C.removeEventListener("touchmove",pe,!0),C.removeEventListener("touchend",Ie,!0),C.removeEventListener("mousedown",he,!0)),L.forEach(_=>{_.removeEventListener("scroll",k)}),O.clear(),E.current=!1}},[u,r,s,i,d,v,o,c,y,l,S,R,M,J,he,ne,ue,pe,Ie,Z,n]),a.useEffect(q,[v,q]);const we=a.useMemo(()=>({onKeyDown:M,...p&&{[cu[x]]:O=>{n.setOpen(!1,ce(Go,O.nativeEvent))},...x!=="intentional"&&{onClick(O){n.setOpen(!1,ce(Go,O.nativeEvent))}}}}),[M,n,p,x]),re=Y(O=>{const k=Qe(O.nativeEvent);!me(n.select("floatingElement"),k)||O.button!==0||(E.current=!0)}),fe=Y(O=>{!o||!l||O.button!==0||(E.current=!0)}),xe=a.useMemo(()=>({onKeyDown:M,onPointerDown:re,onMouseDown:re,onMouseUp:re,onClickCapture:F,onMouseDownCapture(O){F(),fe(O)},onPointerDownCapture(O){F(),fe(O)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[M,re,F,fe]);return a.useMemo(()=>l?{reference:we,floating:xe,trigger:we}:{},[l,we,xe])}Kn.createSelectorCreator({memoize:Kn.lruMemoize,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const z=(e,t,n,o,r,s,...i)=>{if(i.length>0)throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of selectors":gt(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var uu=Kn.requireShim();const fu=cr(19),du=fu?mu:hu;function A(e,t,n,o,r){return du(e,t,n,o,r)}function pu(e,t,n,o,r){const s=a.useCallback(()=>t(e.getSnapshot(),n,o,r),[e,t,n,o,r]);return uu.useSyncExternalStore(e.subscribe,s,s)}function mu(e,t,n,o,r){return pu(e,t,n,o,r)}function hu(e,t,n,o,r){return Kn.withSelectorExports.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,o,r))}class wi{constructor(t){Pe(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Pe(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const o of this.listeners){if(n!==this.updateTick)return;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,o,r){return A(this,t,n,o,r)}}class gu extends wi{constructor(t,n={},o){super(t),this.context=n,this.selectors=o}useSyncedValue(t,n){a.useDebugValue(t),Q(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const o=this;Q(()=>(o.state[t]!==n&&o.set(t,n),()=>{o.set(t,void 0)}),[o,t,n])}useSyncedValues(t){const n=this;if(process.env.NODE_ENV!=="production"){a.useDebugValue(t,i=>Object.keys(i));const r=a.useRef(Object.keys(t)).current,s=Object.keys(t);(r.length!==s.length||r.some((i,c)=>i!==s[c]))&&console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.")}const o=Object.values(t);Q(()=>{n.update(t)},[n,...o])}useControlledProp(t,n){a.useDebugValue(t);const o=n!==void 0;if(Q(()=>{o&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,o]),process.env.NODE_ENV!=="production"){const r=this.controlledValues??(this.controlledValues=new Map);r.has(t)||r.set(t,o);const s=r.get(t);s!==void 0&&s!==o&&console.error(`A component is changing the ${o?"":"un"}controlled state of ${t.toString()} to be ${o?"un":""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}}select(t,n,o,r){const s=this.selectors[t];return s(this.state,n,o,r)}useState(t,n,o,r){return a.useDebugValue(t),A(this,this.selectors[t],n,o,r)}useContextCallback(t,n){a.useDebugValue(t);const o=Y(n??Re);this.context[t]=o}useStateSetter(t){const n=a.useRef(void 0);return n.current===void 0&&(n.current=o=>{this.set(t,o)}),n.current}observe(t,n){let o;typeof t=="function"?o=t:o=this.selectors[t];let r=o(this.state);return n(r,r,this),this.subscribe(s=>{const i=o(s);if(!Object.is(r,i)){const c=r;r=i,n(i,c,this)}})}}const bu={open:z(e=>e.open),domReferenceElement:z(e=>e.domReferenceElement),referenceElement:z(e=>e.positionReference??e.referenceElement),floatingElement:z(e=>e.floatingElement),floatingId:z(e=>e.floatingId)};class xu extends gu{constructor(n){const{nested:o,noEmit:r,onOpenChange:s,triggerElements:i,...c}=n;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:la(),nested:o,noEmit:r,triggerElements:i},bu);Pe(this,"setOpen",(n,o)=>{if((!n||!this.state.open||Ys(o.event))&&(this.context.dataRef.current.openEvent=n?o.event:void 0),!this.context.noEmit){const r={open:n,reason:o.reason,nativeEvent:o.event,nested:this.context.nested,triggerElement:o.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(n,o)})}}class yu{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const o=this.idMap.get(t);if(o!==n&&(o!==void 0&&this.elementsSet.delete(o),this.elementsSet.add(n),this.idMap.set(t,n),process.env.NODE_ENV!=="production"&&this.elementsSet.size!==this.idMap.size))throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.")}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function Ri(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,r=ar(),s=ai()!=null;if(process.env.NODE_ENV!=="production"){const c=o.reference;c&&!Ce(c)&&console.error("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `context.setPositionReference()`","instead.")}const i=at(()=>new xu({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:new yu,floatingId:r,nested:s,noEmit:!1})).current;return Q(()=>{const c={open:t,floatingId:r};o.reference!==void 0&&(c.referenceElement=o.reference,c.domReferenceElement=Ce(o.reference)?o.reference:null),o.floating!==void 0&&(c.floatingElement=o.floating),i.update(c)},[t,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=!1,i}function vu(e={}){const{nodeId:t,externalTree:n}=e,o=Ri(e),r=e.rootContext||o,s={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,c]=a.useState(null),u=a.useRef(null),l=po(n);Q(()=>{s.domReference&&(u.current=s.domReference)},[s.domReference]);const d=eu({...e,elements:{...s,...i&&{reference:i}}}),f=a.useCallback(R=>{const I=Ce(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;c(I),d.refs.setReference(I)},[d.refs]),[g,p]=a.useState(null),[x,y]=a.useState(null);r.useSyncedValue("referenceElement",g),r.useSyncedValue("domReferenceElement",Ce(g)?g:null),r.useSyncedValue("floatingElement",x);const h=a.useCallback(R=>{(Ce(R)||R===null)&&(u.current=R,p(R)),(Ce(d.refs.reference.current)||d.refs.reference.current===null||R!==null&&!Ce(R))&&d.refs.setReference(R)},[d.refs,p]),b=a.useCallback(R=>{y(R),d.refs.setFloating(R)},[d.refs]),m=a.useMemo(()=>({...d.refs,setReference:h,setFloating:b,setPositionReference:f,domReference:u}),[d.refs,h,b,f]),w=a.useMemo(()=>({...d.elements,domReference:s.domReference}),[d.elements,s.domReference]),v=r.useState("open"),E=r.useState("floatingId"),S=a.useMemo(()=>({...d,dataRef:r.context.dataRef,open:v,onOpenChange:r.setOpen,events:r.context.events,floatingId:E,refs:m,elements:w,nodeId:t,rootStore:r}),[d,m,w,t,r,v,E]);return Q(()=>{r.context.dataRef.current.floatingContext=S;const R=l?.nodesRef.current.find(I=>I.id===t);R&&(R.context=S)}),a.useMemo(()=>({...d,context:S,refs:m,elements:w,rootStore:r}),[d,m,w,S,r])}function Eu(e=[]){const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=e.map(l=>l?.trigger),s=a.useCallback(l=>Bn(l,e,"reference"),t),i=a.useCallback(l=>Bn(l,e,"floating"),n),c=a.useCallback(l=>Bn(l,e,"item"),o),u=a.useCallback(l=>Bn(l,e,"trigger"),r);return a.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:c,getTriggerProps:u}),[s,i,c,u])}function Bn(e,t,n){const o=new Map,r=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Xo]="");for(const i in e)r&&e&&(i===Gs||i===qs)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let c;const u=t[i]?.[n];typeof u=="function"?c=e?u(e):null:c=u,c&&vs(s,c,r,o)}return vs(s,e,r,o),s}function vs(e,t,n,o){for(const r in t){const s=t[r];n&&(r===Gs||r===qs)||(r.startsWith("on")?(o.has(r)||o.set(r,[]),typeof s=="function"&&(o.get(r)?.push(s),e[r]=(...i)=>o.get(r)?.map(c=>c(...i)).find(c=>c!==void 0))):e[r]=s)}}const Cu="Escape";function ho(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function jn(e,t){return ho(t,e===hr||e===Cn,e===Dt||e===Vt)}function $o(e,t,n){return ho(t,e===Cn,n?e===Dt:e===Vt)||e==="Enter"||e===" "||e===""}function wu(e,t,n){return ho(t,n?e===Dt:e===Vt,e===Cn)}function Ru(e,t,n,o){const r=n?e===Vt:e===Dt,s=e===hr;return t==="both"||t==="horizontal"&&o&&o>1?e===Cu:ho(t,r,s)}function Iu(e,t){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),i=n.context.dataRef,{listRef:c,activeIndex:u,onNavigate:l=()=>{},enabled:d=!0,selectedIndex:f=null,allowEscape:g=!1,loopFocus:p=!1,nested:x=!1,rtl:y=!1,virtual:h=!1,focusItemOnOpen:b="auto",focusItemOnHover:m=!0,openOnArrowKeyDown:w=!0,disabledIndices:v=void 0,orientation:E="vertical",parentOrientation:S,cols:R=1,id:I,resetOnPointerLeave:G=!0,externalTree:K}=t;process.env.NODE_ENV!=="production"&&(g&&(p||console.warn("`useListNavigation` looping must be enabled to allow escaping."),h||console.warn("`useListNavigation` must be virtual to allow escaping.")),E==="vertical"&&R>1&&console.warn("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const q=Qo(r),D=ct(q),X=ai(),Z=po(K);Q(()=>{i.current.orientation=E},[i,E]);const B=Jo(s),M=a.useRef(b),U=a.useRef(f??-1),F=a.useRef(null),J=a.useRef(!0),ne=Y(P=>{l(U.current===-1?null:U.current,P)}),ye=a.useRef(ne),ue=a.useRef(!!r),he=a.useRef(o),se=a.useRef(!1),pe=a.useRef(!1),Me=ct(v),Ie=ct(o),we=ct(f),re=ct(G),fe=Y(()=>{function P(te){h?Z?.events.emit("virtualfocus",te):xn(te,{sync:se.current,preventScroll:!0})}const $=c.current[U.current],T=pe.current;$&&P($),(se.current?te=>te():requestAnimationFrame)(()=>{const te=c.current[U.current]||$;if(!te)return;$||P(te),O&&(T||!J.current)&&te.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Q(()=>{d&&(o&&r?(U.current=f??-1,M.current&&f!=null&&(pe.current=!0,ne())):ue.current&&(U.current=-1,ye.current()))},[d,o,r,f,ne]),Q(()=>{if(d){if(!o){se.current=!1;return}if(r)if(u==null){if(se.current=!1,we.current!=null)return;if(ue.current&&(U.current=-1,fe()),(!he.current||!ue.current)&&M.current&&(F.current!=null||M.current===!0&&F.current==null)){let P=0;const $=()=>{c.current[0]==null?(P<2&&(P?requestAnimationFrame:queueMicrotask)($),P+=1):(U.current=F.current==null||$o(F.current,E,y)||x?Lo(c):ns(c),F.current=null,ne())};$()}}else hn(c,u)||(U.current=u,fe(),pe.current=!1)}},[d,o,r,u,we,x,c,E,y,ne,fe,Me]),Q(()=>{if(!d||r||!Z||h||!ue.current)return;const P=Z.nodesRef.current,$=P.find(te=>te.id===X)?.context?.elements.floating,T=wt(Ne(r)),W=P.some(te=>te.context&&me(te.context.elements.floating,T));$&&!W&&J.current&&$.focus({preventScroll:!0})},[d,r,Z,X,h]),Q(()=>{ye.current=ne,he.current=o,ue.current=!!r}),Q(()=>{o||(F.current=null,M.current=b)},[o,b]);const xe=u!=null,O=a.useMemo(()=>{function P(T){if(!Ie.current)return;const W=c.current.indexOf(T.currentTarget);W!==-1&&U.current!==W&&(U.current=W,ne(T))}return{onFocus(T){se.current=!0,P(T)},onClick:({currentTarget:T})=>T.focus({preventScroll:!0}),onMouseMove(T){se.current=!0,pe.current=!1,m&&P(T)},onPointerLeave(T){if(!Ie.current||!J.current||T.pointerType==="touch")return;se.current=!0;const W=T.relatedTarget;!m||c.current.includes(W)||re.current&&(xn(null,{sync:!0}),U.current=-1,ne(T),h||D.current?.focus({preventScroll:!0}))}}},[Ie,D,m,c,ne,re,h]),k=a.useCallback(()=>S??Z?.nodesRef.current.find(P=>P.id===X)?.context?.dataRef?.current.orientation,[X,Z,S]),V=Y(P=>{if(J.current=!1,se.current=!0,P.which===229||!Ie.current&&P.currentTarget===D.current)return;if(x&&Ru(P.key,E,y,R)){jn(P.key,k())||Ee(P),n.setOpen(!1,ce(mn,P.nativeEvent)),ke(s)&&(h?Z?.events.emit("virtualfocus",s):s.focus());return}const $=U.current,T=Lo(c,v),W=ns(c,v);if(B||(P.key==="Home"&&(Ee(P),U.current=T,ne(P)),P.key==="End"&&(Ee(P),U.current=W,ne(P))),R>1){const te=Array.from({length:c.current.length},()=>({width:1,height:1})),ae=Vl(te,R),De=ae.findIndex(ge=>ge!=null&&!gn(c,ge,v)),qe=ae.reduce((ge,Ae,Ke)=>Ae!=null&&!gn(c,Ae,v)?Ke:ge,-1),Se=ae[Dl({current:ae.map(ge=>ge!=null?c.current[ge]:null)},{event:P,orientation:E,loopFocus:p,rtl:y,cols:R,disabledIndices:Fl([...(typeof v!="function"?v:null)||c.current.map((ge,Ae)=>gn(c,Ae,v)?Ae:void 0),void 0],ae),minIndex:De,maxIndex:qe,prevIndex:Ll(U.current>W?T:U.current,te,ae,R,P.key===Cn?"bl":P.key===(y?Dt:Vt)?"tr":"tl"),stopEvent:!0})];if(Se!=null&&(U.current=Se,ne(P)),E==="both")return}if(jn(P.key,E)){if(Ee(P),o&&!h&&wt(P.currentTarget.ownerDocument)===P.currentTarget){U.current=$o(P.key,E,y)?T:W,ne(P);return}$o(P.key,E,y)?p?$>=W?g&&$!==c.current.length?U.current=-1:(se.current=!1,U.current=T):U.current=$e(c,{startingIndex:$,disabledIndices:v}):U.current=Math.min(W,$e(c,{startingIndex:$,disabledIndices:v})):p?$<=T?g&&$!==-1?U.current=c.current.length:(se.current=!1,U.current=W):U.current=$e(c,{startingIndex:$,decrement:!0,disabledIndices:v}):U.current=Math.max(T,$e(c,{startingIndex:$,decrement:!0,disabledIndices:v})),hn(c,U.current)&&(U.current=-1),ne(P)}}),ie=a.useMemo(()=>h&&o&&xe&&{"aria-activedescendant":`${I}-${u}`},[h,o,xe,I,u]),C=a.useMemo(()=>({"aria-orientation":E==="both"?void 0:E,...B?{}:ie,onKeyDown(P){if(P.key==="Tab"&&P.shiftKey&&o&&!h){const $=Qe(P.nativeEvent);if($&&!me(D.current,$))return;Ee(P),n.setOpen(!1,ce(so,P.nativeEvent)),ke(s)&&s.focus();return}V(P)},onPointerMove(){J.current=!0}}),[ie,V,D,E,B,n,o,h,s]),L=a.useMemo(()=>{function P(T){b==="auto"&&Ks(T.nativeEvent)&&(M.current=!h)}function $(T){M.current=b,b==="auto"&&zs(T.nativeEvent)&&(M.current=!0)}return{onKeyDown(T){const W=n.select("open");J.current=!1;const te=T.key.startsWith("Arrow"),ae=wu(T.key,k(),y),De=jn(T.key,E),qe=(x?ae:De)||T.key==="Enter"||T.key.trim()==="";if(h&&W)return V(T);if(!(!W&&!w&&te)){if(qe){const Se=jn(T.key,k());F.current=x&&Se?null:T.key}if(x){ae&&(Ee(T),W?(U.current=Lo(c,Me.current),ne(T)):n.setOpen(!0,ce(mn,T.nativeEvent,T.currentTarget)));return}De&&(we.current!=null&&(U.current=we.current),Ee(T),!W&&w?n.setOpen(!0,ce(mn,T.nativeEvent,T.currentTarget)):V(T),W&&ne(T))}},onFocus(T){n.select("open")&&!h&&(U.current=-1,ne(T))},onPointerDown:$,onPointerEnter:$,onMouseDown:P,onClick:P}},[V,Me,b,c,x,ne,n,w,E,k,y,we,h]),_=a.useMemo(()=>({...ie,...L}),[ie,L]);return a.useMemo(()=>d?{reference:_,floating:C,item:O,trigger:L}:{},[d,_,C,L,O])}function Su(e,t){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,r=n.useState("open"),{listRef:s,activeIndex:i,onMatch:c,onTypingChange:u,enabled:l=!0,resetMs:d=750,selectedIndex:f=null}=t,g=Gt(),p=a.useRef(""),x=a.useRef(f??i??-1),y=a.useRef(null);Q(()=>{!r&&f!==null||(g.clear(),y.current=null,p.current!==""&&(p.current=""))},[r,f,g]),Q(()=>{r&&p.current===""&&(x.current=f??i??-1)},[r,f,i]);const h=Y(E=>{E?o.current.typing||(o.current.typing=E,u?.(E)):o.current.typing&&(o.current.typing=E,u?.(E))}),b=Y(E=>{function S(D,X,Z){const B=X.find(M=>M?.toLocaleLowerCase().indexOf(Z.toLocaleLowerCase())===0);return B?D.indexOf(B):-1}const R=s.current;if(p.current.length>0&&p.current[0]!==" "&&(S(R,R,p.current)===-1?h(!1):E.key===" "&&Ee(E)),R==null||E.key.length!==1||E.ctrlKey||E.metaKey||E.altKey)return;r&&E.key!==" "&&(Ee(E),h(!0));const I=p.current==="";I&&(x.current=f??i??-1),R.every(D=>D?D[0]?.toLocaleLowerCase()!==D[1]?.toLocaleLowerCase():!0)&&p.current===E.key&&(p.current="",x.current=y.current),p.current+=E.key,g.start(d,()=>{p.current="",x.current=y.current,h(!1)});const K=I?f??i??-1:x.current,q=S(R,[...R.slice((K||0)+1),...R.slice(0,(K||0)+1)],p.current);q!==-1?(c?.(q),y.current=q):E.key!==" "&&(p.current="",h(!1))}),m=Y(E=>{const S=E.relatedTarget,R=n.select("domReferenceElement"),I=n.select("floatingElement"),G=me(R,S),K=me(I,S);G||K||(g.clear(),p.current="",x.current=y.current,h(!1))}),w=a.useMemo(()=>({onKeyDown:b,onBlur:m}),[b,m]),v=a.useMemo(()=>({onKeyDown:b,onKeyUp(E){E.key===" "&&h(!1)},onBlur:m}),[b,m,h]);return a.useMemo(()=>l?{reference:w,floating:v}:{},[l,w,v])}function Ou(e){const t=a.useRef(""),n=a.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:a.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function Pu(e){const[t,n]=a.useState(null),o=Y((c,u)=>{e||n(u||(Ws?"touch":""))}),r=a.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=Ou(o);return a.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:s,onPointerDown:i}}),[t,r,s,i])}let Ir=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=vn.startingStyle]="startingStyle",e[e.endingStyle=vn.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),or=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const Au={[or.popupOpen]:""},Tu={[or.popupOpen]:"",[or.pressed]:""},Nu={[Ir.open]:""},ku={[Ir.closed]:""},Mu={[Ir.anchorHidden]:""},Du={open(e){return e?Au:null}},Vu={open(e){return e?Tu:null}},Ii={open(e){return e?Nu:ku},anchorHidden(e){return e?Mu:null}};function Lu(e){return cr(19)?e:e?"true":void 0}const Si=a.forwardRef(function(t,n){const{cutout:o,...r}=t;let s;if(o){const i=o?.getBoundingClientRect();s=`polygon(
1
+ "use strict";var Cc=Object.defineProperty;var wc=(e,t,n)=>t in e?Cc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>wc(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react/jsx-runtime"),Ge=require("react"),et=require("./lib-utils.cjs"),Rc=require("./components-ui-button-button.cjs");require("./components-ui-button-button.styles.cjs");const Mn=require("./components-ui-field-field.cjs"),sr=require("./components-ui-icon-icon.cjs");require("phosphor-strokes-icons/icons");const Wn=require("./components-ui-input-group-input-group.cjs"),He=require("./components-ui-combobox-combobox.styles.cjs"),Kn=require("./with-selector-DSbfqgSY.cjs"),Ic=require("react-dom");function Is(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const u=Is(Ge),Yt=Is(Ic);function ko({controlled:e,default:t,name:n,state:o="value"}){const{current:r}=u.useRef(e!==void 0),[s,i]=u.useState(t),c=r?e:s;if(process.env.NODE_ENV!=="production"){u.useEffect(()=>{r!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${r?"":"un"}controlled ${o} state of ${n} to be ${r?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
2
+ `))},[o,n,e]);const{current:l}=u.useRef(t);u.useEffect(()=>{!r&&JSON.stringify(l)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${o} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
3
+ `))},[JSON.stringify(t)])}const a=u.useCallback(l=>{r||i(l)},[]);return[c,a]}const Wr={};function ut(e,t){const n=u.useRef(Wr);return n.current===Wr&&(n.current=e(t)),n}const Mo=u[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Sc=Mo&&Mo!==u.useLayoutEffect?Mo:e=>e();function Y(e){const t=ut(Oc).current;return t.next=e,Sc(t.effect),t.trampoline}function Oc(){const e={next:void 0,callback:Pc,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Pc(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const Ac=()=>{},Q=typeof document<"u"?u.useLayoutEffect:Ac,ir=u.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});process.env.NODE_ENV!=="production"&&(ir.displayName="CompositeListContext");function Tc(){return u.useContext(ir)}function Ss(e){const{children:t,elementsRef:n,labelsRef:o,onMapChange:r}=e,s=Y(r),i=u.useRef(0),c=ut(kc).current,a=ut(Nc).current,[l,d]=u.useState(0),f=u.useRef(l),g=Y((b,m)=>{a.set(b,m??null),f.current+=1,d(f.current)}),p=Y(b=>{a.delete(b),f.current+=1,d(f.current)}),x=u.useMemo(()=>{const b=new Map;return Array.from(a.keys()).filter(w=>w.isConnected).sort(Mc).forEach((w,v)=>{const E=a.get(w)??{};b.set(w,{...E,index:v})}),b},[a,l]);Q(()=>{if(typeof MutationObserver!="function"||x.size===0)return;const b=new MutationObserver(m=>{const w=new Set,v=E=>w.has(E)?w.delete(E):w.add(E);m.forEach(E=>{E.removedNodes.forEach(v),E.addedNodes.forEach(v)}),w.size===0&&(f.current+=1,d(f.current))});return x.forEach((m,w)=>{w.parentElement&&b.observe(w.parentElement,{childList:!0})}),()=>{b.disconnect()}},[x]),Q(()=>{f.current===l&&(n.current.length!==x.size&&(n.current.length=x.size),o&&o.current.length!==x.size&&(o.current.length=x.size),i.current=x.size),s(x)},[s,x,n,o,l]),Q(()=>()=>{n.current=[]},[n]),Q(()=>()=>{o&&(o.current=[])},[o]);const y=Y(b=>(c.add(b),()=>{c.delete(b)}));Q(()=>{c.forEach(b=>b(x))},[c,x]);const h=u.useMemo(()=>({register:g,unregister:p,subscribeMapChange:y,elementsRef:n,labelsRef:o,nextIndexRef:i}),[g,p,y,n,o,i]);return j.jsx(ir.Provider,{value:h,children:t})}function Nc(){return new Map}function kc(){return new Set}function Mc(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Os=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Os.displayName="DirectionContext");function Ps(){return u.useContext(Os)?.direction??"ltr"}function bt(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(o=>n.searchParams.append("args[]",o)),`Base UI error #${e}; visit ${n} for the full message.`}function vn(e,t,n,o){const r=ut(As).current;return Vc(r,e,t,n,o)&&Ts(r,[e,t,n,o]),r.callback}function Dc(e){const t=ut(As).current;return Lc(t,e)&&Ts(t,e),t.callback}function As(){return{callback:null,cleanup:null,refs:[]}}function Vc(e,t,n,o,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==o||e.refs[3]!==r}function Lc(e,t){return e.refs.length!==t.length||e.refs.some((n,o)=>n!==t[o])}function Ts(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const o=Array(t.length).fill(null);for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(o[r]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=o[r];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}const Fc=parseInt(u.version,10);function cr(e){return Fc>=e}function Gr(e){if(!u.isValidElement(e))return null;const t=e,n=t.props;return(cr(19)?n?.ref:t.ref)??null}function Ho(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function _c(e,t){const n={};for(const o in e){const r=e[o];if(t?.hasOwnProperty(o)){const s=t[o](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${o.toLowerCase()}`]="":r&&(n[`data-${o.toLowerCase()}`]=r.toString())}return n}function Bc(e,t){return typeof e=="function"?e(t):e}function jc(e,t){return typeof e=="function"?e(t):e}const mn={};function Ns(e,t,n,o,r){let s={...Uo(e,mn)};return t&&(s=Gn(s,t)),n&&(s=Gn(s,n)),o&&(s=Gn(s,o)),s}function $c(e){if(e.length===0)return mn;if(e.length===1)return Uo(e[0],mn);let t={...Uo(e[0],mn)};for(let n=1;n<e.length;n+=1)t=Gn(t,e[n]);return t}function Gn(e,t){return ks(t)?t(e):Hc(e,t)}function Hc(e,t){if(!t)return e;for(const n in t){const o=t[n];switch(n){case"style":{e[n]=Ho(e.style,o);break}case"className":{e[n]=Ms(e.className,o);break}default:Uc(n,o)?e[n]=Wc(e[n],o):e[n]=o}}return e}function Uc(e,t){const n=e.charCodeAt(0),o=e.charCodeAt(1),r=e.charCodeAt(2);return n===111&&o===110&&r>=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function ks(e){return typeof e=="function"}function Uo(e,t){return ks(e)?e(t):e??mn}function Wc(e,t){return t?e?n=>{if(Gc(n)){const r=n;Wo(r);const s=t(r);return r.baseUIHandlerPrevented||e?.(r),s}const o=t(n);return e?.(n),o}:t:e}function Wo(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Ms(e,t){return t?e?t+" "+e:t:e}function Gc(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Re(){}const Dn=Object.freeze([]),We=Object.freeze({}),qc={style:{transition:"none"}},Kc="data-base-ui-click-trigger",zc={fallbackAxisSide:"none"},Yc={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function qe(e,t,n={}){const o=t.render,r=Xc(t,n);if(n.enabled===!1)return null;const s=n.state??We;return Qc(e,o,r,s)}function Xc(e,t={}){const{className:n,style:o,render:r}=e,{state:s=We,ref:i,props:c,stateAttributesMapping:a,enabled:l=!0}=t,d=l?Bc(n,s):void 0,f=l?jc(o,s):void 0,g=l?_c(s,a):We,p=l?Ho(g,Array.isArray(c)?$c(c):c)??We:We;return typeof document<"u"&&(l?Array.isArray(i)?p.ref=Dc([p.ref,Gr(r),...i]):p.ref=vn(p.ref,Gr(r),i):vn(null,null)),l?(d!==void 0&&(p.className=Ms(p.className,d)),f!==void 0&&(p.style=Ho(p.style,f)),p):We}const Jc=Symbol.for("react.lazy");function Qc(e,t,n,o){if(t){if(typeof t=="function")return t(n,o);const r=Ns(n,t.props);r.ref=n.ref;let s=t;if(s?.$$typeof===Jc&&(s=u.Children.toArray(t)[0]),process.env.NODE_ENV!=="production"&&!u.isValidElement(s))throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.","https://base-ui.com/r/invalid-render-prop"].join(`
4
+ `));return u.cloneElement(s,r)}if(e&&typeof e=="string")return Zc(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":bt(8))}function Zc(e,t){return e==="button"?Ge.createElement("button",{type:"button",...t,key:t.key}):e==="img"?Ge.createElement("img",{alt:"",...t,key:t.key}):u.createElement(e,t)}const ct="none",Go="trigger-press",el="trigger-hover",lr="outside-press",tl="item-press",qr="clear-press",nl="chip-remove-press",Qt="input-change",kt="input-clear",ol="input-press",so="focus-out",Ds="escape-key",hn="list-navigation";function ce(e,t,n,o){let r=!1,s=!1;const i=We;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...i}}function fn(e,t,n){const o=n??We;return{reason:e,event:t??new Event("base-ui"),...o}}const qo={...u};let Kr=0;function rl(e,t="mui"){const[n,o]=u.useState(e),r=e||n;return u.useEffect(()=>{n==null&&(Kr+=1,o(`${t}-${Kr}`))},[n,t]),r}const zr=qo.useId;function ar(e,t){if(zr!==void 0){const n=zr();return e??(t?`${t}-${n}`:n)}return rl(e,t)}function ur(e){return ar(e,"base-ui")}const sl=[];function Vs(e){u.useEffect(e,sl)}const Vn=null;let Yr=globalThis.requestAnimationFrame;class il{constructor(){Pe(this,"callbacks",[]);Pe(this,"callbacksCount",0);Pe(this,"nextId",1);Pe(this,"startId",1);Pe(this,"isScheduled",!1);Pe(this,"tick",t=>{this.isScheduled=!1;const n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<n.length;r+=1)n[r]?.(t)})}request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const o=process.env.NODE_ENV!=="production"&&Yr!==requestAnimationFrame&&(Yr=requestAnimationFrame,!0);return(!this.isScheduled||o)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Ln=new il;class yt{constructor(){Pe(this,"currentId",Vn);Pe(this,"cancel",()=>{this.currentId!==Vn&&(Ln.cancel(this.currentId),this.currentId=Vn)});Pe(this,"disposeEffect",()=>this.cancel)}static create(){return new yt}static request(t){return Ln.request(t)}static cancel(t){return Ln.cancel(t)}request(t){this.cancel(),this.currentId=Ln.request(()=>{this.currentId=Vn,t()})}}function fr(){const e=ut(yt.create).current;return Vs(e.disposeEffect),e}function wt(e){return e==null?e:"current"in e?e.current:e}let En=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const cl={[En.startingStyle]:""},ll={[En.endingStyle]:""},Ls={transitionStatus(e){return e==="starting"?cl:e==="ending"?ll:null}};function al(e,t=!1,n=!0){const o=fr();return Y((r,s=null)=>{o.cancel();function i(){Yt.flushSync(r)}const c=wt(e);if(c==null)return;const a=c;if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let l=function(){const f=En.startingStyle;if(!a.hasAttribute(f)){o.request(d);return}const g=new MutationObserver(()=>{a.hasAttribute(f)||(g.disconnect(),d())});g.observe(a,{attributes:!0,attributeFilter:[f]}),s?.addEventListener("abort",()=>g.disconnect(),{once:!0})},d=function(){Promise.all(a.getAnimations().map(f=>f.finished)).then(()=>{s?.aborted||i()}).catch(()=>{const f=a.getAnimations();if(n){if(s?.aborted)return;i()}else f.length>0&&f.some(g=>g.pending||g.playState!=="finished")&&d()})};if(t){l();return}o.request(d)}})}function Fs(e,t=!1,n=!1){const[o,r]=u.useState(e&&t?"idle":void 0),[s,i]=u.useState(e);return e&&!s&&(i(!0),r("starting")),!e&&s&&o!=="ending"&&!n&&r("ending"),!e&&!s&&o==="ending"&&r(void 0),Q(()=>{if(!e&&s&&o!=="ending"&&n){const c=yt.request(()=>{r("ending")});return()=>{yt.cancel(c)}}},[e,s,o,n]),Q(()=>{if(!e||t)return;const c=yt.request(()=>{r(void 0)});return()=>{yt.cancel(c)}},[t,e]),Q(()=>{if(!e||!t)return;e&&s&&o!=="idle"&&r("starting");const c=yt.request(()=>{r("idle")});return()=>{yt.cancel(c)}},[t,e,s,r,o]),u.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:o}),[s,o])}let _s=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Bs(e={}){const{label:t,metadata:n,textRef:o,indexGuessBehavior:r,index:s}=e,{register:i,unregister:c,subscribeMapChange:a,elementsRef:l,labelsRef:d,nextIndexRef:f}=Tc(),g=u.useRef(-1),[p,x]=u.useState(s??(r===_s.GuessFromOrder?()=>{if(g.current===-1){const b=f.current;f.current+=1,g.current=b}return g.current}:-1)),y=u.useRef(null),h=u.useCallback(b=>{if(y.current=b,p!==-1&&b!==null&&(l.current[p]=b,d)){const m=t!==void 0;d.current[p]=m?t:o?.current?.textContent??b.textContent}},[p,l,d,t,o]);return Q(()=>{if(s!=null)return;const b=y.current;if(b)return i(b,n),()=>{c(b)}},[s,i,c,n]),Q(()=>{if(s==null)return a(b=>{const m=y.current?b.get(y.current)?.index:null;m!=null&&x(m)})},[s,a,x]),u.useMemo(()=>({ref:h,index:p}),[p,h])}function io(){return typeof window<"u"}function Ft(e){return dr(e)?(e.nodeName||"").toLowerCase():"#document"}function _e(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Et(e){var t;return(t=(dr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dr(e){return io()?e instanceof Node||e instanceof _e(e).Node:!1}function Ce(e){return io()?e instanceof Element||e instanceof _e(e).Element:!1}function ke(e){return io()?e instanceof HTMLElement||e instanceof _e(e).HTMLElement:!1}function Ko(e){return!io()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _e(e).ShadowRoot}function _t(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=st(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function ul(e){return/^(table|td|th)$/.test(Ft(e))}function co(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const fl=/transform|translate|scale|rotate|perspective|filter/,dl=/paint|layout|strict|content/,Wt=e=>!!e&&e!=="none";let Do;function pr(e){const t=Ce(e)?st(e):e;return Wt(t.transform)||Wt(t.translate)||Wt(t.scale)||Wt(t.rotate)||Wt(t.perspective)||!lo()&&(Wt(t.backdropFilter)||Wt(t.filter))||fl.test(t.willChange||"")||dl.test(t.contain||"")}function pl(e){let t=St(e);for(;ke(t)&&!It(t);){if(pr(t))return t;if(co(t))return null;t=St(t)}return null}function lo(){return Do==null&&(Do=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Do}function It(e){return/^(html|body|#document)$/.test(Ft(e))}function st(e){return _e(e).getComputedStyle(e)}function ao(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function St(e){if(Ft(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ko(e)&&e.host||Et(e);return Ko(t)?t.host:t}function js(e){const t=St(e);return It(t)?e.ownerDocument?e.ownerDocument.body:e.body:ke(t)&&_t(t)?t:js(t)}function Dt(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=js(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=_e(r);if(s){const c=zo(i);return t.concat(i,i.visualViewport||[],_t(r)?r:[],c&&n?Dt(c):[])}else return t.concat(r,Dt(r,[],n))}function zo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}let Yo;process.env.NODE_ENV!=="production"&&(Yo=new Set);function Xr(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");Yo.has(t)||(Yo.add(t),console.error(`Base UI: ${t}`))}}const $s=u.createContext(void 0);process.env.NODE_ENV!=="production"&&($s.displayName="CompositeRootContext");function ml(e=!1){const t=u.useContext($s);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":bt(16));return t}function hl(e){const{focusableWhenDisabled:t,disabled:n,composite:o=!1,tabIndex:r=0,isNativeButton:s}=e,i=o&&t!==!1,c=o&&t===!1;return{props:u.useMemo(()=>{const l={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return o||(l.tabIndex=r,!s&&n&&(l.tabIndex=t?r:-1)),(s&&(t||i)||!s&&n)&&(l["aria-disabled"]=n),s&&(!t||c)&&(l.disabled=n),l},[o,n,t,i,c,s,r])}}function uo(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:o=0,native:r=!0}=e,s=u.useRef(null),i=ml(!0)!==void 0,c=Y(()=>{const g=s.current;return!!(g?.tagName==="A"&&g?.href)}),{props:a}=hl({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:o,isNativeButton:r});process.env.NODE_ENV!=="production"&&u.useEffect(()=>{if(!s.current)return;const g=s.current.tagName==="BUTTON";if(r){if(!g){const p=qo.captureOwnerStack?.()||"";Xr(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${p}`)}}else if(g){const p=qo.captureOwnerStack?.()||"";Xr(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${p}`)}},[r]);const l=u.useCallback(()=>{const g=s.current;gl(g)&&i&&t&&a.disabled===void 0&&g.disabled&&(g.disabled=!1)},[t,a.disabled,i]);Q(l,[l]);const d=u.useCallback((g={})=>{const{onClick:p,onMouseDown:x,onKeyUp:y,onKeyDown:h,onPointerDown:b,...m}=g;return Ns({type:r?"button":void 0,onClick(v){if(t){v.preventDefault();return}p?.(v)},onMouseDown(v){t||x?.(v)},onKeyDown(v){if(t||(Wo(v),h?.(v)),v.baseUIHandlerPrevented)return;const E=v.target===v.currentTarget&&!r&&!c()&&!t,S=v.key==="Enter",R=v.key===" ";E&&((R||S)&&v.preventDefault(),S&&p?.(v))},onKeyUp(v){t||(Wo(v),y?.(v)),!v.baseUIHandlerPrevented&&v.target===v.currentTarget&&!r&&!t&&v.key===" "&&p?.(v)},onPointerDown(v){if(t){v.preventDefault();return}b?.(v)}},r?void 0:{role:"button"},a,m)},[t,a,r,c]),f=Y(g=>{s.current=g,l()});return{getButtonProps:d,buttonRef:f}}function gl(e){return ke(e)&&e.tagName==="BUTTON"}const Xt=typeof navigator<"u",Vo=yl(),Hs=El(),mr=vl(),Us=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),Ws=Vo.platform==="MacIntel"&&Vo.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Vo.platform),Jr=Xt&&/firefox/i.test(mr),bl=Xt&&/apple/i.test(navigator.vendor),zn=Xt&&/android/i.test(Hs)||/android/i.test(mr);Xt&&Hs.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const xl=mr.includes("jsdom/");function yl(){if(!Xt)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function vl(){if(!Xt)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function El(){if(!Xt)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Xo="data-base-ui-focusable",Gs="active",qs="selected",Cl="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Vt="ArrowLeft",Lt="ArrowRight",hr="ArrowUp",wn="ArrowDown";function Rt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function me(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Ko(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Ze(e){return"composedPath"in e?e.composedPath()[0]:e.target}function gt(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function wl(e){return e.matches("html,body")}function gr(e){return ke(e)&&e.matches(Cl)}function Jo(e){return e?e.getAttribute("role")==="combobox"&&gr(e):!1}function Qo(e){return e?e.hasAttribute(Xo)?e:e.querySelector(`[${Xo}]`)||e:null}function en(e,t,n=!0){return e.filter(r=>r.parentId===t&&(!n||r.context?.open)).flatMap(r=>[r,...en(e,r.id,n)])}function Qr(e,t){let n=[],o=e.find(r=>r.id===t)?.parentId;for(;o;){const r=e.find(s=>s.id===o);o=r?.parentId,r&&(n=n.concat(r))}return n}function Ee(e){e.preventDefault(),e.stopPropagation()}function Rl(e){return"nativeEvent"in e}function Ks(e){return e.pointerType===""&&e.isTrusted?!0:zn&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function zs(e){return xl?!1:!zn&&e.width===0&&e.height===0||zn&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Zr(e,t){return["mouse","pen"].includes(e)}function Ys(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Il=["top","right","bottom","left"],on=Math.min,ot=Math.max,Yn=Math.round,Zt=Math.floor,vt=e=>({x:e,y:e}),Sl={left:"right",right:"left",bottom:"top",top:"bottom"};function Zo(e,t,n){return ot(e,on(t,n))}function Ot(e,t){return typeof e=="function"?e(t):e}function rt(e){return e.split("-")[0]}function Bt(e){return e.split("-")[1]}function br(e){return e==="x"?"y":"x"}function xr(e){return e==="y"?"height":"width"}function at(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function yr(e){return br(at(e))}function Ol(e,t,n){n===void 0&&(n=!1);const o=Bt(e),r=yr(e),s=xr(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Xn(i)),[i,Xn(i)]}function Pl(e){const t=Xn(e);return[er(e),t,er(t)]}function er(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const es=["left","right"],ts=["right","left"],Al=["top","bottom"],Tl=["bottom","top"];function Nl(e,t,n){switch(e){case"top":case"bottom":return n?t?ts:es:t?es:ts;case"left":case"right":return t?Al:Tl;default:return[]}}function kl(e,t,n,o){const r=Bt(e);let s=Nl(rt(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(er)))),s}function Xn(e){const t=rt(e);return Sl[t]+e.slice(t.length)}function Ml(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xs(e){return typeof e!="number"?Ml(e):{top:e,right:e,bottom:e,left:e}}function Jn(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Fn(e,t,n){return Math.floor(e/t)!==n}function gn(e,t){return t<0||t>=e.current.length}function Lo(e,t){return $e(e,{disabledIndices:t})}function ns(e,t){return $e(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function $e(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:o,amount:r=1}={}){let s=t;do s+=n?-r:r;while(s>=0&&s<=e.current.length-1&&bn(e,s,o));return s}function Dl(e,{event:t,orientation:n,loopFocus:o,rtl:r,cols:s,disabledIndices:i,minIndex:c,maxIndex:a,prevIndex:l,stopEvent:d=!1}){let f=l;const g=[],p={};let x=!1;{let b=null,m=-1;e.current.forEach((w,v)=>{if(w==null)return;const E=w.closest('[role="row"]');E&&(x=!0),(E!==b||m===-1)&&(b=E,m+=1,g[m]=[]),g[m].push(v),p[v]=m})}const y=x&&g.length>0&&g.some(b=>b.length!==s);function h(b){if(!y||l===-1)return;const m=p[l];if(m==null)return;const w=g[m].indexOf(l);let v=b==="up"?m-1:m+1;o&&(v<0?v=g.length-1:v>=g.length&&(v=0));const E=new Set;for(;v>=0&&v<g.length&&!E.has(v);){E.add(v);const S=g[v];if(S.length===0){v=b==="up"?v-1:v+1;continue}const R=Math.min(w,S.length-1);for(let I=R;I>=0;I-=1){const G=S[I];if(!bn(e,G,i))return G}v=b==="up"?v-1:v+1,o&&(v<0?v=g.length-1:v>=g.length&&(v=0))}}if(t.key===hr){const b=h("up");if(b!==void 0)d&&Ee(t),f=b;else{if(d&&Ee(t),l===-1)f=a;else if(f=$e(e,{startingIndex:f,amount:s,decrement:!0,disabledIndices:i}),o&&(l-s<c||f<0)){const m=l%s,w=a%s,v=a-(w-m);w===m?f=a:f=w>m?v:v-s}gn(e,f)&&(f=l)}}if(t.key===wn){const b=h("down");b!==void 0?(d&&Ee(t),f=b):(d&&Ee(t),l===-1?f=c:(f=$e(e,{startingIndex:l,amount:s,disabledIndices:i}),o&&l+s>a&&(f=$e(e,{startingIndex:l%s-s,amount:s,disabledIndices:i}))),gn(e,f)&&(f=l))}if(n==="both"){const b=Zt(l/s);t.key===(r?Vt:Lt)&&(d&&Ee(t),l%s!==s-1?(f=$e(e,{startingIndex:l,disabledIndices:i}),o&&Fn(f,s,b)&&(f=$e(e,{startingIndex:l-l%s-1,disabledIndices:i}))):o&&(f=$e(e,{startingIndex:l-l%s-1,disabledIndices:i})),Fn(f,s,b)&&(f=l)),t.key===(r?Lt:Vt)&&(d&&Ee(t),l%s!==0?(f=$e(e,{startingIndex:l,decrement:!0,disabledIndices:i}),o&&Fn(f,s,b)&&(f=$e(e,{startingIndex:l+(s-l%s),decrement:!0,disabledIndices:i}))):o&&(f=$e(e,{startingIndex:l+(s-l%s),decrement:!0,disabledIndices:i})),Fn(f,s,b)&&(f=l));const m=Zt(a/s)===b;gn(e,f)&&(o&&m?f=t.key===(r?Lt:Vt)?a:$e(e,{startingIndex:l-l%s-1,disabledIndices:i}):f=l)}return f}function Vl(e,t,n){const o=[];let r=0;return e.forEach(({width:s,height:i},c)=>{if(s>t&&process.env.NODE_ENV!=="production")throw new Error(`[Floating UI]: Invalid grid - item width at index ${c} is greater than grid columns`);let a=!1;for(;!a;){const l=[];for(let d=0;d<s;d+=1)for(let f=0;f<i;f+=1)l.push(r+d+f*t);r%t+s<=t&&l.every(d=>o[d]==null)?(l.forEach(d=>{o[d]=c}),a=!0):r+=1}}),[...o]}function Ll(e,t,n,o,r){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(r){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*o:s;case"br":return n.lastIndexOf(e);default:return-1}}function Fl(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function bn(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const o=e.current[t];return o?o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true":!1}var _l=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Qn=_l.join(","),Js=typeof Element>"u",rn=Js?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Zn=!Js&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},eo=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),s=r===""||r==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):eo(t.parentNode));return i},Bl=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},Qs=function(t,n,o){if(eo(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(Qn));return n&&rn.call(t,Qn)&&r.unshift(t),r=r.filter(o),r},to=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var i=s.shift();if(!eo(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),a=c.length?c:i.children,l=to(a,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{var d=rn.call(i,Qn);d&&o.filter(i)&&(n||!t.includes(i))&&r.push(i);var f=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),g=!eo(f,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(f&&g){var p=to(f===!0?i.children:f.children,!0,o);o.flatten?r.push.apply(r,p):r.push({scopeParent:i,candidates:p})}else s.unshift.apply(s,i.children)}}return r},Zs=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ei=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Bl(t))&&!Zs(t)?0:t.tabIndex},jl=function(t,n){var o=ei(t);return o<0&&n&&!Zs(t)?0:o},$l=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ti=function(t){return t.tagName==="INPUT"},Hl=function(t){return ti(t)&&t.type==="hidden"},Ul=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Wl=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Gl=function(t){if(!t.name)return!0;var n=t.form||Zn(t),o=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Wl(r,t.form);return!s||s===t},ql=function(t){return ti(t)&&t.type==="radio"},Kl=function(t){return ql(t)&&!Gl(t)},zl=function(t){var n,o=t&&Zn(t),r=(n=o)===null||n===void 0?void 0:n.host,s=!1;if(o&&o!==t){var i,c,a;for(s=!!((i=r)!==null&&i!==void 0&&(c=i.ownerDocument)!==null&&c!==void 0&&c.contains(r)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!s&&r;){var l,d,f;o=Zn(r),r=(l=o)===null||l===void 0?void 0:l.host,s=!!((d=r)!==null&&d!==void 0&&(f=d.ownerDocument)!==null&&f!==void 0&&f.contains(r))}}return s},os=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},Yl=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=rn.call(t,"details>summary:first-of-type"),c=i?t.parentElement:t;if(rn.call(c,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var a=t;t;){var l=t.parentElement,d=Zn(t);if(l&&!l.shadowRoot&&r(l)===!0)return os(t);t.assignedSlot?t=t.assignedSlot:!l&&d!==t.ownerDocument?t=d.host:t=l}t=a}if(zl(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return os(t);return!1},Xl=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return rn.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},tr=function(t,n){return!(n.disabled||Hl(n)||Yl(n,t)||Ul(n)||Xl(n))},nr=function(t,n){return!(Kl(n)||ei(n)<0||!tr(t,n))},Jl=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},ni=function(t){var n=[],o=[];return t.forEach(function(r,s){var i=!!r.scopeParent,c=i?r.scopeParent:r,a=jl(c,i),l=i?ni(r.candidates):c;a===0?i?n.push.apply(n,l):n.push(c):o.push({documentOrder:s,tabIndex:a,item:r,isScope:i,content:l})}),o.sort($l).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},fo=function(t,n){n=n||{};var o;return n.getShadowRoot?o=to([t],n.includeContainer,{filter:nr.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Jl}):o=Qs(t,n.includeContainer,nr.bind(null,n)),ni(o)},Ql=function(t,n){n=n||{};var o;return n.getShadowRoot?o=to([t],n.includeContainer,{filter:tr.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=Qs(t,n.includeContainer,tr.bind(null,n)),o},oi=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return rn.call(t,Qn)===!1?!1:nr(n,t)};function Ne(e){return e?.ownerDocument||document}const Rn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ri(e,t){const n=fo(e,Rn()),o=n.length;if(o===0)return;const r=Rt(Ne(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function si(e){return ri(Ne(e).body,1)||e}function ii(e){return ri(Ne(e).body,-1)||e}function xn(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!me(n,o)}function Zl(e){fo(e,Rn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function rs(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}function vr(e){const{enabled:t=!0,open:n,ref:o,onComplete:r}=e,s=Y(r),i=al(o,n,!1);u.useEffect(()=>{if(!t)return;const c=new AbortController;return i(s,c.signal),()=>{c.abort()}},[t,n,s,i])}const dn=0;class sn{constructor(){Pe(this,"currentId",dn);Pe(this,"clear",()=>{this.currentId!==dn&&(clearTimeout(this.currentId),this.currentId=dn)});Pe(this,"disposeEffect",()=>this.clear)}static create(){return new sn}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=dn,n()},t)}isStarted(){return this.currentId!==dn}}function qt(){const e=ut(sn.create).current;return Vs(e.disposeEffect),e}let ss={},is={},cs="";function ea(e){if(typeof document>"u")return!1;const t=Ne(e);return _e(t).innerWidth-t.documentElement.clientWidth>0}function ta(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Ne(e),o=n.documentElement,r=n.body,s=_t(o)?o:r,i=s.style.overflowY,c=o.style.scrollbarGutter;o.style.scrollbarGutter="stable",s.style.overflowY="scroll";const a=s.offsetWidth;s.style.overflowY="hidden";const l=s.offsetWidth;return s.style.overflowY=i,o.style.scrollbarGutter=c,a===l}function na(e){const t=Ne(e),n=t.documentElement,o=t.body,r=_t(n)?n:o,s={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,s)}}function oa(e){const t=Ne(e),n=t.documentElement,o=t.body,r=_e(n);let s=0,i=0,c=!1;const a=yt.create();if(Us&&(r.visualViewport?.scale??1)!==1)return()=>{};function l(){const g=r.getComputedStyle(n),p=r.getComputedStyle(o),h=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,ss={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},cs=n.style.scrollBehavior,is={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,m=n.scrollWidth>n.clientWidth,w=g.overflowY==="scroll"||p.overflowY==="scroll",v=g.overflowX==="scroll"||p.overflowX==="scroll",E=Math.max(0,r.innerWidth-o.clientWidth),S=Math.max(0,r.innerHeight-o.clientHeight),R=parseFloat(p.marginTop)+parseFloat(p.marginBottom),I=parseFloat(p.marginLeft)+parseFloat(p.marginRight),G=_t(n)?n:o;if(c=ta(e),c){n.style.scrollbarGutter=h,G.style.overflowY="hidden",G.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:h,overflowY:"hidden",overflowX:"hidden"}),(b||w)&&(n.style.overflowY="scroll"),(m||v)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:R||S?`calc(100dvh - ${R+S}px)`:"100dvh",width:I||E?`calc(100vw - ${I+E}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=s,o.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,ss),Object.assign(o.style,is),c||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=cs)}function f(){d(),a.request(l)}return l(),r.addEventListener("resize",f),()=>{a.cancel(),d(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",f)}}class ra{constructor(){Pe(this,"lockCount",0);Pe(this,"restore",null);Pe(this,"timeoutLock",sn.create());Pe(this,"timeoutUnlock",sn.create());Pe(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Pe(this,"unlock",()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const o=Ne(t).documentElement,r=_e(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=Re;return}const s=Ws||!ea(t);this.restore=s?na(t):oa(t)}}const sa=new ra;function ia(e=!0,t=null){Q(()=>{if(e)return sa.acquire(t)},[e,t])}function lt(e){const t=ut(ca,e).current;return t.next=e,Q(t.effect),t}function ca(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function la(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}const ci=u.createContext(null);process.env.NODE_ENV!=="production"&&(ci.displayName="FloatingNodeContext");const li=u.createContext(null);process.env.NODE_ENV!=="production"&&(li.displayName="FloatingTreeContext");const ai=()=>u.useContext(ci)?.id||null,po=e=>{const t=u.useContext(li);return e??t};function no(e){return`data-base-ui-${e}`}const ui={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Er={...ui,position:"fixed",top:0,left:0},aa={...ui,position:"absolute"},Cn=u.forwardRef(function(t,n){const[o,r]=u.useState();Q(()=>{bl&&r("button")},[]);const s={tabIndex:0,role:o};return j.jsx("span",{...t,ref:n,style:Er,"aria-hidden":o?void 0:!0,...s,"data-base-ui-focus-guard":""})});process.env.NODE_ENV!=="production"&&(Cn.displayName="FocusGuard");let ls=0;function yn(e,t={}){const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(ls);const s=()=>e?.focus({preventScroll:n});r?s():ls=requestAnimationFrame(s)}const tn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function as(e){return e==="inert"?tn.inert:e==="aria-hidden"?tn["aria-hidden"]:tn.none}let _n=new WeakSet,Bn={},Fo=0;const fi=e=>e&&(e.host||fi(e.parentNode)),ua=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=fi(n);return e.contains(o)?o:null}).filter(n=>n!=null);function fa(e,t,n,o){const r="data-base-ui-inert",s=o?"inert":n?"aria-hidden":null,i=ua(t,e),c=new Set,a=new Set(i),l=[];Bn[r]||(Bn[r]=new WeakMap);const d=Bn[r];i.forEach(f),g(t),c.clear();function f(p){!p||c.has(p)||(c.add(p),p.parentNode&&f(p.parentNode))}function g(p){!p||a.has(p)||[].forEach.call(p.children,x=>{if(Ft(x)!=="script")if(c.has(x))g(x);else{const y=s?x.getAttribute(s):null,h=y!==null&&y!=="false",b=as(s),m=(b.get(x)||0)+1,w=(d.get(x)||0)+1;b.set(x,m),d.set(x,w),l.push(x),m===1&&h&&_n.add(x),w===1&&x.setAttribute(r,""),!h&&s&&x.setAttribute(s,s==="inert"?"":"true")}})}return Fo+=1,()=>{l.forEach(p=>{const x=as(s),h=(x.get(p)||0)-1,b=(d.get(p)||0)-1;x.set(p,h),d.set(p,b),h||(!_n.has(p)&&s&&p.removeAttribute(s),_n.delete(p)),b||p.removeAttribute(r)}),Fo-=1,Fo||(tn.inert=new WeakMap,tn["aria-hidden"]=new WeakMap,tn.none=new WeakMap,_n=new WeakSet,Bn={})}}function da(e,t=!1,n=!1){const o=Ne(e[0]).body;return fa(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const Cr=u.createContext(null);process.env.NODE_ENV!=="production"&&(Cr.displayName="PortalContext");const di=()=>u.useContext(Cr),pa=no("portal");function ma(e={}){const{ref:t,container:n,componentProps:o=We,elementProps:r}=e,s=ar(),c=di()?.portalNode,[a,l]=u.useState(null),[d,f]=u.useState(null),g=Y(h=>{h!==null&&f(h)}),p=u.useRef(null);Q(()=>{if(n===null){p.current&&(p.current=null,f(null),l(null));return}if(s==null)return;const h=(n&&(dr(n)?n:n.current))??c??document.body;if(h==null){p.current&&(p.current=null,f(null),l(null));return}p.current!==h&&(p.current=h,f(null),l(h))},[n,c,s]);const x=qe("div",o,{ref:[t,g],props:[{id:s,[pa]:""},r]});return{portalNode:d,portalSubtree:a&&x?Yt.createPortal(x,a):null}}const pi=u.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,renderGuards:c,...a}=t,{portalNode:l,portalSubtree:d}=ma({container:r,ref:n,componentProps:t,elementProps:a}),f=u.useRef(null),g=u.useRef(null),p=u.useRef(null),x=u.useRef(null),[y,h]=u.useState(null),b=y?.modal,m=y?.open,w=typeof c=="boolean"?c:!!y&&!y.modal&&y.open&&!!l;u.useEffect(()=>{if(!l||b)return;function E(S){l&&S.relatedTarget&&xn(S)&&(S.type==="focusin"?rs:Zl)(l)}return l.addEventListener("focusin",E,!0),l.addEventListener("focusout",E,!0),()=>{l.removeEventListener("focusin",E,!0),l.removeEventListener("focusout",E,!0)}},[l,b]),u.useEffect(()=>{!l||m||rs(l)},[m,l]);const v=u.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:g,beforeInsideRef:p,afterInsideRef:x,portalNode:l,setFocusManagerState:h}),[l]);return j.jsxs(u.Fragment,{children:[d,j.jsxs(Cr.Provider,{value:v,children:[w&&l&&j.jsx(Cn,{"data-type":"outside",ref:f,onFocus:E=>{if(xn(E,l))p.current?.focus();else{const S=y?y.domReference:null;ii(S)?.focus()}}}),w&&l&&j.jsx("span",{"aria-owns":l.id,style:Yc}),l&&Yt.createPortal(o,l),w&&l&&j.jsx(Cn,{"data-type":"outside",ref:g,onFocus:E=>{if(xn(E,l))x.current?.focus();else{const S=y?y.domReference:null;si(S)?.focus(),y?.closeOnFocusOut&&y?.onOpenChange(!1,ce(so,E.nativeEvent))}}})]})]})});process.env.NODE_ENV!=="production"&&(pi.displayName="FloatingPortal");function ha(e,t){const n=_e(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const us=20;let Mt=[];function wr(){Mt=Mt.filter(e=>e.deref()?.isConnected)}function ga(e){wr(),e&&Ft(e)!=="body"&&(Mt.push(new WeakRef(e)),Mt.length>us&&(Mt=Mt.slice(-us)))}function _o(){return wr(),Mt[Mt.length-1]?.deref()}function ba(e){if(!e)return null;const t=Rn();return oi(e,t)?e:fo(e,t)[0]||e}function xa(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():st(e).display!=="none"}function fs(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Rn(),r=Ql(e,n).filter(i=>{const c=i.getAttribute("data-tabindex")||"";return oi(i,n)||i.hasAttribute("data-tabindex")&&!c.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function ya(e){const{context:t,children:n,disabled:o=!1,initialFocus:r=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:c=!0,closeOnFocusOut:a=!0,openInteractionType:l="",nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:g,externalTree:p}=e,x="rootStore"in t?t.rootStore:t,y=x.useState("open"),h=x.useState("domReferenceElement"),b=x.useState("floatingElement"),{events:m,dataRef:w}=x.context,v=Y(()=>w.current.floatingContext?.nodeId),E=r===!1,S=Jo(h)&&E,R=u.useRef(["content"]),I=lt(r),G=lt(s),K=lt(l),q=po(p),D=di(),X=u.useRef(null),Z=u.useRef(null),B=u.useRef(!1),M=u.useRef(!1),U=u.useRef(!1),F=u.useRef(-1),J=u.useRef(""),ne=u.useRef(""),ye=u.useRef(null),ue=u.useRef(null),he=vn(ye,g,D?.beforeInsideRef),se=vn(ue,D?.afterInsideRef),pe=qt(),Me=qt(),Ie=fr(),we=D!=null,re=Qo(b),fe=Y((k=re)=>k?fo(k,Rn()):[]),xe=Y(k=>{const V=fe(k);return R.current.map(()=>V).filter(Boolean).flat()});u.useEffect(()=>{if(o||!c)return;function k(ie){ie.key==="Tab"&&me(re,Rt(Ne(re)))&&fe().length===0&&!S&&Ee(ie)}const V=Ne(re);return V.addEventListener("keydown",k),()=>{V.removeEventListener("keydown",k)}},[o,h,re,c,R,S,fe,xe]),u.useEffect(()=>{if(o||!y)return;const k=Ne(re);function V(){U.current=!1}function ie(L){const _=Ze(L),P=me(b,_)||me(h,_)||me(D?.portalNode,_);U.current=!P,ne.current=L.pointerType||"keyboard",_?.closest(`[${Kc}]`)&&(M.current=!0)}function C(){ne.current="keyboard"}return k.addEventListener("pointerdown",ie,!0),k.addEventListener("pointerup",V,!0),k.addEventListener("pointercancel",V,!0),k.addEventListener("keydown",C,!0),()=>{k.removeEventListener("pointerdown",ie,!0),k.removeEventListener("pointerup",V,!0),k.removeEventListener("pointercancel",V,!0),k.removeEventListener("keydown",C,!0)}},[o,b,h,re,y,D]),u.useEffect(()=>{if(o||!a)return;const k=Ne(re);function V(){M.current=!0,Me.start(0,()=>{M.current=!1})}function ie($){const T=Ze($),te=fe().indexOf(T);te!==-1&&(F.current=te)}function C($){const T=$.relatedTarget,W=$.currentTarget,te=Ze($);queueMicrotask(()=>{const ae=v(),De=x.context.triggerElements,Ke=T?.hasAttribute(no("focus-guard"))&&[ye.current,ue.current,D?.beforeInsideRef.current,D?.afterInsideRef.current,D?.beforeOutsideRef.current,D?.afterOutsideRef.current,wt(f),wt(d)].includes(T),Se=!(me(h,T)||me(b,T)||me(T,b)||me(D?.portalNode,T)||T!=null&&De.hasElement(T)||De.hasMatchingElement(ge=>me(ge,T))||Ke||q&&(en(q.nodesRef.current,ae).find(ge=>me(ge.context?.elements.floating,T)||me(ge.context?.elements.domReference,T))||Qr(q.nodesRef.current,ae).find(ge=>[ge.context?.elements.floating,Qo(ge.context?.elements.floating)].includes(T)||ge.context?.elements.domReference===T)));if(W===h&&re&&fs(re,R),i&&W!==h&&!xa(te)&&Rt(k)===k.body){if(ke(re)&&(re.focus(),i==="popup")){Ie.request(()=>{re.focus()});return}const ge=F.current,Ae=fe(),ze=Ae[ge]||Ae[Ae.length-1]||re;ke(ze)&&ze.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(S||!c)&&T&&Se&&!M.current&&(S||T!==_o())&&(B.current=!0,x.setOpen(!1,ce(so,$)))})}function L(){U.current||(w.current.insideReactTree=!0,pe.start(0,()=>{w.current.insideReactTree=!1}))}const _=ke(h)?h:null,P=[];if(!(!b&&!_))return _&&(_.addEventListener("focusout",C),_.addEventListener("pointerdown",V),P.push(()=>{_.removeEventListener("focusout",C),_.removeEventListener("pointerdown",V)})),b&&(b.addEventListener("focusin",ie),b.addEventListener("focusout",C),D&&(b.addEventListener("focusout",L,!0),P.push(()=>{b.removeEventListener("focusout",L,!0)})),P.push(()=>{b.removeEventListener("focusin",ie),b.removeEventListener("focusout",C)})),()=>{P.forEach($=>{$()})}},[o,h,b,re,c,q,D,x,a,i,fe,S,v,R,w,pe,Me,Ie,d,f]),u.useEffect(()=>{if(o||!b||!y)return;const k=Array.from(D?.portalNode?.querySelectorAll(`[${no("portal")}]`)||[]),ie=(q?Qr(q.nodesRef.current,v()):[]).find(L=>Jo(L.context?.elements.domReference||null))?.context?.elements.domReference,C=[b,ie,...k,X.current,Z.current,ye.current,ue.current,D?.beforeOutsideRef.current,D?.afterOutsideRef.current,wt(f),wt(d),S?h:null].filter(L=>L!=null);return da(C,c||S)},[y,o,h,b,c,R,D,S,q,v,d,f]),Q(()=>{if(!y||o||!ke(re))return;const k=Ne(re),V=Rt(k);queueMicrotask(()=>{const ie=xe(re),C=I.current,L=typeof C=="function"?C(K.current||""):C;if(L===void 0||L===!1)return;let _;L===!0||L===null?_=ie[0]||re:_=wt(L),_=_||ie[0]||re,!me(re,V)&&yn(_,{preventScroll:_===re})})},[o,y,re,E,xe,I,K]),Q(()=>{if(o||!re)return;const k=Ne(re),V=Rt(k);ga(V);function ie(_){if(_.open||(J.current=ha(_.nativeEvent,ne.current)),_.reason===el&&_.nativeEvent.type==="mouseleave"&&(B.current=!0),_.reason===lr)if(_.nested)B.current=!1;else if(Ks(_.nativeEvent)||zs(_.nativeEvent))B.current=!1;else{let P=!1;document.createElement("div").focus({get preventScroll(){return P=!0,!1}}),P?B.current=!1:B.current=!0}}m.on("openchange",ie);const C=k.createElement("span");C.setAttribute("tabindex","-1"),C.setAttribute("aria-hidden","true"),Object.assign(C.style,Er),we&&h&&h.insertAdjacentElement("afterend",C);function L(){const _=G.current;let P=typeof _=="function"?_(J.current):_;if(P===void 0||P===!1)return null;if(P===null&&(P=!0),typeof P=="boolean"){const T=h||_o();return T&&T.isConnected?T:C}const $=h||_o()||C;return wt(P)||$}return()=>{m.off("openchange",ie);const _=Rt(k),P=me(b,_)||q&&en(q.nodesRef.current,v(),!1).some(T=>me(T.context?.elements.floating,_)),$=L();queueMicrotask(()=>{const T=ba($),W=typeof G.current!="boolean";G.current&&!B.current&&ke(T)&&(!(!W&&T!==_&&_!==k.body)||P)&&T.focus({preventScroll:!0}),C.remove(),B.current=!1})}},[o,b,re,G,w,m,q,we,h,v]),Q(()=>{if(!Us||y||!b)return;const k=Rt(Ne(b));!ke(k)||!gr(k)||me(b,k)&&k.blur()},[y,b]),Q(()=>{if(!(o||!D))return D.setFocusManagerState({modal:c,closeOnFocusOut:a,open:y,onOpenChange:x.setOpen,domReference:h}),()=>{D.setFocusManagerState(null)}},[o,D,c,y,x,a,h]),Q(()=>{if(!(o||!re))return fs(re,R),()=>{queueMicrotask(wr)}},[o,re,R]);const O=!o&&(c?!S:!0)&&(we||c);return j.jsxs(u.Fragment,{children:[O&&j.jsx(Cn,{"data-type":"inside",ref:he,onFocus:k=>{if(c){const V=xe();yn(V[V.length-1])}else D?.portalNode&&(B.current=!1,xn(k,D.portalNode)?si(h)?.focus():wt(f??D.beforeOutsideRef)?.focus())}}),n,O&&j.jsx(Cn,{"data-type":"inside",ref:se,onFocus:k=>{c?yn(xe()[0]):D?.portalNode&&(a&&(B.current=!0),xn(k,D.portalNode)?ii(h)?.focus():wt(d??D.afterOutsideRef)?.focus())}})]})}function mi(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:r=!0,event:s="click",toggle:i=!0,ignoreMouse:c=!1,stickIfOpen:a=!0,touchOpenDelay:l=0,reason:d=Go}=t,f=u.useRef(void 0),g=fr(),p=qt(),x=u.useMemo(()=>({onPointerDown(y){f.current=y.pointerType},onMouseDown(y){const h=f.current,b=y.nativeEvent,m=n.select("open");if(y.button!==0||s==="click"||Zr(h)&&c)return;const w=o.current.openEvent,v=w?.type,E=n.select("domReferenceElement")!==y.currentTarget,S=m&&E||!(m&&i&&(!(w&&a)||v==="click"||v==="mousedown"));if(gr(b.target)){const I=ce(d,b,b.target);S&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,I)}):n.setOpen(S,I);return}const R=y.currentTarget;g.request(()=>{const I=ce(d,b,R);S&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,I)}):n.setOpen(S,I)})},onClick(y){if(s==="mousedown-only")return;const h=f.current;if(s==="mousedown"&&h){f.current=void 0;return}if(Zr(h)&&c)return;const b=n.select("open"),m=o.current.openEvent,w=n.select("domReferenceElement")!==y.currentTarget,v=b&&w||!(b&&i&&(!(m&&a)||Ys(m))),E=ce(d,y.nativeEvent,y.currentTarget);v&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,E)}):n.setOpen(v,E)},onKeyDown(){f.current=void 0}}),[o,s,c,n,a,i,g,p,l,d]);return u.useMemo(()=>r?{reference:x}:We,[r,x])}function ds(e,t,n){let{reference:o,floating:r}=e;const s=at(t),i=yr(t),c=xr(i),a=rt(t),l=s==="y",d=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,g=o[c]/2-r[c]/2;let p;switch(a){case"top":p={x:d,y:o.y-r.height};break;case"bottom":p={x:d,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-r.width,y:f};break;default:p={x:o.x,y:o.y}}switch(Bt(t)){case"start":p[i]-=g*(n&&l?-1:1);break;case"end":p[i]+=g*(n&&l?-1:1);break}return p}async function va(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:a}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=Ot(t,e),x=Xs(p),h=c[g?f==="floating"?"reference":"floating":f],b=Jn(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(h)))==null||n?h:h.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:d,strategy:a})),m=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),v=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},E=Jn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:m,offsetParent:w,strategy:a}):m);return{top:(b.top-E.top+x.top)/v.y,bottom:(E.bottom-b.bottom+x.bottom)/v.y,left:(b.left-E.left+x.left)/v.x,right:(E.right-b.right+x.right)/v.x}}const Ea=50,Ca=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:va},a=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=ds(l,o,a),g=o,p=0;const x={};for(let y=0;y<s.length;y++){const h=s[y];if(!h)continue;const{name:b,fn:m}=h,{x:w,y:v,data:E,reset:S}=await m({x:d,y:f,initialPlacement:o,placement:g,strategy:r,middlewareData:x,rects:l,platform:c,elements:{reference:e,floating:t}});d=w??d,f=v??f,x[b]={...x[b],...E},S&&p<Ea&&(p++,typeof S=="object"&&(S.placement&&(g=S.placement),S.rects&&(l=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):S.rects),{x:d,y:f}=ds(l,g,a)),y=-1)}return{x:d,y:f,placement:g,strategy:r,middlewareData:x}},wa=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:a,elements:l}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...h}=Ot(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=rt(r),m=at(c),w=rt(c)===c,v=await(a.isRTL==null?void 0:a.isRTL(l.floating)),E=g||(w||!y?[Xn(c)]:Pl(c)),S=x!=="none";!g&&S&&E.push(...kl(c,y,x,v));const R=[c,...E],I=await a.detectOverflow(t,h),G=[];let K=((o=s.flip)==null?void 0:o.overflows)||[];if(d&&G.push(I[b]),f){const Z=Ol(r,i,v);G.push(I[Z[0]],I[Z[1]])}if(K=[...K,{placement:r,overflows:G}],!G.every(Z=>Z<=0)){var q,D;const Z=(((q=s.flip)==null?void 0:q.index)||0)+1,B=R[Z];if(B&&(!(f==="alignment"?m!==at(B):!1)||K.every(F=>at(F.placement)===m?F.overflows[0]>0:!0)))return{data:{index:Z,overflows:K},reset:{placement:B}};let M=(D=K.filter(U=>U.overflows[0]<=0).sort((U,F)=>U.overflows[1]-F.overflows[1])[0])==null?void 0:D.placement;if(!M)switch(p){case"bestFit":{var X;const U=(X=K.filter(F=>{if(S){const J=at(F.placement);return J===m||J==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(J=>J>0).reduce((J,ne)=>J+ne,0)]).sort((F,J)=>F[1]-J[1])[0])==null?void 0:X[0];U&&(M=U);break}case"initialPlacement":M=c;break}if(r!==M)return{reset:{placement:M}}}return{}}}};function ps(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ms(e){return Il.some(t=>e[t]>=0)}const Ra=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=Ot(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),c=ps(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:ms(c)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),c=ps(i,n.floating);return{data:{escapedOffsets:c,escaped:ms(c)}}}default:return{}}}}},hi=new Set(["left","top"]);async function Ia(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=rt(n),c=Bt(n),a=at(n)==="y",l=hi.has(i)?-1:1,d=s&&a?-1:1,f=Ot(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof x=="number"&&(p=c==="end"?x*-1:x),a?{x:p*d,y:g*l}:{x:g*l,y:p*d}}const Sa=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=t,a=await Ia(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:s+a.y,data:{...a,placement:i}}}}},Oa=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:a={fn:b=>{let{x:m,y:w}=b;return{x:m,y:w}}},...l}=Ot(e,t),d={x:n,y:o},f=await s.detectOverflow(t,l),g=at(rt(r)),p=br(g);let x=d[p],y=d[g];if(i){const b=p==="y"?"top":"left",m=p==="y"?"bottom":"right",w=x+f[b],v=x-f[m];x=Zo(w,x,v)}if(c){const b=g==="y"?"top":"left",m=g==="y"?"bottom":"right",w=y+f[b],v=y-f[m];y=Zo(w,y,v)}const h=a.fn({...t,[p]:x,[g]:y});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[p]:i,[g]:c}}}}}},Pa=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:a=!0,crossAxis:l=!0}=Ot(e,t),d={x:n,y:o},f=at(r),g=br(f);let p=d[g],x=d[f];const y=Ot(c,t),h=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(a){const w=g==="y"?"height":"width",v=s.reference[g]-s.floating[w]+h.mainAxis,E=s.reference[g]+s.reference[w]-h.mainAxis;p<v?p=v:p>E&&(p=E)}if(l){var b,m;const w=g==="y"?"width":"height",v=hi.has(rt(r)),E=s.reference[f]-s.floating[w]+(v&&((b=i.offset)==null?void 0:b[f])||0)+(v?0:h.crossAxis),S=s.reference[f]+s.reference[w]+(v?0:((m=i.offset)==null?void 0:m[f])||0)-(v?h.crossAxis:0);x<E?x=E:x>S&&(x=S)}return{[g]:p,[f]:x}}}},Aa=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:c}=t,{apply:a=()=>{},...l}=Ot(e,t),d=await i.detectOverflow(t,l),f=rt(r),g=Bt(r),p=at(r)==="y",{width:x,height:y}=s.floating;let h,b;f==="top"||f==="bottom"?(h=f,b=g===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(b=f,h=g==="end"?"top":"bottom");const m=y-d.top-d.bottom,w=x-d.left-d.right,v=on(y-d[h],m),E=on(x-d[b],w),S=!t.middlewareData.shift;let R=v,I=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=w),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(R=m),S&&!g){const K=ot(d.left,0),q=ot(d.right,0),D=ot(d.top,0),X=ot(d.bottom,0);p?I=x-2*(K!==0||q!==0?K+q:ot(d.left,d.right)):R=y-2*(D!==0||X!==0?D+X:ot(d.top,d.bottom))}await a({...t,availableWidth:I,availableHeight:R});const G=await i.getDimensions(c.floating);return x!==G.width||y!==G.height?{reset:{rects:!0}}:{}}}};function gi(e){const t=st(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ke(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,c=Yn(n)!==s||Yn(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function Rr(e){return Ce(e)?e:e.contextElement}function nn(e){const t=Rr(e);if(!ke(t))return vt(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=gi(t);let i=(s?Yn(n.width):n.width)/o,c=(s?Yn(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Ta=vt(0);function bi(e){const t=_e(e);return!lo()||!t.visualViewport?Ta:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Na(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_e(e)?!1:t}function Kt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Rr(e);let i=vt(1);t&&(o?Ce(o)&&(i=nn(o)):i=nn(e));const c=Na(s,n,o)?bi(s):vt(0);let a=(r.left+c.x)/i.x,l=(r.top+c.y)/i.y,d=r.width/i.x,f=r.height/i.y;if(s){const g=_e(s),p=o&&Ce(o)?_e(o):o;let x=g,y=zo(x);for(;y&&o&&p!==x;){const h=nn(y),b=y.getBoundingClientRect(),m=st(y),w=b.left+(y.clientLeft+parseFloat(m.paddingLeft))*h.x,v=b.top+(y.clientTop+parseFloat(m.paddingTop))*h.y;a*=h.x,l*=h.y,d*=h.x,f*=h.y,a+=w,l+=v,x=_e(y),y=zo(x)}}return Jn({width:d,height:f,x:a,y:l})}function mo(e,t){const n=ao(e).scrollLeft;return t?t.left+n:Kt(Et(e)).left+n}function xi(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-mo(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function ka(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=Et(o),c=t?co(t.floating):!1;if(o===i||c&&s)return n;let a={scrollLeft:0,scrollTop:0},l=vt(1);const d=vt(0),f=ke(o);if((f||!f&&!s)&&((Ft(o)!=="body"||_t(i))&&(a=ao(o)),f)){const p=Kt(o);l=nn(o),d.x=p.x+o.clientLeft,d.y=p.y+o.clientTop}const g=i&&!f&&!s?xi(i,a):vt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+d.x+g.x,y:n.y*l.y-a.scrollTop*l.y+d.y+g.y}}function Ma(e){return Array.from(e.getClientRects())}function Da(e){const t=Et(e),n=ao(e),o=e.ownerDocument.body,r=ot(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=ot(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+mo(e);const c=-n.scrollTop;return st(o).direction==="rtl"&&(i+=ot(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:c}}const hs=25;function Va(e,t){const n=_e(e),o=Et(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,c=0,a=0;if(r){s=r.width,i=r.height;const d=lo();(!d||d&&t==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}const l=mo(o);if(l<=0){const d=o.ownerDocument,f=d.body,g=getComputedStyle(f),p=d.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,x=Math.abs(o.clientWidth-f.clientWidth-p);x<=hs&&(s-=x)}else l<=hs&&(s+=l);return{width:s,height:i,x:c,y:a}}function La(e,t){const n=Kt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=ke(e)?nn(e):vt(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,a=r*s.x,l=o*s.y;return{width:i,height:c,x:a,y:l}}function gs(e,t,n){let o;if(t==="viewport")o=Va(e,n);else if(t==="document")o=Da(Et(e));else if(Ce(t))o=La(t,n);else{const r=bi(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Jn(o)}function yi(e,t){const n=St(e);return n===t||!Ce(n)||It(n)?!1:st(n).position==="fixed"||yi(n,t)}function Fa(e,t){const n=t.get(e);if(n)return n;let o=Dt(e,[],!1).filter(c=>Ce(c)&&Ft(c)!=="body"),r=null;const s=st(e).position==="fixed";let i=s?St(e):e;for(;Ce(i)&&!It(i);){const c=st(i),a=pr(i);!a&&c.position==="fixed"&&(r=null),(s?!a&&!r:!a&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||_t(i)&&!a&&yi(e,i))?o=o.filter(d=>d!==i):r=c,i=St(i)}return t.set(e,o),o}function _a(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?co(t)?[]:Fa(t,this._c):[].concat(n),o],c=gs(t,i[0],r);let a=c.top,l=c.right,d=c.bottom,f=c.left;for(let g=1;g<i.length;g++){const p=gs(t,i[g],r);a=ot(p.top,a),l=on(p.right,l),d=on(p.bottom,d),f=ot(p.left,f)}return{width:l-f,height:d-a,x:f,y:a}}function Ba(e){const{width:t,height:n}=gi(e);return{width:t,height:n}}function ja(e,t,n){const o=ke(t),r=Et(t),s=n==="fixed",i=Kt(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=vt(0);function l(){a.x=mo(r)}if(o||!o&&!s)if((Ft(t)!=="body"||_t(r))&&(c=ao(t)),o){const p=Kt(t,!0,s,t);a.x=p.x+t.clientLeft,a.y=p.y+t.clientTop}else r&&l();s&&!o&&r&&l();const d=r&&!o&&!s?xi(r,c):vt(0),f=i.left+c.scrollLeft-a.x-d.x,g=i.top+c.scrollTop-a.y-d.y;return{x:f,y:g,width:i.width,height:i.height}}function Bo(e){return st(e).position==="static"}function bs(e,t){if(!ke(e)||st(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Et(e)===n&&(n=n.ownerDocument.body),n}function vi(e,t){const n=_e(e);if(co(e))return n;if(!ke(e)){let r=St(e);for(;r&&!It(r);){if(Ce(r)&&!Bo(r))return r;r=St(r)}return n}let o=bs(e,t);for(;o&&ul(o)&&Bo(o);)o=bs(o,t);return o&&It(o)&&Bo(o)&&!pr(o)?n:o||pl(e)||n}const $a=async function(e){const t=this.getOffsetParent||vi,n=this.getDimensions,o=await n(e.floating);return{reference:ja(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ha(e){return st(e).direction==="rtl"}const Ua={convertOffsetParentRelativeRectToViewportRelativeRect:ka,getDocumentElement:Et,getClippingRect:_a,getOffsetParent:vi,getElementRects:$a,getClientRects:Ma,getDimensions:Ba,getScale:nn,isElement:Ce,isRTL:Ha};function Ei(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Wa(e,t){let n=null,o;const r=Et(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function i(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),s();const l=e.getBoundingClientRect(),{left:d,top:f,width:g,height:p}=l;if(c||t(),!g||!p)return;const x=Zt(f),y=Zt(r.clientWidth-(d+g)),h=Zt(r.clientHeight-(f+p)),b=Zt(d),w={rootMargin:-x+"px "+-y+"px "+-h+"px "+-b+"px",threshold:ot(0,on(1,a))||1};let v=!0;function E(S){const R=S[0].intersectionRatio;if(R!==a){if(!v)return i();R?i(!1,R):o=setTimeout(()=>{i(!1,1e-7)},1e3)}R===1&&!Ei(l,e.getBoundingClientRect())&&i(),v=!1}try{n=new IntersectionObserver(E,{...w,root:r.ownerDocument})}catch{n=new IntersectionObserver(E,w)}n.observe(e)}return i(!0),s}function xs(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=Rr(e),d=r||s?[...l?Dt(l):[],...t?Dt(t):[]]:[];d.forEach(b=>{r&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const f=l&&c?Wa(l,n):null;let g=-1,p=null;i&&(p=new ResizeObserver(b=>{let[m]=b;m&&m.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),l&&!a&&p.observe(l),t&&p.observe(t));let x,y=a?Kt(e):null;a&&h();function h(){const b=Kt(e);y&&!Ei(y,b)&&n(),y=b,x=requestAnimationFrame(h)}return n(),()=>{var b;d.forEach(m=>{r&&m.removeEventListener("scroll",n),s&&m.removeEventListener("resize",n)}),f?.(),(b=p)==null||b.disconnect(),p=null,a&&cancelAnimationFrame(x)}}const Ga=Sa,qa=Oa,Ka=wa,za=Aa,Ya=Ra,Xa=Pa,Ja=(e,t,n)=>{const o=new Map,r={platform:Ua,...n},s={...r.platform,_c:o};return Ca(e,t,{...r,platform:s})};var Qa=typeof document<"u",Za=function(){},qn=Qa?Ge.useLayoutEffect:Za;function oo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!oo(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!oo(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ci(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ys(e,t){const n=Ci(e);return Math.round(t*n)/n}function jo(e){const t=u.useRef(e);return qn(()=>{t.current=e}),t}function eu(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:a,open:l}=e,[d,f]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=u.useState(o);oo(g,o)||p(o);const[x,y]=u.useState(null),[h,b]=u.useState(null),m=u.useCallback(F=>{F!==S.current&&(S.current=F,y(F))},[]),w=u.useCallback(F=>{F!==R.current&&(R.current=F,b(F))},[]),v=s||x,E=i||h,S=u.useRef(null),R=u.useRef(null),I=u.useRef(d),G=a!=null,K=jo(a),q=jo(r),D=jo(l),X=u.useCallback(()=>{if(!S.current||!R.current)return;const F={placement:t,strategy:n,middleware:g};q.current&&(F.platform=q.current),Ja(S.current,R.current,F).then(J=>{const ne={...J,isPositioned:D.current!==!1};Z.current&&!oo(I.current,ne)&&(I.current=ne,Yt.flushSync(()=>{f(ne)}))})},[g,t,n,q,D]);qn(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(F=>({...F,isPositioned:!1})))},[l]);const Z=u.useRef(!1);qn(()=>(Z.current=!0,()=>{Z.current=!1}),[]),qn(()=>{if(v&&(S.current=v),E&&(R.current=E),v&&E){if(K.current)return K.current(v,E,X);X()}},[v,E,X,K,G]);const B=u.useMemo(()=>({reference:S,floating:R,setReference:m,setFloating:w}),[m,w]),M=u.useMemo(()=>({reference:v,floating:E}),[v,E]),U=u.useMemo(()=>{const F={position:n,left:0,top:0};if(!M.floating)return F;const J=ys(M.floating,d.x),ne=ys(M.floating,d.y);return c?{...F,transform:"translate("+J+"px, "+ne+"px)",...Ci(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:ne}},[n,c,M.floating,d.x,d.y]);return u.useMemo(()=>({...d,update:X,refs:B,elements:M,floatingStyles:U}),[d,X,B,M,U])}const tu=(e,t)=>{const n=Ga(e);return{name:n.name,fn:n.fn,options:[e,t]}},nu=(e,t)=>{const n=qa(e);return{name:n.name,fn:n.fn,options:[e,t]}},ou=(e,t)=>({fn:Xa(e).fn,options:[e,t]}),ru=(e,t)=>{const n=Ka(e);return{name:n.name,fn:n.fn,options:[e,t]}},su=(e,t)=>{const n=za(e);return{name:n.name,fn:n.fn,options:[e,t]}},iu=(e,t)=>{const n=Ya(e);return{name:n.name,fn:n.fn,options:[e,t]}},cu={intentional:"onClick",sloppy:"onPointerDown"};function lu(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function au(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:c,dataRef:a}=n.context,{enabled:l=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:g="sloppy",referencePress:p=!1,referencePressEvent:x="sloppy",ancestorScroll:y=!1,bubbles:h,externalTree:b}=t,m=po(b),w=Y(typeof f=="function"?f:()=>!1),v=typeof f=="function"?w:f,E=u.useRef(!1),{escapeKey:S,outsidePress:R}=lu(h),I=u.useRef(null),G=qt(),K=qt(),q=Y(()=>{K.clear(),a.current.insideReactTree=!1}),D=u.useRef(!1),X=u.useRef(""),Z=Y(O=>{X.current=O.pointerType}),B=Y(()=>{const O=X.current,k=O==="pen"||!O?"mouse":O,V=typeof g=="function"?g():g;return typeof V=="string"?V:V[k]}),M=Y(O=>{if(!o||!l||!d||O.key!=="Escape"||D.current)return;const k=a.current.floatingContext?.nodeId,V=m?en(m.nodesRef.current,k):[];if(!S&&V.length>0){let L=!0;if(V.forEach(_=>{_.context?.open&&!_.context.dataRef.current.__escapeKeyBubbles&&(L=!1)}),!L)return}const ie=Rl(O)?O.nativeEvent:O,C=ce(Ds,ie);n.setOpen(!1,C),!S&&!C.isPropagationAllowed&&O.stopPropagation()}),U=Y(O=>{const k=B();return k==="intentional"&&O.type!=="click"||k==="sloppy"&&O.type==="click"}),F=Y(()=>{a.current.insideReactTree=!0,K.start(0,q)}),J=Y((O,k=!1)=>{if(U(O)){q();return}if(a.current.insideReactTree){q();return}if(B()==="intentional"&&k||typeof v=="function"&&!v(O))return;const V=Ze(O),ie=`[${no("inert")}]`,C=Ne(n.select("floatingElement")).querySelectorAll(ie),L=n.context.triggerElements;if(V&&(L.hasElement(V)||L.hasMatchingElement(W=>me(W,V))))return;let _=Ce(V)?V:null;for(;_&&!It(_);){const W=St(_);if(It(W)||!Ce(W))break;_=W}if(C.length&&Ce(V)&&!wl(V)&&!me(V,n.select("floatingElement"))&&Array.from(C).every(W=>!me(_,W)))return;if(ke(V)&&!("touches"in O)){const W=It(V),te=st(V),ae=/auto|scroll/,De=W||ae.test(te.overflowX),Ke=W||ae.test(te.overflowY),Se=De&&V.clientWidth>0&&V.scrollWidth>V.clientWidth,ge=Ke&&V.clientHeight>0&&V.scrollHeight>V.clientHeight,Ae=te.direction==="rtl",ze=ge&&(Ae?O.offsetX<=V.offsetWidth-V.clientWidth:O.offsetX>V.clientWidth),Ue=Se&&O.offsetY>V.clientHeight;if(ze||Ue)return}const P=a.current.floatingContext?.nodeId,$=m&&en(m.nodesRef.current,P).some(W=>gt(O,W.context?.elements.floating));if(gt(O,n.select("floatingElement"))||gt(O,n.select("domReferenceElement"))||$)return;const T=m?en(m.nodesRef.current,P):[];if(T.length>0){let W=!0;if(T.forEach(te=>{te.context?.open&&!te.context.dataRef.current.__outsidePressBubbles&&(W=!1)}),!W)return}n.setOpen(!1,ce(lr,O)),q()}),ne=Y(O=>{B()!=="sloppy"||O.pointerType==="touch"||!n.select("open")||!l||gt(O,n.select("floatingElement"))||gt(O,n.select("domReferenceElement"))||J(O)}),ye=Y(O=>{if(B()!=="sloppy"||!n.select("open")||!l||gt(O,n.select("floatingElement"))||gt(O,n.select("domReferenceElement")))return;const k=O.touches[0];k&&(I.current={startTime:Date.now(),startX:k.clientX,startY:k.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},G.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}),ue=Y(O=>{const k=Ze(O);function V(){ye(O),k?.removeEventListener(O.type,V)}k?.addEventListener(O.type,V)}),he=Y(O=>{const k=E.current;if(E.current=!1,G.clear(),O.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const V=Ze(O);function ie(){O.type==="pointerdown"?ne(O):J(O,k),V?.removeEventListener(O.type,ie)}V?.addEventListener(O.type,ie)}),se=Y(O=>{if(B()!=="sloppy"||!I.current||gt(O,n.select("floatingElement"))||gt(O,n.select("domReferenceElement")))return;const k=O.touches[0];if(!k)return;const V=Math.abs(k.clientX-I.current.startX),ie=Math.abs(k.clientY-I.current.startY),C=Math.sqrt(V*V+ie*ie);C>5&&(I.current.dismissOnTouchEnd=!0),C>10&&(J(O),G.clear(),I.current=null)}),pe=Y(O=>{const k=Ze(O);function V(){se(O),k?.removeEventListener(O.type,V)}k?.addEventListener(O.type,V)}),Me=Y(O=>{B()!=="sloppy"||!I.current||gt(O,n.select("floatingElement"))||gt(O,n.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&J(O),G.clear(),I.current=null)}),Ie=Y(O=>{const k=Ze(O);function V(){Me(O),k?.removeEventListener(O.type,V)}k?.addEventListener(O.type,V)});u.useEffect(()=>{if(!o||!l)return;a.current.__escapeKeyBubbles=S,a.current.__outsidePressBubbles=R;const O=new sn;function k(_){n.setOpen(!1,ce(ct,_))}function V(){O.clear(),D.current=!0}function ie(){O.start(lo()?5:0,()=>{D.current=!1})}const C=Ne(r);C.addEventListener("pointerdown",Z,!0),d&&(C.addEventListener("keydown",M),C.addEventListener("compositionstart",V),C.addEventListener("compositionend",ie)),v&&(C.addEventListener("click",he,!0),C.addEventListener("pointerdown",he,!0),C.addEventListener("touchstart",ue,!0),C.addEventListener("touchmove",pe,!0),C.addEventListener("touchend",Ie,!0),C.addEventListener("mousedown",he,!0));let L=[];return y&&(Ce(i)&&(L=Dt(i)),Ce(r)&&(L=L.concat(Dt(r))),!Ce(s)&&s&&s.contextElement&&(L=L.concat(Dt(s.contextElement)))),L=L.filter(_=>_!==C.defaultView?.visualViewport),L.forEach(_=>{_.addEventListener("scroll",k,{passive:!0})}),()=>{C.removeEventListener("pointerdown",Z,!0),d&&(C.removeEventListener("keydown",M),C.removeEventListener("compositionstart",V),C.removeEventListener("compositionend",ie)),v&&(C.removeEventListener("click",he,!0),C.removeEventListener("pointerdown",he,!0),C.removeEventListener("touchstart",ue,!0),C.removeEventListener("touchmove",pe,!0),C.removeEventListener("touchend",Ie,!0),C.removeEventListener("mousedown",he,!0)),L.forEach(_=>{_.removeEventListener("scroll",k)}),O.clear(),E.current=!1}},[a,r,s,i,d,v,o,c,y,l,S,R,M,J,he,ne,ue,pe,Ie,Z,n]),u.useEffect(q,[v,q]);const we=u.useMemo(()=>({onKeyDown:M,...p&&{[cu[x]]:O=>{n.setOpen(!1,ce(Go,O.nativeEvent))},...x!=="intentional"&&{onClick(O){n.setOpen(!1,ce(Go,O.nativeEvent))}}}}),[M,n,p,x]),re=Y(O=>{const k=Ze(O.nativeEvent);!me(n.select("floatingElement"),k)||O.button!==0||(E.current=!0)}),fe=Y(O=>{!o||!l||O.button!==0||(E.current=!0)}),xe=u.useMemo(()=>({onKeyDown:M,onPointerDown:re,onMouseDown:re,onMouseUp:re,onClickCapture:F,onMouseDownCapture(O){F(),fe(O)},onPointerDownCapture(O){F(),fe(O)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[M,re,F,fe]);return u.useMemo(()=>l?{reference:we,floating:xe,trigger:we}:{},[l,we,xe])}Kn.createSelectorCreator({memoize:Kn.lruMemoize,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const z=(e,t,n,o,r,s,...i)=>{if(i.length>0)throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of selectors":bt(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var uu=Kn.requireShim();const fu=cr(19),du=fu?mu:hu;function A(e,t,n,o,r){return du(e,t,n,o,r)}function pu(e,t,n,o,r){const s=u.useCallback(()=>t(e.getSnapshot(),n,o,r),[e,t,n,o,r]);return uu.useSyncExternalStore(e.subscribe,s,s)}function mu(e,t,n,o,r){return pu(e,t,n,o,r)}function hu(e,t,n,o,r){return Kn.withSelectorExports.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,o,r))}class wi{constructor(t){Pe(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Pe(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const o of this.listeners){if(n!==this.updateTick)return;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,o,r){return A(this,t,n,o,r)}}class gu extends wi{constructor(t,n={},o){super(t),this.context=n,this.selectors=o}useSyncedValue(t,n){u.useDebugValue(t),Q(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const o=this;Q(()=>(o.state[t]!==n&&o.set(t,n),()=>{o.set(t,void 0)}),[o,t,n])}useSyncedValues(t){const n=this;if(process.env.NODE_ENV!=="production"){u.useDebugValue(t,i=>Object.keys(i));const r=u.useRef(Object.keys(t)).current,s=Object.keys(t);(r.length!==s.length||r.some((i,c)=>i!==s[c]))&&console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.")}const o=Object.values(t);Q(()=>{n.update(t)},[n,...o])}useControlledProp(t,n){u.useDebugValue(t);const o=n!==void 0;if(Q(()=>{o&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,o]),process.env.NODE_ENV!=="production"){const r=this.controlledValues??(this.controlledValues=new Map);r.has(t)||r.set(t,o);const s=r.get(t);s!==void 0&&s!==o&&console.error(`A component is changing the ${o?"":"un"}controlled state of ${t.toString()} to be ${o?"un":""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}}select(t,n,o,r){const s=this.selectors[t];return s(this.state,n,o,r)}useState(t,n,o,r){return u.useDebugValue(t),A(this,this.selectors[t],n,o,r)}useContextCallback(t,n){u.useDebugValue(t);const o=Y(n??Re);this.context[t]=o}useStateSetter(t){const n=u.useRef(void 0);return n.current===void 0&&(n.current=o=>{this.set(t,o)}),n.current}observe(t,n){let o;typeof t=="function"?o=t:o=this.selectors[t];let r=o(this.state);return n(r,r,this),this.subscribe(s=>{const i=o(s);if(!Object.is(r,i)){const c=r;r=i,n(i,c,this)}})}}const bu={open:z(e=>e.open),domReferenceElement:z(e=>e.domReferenceElement),referenceElement:z(e=>e.positionReference??e.referenceElement),floatingElement:z(e=>e.floatingElement),floatingId:z(e=>e.floatingId)};class xu extends gu{constructor(n){const{nested:o,noEmit:r,onOpenChange:s,triggerElements:i,...c}=n;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:la(),nested:o,noEmit:r,triggerElements:i},bu);Pe(this,"setOpen",(n,o)=>{if((!n||!this.state.open||Ys(o.event))&&(this.context.dataRef.current.openEvent=n?o.event:void 0),!this.context.noEmit){const r={open:n,reason:o.reason,nativeEvent:o.event,nested:this.context.nested,triggerElement:o.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(n,o)})}}class yu{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const o=this.idMap.get(t);if(o!==n&&(o!==void 0&&this.elementsSet.delete(o),this.elementsSet.add(n),this.idMap.set(t,n),process.env.NODE_ENV!=="production"&&this.elementsSet.size!==this.idMap.size))throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.")}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function Ri(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,r=ar(),s=ai()!=null;if(process.env.NODE_ENV!=="production"){const c=o.reference;c&&!Ce(c)&&console.error("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `context.setPositionReference()`","instead.")}const i=ut(()=>new xu({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:new yu,floatingId:r,nested:s,noEmit:!1})).current;return Q(()=>{const c={open:t,floatingId:r};o.reference!==void 0&&(c.referenceElement=o.reference,c.domReferenceElement=Ce(o.reference)?o.reference:null),o.floating!==void 0&&(c.floatingElement=o.floating),i.update(c)},[t,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=!1,i}function vu(e={}){const{nodeId:t,externalTree:n}=e,o=Ri(e),r=e.rootContext||o,s={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,c]=u.useState(null),a=u.useRef(null),l=po(n);Q(()=>{s.domReference&&(a.current=s.domReference)},[s.domReference]);const d=eu({...e,elements:{...s,...i&&{reference:i}}}),f=u.useCallback(R=>{const I=Ce(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;c(I),d.refs.setReference(I)},[d.refs]),[g,p]=u.useState(null),[x,y]=u.useState(null);r.useSyncedValue("referenceElement",g),r.useSyncedValue("domReferenceElement",Ce(g)?g:null),r.useSyncedValue("floatingElement",x);const h=u.useCallback(R=>{(Ce(R)||R===null)&&(a.current=R,p(R)),(Ce(d.refs.reference.current)||d.refs.reference.current===null||R!==null&&!Ce(R))&&d.refs.setReference(R)},[d.refs,p]),b=u.useCallback(R=>{y(R),d.refs.setFloating(R)},[d.refs]),m=u.useMemo(()=>({...d.refs,setReference:h,setFloating:b,setPositionReference:f,domReference:a}),[d.refs,h,b,f]),w=u.useMemo(()=>({...d.elements,domReference:s.domReference}),[d.elements,s.domReference]),v=r.useState("open"),E=r.useState("floatingId"),S=u.useMemo(()=>({...d,dataRef:r.context.dataRef,open:v,onOpenChange:r.setOpen,events:r.context.events,floatingId:E,refs:m,elements:w,nodeId:t,rootStore:r}),[d,m,w,t,r,v,E]);return Q(()=>{r.context.dataRef.current.floatingContext=S;const R=l?.nodesRef.current.find(I=>I.id===t);R&&(R.context=S)}),u.useMemo(()=>({...d,context:S,refs:m,elements:w,rootStore:r}),[d,m,w,S,r])}function Eu(e=[]){const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=e.map(l=>l?.trigger),s=u.useCallback(l=>jn(l,e,"reference"),t),i=u.useCallback(l=>jn(l,e,"floating"),n),c=u.useCallback(l=>jn(l,e,"item"),o),a=u.useCallback(l=>jn(l,e,"trigger"),r);return u.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:c,getTriggerProps:a}),[s,i,c,a])}function jn(e,t,n){const o=new Map,r=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Xo]="");for(const i in e)r&&e&&(i===Gs||i===qs)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let c;const a=t[i]?.[n];typeof a=="function"?c=e?a(e):null:c=a,c&&vs(s,c,r,o)}return vs(s,e,r,o),s}function vs(e,t,n,o){for(const r in t){const s=t[r];n&&(r===Gs||r===qs)||(r.startsWith("on")?(o.has(r)||o.set(r,[]),typeof s=="function"&&(o.get(r)?.push(s),e[r]=(...i)=>o.get(r)?.map(c=>c(...i)).find(c=>c!==void 0))):e[r]=s)}}const Cu="Escape";function ho(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function $n(e,t){return ho(t,e===hr||e===wn,e===Vt||e===Lt)}function $o(e,t,n){return ho(t,e===wn,n?e===Vt:e===Lt)||e==="Enter"||e===" "||e===""}function wu(e,t,n){return ho(t,n?e===Vt:e===Lt,e===wn)}function Ru(e,t,n,o){const r=n?e===Lt:e===Vt,s=e===hr;return t==="both"||t==="horizontal"&&o&&o>1?e===Cu:ho(t,r,s)}function Iu(e,t){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),i=n.context.dataRef,{listRef:c,activeIndex:a,onNavigate:l=()=>{},enabled:d=!0,selectedIndex:f=null,allowEscape:g=!1,loopFocus:p=!1,nested:x=!1,rtl:y=!1,virtual:h=!1,focusItemOnOpen:b="auto",focusItemOnHover:m=!0,openOnArrowKeyDown:w=!0,disabledIndices:v=void 0,orientation:E="vertical",parentOrientation:S,cols:R=1,id:I,resetOnPointerLeave:G=!0,externalTree:K}=t;process.env.NODE_ENV!=="production"&&(g&&(p||console.warn("`useListNavigation` looping must be enabled to allow escaping."),h||console.warn("`useListNavigation` must be virtual to allow escaping.")),E==="vertical"&&R>1&&console.warn("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const q=Qo(r),D=lt(q),X=ai(),Z=po(K);Q(()=>{i.current.orientation=E},[i,E]);const B=Jo(s),M=u.useRef(b),U=u.useRef(f??-1),F=u.useRef(null),J=u.useRef(!0),ne=Y(P=>{l(U.current===-1?null:U.current,P)}),ye=u.useRef(ne),ue=u.useRef(!!r),he=u.useRef(o),se=u.useRef(!1),pe=u.useRef(!1),Me=lt(v),Ie=lt(o),we=lt(f),re=lt(G),fe=Y(()=>{function P(te){h?Z?.events.emit("virtualfocus",te):yn(te,{sync:se.current,preventScroll:!0})}const $=c.current[U.current],T=pe.current;$&&P($),(se.current?te=>te():requestAnimationFrame)(()=>{const te=c.current[U.current]||$;if(!te)return;$||P(te),O&&(T||!J.current)&&te.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Q(()=>{d&&(o&&r?(U.current=f??-1,M.current&&f!=null&&(pe.current=!0,ne())):ue.current&&(U.current=-1,ye.current()))},[d,o,r,f,ne]),Q(()=>{if(d){if(!o){se.current=!1;return}if(r)if(a==null){if(se.current=!1,we.current!=null)return;if(ue.current&&(U.current=-1,fe()),(!he.current||!ue.current)&&M.current&&(F.current!=null||M.current===!0&&F.current==null)){let P=0;const $=()=>{c.current[0]==null?(P<2&&(P?requestAnimationFrame:queueMicrotask)($),P+=1):(U.current=F.current==null||$o(F.current,E,y)||x?Lo(c):ns(c),F.current=null,ne())};$()}}else gn(c,a)||(U.current=a,fe(),pe.current=!1)}},[d,o,r,a,we,x,c,E,y,ne,fe,Me]),Q(()=>{if(!d||r||!Z||h||!ue.current)return;const P=Z.nodesRef.current,$=P.find(te=>te.id===X)?.context?.elements.floating,T=Rt(Ne(r)),W=P.some(te=>te.context&&me(te.context.elements.floating,T));$&&!W&&J.current&&$.focus({preventScroll:!0})},[d,r,Z,X,h]),Q(()=>{ye.current=ne,he.current=o,ue.current=!!r}),Q(()=>{o||(F.current=null,M.current=b)},[o,b]);const xe=a!=null,O=u.useMemo(()=>{function P(T){if(!Ie.current)return;const W=c.current.indexOf(T.currentTarget);W!==-1&&U.current!==W&&(U.current=W,ne(T))}return{onFocus(T){se.current=!0,P(T)},onClick:({currentTarget:T})=>T.focus({preventScroll:!0}),onMouseMove(T){se.current=!0,pe.current=!1,m&&P(T)},onPointerLeave(T){if(!Ie.current||!J.current||T.pointerType==="touch")return;se.current=!0;const W=T.relatedTarget;!m||c.current.includes(W)||re.current&&(yn(null,{sync:!0}),U.current=-1,ne(T),h||D.current?.focus({preventScroll:!0}))}}},[Ie,D,m,c,ne,re,h]),k=u.useCallback(()=>S??Z?.nodesRef.current.find(P=>P.id===X)?.context?.dataRef?.current.orientation,[X,Z,S]),V=Y(P=>{if(J.current=!1,se.current=!0,P.which===229||!Ie.current&&P.currentTarget===D.current)return;if(x&&Ru(P.key,E,y,R)){$n(P.key,k())||Ee(P),n.setOpen(!1,ce(hn,P.nativeEvent)),ke(s)&&(h?Z?.events.emit("virtualfocus",s):s.focus());return}const $=U.current,T=Lo(c,v),W=ns(c,v);if(B||(P.key==="Home"&&(Ee(P),U.current=T,ne(P)),P.key==="End"&&(Ee(P),U.current=W,ne(P))),R>1){const te=Array.from({length:c.current.length},()=>({width:1,height:1})),ae=Vl(te,R),De=ae.findIndex(ge=>ge!=null&&!bn(c,ge,v)),Ke=ae.reduce((ge,Ae,ze)=>Ae!=null&&!bn(c,Ae,v)?ze:ge,-1),Se=ae[Dl({current:ae.map(ge=>ge!=null?c.current[ge]:null)},{event:P,orientation:E,loopFocus:p,rtl:y,cols:R,disabledIndices:Fl([...(typeof v!="function"?v:null)||c.current.map((ge,Ae)=>bn(c,Ae,v)?Ae:void 0),void 0],ae),minIndex:De,maxIndex:Ke,prevIndex:Ll(U.current>W?T:U.current,te,ae,R,P.key===wn?"bl":P.key===(y?Vt:Lt)?"tr":"tl"),stopEvent:!0})];if(Se!=null&&(U.current=Se,ne(P)),E==="both")return}if($n(P.key,E)){if(Ee(P),o&&!h&&Rt(P.currentTarget.ownerDocument)===P.currentTarget){U.current=$o(P.key,E,y)?T:W,ne(P);return}$o(P.key,E,y)?p?$>=W?g&&$!==c.current.length?U.current=-1:(se.current=!1,U.current=T):U.current=$e(c,{startingIndex:$,disabledIndices:v}):U.current=Math.min(W,$e(c,{startingIndex:$,disabledIndices:v})):p?$<=T?g&&$!==-1?U.current=c.current.length:(se.current=!1,U.current=W):U.current=$e(c,{startingIndex:$,decrement:!0,disabledIndices:v}):U.current=Math.max(T,$e(c,{startingIndex:$,decrement:!0,disabledIndices:v})),gn(c,U.current)&&(U.current=-1),ne(P)}}),ie=u.useMemo(()=>h&&o&&xe&&{"aria-activedescendant":`${I}-${a}`},[h,o,xe,I,a]),C=u.useMemo(()=>({"aria-orientation":E==="both"?void 0:E,...B?{}:ie,onKeyDown(P){if(P.key==="Tab"&&P.shiftKey&&o&&!h){const $=Ze(P.nativeEvent);if($&&!me(D.current,$))return;Ee(P),n.setOpen(!1,ce(so,P.nativeEvent)),ke(s)&&s.focus();return}V(P)},onPointerMove(){J.current=!0}}),[ie,V,D,E,B,n,o,h,s]),L=u.useMemo(()=>{function P(T){b==="auto"&&Ks(T.nativeEvent)&&(M.current=!h)}function $(T){M.current=b,b==="auto"&&zs(T.nativeEvent)&&(M.current=!0)}return{onKeyDown(T){const W=n.select("open");J.current=!1;const te=T.key.startsWith("Arrow"),ae=wu(T.key,k(),y),De=$n(T.key,E),Ke=(x?ae:De)||T.key==="Enter"||T.key.trim()==="";if(h&&W)return V(T);if(!(!W&&!w&&te)){if(Ke){const Se=$n(T.key,k());F.current=x&&Se?null:T.key}if(x){ae&&(Ee(T),W?(U.current=Lo(c,Me.current),ne(T)):n.setOpen(!0,ce(hn,T.nativeEvent,T.currentTarget)));return}De&&(we.current!=null&&(U.current=we.current),Ee(T),!W&&w?n.setOpen(!0,ce(hn,T.nativeEvent,T.currentTarget)):V(T),W&&ne(T))}},onFocus(T){n.select("open")&&!h&&(U.current=-1,ne(T))},onPointerDown:$,onPointerEnter:$,onMouseDown:P,onClick:P}},[V,Me,b,c,x,ne,n,w,E,k,y,we,h]),_=u.useMemo(()=>({...ie,...L}),[ie,L]);return u.useMemo(()=>d?{reference:_,floating:C,item:O,trigger:L}:{},[d,_,C,L,O])}function Su(e,t){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,r=n.useState("open"),{listRef:s,activeIndex:i,onMatch:c,onTypingChange:a,enabled:l=!0,resetMs:d=750,selectedIndex:f=null}=t,g=qt(),p=u.useRef(""),x=u.useRef(f??i??-1),y=u.useRef(null);Q(()=>{!r&&f!==null||(g.clear(),y.current=null,p.current!==""&&(p.current=""))},[r,f,g]),Q(()=>{r&&p.current===""&&(x.current=f??i??-1)},[r,f,i]);const h=Y(E=>{E?o.current.typing||(o.current.typing=E,a?.(E)):o.current.typing&&(o.current.typing=E,a?.(E))}),b=Y(E=>{function S(D,X,Z){const B=X.find(M=>M?.toLocaleLowerCase().indexOf(Z.toLocaleLowerCase())===0);return B?D.indexOf(B):-1}const R=s.current;if(p.current.length>0&&p.current[0]!==" "&&(S(R,R,p.current)===-1?h(!1):E.key===" "&&Ee(E)),R==null||E.key.length!==1||E.ctrlKey||E.metaKey||E.altKey)return;r&&E.key!==" "&&(Ee(E),h(!0));const I=p.current==="";I&&(x.current=f??i??-1),R.every(D=>D?D[0]?.toLocaleLowerCase()!==D[1]?.toLocaleLowerCase():!0)&&p.current===E.key&&(p.current="",x.current=y.current),p.current+=E.key,g.start(d,()=>{p.current="",x.current=y.current,h(!1)});const K=I?f??i??-1:x.current,q=S(R,[...R.slice((K||0)+1),...R.slice(0,(K||0)+1)],p.current);q!==-1?(c?.(q),y.current=q):E.key!==" "&&(p.current="",h(!1))}),m=Y(E=>{const S=E.relatedTarget,R=n.select("domReferenceElement"),I=n.select("floatingElement"),G=me(R,S),K=me(I,S);G||K||(g.clear(),p.current="",x.current=y.current,h(!1))}),w=u.useMemo(()=>({onKeyDown:b,onBlur:m}),[b,m]),v=u.useMemo(()=>({onKeyDown:b,onKeyUp(E){E.key===" "&&h(!1)},onBlur:m}),[b,m,h]);return u.useMemo(()=>l?{reference:w,floating:v}:{},[l,w,v])}function Ou(e){const t=u.useRef(""),n=u.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:u.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function Pu(e){const[t,n]=u.useState(null),o=Y((c,a)=>{e||n(a||(Ws?"touch":""))}),r=u.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=Ou(o);return u.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:s,onPointerDown:i}}),[t,r,s,i])}let Ir=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=En.startingStyle]="startingStyle",e[e.endingStyle=En.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),or=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const Au={[or.popupOpen]:""},Tu={[or.popupOpen]:"",[or.pressed]:""},Nu={[Ir.open]:""},ku={[Ir.closed]:""},Mu={[Ir.anchorHidden]:""},Du={open(e){return e?Au:null}},Vu={open(e){return e?Tu:null}},Ii={open(e){return e?Nu:ku},anchorHidden(e){return e?Mu:null}};function Lu(e){return cr(19)?e:e?"true":void 0}const Si=u.forwardRef(function(t,n){const{cutout:o,...r}=t;let s;if(o){const i=o?.getBoundingClientRect();s=`polygon(
5
5
  0% 0%,
6
6
  100% 0%,
7
7
  100% 100%,
@@ -12,5 +12,5 @@
12
12
  ${i.right}px ${i.bottom}px,
13
13
  ${i.right}px ${i.top}px,
14
14
  ${i.left}px ${i.top}px
15
- )`}return j.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});process.env.NODE_ENV!=="production"&&(Si.displayName="InternalBackdrop");function Fu(e){const t=a.useRef(!0);t.current&&(t.current=!1,e())}const Sr=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Sr.displayName="ComboboxRootContext");const Or=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Or.displayName="ComboboxFloatingContext");const Pr=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Pr.displayName="ComboboxDerivedItemsContext");const Ar=a.createContext("");process.env.NODE_ENV!=="production"&&(Ar.displayName="ComboboxInputValueContext");function st(){const e=a.useContext(Sr);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.":gt(22));return e}function go(){const e=a.useContext(Or);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.":gt(23));return e}function Bt(){const e=a.useContext(Pr);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.":gt(24));return e}function Tr(){return a.useContext(Ar)}const _u=(e,t)=>Object.is(e,t);function Kt(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Bu(e,t,n){return!e||e.length===0?!1:e.some(o=>o===void 0?!1:Kt(t,o,n))}function ro(e,t,n){return!e||e.length===0?-1:e.findIndex(o=>o===void 0?!1:Kt(o,t,n))}function ju(e,t,n){return e.filter(o=>!Kt(t,o,n))}function rr(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Nr(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function $u(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(Nr(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function Je(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return rr(e)}function dn(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?rr(e.value):rr(e)}function Oi(e,t,n){function o(){return Je(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??o();if(Array.isArray(t)){const r=Nr(t)?t.flatMap(s=>s.items):t;if(e==null||typeof e!="object"){const s=r.find(i=>i.value===e);return s&&s.label!=null?s.label:o()}if("value"in e){const s=r.find(i=>i&&i.value===e.value);if(s&&s.label!=null)return s.label}}return o()}function Hu(e,t,n){return e.reduce((o,r,s)=>(s>0&&o.push(", "),o.push(j.jsx(a.Fragment,{children:Oi(r,t,n)},s)),o),[])}const N={id:z(e=>e.id),query:z(e=>e.query),items:z(e=>e.items),selectedValue:z(e=>e.selectedValue),hasSelectionChips:z(e=>{const t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:z(e=>{const{selectedValue:t,selectionMode:n}=e;return t==null?!1:n==="multiple"&&Array.isArray(t)?t.length>0:!0}),hasNullItemLabel:z((e,t)=>t?$u(e.items):!1),open:z(e=>e.open),mounted:z(e=>e.mounted),forceMounted:z(e=>e.forceMounted),inline:z(e=>e.inline),activeIndex:z(e=>e.activeIndex),selectedIndex:z(e=>e.selectedIndex),isActive:z((e,t)=>e.activeIndex===t),isSelected:z((e,t)=>{const n=e.isItemEqualToValue,o=e.selectedValue;return Array.isArray(o)?o.some(r=>Kt(t,r,n)):Kt(t,o,n)}),transitionStatus:z(e=>e.transitionStatus),popupProps:z(e=>e.popupProps),inputProps:z(e=>e.inputProps),triggerProps:z(e=>e.triggerProps),getItemProps:z(e=>e.getItemProps),positionerElement:z(e=>e.positionerElement),listElement:z(e=>e.listElement),triggerElement:z(e=>e.triggerElement),inputElement:z(e=>e.inputElement),popupSide:z(e=>e.popupSide),openMethod:z(e=>e.openMethod),inputInsidePopup:z(e=>e.inputInsidePopup),selectionMode:z(e=>e.selectionMode),listRef:z(e=>e.listRef),labelsRef:z(e=>e.labelsRef),popupRef:z(e=>e.popupRef),emptyRef:z(e=>e.emptyRef),inputRef:z(e=>e.inputRef),keyboardActiveRef:z(e=>e.keyboardActiveRef),chipsContainerRef:z(e=>e.chipsContainerRef),clearRef:z(e=>e.clearRef),valuesRef:z(e=>e.valuesRef),allValuesRef:z(e=>e.allValuesRef),name:z(e=>e.name),disabled:z(e=>e.disabled),readOnly:z(e=>e.readOnly),required:z(e=>e.required),grid:z(e=>e.grid),isGrouped:z(e=>e.isGrouped),virtualized:z(e=>e.virtualized),onOpenChangeComplete:z(e=>e.onOpenChangeComplete),openOnInputClick:z(e=>e.openOnInputClick),itemToStringLabel:z(e=>e.itemToStringLabel),isItemEqualToValue:z(e=>e.isItemEqualToValue),modal:z(e=>e.modal),autoHighlight:z(e=>e.autoHighlight),submitOnItemClick:z(e=>e.submitOnItemClick)};let Es=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Uu={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Wu={valid(e){return e===null?null:e?{[Es.valid]:""}:{[Es.invalid]:""}}},Pi=a.createContext({invalid:void 0,name:void 0,validityData:{state:Uu,errors:[],error:"",value:"",initialValue:null},setValidityData:Re,disabled:void 0,touched:!1,setTouched:Re,dirty:!1,setDirty:Re,filled:!1,setFilled:Re,focused:!1,setFocused:Re,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=We)=>e,getInputValidationProps:(e=We)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(Pi.displayName="FieldRootContext");function Rn(e=!0){const t=a.useContext(Pi);if(t.setValidityData===Re&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":gt(28));return t}function Gu(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const Ai=a.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Re,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(Ai.displayName="FormContext");function Ti(){return a.useContext(Ai)}function qu(e){const{enabled:t=!0,value:n,id:o,name:r,controlRef:s,commit:i}=e,{formRef:c}=Ti(),{invalid:u,markedDirtyRef:l,validityData:d,setValidityData:f}=Rn(),g=Y(e.getValue);Q(()=>{if(!t)return;let p=n;p===void 0&&(p=g()),d.initialValue===null&&p!==null&&f(x=>({...x,initialValue:p}))},[t,f,n,d.initialValue,g]),Q(()=>{!t||!o||c.current.fields.set(o,{getValue:g,name:r,controlRef:s,validityData:Gu(d,u),validate(p=!0){let x=n;x===void 0&&(x=g()),l.current=!0,p?zt.flushSync(()=>i(x)):i(x)}})},[i,s,t,c,g,o,u,l,r,d,n]),Q(()=>{const p=c.current.fields;return()=>{o&&p.delete(o)}},[c,o])}const Ni=a.createContext({controlId:void 0,registerControlId:Re,labelId:void 0,setLabelId:Re,messageIds:[],setMessageIds:Re,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(Ni.displayName="LabelableContext");function kr(){return a.useContext(Ni)}function ki(e={}){const{id:t,implicit:n=!1,controlRef:o}=e,{controlId:r,registerControlId:s}=kr(),i=ur(t),c=n?r:void 0,u=at(()=>Symbol("labelable-control")),l=a.useRef(!1),d=a.useRef(t!=null),f=Y(()=>{!l.current||s===Re||(l.current=!1,s(u.current,void 0))});return Q(()=>{if(s===Re)return;let g;if(n){const p=o?.current;Ce(p)&&p.closest("label")!=null?g=t??null:g=c??i}else if(t!=null)d.current=!0,g=t;else if(d.current)g=i;else{f();return}if(g===void 0){f();return}l.current=!0,s(u.current,g)},[t,o,c,s,n,i,u,f]),a.useEffect(()=>f,[f]),r??i}function Ku(e,t){return(n,o)=>{if(n==null)return!1;const r=Je(n,t);return e.contains(r,o)}}function zu(e,t,n){return(o,r)=>{if(o==null)return!1;if(!r)return!0;const s=Je(o,t),i=n!=null?Je(n,t):"";return i&&e.contains(i,r)&&i.length===r.length?!0:e.contains(s,r)}}const Cs=new Map;function Mi(e){return Array.isArray(e)?e.map(t=>Mi(t)).join(","):e==null?"":String(e)}function Yu(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${Mi(e.locale)}|${JSON.stringify(t)}`,o=Cs.get(n);if(o)return o;const r=new Intl.Collator(e.locale,t),s={contains(i,c,u){if(!c)return!0;const l=Je(i,u);for(let d=0;d<=l.length-c.length;d+=1)if(r.compare(l.slice(d,d+c.length),c)===0)return!0;return!1},startsWith(i,c,u){if(!c)return!0;const l=Je(i,u);return r.compare(l.slice(0,c.length),c)===0},endsWith(i,c,u){if(!c)return!0;const l=Je(i,u),d=c.length;return l.length>=d&&r.compare(l.slice(l.length-d),c)===0}};return Cs.set(n,s),s}const Xu=Yu;function $n(e,t){const n=a.useRef(e),o=Y(t);Q(()=>{n.current!==e&&o(n.current)},[e,o]),Q(()=>{n.current=e},[e])}const Di=Symbol("none"),Wt={value:Di,index:-1};function Ju(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:o=null,selectedValue:r,onSelectedValueChange:s,defaultInputValue:i,inputValue:c,selectionMode:u="none",onItemHighlighted:l,name:d,disabled:f=!1,readOnly:g=!1,required:p=!1,inputRef:x,grid:y=!1,items:h,filteredItems:b,filter:m,openOnInputClick:w=!0,autoHighlight:v=!1,keepHighlight:E=!1,highlightItemOnHover:S=!0,loopFocus:R=!0,itemToStringLabel:I,itemToStringValue:G,isItemEqualToValue:K=_u,virtualized:q=!1,inline:D=!1,fillInputOnItemPress:X=!0,modal:Z=!1,limit:B=-1,autoComplete:M="list",formAutoComplete:U,locale:F,submitOnItemClick:J=!1}=e,{clearErrors:ne}=Ti(),{setDirty:ye,validityData:ue,shouldValidateOnChange:he,setFilled:se,name:pe,disabled:Me,setTouched:Ie,setFocused:we,validationMode:re,validation:fe}=Rn(),xe=ki({id:t}),O=Xu({locale:F}),[k,V]=a.useState(!1),[ie,C]=a.useState(null),L=a.useRef([]),_=a.useRef([]),P=a.useRef(null),$=a.useRef(null),T=a.useRef(null),W=a.useRef(!0),te=a.useRef(!1),ae=a.useRef(null),De=a.useRef(null),qe=a.useRef(null),Se=a.useRef(Wt),ge=a.useRef(null),Ae=a.useRef([]),Ke=a.useRef([]),Ue=Me||f,et=pe??d,Be=u==="multiple",ze=u==="single",Et=c!==void 0||i!==void 0,ut=h!==void 0,ve=b!==void 0;let be;v==="always"?be="always":be=v?"input-change":!1;const[oe,Ye]=ko({controlled:r,default:Be?o??Mn:o,name:"Combobox",state:"selectedValue"}),Xe=a.useMemo(()=>m===null?()=>!0:m!==void 0?m:ze&&!k?zu(O,I,oe):Ku(O,I),[m,ze,oe,k,O,I]),jt=at(()=>Et?i??"":ze?Je(oe,I):"").current,[Ve,sn]=ko({controlled:c,default:jt,name:"Combobox",state:"inputValue"}),[Oe,xo]=ko({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),ft=Nr(h),je=ie??(Ve===""?"":String(Ve).trim()),cn=ze?Je(oe,I):"",Xt=ze&&!k&&je!==""&&cn!==""&&cn.length===je.length&&O.contains(cn,je),Ot=Xt?"":je,In=ut&&ve&&Xt,Pt=a.useMemo(()=>h?ft?h.flatMap(H=>H.items):h:Mn,[h,ft]),dt=a.useMemo(()=>{if(b&&!In)return b;if(!h)return Mn;if(ft){const ee=h,le=[];let Te=0;for(const Le of ee){if(B>-1&&Te>=B)break;const Fe=Ot===""?Le.items:Le.items.filter(Nn=>Xe(Nn,Ot,I));if(Fe.length===0)continue;const $t=B>-1?B-Te:1/0,Ht=Fe.slice(0,$t);if(Ht.length>0){const Nn={...Le,items:Ht};le.push(Nn),Te+=Ht.length}}return le}if(Ot==="")return B>-1?Pt.slice(0,B):Pt;const H=[];for(const ee of Pt){if(B>-1&&H.length>=B)break;Xe(ee,Ot,I)&&H.push(ee)}return H},[b,In,h,ft,Ot,B,Xe,I,Pt]),tt=a.useMemo(()=>ft?dt.flatMap(ee=>ee.items):dt,[dt,ft]),de=at(()=>new wi({id:xe,selectedValue:oe,open:Oe,filter:Xe,query:je,items:h,selectionMode:u,listRef:L,labelsRef:_,popupRef:P,emptyRef:T,inputRef:$,keyboardActiveRef:W,chipsContainerRef:ae,clearRef:De,valuesRef:Ae,allValuesRef:Ke,selectionEventRef:qe,name:et,disabled:Ue,readOnly:g,required:p,grid:y,isGrouped:ft,virtualized:q,openOnInputClick:w,itemToStringLabel:I,isItemEqualToValue:K,modal:Z,autoHighlight:be,submitOnItemClick:J,hasInputValue:Et,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:D,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||Re,setOpen:Re,setInputValue:Re,setSelectedValue:Re,setIndices:Re,onItemHighlighted:Re,handleSelection:Re,getItemProps:()=>We,forceMount:Re,requestSubmit:Re})).current,At=u==="none"?Ve:oe,oc=a.useMemo(()=>u==="none"?At:Array.isArray(oe)?oe.map(H=>dn(H,G)):dn(oe,G),[At,G,u,oe]),yo=Y(l),vo=Y(n),Sn=A(de,N.activeIndex),rc=A(de,N.selectedIndex),On=A(de,N.positionerElement),$r=A(de,N.listElement),ln=A(de,N.triggerElement),Eo=A(de,N.inputElement),pt=A(de,N.inline),Tt=A(de,N.inputInsidePopup),sc=ct(ln),{mounted:Hr,setMounted:ic,transitionStatus:Co}=Fs(Oe),{openMethod:Ur,triggerProps:wo,reset:cc}=Pu(Oe);qu({id:xe,name:et,commit:fe.commit,value:At,controlRef:Tt?sc:$,getValue:()=>oc});const Pn=Y(()=>{h?_.current=tt.map(H=>Je(H,I)):de.set("forceMounted",!0)}),lc=a.useRef(oe);Q(()=>{oe!==lc.current&&Pn()},[Pn,oe]);const mt=Y(H=>{de.update(H);const ee=H.type||"none";if(H.activeIndex!==void 0)if(H.activeIndex===null)Se.current!==Wt&&(Se.current=Wt,yo(void 0,un(ee,void 0,{index:-1})));else{const le=Ae.current[H.activeIndex];Se.current={value:le,index:H.activeIndex},yo(le,un(ee,void 0,{index:H.activeIndex}))}}),bt=Y((H,ee)=>{if(te.current=ee.reason===Nt,e.onInputValueChange?.(H,ee),!ee.isCanceled){if(ee.reason===Jt){const le=ee.event,Te=le.inputType;if(le.type==="compositionend"||Te!=null&&Te!==""&&Te!=="insertReplacementText"){const Fe=H.trim()!=="";Fe&&V(!0),ge.current={hasQuery:Fe},Fe&&be&&de.state.activeIndex==null&&de.set("activeIndex",0)}}sn(H)}}),an=Y((H,ee)=>{if(Oe!==H&&(ee.reason==="escape-key"&&ut&&tt.length===0&&!de.state.emptyRef.current&&ee.allowPropagation(),e.onOpenChange?.(H,ee),!ee.isCanceled&&(!H&&k&&(ze?(pt||C(je),je===""&&V(!1)):Be&&(pt||Tt?mt({activeIndex:null}):C(je),bt("",ce(Nt,ee.event)))),xo(H),!H&&Tt&&(ee.reason===so||ee.reason===lr)&&(Ie(!0),we(!1),re==="onBlur")))){const le=u==="none"?Ve:oe;fe.commit(le)}}),An=Y((H,ee)=>{if(s?.(H,ee),ee.isCanceled)return;Ye(H),(u==="none"&&P.current&&X||ze&&!de.state.inputInsidePopup)&&bt(Je(H,I),ce(ee.reason,ee.event)),ze&&H!=null&&ee.reason!==Jt&&k&&!pt&&C(je)}),ac=Y((H,ee)=>{let le=ee;if(le===void 0){if(Sn===null)return;le=Ae.current[Sn]}const Te=Qe(H),Le=qe.current??H;qe.current=null;const Fe=ce(tl,Le),$t=Te?.closest("a")?.getAttribute("href");if($t){$t.startsWith("#")&&an(!1,Fe);return}if(Be){const Ht=Array.isArray(oe)?oe:[],Ec=Bu(Ht,le,de.state.isItemEqualToValue)?ju(Ht,le,de.state.isItemEqualToValue):[...Ht,le];if(An(Ec,Fe),!($.current?$.current.value.trim()!=="":!1))return;de.state.inputInsidePopup?bt("",ce(Nt,Fe.event)):an(!1,Fe)}else An(le,Fe),an(!1,Fe)}),Ro=Y(()=>{if(!de.state.submitOnItemClick)return;const H=de.state.inputElement?.form;H&&typeof H.requestSubmit=="function"&&H.requestSubmit()}),Io=Y(()=>{if(ic(!1),vo?.(!1),V(!1),cc(),C(null),mt(u==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Be&&$.current&&$.current.value!==""&&!te.current&&bt("",ce(Nt)),ze)if(de.state.inputInsidePopup)$.current&&$.current.value!==""&&bt("",ce(Nt));else{const H=Je(oe,I);$.current&&$.current.value!==H&&bt(H,ce(H===""?Nt:it))}}),uc=a.useMemo(()=>pt&&On?{current:On.closest('[role="dialog"]')}:P,[pt,On]);vr({enabled:!e.actionsRef,open:Oe,ref:uc,onComplete(){Oe||Io()}}),a.useImperativeHandle(e.actionsRef,()=>({unmount:Io}),[Io]),Q(function(){if(Oe||u==="none")return;const ee=h?Pt:Ke.current;if(Be){const le=Array.isArray(oe)?oe:[],Te=le[le.length-1],Le=ro(ee,Te,K);mt({selectedIndex:Le===-1?null:Le})}else{const le=ro(ee,oe,K);mt({selectedIndex:le===-1?null:le})}},[Oe,oe,h,u,Pt,Be,K,mt]),Q(()=>{h&&(Ae.current=tt,L.current.length=tt.length)},[h,tt]),Q(()=>{const H=ge.current;if(H&&(H.hasQuery?be&&de.set("activeIndex",0):be==="always"&&de.set("activeIndex",0),ge.current=null),!Oe&&!pt)return;const le=ut||ve?tt:Ae.current,Te=de.state.activeIndex;if(Te==null){if(be==="always"&&le.length>0){de.set("activeIndex",0);return}Se.current!==Wt&&(Se.current=Wt,de.state.onItemHighlighted(void 0,un(it,void 0,{index:-1})));return}if(Te>=le.length){Se.current!==Wt&&(Se.current=Wt,de.state.onItemHighlighted(void 0,un(it,void 0,{index:-1}))),de.set("activeIndex",null);return}const Le=le[Te],Fe=Se.current.value,$t=Fe!==Di&&Kt(Le,Fe,de.state.isItemEqualToValue);(Se.current.index!==Te||!$t)&&(Se.current={value:Le,index:Te},de.state.onItemHighlighted(Le,un(it,void 0,{index:Te})))},[Sn,be,ve,ut,tt,pt,Oe,de]),Q(()=>{if(u==="none"){se(String(Ve)!=="");return}se(Be?Array.isArray(oe)&&oe.length>0:oe!=null)},[se,u,Ve,oe,Be]),a.useEffect(()=>{ut&&be&&tt.length===0&&mt({activeIndex:null})},[ut,be,tt.length,mt]),$n(je,()=>{!Oe||je===""||je===String(jt)||V(!0)}),$n(oe,()=>{if(u!=="none"&&(ne(et),ye(oe!==ue.initialValue),he()?fe.commit(oe):fe.commit(oe,!0),ze&&!Et&&!Tt)){const H=Je(oe,I);Ve!==H&&bt(H,ce(it))}}),$n(Ve,()=>{u==="none"&&(ne(et),ye(Ve!==ue.initialValue),he()?fe.commit(Ve):fe.commit(Ve,!0))}),$n(h,()=>{if(!ze||Et||Tt||k)return;const H=Je(oe,I);Ve!==H&&bt(H,ce(it))});const Tn=Ri({open:pt?!0:Oe,onOpenChange:an,elements:{reference:Tt?ln:Eo,floating:On}});let So,Oo;pt||(So=y?"grid":"listbox",Oo=Oe?"true":"false");const fc=a.useMemo(()=>{const H=Eo?.tagName==="INPUT",ee=H||Oe,le=H?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return ee&&(le.role="combobox",le["aria-expanded"]=Oo,le["aria-haspopup"]=So,le["aria-controls"]=Oe?$r?.id:void 0,le["aria-autocomplete"]=M),{reference:le,floating:{role:"presentation"}}},[Eo,Oe,Oo,So,$r?.id,M]),dc=mi(Tn,{enabled:!g&&!Ue&&w,event:"mousedown-only",toggle:!1,touchOpenDelay:Tt?0:50,reason:ol}),pc=au(Tn,{enabled:!g&&!Ue&&!pt,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:pt?!0:void 0,outsidePress(H){const ee=Qe(H);return!me(ln,ee)&&!me(De.current,ee)&&!me(ae.current,ee)}}),mc=Iu(Tn,{enabled:!g&&!Ue,id:xe,listRef:L,activeIndex:Sn,selectedIndex:rc,virtual:!0,loopFocus:R,allowEscape:R&&!be,focusItemOnOpen:k||u==="none"&&!be?!1:"auto",focusItemOnHover:S,resetOnPointerLeave:!E,cols:y?2:1,orientation:y?"horizontal":void 0,disabledIndices:Mn,onNavigate(H,ee){!ee&&!Oe||Co==="ending"||mt(ee?{activeIndex:H,type:W.current?"keyboard":"pointer"}:{activeIndex:H})}}),{getReferenceProps:Po,getFloatingProps:Ao,getItemProps:To}=Eu([fc,dc,pc,mc]);Fu(()=>{de.update({inline:D,popupProps:Ao(),inputProps:Po(),triggerProps:wo,getItemProps:To,setOpen:an,setInputValue:bt,setSelectedValue:An,setIndices:mt,onItemHighlighted:yo,handleSelection:ac,forceMount:Pn,requestSubmit:Ro})}),Q(()=>{de.update({id:xe,selectedValue:oe,open:Oe,mounted:Hr,transitionStatus:Co,items:h,inline:D,popupProps:Ao(),inputProps:Po(),triggerProps:wo,openMethod:Ur,getItemProps:To,selectionMode:u,name:et,disabled:Ue,readOnly:g,required:p,grid:y,isGrouped:ft,virtualized:q,onOpenChangeComplete:vo,openOnInputClick:w,itemToStringLabel:I,modal:Z,autoHighlight:be,isItemEqualToValue:K,submitOnItemClick:J,hasInputValue:Et,requestSubmit:Ro})},[de,xe,oe,Oe,Hr,Co,h,Ao,Po,To,Ur,wo,u,et,Ue,g,p,fe,y,ft,q,vo,w,I,Z,K,J,Et,D,Ro,be]);const hc=yn(x,fe.inputRef),gc=a.useMemo(()=>({query:je,hasItems:ut,filteredItems:dt,flatFilteredItems:tt}),[je,ut,dt,tt]),bc=a.useMemo(()=>Array.isArray(At)?"":dn(At,G),[At,G]),xc=Be&&Array.isArray(oe)&&oe.length>0,No=Be||u==="none"?void 0:et,yc=a.useMemo(()=>!Be||!Array.isArray(oe)||!et?null:oe.map(H=>{const ee=dn(H,G);return j.jsx("input",{type:"hidden",name:et,value:ee},ee)}),[Be,oe,et,G]),vc=j.jsxs(a.Fragment,{children:[e.children,j.jsx("input",{...fe.getInputValidationProps({onFocus(){if(Tt){ln?.focus();return}($.current||ln)?.focus()},onChange(H){if(H.nativeEvent.defaultPrevented)return;const ee=H.target.value,le=ce(it,H.nativeEvent);function Te(){if(Be)return;if(u==="none"){ye(ee!==ue.initialValue),bt(ee,le),he()&&fe.commit(ee);return}const Le=Ae.current.find(Fe=>dn(Fe,G).toLowerCase()===ee.toLowerCase());Le!=null&&(ye(Le!==ue.initialValue),An?.(Le,le),he()&&fe.commit(Le))}h?Te():(Pn(),queueMicrotask(Te))}}),id:xe&&No==null?`${xe}-hidden-input`:void 0,name:No,autoComplete:U,disabled:Ue,required:p&&!xc,readOnly:g,value:bc,ref:hc,style:No?aa:Er,tabIndex:-1,"aria-hidden":!0}),yc]});return j.jsx(Sr.Provider,{value:de,children:j.jsx(Or.Provider,{value:Tn,children:j.jsx(Pr.Provider,{value:gc,children:j.jsx(Ar.Provider,{value:Ve,children:vc})})})})}const Vi={...Vu,...Wu,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null};function Qu(e){const t=e.getBoundingClientRect();if(process.env.NODE_ENV!=="production")return t;const n=window.getComputedStyle(e,"::before"),o=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||o.content!=="none"))return t;const s=parseFloat(n.width)||0,i=parseFloat(n.height)||0,c=parseFloat(o.width)||0,u=parseFloat(o.height)||0,l=Math.max(t.width,s,c),d=Math.max(t.height,i,u),f=l-t.width,g=d-t.height;return{left:t.left-f/2,right:t.right+f/2,top:t.top-g/2,bottom:t.bottom+g/2}}const Hn=2,Li=a.forwardRef(function(t,n){const{render:o,className:r,nativeButton:s=!0,disabled:i=!1,id:c,...u}=t,{state:l,disabled:d,setTouched:f,setFocused:g,validationMode:p,validation:x}=Rn(),{labelId:y}=kr(),h=st(),{filteredItems:b}=Bt(),m=A(h,N.selectionMode),w=A(h,N.disabled),v=A(h,N.readOnly),E=A(h,N.required),S=A(h,N.mounted),R=A(h,N.popupSide),I=A(h,N.positionerElement),G=A(h,N.listElement),K=A(h,N.triggerProps),q=A(h,N.triggerElement),D=A(h,N.inputInsidePopup),X=A(h,N.id),Z=A(h,N.open),B=A(h,N.selectedValue),M=A(h,N.activeIndex),U=A(h,N.selectedIndex),F=A(h,N.hasSelectedValue),J=go(),ne=Tr(),ye=Gt(),ue=d||w||i,he=b.length===0,se=S&&I?R:null;ki({id:D?c:void 0});const pe=D?c??X:c,Me=a.useRef("");function Ie(C){Me.current=C.pointerType}const we=J.useState("domReferenceElement");a.useEffect(()=>{D&&q&&q!==we&&J.set("domReferenceElement",q)},[q,we,J,D]);const{reference:re}=Su(J,{enabled:!Z&&!v&&!w&&m==="single",listRef:h.state.labelsRef,activeIndex:M,selectedIndex:U,onMatch(C){const L=h.state.valuesRef.current[C];L!==void 0&&h.state.setSelectedValue(L,ce("none"))}}),{reference:fe}=mi(J,{enabled:!v&&!w,event:"mousedown"}),{buttonRef:xe,getButtonProps:O}=uo({native:s,disabled:ue}),k={...l,open:Z,disabled:ue,popupSide:se,listEmpty:he,placeholder:!F},V=Y(C=>{h.set("triggerElement",C)});return Ge("button",t,{ref:[n,xe,V],state:k,props:[K,fe,re,{id:pe,tabIndex:D?0:-1,role:D?"combobox":void 0,"aria-expanded":Z?"true":"false","aria-haspopup":D?"dialog":"listbox","aria-controls":Z?G?.id:void 0,"aria-required":D&&E||void 0,"aria-labelledby":y,onPointerDown:Ie,onPointerEnter:Ie,onFocus(){g(!0),!(ue||v)&&ye.start(0,h.state.forceMount)},onBlur(C){if(!me(I,C.relatedTarget)&&(f(!0),g(!1),p==="onBlur")){const L=m==="none"?ne:B;x.commit(L)}},onMouseDown(C){if(ue||v||(D||J.set("domReferenceElement",C.currentTarget),h.state.forceMount(),Me.current!=="touch"&&(h.state.inputRef.current?.focus(),D||C.preventDefault()),Z))return;const L=Ne(C.currentTarget);function _(P){if(!q)return;const $=Qe(P),T=h.state.positionerElement,W=h.state.listElement;if(me(q,$)||me(T,$)||me(W,$)||$===q)return;const te=Qu(q),ae=P.clientX>=te.left-Hn&&P.clientX<=te.right+Hn,De=P.clientY>=te.top-Hn&&P.clientY<=te.bottom+Hn;ae&&De||h.state.setOpen(!1,ce("cancel-open",P))}D&&L.addEventListener("mouseup",_,{once:!0})},onKeyDown(C){ue||v||(C.key==="ArrowDown"||C.key==="ArrowUp")&&(Ee(C),h.state.setOpen(!0,ce(mn,C.nativeEvent)),h.state.inputRef.current?.focus())}},x?x.getValidationProps(u):u,O],stateAttributesMapping:Vi})});process.env.NODE_ENV!=="production"&&(Li.displayName="ComboboxTrigger");const Mr=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Mr.displayName="ComboboxChipsContext");function Fi(){return a.useContext(Mr)}const Dr=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Dr.displayName="ComboboxPositionerContext");function Vr(e){const t=a.useContext(Dr);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component":gt(21));return t}const Lr=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,id:i,...c}=t,{state:u,disabled:l,setTouched:d,setFocused:f,validationMode:g,validation:p}=Rn(),{labelId:x}=kr(),y=Fi(),b=!!Vr(!0),m=st(),{filteredItems:w}=Bt(),v=Tr(),E=Ps(),S=A(m,N.required),R=A(m,N.disabled),I=A(m,N.readOnly),G=A(m,N.name),K=A(m,N.selectionMode),q=A(m,N.autoHighlight),D=A(m,N.inputProps),X=A(m,N.triggerProps),Z=A(m,N.open),B=A(m,N.mounted),M=A(m,N.selectedValue),U=A(m,N.popupSide),F=A(m,N.positionerElement),J=A(m,N.id),ne=A(m,N.inline),ye=!!q,ue=B&&F?U:null,he=l||R||s,se=w.length===0,Me=ur(i??(b||ne?void 0:J)),[Ie,we]=a.useState(null),re=a.useRef(!1),fe=a.useRef(null),xe=a.useRef(!1),O=Y(C=>{const L=b||m.state.inline;L&&!m.state.hasInputValue&&m.state.setInputValue("",ce(it)),m.update({inputElement:C,inputInsidePopup:L})}),k={...u,open:Z,disabled:he,readOnly:I,popupSide:ue,listEmpty:se};function V(C){if(!y)return;let L;const{highlightedChipIndex:_}=y;if(_!==void 0){if(C.key==="ArrowLeft")C.preventDefault(),_>0?L=_-1:L=void 0;else if(C.key==="ArrowRight")C.preventDefault(),_<M.length-1?L=_+1:L=void 0;else if(C.key==="Backspace"||C.key==="Delete"){C.preventDefault();const P=_>=M.length-1?M.length-2:_;L=P>=0?P:void 0,m.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return L}return C.key==="ArrowLeft"&&(C.currentTarget.selectionStart??0)===0&&M.length>0?(C.preventDefault(),L=Math.max(M.length-1,0)):C.key==="Backspace"&&C.currentTarget.value===""&&M.length>0&&(m.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),C.preventDefault()),L}return Ge("input",t,{state:k,ref:[n,m.state.inputRef,O],props:[D,X,{type:"text",value:t.value??Ie??v,"aria-readonly":I||void 0,"aria-required":S||void 0,"aria-labelledby":x,disabled:he,readOnly:I,required:K==="none"?S:void 0,...K==="none"&&G&&{name:G},id:Me,onFocus(){if(f(!0),!ne||!xe.current)return;xe.current=!1;const C=fe.current;C==null||!Object.hasOwn(m.state.valuesRef.current,C)||m.state.setIndices({activeIndex:C})},onBlur(){d(!0),f(!1);const C=m.state.activeIndex;if(ne&&C!==null&&q!=="always"&&(fe.current=C,xe.current=!0,m.state.setIndices({activeIndex:null})),g==="onBlur"){const L=K==="none"?v:M;p.commit(L)}},onCompositionStart(C){zn||(re.current=!0,we(C.currentTarget.value))},onCompositionEnd(C){re.current=!1;const L=C.currentTarget.value;we(null),m.state.setInputValue(L,ce(Jt,C.nativeEvent))},onChange(C){const L=C.nativeEvent.inputType,_=!L||L==="insertReplacementText",P=re.current||!_;if(re.current){const te=C.currentTarget.value;we(te),te===""&&!m.state.openOnInputClick&&!m.state.inputInsidePopup&&m.state.setOpen(!1,ce(Nt,C.nativeEvent));const ae=te.trim(),De=ye&&ae!=="";!I&&!he&&ae&&P&&(m.state.setOpen(!0,ce(Jt,C.nativeEvent)),ye||m.state.setIndices({activeIndex:null,selectedIndex:null,type:m.state.keyboardActiveRef.current?"keyboard":"pointer"})),Z&&m.state.activeIndex!==null&&!De&&m.state.setIndices({activeIndex:null,selectedIndex:null,type:m.state.keyboardActiveRef.current?"keyboard":"pointer"});return}m.state.setInputValue(C.currentTarget.value,ce(Jt,C.nativeEvent));const $=C.currentTarget.value==="",T=ce(Nt,C.nativeEvent);$&&!m.state.inputInsidePopup&&(K==="single"&&m.state.setSelectedValue(null,T),m.state.openOnInputClick||m.state.setOpen(!1,T));const W=C.currentTarget.value.trim();!I&&!he&&W&&P&&(m.state.setOpen(!0,ce(Jt,C.nativeEvent)),ye||m.state.setIndices({activeIndex:null,selectedIndex:null,type:m.state.keyboardActiveRef.current?"keyboard":"pointer"})),Z&&m.state.activeIndex!==null&&!ye&&m.state.setIndices({activeIndex:null,selectedIndex:null,type:m.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(C){if(he||I||C.ctrlKey||C.shiftKey||C.altKey||C.metaKey)return;m.state.keyboardActiveRef.current=!0;const L=C.currentTarget,_=L.scrollWidth-L.clientWidth,P=E==="rtl";if(C.key==="Home"){Ee(C);const W=Jr&&P?L.value.length:0;L.setSelectionRange(W,W),L.scrollLeft=0;return}if(C.key==="End"){Ee(C);const W=Jr&&P?0:L.value.length;L.setSelectionRange(W,W),L.scrollLeft=P?-_:_;return}if(!B&&C.key==="Escape"){const W=K==="multiple"&&Array.isArray(M)?M.length===0:M===null,te=ce(Ds,C.nativeEvent),ae=K==="multiple"?[]:null;m.state.setInputValue("",te),m.state.setSelectedValue(ae,te),!W&&!m.state.inline&&!te.isPropagationAllowed&&C.stopPropagation();return}if(y&&C.key==="Backspace"&&L.value===""&&y.highlightedChipIndex===void 0&&Array.isArray(M)&&M.length>0){const W=M.slice(0,-1);m.state.setIndices({activeIndex:null,selectedIndex:null,type:m.state.keyboardActiveRef.current?"keyboard":"pointer"}),m.state.setSelectedValue(W,ce(it,C.nativeEvent));return}const $=y?.highlightedChipIndex!==void 0,T=V(C);if(y?.setHighlightedChipIndex(T),T!==void 0?y?.chipsRef.current[T]?.focus():$&&m.state.inputRef.current?.focus(),C.which!==229&&C.key==="Enter"&&Z){const W=m.state.activeIndex,te=C.nativeEvent;if(W===null){m.state.setOpen(!1,ce(it,te));return}Ee(C);const ae=m.state.listRef.current[W];ae&&(m.state.selectionEventRef.current=te,ae.click(),m.state.selectionEventRef.current=null)}},onPointerMove(){m.state.keyboardActiveRef.current=!1},onPointerDown(){m.state.keyboardActiveRef.current=!1}},p?p.getValidationProps(c):c],stateAttributesMapping:Vi})});process.env.NODE_ENV!=="production"&&(Lr.displayName="ComboboxInput");const Zu={...Ls,...Du},_i=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,keepMounted:c=!1,...u}=t,{disabled:l}=Rn(),d=st(),f=A(d,N.selectionMode),g=A(d,N.disabled),p=A(d,N.readOnly),x=A(d,N.open),y=A(d,N.selectedValue),h=A(d,N.hasSelectionChips),b=Tr();let m=!1;f==="none"?m=b!=="":f==="single"?m=y!=null:m=h;const w=l||g||s,{buttonRef:v,getButtonProps:E}=uo({native:i,disabled:w}),{mounted:S,transitionStatus:R,setMounted:I}=Fs(m),G={disabled:w,open:x,transitionStatus:R};vr({open:m,ref:d.state.clearRef,onComplete(){m||I(!1)}});const K=Ge("button",t,{state:G,ref:[n,v,d.state.clearRef],props:[{tabIndex:-1,children:"x",onMouseDown(D){D.preventDefault()},onClick(D){if(w||p)return;const X=d.state.keyboardActiveRef;d.state.setInputValue("",ce(qr,D.nativeEvent)),f!=="none"?(d.state.setSelectedValue(Array.isArray(y)?[]:null,ce(qr,D.nativeEvent)),d.state.setIndices({activeIndex:null,selectedIndex:null,type:X.current?"keyboard":"pointer"})):d.state.setIndices({activeIndex:null,type:X.current?"keyboard":"pointer"}),d.state.inputRef.current?.focus()}},u,E],stateAttributesMapping:Zu});return c||S?K:null});process.env.NODE_ENV!=="production"&&(_i.displayName="ComboboxClear");const Fr=a.createContext(null);process.env.NODE_ENV!=="production"&&(Fr.displayName="GroupCollectionContext");function ef(){return a.useContext(Fr)}function tf(e){const{children:t,items:n}=e,o=a.useMemo(()=>({items:n}),[n]);return j.jsx(Fr.Provider,{value:o,children:t})}function Bi(e){const{children:t}=e,{filteredItems:n}=Bt(),o=ef(),r=o?o.items:n;return r?j.jsx(a.Fragment,{children:r.map(t)}):null}const ji=a.forwardRef(function(t,n){var o;const{render:r,className:s,children:i,...c}=t,u=st(),l=go(),d=!!Vr(!0),{filteredItems:f}=Bt(),g=A(u,N.items),p=A(u,N.labelsRef),x=A(u,N.listRef),y=A(u,N.selectionMode),h=A(u,N.grid),b=A(u,N.popupProps),m=A(u,N.disabled),w=A(u,N.readOnly),v=A(u,N.virtualized),E=y==="multiple",S=f.length===0,R=Y(X=>{u.set("positionerElement",X)}),I=Y(X=>{u.set("listElement",X)}),G=a.useMemo(()=>typeof i=="function"?o||(o=j.jsx(Bi,{children:i})):i,[i]),K={empty:S},q=l.useState("floatingId"),D=Ge("div",t,{state:K,ref:[n,I,d?null:R],props:[b,{children:G,tabIndex:-1,id:q,role:h?"grid":"listbox","aria-multiselectable":E?"true":void 0,onKeyDown(X){if(!(m||w)&&X.key==="Enter"){const Z=u.state.activeIndex;if(Z==null)return;Ee(X);const B=X.nativeEvent,M=u.state.listRef.current[Z];M&&(u.state.selectionEventRef.current=B,M.click(),u.state.selectionEventRef.current=null)}},onKeyDownCapture(){u.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){u.state.keyboardActiveRef.current=!1}},c]});return v?D:j.jsx(Ss,{elementsRef:x,labelsRef:g?void 0:p,children:D})});process.env.NODE_ENV!=="production"&&(ji.displayName="ComboboxList");const _r=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(_r.displayName="ComboboxPortalContext");function nf(){const e=a.useContext(_r);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Portal> is missing.":gt(20));return e}const $i=a.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,s=st(),i=A(s,N.mounted),c=A(s,N.forceMounted);return i||o||c?j.jsx(_r.Provider,{value:o,children:j.jsx(pi,{ref:n,...r})}):null});process.env.NODE_ENV!=="production"&&($i.displayName="ComboboxPortal");const of=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:u}=t,{element:l,padding:d=0,offsetParent:f="real"}=St(e,t)||{};if(l==null)return{};const g=Xs(d),p={x:n,y:o},x=yr(r),y=xr(x),h=await i.getDimensions(l),b=x==="y",m=b?"top":"left",w=b?"bottom":"right",v=b?"clientHeight":"clientWidth",E=s.reference[y]+s.reference[x]-p[x]-s.floating[y],S=p[x]-s.reference[x],R=f==="real"?await i.getOffsetParent?.(l):c.floating;let I=c.floating[v]||s.floating[y];(!I||!await i.isElement?.(R))&&(I=c.floating[v]||s.floating[y]);const G=E/2-S/2,K=I/2-h[y]/2-1,q=Math.min(g[m],K),D=Math.min(g[w],K),X=q,Z=I-h[y]-D,B=I/2-h[y]/2+G,M=Zo(X,B,Z),U=!u.arrow&&_t(r)!=null&&B!==M&&s.reference[y]/2-(B<X?q:D)-h[y]/2<0,F=U?B<X?B-X:B-Z:0;return{[x]:p[x]+F,data:{[x]:M,centerOffset:B-M-F,...U&&{alignmentOffset:F}},reset:U}}}),rf=(e,t)=>({...of(e),options:[e,t]}),sf={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,s=t===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:(await iu().fn(e)).data?.referenceHidden||s}}}},cf={sideX:"left",sideY:"top"};function Hi(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function ws(e,t,n){const{rects:o,placement:r}=e;return{side:Hi(t,ot(r),n),align:_t(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function lf(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:u=5,sticky:l=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,keepMounted:g=!1,floatingRootContext:p,mounted:x,collisionAvoidance:y,shiftCrossAxis:h=!1,nodeId:b,adaptiveOrigin:m,lazyFlip:w=!1,externalTree:v}=e,[E,S]=a.useState(null);!x&&E!==null&&S(null);const R=y.side||"flip",I=y.align||"flip",G=y.fallbackAxisSide||"end",K=typeof t=="function"?t:void 0,q=Y(K),D=K?q:t,X=ct(t),B=Ps()==="rtl",M=E||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[o],U=s==="center"?M:`${M}-${s}`;let F=u;const J=1,ne=o==="bottom"?J:0,ye=o==="top"?J:0,ue=o==="right"?J:0,he=o==="left"?J:0;typeof F=="number"?F={top:F+ne,right:F+he,bottom:F+ye,left:F+ue}:F&&(F={top:(F.top||0)+ne,right:(F.right||0)+he,bottom:(F.bottom||0)+ye,left:(F.left||0)+ue});const se={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:F},pe=a.useRef(null),Me=ct(r),Ie=ct(i),fe=[tu(ve=>{const be=ws(ve,o,B),oe=typeof Me.current=="function"?Me.current(be):Me.current,Ye=typeof Ie.current=="function"?Ie.current(be):Ie.current;return{mainAxis:oe,crossAxis:Ye,alignmentAxis:Ye}},[typeof r!="function"?r:0,typeof i!="function"?i:0,B,o])],xe=I==="none"&&R!=="shift",O=!xe&&(l||h||R==="shift"),k=R==="none"?null:ru({...se,padding:{top:F.top+J,right:F.right+J,bottom:F.bottom+J,left:F.left+J},mainAxis:!h&&R==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:G}),V=xe?null:nu(ve=>{const be=Ne(ve.elements.floating).documentElement;return{...se,rootBoundary:h?{x:0,y:0,width:be.clientWidth,height:be.clientHeight}:void 0,mainAxis:I!=="none",crossAxis:O,limiter:l||h?void 0:ou(oe=>{if(!pe.current)return{};const{width:Ye,height:Xe}=pe.current.getBoundingClientRect(),jt=lt(ot(oe.placement)),Ve=jt==="y"?Ye:Xe,sn=jt==="y"?F.left+F.right:F.top+F.bottom;return{offset:Ve/2+sn/2}})}},[se,l,h,F,I]);R==="shift"||I==="shift"||s==="center"?fe.push(V,k):fe.push(k,V),fe.push(su({...se,apply({elements:{floating:ve},rects:{reference:be},availableWidth:oe,availableHeight:Ye}){const Xe=ve.style;Xe.setProperty("--available-width",`${oe}px`),Xe.setProperty("--available-height",`${Ye}px`),Xe.setProperty("--anchor-width",`${be.width}px`),Xe.setProperty("--anchor-height",`${be.height}px`)}}),rf(()=>({element:pe.current||document.createElement("div"),padding:d,offsetParent:"floating"}),[d]),{name:"transformOrigin",fn(ve){const{elements:be,middlewareData:oe,placement:Ye,rects:Xe,y:jt}=ve,Ve=ot(Ye),sn=lt(Ve),Oe=pe.current,xo=oe.arrow?.x||0,ft=oe.arrow?.y||0,je=Oe?.clientWidth||0,cn=Oe?.clientHeight||0,Xt=xo+je/2,Ot=ft+cn/2,In=Math.abs(oe.shift?.y||0),Pt=Xe.reference.height/2,dt=typeof r=="function"?r(ws(ve,o,B)):r,tt=In>dt,de={top:`${Xt}px calc(100% + ${dt}px)`,bottom:`${Xt}px ${-dt}px`,left:`calc(100% + ${dt}px) ${Ot}px`,right:`${-dt}px ${Ot}px`}[Ve],At=`${Xt}px ${Xe.reference.y+Pt-jt}px`;return be.floating.style.setProperty("--transform-origin",O&&sn==="y"&&tt?At:de),{}}},sf,m),Q(()=>{!x&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[x,p]);const ie=a.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:C,elements:L,x:_,y:P,middlewareData:$,update:T,placement:W,context:te,isPositioned:ae,floatingStyles:De}=vu({rootContext:p,placement:U,middleware:fe,strategy:n,whileElementsMounted:g?void 0:(...ve)=>xs(...ve,ie),nodeId:b,externalTree:v}),{sideX:qe,sideY:Se}=$.adaptiveOrigin||cf,ge=ae?n:"fixed",Ae=a.useMemo(()=>{const ve=m?{position:ge,[qe]:_,[Se]:P}:{position:ge,...De};return ae||(ve.opacity=0),ve},[m,ge,qe,_,Se,P,De,ae]),Ke=a.useRef(null);Q(()=>{if(!x)return;const ve=X.current,be=typeof ve=="function"?ve():ve,Ye=(Rs(be)?be.current:be)||null||null;Ye!==Ke.current&&(C.setPositionReference(Ye),Ke.current=Ye)},[x,C,D,X]),a.useEffect(()=>{if(!x)return;const ve=X.current;typeof ve!="function"&&Rs(ve)&&ve.current!==Ke.current&&(C.setPositionReference(ve.current),Ke.current=ve.current)},[x,C,D,X]),a.useEffect(()=>{if(g&&x&&L.domReference&&L.floating)return xs(L.domReference,L.floating,T,ie)},[g,x,L,T,ie]);const Ue=ot(W),et=Hi(o,Ue,B),Be=_t(W)||"center",ze=!!$.hide?.referenceHidden;Q(()=>{w&&x&&ae&&S(Ue)},[w,x,ae,Ue]);const Et=a.useMemo(()=>({position:"absolute",top:$.arrow?.y,left:$.arrow?.x}),[$.arrow]),ut=$.arrow?.centerOffset!==0;return a.useMemo(()=>({positionerStyles:Ae,arrowStyles:Et,arrowRef:pe,arrowUncentered:ut,side:et,align:Be,physicalSide:Ue,anchorHidden:ze,refs:C,context:te,isPositioned:ae,update:T}),[Ae,Et,pe,ut,et,Be,Ue,ze,C,te,ae,T])}function Rs(e){return e!=null&&"current"in e}function Ui(e){return e==="starting"?qc:We}const Wi=a.forwardRef(function(t,n){const{render:o,className:r,anchor:s,positionMethod:i="absolute",side:c="bottom",align:u="center",sideOffset:l=0,alignOffset:d=0,collisionBoundary:f="clipping-ancestors",collisionPadding:g=5,arrowPadding:p=5,sticky:x=!1,disableAnchorTracking:y=!1,collisionAvoidance:h=zc,...b}=t,m=st(),{filteredItems:w}=Bt(),v=go(),E=nf(),S=A(m,N.modal),R=A(m,N.open),I=A(m,N.mounted),G=A(m,N.openMethod),K=A(m,N.triggerElement),q=A(m,N.inputElement),D=A(m,N.inputInsidePopup),X=A(m,N.transitionStatus),Z=w.length===0,M=lf({anchor:s??(D?K:q),floatingRootContext:v,positionMethod:i,mounted:I,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:p,collisionBoundary:f,collisionPadding:g,sticky:x,disableAnchorTracking:y,keepMounted:E,collisionAvoidance:h,lazyFlip:!0});ia(R&&S&&G!=="touch",K);const U=a.useMemo(()=>{const ue={...M.positionerStyles};return R||(ue.pointerEvents="none"),{role:"presentation",hidden:!I,style:ue}},[R,I,M.positionerStyles]),F={open:R,side:M.side,align:M.align,anchorHidden:M.anchorHidden,empty:Z};Q(()=>{m.set("popupSide",M.side)},[m,M.side]);const J=a.useMemo(()=>({side:M.side,align:M.align,arrowRef:M.arrowRef,arrowUncentered:M.arrowUncentered,arrowStyles:M.arrowStyles,anchorHidden:M.anchorHidden,isPositioned:M.isPositioned}),[M.side,M.align,M.arrowRef,M.arrowUncentered,M.arrowStyles,M.anchorHidden,M.isPositioned]),ne=Y(ue=>{m.set("positionerElement",ue)}),ye=Ge("div",t,{state:F,ref:[n,ne],props:[U,Ui(X),b],stateAttributesMapping:Ii});return j.jsxs(Dr.Provider,{value:J,children:[I&&S&&j.jsx(Si,{inert:Lu(!R),cutout:q??K}),ye]})});process.env.NODE_ENV!=="production"&&(Wi.displayName="ComboboxPositioner");const af={...Ii,...Ls},Gi=a.forwardRef(function(t,n){const{render:o,className:r,initialFocus:s,finalFocus:i,...c}=t,u=st(),l=Vr(),d=go(),{filteredItems:f}=Bt(),g=A(u,N.mounted),p=A(u,N.open),x=A(u,N.openMethod),y=A(u,N.transitionStatus),h=A(u,N.inputInsidePopup),b=A(u,N.inputElement),m=f.length===0;vr({open:p,ref:u.state.popupRef,onComplete(){p&&u.state.onOpenChangeComplete(!0)}});const w={open:p,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:y,empty:m},v=Ge("div",t,{state:w,ref:[n,u.state.popupRef],props:[{role:h?"dialog":"presentation",tabIndex:-1,onFocus(I){const G=Qe(I.nativeEvent);x!=="touch"&&(me(u.state.listElement,G)||G===I.currentTarget)&&u.state.inputRef.current?.focus()}},Ui(y),c],stateAttributesMapping:af}),S=s===void 0?h?I=>I==="touch"?u.state.popupRef.current:b:!1:s;let R;return i!=null?R=i:R=h?void 0:!1,j.jsx(ya,{context:d,disabled:!g,modal:!h,openInteractionType:x,initialFocus:S,returnFocus:R,children:v})});process.env.NODE_ENV!=="production"&&(Gi.displayName="ComboboxPopup");const Br=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Br.displayName="ComboboxGroupContext");function uf(){const e=a.useContext(Br);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxGroupContext is missing. ComboboxGroup parts must be placed within <Combobox.Group>.":gt(18));return e}const qi=a.forwardRef(function(t,n){const{render:o,className:r,items:s,...i}=t,[c,u]=a.useState(),l=a.useMemo(()=>({labelId:c,setLabelId:u,items:s}),[c,u,s]),d=Ge("div",t,{ref:n,props:[{role:"group","aria-labelledby":c},i]}),f=j.jsx(Br.Provider,{value:l,children:d});return s?j.jsx(tf,{items:s,children:f}):f});process.env.NODE_ENV!=="production"&&(qi.displayName="ComboboxGroup");const Ki=a.forwardRef(function(t,n){const{render:o,className:r,id:s,...i}=t,{setLabelId:c}=uf(),u=ur(s);return Q(()=>(c(u),()=>{c(void 0)}),[u,c]),Ge("div",t,{ref:n,props:[{id:u},i]})});process.env.NODE_ENV!=="production"&&(Ki.displayName="ComboboxGroupLabel");const zi=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(zi.displayName="ComboboxItemContext");const Yi=a.createContext(!1);process.env.NODE_ENV!=="production"&&(Yi.displayName="ComboboxRowContext");function ff(){return a.useContext(Yi)}const Xi=a.memo(a.forwardRef(function(t,n){const{render:o,className:r,value:s=null,index:i,disabled:c=!1,nativeButton:u=!1,...l}=t,d=a.useRef(!1),f=a.useRef(null),g=Bs({index:i,textRef:f,indexGuessBehavior:_s.GuessFromOrder}),p=st(),x=ff(),{flatFilteredItems:y,hasItems:h}=Bt(),b=A(p,N.open),m=A(p,N.selectionMode),w=A(p,N.readOnly),v=A(p,N.virtualized),E=A(p,N.isItemEqualToValue),S=m!=="none",R=i??(v?ro(y,s,E):g.index),I=g.index!==-1,G=A(p,N.id),K=A(p,N.isActive,R),q=A(p,N.isSelected,s),D=A(p,N.getItemProps),X=a.useRef(null),Z=G!=null&&I?`${G}-${R}`:void 0,B=q&&S;Q(()=>{if(!(I&&(v||i!=null)))return;const pe=p.state.listRef.current;return pe[R]=X.current,()=>{delete pe[R]}},[I,v,R,i,p]),Q(()=>{if(!I||h)return;const se=p.state.valuesRef.current;return se[R]=s,m!=="none"&&p.state.allValuesRef.current.push(s),()=>{delete se[R]}},[I,h,R,s,p,m]),Q(()=>{if(!b){d.current=!1;return}if(!I||h)return;const se=p.state.selectedValue,pe=Array.isArray(se)?se[se.length-1]:se;Kt(s,pe,E)&&p.set("selectedIndex",R)},[I,h,b,p,R,s,E]);const M={disabled:c,selected:B,highlighted:K},U=D({active:K,selected:B});U.id=void 0,U.onFocus=void 0;const{getButtonProps:F,buttonRef:J}=uo({disabled:c,focusableWhenDisabled:!0,native:u});function ne(se){function pe(){p.state.handleSelection(se,s)}p.state.submitOnItemClick?(zt.flushSync(pe),p.state.requestSubmit()):pe()}const ye={id:Z,role:x?"gridcell":"option","aria-selected":S?B:void 0,tabIndex:void 0,onPointerDownCapture(se){d.current=!0,se.preventDefault()},onClick(se){c||w||ne(se.nativeEvent)},onMouseUp(se){const pe=d.current;d.current=!1,!(c||w||se.button!==0||pe||!K)&&ne(se.nativeEvent)}},ue=Ge("div",t,{ref:[J,n,g.ref,X],state:M,props:[U,ye,l,F]}),he=a.useMemo(()=>({selected:B,textRef:f}),[B,f]);return j.jsx(zi.Provider,{value:he,children:ue})}));process.env.NODE_ENV!=="production"&&(Xi.displayName="ComboboxItem");const Ji=a.forwardRef(function(t,n){const{render:o,className:r,children:s,...i}=t,{filteredItems:c}=Bt(),u=st(),l=c.length===0?s:null;return Ge("div",t,{ref:[n,u.state.emptyRef],props:[{children:l,role:"status","aria-live":"polite","aria-atomic":!0},i]})});process.env.NODE_ENV!=="production"&&(Ji.displayName="ComboboxEmpty");const Qi=a.forwardRef(function(t,n){const{className:o,render:r,orientation:s="horizontal",...i}=t;return Ge("div",t,{state:{orientation:s},ref:n,props:[{role:"separator","aria-orientation":s},i]})});process.env.NODE_ENV!=="production"&&(Qi.displayName="Separator");function df(e){const{multiple:t=!1,defaultValue:n,value:o,onValueChange:r,autoComplete:s,...i}=e;return j.jsx(Ju,{...i,selectionMode:t?"multiple":"single",selectedValue:o,defaultSelectedValue:n,onSelectedValueChange:r,formAutoComplete:s})}function pf(e){const{children:t,placeholder:n}=e,o=st(),r=A(o,N.itemToStringLabel),s=A(o,N.selectedValue),i=A(o,N.items),c=A(o,N.selectionMode)==="multiple",u=A(o,N.hasSelectedValue),l=!u&&n!=null&&t==null,d=A(o,N.hasNullItemLabel,l);let f=null;return typeof t=="function"?f=t(s):t!=null?f=t:!u&&n!=null&&!d?f=n:c&&Array.isArray(s)?f=Hu(s,i,r):f=Oi(s,i,r),j.jsx(a.Fragment,{children:f})}const Zi=a.forwardRef(function(t,n){const{render:o,className:r,...s}=t,i=st(),c=A(i,N.open),u=A(i,N.hasSelectionChips),[l,d]=a.useState(void 0);c&&l!==void 0&&d(void 0);const f=a.useRef([]),g=Ge("div",t,{ref:[n,i.state.chipsContainerRef],props:[u?{role:"toolbar"}:We,s]}),p=a.useMemo(()=>({highlightedChipIndex:l,setHighlightedChipIndex:d,chipsRef:f}),[l,d,f]);return j.jsx(Mr.Provider,{value:p,children:j.jsx(Ss,{elementsRef:f,children:g})})});process.env.NODE_ENV!=="production"&&(Zi.displayName="ComboboxChips");const jr=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(jr.displayName="ComboboxChipContext");function mf(){const e=a.useContext(jr);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"useComboboxChipContext must be used within a ComboboxChip":gt(17));return e}const ec=a.forwardRef(function(t,n){const{render:o,className:r,...s}=t,i=st(),{setHighlightedChipIndex:c,chipsRef:u}=Fi(),l=A(i,N.disabled),d=A(i,N.readOnly),f=A(i,N.selectedValue),{ref:g,index:p}=Bs();function x(m){let w=p;if(m.key==="ArrowLeft")m.preventDefault(),p>0?w=p-1:w=void 0;else if(m.key==="ArrowRight")m.preventDefault(),p<f.length-1?w=p+1:w=void 0;else if(m.key==="Backspace"||m.key==="Delete"){const v=p>=f.length-1?f.length-2:p;w=v>=0?v:void 0,Ee(m),i.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),i.state.setSelectedValue(f.filter((E,S)=>S!==p),ce(it,m.nativeEvent))}else m.key==="Enter"||m.key===" "?(Ee(m),w=void 0):m.key==="ArrowDown"||m.key==="ArrowUp"?(Ee(m),i.state.setOpen(!0,ce(mn,m.nativeEvent)),w=void 0):m.key.length===1&&!m.ctrlKey&&!m.metaKey&&!m.altKey&&(w=void 0);return w}const h=Ge("div",t,{ref:[n,g],state:{disabled:l},props:[{tabIndex:-1,"aria-disabled":l||void 0,"aria-readonly":d||void 0,onKeyDown(m){if(l||d)return;const w=x(m);zt.flushSync(()=>{c(w)}),w===void 0?i.state.inputRef.current?.focus():u.current[w]?.focus()},onMouseDown(m){d||(m.preventDefault(),!l&&i.state.inputRef.current?.focus())}},s]}),b=a.useMemo(()=>({index:p}),[p]);return j.jsx(jr.Provider,{value:b,children:h})});process.env.NODE_ENV!=="production"&&(ec.displayName="ComboboxChip");const tc=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,...c}=t,u=st(),{index:l}=mf(),d=A(u,N.disabled),f=A(u,N.readOnly),g=A(u,N.selectedValue),p=A(u,N.isItemEqualToValue),x=d||s,{buttonRef:y,getButtonProps:h}=uo({native:i,disabled:x||f,focusableWhenDisabled:!0}),b={disabled:x};function m(E){const S=u.state.activeIndex;if(S==null)return;const R=ro(u.state.valuesRef.current,E,p);R!==-1&&S===R&&u.state.setIndices({activeIndex:null,type:u.state.keyboardActiveRef.current?"keyboard":"pointer"})}function w(E){const S=ce(nl,E.nativeEvent),R=g[l];return m(R),u.state.setSelectedValue(g.filter((I,G)=>G!==l),S),u.state.inputRef.current?.focus(),S}return Ge("button",t,{ref:[n,y],state:b,props:[{tabIndex:-1,onClick(E){if(x||f)return;w(E).isPropagationAllowed||E.stopPropagation()},onKeyDown(E){x||f||(E.key==="Enter"||E.key===" ")&&(w(E).isPropagationAllowed||Ee(E))}},c,h]})});process.env.NODE_ENV!=="production"&&(tc.displayName="ComboboxChipRemove");const bo=a.createContext(null);function hf({children:e,...t}){const[n,o]=a.useState(null),r=a.useMemo(()=>({anchorElement:n,setAnchorElement:o}),[n]);return j.jsx(bo,{value:r,children:j.jsx(df,{...t,children:e})})}function gf({className:e,label:t,description:n,error:o,children:r,...s}){return j.jsxs(kn.Field,{className:e,...s,children:[t&&j.jsx(kn.FieldLabel,{children:t}),r,n&&j.jsx(kn.FieldDescription,{children:n}),o&&j.jsx(kn.FieldError,{children:o})]})}function bf({...e}){return j.jsx(pf,{"data-slot":"combobox-value",...e})}function nc({className:e,children:t,...n}){return j.jsxs(Li,{"data-slot":"combobox-trigger",className:Ze.cn(He.comboboxTriggerStyles,e),...n,children:[t,j.jsx(sr.Icon,{type:"caret-down",className:Ze.cn(He.comboboxTriggerIconVariants({disabled:n.disabled})),size:"small"})]})}function xf({className:e,...t}){return j.jsx(_i,{"data-slot":"combobox-clear",className:Ze.cn(e),...t,render:j.jsx(Un.InputGroupButton,{variant:"link",size:"icon-xs",className:He.comboboxClearButtonStyles,children:j.jsx(sr.Icon,{className:He.comboboxClearIconStyles,type:"x"})})})}function yf({className:e,children:t,disabled:n=!1,showTrigger:o=!0,showClear:r=!1,...s}){const i=a.use(bo),c=a.useCallback(u=>{i&&i.setAnchorElement(l=>l===u?l:u)},[i]);return j.jsxs(Un.InputGroup,{ref:c,className:Ze.cn(He.comboboxInputGroupStyles,e),children:[j.jsx(Lr,{render:j.jsx(Un.InputGroupInput,{disabled:n}),...s}),j.jsxs(Un.InputGroupAddon,{align:"inline-end",className:He.comboboxInputAddonStyles,children:[o&&j.jsx(nc,{}),r&&j.jsx(xf,{disabled:n})]}),t]})}function vf({className:e,side:t="bottom",sideOffset:n=8,align:o="start",alignOffset:r=0,anchor:s,portalContainer:i,...c}){const l=a.use(bo)?.anchorElement??null,d=a.useCallback(()=>{if(typeof document>"u")return null;const y=document.activeElement;return y?y.closest('[data-slot="combobox-chips"]')??y.closest('[data-slot="input-group"]'):null},[]),f=a.useCallback(()=>{const y=l??d();if(typeof Element>"u"||!s)return y;if(s instanceof Element)return s;if(typeof s=="function"){const h=s();return h instanceof Element?h:y}return"current"in s&&s.current instanceof Element?s.current:y},[s,l,d]),g=a.useCallback(()=>{if(typeof document>"u")return;const y=f();if(y instanceof HTMLElement){const b=y.closest('[role="dialog"]');if(b instanceof HTMLElement)return b}const h=document.activeElement?.closest('[role="dialog"]');return h instanceof HTMLElement?h:void 0},[f]),p=s??l??d,x=i??g();return j.jsx($i,{container:x,children:j.jsx(Wi,{side:t,sideOffset:n,align:o,alignOffset:r,anchor:p,className:He.comboboxPositionerStyles,children:j.jsx(Gi,{"data-slot":"combobox-content","data-chips":!!s,className:Ze.cn(He.comboboxContentStyles,e),...c})})})}function Ef({className:e,...t}){return j.jsx(ji,{"data-slot":"combobox-list",className:Ze.cn("flex flex-col gap-1",e),...t})}function Cf({className:e,children:t,...n}){return j.jsx(Xi,{"data-slot":"combobox-item",className:Ze.cn(He.comboboxItemStyles,e),...n,children:t})}function wf({className:e,...t}){return j.jsx(qi,{"data-slot":"combobox-group",className:Ze.cn(e),...t})}function Rf({className:e,...t}){return j.jsx(Ki,{"data-slot":"combobox-label",className:Ze.cn(He.comboboxLabelStyles,e),...t})}function If({...e}){return j.jsx(Bi,{"data-slot":"combobox-collection",...e})}function Sf({className:e,...t}){return j.jsx(Ji,{"data-slot":"combobox-empty",className:Ze.cn(He.comboboxEmptyStyles,e),...t})}function Of({className:e,...t}){return j.jsx(Qi,{"data-slot":"combobox-separator",className:Ze.cn(He.comboboxSeparatorStyles,e),...t})}function Pf({className:e,disabled:t=!1,...n}){const o=a.use(bo),r=a.useCallback(s=>{o&&o.setAnchorElement(i=>i===s?i:s)},[o]);return j.jsx(Zi,{ref:r,"data-slot":"combobox-chips",className:Ze.cn(He.comboboxChipsVariants({disabled:t}),e),...n})}function Af({className:e,children:t,showRemove:n=!0,...o}){return j.jsxs(ec,{"data-slot":"combobox-chip",className:Ze.cn(He.comboboxChipStyles,e),...o,children:[t,n&&j.jsx(tc,{render:j.jsx(Rc.Button,{className:He.comboboxClearButtonStyles,variant:"ghost",children:j.jsx(sr.Icon,{className:"text-secondary-text",type:"x"})})})]})}function Tf({className:e,...t}){return j.jsx(Lr,{"data-slot":"combobox-chip-input",className:Ze.cn(He.comboboxChipsInputVariants({disabled:t.disabled}),e),...t})}exports.Combobox=hf;exports.ComboboxChip=Af;exports.ComboboxChips=Pf;exports.ComboboxChipsInput=Tf;exports.ComboboxCollection=If;exports.ComboboxContent=vf;exports.ComboboxEmpty=Sf;exports.ComboboxField=gf;exports.ComboboxGroup=wf;exports.ComboboxInput=yf;exports.ComboboxItem=Cf;exports.ComboboxLabel=Rf;exports.ComboboxList=Ef;exports.ComboboxSeparator=Of;exports.ComboboxTrigger=nc;exports.ComboboxValue=bf;
15
+ )`}return j.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});process.env.NODE_ENV!=="production"&&(Si.displayName="InternalBackdrop");function Fu(e){const t=u.useRef(!0);t.current&&(t.current=!1,e())}const Sr=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Sr.displayName="ComboboxRootContext");const Or=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Or.displayName="ComboboxFloatingContext");const Pr=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Pr.displayName="ComboboxDerivedItemsContext");const Ar=u.createContext("");process.env.NODE_ENV!=="production"&&(Ar.displayName="ComboboxInputValueContext");function it(){const e=u.useContext(Sr);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.":bt(22));return e}function go(){const e=u.useContext(Or);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.":bt(23));return e}function jt(){const e=u.useContext(Pr);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.":bt(24));return e}function Tr(){return u.useContext(Ar)}const _u=(e,t)=>Object.is(e,t);function zt(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Bu(e,t,n){return!e||e.length===0?!1:e.some(o=>o===void 0?!1:zt(t,o,n))}function ro(e,t,n){return!e||e.length===0?-1:e.findIndex(o=>o===void 0?!1:zt(o,t,n))}function ju(e,t,n){return e.filter(o=>!zt(t,o,n))}function rr(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Nr(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function $u(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(Nr(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function Qe(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return rr(e)}function pn(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?rr(e.value):rr(e)}function Oi(e,t,n){function o(){return Qe(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??o();if(Array.isArray(t)){const r=Nr(t)?t.flatMap(s=>s.items):t;if(e==null||typeof e!="object"){const s=r.find(i=>i.value===e);return s&&s.label!=null?s.label:o()}if("value"in e){const s=r.find(i=>i&&i.value===e.value);if(s&&s.label!=null)return s.label}}return o()}function Hu(e,t,n){return e.reduce((o,r,s)=>(s>0&&o.push(", "),o.push(j.jsx(u.Fragment,{children:Oi(r,t,n)},s)),o),[])}const N={id:z(e=>e.id),query:z(e=>e.query),items:z(e=>e.items),selectedValue:z(e=>e.selectedValue),hasSelectionChips:z(e=>{const t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:z(e=>{const{selectedValue:t,selectionMode:n}=e;return t==null?!1:n==="multiple"&&Array.isArray(t)?t.length>0:!0}),hasNullItemLabel:z((e,t)=>t?$u(e.items):!1),open:z(e=>e.open),mounted:z(e=>e.mounted),forceMounted:z(e=>e.forceMounted),inline:z(e=>e.inline),activeIndex:z(e=>e.activeIndex),selectedIndex:z(e=>e.selectedIndex),isActive:z((e,t)=>e.activeIndex===t),isSelected:z((e,t)=>{const n=e.isItemEqualToValue,o=e.selectedValue;return Array.isArray(o)?o.some(r=>zt(t,r,n)):zt(t,o,n)}),transitionStatus:z(e=>e.transitionStatus),popupProps:z(e=>e.popupProps),inputProps:z(e=>e.inputProps),triggerProps:z(e=>e.triggerProps),getItemProps:z(e=>e.getItemProps),positionerElement:z(e=>e.positionerElement),listElement:z(e=>e.listElement),triggerElement:z(e=>e.triggerElement),inputElement:z(e=>e.inputElement),popupSide:z(e=>e.popupSide),openMethod:z(e=>e.openMethod),inputInsidePopup:z(e=>e.inputInsidePopup),selectionMode:z(e=>e.selectionMode),listRef:z(e=>e.listRef),labelsRef:z(e=>e.labelsRef),popupRef:z(e=>e.popupRef),emptyRef:z(e=>e.emptyRef),inputRef:z(e=>e.inputRef),keyboardActiveRef:z(e=>e.keyboardActiveRef),chipsContainerRef:z(e=>e.chipsContainerRef),clearRef:z(e=>e.clearRef),valuesRef:z(e=>e.valuesRef),allValuesRef:z(e=>e.allValuesRef),name:z(e=>e.name),disabled:z(e=>e.disabled),readOnly:z(e=>e.readOnly),required:z(e=>e.required),grid:z(e=>e.grid),isGrouped:z(e=>e.isGrouped),virtualized:z(e=>e.virtualized),onOpenChangeComplete:z(e=>e.onOpenChangeComplete),openOnInputClick:z(e=>e.openOnInputClick),itemToStringLabel:z(e=>e.itemToStringLabel),isItemEqualToValue:z(e=>e.isItemEqualToValue),modal:z(e=>e.modal),autoHighlight:z(e=>e.autoHighlight),submitOnItemClick:z(e=>e.submitOnItemClick)};let Es=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Uu={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Wu={valid(e){return e===null?null:e?{[Es.valid]:""}:{[Es.invalid]:""}}},Pi=u.createContext({invalid:void 0,name:void 0,validityData:{state:Uu,errors:[],error:"",value:"",initialValue:null},setValidityData:Re,disabled:void 0,touched:!1,setTouched:Re,dirty:!1,setDirty:Re,filled:!1,setFilled:Re,focused:!1,setFocused:Re,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=We)=>e,getInputValidationProps:(e=We)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(Pi.displayName="FieldRootContext");function In(e=!0){const t=u.useContext(Pi);if(t.setValidityData===Re&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":bt(28));return t}function Gu(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const Ai=u.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Re,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(Ai.displayName="FormContext");function Ti(){return u.useContext(Ai)}function qu(e){const{enabled:t=!0,value:n,id:o,name:r,controlRef:s,commit:i}=e,{formRef:c}=Ti(),{invalid:a,markedDirtyRef:l,validityData:d,setValidityData:f}=In(),g=Y(e.getValue);Q(()=>{if(!t)return;let p=n;p===void 0&&(p=g()),d.initialValue===null&&p!==null&&f(x=>({...x,initialValue:p}))},[t,f,n,d.initialValue,g]),Q(()=>{!t||!o||c.current.fields.set(o,{getValue:g,name:r,controlRef:s,validityData:Gu(d,a),validate(p=!0){let x=n;x===void 0&&(x=g()),l.current=!0,p?Yt.flushSync(()=>i(x)):i(x)}})},[i,s,t,c,g,o,a,l,r,d,n]),Q(()=>{const p=c.current.fields;return()=>{o&&p.delete(o)}},[c,o])}const Ni=u.createContext({controlId:void 0,registerControlId:Re,labelId:void 0,setLabelId:Re,messageIds:[],setMessageIds:Re,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(Ni.displayName="LabelableContext");function kr(){return u.useContext(Ni)}function ki(e={}){const{id:t,implicit:n=!1,controlRef:o}=e,{controlId:r,registerControlId:s}=kr(),i=ur(t),c=n?r:void 0,a=ut(()=>Symbol("labelable-control")),l=u.useRef(!1),d=u.useRef(t!=null),f=Y(()=>{!l.current||s===Re||(l.current=!1,s(a.current,void 0))});return Q(()=>{if(s===Re)return;let g;if(n){const p=o?.current;Ce(p)&&p.closest("label")!=null?g=t??null:g=c??i}else if(t!=null)d.current=!0,g=t;else if(d.current)g=i;else{f();return}if(g===void 0){f();return}l.current=!0,s(a.current,g)},[t,o,c,s,n,i,a,f]),u.useEffect(()=>f,[f]),r??i}function Ku(e,t){return(n,o)=>{if(n==null)return!1;const r=Qe(n,t);return e.contains(r,o)}}function zu(e,t,n){return(o,r)=>{if(o==null)return!1;if(!r)return!0;const s=Qe(o,t),i=n!=null?Qe(n,t):"";return i&&e.contains(i,r)&&i.length===r.length?!0:e.contains(s,r)}}const Cs=new Map;function Mi(e){return Array.isArray(e)?e.map(t=>Mi(t)).join(","):e==null?"":String(e)}function Yu(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${Mi(e.locale)}|${JSON.stringify(t)}`,o=Cs.get(n);if(o)return o;const r=new Intl.Collator(e.locale,t),s={contains(i,c,a){if(!c)return!0;const l=Qe(i,a);for(let d=0;d<=l.length-c.length;d+=1)if(r.compare(l.slice(d,d+c.length),c)===0)return!0;return!1},startsWith(i,c,a){if(!c)return!0;const l=Qe(i,a);return r.compare(l.slice(0,c.length),c)===0},endsWith(i,c,a){if(!c)return!0;const l=Qe(i,a),d=c.length;return l.length>=d&&r.compare(l.slice(l.length-d),c)===0}};return Cs.set(n,s),s}const Xu=Yu;function Hn(e,t){const n=u.useRef(e),o=Y(t);Q(()=>{n.current!==e&&o(n.current)},[e,o]),Q(()=>{n.current=e},[e])}const Di=Symbol("none"),Gt={value:Di,index:-1};function Ju(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:o=null,selectedValue:r,onSelectedValueChange:s,defaultInputValue:i,inputValue:c,selectionMode:a="none",onItemHighlighted:l,name:d,disabled:f=!1,readOnly:g=!1,required:p=!1,inputRef:x,grid:y=!1,items:h,filteredItems:b,filter:m,openOnInputClick:w=!0,autoHighlight:v=!1,keepHighlight:E=!1,highlightItemOnHover:S=!0,loopFocus:R=!0,itemToStringLabel:I,itemToStringValue:G,isItemEqualToValue:K=_u,virtualized:q=!1,inline:D=!1,fillInputOnItemPress:X=!0,modal:Z=!1,limit:B=-1,autoComplete:M="list",formAutoComplete:U,locale:F,submitOnItemClick:J=!1}=e,{clearErrors:ne}=Ti(),{setDirty:ye,validityData:ue,shouldValidateOnChange:he,setFilled:se,name:pe,disabled:Me,setTouched:Ie,setFocused:we,validationMode:re,validation:fe}=In(),xe=ki({id:t}),O=Xu({locale:F}),[k,V]=u.useState(!1),[ie,C]=u.useState(null),L=u.useRef([]),_=u.useRef([]),P=u.useRef(null),$=u.useRef(null),T=u.useRef(null),W=u.useRef(!0),te=u.useRef(!1),ae=u.useRef(null),De=u.useRef(null),Ke=u.useRef(null),Se=u.useRef(Gt),ge=u.useRef(null),Ae=u.useRef([]),ze=u.useRef([]),Ue=Me||f,tt=pe??d,Be=a==="multiple",Ye=a==="single",Ct=c!==void 0||i!==void 0,ft=h!==void 0,ve=b!==void 0;let be;v==="always"?be="always":be=v?"input-change":!1;const[oe,Xe]=ko({controlled:r,default:Be?o??Dn:o,name:"Combobox",state:"selectedValue"}),Je=u.useMemo(()=>m===null?()=>!0:m!==void 0?m:Ye&&!k?zu(O,I,oe):Ku(O,I),[m,Ye,oe,k,O,I]),$t=ut(()=>Ct?i??"":Ye?Qe(oe,I):"").current,[Ve,cn]=ko({controlled:c,default:$t,name:"Combobox",state:"inputValue"}),[Oe,xo]=ko({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),dt=Nr(h),je=ie??(Ve===""?"":String(Ve).trim()),ln=Ye?Qe(oe,I):"",Jt=Ye&&!k&&je!==""&&ln!==""&&ln.length===je.length&&O.contains(ln,je),Pt=Jt?"":je,Sn=ft&&ve&&Jt,At=u.useMemo(()=>h?dt?h.flatMap(H=>H.items):h:Dn,[h,dt]),pt=u.useMemo(()=>{if(b&&!Sn)return b;if(!h)return Dn;if(dt){const ee=h,le=[];let Te=0;for(const Le of ee){if(B>-1&&Te>=B)break;const Fe=Pt===""?Le.items:Le.items.filter(kn=>Je(kn,Pt,I));if(Fe.length===0)continue;const Ht=B>-1?B-Te:1/0,Ut=Fe.slice(0,Ht);if(Ut.length>0){const kn={...Le,items:Ut};le.push(kn),Te+=Ut.length}}return le}if(Pt==="")return B>-1?At.slice(0,B):At;const H=[];for(const ee of At){if(B>-1&&H.length>=B)break;Je(ee,Pt,I)&&H.push(ee)}return H},[b,Sn,h,dt,Pt,B,Je,I,At]),nt=u.useMemo(()=>dt?pt.flatMap(ee=>ee.items):pt,[pt,dt]),de=ut(()=>new wi({id:xe,selectedValue:oe,open:Oe,filter:Je,query:je,items:h,selectionMode:a,listRef:L,labelsRef:_,popupRef:P,emptyRef:T,inputRef:$,keyboardActiveRef:W,chipsContainerRef:ae,clearRef:De,valuesRef:Ae,allValuesRef:ze,selectionEventRef:Ke,name:tt,disabled:Ue,readOnly:g,required:p,grid:y,isGrouped:dt,virtualized:q,openOnInputClick:w,itemToStringLabel:I,isItemEqualToValue:K,modal:Z,autoHighlight:be,submitOnItemClick:J,hasInputValue:Ct,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:D,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||Re,setOpen:Re,setInputValue:Re,setSelectedValue:Re,setIndices:Re,onItemHighlighted:Re,handleSelection:Re,getItemProps:()=>We,forceMount:Re,requestSubmit:Re})).current,Tt=a==="none"?Ve:oe,oc=u.useMemo(()=>a==="none"?Tt:Array.isArray(oe)?oe.map(H=>pn(H,G)):pn(oe,G),[Tt,G,a,oe]),yo=Y(l),vo=Y(n),On=A(de,N.activeIndex),rc=A(de,N.selectedIndex),Pn=A(de,N.positionerElement),$r=A(de,N.listElement),an=A(de,N.triggerElement),Eo=A(de,N.inputElement),mt=A(de,N.inline),Nt=A(de,N.inputInsidePopup),sc=lt(an),{mounted:Hr,setMounted:ic,transitionStatus:Co}=Fs(Oe),{openMethod:Ur,triggerProps:wo,reset:cc}=Pu(Oe);qu({id:xe,name:tt,commit:fe.commit,value:Tt,controlRef:Nt?sc:$,getValue:()=>oc});const An=Y(()=>{h?_.current=nt.map(H=>Qe(H,I)):de.set("forceMounted",!0)}),lc=u.useRef(oe);Q(()=>{oe!==lc.current&&An()},[An,oe]);const ht=Y(H=>{de.update(H);const ee=H.type||"none";if(H.activeIndex!==void 0)if(H.activeIndex===null)Se.current!==Gt&&(Se.current=Gt,yo(void 0,fn(ee,void 0,{index:-1})));else{const le=Ae.current[H.activeIndex];Se.current={value:le,index:H.activeIndex},yo(le,fn(ee,void 0,{index:H.activeIndex}))}}),xt=Y((H,ee)=>{if(te.current=ee.reason===kt,e.onInputValueChange?.(H,ee),!ee.isCanceled){if(ee.reason===Qt){const le=ee.event,Te=le.inputType;if(le.type==="compositionend"||Te!=null&&Te!==""&&Te!=="insertReplacementText"){const Fe=H.trim()!=="";Fe&&V(!0),ge.current={hasQuery:Fe},Fe&&be&&de.state.activeIndex==null&&de.set("activeIndex",0)}}cn(H)}}),un=Y((H,ee)=>{if(Oe!==H&&(ee.reason==="escape-key"&&ft&&nt.length===0&&!de.state.emptyRef.current&&ee.allowPropagation(),e.onOpenChange?.(H,ee),!ee.isCanceled&&(!H&&k&&(Ye?(mt||C(je),je===""&&V(!1)):Be&&(mt||Nt?ht({activeIndex:null}):C(je),xt("",ce(kt,ee.event)))),xo(H),!H&&Nt&&(ee.reason===so||ee.reason===lr)&&(Ie(!0),we(!1),re==="onBlur")))){const le=a==="none"?Ve:oe;fe.commit(le)}}),Tn=Y((H,ee)=>{if(s?.(H,ee),ee.isCanceled)return;Xe(H),(a==="none"&&P.current&&X||Ye&&!de.state.inputInsidePopup)&&xt(Qe(H,I),ce(ee.reason,ee.event)),Ye&&H!=null&&ee.reason!==Qt&&k&&!mt&&C(je)}),ac=Y((H,ee)=>{let le=ee;if(le===void 0){if(On===null)return;le=Ae.current[On]}const Te=Ze(H),Le=Ke.current??H;Ke.current=null;const Fe=ce(tl,Le),Ht=Te?.closest("a")?.getAttribute("href");if(Ht){Ht.startsWith("#")&&un(!1,Fe);return}if(Be){const Ut=Array.isArray(oe)?oe:[],Ec=Bu(Ut,le,de.state.isItemEqualToValue)?ju(Ut,le,de.state.isItemEqualToValue):[...Ut,le];if(Tn(Ec,Fe),!($.current?$.current.value.trim()!=="":!1))return;de.state.inputInsidePopup?xt("",ce(kt,Fe.event)):un(!1,Fe)}else Tn(le,Fe),un(!1,Fe)}),Ro=Y(()=>{if(!de.state.submitOnItemClick)return;const H=de.state.inputElement?.form;H&&typeof H.requestSubmit=="function"&&H.requestSubmit()}),Io=Y(()=>{if(ic(!1),vo?.(!1),V(!1),cc(),C(null),ht(a==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Be&&$.current&&$.current.value!==""&&!te.current&&xt("",ce(kt)),Ye)if(de.state.inputInsidePopup)$.current&&$.current.value!==""&&xt("",ce(kt));else{const H=Qe(oe,I);$.current&&$.current.value!==H&&xt(H,ce(H===""?kt:ct))}}),uc=u.useMemo(()=>mt&&Pn?{current:Pn.closest('[role="dialog"]')}:P,[mt,Pn]);vr({enabled:!e.actionsRef,open:Oe,ref:uc,onComplete(){Oe||Io()}}),u.useImperativeHandle(e.actionsRef,()=>({unmount:Io}),[Io]),Q(function(){if(Oe||a==="none")return;const ee=h?At:ze.current;if(Be){const le=Array.isArray(oe)?oe:[],Te=le[le.length-1],Le=ro(ee,Te,K);ht({selectedIndex:Le===-1?null:Le})}else{const le=ro(ee,oe,K);ht({selectedIndex:le===-1?null:le})}},[Oe,oe,h,a,At,Be,K,ht]),Q(()=>{h&&(Ae.current=nt,L.current.length=nt.length)},[h,nt]),Q(()=>{const H=ge.current;if(H&&(H.hasQuery?be&&de.set("activeIndex",0):be==="always"&&de.set("activeIndex",0),ge.current=null),!Oe&&!mt)return;const le=ft||ve?nt:Ae.current,Te=de.state.activeIndex;if(Te==null){if(be==="always"&&le.length>0){de.set("activeIndex",0);return}Se.current!==Gt&&(Se.current=Gt,de.state.onItemHighlighted(void 0,fn(ct,void 0,{index:-1})));return}if(Te>=le.length){Se.current!==Gt&&(Se.current=Gt,de.state.onItemHighlighted(void 0,fn(ct,void 0,{index:-1}))),de.set("activeIndex",null);return}const Le=le[Te],Fe=Se.current.value,Ht=Fe!==Di&&zt(Le,Fe,de.state.isItemEqualToValue);(Se.current.index!==Te||!Ht)&&(Se.current={value:Le,index:Te},de.state.onItemHighlighted(Le,fn(ct,void 0,{index:Te})))},[On,be,ve,ft,nt,mt,Oe,de]),Q(()=>{if(a==="none"){se(String(Ve)!=="");return}se(Be?Array.isArray(oe)&&oe.length>0:oe!=null)},[se,a,Ve,oe,Be]),u.useEffect(()=>{ft&&be&&nt.length===0&&ht({activeIndex:null})},[ft,be,nt.length,ht]),Hn(je,()=>{!Oe||je===""||je===String($t)||V(!0)}),Hn(oe,()=>{if(a!=="none"&&(ne(tt),ye(oe!==ue.initialValue),he()?fe.commit(oe):fe.commit(oe,!0),Ye&&!Ct&&!Nt)){const H=Qe(oe,I);Ve!==H&&xt(H,ce(ct))}}),Hn(Ve,()=>{a==="none"&&(ne(tt),ye(Ve!==ue.initialValue),he()?fe.commit(Ve):fe.commit(Ve,!0))}),Hn(h,()=>{if(!Ye||Ct||Nt||k)return;const H=Qe(oe,I);Ve!==H&&xt(H,ce(ct))});const Nn=Ri({open:mt?!0:Oe,onOpenChange:un,elements:{reference:Nt?an:Eo,floating:Pn}});let So,Oo;mt||(So=y?"grid":"listbox",Oo=Oe?"true":"false");const fc=u.useMemo(()=>{const H=Eo?.tagName==="INPUT",ee=H||Oe,le=H?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return ee&&(le.role="combobox",le["aria-expanded"]=Oo,le["aria-haspopup"]=So,le["aria-controls"]=Oe?$r?.id:void 0,le["aria-autocomplete"]=M),{reference:le,floating:{role:"presentation"}}},[Eo,Oe,Oo,So,$r?.id,M]),dc=mi(Nn,{enabled:!g&&!Ue&&w,event:"mousedown-only",toggle:!1,touchOpenDelay:Nt?0:50,reason:ol}),pc=au(Nn,{enabled:!g&&!Ue&&!mt,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:mt?!0:void 0,outsidePress(H){const ee=Ze(H);return!me(an,ee)&&!me(De.current,ee)&&!me(ae.current,ee)}}),mc=Iu(Nn,{enabled:!g&&!Ue,id:xe,listRef:L,activeIndex:On,selectedIndex:rc,virtual:!0,loopFocus:R,allowEscape:R&&!be,focusItemOnOpen:k||a==="none"&&!be?!1:"auto",focusItemOnHover:S,resetOnPointerLeave:!E,cols:y?2:1,orientation:y?"horizontal":void 0,disabledIndices:Dn,onNavigate(H,ee){!ee&&!Oe||Co==="ending"||ht(ee?{activeIndex:H,type:W.current?"keyboard":"pointer"}:{activeIndex:H})}}),{getReferenceProps:Po,getFloatingProps:Ao,getItemProps:To}=Eu([fc,dc,pc,mc]);Fu(()=>{de.update({inline:D,popupProps:Ao(),inputProps:Po(),triggerProps:wo,getItemProps:To,setOpen:un,setInputValue:xt,setSelectedValue:Tn,setIndices:ht,onItemHighlighted:yo,handleSelection:ac,forceMount:An,requestSubmit:Ro})}),Q(()=>{de.update({id:xe,selectedValue:oe,open:Oe,mounted:Hr,transitionStatus:Co,items:h,inline:D,popupProps:Ao(),inputProps:Po(),triggerProps:wo,openMethod:Ur,getItemProps:To,selectionMode:a,name:tt,disabled:Ue,readOnly:g,required:p,grid:y,isGrouped:dt,virtualized:q,onOpenChangeComplete:vo,openOnInputClick:w,itemToStringLabel:I,modal:Z,autoHighlight:be,isItemEqualToValue:K,submitOnItemClick:J,hasInputValue:Ct,requestSubmit:Ro})},[de,xe,oe,Oe,Hr,Co,h,Ao,Po,To,Ur,wo,a,tt,Ue,g,p,fe,y,dt,q,vo,w,I,Z,K,J,Ct,D,Ro,be]);const hc=vn(x,fe.inputRef),gc=u.useMemo(()=>({query:je,hasItems:ft,filteredItems:pt,flatFilteredItems:nt}),[je,ft,pt,nt]),bc=u.useMemo(()=>Array.isArray(Tt)?"":pn(Tt,G),[Tt,G]),xc=Be&&Array.isArray(oe)&&oe.length>0,No=Be||a==="none"?void 0:tt,yc=u.useMemo(()=>!Be||!Array.isArray(oe)||!tt?null:oe.map(H=>{const ee=pn(H,G);return j.jsx("input",{type:"hidden",name:tt,value:ee},ee)}),[Be,oe,tt,G]),vc=j.jsxs(u.Fragment,{children:[e.children,j.jsx("input",{...fe.getInputValidationProps({onFocus(){if(Nt){an?.focus();return}($.current||an)?.focus()},onChange(H){if(H.nativeEvent.defaultPrevented)return;const ee=H.target.value,le=ce(ct,H.nativeEvent);function Te(){if(Be)return;if(a==="none"){ye(ee!==ue.initialValue),xt(ee,le),he()&&fe.commit(ee);return}const Le=Ae.current.find(Fe=>pn(Fe,G).toLowerCase()===ee.toLowerCase());Le!=null&&(ye(Le!==ue.initialValue),Tn?.(Le,le),he()&&fe.commit(Le))}h?Te():(An(),queueMicrotask(Te))}}),id:xe&&No==null?`${xe}-hidden-input`:void 0,name:No,autoComplete:U,disabled:Ue,required:p&&!xc,readOnly:g,value:bc,ref:hc,style:No?aa:Er,tabIndex:-1,"aria-hidden":!0}),yc]});return j.jsx(Sr.Provider,{value:de,children:j.jsx(Or.Provider,{value:Nn,children:j.jsx(Pr.Provider,{value:gc,children:j.jsx(Ar.Provider,{value:Ve,children:vc})})})})}const Vi={...Vu,...Wu,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null};function Qu(e){const t=e.getBoundingClientRect();if(process.env.NODE_ENV!=="production")return t;const n=window.getComputedStyle(e,"::before"),o=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||o.content!=="none"))return t;const s=parseFloat(n.width)||0,i=parseFloat(n.height)||0,c=parseFloat(o.width)||0,a=parseFloat(o.height)||0,l=Math.max(t.width,s,c),d=Math.max(t.height,i,a),f=l-t.width,g=d-t.height;return{left:t.left-f/2,right:t.right+f/2,top:t.top-g/2,bottom:t.bottom+g/2}}const Un=2,Li=u.forwardRef(function(t,n){const{render:o,className:r,nativeButton:s=!0,disabled:i=!1,id:c,...a}=t,{state:l,disabled:d,setTouched:f,setFocused:g,validationMode:p,validation:x}=In(),{labelId:y}=kr(),h=it(),{filteredItems:b}=jt(),m=A(h,N.selectionMode),w=A(h,N.disabled),v=A(h,N.readOnly),E=A(h,N.required),S=A(h,N.mounted),R=A(h,N.popupSide),I=A(h,N.positionerElement),G=A(h,N.listElement),K=A(h,N.triggerProps),q=A(h,N.triggerElement),D=A(h,N.inputInsidePopup),X=A(h,N.id),Z=A(h,N.open),B=A(h,N.selectedValue),M=A(h,N.activeIndex),U=A(h,N.selectedIndex),F=A(h,N.hasSelectedValue),J=go(),ne=Tr(),ye=qt(),ue=d||w||i,he=b.length===0,se=S&&I?R:null;ki({id:D?c:void 0});const pe=D?c??X:c,Me=u.useRef("");function Ie(C){Me.current=C.pointerType}const we=J.useState("domReferenceElement");u.useEffect(()=>{D&&q&&q!==we&&J.set("domReferenceElement",q)},[q,we,J,D]);const{reference:re}=Su(J,{enabled:!Z&&!v&&!w&&m==="single",listRef:h.state.labelsRef,activeIndex:M,selectedIndex:U,onMatch(C){const L=h.state.valuesRef.current[C];L!==void 0&&h.state.setSelectedValue(L,ce("none"))}}),{reference:fe}=mi(J,{enabled:!v&&!w,event:"mousedown"}),{buttonRef:xe,getButtonProps:O}=uo({native:s,disabled:ue}),k={...l,open:Z,disabled:ue,popupSide:se,listEmpty:he,placeholder:!F},V=Y(C=>{h.set("triggerElement",C)});return qe("button",t,{ref:[n,xe,V],state:k,props:[K,fe,re,{id:pe,tabIndex:D?0:-1,role:D?"combobox":void 0,"aria-expanded":Z?"true":"false","aria-haspopup":D?"dialog":"listbox","aria-controls":Z?G?.id:void 0,"aria-required":D&&E||void 0,"aria-labelledby":y,onPointerDown:Ie,onPointerEnter:Ie,onFocus(){g(!0),!(ue||v)&&ye.start(0,h.state.forceMount)},onBlur(C){if(!me(I,C.relatedTarget)&&(f(!0),g(!1),p==="onBlur")){const L=m==="none"?ne:B;x.commit(L)}},onMouseDown(C){if(ue||v||(D||J.set("domReferenceElement",C.currentTarget),h.state.forceMount(),Me.current!=="touch"&&(h.state.inputRef.current?.focus(),D||C.preventDefault()),Z))return;const L=Ne(C.currentTarget);function _(P){if(!q)return;const $=Ze(P),T=h.state.positionerElement,W=h.state.listElement;if(me(q,$)||me(T,$)||me(W,$)||$===q)return;const te=Qu(q),ae=P.clientX>=te.left-Un&&P.clientX<=te.right+Un,De=P.clientY>=te.top-Un&&P.clientY<=te.bottom+Un;ae&&De||h.state.setOpen(!1,ce("cancel-open",P))}D&&L.addEventListener("mouseup",_,{once:!0})},onKeyDown(C){ue||v||(C.key==="ArrowDown"||C.key==="ArrowUp")&&(Ee(C),h.state.setOpen(!0,ce(hn,C.nativeEvent)),h.state.inputRef.current?.focus())}},x?x.getValidationProps(a):a,O],stateAttributesMapping:Vi})});process.env.NODE_ENV!=="production"&&(Li.displayName="ComboboxTrigger");const Mr=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Mr.displayName="ComboboxChipsContext");function Fi(){return u.useContext(Mr)}const Dr=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Dr.displayName="ComboboxPositionerContext");function Vr(e){const t=u.useContext(Dr);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component":bt(21));return t}const Lr=u.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,id:i,...c}=t,{state:a,disabled:l,setTouched:d,setFocused:f,validationMode:g,validation:p}=In(),{labelId:x}=kr(),y=Fi(),b=!!Vr(!0),m=it(),{filteredItems:w}=jt(),v=Tr(),E=Ps(),S=A(m,N.required),R=A(m,N.disabled),I=A(m,N.readOnly),G=A(m,N.name),K=A(m,N.selectionMode),q=A(m,N.autoHighlight),D=A(m,N.inputProps),X=A(m,N.triggerProps),Z=A(m,N.open),B=A(m,N.mounted),M=A(m,N.selectedValue),U=A(m,N.popupSide),F=A(m,N.positionerElement),J=A(m,N.id),ne=A(m,N.inline),ye=!!q,ue=B&&F?U:null,he=l||R||s,se=w.length===0,Me=ur(i??(b||ne?void 0:J)),[Ie,we]=u.useState(null),re=u.useRef(!1),fe=u.useRef(null),xe=u.useRef(!1),O=Y(C=>{const L=b||m.state.inline;L&&!m.state.hasInputValue&&m.state.setInputValue("",ce(ct)),m.update({inputElement:C,inputInsidePopup:L})}),k={...a,open:Z,disabled:he,readOnly:I,popupSide:ue,listEmpty:se};function V(C){if(!y)return;let L;const{highlightedChipIndex:_}=y;if(_!==void 0){if(C.key==="ArrowLeft")C.preventDefault(),_>0?L=_-1:L=void 0;else if(C.key==="ArrowRight")C.preventDefault(),_<M.length-1?L=_+1:L=void 0;else if(C.key==="Backspace"||C.key==="Delete"){C.preventDefault();const P=_>=M.length-1?M.length-2:_;L=P>=0?P:void 0,m.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return L}return C.key==="ArrowLeft"&&(C.currentTarget.selectionStart??0)===0&&M.length>0?(C.preventDefault(),L=Math.max(M.length-1,0)):C.key==="Backspace"&&C.currentTarget.value===""&&M.length>0&&(m.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),C.preventDefault()),L}return qe("input",t,{state:k,ref:[n,m.state.inputRef,O],props:[D,X,{type:"text",value:t.value??Ie??v,"aria-readonly":I||void 0,"aria-required":S||void 0,"aria-labelledby":x,disabled:he,readOnly:I,required:K==="none"?S:void 0,...K==="none"&&G&&{name:G},id:Me,onFocus(){if(f(!0),!ne||!xe.current)return;xe.current=!1;const C=fe.current;C==null||!Object.hasOwn(m.state.valuesRef.current,C)||m.state.setIndices({activeIndex:C})},onBlur(){d(!0),f(!1);const C=m.state.activeIndex;if(ne&&C!==null&&q!=="always"&&(fe.current=C,xe.current=!0,m.state.setIndices({activeIndex:null})),g==="onBlur"){const L=K==="none"?v:M;p.commit(L)}},onCompositionStart(C){zn||(re.current=!0,we(C.currentTarget.value))},onCompositionEnd(C){re.current=!1;const L=C.currentTarget.value;we(null),m.state.setInputValue(L,ce(Qt,C.nativeEvent))},onChange(C){const L=C.nativeEvent.inputType,_=!L||L==="insertReplacementText",P=re.current||!_;if(re.current){const te=C.currentTarget.value;we(te),te===""&&!m.state.openOnInputClick&&!m.state.inputInsidePopup&&m.state.setOpen(!1,ce(kt,C.nativeEvent));const ae=te.trim(),De=ye&&ae!=="";!I&&!he&&ae&&P&&(m.state.setOpen(!0,ce(Qt,C.nativeEvent)),ye||m.state.setIndices({activeIndex:null,selectedIndex:null,type:m.state.keyboardActiveRef.current?"keyboard":"pointer"})),Z&&m.state.activeIndex!==null&&!De&&m.state.setIndices({activeIndex:null,selectedIndex:null,type:m.state.keyboardActiveRef.current?"keyboard":"pointer"});return}m.state.setInputValue(C.currentTarget.value,ce(Qt,C.nativeEvent));const $=C.currentTarget.value==="",T=ce(kt,C.nativeEvent);$&&!m.state.inputInsidePopup&&(K==="single"&&m.state.setSelectedValue(null,T),m.state.openOnInputClick||m.state.setOpen(!1,T));const W=C.currentTarget.value.trim();!I&&!he&&W&&P&&(m.state.setOpen(!0,ce(Qt,C.nativeEvent)),ye||m.state.setIndices({activeIndex:null,selectedIndex:null,type:m.state.keyboardActiveRef.current?"keyboard":"pointer"})),Z&&m.state.activeIndex!==null&&!ye&&m.state.setIndices({activeIndex:null,selectedIndex:null,type:m.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(C){if(he||I||C.ctrlKey||C.shiftKey||C.altKey||C.metaKey)return;m.state.keyboardActiveRef.current=!0;const L=C.currentTarget,_=L.scrollWidth-L.clientWidth,P=E==="rtl";if(C.key==="Home"){Ee(C);const W=Jr&&P?L.value.length:0;L.setSelectionRange(W,W),L.scrollLeft=0;return}if(C.key==="End"){Ee(C);const W=Jr&&P?0:L.value.length;L.setSelectionRange(W,W),L.scrollLeft=P?-_:_;return}if(!B&&C.key==="Escape"){const W=K==="multiple"&&Array.isArray(M)?M.length===0:M===null,te=ce(Ds,C.nativeEvent),ae=K==="multiple"?[]:null;m.state.setInputValue("",te),m.state.setSelectedValue(ae,te),!W&&!m.state.inline&&!te.isPropagationAllowed&&C.stopPropagation();return}if(y&&C.key==="Backspace"&&L.value===""&&y.highlightedChipIndex===void 0&&Array.isArray(M)&&M.length>0){const W=M.slice(0,-1);m.state.setIndices({activeIndex:null,selectedIndex:null,type:m.state.keyboardActiveRef.current?"keyboard":"pointer"}),m.state.setSelectedValue(W,ce(ct,C.nativeEvent));return}const $=y?.highlightedChipIndex!==void 0,T=V(C);if(y?.setHighlightedChipIndex(T),T!==void 0?y?.chipsRef.current[T]?.focus():$&&m.state.inputRef.current?.focus(),C.which!==229&&C.key==="Enter"&&Z){const W=m.state.activeIndex,te=C.nativeEvent;if(W===null){m.state.setOpen(!1,ce(ct,te));return}Ee(C);const ae=m.state.listRef.current[W];ae&&(m.state.selectionEventRef.current=te,ae.click(),m.state.selectionEventRef.current=null)}},onPointerMove(){m.state.keyboardActiveRef.current=!1},onPointerDown(){m.state.keyboardActiveRef.current=!1}},p?p.getValidationProps(c):c],stateAttributesMapping:Vi})});process.env.NODE_ENV!=="production"&&(Lr.displayName="ComboboxInput");const Zu={...Ls,...Du},_i=u.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,keepMounted:c=!1,...a}=t,{disabled:l}=In(),d=it(),f=A(d,N.selectionMode),g=A(d,N.disabled),p=A(d,N.readOnly),x=A(d,N.open),y=A(d,N.selectedValue),h=A(d,N.hasSelectionChips),b=Tr();let m=!1;f==="none"?m=b!=="":f==="single"?m=y!=null:m=h;const w=l||g||s,{buttonRef:v,getButtonProps:E}=uo({native:i,disabled:w}),{mounted:S,transitionStatus:R,setMounted:I}=Fs(m),G={disabled:w,open:x,transitionStatus:R};vr({open:m,ref:d.state.clearRef,onComplete(){m||I(!1)}});const K=qe("button",t,{state:G,ref:[n,v,d.state.clearRef],props:[{tabIndex:-1,children:"x",onMouseDown(D){D.preventDefault()},onClick(D){if(w||p)return;const X=d.state.keyboardActiveRef;d.state.setInputValue("",ce(qr,D.nativeEvent)),f!=="none"?(d.state.setSelectedValue(Array.isArray(y)?[]:null,ce(qr,D.nativeEvent)),d.state.setIndices({activeIndex:null,selectedIndex:null,type:X.current?"keyboard":"pointer"})):d.state.setIndices({activeIndex:null,type:X.current?"keyboard":"pointer"}),d.state.inputRef.current?.focus()}},a,E],stateAttributesMapping:Zu});return c||S?K:null});process.env.NODE_ENV!=="production"&&(_i.displayName="ComboboxClear");const Fr=u.createContext(null);process.env.NODE_ENV!=="production"&&(Fr.displayName="GroupCollectionContext");function ef(){return u.useContext(Fr)}function tf(e){const{children:t,items:n}=e,o=u.useMemo(()=>({items:n}),[n]);return j.jsx(Fr.Provider,{value:o,children:t})}function Bi(e){const{children:t}=e,{filteredItems:n}=jt(),o=ef(),r=o?o.items:n;return r?j.jsx(u.Fragment,{children:r.map(t)}):null}const ji=u.forwardRef(function(t,n){var o;const{render:r,className:s,children:i,...c}=t,a=it(),l=go(),d=!!Vr(!0),{filteredItems:f}=jt(),g=A(a,N.items),p=A(a,N.labelsRef),x=A(a,N.listRef),y=A(a,N.selectionMode),h=A(a,N.grid),b=A(a,N.popupProps),m=A(a,N.disabled),w=A(a,N.readOnly),v=A(a,N.virtualized),E=y==="multiple",S=f.length===0,R=Y(X=>{a.set("positionerElement",X)}),I=Y(X=>{a.set("listElement",X)}),G=u.useMemo(()=>typeof i=="function"?o||(o=j.jsx(Bi,{children:i})):i,[i]),K={empty:S},q=l.useState("floatingId"),D=qe("div",t,{state:K,ref:[n,I,d?null:R],props:[b,{children:G,tabIndex:-1,id:q,role:h?"grid":"listbox","aria-multiselectable":E?"true":void 0,onKeyDown(X){if(!(m||w)&&X.key==="Enter"){const Z=a.state.activeIndex;if(Z==null)return;Ee(X);const B=X.nativeEvent,M=a.state.listRef.current[Z];M&&(a.state.selectionEventRef.current=B,M.click(),a.state.selectionEventRef.current=null)}},onKeyDownCapture(){a.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){a.state.keyboardActiveRef.current=!1}},c]});return v?D:j.jsx(Ss,{elementsRef:x,labelsRef:g?void 0:p,children:D})});process.env.NODE_ENV!=="production"&&(ji.displayName="ComboboxList");const _r=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(_r.displayName="ComboboxPortalContext");function nf(){const e=u.useContext(_r);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Portal> is missing.":bt(20));return e}const $i=u.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,s=it(),i=A(s,N.mounted),c=A(s,N.forceMounted);return i||o||c?j.jsx(_r.Provider,{value:o,children:j.jsx(pi,{ref:n,...r})}):null});process.env.NODE_ENV!=="production"&&($i.displayName="ComboboxPortal");const of=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:a}=t,{element:l,padding:d=0,offsetParent:f="real"}=Ot(e,t)||{};if(l==null)return{};const g=Xs(d),p={x:n,y:o},x=yr(r),y=xr(x),h=await i.getDimensions(l),b=x==="y",m=b?"top":"left",w=b?"bottom":"right",v=b?"clientHeight":"clientWidth",E=s.reference[y]+s.reference[x]-p[x]-s.floating[y],S=p[x]-s.reference[x],R=f==="real"?await i.getOffsetParent?.(l):c.floating;let I=c.floating[v]||s.floating[y];(!I||!await i.isElement?.(R))&&(I=c.floating[v]||s.floating[y]);const G=E/2-S/2,K=I/2-h[y]/2-1,q=Math.min(g[m],K),D=Math.min(g[w],K),X=q,Z=I-h[y]-D,B=I/2-h[y]/2+G,M=Zo(X,B,Z),U=!a.arrow&&Bt(r)!=null&&B!==M&&s.reference[y]/2-(B<X?q:D)-h[y]/2<0,F=U?B<X?B-X:B-Z:0;return{[x]:p[x]+F,data:{[x]:M,centerOffset:B-M-F,...U&&{alignmentOffset:F}},reset:U}}}),rf=(e,t)=>({...of(e),options:[e,t]}),sf={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,s=t===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:(await iu().fn(e)).data?.referenceHidden||s}}}},cf={sideX:"left",sideY:"top"};function Hi(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function ws(e,t,n){const{rects:o,placement:r}=e;return{side:Hi(t,rt(r),n),align:Bt(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function lf(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:a=5,sticky:l=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,keepMounted:g=!1,floatingRootContext:p,mounted:x,collisionAvoidance:y,shiftCrossAxis:h=!1,nodeId:b,adaptiveOrigin:m,lazyFlip:w=!1,externalTree:v}=e,[E,S]=u.useState(null);!x&&E!==null&&S(null);const R=y.side||"flip",I=y.align||"flip",G=y.fallbackAxisSide||"end",K=typeof t=="function"?t:void 0,q=Y(K),D=K?q:t,X=lt(t),B=Ps()==="rtl",M=E||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[o],U=s==="center"?M:`${M}-${s}`;let F=a;const J=1,ne=o==="bottom"?J:0,ye=o==="top"?J:0,ue=o==="right"?J:0,he=o==="left"?J:0;typeof F=="number"?F={top:F+ne,right:F+he,bottom:F+ye,left:F+ue}:F&&(F={top:(F.top||0)+ne,right:(F.right||0)+he,bottom:(F.bottom||0)+ye,left:(F.left||0)+ue});const se={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:F},pe=u.useRef(null),Me=lt(r),Ie=lt(i),fe=[tu(ve=>{const be=ws(ve,o,B),oe=typeof Me.current=="function"?Me.current(be):Me.current,Xe=typeof Ie.current=="function"?Ie.current(be):Ie.current;return{mainAxis:oe,crossAxis:Xe,alignmentAxis:Xe}},[typeof r!="function"?r:0,typeof i!="function"?i:0,B,o])],xe=I==="none"&&R!=="shift",O=!xe&&(l||h||R==="shift"),k=R==="none"?null:ru({...se,padding:{top:F.top+J,right:F.right+J,bottom:F.bottom+J,left:F.left+J},mainAxis:!h&&R==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:G}),V=xe?null:nu(ve=>{const be=Ne(ve.elements.floating).documentElement;return{...se,rootBoundary:h?{x:0,y:0,width:be.clientWidth,height:be.clientHeight}:void 0,mainAxis:I!=="none",crossAxis:O,limiter:l||h?void 0:ou(oe=>{if(!pe.current)return{};const{width:Xe,height:Je}=pe.current.getBoundingClientRect(),$t=at(rt(oe.placement)),Ve=$t==="y"?Xe:Je,cn=$t==="y"?F.left+F.right:F.top+F.bottom;return{offset:Ve/2+cn/2}})}},[se,l,h,F,I]);R==="shift"||I==="shift"||s==="center"?fe.push(V,k):fe.push(k,V),fe.push(su({...se,apply({elements:{floating:ve},rects:{reference:be},availableWidth:oe,availableHeight:Xe}){const Je=ve.style;Je.setProperty("--available-width",`${oe}px`),Je.setProperty("--available-height",`${Xe}px`),Je.setProperty("--anchor-width",`${be.width}px`),Je.setProperty("--anchor-height",`${be.height}px`)}}),rf(()=>({element:pe.current||document.createElement("div"),padding:d,offsetParent:"floating"}),[d]),{name:"transformOrigin",fn(ve){const{elements:be,middlewareData:oe,placement:Xe,rects:Je,y:$t}=ve,Ve=rt(Xe),cn=at(Ve),Oe=pe.current,xo=oe.arrow?.x||0,dt=oe.arrow?.y||0,je=Oe?.clientWidth||0,ln=Oe?.clientHeight||0,Jt=xo+je/2,Pt=dt+ln/2,Sn=Math.abs(oe.shift?.y||0),At=Je.reference.height/2,pt=typeof r=="function"?r(ws(ve,o,B)):r,nt=Sn>pt,de={top:`${Jt}px calc(100% + ${pt}px)`,bottom:`${Jt}px ${-pt}px`,left:`calc(100% + ${pt}px) ${Pt}px`,right:`${-pt}px ${Pt}px`}[Ve],Tt=`${Jt}px ${Je.reference.y+At-$t}px`;return be.floating.style.setProperty("--transform-origin",O&&cn==="y"&&nt?Tt:de),{}}},sf,m),Q(()=>{!x&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[x,p]);const ie=u.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:C,elements:L,x:_,y:P,middlewareData:$,update:T,placement:W,context:te,isPositioned:ae,floatingStyles:De}=vu({rootContext:p,placement:U,middleware:fe,strategy:n,whileElementsMounted:g?void 0:(...ve)=>xs(...ve,ie),nodeId:b,externalTree:v}),{sideX:Ke,sideY:Se}=$.adaptiveOrigin||cf,ge=ae?n:"fixed",Ae=u.useMemo(()=>{const ve=m?{position:ge,[Ke]:_,[Se]:P}:{position:ge,...De};return ae||(ve.opacity=0),ve},[m,ge,Ke,_,Se,P,De,ae]),ze=u.useRef(null);Q(()=>{if(!x)return;const ve=X.current,be=typeof ve=="function"?ve():ve,Xe=(Rs(be)?be.current:be)||null||null;Xe!==ze.current&&(C.setPositionReference(Xe),ze.current=Xe)},[x,C,D,X]),u.useEffect(()=>{if(!x)return;const ve=X.current;typeof ve!="function"&&Rs(ve)&&ve.current!==ze.current&&(C.setPositionReference(ve.current),ze.current=ve.current)},[x,C,D,X]),u.useEffect(()=>{if(g&&x&&L.domReference&&L.floating)return xs(L.domReference,L.floating,T,ie)},[g,x,L,T,ie]);const Ue=rt(W),tt=Hi(o,Ue,B),Be=Bt(W)||"center",Ye=!!$.hide?.referenceHidden;Q(()=>{w&&x&&ae&&S(Ue)},[w,x,ae,Ue]);const Ct=u.useMemo(()=>({position:"absolute",top:$.arrow?.y,left:$.arrow?.x}),[$.arrow]),ft=$.arrow?.centerOffset!==0;return u.useMemo(()=>({positionerStyles:Ae,arrowStyles:Ct,arrowRef:pe,arrowUncentered:ft,side:tt,align:Be,physicalSide:Ue,anchorHidden:Ye,refs:C,context:te,isPositioned:ae,update:T}),[Ae,Ct,pe,ft,tt,Be,Ue,Ye,C,te,ae,T])}function Rs(e){return e!=null&&"current"in e}function Ui(e){return e==="starting"?qc:We}const Wi=u.forwardRef(function(t,n){const{render:o,className:r,anchor:s,positionMethod:i="absolute",side:c="bottom",align:a="center",sideOffset:l=0,alignOffset:d=0,collisionBoundary:f="clipping-ancestors",collisionPadding:g=5,arrowPadding:p=5,sticky:x=!1,disableAnchorTracking:y=!1,collisionAvoidance:h=zc,...b}=t,m=it(),{filteredItems:w}=jt(),v=go(),E=nf(),S=A(m,N.modal),R=A(m,N.open),I=A(m,N.mounted),G=A(m,N.openMethod),K=A(m,N.triggerElement),q=A(m,N.inputElement),D=A(m,N.inputInsidePopup),X=A(m,N.transitionStatus),Z=w.length===0,M=lf({anchor:s??(D?K:q),floatingRootContext:v,positionMethod:i,mounted:I,side:c,sideOffset:l,align:a,alignOffset:d,arrowPadding:p,collisionBoundary:f,collisionPadding:g,sticky:x,disableAnchorTracking:y,keepMounted:E,collisionAvoidance:h,lazyFlip:!0});ia(R&&S&&G!=="touch",K);const U=u.useMemo(()=>{const ue={...M.positionerStyles};return R||(ue.pointerEvents="none"),{role:"presentation",hidden:!I,style:ue}},[R,I,M.positionerStyles]),F={open:R,side:M.side,align:M.align,anchorHidden:M.anchorHidden,empty:Z};Q(()=>{m.set("popupSide",M.side)},[m,M.side]);const J=u.useMemo(()=>({side:M.side,align:M.align,arrowRef:M.arrowRef,arrowUncentered:M.arrowUncentered,arrowStyles:M.arrowStyles,anchorHidden:M.anchorHidden,isPositioned:M.isPositioned}),[M.side,M.align,M.arrowRef,M.arrowUncentered,M.arrowStyles,M.anchorHidden,M.isPositioned]),ne=Y(ue=>{m.set("positionerElement",ue)}),ye=qe("div",t,{state:F,ref:[n,ne],props:[U,Ui(X),b],stateAttributesMapping:Ii});return j.jsxs(Dr.Provider,{value:J,children:[I&&S&&j.jsx(Si,{inert:Lu(!R),cutout:q??K}),ye]})});process.env.NODE_ENV!=="production"&&(Wi.displayName="ComboboxPositioner");const af={...Ii,...Ls},Gi=u.forwardRef(function(t,n){const{render:o,className:r,initialFocus:s,finalFocus:i,...c}=t,a=it(),l=Vr(),d=go(),{filteredItems:f}=jt(),g=A(a,N.mounted),p=A(a,N.open),x=A(a,N.openMethod),y=A(a,N.transitionStatus),h=A(a,N.inputInsidePopup),b=A(a,N.inputElement),m=f.length===0;vr({open:p,ref:a.state.popupRef,onComplete(){p&&a.state.onOpenChangeComplete(!0)}});const w={open:p,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:y,empty:m},v=qe("div",t,{state:w,ref:[n,a.state.popupRef],props:[{role:h?"dialog":"presentation",tabIndex:-1,onFocus(I){const G=Ze(I.nativeEvent);x!=="touch"&&(me(a.state.listElement,G)||G===I.currentTarget)&&a.state.inputRef.current?.focus()}},Ui(y),c],stateAttributesMapping:af}),S=s===void 0?h?I=>I==="touch"?a.state.popupRef.current:b:!1:s;let R;return i!=null?R=i:R=h?void 0:!1,j.jsx(ya,{context:d,disabled:!g,modal:!h,openInteractionType:x,initialFocus:S,returnFocus:R,children:v})});process.env.NODE_ENV!=="production"&&(Gi.displayName="ComboboxPopup");const Br=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Br.displayName="ComboboxGroupContext");function uf(){const e=u.useContext(Br);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxGroupContext is missing. ComboboxGroup parts must be placed within <Combobox.Group>.":bt(18));return e}const qi=u.forwardRef(function(t,n){const{render:o,className:r,items:s,...i}=t,[c,a]=u.useState(),l=u.useMemo(()=>({labelId:c,setLabelId:a,items:s}),[c,a,s]),d=qe("div",t,{ref:n,props:[{role:"group","aria-labelledby":c},i]}),f=j.jsx(Br.Provider,{value:l,children:d});return s?j.jsx(tf,{items:s,children:f}):f});process.env.NODE_ENV!=="production"&&(qi.displayName="ComboboxGroup");const Ki=u.forwardRef(function(t,n){const{render:o,className:r,id:s,...i}=t,{setLabelId:c}=uf(),a=ur(s);return Q(()=>(c(a),()=>{c(void 0)}),[a,c]),qe("div",t,{ref:n,props:[{id:a},i]})});process.env.NODE_ENV!=="production"&&(Ki.displayName="ComboboxGroupLabel");const zi=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(zi.displayName="ComboboxItemContext");const Yi=u.createContext(!1);process.env.NODE_ENV!=="production"&&(Yi.displayName="ComboboxRowContext");function ff(){return u.useContext(Yi)}const Xi=u.memo(u.forwardRef(function(t,n){const{render:o,className:r,value:s=null,index:i,disabled:c=!1,nativeButton:a=!1,...l}=t,d=u.useRef(!1),f=u.useRef(null),g=Bs({index:i,textRef:f,indexGuessBehavior:_s.GuessFromOrder}),p=it(),x=ff(),{flatFilteredItems:y,hasItems:h}=jt(),b=A(p,N.open),m=A(p,N.selectionMode),w=A(p,N.readOnly),v=A(p,N.virtualized),E=A(p,N.isItemEqualToValue),S=m!=="none",R=i??(v?ro(y,s,E):g.index),I=g.index!==-1,G=A(p,N.id),K=A(p,N.isActive,R),q=A(p,N.isSelected,s),D=A(p,N.getItemProps),X=u.useRef(null),Z=G!=null&&I?`${G}-${R}`:void 0,B=q&&S;Q(()=>{if(!(I&&(v||i!=null)))return;const pe=p.state.listRef.current;return pe[R]=X.current,()=>{delete pe[R]}},[I,v,R,i,p]),Q(()=>{if(!I||h)return;const se=p.state.valuesRef.current;return se[R]=s,m!=="none"&&p.state.allValuesRef.current.push(s),()=>{delete se[R]}},[I,h,R,s,p,m]),Q(()=>{if(!b){d.current=!1;return}if(!I||h)return;const se=p.state.selectedValue,pe=Array.isArray(se)?se[se.length-1]:se;zt(s,pe,E)&&p.set("selectedIndex",R)},[I,h,b,p,R,s,E]);const M={disabled:c,selected:B,highlighted:K},U=D({active:K,selected:B});U.id=void 0,U.onFocus=void 0;const{getButtonProps:F,buttonRef:J}=uo({disabled:c,focusableWhenDisabled:!0,native:a});function ne(se){function pe(){p.state.handleSelection(se,s)}p.state.submitOnItemClick?(Yt.flushSync(pe),p.state.requestSubmit()):pe()}const ye={id:Z,role:x?"gridcell":"option","aria-selected":S?B:void 0,tabIndex:void 0,onPointerDownCapture(se){d.current=!0,se.preventDefault()},onClick(se){c||w||ne(se.nativeEvent)},onMouseUp(se){const pe=d.current;d.current=!1,!(c||w||se.button!==0||pe||!K)&&ne(se.nativeEvent)}},ue=qe("div",t,{ref:[J,n,g.ref,X],state:M,props:[U,ye,l,F]}),he=u.useMemo(()=>({selected:B,textRef:f}),[B,f]);return j.jsx(zi.Provider,{value:he,children:ue})}));process.env.NODE_ENV!=="production"&&(Xi.displayName="ComboboxItem");const Ji=u.forwardRef(function(t,n){const{render:o,className:r,children:s,...i}=t,{filteredItems:c}=jt(),a=it(),l=c.length===0?s:null;return qe("div",t,{ref:[n,a.state.emptyRef],props:[{children:l,role:"status","aria-live":"polite","aria-atomic":!0},i]})});process.env.NODE_ENV!=="production"&&(Ji.displayName="ComboboxEmpty");const Qi=u.forwardRef(function(t,n){const{className:o,render:r,orientation:s="horizontal",...i}=t;return qe("div",t,{state:{orientation:s},ref:n,props:[{role:"separator","aria-orientation":s},i]})});process.env.NODE_ENV!=="production"&&(Qi.displayName="Separator");function df(e){const{multiple:t=!1,defaultValue:n,value:o,onValueChange:r,autoComplete:s,...i}=e;return j.jsx(Ju,{...i,selectionMode:t?"multiple":"single",selectedValue:o,defaultSelectedValue:n,onSelectedValueChange:r,formAutoComplete:s})}function pf(e){const{children:t,placeholder:n}=e,o=it(),r=A(o,N.itemToStringLabel),s=A(o,N.selectedValue),i=A(o,N.items),c=A(o,N.selectionMode)==="multiple",a=A(o,N.hasSelectedValue),l=!a&&n!=null&&t==null,d=A(o,N.hasNullItemLabel,l);let f=null;return typeof t=="function"?f=t(s):t!=null?f=t:!a&&n!=null&&!d?f=n:c&&Array.isArray(s)?f=Hu(s,i,r):f=Oi(s,i,r),j.jsx(u.Fragment,{children:f})}const Zi=u.forwardRef(function(t,n){const{render:o,className:r,...s}=t,i=it(),c=A(i,N.open),a=A(i,N.hasSelectionChips),[l,d]=u.useState(void 0);c&&l!==void 0&&d(void 0);const f=u.useRef([]),g=qe("div",t,{ref:[n,i.state.chipsContainerRef],props:[a?{role:"toolbar"}:We,s]}),p=u.useMemo(()=>({highlightedChipIndex:l,setHighlightedChipIndex:d,chipsRef:f}),[l,d,f]);return j.jsx(Mr.Provider,{value:p,children:j.jsx(Ss,{elementsRef:f,children:g})})});process.env.NODE_ENV!=="production"&&(Zi.displayName="ComboboxChips");const jr=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(jr.displayName="ComboboxChipContext");function mf(){const e=u.useContext(jr);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"useComboboxChipContext must be used within a ComboboxChip":bt(17));return e}const ec=u.forwardRef(function(t,n){const{render:o,className:r,...s}=t,i=it(),{setHighlightedChipIndex:c,chipsRef:a}=Fi(),l=A(i,N.disabled),d=A(i,N.readOnly),f=A(i,N.selectedValue),{ref:g,index:p}=Bs();function x(m){let w=p;if(m.key==="ArrowLeft")m.preventDefault(),p>0?w=p-1:w=void 0;else if(m.key==="ArrowRight")m.preventDefault(),p<f.length-1?w=p+1:w=void 0;else if(m.key==="Backspace"||m.key==="Delete"){const v=p>=f.length-1?f.length-2:p;w=v>=0?v:void 0,Ee(m),i.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),i.state.setSelectedValue(f.filter((E,S)=>S!==p),ce(ct,m.nativeEvent))}else m.key==="Enter"||m.key===" "?(Ee(m),w=void 0):m.key==="ArrowDown"||m.key==="ArrowUp"?(Ee(m),i.state.setOpen(!0,ce(hn,m.nativeEvent)),w=void 0):m.key.length===1&&!m.ctrlKey&&!m.metaKey&&!m.altKey&&(w=void 0);return w}const h=qe("div",t,{ref:[n,g],state:{disabled:l},props:[{tabIndex:-1,"aria-disabled":l||void 0,"aria-readonly":d||void 0,onKeyDown(m){if(l||d)return;const w=x(m);Yt.flushSync(()=>{c(w)}),w===void 0?i.state.inputRef.current?.focus():a.current[w]?.focus()},onMouseDown(m){d||(m.preventDefault(),!l&&i.state.inputRef.current?.focus())}},s]}),b=u.useMemo(()=>({index:p}),[p]);return j.jsx(jr.Provider,{value:b,children:h})});process.env.NODE_ENV!=="production"&&(ec.displayName="ComboboxChip");const tc=u.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,...c}=t,a=it(),{index:l}=mf(),d=A(a,N.disabled),f=A(a,N.readOnly),g=A(a,N.selectedValue),p=A(a,N.isItemEqualToValue),x=d||s,{buttonRef:y,getButtonProps:h}=uo({native:i,disabled:x||f,focusableWhenDisabled:!0}),b={disabled:x};function m(E){const S=a.state.activeIndex;if(S==null)return;const R=ro(a.state.valuesRef.current,E,p);R!==-1&&S===R&&a.state.setIndices({activeIndex:null,type:a.state.keyboardActiveRef.current?"keyboard":"pointer"})}function w(E){const S=ce(nl,E.nativeEvent),R=g[l];return m(R),a.state.setSelectedValue(g.filter((I,G)=>G!==l),S),a.state.inputRef.current?.focus(),S}return qe("button",t,{ref:[n,y],state:b,props:[{tabIndex:-1,onClick(E){if(x||f)return;w(E).isPropagationAllowed||E.stopPropagation()},onKeyDown(E){x||f||(E.key==="Enter"||E.key===" ")&&(w(E).isPropagationAllowed||Ee(E))}},c,h]})});process.env.NODE_ENV!=="production"&&(tc.displayName="ComboboxChipRemove");const bo=Ge.createContext(null);function hf({children:e,...t}){const[n,o]=Ge.useState(null),r=Ge.useMemo(()=>({anchorElement:n,setAnchorElement:o}),[n]);return j.jsx(bo,{value:r,children:j.jsx(df,{...t,children:e})})}function gf({className:e,label:t,description:n,error:o,children:r,...s}){return j.jsxs(Mn.Field,{className:e,...s,children:[t&&j.jsx(Mn.FieldLabel,{children:t}),r,n&&j.jsx(Mn.FieldDescription,{children:n}),o&&j.jsx(Mn.FieldError,{children:o})]})}function bf({...e}){return j.jsx(pf,{"data-slot":"combobox-value",...e})}function nc({className:e,children:t,...n}){return j.jsxs(Li,{"data-slot":"combobox-trigger",className:et.cn(He.comboboxTriggerStyles,e),...n,children:[t,j.jsx(sr.Icon,{type:"caret-down",className:et.cn(He.comboboxTriggerIconVariants({disabled:n.disabled})),size:"small"})]})}function xf({className:e,...t}){return j.jsx(_i,{"data-slot":"combobox-clear",className:et.cn(e),...t,render:j.jsx(Wn.InputGroupButton,{variant:"link",size:"icon-xs",className:He.comboboxClearButtonStyles,children:j.jsx(sr.Icon,{className:He.comboboxClearIconStyles,type:"x"})})})}function yf({className:e,children:t,disabled:n=!1,showTrigger:o=!0,showClear:r=!1,...s}){const i=Ge.use(bo),c=Ge.useCallback(a=>{i&&i.setAnchorElement(l=>l===a?l:a)},[i]);return j.jsxs(Wn.InputGroup,{ref:c,className:et.cn(He.comboboxInputGroupStyles,e),children:[j.jsx(Lr,{render:j.jsx(Wn.InputGroupInput,{disabled:n}),...s}),j.jsxs(Wn.InputGroupAddon,{align:"inline-end",className:He.comboboxInputAddonStyles,children:[o&&j.jsx(nc,{}),r&&j.jsx(xf,{disabled:n})]}),t]})}function vf({className:e,side:t="bottom",sideOffset:n=8,align:o="start",alignOffset:r=0,anchor:s,portalContainer:i,...c}){const l=Ge.use(bo)?.anchorElement??null,d=Ge.useCallback(()=>{if(typeof document>"u")return null;const y=document.activeElement;return y?y.closest('[data-slot="combobox-chips"]')??y.closest('[data-slot="input-group"]'):null},[]),f=Ge.useCallback(()=>{const y=l??d();if(typeof Element>"u"||!s)return y;if(s instanceof Element)return s;if(typeof s=="function"){const h=s();return h instanceof Element?h:y}return"current"in s&&s.current instanceof Element?s.current:y},[s,l,d]),g=Ge.useCallback(()=>{if(typeof document>"u")return;const y=f();if(y instanceof HTMLElement){const b=y.closest('[role="dialog"]');if(b instanceof HTMLElement)return b}const h=document.activeElement?.closest('[role="dialog"]');return h instanceof HTMLElement?h:void 0},[f]),p=s??l??d,x=i??g();return j.jsx($i,{container:x,children:j.jsx(Wi,{side:t,sideOffset:n,align:o,alignOffset:r,anchor:p,className:He.comboboxPositionerStyles,children:j.jsx(Gi,{"data-slot":"combobox-content","data-chips":!!s,className:et.cn(He.comboboxContentStyles,e),...c})})})}function Ef({className:e,...t}){return j.jsx(ji,{"data-slot":"combobox-list",className:et.cn("flex flex-col gap-1",e),...t})}function Cf({className:e,children:t,...n}){return j.jsx(Xi,{"data-slot":"combobox-item",className:et.cn(He.comboboxItemStyles,e),...n,children:t})}function wf({className:e,...t}){return j.jsx(qi,{"data-slot":"combobox-group",className:et.cn(e),...t})}function Rf({className:e,...t}){return j.jsx(Ki,{"data-slot":"combobox-label",className:et.cn(He.comboboxLabelStyles,e),...t})}function If({...e}){return j.jsx(Bi,{"data-slot":"combobox-collection",...e})}function Sf({className:e,...t}){return j.jsx(Ji,{"data-slot":"combobox-empty",className:et.cn(He.comboboxEmptyStyles,e),...t})}function Of({className:e,...t}){return j.jsx(Qi,{"data-slot":"combobox-separator",className:et.cn(He.comboboxSeparatorStyles,e),...t})}function Pf({className:e,disabled:t=!1,...n}){const o=Ge.use(bo),r=Ge.useCallback(s=>{o&&o.setAnchorElement(i=>i===s?i:s)},[o]);return j.jsx(Zi,{ref:r,"data-slot":"combobox-chips",className:et.cn(He.comboboxChipsVariants({disabled:t}),e),...n})}function Af({className:e,children:t,showRemove:n=!0,...o}){return j.jsxs(ec,{"data-slot":"combobox-chip",className:et.cn(He.comboboxChipStyles,e),...o,children:[t,n&&j.jsx(tc,{render:j.jsx(Rc.Button,{className:He.comboboxClearButtonStyles,variant:"ghost",children:j.jsx(sr.Icon,{className:"text-secondary-text",type:"x"})})})]})}function Tf({className:e,...t}){return j.jsx(Lr,{"data-slot":"combobox-chip-input",className:et.cn(He.comboboxChipsInputVariants({disabled:t.disabled}),e),...t})}exports.Combobox=hf;exports.ComboboxChip=Af;exports.ComboboxChips=Pf;exports.ComboboxChipsInput=Tf;exports.ComboboxCollection=If;exports.ComboboxContent=vf;exports.ComboboxEmpty=Sf;exports.ComboboxField=gf;exports.ComboboxGroup=wf;exports.ComboboxInput=yf;exports.ComboboxItem=Cf;exports.ComboboxLabel=Rf;exports.ComboboxList=Ef;exports.ComboboxSeparator=Of;exports.ComboboxTrigger=nc;exports.ComboboxValue=bf;
16
16
  //# sourceMappingURL=components-ui-combobox-combobox.cjs.map