@kushagradhawan/kookie-ui 0.3.21 → 0.3.23

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 (548) hide show
  1. package/components.css +264 -329
  2. package/dist/cjs/components/_internal/base-button.d.ts.map +1 -1
  3. package/dist/cjs/components/_internal/base-button.js +1 -1
  4. package/dist/cjs/components/_internal/base-button.js.map +4 -4
  5. package/dist/cjs/components/_internal/dropdown-menu-drill-down.js +1 -1
  6. package/dist/cjs/components/_internal/dropdown-menu-drill-down.js.map +3 -3
  7. package/dist/cjs/components/_internal/shell-bottom.js +1 -1
  8. package/dist/cjs/components/_internal/shell-bottom.js.map +4 -4
  9. package/dist/cjs/components/_internal/shell-handles.d.ts.map +1 -1
  10. package/dist/cjs/components/_internal/shell-handles.js +1 -1
  11. package/dist/cjs/components/_internal/shell-handles.js.map +3 -3
  12. package/dist/cjs/components/_internal/shell-inspector.js +1 -1
  13. package/dist/cjs/components/_internal/shell-inspector.js.map +4 -4
  14. package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
  15. package/dist/cjs/components/_internal/shell-sidebar.js.map +4 -4
  16. package/dist/cjs/components/accordion.d.ts.map +1 -1
  17. package/dist/cjs/components/accordion.js +1 -1
  18. package/dist/cjs/components/accordion.js.map +4 -4
  19. package/dist/cjs/components/alert-dialog.d.ts.map +1 -1
  20. package/dist/cjs/components/alert-dialog.js +1 -1
  21. package/dist/cjs/components/alert-dialog.js.map +4 -4
  22. package/dist/cjs/components/avatar.js +1 -1
  23. package/dist/cjs/components/avatar.js.map +4 -4
  24. package/dist/cjs/components/badge.d.ts.map +1 -1
  25. package/dist/cjs/components/badge.js +1 -1
  26. package/dist/cjs/components/badge.js.map +4 -4
  27. package/dist/cjs/components/blockquote.js +1 -1
  28. package/dist/cjs/components/blockquote.js.map +4 -4
  29. package/dist/cjs/components/box.js +1 -1
  30. package/dist/cjs/components/box.js.map +4 -4
  31. package/dist/cjs/components/button.js +1 -1
  32. package/dist/cjs/components/button.js.map +4 -4
  33. package/dist/cjs/components/callout.js +1 -1
  34. package/dist/cjs/components/callout.js.map +4 -4
  35. package/dist/cjs/components/card.js +1 -1
  36. package/dist/cjs/components/card.js.map +4 -4
  37. package/dist/cjs/components/chatbar.js +2 -2
  38. package/dist/cjs/components/chatbar.js.map +4 -4
  39. package/dist/cjs/components/checkbox-cards.js +1 -1
  40. package/dist/cjs/components/checkbox-cards.js.map +4 -4
  41. package/dist/cjs/components/checkbox-group.js +1 -1
  42. package/dist/cjs/components/checkbox-group.js.map +4 -4
  43. package/dist/cjs/components/checkbox.js +1 -1
  44. package/dist/cjs/components/checkbox.js.map +4 -4
  45. package/dist/cjs/components/code.js +1 -1
  46. package/dist/cjs/components/code.js.map +4 -4
  47. package/dist/cjs/components/combobox.js +1 -1
  48. package/dist/cjs/components/combobox.js.map +4 -4
  49. package/dist/cjs/components/container.js +1 -1
  50. package/dist/cjs/components/container.js.map +4 -4
  51. package/dist/cjs/components/context-menu.d.ts.map +1 -1
  52. package/dist/cjs/components/context-menu.js +1 -1
  53. package/dist/cjs/components/context-menu.js.map +4 -4
  54. package/dist/cjs/components/data-list.js +1 -1
  55. package/dist/cjs/components/data-list.js.map +4 -4
  56. package/dist/cjs/components/dialog.d.ts.map +1 -1
  57. package/dist/cjs/components/dialog.js +1 -1
  58. package/dist/cjs/components/dialog.js.map +4 -4
  59. package/dist/cjs/components/dropdown-menu.d.ts.map +1 -1
  60. package/dist/cjs/components/dropdown-menu.js +1 -1
  61. package/dist/cjs/components/dropdown-menu.js.map +4 -4
  62. package/dist/cjs/components/em.js +1 -1
  63. package/dist/cjs/components/em.js.map +4 -4
  64. package/dist/cjs/components/flex.js +1 -1
  65. package/dist/cjs/components/flex.js.map +4 -4
  66. package/dist/cjs/components/grid.js +1 -1
  67. package/dist/cjs/components/grid.js.map +4 -4
  68. package/dist/cjs/components/heading.js +1 -1
  69. package/dist/cjs/components/heading.js.map +4 -4
  70. package/dist/cjs/components/hover-card.js +1 -1
  71. package/dist/cjs/components/hover-card.js.map +4 -4
  72. package/dist/cjs/components/icon-button.js +2 -2
  73. package/dist/cjs/components/icon-button.js.map +4 -4
  74. package/dist/cjs/components/image.js +1 -1
  75. package/dist/cjs/components/image.js.map +4 -4
  76. package/dist/cjs/components/index.js +5 -5
  77. package/dist/cjs/components/index.js.map +4 -4
  78. package/dist/cjs/components/inset.js +1 -1
  79. package/dist/cjs/components/inset.js.map +4 -4
  80. package/dist/cjs/components/kbd.js +1 -1
  81. package/dist/cjs/components/kbd.js.map +4 -4
  82. package/dist/cjs/components/link.js +1 -1
  83. package/dist/cjs/components/link.js.map +4 -4
  84. package/dist/cjs/components/navbar.js +1 -1
  85. package/dist/cjs/components/navbar.js.map +4 -4
  86. package/dist/cjs/components/popover.js +1 -1
  87. package/dist/cjs/components/popover.js.map +4 -4
  88. package/dist/cjs/components/progress.js +1 -1
  89. package/dist/cjs/components/progress.js.map +4 -4
  90. package/dist/cjs/components/quote.js +1 -1
  91. package/dist/cjs/components/quote.js.map +4 -4
  92. package/dist/cjs/components/radio-cards.js +1 -1
  93. package/dist/cjs/components/radio-cards.js.map +4 -4
  94. package/dist/cjs/components/radio-group.js +1 -1
  95. package/dist/cjs/components/radio-group.js.map +4 -4
  96. package/dist/cjs/components/radio.js +1 -1
  97. package/dist/cjs/components/radio.js.map +4 -4
  98. package/dist/cjs/components/schemas/base-button.schema.d.ts +2 -2
  99. package/dist/cjs/components/schemas/button.schema.d.ts +2 -2
  100. package/dist/cjs/components/schemas/icon-button.schema.d.ts +4 -4
  101. package/dist/cjs/components/schemas/shell.schema.d.ts +2 -2
  102. package/dist/cjs/components/schemas/toggle-button.schema.d.ts +6 -6
  103. package/dist/cjs/components/schemas/toggle-icon-button.schema.d.ts +8 -8
  104. package/dist/cjs/components/scroll-area.js +1 -1
  105. package/dist/cjs/components/scroll-area.js.map +4 -4
  106. package/dist/cjs/components/section.js +1 -1
  107. package/dist/cjs/components/section.js.map +4 -4
  108. package/dist/cjs/components/segmented-control.js +1 -1
  109. package/dist/cjs/components/segmented-control.js.map +4 -4
  110. package/dist/cjs/components/select.js +1 -1
  111. package/dist/cjs/components/select.js.map +4 -4
  112. package/dist/cjs/components/separator.js +1 -1
  113. package/dist/cjs/components/separator.js.map +4 -4
  114. package/dist/cjs/components/sheet.d.ts.map +1 -1
  115. package/dist/cjs/components/sheet.js +1 -1
  116. package/dist/cjs/components/sheet.js.map +4 -4
  117. package/dist/cjs/components/shell.d.ts.map +1 -1
  118. package/dist/cjs/components/shell.js +1 -1
  119. package/dist/cjs/components/shell.js.map +4 -4
  120. package/dist/cjs/components/sidebar.js +1 -1
  121. package/dist/cjs/components/sidebar.js.map +4 -4
  122. package/dist/cjs/components/skeleton.js +1 -1
  123. package/dist/cjs/components/skeleton.js.map +4 -4
  124. package/dist/cjs/components/slider.js +1 -1
  125. package/dist/cjs/components/slider.js.map +4 -4
  126. package/dist/cjs/components/spinner.js +1 -1
  127. package/dist/cjs/components/spinner.js.map +4 -4
  128. package/dist/cjs/components/strong.js +1 -1
  129. package/dist/cjs/components/strong.js.map +4 -4
  130. package/dist/cjs/components/switch.js +1 -1
  131. package/dist/cjs/components/switch.js.map +4 -4
  132. package/dist/cjs/components/tab-nav.js +1 -1
  133. package/dist/cjs/components/tab-nav.js.map +4 -4
  134. package/dist/cjs/components/table.js +1 -1
  135. package/dist/cjs/components/table.js.map +4 -4
  136. package/dist/cjs/components/tabs.js +1 -1
  137. package/dist/cjs/components/tabs.js.map +4 -4
  138. package/dist/cjs/components/text-area.js +1 -1
  139. package/dist/cjs/components/text-area.js.map +4 -4
  140. package/dist/cjs/components/text-field.js +2 -2
  141. package/dist/cjs/components/text-field.js.map +4 -4
  142. package/dist/cjs/components/text.js +1 -1
  143. package/dist/cjs/components/text.js.map +4 -4
  144. package/dist/cjs/components/theme-panel.js +3 -3
  145. package/dist/cjs/components/theme-panel.js.map +4 -4
  146. package/dist/cjs/components/theme.d.ts.map +1 -1
  147. package/dist/cjs/components/theme.js +1 -1
  148. package/dist/cjs/components/theme.js.map +4 -4
  149. package/dist/cjs/components/toggle-button.js +2 -2
  150. package/dist/cjs/components/toggle-button.js.map +4 -4
  151. package/dist/cjs/components/toggle-icon-button.js +3 -3
  152. package/dist/cjs/components/toggle-icon-button.js.map +4 -4
  153. package/dist/cjs/components/toolbar.js +1 -1
  154. package/dist/cjs/components/toolbar.js.map +4 -4
  155. package/dist/cjs/components/tooltip.js +1 -1
  156. package/dist/cjs/components/tooltip.js.map +4 -4
  157. package/dist/cjs/components/user-card.js +1 -1
  158. package/dist/cjs/components/user-card.js.map +4 -4
  159. package/dist/cjs/helpers/compile-prop-defs.d.ts +49 -0
  160. package/dist/cjs/helpers/compile-prop-defs.d.ts.map +1 -0
  161. package/dist/cjs/helpers/compile-prop-defs.js +2 -0
  162. package/dist/cjs/helpers/compile-prop-defs.js.map +7 -0
  163. package/dist/cjs/helpers/extract-props.d.ts.map +1 -1
  164. package/dist/cjs/helpers/extract-props.js +1 -1
  165. package/dist/cjs/helpers/extract-props.js.map +4 -4
  166. package/dist/cjs/helpers/get-margin-styles.d.ts.map +1 -1
  167. package/dist/cjs/helpers/get-margin-styles.js +1 -1
  168. package/dist/cjs/helpers/get-margin-styles.js.map +3 -3
  169. package/dist/cjs/helpers/get-responsive-styles.d.ts +5 -2
  170. package/dist/cjs/helpers/get-responsive-styles.d.ts.map +1 -1
  171. package/dist/cjs/helpers/get-responsive-styles.js +1 -1
  172. package/dist/cjs/helpers/get-responsive-styles.js.map +3 -3
  173. package/dist/cjs/helpers/index.js +2 -2
  174. package/dist/cjs/helpers/index.js.map +4 -4
  175. package/dist/cjs/helpers/use-deprecation-warning.d.ts +10 -0
  176. package/dist/cjs/helpers/use-deprecation-warning.d.ts.map +1 -0
  177. package/dist/cjs/helpers/use-deprecation-warning.js +2 -0
  178. package/dist/cjs/helpers/use-deprecation-warning.js.map +7 -0
  179. package/dist/cjs/hooks/index.js +2 -2
  180. package/dist/cjs/hooks/index.js.map +3 -3
  181. package/dist/cjs/hooks/use-body-pointer-events-cleanup.d.ts.map +1 -1
  182. package/dist/cjs/hooks/use-body-pointer-events-cleanup.js +1 -1
  183. package/dist/cjs/hooks/use-body-pointer-events-cleanup.js.map +3 -3
  184. package/dist/cjs/hooks/use-breakpoint.d.ts +7 -3
  185. package/dist/cjs/hooks/use-breakpoint.d.ts.map +1 -1
  186. package/dist/cjs/hooks/use-breakpoint.js +1 -1
  187. package/dist/cjs/hooks/use-breakpoint.js.map +3 -3
  188. package/dist/cjs/hooks/use-prop-synced-state.d.ts +14 -0
  189. package/dist/cjs/hooks/use-prop-synced-state.d.ts.map +1 -0
  190. package/dist/cjs/hooks/use-prop-synced-state.js +2 -0
  191. package/dist/cjs/hooks/use-prop-synced-state.js.map +7 -0
  192. package/dist/cjs/index.js +5 -5
  193. package/dist/cjs/index.js.map +4 -4
  194. package/dist/esm/{chunk-RQ2ZPMHJ.js → chunk-22HGLMPQ.js} +2 -2
  195. package/dist/esm/{chunk-WYA4IRU6.js → chunk-25WZA7ZU.js} +2 -2
  196. package/dist/esm/chunk-2UPAYDKR.js +2 -0
  197. package/dist/esm/chunk-2UPAYDKR.js.map +7 -0
  198. package/dist/esm/{chunk-XHQGMOXV.js → chunk-36ZQVP7F.js} +2 -2
  199. package/dist/esm/{chunk-K3R4AH3E.js → chunk-3MWWP4MW.js} +2 -2
  200. package/dist/esm/{chunk-HQ35PM4O.js → chunk-43A5GUSI.js} +2 -2
  201. package/dist/esm/{chunk-Z5DQ6FSA.js → chunk-4AQTUBVP.js} +2 -2
  202. package/dist/esm/{chunk-25U7DENY.js → chunk-4BBOHEF4.js} +2 -2
  203. package/dist/esm/chunk-4CKDU6FY.js +2 -0
  204. package/dist/esm/chunk-4CKDU6FY.js.map +7 -0
  205. package/dist/esm/{chunk-ZSEFZM5H.js → chunk-4IY2PR6N.js} +2 -2
  206. package/dist/esm/{chunk-QLIELX4I.js → chunk-4ME6O27S.js} +2 -2
  207. package/dist/esm/chunk-4XJY6FIK.js +2 -0
  208. package/dist/esm/chunk-4XJY6FIK.js.map +7 -0
  209. package/dist/esm/{chunk-JQOFJNCV.js → chunk-4YFJWXL2.js} +2 -2
  210. package/dist/esm/{chunk-DNI4QRXQ.js → chunk-5IBGFL6O.js} +2 -2
  211. package/dist/esm/chunk-5TXQLK4G.js +2 -0
  212. package/dist/esm/chunk-5TXQLK4G.js.map +7 -0
  213. package/dist/esm/{chunk-IPJUHVM6.js → chunk-666GX7O5.js} +2 -2
  214. package/dist/esm/chunk-6FLLFCBU.js +2 -0
  215. package/dist/esm/chunk-6FLLFCBU.js.map +7 -0
  216. package/dist/esm/{chunk-DJBPM5QK.js → chunk-7FC7HF76.js} +2 -2
  217. package/dist/esm/{chunk-SVLY6B5F.js → chunk-7QDTSBJF.js} +2 -2
  218. package/dist/esm/chunk-AX5S56DS.js +2 -0
  219. package/dist/esm/chunk-AX5S56DS.js.map +7 -0
  220. package/dist/esm/{chunk-DK5MHD6I.js → chunk-B24BDVG2.js} +2 -2
  221. package/dist/esm/{chunk-WZCZHCVE.js → chunk-BJYUPIXO.js} +2 -2
  222. package/dist/esm/{chunk-BJTJUIYJ.js → chunk-CRWYCLTE.js} +2 -2
  223. package/dist/esm/{chunk-OHJVFZMH.js → chunk-CSKZZOI2.js} +2 -2
  224. package/dist/esm/chunk-D5N627TH.js +2 -0
  225. package/dist/esm/chunk-D5N627TH.js.map +7 -0
  226. package/dist/esm/{chunk-ADYTQCZX.js → chunk-D6B7IMZU.js} +2 -2
  227. package/dist/esm/chunk-DL2O3GKG.js +2 -0
  228. package/dist/esm/chunk-DL2O3GKG.js.map +7 -0
  229. package/dist/esm/{chunk-USGTBZ43.js → chunk-E67CIG6A.js} +2 -2
  230. package/dist/esm/{chunk-42HFGCHX.js → chunk-ETMLMDW4.js} +2 -2
  231. package/dist/esm/{chunk-7CBAHIVG.js → chunk-F2HYQ3ZR.js} +2 -2
  232. package/dist/esm/{chunk-YUZPSUJE.js → chunk-F7IYL2VW.js} +2 -2
  233. package/dist/esm/{chunk-FVCWNSRU.js → chunk-FHOCUZDR.js} +2 -2
  234. package/dist/esm/{chunk-7MURQ6CR.js → chunk-FLFAXVFB.js} +2 -2
  235. package/dist/esm/{chunk-APRBRAOT.js → chunk-FOEZLQTW.js} +2 -2
  236. package/dist/esm/{chunk-WNSPLWRV.js → chunk-GJSGKE7B.js} +2 -2
  237. package/dist/esm/{chunk-OGOOZLUD.js → chunk-GLERJXVS.js} +2 -2
  238. package/dist/esm/{chunk-6VGPTAHM.js → chunk-GWXVETMF.js} +2 -2
  239. package/dist/esm/{chunk-ES7MK2MM.js → chunk-GYBLXQ4R.js} +2 -2
  240. package/dist/esm/{chunk-4OBMRJHC.js → chunk-H7ST535H.js} +2 -2
  241. package/dist/esm/{chunk-QLZ5XAW6.js → chunk-HF5WY5YE.js} +2 -2
  242. package/dist/esm/chunk-ICIGZ3N7.js +2 -0
  243. package/dist/esm/chunk-ICIGZ3N7.js.map +7 -0
  244. package/dist/esm/{chunk-RDP4UQ42.js → chunk-IEWCQU2S.js} +2 -2
  245. package/dist/esm/{chunk-XLOHPURR.js → chunk-IHK3H2OM.js} +2 -2
  246. package/dist/esm/{chunk-3F6I7YOR.js → chunk-JDGJSNWT.js} +2 -2
  247. package/dist/esm/chunk-JQQIPEGY.js +2 -0
  248. package/dist/esm/chunk-JQQIPEGY.js.map +7 -0
  249. package/dist/esm/chunk-JR2YOGII.js +2 -0
  250. package/dist/esm/chunk-JR2YOGII.js.map +7 -0
  251. package/dist/esm/chunk-JUY7CBSL.js +2 -0
  252. package/dist/esm/chunk-JUY7CBSL.js.map +7 -0
  253. package/dist/esm/{chunk-VF5TRT3H.js → chunk-KKM6T5P7.js} +2 -2
  254. package/dist/esm/{chunk-ZHYOJNWV.js → chunk-LKAK5GXF.js} +2 -2
  255. package/dist/esm/chunk-LOGJJF4I.js +2 -0
  256. package/dist/esm/chunk-LOGJJF4I.js.map +7 -0
  257. package/dist/esm/{chunk-JCYI4NTV.js → chunk-MBCBP73P.js} +2 -2
  258. package/dist/esm/{chunk-UYNYUR7O.js → chunk-MBE2YSBU.js} +2 -2
  259. package/dist/esm/chunk-MHANZINI.js +2 -0
  260. package/dist/esm/chunk-MHANZINI.js.map +7 -0
  261. package/dist/esm/chunk-MRECKC4D.js +2 -0
  262. package/dist/esm/chunk-MRECKC4D.js.map +7 -0
  263. package/dist/esm/{chunk-H2G446JG.js → chunk-NMKPFUNP.js} +2 -2
  264. package/dist/esm/{chunk-4N5JU7XQ.js → chunk-O3CDWEZA.js} +2 -2
  265. package/dist/esm/{chunk-TEULZKBM.js → chunk-OGXZHAQL.js} +2 -2
  266. package/dist/esm/{chunk-2AEELIG6.js → chunk-OWAUCLRT.js} +2 -2
  267. package/dist/esm/{chunk-7CXVHFMQ.js → chunk-P7HYVJSU.js} +2 -2
  268. package/dist/esm/{chunk-4532RT2B.js → chunk-P7IAHW4V.js} +2 -2
  269. package/dist/esm/{chunk-M3ZYJANH.js → chunk-PQZXQ4ST.js} +2 -2
  270. package/dist/esm/{chunk-SGU4HUHF.js → chunk-PTLFMWCN.js} +2 -2
  271. package/dist/esm/chunk-S2HA3W3V.js +2 -0
  272. package/dist/esm/chunk-S2HA3W3V.js.map +7 -0
  273. package/dist/esm/{chunk-E6IWYD3U.js → chunk-S5C5YRBS.js} +2 -2
  274. package/dist/esm/{chunk-A24PYRVV.js → chunk-SO67YEVQ.js} +2 -2
  275. package/dist/esm/chunk-TLWTUKKL.js +2 -0
  276. package/dist/esm/chunk-TLWTUKKL.js.map +7 -0
  277. package/dist/esm/{chunk-HACQF6F4.js → chunk-TOOSHJOA.js} +2 -2
  278. package/dist/esm/{chunk-QOWA5LK5.js → chunk-U2X2CAW4.js} +2 -2
  279. package/dist/esm/{chunk-U7AASKZI.js → chunk-UVCH7QKO.js} +2 -2
  280. package/dist/esm/{chunk-GWYFT3EI.js → chunk-VLO7NXSP.js} +2 -2
  281. package/dist/esm/{chunk-DXI5P5O4.js → chunk-VX6ARMWP.js} +2 -2
  282. package/dist/esm/chunk-WAURCNAS.js +2 -0
  283. package/dist/esm/chunk-WAURCNAS.js.map +7 -0
  284. package/dist/esm/{chunk-EJWAAFCI.js → chunk-WO43WW3A.js} +2 -2
  285. package/dist/esm/{chunk-GLC4QJBF.js → chunk-WTYNFBFV.js} +2 -2
  286. package/dist/esm/{chunk-6FAICIYS.js → chunk-XMRIRFM7.js} +2 -2
  287. package/dist/esm/chunk-YV2KYHGR.js +2 -0
  288. package/dist/esm/chunk-YV2KYHGR.js.map +7 -0
  289. package/dist/esm/{chunk-UIEUZLZZ.js → chunk-ZY6SQWHT.js} +2 -2
  290. package/dist/esm/components/_internal/base-button.d.ts.map +1 -1
  291. package/dist/esm/components/_internal/base-button.js +1 -1
  292. package/dist/esm/components/_internal/dropdown-menu-drill-down.js +1 -1
  293. package/dist/esm/components/_internal/shell-bottom.js +1 -1
  294. package/dist/esm/components/_internal/shell-handles.d.ts.map +1 -1
  295. package/dist/esm/components/_internal/shell-handles.js +1 -1
  296. package/dist/esm/components/_internal/shell-inspector.js +1 -1
  297. package/dist/esm/components/_internal/shell-sidebar.js +1 -1
  298. package/dist/esm/components/accordion.d.ts.map +1 -1
  299. package/dist/esm/components/accordion.js +1 -1
  300. package/dist/esm/components/alert-dialog.d.ts.map +1 -1
  301. package/dist/esm/components/alert-dialog.js +1 -1
  302. package/dist/esm/components/avatar.js +1 -1
  303. package/dist/esm/components/badge.d.ts.map +1 -1
  304. package/dist/esm/components/badge.js +1 -1
  305. package/dist/esm/components/blockquote.js +1 -1
  306. package/dist/esm/components/box.js +1 -1
  307. package/dist/esm/components/button.js +1 -1
  308. package/dist/esm/components/callout.js +1 -1
  309. package/dist/esm/components/card.js +1 -1
  310. package/dist/esm/components/chatbar.js +1 -1
  311. package/dist/esm/components/checkbox-cards.js +1 -1
  312. package/dist/esm/components/checkbox-group.js +1 -1
  313. package/dist/esm/components/checkbox.js +1 -1
  314. package/dist/esm/components/code.js +1 -1
  315. package/dist/esm/components/combobox.js +1 -1
  316. package/dist/esm/components/container.js +1 -1
  317. package/dist/esm/components/context-menu.d.ts.map +1 -1
  318. package/dist/esm/components/context-menu.js +1 -1
  319. package/dist/esm/components/data-list.js +1 -1
  320. package/dist/esm/components/dialog.d.ts.map +1 -1
  321. package/dist/esm/components/dialog.js +1 -1
  322. package/dist/esm/components/dropdown-menu.d.ts.map +1 -1
  323. package/dist/esm/components/dropdown-menu.js +1 -1
  324. package/dist/esm/components/em.js +1 -1
  325. package/dist/esm/components/flex.js +1 -1
  326. package/dist/esm/components/grid.js +1 -1
  327. package/dist/esm/components/heading.js +1 -1
  328. package/dist/esm/components/hover-card.js +1 -1
  329. package/dist/esm/components/icon-button.js +1 -1
  330. package/dist/esm/components/image.js +1 -1
  331. package/dist/esm/components/index.js +1 -1
  332. package/dist/esm/components/inset.js +1 -1
  333. package/dist/esm/components/kbd.js +1 -1
  334. package/dist/esm/components/link.js +1 -1
  335. package/dist/esm/components/navbar.js +1 -1
  336. package/dist/esm/components/popover.js +1 -1
  337. package/dist/esm/components/progress.js +1 -1
  338. package/dist/esm/components/quote.js +1 -1
  339. package/dist/esm/components/radio-cards.js +1 -1
  340. package/dist/esm/components/radio-group.js +1 -1
  341. package/dist/esm/components/radio.js +1 -1
  342. package/dist/esm/components/schemas/base-button.schema.d.ts +2 -2
  343. package/dist/esm/components/schemas/button.schema.d.ts +2 -2
  344. package/dist/esm/components/schemas/icon-button.schema.d.ts +4 -4
  345. package/dist/esm/components/schemas/shell.schema.d.ts +2 -2
  346. package/dist/esm/components/schemas/toggle-button.schema.d.ts +6 -6
  347. package/dist/esm/components/schemas/toggle-icon-button.schema.d.ts +8 -8
  348. package/dist/esm/components/scroll-area.js +1 -1
  349. package/dist/esm/components/section.js +1 -1
  350. package/dist/esm/components/segmented-control.js +1 -1
  351. package/dist/esm/components/select.js +1 -1
  352. package/dist/esm/components/separator.js +1 -1
  353. package/dist/esm/components/sheet.d.ts.map +1 -1
  354. package/dist/esm/components/sheet.js +1 -1
  355. package/dist/esm/components/shell.d.ts.map +1 -1
  356. package/dist/esm/components/shell.js +1 -1
  357. package/dist/esm/components/sidebar.js +1 -1
  358. package/dist/esm/components/skeleton.js +1 -1
  359. package/dist/esm/components/slider.js +1 -1
  360. package/dist/esm/components/spinner.js +1 -1
  361. package/dist/esm/components/strong.js +1 -1
  362. package/dist/esm/components/switch.js +1 -1
  363. package/dist/esm/components/tab-nav.js +1 -1
  364. package/dist/esm/components/table.js +1 -1
  365. package/dist/esm/components/tabs.js +1 -1
  366. package/dist/esm/components/text-area.js +1 -1
  367. package/dist/esm/components/text-field.js +1 -1
  368. package/dist/esm/components/text.js +1 -1
  369. package/dist/esm/components/theme-panel.js +1 -1
  370. package/dist/esm/components/theme.d.ts.map +1 -1
  371. package/dist/esm/components/theme.js +1 -1
  372. package/dist/esm/components/toggle-button.js +1 -1
  373. package/dist/esm/components/toggle-icon-button.js +1 -1
  374. package/dist/esm/components/toolbar.js +1 -1
  375. package/dist/esm/components/tooltip.js +1 -1
  376. package/dist/esm/components/user-card.js +1 -1
  377. package/dist/esm/helpers/compile-prop-defs.d.ts +49 -0
  378. package/dist/esm/helpers/compile-prop-defs.d.ts.map +1 -0
  379. package/dist/esm/helpers/compile-prop-defs.js +2 -0
  380. package/dist/esm/helpers/compile-prop-defs.js.map +7 -0
  381. package/dist/esm/helpers/extract-props.d.ts.map +1 -1
  382. package/dist/esm/helpers/extract-props.js +1 -1
  383. package/dist/esm/helpers/get-margin-styles.d.ts.map +1 -1
  384. package/dist/esm/helpers/get-margin-styles.js +1 -1
  385. package/dist/esm/helpers/get-responsive-styles.d.ts +5 -2
  386. package/dist/esm/helpers/get-responsive-styles.d.ts.map +1 -1
  387. package/dist/esm/helpers/get-responsive-styles.js +1 -1
  388. package/dist/esm/helpers/index.js +1 -1
  389. package/dist/esm/helpers/use-deprecation-warning.d.ts +10 -0
  390. package/dist/esm/helpers/use-deprecation-warning.d.ts.map +1 -0
  391. package/dist/esm/helpers/use-deprecation-warning.js +2 -0
  392. package/dist/esm/helpers/use-deprecation-warning.js.map +7 -0
  393. package/dist/esm/hooks/index.js +1 -1
  394. package/dist/esm/hooks/use-body-pointer-events-cleanup.d.ts.map +1 -1
  395. package/dist/esm/hooks/use-body-pointer-events-cleanup.js +1 -1
  396. package/dist/esm/hooks/use-breakpoint.d.ts +7 -3
  397. package/dist/esm/hooks/use-breakpoint.d.ts.map +1 -1
  398. package/dist/esm/hooks/use-breakpoint.js +1 -1
  399. package/dist/esm/hooks/use-prop-synced-state.d.ts +14 -0
  400. package/dist/esm/hooks/use-prop-synced-state.d.ts.map +1 -0
  401. package/dist/esm/hooks/use-prop-synced-state.js +2 -0
  402. package/dist/esm/hooks/use-prop-synced-state.js.map +7 -0
  403. package/dist/esm/index.js +1 -1
  404. package/package.json +2 -1
  405. package/schemas/base-button.json +0 -1
  406. package/schemas/button.json +0 -1
  407. package/schemas/icon-button.json +0 -1
  408. package/schemas/index.json +0 -6
  409. package/schemas/toggle-button.json +0 -1
  410. package/schemas/toggle-icon-button.json +0 -1
  411. package/src/components/_internal/base-button.css +2 -2
  412. package/src/components/_internal/base-button.tsx +3 -58
  413. package/src/components/_internal/base-card.css +19 -4
  414. package/src/components/_internal/base-checkbox.css +2 -2
  415. package/src/components/_internal/base-dialog.css +7 -13
  416. package/src/components/_internal/base-menu.css +7 -0
  417. package/src/components/_internal/base-radio.css +2 -2
  418. package/src/components/_internal/base-sidebar.css +7 -0
  419. package/src/components/_internal/base-tab-list.css +2 -2
  420. package/src/components/_internal/shell-handles.tsx +27 -0
  421. package/src/components/accordion.css +6 -6
  422. package/src/components/accordion.tsx +2 -8
  423. package/src/components/alert-dialog.tsx +22 -20
  424. package/src/components/avatar.css +2 -2
  425. package/src/components/badge.css +2 -2
  426. package/src/components/badge.tsx +2 -8
  427. package/src/components/callout.css +2 -2
  428. package/src/components/chatbar.css +1 -1
  429. package/src/components/context-menu.tsx +2 -8
  430. package/src/components/dialog.tsx +46 -72
  431. package/src/components/dropdown-menu.tsx +2 -8
  432. package/src/components/popover.css +7 -0
  433. package/src/components/progress.css +21 -8
  434. package/src/components/segmented-control.css +2 -2
  435. package/src/components/select.css +9 -2
  436. package/src/components/sheet.tsx +31 -28
  437. package/src/components/shell.css +106 -69
  438. package/src/components/shell.tsx +168 -97
  439. package/src/components/slider.css +2 -2
  440. package/src/components/switch.css +2 -2
  441. package/src/components/table.css +7 -0
  442. package/src/components/text-area.css +2 -2
  443. package/src/components/text-field.css +2 -2
  444. package/src/components/theme.tsx +35 -34
  445. package/src/helpers/compile-prop-defs.ts +121 -0
  446. package/src/helpers/extract-props.ts +104 -83
  447. package/src/helpers/get-margin-styles.ts +38 -71
  448. package/src/helpers/get-responsive-styles.ts +37 -38
  449. package/src/helpers/use-deprecation-warning.ts +26 -0
  450. package/src/hooks/use-body-pointer-events-cleanup.ts +36 -6
  451. package/src/hooks/use-breakpoint.ts +94 -53
  452. package/src/hooks/use-prop-synced-state.ts +24 -0
  453. package/src/styles/tokens/blur.css +28 -0
  454. package/src/styles/tokens/color.css +3 -3
  455. package/src/styles/tokens/constants.css +11 -0
  456. package/styles.css +280 -332
  457. package/tokens/base.css +13 -3
  458. package/tokens.css +16 -3
  459. package/dist/esm/chunk-2SS3FA3N.js +0 -2
  460. package/dist/esm/chunk-2SS3FA3N.js.map +0 -7
  461. package/dist/esm/chunk-5U2Q23K3.js +0 -2
  462. package/dist/esm/chunk-5U2Q23K3.js.map +0 -7
  463. package/dist/esm/chunk-6ELPYR73.js +0 -2
  464. package/dist/esm/chunk-6ELPYR73.js.map +0 -7
  465. package/dist/esm/chunk-DZ4H2KTP.js +0 -2
  466. package/dist/esm/chunk-DZ4H2KTP.js.map +0 -7
  467. package/dist/esm/chunk-H4MMVAGQ.js +0 -2
  468. package/dist/esm/chunk-H4MMVAGQ.js.map +0 -7
  469. package/dist/esm/chunk-HURTSXRY.js +0 -2
  470. package/dist/esm/chunk-HURTSXRY.js.map +0 -7
  471. package/dist/esm/chunk-ITRVKLYU.js +0 -2
  472. package/dist/esm/chunk-ITRVKLYU.js.map +0 -7
  473. package/dist/esm/chunk-KCAFSCOV.js +0 -2
  474. package/dist/esm/chunk-KCAFSCOV.js.map +0 -7
  475. package/dist/esm/chunk-KMPBTEZH.js +0 -2
  476. package/dist/esm/chunk-KMPBTEZH.js.map +0 -7
  477. package/dist/esm/chunk-LN5SP46K.js +0 -2
  478. package/dist/esm/chunk-LN5SP46K.js.map +0 -7
  479. package/dist/esm/chunk-Q73Y5O5P.js +0 -2
  480. package/dist/esm/chunk-Q73Y5O5P.js.map +0 -7
  481. package/dist/esm/chunk-RMBS6CAO.js +0 -2
  482. package/dist/esm/chunk-RMBS6CAO.js.map +0 -7
  483. package/dist/esm/chunk-UUX42HBM.js +0 -2
  484. package/dist/esm/chunk-UUX42HBM.js.map +0 -7
  485. package/dist/esm/chunk-X7BD5FLE.js +0 -2
  486. package/dist/esm/chunk-X7BD5FLE.js.map +0 -7
  487. package/dist/esm/chunk-YEA646GM.js +0 -2
  488. package/dist/esm/chunk-YEA646GM.js.map +0 -7
  489. package/dist/esm/chunk-ZMEXIPWM.js +0 -2
  490. package/dist/esm/chunk-ZMEXIPWM.js.map +0 -7
  491. /package/dist/esm/{chunk-RQ2ZPMHJ.js.map → chunk-22HGLMPQ.js.map} +0 -0
  492. /package/dist/esm/{chunk-WYA4IRU6.js.map → chunk-25WZA7ZU.js.map} +0 -0
  493. /package/dist/esm/{chunk-XHQGMOXV.js.map → chunk-36ZQVP7F.js.map} +0 -0
  494. /package/dist/esm/{chunk-K3R4AH3E.js.map → chunk-3MWWP4MW.js.map} +0 -0
  495. /package/dist/esm/{chunk-HQ35PM4O.js.map → chunk-43A5GUSI.js.map} +0 -0
  496. /package/dist/esm/{chunk-Z5DQ6FSA.js.map → chunk-4AQTUBVP.js.map} +0 -0
  497. /package/dist/esm/{chunk-25U7DENY.js.map → chunk-4BBOHEF4.js.map} +0 -0
  498. /package/dist/esm/{chunk-ZSEFZM5H.js.map → chunk-4IY2PR6N.js.map} +0 -0
  499. /package/dist/esm/{chunk-QLIELX4I.js.map → chunk-4ME6O27S.js.map} +0 -0
  500. /package/dist/esm/{chunk-JQOFJNCV.js.map → chunk-4YFJWXL2.js.map} +0 -0
  501. /package/dist/esm/{chunk-DNI4QRXQ.js.map → chunk-5IBGFL6O.js.map} +0 -0
  502. /package/dist/esm/{chunk-IPJUHVM6.js.map → chunk-666GX7O5.js.map} +0 -0
  503. /package/dist/esm/{chunk-DJBPM5QK.js.map → chunk-7FC7HF76.js.map} +0 -0
  504. /package/dist/esm/{chunk-SVLY6B5F.js.map → chunk-7QDTSBJF.js.map} +0 -0
  505. /package/dist/esm/{chunk-DK5MHD6I.js.map → chunk-B24BDVG2.js.map} +0 -0
  506. /package/dist/esm/{chunk-WZCZHCVE.js.map → chunk-BJYUPIXO.js.map} +0 -0
  507. /package/dist/esm/{chunk-BJTJUIYJ.js.map → chunk-CRWYCLTE.js.map} +0 -0
  508. /package/dist/esm/{chunk-OHJVFZMH.js.map → chunk-CSKZZOI2.js.map} +0 -0
  509. /package/dist/esm/{chunk-ADYTQCZX.js.map → chunk-D6B7IMZU.js.map} +0 -0
  510. /package/dist/esm/{chunk-USGTBZ43.js.map → chunk-E67CIG6A.js.map} +0 -0
  511. /package/dist/esm/{chunk-42HFGCHX.js.map → chunk-ETMLMDW4.js.map} +0 -0
  512. /package/dist/esm/{chunk-7CBAHIVG.js.map → chunk-F2HYQ3ZR.js.map} +0 -0
  513. /package/dist/esm/{chunk-YUZPSUJE.js.map → chunk-F7IYL2VW.js.map} +0 -0
  514. /package/dist/esm/{chunk-FVCWNSRU.js.map → chunk-FHOCUZDR.js.map} +0 -0
  515. /package/dist/esm/{chunk-7MURQ6CR.js.map → chunk-FLFAXVFB.js.map} +0 -0
  516. /package/dist/esm/{chunk-APRBRAOT.js.map → chunk-FOEZLQTW.js.map} +0 -0
  517. /package/dist/esm/{chunk-WNSPLWRV.js.map → chunk-GJSGKE7B.js.map} +0 -0
  518. /package/dist/esm/{chunk-OGOOZLUD.js.map → chunk-GLERJXVS.js.map} +0 -0
  519. /package/dist/esm/{chunk-6VGPTAHM.js.map → chunk-GWXVETMF.js.map} +0 -0
  520. /package/dist/esm/{chunk-ES7MK2MM.js.map → chunk-GYBLXQ4R.js.map} +0 -0
  521. /package/dist/esm/{chunk-4OBMRJHC.js.map → chunk-H7ST535H.js.map} +0 -0
  522. /package/dist/esm/{chunk-QLZ5XAW6.js.map → chunk-HF5WY5YE.js.map} +0 -0
  523. /package/dist/esm/{chunk-RDP4UQ42.js.map → chunk-IEWCQU2S.js.map} +0 -0
  524. /package/dist/esm/{chunk-XLOHPURR.js.map → chunk-IHK3H2OM.js.map} +0 -0
  525. /package/dist/esm/{chunk-3F6I7YOR.js.map → chunk-JDGJSNWT.js.map} +0 -0
  526. /package/dist/esm/{chunk-VF5TRT3H.js.map → chunk-KKM6T5P7.js.map} +0 -0
  527. /package/dist/esm/{chunk-ZHYOJNWV.js.map → chunk-LKAK5GXF.js.map} +0 -0
  528. /package/dist/esm/{chunk-JCYI4NTV.js.map → chunk-MBCBP73P.js.map} +0 -0
  529. /package/dist/esm/{chunk-UYNYUR7O.js.map → chunk-MBE2YSBU.js.map} +0 -0
  530. /package/dist/esm/{chunk-H2G446JG.js.map → chunk-NMKPFUNP.js.map} +0 -0
  531. /package/dist/esm/{chunk-4N5JU7XQ.js.map → chunk-O3CDWEZA.js.map} +0 -0
  532. /package/dist/esm/{chunk-TEULZKBM.js.map → chunk-OGXZHAQL.js.map} +0 -0
  533. /package/dist/esm/{chunk-2AEELIG6.js.map → chunk-OWAUCLRT.js.map} +0 -0
  534. /package/dist/esm/{chunk-7CXVHFMQ.js.map → chunk-P7HYVJSU.js.map} +0 -0
  535. /package/dist/esm/{chunk-4532RT2B.js.map → chunk-P7IAHW4V.js.map} +0 -0
  536. /package/dist/esm/{chunk-M3ZYJANH.js.map → chunk-PQZXQ4ST.js.map} +0 -0
  537. /package/dist/esm/{chunk-SGU4HUHF.js.map → chunk-PTLFMWCN.js.map} +0 -0
  538. /package/dist/esm/{chunk-E6IWYD3U.js.map → chunk-S5C5YRBS.js.map} +0 -0
  539. /package/dist/esm/{chunk-A24PYRVV.js.map → chunk-SO67YEVQ.js.map} +0 -0
  540. /package/dist/esm/{chunk-HACQF6F4.js.map → chunk-TOOSHJOA.js.map} +0 -0
  541. /package/dist/esm/{chunk-QOWA5LK5.js.map → chunk-U2X2CAW4.js.map} +0 -0
  542. /package/dist/esm/{chunk-U7AASKZI.js.map → chunk-UVCH7QKO.js.map} +0 -0
  543. /package/dist/esm/{chunk-GWYFT3EI.js.map → chunk-VLO7NXSP.js.map} +0 -0
  544. /package/dist/esm/{chunk-DXI5P5O4.js.map → chunk-VX6ARMWP.js.map} +0 -0
  545. /package/dist/esm/{chunk-EJWAAFCI.js.map → chunk-WO43WW3A.js.map} +0 -0
  546. /package/dist/esm/{chunk-GLC4QJBF.js.map → chunk-WTYNFBFV.js.map} +0 -0
  547. /package/dist/esm/{chunk-6FAICIYS.js.map → chunk-XMRIRFM7.js.map} +0 -0
  548. /package/dist/esm/{chunk-UIEUZLZZ.js.map → chunk-ZY6SQWHT.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/components/card.tsx", "../../../src/props/as-child.prop.ts", "../../../src/components/card.props.tsx", "../../../src/helpers/extract-props.ts", "../../../src/props/prop-def.ts", "../../../src/helpers/has-own-property.ts", "../../../src/helpers/is-responsive-object.ts", "../../../src/helpers/get-responsive-styles.ts", "../../../src/helpers/merge-styles.ts", "../../../src/props/margin.props.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { cardPropDefs } from './card.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\n\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype CardElement = React.ElementRef<'div'>;\ntype CardOwnProps = GetPropDefTypes<typeof cardPropDefs>;\ninterface CardProps extends ComponentPropsWithout<'div', RemovedProps>, MarginProps, CardOwnProps {}\nconst Card = React.forwardRef<CardElement, CardProps>((props, forwardedRef) => {\n const { asChild, className, panelBackground, material, flush, inset, ...cardProps } = extractProps(\n props,\n cardPropDefs,\n marginPropDefs,\n );\n const effectiveMaterial = material || panelBackground;\n const Comp = asChild ? Slot.Root : 'div';\n return (\n <Comp\n ref={forwardedRef}\n {...cardProps}\n data-panel-background={effectiveMaterial}\n data-material={effectiveMaterial}\n data-flush={flush ? 'true' : undefined}\n data-inset={inset ? 'true' : undefined}\n className={classNames('rt-reset', 'rt-BaseCard', 'rt-Card', className)}\n />\n );\n});\nCard.displayName = 'Card';\n\nexport { Card };\nexport type { CardProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst asChildPropDef = {\n /**\n * Composes the component into its immediate child instead of rendering its own HTML element.\n * You\u2019ll have to provide a single React Element child.\n */\n asChild: {\n type: 'boolean',\n },\n} satisfies {\n asChild: PropDef<boolean>;\n};\n\nexport { asChildPropDef };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4', '5'] as const;\nconst variants = ['surface', 'outline', 'classic', 'ghost', 'soft'] as const;\nconst panelBackgrounds = ['solid', 'translucent'] as const;\nconst materials = ['solid', 'translucent'] as const;\n\nconst cardPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '1', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: variants, default: 'outline' },\n panelBackground: { type: 'enum', values: panelBackgrounds, default: undefined },\n material: { type: 'enum', values: materials, default: undefined },\n flush: { type: 'boolean', default: false },\n inset: { type: 'boolean', default: false },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n panelBackground: PropDef<(typeof panelBackgrounds)[number] | undefined>;\n material: PropDef<(typeof materials)[number] | undefined>;\n flush: PropDef<boolean>;\n inset: PropDef<boolean>;\n};\n\nexport { cardPropDefs };\n", "import classNames from 'classnames';\n\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef>\n ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T]\n : never;\n\nfunction mergePropDefs<T extends Record<string, PropDef>[]>(...args: T): Record<string, PropDef> {\n return Object.assign({}, ...args);\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<\n P extends { className?: string; style?: React.CSSProperties; [key: string]: any },\n T extends Record<string, PropDef>[]\n>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n let className: string | undefined;\n let style: ReturnType<typeof mergeStyles>;\n const extractedProps = { ...props };\n const allPropDefs = mergePropDefs(...propDefs);\n\n for (const key in allPropDefs) {\n let value = extractedProps[key];\n const propDef = allPropDefs[key];\n\n // Apply prop def defaults\n if (propDef.default !== undefined && value === undefined) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.type === 'enum') {\n const values = [propDef.default, ...propDef.values];\n\n if (!values.includes(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n }\n\n // Apply the value with defaults\n (extractedProps as Record<string, any>)[key] = value;\n\n if ('className' in propDef && propDef.className) {\n delete extractedProps[key];\n\n const isResponsivePropDef = 'responsive' in propDef;\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!value || (isResponsiveObject(value) && !isResponsivePropDef)) {\n continue;\n }\n\n if (isResponsiveObject(value)) {\n // Apply prop def defaults to the `initial` breakpoint\n if (propDef.default !== undefined && value.initial === undefined) {\n value.initial = propDef.default;\n }\n\n // Apply the default value to the `initial` breakpoint when it is not a valid enum value\n if (propDef.type === 'enum') {\n const values = [propDef.default, ...propDef.values];\n\n if (!values.includes(value.initial)) {\n value.initial = propDef.default;\n }\n }\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className,\n propValues: propDef.values,\n parseValue: propDef.parseValue,\n });\n\n className = classNames(className, propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const propDefValues = propDef.type === 'string' ? [] : propDef.values;\n\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className,\n customProperties: propDef.customProperties,\n propValues: propDefValues,\n parseValue: propDef.parseValue,\n value,\n });\n\n style = mergeStyles(style, propCustomProperties);\n className = classNames(className, propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean' && value) {\n // TODO handle responsive boolean props\n className = classNames(className, propDef.className);\n continue;\n }\n }\n }\n\n extractedProps.className = classNames(className, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps;\n}\n\nexport { extractProps };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({\n allowArbitraryValues,\n value,\n className,\n propValues,\n parseValue = (value) => value,\n}: GetResponsiveClassNamesOptions): string | undefined {\n const classNames: string[] = [];\n\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string' && propValues.includes(value)) {\n return getBaseClassName(className, value, parseValue);\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (propValues.includes(value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.join(' ');\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(\n className: string,\n value: string,\n parseValue: (value: string) => string | undefined\n): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({\n customProperties,\n value,\n propValues,\n parseValue = (value) => value,\n}: GetResponsiveCustomPropertiesOptions) {\n let styles: Record<string, string | undefined> = {};\n\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && propValues.includes(value))) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n styles = Object.fromEntries(customProperties.map((prop) => [prop, value]));\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (propValues.includes(value)) {\n continue;\n }\n\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = value;\n }\n }\n }\n\n for (const key in styles) {\n const value = styles[key];\n if (value !== undefined) {\n styles[key] = parseValue(value);\n }\n }\n\n return styles;\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\n// prettier-ignore\nconst marginValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9', '-10', '-11', '-12'] as const;\n\nconst marginPropDefs = {\n /**\n * Sets the CSS **margin** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * m=\"4\"\n * m=\"100px\"\n * m={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin\n */\n m: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-m',\n customProperties: ['--m'],\n },\n /**\n * Sets the CSS **margin-left** and **margin-right** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mx=\"4\"\n * mx=\"100px\"\n * mx={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mx: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mx',\n customProperties: ['--ml', '--mr'],\n },\n /**\n * Sets the CSS **margin-top** and **margin-bottom** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * my=\"4\"\n * my=\"100px\"\n * my={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n my: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-my',\n customProperties: ['--mt', '--mb'],\n },\n /**\n * Sets the CSS **margin-top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mt=\"4\"\n * mt=\"100px\"\n * mt={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n */\n mt: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mt',\n customProperties: ['--mt'],\n },\n /**\n * Sets the CSS **margin-right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mr=\"4\"\n * mr=\"100px\"\n * mr={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mr: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mr',\n customProperties: ['--mr'],\n },\n /**\n * Sets the CSS **margin-bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mb=\"4\"\n * mb=\"100px\"\n * mb={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n mb: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mb',\n customProperties: ['--mb'],\n },\n /**\n * Sets the CSS **margin-left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * ml=\"4\"\n * ml=\"100px\"\n * ml={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n */\n ml: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-ml',\n customProperties: ['--ml'],\n },\n} satisfies {\n m: PropDef<(typeof marginValues)[number]>;\n mx: PropDef<(typeof marginValues)[number]>;\n my: PropDef<(typeof marginValues)[number]>;\n mt: PropDef<(typeof marginValues)[number]>;\n mr: PropDef<(typeof marginValues)[number]>;\n mb: PropDef<(typeof marginValues)[number]>;\n ml: PropDef<(typeof marginValues)[number]>;\n};\n\ntype MarginProps = GetPropDefTypes<typeof marginPropDefs>;\n\nexport { marginPropDefs };\nexport type { MarginProps };\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBACvBC,EAAuB,yBACvBC,EAAqB,oBCArB,IAAMC,EAAiB,CAKrB,QAAS,CACP,KAAM,SACR,CACF,ECNA,IAAMC,EAAQ,CAAC,IAAK,IAAK,IAAK,IAAK,GAAG,EAChCC,EAAW,CAAC,UAAW,UAAW,UAAW,QAAS,MAAM,EAC5DC,EAAmB,CAAC,QAAS,aAAa,EAC1CC,EAAY,CAAC,QAAS,aAAa,EAEnCC,EAAe,CACnB,GAAGC,EACH,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQL,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQC,EAAU,QAAS,SAAU,EACvF,gBAAiB,CAAE,KAAM,OAAQ,OAAQC,EAAkB,QAAS,MAAU,EAC9E,SAAU,CAAE,KAAM,OAAQ,OAAQC,EAAW,QAAS,MAAU,EAChE,MAAO,CAAE,KAAM,UAAW,QAAS,EAAM,EACzC,MAAO,CAAE,KAAM,UAAW,QAAS,EAAM,CAC3C,ECjBA,IAAAG,EAAuB,yBCMvB,IAAMC,EAAc,CAAC,UAAW,KAAM,KAAM,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A,GAAI,CACF,KAAM,gBACN,OAAQA,EACR,WAAY,GACZ,UAAW,UACX,iBAAkB,CAAC,MAAM,CAC3B,EAaA,GAAI,CACF,KAAM,gBACN,OAAQA,EACR,WAAY,GACZ,UAAW,UACX,iBAAkB,CAAC,MAAM,CAC3B,EAaA,GAAI,CACF,KAAM,gBACN,OAAQA,EACR,WAAY,GACZ,UAAW,UACX,iBAAkB,CAAC,MAAM,CAC3B,EAaA,GAAI,CACF,KAAM,gBACN,OAAQA,EACR,WAAY,GACZ,UAAW,UACX,iBAAkB,CAAC,MAAM,CAC3B,CACF,ET9HA,IAAME,EAAa,aAAmC,CAACC,EAAOC,IAAiB,CAC7E,GAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,gBAAAC,EAAiB,SAAAC,EAAU,MAAAC,EAAO,MAAAC,EAAO,GAAGC,CAAU,EAAIC,EACpFT,EACAU,EACAC,CACF,EACMC,EAAoBP,GAAYD,EAChCS,EAAOX,EAAU,OAAK,KAAO,MACnC,OACE,gBAACW,EAAA,CACC,IAAKZ,EACJ,GAAGO,EACJ,wBAAuBI,EACvB,gBAAeA,EACf,aAAYN,EAAQ,OAAS,OAC7B,aAAYC,EAAQ,OAAS,OAC7B,aAAW,EAAAO,SAAW,WAAY,cAAe,UAAWX,CAAS,EACvE,CAEJ,CAAC,EACDJ,EAAK,YAAc",
6
- "names": ["card_exports", "__export", "Card", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "asChildPropDef", "sizes", "variants", "panelBackgrounds", "materials", "cardPropDefs", "asChildPropDef", "import_classnames", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "value", "propValues", "parseValue", "classNames", "getBaseClassName", "isResponsiveObject", "object", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "prop", "customProperty", "bpProperty", "key", "mergeStyles", "styles", "result", "style", "mergePropDefs", "args", "extractProps", "props", "propDefs", "className", "style", "extractedProps", "allPropDefs", "key", "value", "propDef", "isResponsiveObject", "isResponsivePropDef", "propClassName", "getResponsiveClassNames", "classNames", "propDefValues", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "marginValues", "marginPropDefs", "Card", "props", "forwardedRef", "asChild", "className", "panelBackground", "material", "flush", "inset", "cardProps", "extractProps", "cardPropDefs", "marginPropDefs", "effectiveMaterial", "Comp", "classNames"]
3
+ "sources": ["../../../src/components/card.tsx", "../../../src/props/as-child.prop.ts", "../../../src/components/card.props.tsx", "../../../src/helpers/extract-props.ts", "../../../src/helpers/compile-prop-defs.ts", "../../../src/props/prop-def.ts", "../../../src/helpers/has-own-property.ts", "../../../src/helpers/is-responsive-object.ts", "../../../src/helpers/get-responsive-styles.ts", "../../../src/helpers/merge-styles.ts", "../../../src/props/margin.props.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { cardPropDefs } from './card.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\n\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype CardElement = React.ElementRef<'div'>;\ntype CardOwnProps = GetPropDefTypes<typeof cardPropDefs>;\ninterface CardProps extends ComponentPropsWithout<'div', RemovedProps>, MarginProps, CardOwnProps {}\nconst Card = React.forwardRef<CardElement, CardProps>((props, forwardedRef) => {\n const { asChild, className, panelBackground, material, flush, inset, ...cardProps } = extractProps(\n props,\n cardPropDefs,\n marginPropDefs,\n );\n const effectiveMaterial = material || panelBackground;\n const Comp = asChild ? Slot.Root : 'div';\n return (\n <Comp\n ref={forwardedRef}\n {...cardProps}\n data-panel-background={effectiveMaterial}\n data-material={effectiveMaterial}\n data-flush={flush ? 'true' : undefined}\n data-inset={inset ? 'true' : undefined}\n className={classNames('rt-reset', 'rt-BaseCard', 'rt-Card', className)}\n />\n );\n});\nCard.displayName = 'Card';\n\nexport { Card };\nexport type { CardProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst asChildPropDef = {\n /**\n * Composes the component into its immediate child instead of rendering its own HTML element.\n * You\u2019ll have to provide a single React Element child.\n */\n asChild: {\n type: 'boolean',\n },\n} satisfies {\n asChild: PropDef<boolean>;\n};\n\nexport { asChildPropDef };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4', '5'] as const;\nconst variants = ['surface', 'outline', 'classic', 'ghost', 'soft'] as const;\nconst panelBackgrounds = ['solid', 'translucent'] as const;\nconst materials = ['solid', 'translucent'] as const;\n\nconst cardPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '1', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: variants, default: 'outline' },\n panelBackground: { type: 'enum', values: panelBackgrounds, default: undefined },\n material: { type: 'enum', values: materials, default: undefined },\n flush: { type: 'boolean', default: false },\n inset: { type: 'boolean', default: false },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n panelBackground: PropDef<(typeof panelBackgrounds)[number] | undefined>;\n material: PropDef<(typeof materials)[number] | undefined>;\n flush: PropDef<boolean>;\n inset: PropDef<boolean>;\n};\n\nexport { cardPropDefs };\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\n// prettier-ignore\nconst marginValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9', '-10', '-11', '-12'] as const;\n\nconst marginPropDefs = {\n /**\n * Sets the CSS **margin** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * m=\"4\"\n * m=\"100px\"\n * m={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin\n */\n m: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-m',\n customProperties: ['--m'],\n },\n /**\n * Sets the CSS **margin-left** and **margin-right** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mx=\"4\"\n * mx=\"100px\"\n * mx={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mx: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mx',\n customProperties: ['--ml', '--mr'],\n },\n /**\n * Sets the CSS **margin-top** and **margin-bottom** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * my=\"4\"\n * my=\"100px\"\n * my={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n my: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-my',\n customProperties: ['--mt', '--mb'],\n },\n /**\n * Sets the CSS **margin-top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mt=\"4\"\n * mt=\"100px\"\n * mt={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n */\n mt: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mt',\n customProperties: ['--mt'],\n },\n /**\n * Sets the CSS **margin-right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mr=\"4\"\n * mr=\"100px\"\n * mr={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mr: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mr',\n customProperties: ['--mr'],\n },\n /**\n * Sets the CSS **margin-bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mb=\"4\"\n * mb=\"100px\"\n * mb={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n mb: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mb',\n customProperties: ['--mb'],\n },\n /**\n * Sets the CSS **margin-left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * ml=\"4\"\n * ml=\"100px\"\n * ml={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n */\n ml: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-ml',\n customProperties: ['--ml'],\n },\n} satisfies {\n m: PropDef<(typeof marginValues)[number]>;\n mx: PropDef<(typeof marginValues)[number]>;\n my: PropDef<(typeof marginValues)[number]>;\n mt: PropDef<(typeof marginValues)[number]>;\n mr: PropDef<(typeof marginValues)[number]>;\n mb: PropDef<(typeof marginValues)[number]>;\n ml: PropDef<(typeof marginValues)[number]>;\n};\n\ntype MarginProps = GetPropDefTypes<typeof marginPropDefs>;\n\nexport { marginPropDefs };\nexport type { MarginProps };\n"],
5
+ "mappings": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,UAAAE,IAAA,eAAAC,EAAAH,IAAA,IAAAI,EAAuB,oBACvBC,EAAuB,yBACvBC,EAAqB,oBCArB,IAAMC,EAAiB,CAKrB,QAAS,CACP,KAAM,SACR,CACF,ECNA,IAAMC,EAAQ,CAAC,IAAK,IAAK,IAAK,IAAK,GAAG,EAChCC,EAAW,CAAC,UAAW,UAAW,UAAW,QAAS,MAAM,EAC5DC,EAAmB,CAAC,QAAS,aAAa,EAC1CC,EAAY,CAAC,QAAS,aAAa,EAEnCC,EAAe,CACnB,GAAGC,EACH,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQL,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQC,EAAU,QAAS,SAAU,EACv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AM,CAC3B,EAaA,GAAI,CACF,KAAM,gBACN,OAAQA,EACR,WAAY,GACZ,UAAW,UACX,iBAAkB,CAAC,MAAM,CAC3B,CACF,EV9HA,IAAME,EAAa,aAAmC,CAACC,EAAOC,IAAiB,CAC7E,GAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,gBAAAC,EAAiB,SAAAC,EAAU,MAAAC,EAAO,MAAAC,EAAO,GAAGC,CAAU,EAAIC,EACpFT,EACAU,EACAC,CACF,EACMC,EAAoBP,GAAYD,EAChCS,EAAOX,EAAU,OAAK,KAAO,MACnC,OACE,gBAACW,EAAA,CACC,IAAKZ,EACJ,GAAGO,EACJ,wBAAuBI,EACvB,gBAAeA,EACf,aAAYN,EAAQ,OAAS,OAC7B,aAAYC,EAAQ,OAAS,OAC7B,aAAW,EAAAO,SAAW,WAAY,cAAe,UAAWX,CAAS,EACvE,CAEJ,CAAC,EACDJ,EAAK,YAAc",
6
+ "names": ["card_exports", "__export", "Card", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "asChildPropDef", "sizes", "variants", "panelBackgrounds", "materials", "cardPropDefs", "asChildPropDef", "import_classnames", "EMPTY_VALUES", "EMPTY_SET", "compile", "propDefs", "merged", "styling", "passthrough", "stylingKeys", "key", "def", "values", "compiled", "cacheRoot", "getCompiledPropDefs", "node", "i", "propDef", "child", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "includesValue", "propValues", "propValueSet", "value", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "parseValue", "getBaseClassName", "isResponsiveObject", "object", "classNames", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "parsed", "customProperty", "bpProperty", "mergeStyles", "styles", "result", "style", "normalizeResponsiveValue", "value", "propDef", "initial", "changed", "extractProps", "props", "propDefs", "styling", "passthrough", "stylingKeys", "getCompiledPropDefs", "extractedProps", "key", "isResponsiveObject", "style", "classes", "propClassName", "getResponsiveClassNames", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "classNames", "marginValues", "marginPropDefs", "Card", "props", "forwardedRef", "asChild", "className", "panelBackground", "material", "flush", "inset", "cardProps", "extractProps", "cardPropDefs", "marginPropDefs", "effectiveMaterial", "Comp", "classNames"]
7
7
  }
@@ -1,5 +1,5 @@
1
- "use strict";var qo=Object.create;var qe=Object.defineProperty;var _o=Object.getOwnPropertyDescriptor;var Zo=Object.getOwnPropertyNames;var Yo=Object.getPrototypeOf,Xo=Object.prototype.hasOwnProperty;var Jo=(e,t)=>{for(var r in t)qe(e,r,{get:t[r],enumerable:!0})},Ut=(e,t,r,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Zo(t))!Xo.call(e,n)&&n!==r&&qe(e,n,{get:()=>t[n],enumerable:!(p=_o(t,n))||p.enumerable});return e};var S=(e,t,r)=>(r=e!=null?qo(Yo(e)):{},Ut(t||!e||!e.__esModule?qe(r,"default",{value:e,enumerable:!0}):r,e)),Qo=e=>Ut(qe({},"__esModule",{value:!0}),e);var Ur={};Jo(Ur,{AttachTrigger:()=>Fo,Attachment:()=>Et,AttachmentsRow:()=>Io,InlineEnd:()=>Vo,InlineStart:()=>Oo,Root:()=>Bo,Row:()=>jo,RowEnd:()=>zo,RowStart:()=>Lo,Send:()=>Ho,Textarea:()=>Mo});module.exports=Qo(Ur);var o=S(require("react")),K=S(require("classnames")),le=require("motion/react");var We=S(require("react")),To=S(require("classnames"));var x=S(require("react")),io=S(require("classnames")),po=require("radix-ui"),lo=require("radix-ui/internal");var ne={asChild:{type:"boolean"}};var _e=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"],Kt=["auto","gray","mauve","slate","sage","olive","sand"],qt={color:{type:"enum",values:_e,default:void 0}},_t={color:{type:"enum",values:_e,default:""}};var Ze={highContrast:{type:"boolean",className:"rt-high-contrast",default:void 0}};var ft=["none","small","medium","large","full"],Ye={radius:{type:"enum",values:ft,default:void 0}};var er=["1","2","3","4"],tr=["classic","solid","soft","surface","outline","ghost","override"],or=["solid","translucent"],rr=["solid","translucent"],dt={...ne,size:{type:"enum",className:"rt-r-size",values:er,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:tr,default:"solid"},..._t,...Ze,...Ye,loading:{type:"boolean",className:"rt-loading",default:!1},fullWidth:{type:"boolean",className:"rt-full-width",default:!1},material:{type:"enum",values:rr,default:void 0},panelBackground:{type:"enum",values:or,default:void 0},flush:{type:"boolean",default:!1}};var Je=S(require("react")),to=S(require("classnames"));var ze=S(require("classnames"));var nr=["initial","xs","sm","md","lg","xl"],yt=new Set(nr);function gt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var sr=new Set(["initial","xs","sm","md","lg","xl"]);function ve(e){if(typeof e!="object"||e===null)return!1;for(let t in e)if(sr.has(t))return!0;return!1}function se({className:e,customProperties:t,...r}){let p=ke({allowArbitraryValues:!0,className:e,...r}),n=ar({customProperties:t,...r});return[p,n]}function ke({allowArbitraryValues:e,value:t,className:r,propValues:p,parseValue:n=l=>l}){let l=[];if(t){if(typeof t=="string"&&p.includes(t))return Zt(r,t,n);if(ve(t)){let i=t;for(let a in i){if(!gt(i,a)||!yt.has(a))continue;let s=i[a];if(s!==void 0){if(p.includes(s)){let u=Zt(r,s,n),f=a==="initial"?u:`${a}:${u}`;l.push(f)}else if(e){let u=a==="initial"?r:`${a}:${r}`;l.push(u)}}}return l.join(" ")}if(e)return r}}function Zt(e,t,r){let p=e?"-":"",n=r(t),l=n?.startsWith("-"),i=l?"-":"",a=l?n?.substring(1):n;return`${i}${e}${p}${a}`}function ar({customProperties:e,value:t,propValues:r,parseValue:p=n=>n}){let n={};if(!(!t||typeof t=="string"&&r.includes(t))){if(typeof t=="string"&&(n=Object.fromEntries(e.map(l=>[l,t]))),ve(t)){let l=t;for(let i in l){if(!gt(l,i)||!yt.has(i))continue;let a=l[i];if(!r.includes(a))for(let s of e){let u=i==="initial"?s:`${s}-${i}`;n[u]=a}}}for(let l in n){let i=n[l];i!==void 0&&(n[l]=p(i))}return n}}function Ce(...e){let t;for(let r of e)r&&(t===void 0&&(t={}),Object.assign(t,r));return t}function ir(...e){return Object.assign({},...e)}function ae(e,...t){let r,p,n={...e},l=ir(...t);for(let i in l){let a=n[i],s=l[i];if(s.default!==void 0&&a===void 0&&(a=s.default),s.type==="enum"&&![s.default,...s.values].includes(a)&&!ve(a)&&(a=s.default),n[i]=a,"className"in s&&s.className){delete n[i];let u="responsive"in s;if(!a||ve(a)&&!u)continue;if(ve(a)&&(s.default!==void 0&&a.initial===void 0&&(a.initial=s.default),s.type==="enum"&&([s.default,...s.values].includes(a.initial)||(a.initial=s.default))),s.type==="enum"){let f=ke({allowArbitraryValues:!1,value:a,className:s.className,propValues:s.values,parseValue:s.parseValue});r=(0,ze.default)(r,f);continue}if(s.type==="string"||s.type==="enum | string"){let f=s.type==="string"?[]:s.values,[P,b]=se({className:s.className,customProperties:s.customProperties,propValues:f,parseValue:s.parseValue,value:a});p=Ce(p,b),r=(0,ze.default)(r,P);continue}if(s.type==="boolean"&&a){r=(0,ze.default)(r,s.className);continue}}}return n.className=(0,ze.default)(r,e.className),n.style=Ce(p,e.style),n}var Re=["0","1","2","3","4","5","6","7","8","9","10","11","12"],Yt={p:{type:"enum | string",className:"rt-r-p",customProperties:["--p"],values:Re,responsive:!0},px:{type:"enum | string",className:"rt-r-px",customProperties:["--pl","--pr"],values:Re,responsive:!0},py:{type:"enum | string",className:"rt-r-py",customProperties:["--pt","--pb"],values:Re,responsive:!0},pt:{type:"enum | string",className:"rt-r-pt",customProperties:["--pt"],values:Re,responsive:!0},pr:{type:"enum | string",className:"rt-r-pr",customProperties:["--pr"],values:Re,responsive:!0},pb:{type:"enum | string",className:"rt-r-pb",customProperties:["--pb"],values:Re,responsive:!0},pl:{type:"enum | string",className:"rt-r-pl",customProperties:["--pl"],values:Re,responsive:!0}};var Xt={height:{type:"string",className:"rt-r-h",customProperties:["--height"],responsive:!0},minHeight:{type:"string",className:"rt-r-min-h",customProperties:["--min-height"],responsive:!0},maxHeight:{type:"string",className:"rt-r-max-h",customProperties:["--max-height"],responsive:!0}};var Be={width:{type:"string",className:"rt-r-w",customProperties:["--width"],responsive:!0},minWidth:{type:"string",className:"rt-r-min-w",customProperties:["--min-width"],responsive:!0},maxWidth:{type:"string",className:"rt-r-max-w",customProperties:["--max-width"],responsive:!0}};var ht=["visible","hidden","clip","scroll","auto"],pr=["static","relative","absolute","fixed","sticky"],He=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],lr=["0","1"],cr=["0","1"],mr=["start","center","end","baseline","stretch"],ur=["start","center","end","baseline","stretch"],Jt={...Yt,...Be,...Xt,position:{type:"enum",className:"rt-r-position",values:pr,responsive:!0},inset:{type:"enum | string",className:"rt-r-inset",customProperties:["--inset"],values:He,responsive:!0},top:{type:"enum | string",className:"rt-r-top",customProperties:["--top"],values:He,responsive:!0},right:{type:"enum | string",className:"rt-r-right",customProperties:["--right"],values:He,responsive:!0},bottom:{type:"enum | string",className:"rt-r-bottom",customProperties:["--bottom"],values:He,responsive:!0},left:{type:"enum | string",className:"rt-r-left",customProperties:["--left"],values:He,responsive:!0},overflow:{type:"enum",className:"rt-r-overflow",values:ht,responsive:!0},overflowX:{type:"enum",className:"rt-r-ox",values:ht,responsive:!0},overflowY:{type:"enum",className:"rt-r-oy",values:ht,responsive:!0},flexBasis:{type:"string",className:"rt-r-fb",customProperties:["--flex-basis"],responsive:!0},flexShrink:{type:"enum | string",className:"rt-r-fs",customProperties:["--flex-shrink"],values:lr,responsive:!0},flexGrow:{type:"enum | string",className:"rt-r-fg",customProperties:["--flex-grow"],values:cr,responsive:!0},gridArea:{type:"string",className:"rt-r-ga",customProperties:["--grid-area"],responsive:!0},gridColumn:{type:"string",className:"rt-r-gc",customProperties:["--grid-column"],responsive:!0},gridColumnStart:{type:"string",className:"rt-r-gcs",customProperties:["--grid-column-start"],responsive:!0},gridColumnEnd:{type:"string",className:"rt-r-gce",customProperties:["--grid-column-end"],responsive:!0},gridRow:{type:"string",className:"rt-r-gr",customProperties:["--grid-row"],responsive:!0},gridRowStart:{type:"string",className:"rt-r-grs",customProperties:["--grid-row-start"],responsive:!0},gridRowEnd:{type:"string",className:"rt-r-gre",customProperties:["--grid-row-end"],responsive:!0},alignSelf:{type:"enum",className:"rt-r-as",values:mr,responsive:!0},justifySelf:{type:"enum",className:"rt-r-js",values:ur,responsive:!0}};var xe=["0","1","2","3","4","5","6","7","8","9","10","11","12","-1","-2","-3","-4","-5","-6","-7","-8","-9","-10","-11","-12"],ie={m:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-m",customProperties:["--m"]},mx:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-mx",customProperties:["--ml","--mr"]},my:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-my",customProperties:["--mt","--mb"]},mt:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-mt",customProperties:["--mt"]},mr:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-mr",customProperties:["--mr"]},mb:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-mb",customProperties:["--mb"]},ml:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-ml",customProperties:["--ml"]}};var Xe=require("radix-ui"),Dn=Xe.Slot.Root,X=Xe.Slot.Root,Tn=Xe.Slot.Slottable;var Pt=["0","1","2","3","4","5","6","7","8","9","10","11","12"],Qt={gap:{type:"enum | string",className:"rt-r-gap",customProperties:["--gap"],values:Pt,responsive:!0},gapX:{type:"enum | string",className:"rt-r-cg",customProperties:["--column-gap"],values:Pt,responsive:!0},gapY:{type:"enum | string",className:"rt-r-rg",customProperties:["--row-gap"],values:Pt,responsive:!0}};var fr=["div","span"],dr=["none","inline-flex","flex"],yr=["row","column","row-reverse","column-reverse"],gr=["start","center","end","baseline","stretch"],hr=["start","center","end","between"],Pr=["nowrap","wrap","wrap-reverse"],eo={as:{type:"enum",values:fr,default:"div"},...ne,display:{type:"enum",className:"rt-r-display",values:dr,responsive:!0},direction:{type:"enum",className:"rt-r-fd",values:yr,responsive:!0},align:{type:"enum",className:"rt-r-ai",values:gr,responsive:!0},justify:{type:"enum",className:"rt-r-jc",values:hr,parseValue:br,responsive:!0},wrap:{type:"enum",className:"rt-r-fw",values:Pr,responsive:!0},...Qt};function br(e){return e==="between"?"space-between":e}var J=Je.forwardRef((e,t)=>{let{className:r,asChild:p,as:n="div",...l}=ae(e,eo,Jt,ie);return Je.createElement(p?X:n,{...l,ref:t,className:(0,to.default)("rt-Flex",r)})});J.displayName="Flex";var I=S(require("react")),ro=S(require("classnames"));var vr=["1","2","3"],oo={size:{type:"enum",className:"rt-r-size",values:vr,default:"2",responsive:!0},loading:{type:"boolean",default:!0}};var bt=I.forwardRef((e,t)=>{let{className:r,children:p,loading:n,...l}=ae(e,oo,ie);if(!n)return p;let i=I.createElement("span",{...l,ref:t,className:(0,ro.default)("rt-Spinner",r)},I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}));return p===void 0?i:I.createElement(J,{asChild:!0,position:"relative",align:"center",justify:"center"},I.createElement("span",null,I.createElement("span",{"aria-hidden":!0,style:{display:"contents",visibility:"hidden"},inert:void 0},p),I.createElement(J,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},I.createElement("span",null,i))))});bt.displayName="Spinner";var vt=require("radix-ui"),no=vt.VisuallyHidden.Root,Gn=vt.VisuallyHidden.Root;function so(e,t){if(e!==void 0)return typeof e=="string"?t(e):Object.fromEntries(Object.entries(e).map(([r,p])=>[r,t(p)]))}function ao(e){switch(e){case"1":return"1";case"2":case"3":return"2";case"4":return"3"}}var Ct=x.forwardRef((e,t)=>{let{size:r=dt.size.default}=e,{className:p,children:n,asChild:l,as:i,color:a,radius:s,material:u,panelBackground:f,flush:P,disabled:b=e.loading,...c}=ae(e,dt,ie);x.useEffect(()=>{e.panelBackground!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.")},[e.panelBackground]);let g=u??f,R=x.useRef(null),M=x.useRef(g);M.current=g,x.useEffect(()=>{let O=R.current;if(!O)return;if(g==="translucent"){O.style.setProperty("will-change","backdrop-filter");let $,ee=()=>{let fe=getComputedStyle(O).getPropertyValue("--duration-2")||"75ms",_=parseInt(fe)||75;$=setTimeout(()=>{O&&M.current!=="translucent"&&O.style.setProperty("will-change","auto")},_)},q=new MutationObserver(ee);return q.observe(O,{attributes:!0,attributeFilter:["data-material"]}),()=>{$&&clearTimeout($),q.disconnect(),O.style.setProperty("will-change","auto")}}else O.style.setProperty("will-change","auto")},[g]);let D=l?po.Slot.Root:i||"button",A=l||!i||["button","input","textarea","select"].includes(i),F=!l&&(!i||i==="button"),V="type"in c,H=x.useId(),E=e.loading?`${H}-loading`:void 0,j=x.useMemo(()=>typeof n=="string"?n:x.isValidElement(n)&&typeof n.props?.children=="string"?n.props.children:"button",[n]),G=x.useMemo(()=>e.loading?{"aria-busy":!0,"aria-disabled":!0,"aria-describedby":E,"aria-label":`${j} (loading)`}:{},[e.loading,E,j]);return x.createElement(D,{"data-disabled":b||void 0,"data-accent-color":a,"data-radius":s,"data-material":g,"data-panel-background":g,"data-flush":P?"true":void 0,...c,...G,ref:(0,lo.composeRefs)(R,t),className:(0,io.default)("rt-reset","rt-BaseButton",p),...A&&{disabled:b},...F&&!V?{type:"button"}:{}},e.loading?x.createElement(x.Fragment,null,x.createElement("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0},n),x.createElement(no,null,x.createElement("span",{id:E},j," is loading, please wait..."),n),x.createElement(J,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},x.createElement("span",null,x.createElement(bt,{size:so(r,ao),"aria-hidden":"true"})))):n)});Ct.displayName="BaseButton";var pe=S(require("react")),xo=S(require("classnames")),Oe=require("radix-ui");var De=S(require("react")),Po=require("radix-ui");var Cr=["normal","start","end","both"],co={trim:{type:"enum",className:"rt-r-lt",values:Cr,responsive:!0}};var Rr=["left","center","right"],mo={align:{type:"enum",className:"rt-r-ta",values:Rr,responsive:!0}};var xr=["wrap","nowrap","pretty","balance"],uo={wrap:{type:"enum",className:"rt-r-tw",values:xr,responsive:!0}};var fo={truncate:{type:"boolean",className:"rt-truncate"}};var Dr=["sans","mono","serif"],yo={font:{type:"enum",className:"rt-r-ff",values:Dr}};var Tr=["thin","extralight","light","regular","medium","semibold","bold","extrabold"],go={weight:{type:"enum",className:"rt-r-weight",values:Tr,responsive:!0}};var wr=["span","div","label","p"],Nr=["0","1","2","3","4","5","6","7","8","9","10","11","12"],ho={as:{type:"enum",values:wr,default:"span"},...ne,size:{type:"enum",className:"rt-r-size",values:Nr,responsive:!0},...yo,...go,...mo,...co,...fo,...uo,...qt,...Ze};var Sr={...ho,...ie},Te=De.memo(De.forwardRef((e,t)=>{let{children:r,className:p,asChild:n,as:l="span",color:i,...a}=ae(e,Sr),s=p?`rt-Text ${p}`:"rt-Text";return n?De.createElement(Po.Slot.Root,{"data-accent-color":i,...a,ref:t,className:s},r):De.createElement(l,{"data-accent-color":i,...a,ref:t,className:s},r)}));Te.displayName="Text";var y=S(require("react")),vo=S(require("classnames")),Me=require("radix-ui");function bo(e){switch(e){case"tomato":case"red":case"ruby":case"crimson":case"pink":case"plum":case"purple":case"violet":return"mauve";case"iris":case"indigo":case"blue":case"sky":case"cyan":return"slate";case"teal":case"jade":case"mint":case"green":return"sage";case"grass":case"lime":return"olive";case"yellow":case"amber":case"orange":case"brown":case"gold":case"bronze":return"sand";case"gray":return"gray"}}var Ar=["inherit","light","dark"],Er=["solid","translucent"],kr=["solid","translucent"],Br=["90%","95%","100%","105%","110%"],Mr=["sans","mono","serif"],C={...ne,hasBackground:{type:"boolean",default:!0},appearance:{type:"enum",values:Ar,default:"inherit"},accentColor:{type:"enum",values:_e,default:"blue"},grayColor:{type:"enum",values:Kt,default:"slate"},material:{type:"enum",values:kr,default:"translucent"},panelBackground:{type:"enum",values:Er,default:"translucent"},radius:{type:"enum",values:ft,default:"medium"},scaling:{type:"enum",values:Br,default:"100%"},fontFamily:{type:"enum",values:Mr,default:"sans"}};var L=()=>{},Ns={appearance:C.appearance.default,accentColor:C.accentColor.default,grayColor:C.grayColor.default,resolvedGrayColor:C.grayColor.default,material:C.material.default,panelBackground:C.panelBackground.default,radius:C.radius.default,scaling:C.scaling.default,fontFamily:C.fontFamily.default,onAppearanceChange:L,onAccentColorChange:L,onGrayColorChange:L,onMaterialChange:L,onPanelBackgroundChange:L,onRadiusChange:L,onScalingChange:L,onFontFamilyChange:L},Rt=y.createContext(void 0);var xt=y.forwardRef((e,t)=>y.useContext(Rt)===void 0?y.createElement(Me.Tooltip.Provider,{delayDuration:200},y.createElement(Me.Direction.Provider,{dir:"ltr"},y.createElement(Co,{...e,ref:t}))):y.createElement(Dt,{...e,ref:t}));xt.displayName="Theme";var Co=y.forwardRef((e,t)=>{let{appearance:r=C.appearance.default,accentColor:p=C.accentColor.default,grayColor:n=C.grayColor.default,material:l=C.material.default,panelBackground:i=C.panelBackground.default,radius:a=C.radius.default,scaling:s=C.scaling.default,fontFamily:u=C.fontFamily.default,hasBackground:f=C.hasBackground.default,...P}=e;y.useEffect(()=>{e.panelBackground!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.")},[e.panelBackground]);let[b,c]=y.useState(r);y.useEffect(()=>c(r),[r]);let[g,R]=y.useState(p);y.useEffect(()=>R(p),[p]);let[M,D]=y.useState(n);y.useEffect(()=>D(n),[n]);let A=l!==C.material.default?l:i,[F,V]=y.useState(A);y.useEffect(()=>V(A),[A]);let[H,E]=y.useState(i);y.useEffect(()=>E(F),[F]);let[j,G]=y.useState(a);y.useEffect(()=>G(a),[a]);let[O,Q]=y.useState(s);y.useEffect(()=>Q(s),[s]);let[$,ee]=y.useState(u);return y.useEffect(()=>ee(u),[u]),y.createElement(Dt,{...P,ref:t,isRoot:!0,hasBackground:f,appearance:b,accentColor:g,grayColor:M,material:F,panelBackground:H,radius:j,scaling:O,fontFamily:$,onAppearanceChange:c,onAccentColorChange:R,onGrayColorChange:D,onMaterialChange:V,onPanelBackgroundChange:E,onRadiusChange:G,onScalingChange:Q,onFontFamilyChange:ee})});Co.displayName="ThemeRoot";function Or(){if(typeof navigator>"u")return;let e=navigator.userAgent;if(e.includes("Win"))return"windows";if(e.includes("Mac"))return"macos";if(e.includes("Linux"))return"linux"}var Dt=y.forwardRef((e,t)=>{let r=y.useContext(Rt),{asChild:p,isRoot:n,hasBackground:l,appearance:i=e.appearance??r?.appearance??C.appearance.default,accentColor:a=e.accentColor??r?.accentColor??C.accentColor.default,grayColor:s=e.grayColor??r?.resolvedGrayColor??C.grayColor.default,material:u=e.material??r?.material??C.material.default,panelBackground:f=e.panelBackground??r?.panelBackground??C.panelBackground.default,radius:P=e.radius??r?.radius??C.radius.default,scaling:b=e.scaling??r?.scaling??C.scaling.default,fontFamily:c=e.fontFamily??r?.fontFamily??C.fontFamily.default,onAppearanceChange:g=L,onAccentColorChange:R=L,onGrayColorChange:M=L,onMaterialChange:D=L,onPanelBackgroundChange:A=L,onRadiusChange:F=L,onScalingChange:V=L,onFontFamilyChange:H=L,...E}=e,j=p?Me.Slot.Root:"div",G=s==="auto"?bo(a):s,O=e.appearance==="light"||e.appearance==="dark",Q=l===void 0?n||O:l,[$,ee]=y.useState(void 0);return y.useEffect(()=>{n&&ee(Or())},[n]),y.createElement(Rt.Provider,{value:y.useMemo(()=>({appearance:i,accentColor:a,grayColor:s,resolvedGrayColor:G,material:u,panelBackground:f,radius:P,scaling:b,fontFamily:c,onAppearanceChange:g,onAccentColorChange:R,onGrayColorChange:M,onMaterialChange:D,onPanelBackgroundChange:A,onRadiusChange:F,onScalingChange:V,onFontFamilyChange:H}),[i,a,s,G,u,f,P,b,c,g,R,M,D,A,F,V,H])},y.createElement(j,{"data-is-root-theme":n?"true":"false","data-accent-color":a,"data-gray-color":G,"data-has-background":Q?"true":"false","data-material":u,"data-panel-background":f,"data-radius":P,"data-scaling":b,"data-font-family":c,"data-os":n?$:void 0,ref:t,...E,className:(0,vo.default)("radix-themes",{light:i==="light",dark:i==="dark"},E.className)}))});Dt.displayName="ThemeImpl";var Ro={content:{type:"ReactNode",required:!0},width:Be.width,minWidth:Be.minWidth,maxWidth:{...Be.maxWidth,default:"360px"}};var Tt=pe.forwardRef((e,t)=>{let{children:r,className:p,open:n,defaultOpen:l,onOpenChange:i,delayDuration:a,disableHoverableContent:s,content:u,container:f,forceMount:P,...b}=ae(e,Ro),c={open:n,defaultOpen:l,onOpenChange:i,delayDuration:a,disableHoverableContent:s};return pe.createElement(Oe.Tooltip.Root,{...c},pe.createElement(Oe.Tooltip.Trigger,{asChild:!0},r),pe.createElement(Oe.Tooltip.Portal,{container:f,forceMount:P},pe.createElement(xt,{asChild:!0},pe.createElement(Oe.Tooltip.Content,{sideOffset:4,collisionPadding:10,...b,asChild:!1,ref:t,className:(0,xo.default)("rt-TooltipContent",p)},pe.createElement(Te,{as:"p",className:"rt-TooltipText",size:"1"},u),pe.createElement(Oe.Tooltip.Arrow,{className:"rt-TooltipArrow"})))))});Tt.displayName="Tooltip";var Qe=S(require("react"));function Do(e){let t=Qe.useId(),r=!!e,p=Qe.useMemo(()=>r?{"aria-describedby":t}:{},[r,t]);return{tooltipId:t,hasTooltip:r,accessibilityProps:p}}var et=We.forwardRef(({className:e,tooltip:t,tooltipSide:r="top",tooltipAlign:p="center",tooltipDelayDuration:n,tooltipDisableHoverableContent:l,...i},a)=>{let{tooltipId:s,hasTooltip:u,accessibilityProps:f}=Do(t),P="aria-label"in i&&i["aria-label"],b="aria-labelledby"in i&&i["aria-labelledby"],c="children"in i&&i.children;!P&&!b&&!c&&console.error(`IconButton: Icon buttons must have an accessible name. Please provide either:
1
+ "use strict";var er=Object.create;var Ue=Object.defineProperty;var tr=Object.getOwnPropertyDescriptor;var or=Object.getOwnPropertyNames;var rr=Object.getPrototypeOf,nr=Object.prototype.hasOwnProperty;var sr=(e,t)=>{for(var o in t)Ue(e,o,{get:t[o],enumerable:!0})},qt=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of or(t))!nr.call(e,n)&&n!==o&&Ue(e,n,{get:()=>t[n],enumerable:!(a=tr(t,n))||a.enumerable});return e};var w=(e,t,o)=>(o=e!=null?er(rr(e)):{},qt(t||!e||!e.__esModule?Ue(o,"default",{value:e,enumerable:!0}):o,e)),ar=e=>qt(Ue({},"__esModule",{value:!0}),e);var sn={};sr(sn,{AttachTrigger:()=>$o,Attachment:()=>Vt,AttachmentsRow:()=>Go,InlineEnd:()=>Wo,InlineStart:()=>Ho,Root:()=>Lo,Row:()=>Uo,RowEnd:()=>_o,RowStart:()=>Ko,Send:()=>qo,Textarea:()=>zo});module.exports=ar(sn);var r=w(require("react")),W=w(require("classnames")),ae=require("motion/react");var ze=w(require("react")),Eo=w(require("classnames"));var k=w(require("react")),yo=w(require("classnames")),go=require("radix-ui");var oe={asChild:{type:"boolean"}};var Ke=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"],Yt=["auto","gray","mauve","slate","sage","olive","sand"],Zt={color:{type:"enum",values:Ke,default:void 0}},Xt={color:{type:"enum",values:Ke,default:""}};var _e={highContrast:{type:"boolean",className:"rt-high-contrast",default:void 0}};var yt=["none","small","medium","large","full"],qe={radius:{type:"enum",values:yt,default:void 0}};var ir=["1","2","3","4"],pr=["classic","solid","soft","surface","outline","ghost","override"],lr=["solid","translucent"],cr=["solid","translucent"],gt={...oe,size:{type:"enum",className:"rt-r-size",values:ir,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:pr,default:"solid"},...Xt,..._e,...qe,loading:{type:"boolean",className:"rt-loading",default:!1},fullWidth:{type:"boolean",className:"rt-full-width",default:!1},material:{type:"enum",values:cr,default:void 0},panelBackground:{type:"enum",values:lr,default:void 0},flush:{type:"boolean",default:!1}};var Je=w(require("react")),ao=w(require("classnames"));var eo=w(require("classnames"));var ur=[],mr=new Set;function fr(e){let t=Object.assign({},...e),o=[],a=[],n=new Set;for(let l in t){let s=t[l],c=s.values??ur,i={key:l,type:s.type,default:s.default,hasDefault:s.default!==void 0,responsive:"responsive"in s,className:s.className,customProperties:s.customProperties,parseValue:s.parseValue,values:c,valueSet:c.length>0?new Set(c):mr,enumValueSet:s.type==="enum"?new Set([s.default,...c]):void 0};s.className?(o.push(i),n.add(l)):(i.hasDefault||s.type==="enum")&&a.push(i)}return{styling:o,passthrough:a,stylingKeys:n}}var dr={children:new WeakMap};function Jt(e){let t=dr;for(let o=0;o<e.length;o++){let a=e[o],n=t.children.get(a);n===void 0&&(n={children:new WeakMap},t.children.set(a,n)),t=n}return t.compiled??(t.compiled=fr(e))}var yr=["initial","xs","sm","md","lg","xl"],ht=new Set(yr);function Pt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var gr=new Set(["initial","xs","sm","md","lg","xl"]);function be(e){if(typeof e!="object"||e===null)return!1;for(let t in e)if(gr.has(t))return!0;return!1}function Ye(e,t,o){return t!==void 0?t.has(o):e.includes(o)}function Ze({className:e,customProperties:t,...o}){let a=ke({allowArbitraryValues:!0,className:e,...o}),n=hr({customProperties:t,...o});return[a,n]}function ke({allowArbitraryValues:e,value:t,className:o,propValues:a,propValueSet:n,parseValue:l=s=>s}){if(t){if(typeof t=="string")return Ye(a,n,t)?Qt(o,t,l):e?o:void 0;if(be(t)){let s=t,c=[];for(let i in s){if(!Pt(s,i)||!ht.has(i))continue;let p=s[i];if(p!==void 0){if(Ye(a,n,p)){let u=Qt(o,p,l),y=i==="initial"?u:`${i}:${u}`;c.push(y)}else if(e){let u=i==="initial"?o:`${i}:${o}`;c.push(u)}}}return c.length>0?c.join(" "):""}if(e)return o}}function Qt(e,t,o){let a=e?"-":"",n=o(t),l=n?.startsWith("-"),s=l?"-":"",c=l?n?.substring(1):n;return`${s}${e}${a}${c}`}function hr({customProperties:e,value:t,propValues:o,propValueSet:a,parseValue:n=l=>l}){if(!t||typeof t=="string"&&Ye(o,a,t))return;let l;if(typeof t=="string"){let s=n(t);l={};for(let c of e)l[c]=s;return l}if(be(t)){let s=t;for(let c in s){if(!Pt(s,c)||!ht.has(c))continue;let i=s[c];if(i===void 0||Ye(o,a,i))continue;let p=n(i);l??(l={});for(let u of e){let y=c==="initial"?u:`${u}-${c}`;l[y]=p}}}return l??{}}function Ce(...e){let t;for(let o of e)o&&(t===void 0&&(t={}),Object.assign(t,o));return t}function Pr(e,t){let o=e.initial,a=!1;return t.hasDefault&&o===void 0&&(o=t.default,a=!0),t.enumValueSet!==void 0&&!t.enumValueSet.has(o)&&(o=t.default,a=!0),a?{...e,initial:o}:e}function re(e,...t){let{styling:o,passthrough:a,stylingKeys:n}=Jt(t),l={};for(let i in e)n.has(i)||(l[i]=e[i]);for(let i=0;i<a.length;i++){let p=a[i],u=l[p.key];if(u===void 0){p.hasDefault&&(l[p.key]=p.default);continue}p.enumValueSet!==void 0&&!p.enumValueSet.has(u)&&!be(u)&&(l[p.key]=p.default)}let s,c=[];for(let i=0;i<o.length;i++){let p=o[i],u=e[p.key];if(u===void 0&&p.hasDefault&&(u=p.default),p.enumValueSet!==void 0&&!p.enumValueSet.has(u)&&!be(u)&&(u=p.default),!!u){if(be(u)){if(!p.responsive)continue;u=Pr(u,p)}if(p.type==="enum"){let y=ke({allowArbitraryValues:!1,value:u,className:p.className,propValues:p.values,propValueSet:p.valueSet,parseValue:p.parseValue});y&&c.push(y);continue}if(p.type==="string"||p.type==="enum | string"){let[y,v]=Ze({className:p.className,customProperties:p.customProperties,propValues:p.type==="string"?[]:p.values,propValueSet:p.type==="string"?void 0:p.valueSet,parseValue:p.parseValue,value:u});v&&(s=Ce(s,v)),y&&c.push(y);continue}if(p.type==="boolean"){c.push(p.className);continue}}}return l.className=(0,eo.default)(c.length>0?c.join(" "):void 0,e.className),l.style=Ce(s,e.style),l}var Re=["0","1","2","3","4","5","6","7","8","9","10","11","12"],to={p:{type:"enum | string",className:"rt-r-p",customProperties:["--p"],values:Re,responsive:!0},px:{type:"enum | string",className:"rt-r-px",customProperties:["--pl","--pr"],values:Re,responsive:!0},py:{type:"enum | string",className:"rt-r-py",customProperties:["--pt","--pb"],values:Re,responsive:!0},pt:{type:"enum | string",className:"rt-r-pt",customProperties:["--pt"],values:Re,responsive:!0},pr:{type:"enum | string",className:"rt-r-pr",customProperties:["--pr"],values:Re,responsive:!0},pb:{type:"enum | string",className:"rt-r-pb",customProperties:["--pb"],values:Re,responsive:!0},pl:{type:"enum | string",className:"rt-r-pl",customProperties:["--pl"],values:Re,responsive:!0}};var oo={height:{type:"string",className:"rt-r-h",customProperties:["--height"],responsive:!0},minHeight:{type:"string",className:"rt-r-min-h",customProperties:["--min-height"],responsive:!0},maxHeight:{type:"string",className:"rt-r-max-h",customProperties:["--max-height"],responsive:!0}};var Ee={width:{type:"string",className:"rt-r-w",customProperties:["--width"],responsive:!0},minWidth:{type:"string",className:"rt-r-min-w",customProperties:["--min-width"],responsive:!0},maxWidth:{type:"string",className:"rt-r-max-w",customProperties:["--max-width"],responsive:!0}};var vt=["visible","hidden","clip","scroll","auto"],vr=["static","relative","absolute","fixed","sticky"],Le=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],br=["0","1"],Cr=["0","1"],Rr=["start","center","end","baseline","stretch"],xr=["start","center","end","baseline","stretch"],ro={...to,...Ee,...oo,position:{type:"enum",className:"rt-r-position",values:vr,responsive:!0},inset:{type:"enum | string",className:"rt-r-inset",customProperties:["--inset"],values:Le,responsive:!0},top:{type:"enum | string",className:"rt-r-top",customProperties:["--top"],values:Le,responsive:!0},right:{type:"enum | string",className:"rt-r-right",customProperties:["--right"],values:Le,responsive:!0},bottom:{type:"enum | string",className:"rt-r-bottom",customProperties:["--bottom"],values:Le,responsive:!0},left:{type:"enum | string",className:"rt-r-left",customProperties:["--left"],values:Le,responsive:!0},overflow:{type:"enum",className:"rt-r-overflow",values:vt,responsive:!0},overflowX:{type:"enum",className:"rt-r-ox",values:vt,responsive:!0},overflowY:{type:"enum",className:"rt-r-oy",values:vt,responsive:!0},flexBasis:{type:"string",className:"rt-r-fb",customProperties:["--flex-basis"],responsive:!0},flexShrink:{type:"enum | string",className:"rt-r-fs",customProperties:["--flex-shrink"],values:br,responsive:!0},flexGrow:{type:"enum | string",className:"rt-r-fg",customProperties:["--flex-grow"],values:Cr,responsive:!0},gridArea:{type:"string",className:"rt-r-ga",customProperties:["--grid-area"],responsive:!0},gridColumn:{type:"string",className:"rt-r-gc",customProperties:["--grid-column"],responsive:!0},gridColumnStart:{type:"string",className:"rt-r-gcs",customProperties:["--grid-column-start"],responsive:!0},gridColumnEnd:{type:"string",className:"rt-r-gce",customProperties:["--grid-column-end"],responsive:!0},gridRow:{type:"string",className:"rt-r-gr",customProperties:["--grid-row"],responsive:!0},gridRowStart:{type:"string",className:"rt-r-grs",customProperties:["--grid-row-start"],responsive:!0},gridRowEnd:{type:"string",className:"rt-r-gre",customProperties:["--grid-row-end"],responsive:!0},alignSelf:{type:"enum",className:"rt-r-as",values:Rr,responsive:!0},justifySelf:{type:"enum",className:"rt-r-js",values:xr,responsive:!0}};var xe=["0","1","2","3","4","5","6","7","8","9","10","11","12","-1","-2","-3","-4","-5","-6","-7","-8","-9","-10","-11","-12"],ne={m:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-m",customProperties:["--m"]},mx:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-mx",customProperties:["--ml","--mr"]},my:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-my",customProperties:["--mt","--mb"]},mt:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-mt",customProperties:["--mt"]},mr:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-mr",customProperties:["--mr"]},mb:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-mb",customProperties:["--mb"]},ml:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-ml",customProperties:["--ml"]}};var Xe=require("radix-ui"),zn=Xe.Slot.Root,q=Xe.Slot.Root,Hn=Xe.Slot.Slottable;var bt=["0","1","2","3","4","5","6","7","8","9","10","11","12"],no={gap:{type:"enum | string",className:"rt-r-gap",customProperties:["--gap"],values:bt,responsive:!0},gapX:{type:"enum | string",className:"rt-r-cg",customProperties:["--column-gap"],values:bt,responsive:!0},gapY:{type:"enum | string",className:"rt-r-rg",customProperties:["--row-gap"],values:bt,responsive:!0}};var Dr=["div","span"],wr=["none","inline-flex","flex"],Tr=["row","column","row-reverse","column-reverse"],Sr=["start","center","end","baseline","stretch"],Nr=["start","center","end","between"],Ar=["nowrap","wrap","wrap-reverse"],so={as:{type:"enum",values:Dr,default:"div"},...oe,display:{type:"enum",className:"rt-r-display",values:wr,responsive:!0},direction:{type:"enum",className:"rt-r-fd",values:Tr,responsive:!0},align:{type:"enum",className:"rt-r-ai",values:Sr,responsive:!0},justify:{type:"enum",className:"rt-r-jc",values:Nr,parseValue:kr,responsive:!0},wrap:{type:"enum",className:"rt-r-fw",values:Ar,responsive:!0},...no};function kr(e){return e==="between"?"space-between":e}var Y=Je.forwardRef((e,t)=>{let{className:o,asChild:a,as:n="div",...l}=re(e,so,ro,ne);return Je.createElement(a?q:n,{...l,ref:t,className:(0,ao.default)("rt-Flex",o)})});Y.displayName="Flex";var O=w(require("react")),po=w(require("classnames"));var Er=["1","2","3"],io={size:{type:"enum",className:"rt-r-size",values:Er,default:"2",responsive:!0},loading:{type:"boolean",default:!0}};var Ct=O.forwardRef((e,t)=>{let{className:o,children:a,loading:n,...l}=re(e,io,ne);if(!n)return a;let s=O.createElement("span",{...l,ref:t,className:(0,po.default)("rt-Spinner",o)},O.createElement("span",{className:"rt-SpinnerLeaf"}),O.createElement("span",{className:"rt-SpinnerLeaf"}),O.createElement("span",{className:"rt-SpinnerLeaf"}),O.createElement("span",{className:"rt-SpinnerLeaf"}),O.createElement("span",{className:"rt-SpinnerLeaf"}),O.createElement("span",{className:"rt-SpinnerLeaf"}),O.createElement("span",{className:"rt-SpinnerLeaf"}),O.createElement("span",{className:"rt-SpinnerLeaf"}));return a===void 0?s:O.createElement(Y,{asChild:!0,position:"relative",align:"center",justify:"center"},O.createElement("span",null,O.createElement("span",{"aria-hidden":!0,style:{display:"contents",visibility:"hidden"},inert:void 0},a),O.createElement(Y,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},O.createElement("span",null,s))))});Ct.displayName="Spinner";var Rt=require("radix-ui"),lo=Rt.VisuallyHidden.Root,ss=Rt.VisuallyHidden.Root;var uo=w(require("react")),Br="Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.",co=new Set;function Vr(e){co.has(e)||(co.add(e),console.warn(e))}function Qe(e){uo.useEffect(()=>{},[e])}function mo(e,t){if(e!==void 0)return typeof e=="string"?t(e):Object.fromEntries(Object.entries(e).map(([o,a])=>[o,t(a)]))}function fo(e){switch(e){case"1":return"1";case"2":case"3":return"2";case"4":return"3"}}var xt=k.forwardRef((e,t)=>{let{size:o=gt.size.default}=e,{className:a,children:n,asChild:l,as:s,color:c,radius:i,material:p,panelBackground:u,flush:y,disabled:v=e.loading,...m}=re(e,gt,ne);Qe(e.panelBackground);let h=p??u,C=l?go.Slot.Root:s||"button",V=l||!s||["button","input","textarea","select"].includes(s),x=!l&&(!s||s==="button"),E="type"in m,j=k.useId(),M=e.loading?`${j}-loading`:void 0,I=k.useMemo(()=>typeof n=="string"?n:k.isValidElement(n)&&typeof n.props?.children=="string"?n.props.children:"button",[n]),B=k.useMemo(()=>e.loading?{"aria-busy":!0,"aria-disabled":!0,"aria-describedby":M,"aria-label":`${I} (loading)`}:{},[e.loading,M,I]);return k.createElement(C,{"data-disabled":v||void 0,"data-accent-color":c,"data-radius":i,"data-material":h,"data-panel-background":h,"data-flush":y?"true":void 0,...m,...B,ref:t,className:(0,yo.default)("rt-reset","rt-BaseButton",a),...V&&{disabled:v},...x&&!E?{type:"button"}:{}},e.loading?k.createElement(k.Fragment,null,k.createElement("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0},n),k.createElement(lo,null,k.createElement("span",{id:M},I," is loading, please wait..."),n),k.createElement(Y,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},k.createElement("span",null,k.createElement(Ct,{size:mo(o,fo),"aria-hidden":"true"})))):n)});xt.displayName="BaseButton";var se=w(require("react")),Ao=w(require("classnames")),Ve=require("radix-ui");var De=w(require("react")),Do=require("radix-ui");var Mr=["normal","start","end","both"],ho={trim:{type:"enum",className:"rt-r-lt",values:Mr,responsive:!0}};var Or=["left","center","right"],Po={align:{type:"enum",className:"rt-r-ta",values:Or,responsive:!0}};var Ir=["wrap","nowrap","pretty","balance"],vo={wrap:{type:"enum",className:"rt-r-tw",values:Ir,responsive:!0}};var bo={truncate:{type:"boolean",className:"rt-truncate"}};var Fr=["sans","mono","serif"],Co={font:{type:"enum",className:"rt-r-ff",values:Fr}};var jr=["thin","extralight","light","regular","medium","semibold","bold","extrabold"],Ro={weight:{type:"enum",className:"rt-r-weight",values:jr,responsive:!0}};var Lr=["span","div","label","p"],zr=["0","1","2","3","4","5","6","7","8","9","10","11","12"],xo={as:{type:"enum",values:Lr,default:"span"},...oe,size:{type:"enum",className:"rt-r-size",values:zr,responsive:!0},...Co,...Ro,...Po,...ho,...bo,...vo,...Zt,..._e};var Hr={...xo,...ne},we=De.memo(De.forwardRef((e,t)=>{let{children:o,className:a,asChild:n,as:l="span",color:s,...c}=re(e,Hr),i=a?`rt-Text ${a}`:"rt-Text";return n?De.createElement(Do.Slot.Root,{"data-accent-color":s,...c,ref:t,className:i},o):De.createElement(l,{"data-accent-color":s,...c,ref:t,className:i},o)}));we.displayName="Text";var S=w(require("react")),To=w(require("classnames")),Be=require("radix-ui"),et=require("radix-ui/internal");function wo(e){switch(e){case"tomato":case"red":case"ruby":case"crimson":case"pink":case"plum":case"purple":case"violet":return"mauve";case"iris":case"indigo":case"blue":case"sky":case"cyan":return"slate";case"teal":case"jade":case"mint":case"green":return"sage";case"grass":case"lime":return"olive";case"yellow":case"amber":case"orange":case"brown":case"gold":case"bronze":return"sand";case"gray":return"gray"}}var Dt=w(require("react"));function ue(e){let[t,o]=Dt.useState(e),[a,n]=Dt.useState(e);return Object.is(e,a)||(n(e),o(e)),[t,o]}var Wr=["inherit","light","dark"],Gr=["solid","translucent"],$r=["solid","translucent"],Ur=["90%","95%","100%","105%","110%"],Kr=["sans","mono","serif"],b={...oe,hasBackground:{type:"boolean",default:!0},appearance:{type:"enum",values:Wr,default:"inherit"},accentColor:{type:"enum",values:Ke,default:"blue"},grayColor:{type:"enum",values:Yt,default:"slate"},material:{type:"enum",values:$r,default:"translucent"},panelBackground:{type:"enum",values:Gr,default:"translucent"},radius:{type:"enum",values:yt,default:"medium"},scaling:{type:"enum",values:Ur,default:"100%"},fontFamily:{type:"enum",values:Kr,default:"sans"}};var F=()=>{},qs={appearance:b.appearance.default,accentColor:b.accentColor.default,grayColor:b.grayColor.default,resolvedGrayColor:b.grayColor.default,material:b.material.default,panelBackground:b.panelBackground.default,radius:b.radius.default,scaling:b.scaling.default,fontFamily:b.fontFamily.default,onAppearanceChange:F,onAccentColorChange:F,onGrayColorChange:F,onMaterialChange:F,onPanelBackgroundChange:F,onRadiusChange:F,onScalingChange:F,onFontFamilyChange:F},wt=S.createContext(void 0);var Tt=S.forwardRef((e,t)=>S.useContext(wt)===void 0?S.createElement(Be.Tooltip.Provider,{delayDuration:200},S.createElement(Be.Direction.Provider,{dir:"ltr"},S.createElement(So,{...e,ref:t}))):S.createElement(St,{...e,ref:t}));Tt.displayName="Theme";var So=S.forwardRef((e,t)=>{let{appearance:o=b.appearance.default,accentColor:a=b.accentColor.default,grayColor:n=b.grayColor.default,material:l=b.material.default,panelBackground:s=b.panelBackground.default,radius:c=b.radius.default,scaling:i=b.scaling.default,fontFamily:p=b.fontFamily.default,hasBackground:u=b.hasBackground.default,...y}=e;Qe(e.panelBackground);let[v,m]=ue(o),[h,C]=ue(a),[V,x]=ue(n),E=l!==b.material.default?l:s,[j,M]=ue(E),[I,B]=ue(j),[G,Z]=ue(c),[ie,me]=ue(i),[X,ve]=ue(p);return S.createElement(St,{...y,ref:t,isRoot:!0,hasBackground:u,appearance:v,accentColor:h,grayColor:V,material:j,panelBackground:I,radius:G,scaling:ie,fontFamily:X,onAppearanceChange:m,onAccentColorChange:C,onGrayColorChange:x,onMaterialChange:M,onPanelBackgroundChange:B,onRadiusChange:Z,onScalingChange:me,onFontFamilyChange:ve})});So.displayName="ThemeRoot";function _r(){if(typeof navigator>"u")return;let e=navigator.userAgent;if(e.includes("Win"))return"windows";if(e.includes("Mac"))return"macos";if(e.includes("Linux"))return"linux"}var St=S.forwardRef((e,t)=>{let o=S.useContext(wt),{asChild:a,isRoot:n,hasBackground:l,appearance:s=e.appearance??o?.appearance??b.appearance.default,accentColor:c=e.accentColor??o?.accentColor??b.accentColor.default,grayColor:i=e.grayColor??o?.resolvedGrayColor??b.grayColor.default,material:p=e.material??o?.material??b.material.default,panelBackground:u=e.panelBackground??o?.panelBackground??b.panelBackground.default,radius:y=e.radius??o?.radius??b.radius.default,scaling:v=e.scaling??o?.scaling??b.scaling.default,fontFamily:m=e.fontFamily??o?.fontFamily??b.fontFamily.default,onAppearanceChange:h=F,onAccentColorChange:C=F,onGrayColorChange:V=F,onMaterialChange:x=F,onPanelBackgroundChange:E=F,onRadiusChange:j=F,onScalingChange:M=F,onFontFamilyChange:I=F,...B}=e,G=a?Be.Slot.Root:"div",Z=i==="auto"?wo(c):i,ie=e.appearance==="light"||e.appearance==="dark",me=l===void 0?n||ie:l,X=S.useRef(null),ve=(0,et.useComposedRefs)(t,X),$="data-os"in B;return(0,et.useLayoutEffect)(()=>{if(!n||$)return;let J=X.current;if(!J)return;let U=_r();if(U)return J.setAttribute("data-os",U),()=>J.removeAttribute("data-os")},[n,$]),S.createElement(wt.Provider,{value:S.useMemo(()=>({appearance:s,accentColor:c,grayColor:i,resolvedGrayColor:Z,material:p,panelBackground:u,radius:y,scaling:v,fontFamily:m,onAppearanceChange:h,onAccentColorChange:C,onGrayColorChange:V,onMaterialChange:x,onPanelBackgroundChange:E,onRadiusChange:j,onScalingChange:M,onFontFamilyChange:I}),[s,c,i,Z,p,u,y,v,m,h,C,V,x,E,j,M,I])},S.createElement(G,{"data-is-root-theme":n?"true":"false","data-accent-color":c,"data-gray-color":Z,"data-has-background":me?"true":"false","data-material":p,"data-panel-background":u,"data-radius":y,"data-scaling":v,"data-font-family":m,ref:ve,...B,className:(0,To.default)("radix-themes",{light:s==="light",dark:s==="dark"},B.className)}))});St.displayName="ThemeImpl";var No={content:{type:"ReactNode",required:!0},width:Ee.width,minWidth:Ee.minWidth,maxWidth:{...Ee.maxWidth,default:"360px"}};var Nt=se.forwardRef((e,t)=>{let{children:o,className:a,open:n,defaultOpen:l,onOpenChange:s,delayDuration:c,disableHoverableContent:i,content:p,container:u,forceMount:y,...v}=re(e,No),m={open:n,defaultOpen:l,onOpenChange:s,delayDuration:c,disableHoverableContent:i};return se.createElement(Ve.Tooltip.Root,{...m},se.createElement(Ve.Tooltip.Trigger,{asChild:!0},o),se.createElement(Ve.Tooltip.Portal,{container:u,forceMount:y},se.createElement(Tt,{asChild:!0},se.createElement(Ve.Tooltip.Content,{sideOffset:4,collisionPadding:10,...v,asChild:!1,ref:t,className:(0,Ao.default)("rt-TooltipContent",a)},se.createElement(we,{as:"p",className:"rt-TooltipText",size:"1"},p),se.createElement(Ve.Tooltip.Arrow,{className:"rt-TooltipArrow"})))))});Nt.displayName="Tooltip";var tt=w(require("react"));function ko(e){let t=tt.useId(),o=!!e,a=tt.useMemo(()=>o?{"aria-describedby":t}:{},[o,t]);return{tooltipId:t,hasTooltip:o,accessibilityProps:a}}var ot=ze.forwardRef(({className:e,tooltip:t,tooltipSide:o="top",tooltipAlign:a="center",tooltipDelayDuration:n,tooltipDisableHoverableContent:l,...s},c)=>{let{tooltipId:i,hasTooltip:p,accessibilityProps:u}=ko(t),y="aria-label"in s&&s["aria-label"],v="aria-labelledby"in s&&s["aria-labelledby"],m="children"in s&&s.children;!y&&!v&&!m&&console.error(`IconButton: Icon buttons must have an accessible name. Please provide either:
2
2
  - aria-label prop with descriptive text
3
3
  - aria-labelledby prop referencing a label element
4
- - or visible text children`);let g=We.createElement(Ct,{...i,...f,ref:a,className:(0,To.default)("rt-IconButton",e)});return u?We.createElement(Tt,{content:t,side:r,align:p,delayDuration:n,disableHoverableContent:l,id:s},g):g});et.displayName="IconButton";var h=S(require("react")),Vr=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z"})));Vr.displayName="ThickDividerHorizontalIcon";var Ir=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z"})));Ir.displayName="ThickCheckIcon";var Fr=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{d:"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z"})));Fr.displayName="ChevronDownIcon";var jr=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z"})));jr.displayName="ThickChevronRightIcon";var Lr=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.76174 0.201711C5.45892 -0.0809141 4.98433 -0.0645489 4.70171 0.238264L1.20171 3.98826C0.932757 4.27642 0.932757 4.72359 1.20171 5.01174L4.70171 8.76174C4.98433 9.06455 5.45892 9.08092 5.76174 8.79829C6.06455 8.51567 6.08091 8.04108 5.79829 7.73826L2.77591 4.5L5.79829 1.26174C6.08091 0.958928 6.06455 0.484337 5.76174 0.201711Z"})));Lr.displayName="ThickChevronLeftIcon";var zr=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("circle",{cx:"4.5",cy:"4.5",r:"2"})));zr.displayName="ThickDotIcon";var wt=h.default.forwardRef((e,t)=>h.default.createElement("svg",{...e,ref:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h.default.createElement("path",{d:"M18 6 6 18"}),h.default.createElement("path",{d:"m6 6 12 12"})));wt.displayName="CloseIcon";var Hr=h.default.forwardRef((e,t)=>h.default.createElement("svg",{...e,ref:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h.default.createElement("path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"})));Hr.displayName="PaperclipIcon";var Wr=h.default.forwardRef((e,t)=>h.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),h.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"})));Wr.displayName="FileIcon";var Nt=h.default.forwardRef((e,t)=>h.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),h.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),h.default.createElement("path",{d:"M10 9H8"}),h.default.createElement("path",{d:"M16 13H8"}),h.default.createElement("path",{d:"M16 17H8"})));Nt.displayName="FileTextIcon";var W=S(require("react")),ot=S(require("classnames")),Pe=require("radix-ui");var Gr=["1","2","3"],$r=["vertical","horizontal","both"],Ve={...ne,size:{type:"enum",className:"rt-r-size",values:Gr,default:"1",responsive:!0},...Ye,scrollbars:{type:"enum",values:$r,default:"both"}};function wo(e){let{m:t,mx:r,my:p,mt:n,mr:l,mb:i,ml:a,...s}=e;return{m:t,mx:r,my:p,mt:n,mr:l,mb:i,ml:a,rest:s}}var No=S(require("classnames"));var we=ie.m.values;function So(e){let[t,r]=se({className:"rt-r-m",customProperties:["--margin"],propValues:we,value:e.m}),[p,n]=se({className:"rt-r-mx",customProperties:["--margin-left","--margin-right"],propValues:we,value:e.mx}),[l,i]=se({className:"rt-r-my",customProperties:["--margin-top","--margin-bottom"],propValues:we,value:e.my}),[a,s]=se({className:"rt-r-mt",customProperties:["--margin-top"],propValues:we,value:e.mt}),[u,f]=se({className:"rt-r-mr",customProperties:["--margin-right"],propValues:we,value:e.mr}),[P,b]=se({className:"rt-r-mb",customProperties:["--margin-bottom"],propValues:we,value:e.mb}),[c,g]=se({className:"rt-r-ml",customProperties:["--margin-left"],propValues:we,value:e.ml});return[(0,No.default)(t,p,l,a,u,P,c),Ce(r,n,i,s,f,b,g)]}var tt=S(require("react"));function Ao(e,t){let{asChild:r,children:p}=e;if(!r)return typeof t=="function"?t(p):t;let n=tt.Children.only(p);return tt.cloneElement(n,{children:typeof t=="function"?t(n.props.children):t})}var St=W.forwardRef((e,t)=>{let{rest:r,...p}=wo(e),[n,l]=So(p),{asChild:i,children:a,className:s,style:u,type:f,scrollHideDelay:P=f!=="scroll"?0:void 0,dir:b,size:c=Ve.size.default,radius:g=Ve.radius.default,scrollbars:R=Ve.scrollbars.default,...M}=r;return W.createElement(Pe.ScrollArea.Root,{type:f,scrollHideDelay:P,className:(0,ot.default)("rt-ScrollAreaRoot",n,s),style:Ce(l,u),asChild:i},Ao({asChild:i,children:a},D=>W.createElement(W.Fragment,null,W.createElement(Pe.ScrollArea.Viewport,{...M,ref:t,className:"rt-ScrollAreaViewport"},D),W.createElement("div",{className:"rt-ScrollAreaViewportFocusRing"}),R!=="vertical"?W.createElement(Pe.ScrollArea.Scrollbar,{"data-radius":g,orientation:"horizontal",className:(0,ot.default)("rt-ScrollAreaScrollbar",ke({className:"rt-r-size",value:c,propValues:Ve.size.values}))},W.createElement(Pe.ScrollArea.Thumb,{className:"rt-ScrollAreaThumb"})):null,R!=="horizontal"?W.createElement(Pe.ScrollArea.Scrollbar,{"data-radius":g,orientation:"vertical",className:(0,ot.default)("rt-ScrollAreaScrollbar",ke({className:"rt-r-size",value:c,propValues:Ve.size.values}))},W.createElement(Pe.ScrollArea.Thumb,{className:"rt-ScrollAreaThumb"})):null,R==="both"?W.createElement(Pe.ScrollArea.Corner,{className:"rt-ScrollAreaCorner"}):null)))});St.displayName="ScrollArea";var Eo=require("react-dropzone"),At=typeof window<"u"?o.useLayoutEffect:o.useEffect,ko=o.createContext(null),be=()=>{let e=o.useContext(ko);if(!e)throw new Error("Chatbar context not found. Wrap parts in <Chatbar.Root>.");return e},Bo=o.forwardRef((e,t)=>{let{className:r,style:p,children:n,value:l,defaultValue:i="",onValueChange:a,open:s,defaultOpen:u=!1,onOpenChange:f,expandOn:P="both",minLines:b=3,maxLines:c=6,sendMode:g="whenDirty",disabled:R,readOnly:M,onSubmit:D,size:A="2",variant:F,color:V,radius:H,panelBackground:E,material:j,width:G,maxWidth:O,asChild:Q,attachments:$,defaultAttachments:ee=[],onAttachmentsChange:q,accept:fe,multiple:_=!0,maxAttachments:z,maxFileSize:N,paste:Ge=!0,pasteAccept:Ne,clearOnSubmit:$e=!0,onAttachmentReject:de,dropzone:ce=!0,apiRef:d,...T}=e,k=j||E,B=l!=null,[te,rt]=o.useState(i),Se=B?l:te,Z=s!=null,[Ie,Ae]=o.useState(u),Ee=Z?s:Ie,nt=o.useRef(null),Ue=o.useRef(null),st=o.useRef(!1),ye="attachments"in e,[kt,Bt]=o.useState(ee),ge=o.useMemo(()=>ye?$??[]:kt,[ye,$,kt]),Ke=o.useRef(new Set),at=m=>Array.isArray(m)?m:typeof m=="string"?m.split(",").map(v=>v.trim()):[],Fe=at(fe),Mt=at(Ne).length>0?at(Ne):Fe,Ot=(m,v)=>{if(v.length===0)return!0;let Y=m.type.toLowerCase(),me=m.name.toLowerCase();for(let oe of v){let U=oe.toLowerCase();if(U.includes("/")){let[re,ue]=U.split("/"),[w,Le]=Y.split("/");if(re==="*"||re===w&&(ue==="*"||ue===Le))return!0}else if(U.startsWith(".")&&me.endsWith(U))return!0}return!1},it=o.useRef(ge);it.current=ge;let pt=o.useRef(Fe);pt.current=Fe;let Vt=o.useRef(Mt);Vt.current=Mt;let lt=o.useRef(z);lt.current=z;let ct=o.useRef(N);ct.current=N;let mt=o.useRef(de);mt.current=de;let It=o.useRef(q);It.current=q;let Ft=o.useRef(f);Ft.current=f;let je=o.useCallback(m=>{let v=it.current,Y=pt.current,me=lt.current,oe=ct.current,U=[],re=[],ue=typeof me=="number"?Math.max(me-v.length,0):1/0;for(let w of m){if(U.length>=ue){re.push({file:w,reason:"count"});continue}if(typeof oe=="number"&&w.size>oe){re.push({file:w,reason:"size"});continue}if(!Ot(w,Y)){re.push({file:w,reason:"type"});continue}let Le=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,he=/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(w.name),ut=(w.type||"").toLowerCase().startsWith("image/")||he?URL.createObjectURL(w):void 0;ut&&Ke.current.add(ut),U.push({id:Le,name:w.name,size:w.size,type:w.type,file:w,url:ut,status:"idle"})}if(U.length>0){let w=v.concat(U);ye||Bt(w),It.current?.(w),Z||Ae(!0),Ft.current?.(!0)}re.length>0&&mt.current?.(re)},[ye,Z]),jt=o.useCallback(m=>{let v=pt.current,Y=Vt.current,me=lt.current,oe=ct.current,U=it.current,re=Y.length>0?Y:v,ue=[],w=[],Le=typeof me=="number"?Math.max(me-U.length,0):1/0;for(let he of m){if(ue.length>=Le){w.push({file:he,reason:"count"});continue}if(typeof oe=="number"&&he.size>oe){w.push({file:he,reason:"size"});continue}if(!Ot(he,re)){w.push({file:he,reason:"type"});continue}ue.push(he)}ue.length>0&&je(ue),w.length>0&&mt.current?.(w)},[je]);o.useEffect(()=>{let m=new Set(ge.map(v=>v.url).filter(Boolean));for(let v of Array.from(Ke.current))m.has(v)||(URL.revokeObjectURL(v),Ke.current.delete(v))},[ge]),o.useEffect(()=>{let m=Ke.current;return()=>{for(let v of Array.from(m))URL.revokeObjectURL(v);m.clear()}},[]);let Wo=Q?X:"div",Lt=o.useCallback(m=>{Z||Ae(m),f?.(m)},[Z,f]),zt=o.useCallback(m=>{B||rt(m),a?.(m)},[B,a]),Ht=o.useCallback(m=>{ye||Bt(m),q?.(m)},[ye,q]),Go=o.useCallback(m=>{let v=m.relatedTarget,Y=nt.current;Y&&(v&&Y.contains(v)||st.current||(Se?.trim?.()??"").length===0&&ge.length===0&&(Z||Ae(!1),f?.(!1)))},[Z,f,Se,ge]),{getRootProps:$o,getInputProps:Uo,isDragActive:Wt,open:Gt}=(0,Eo.useDropzone)({onDrop:(m,v)=>{if(m.length>0&&je(m),v.length>0&&de){let Y=v.map(({file:me,errors:oe})=>{let U=oe[0]?.code==="file-too-large"?"size":oe[0]?.code==="file-invalid-type"?"type":"count";return{file:me,reason:U}});de(Y)}},accept:Fe.length>0?Fe.reduce((m,v)=>(v.includes("/")?m[v]=[]:v.startsWith(".")&&(m[v]=[]),m),{}):void 0,multiple:_,maxSize:N,noClick:!0,noKeyboard:!0,disabled:!ce||R});o.useImperativeHandle(d,()=>({focusTextarea:()=>Ue.current?.focus({preventScroll:!0}),openFilePicker:()=>{st.current=!0,Gt()}}),[Gt]);let $t=o.useCallback(m=>{if(!(m instanceof Element))return!1;let v=m;return v.closest(".rt-ChatbarDropOverlay")?!0:!!v.closest('button, [role="button"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex="-1"])')},[]),Ko=o.useCallback(m=>{R||$t(m.target)||m.pointerType==="mouse"&&m.button!==0||(m.preventDefault(),Ue.current?.focus({preventScroll:!0}))},[R,$t,Ue]);return o.createElement(ko.Provider,{value:o.useMemo(()=>({open:Ee,setOpen:Lt,isOpenControlled:Z,value:Se,setValue:zt,isValueControlled:B,size:A,expandOn:P,minLines:b,maxLines:c,sendMode:g,disabled:R,readOnly:M,onSubmit:D,rootRef:nt,textareaRef:Ue,attachments:ge,setAttachments:Ht,isAttachmentsControlled:ye,accept:fe,multiple:_,maxAttachments:z,maxFileSize:N,paste:Ge,pasteAccept:Ne,clearOnSubmit:$e,onAttachmentReject:de,dropzone:ce,appendFiles:je,appendFilesFromPaste:jt,fileDialogOpenRef:st}),[Ee,Lt,Z,Se,zt,B,A,P,b,c,g,R,M,D,ge,Ht,ye,fe,_,z,N,Ge,Ne,$e,de,ce,je,jt])},o.createElement(le.LazyMotion,{features:le.domAnimation},o.createElement(Wo,{...T,ref:m=>{typeof t=="function"?t(m):t&&(t.current=m),nt.current=m},className:(0,K.default)("rt-ChatbarRoot",`rt-r-size-${A}`,r),style:{position:"relative",width:G,maxWidth:O,...p},"data-state":Ee?"open":"closed","data-disabled":R?"":void 0,"data-readonly":M?"":void 0,"data-drop-active":ce&&Wt?"":void 0,"data-accent-color":V,"data-radius":H,"data-panel-background":k,"data-material":k,"aria-expanded":Ee,onBlurCapture:Go},ce&&o.createElement("input",{...Uo()}),o.createElement("div",{...ce?$o():{},style:{width:"100%",height:"100%"},onPointerDown:Ko},o.createElement(le.m.div,{className:(0,K.default)("rt-ChatbarBox",`rt-variant-${F??"surface"}`),style:{position:"relative"},"data-accent-color":V,"data-radius":H,"data-panel-background":k,"data-material":k,layout:!0,transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},o.createElement(le.m.div,{className:"rt-ChatbarGrid",layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},n),ce&&Wt&&o.createElement("div",{className:"rt-ChatbarDropOverlay"},o.createElement("div",{className:"rt-ChatbarDropContent"},o.createElement(Te,{color:"gray",size:A,weight:"medium"},"Drop files here to attach"))))))))});Bo.displayName="Chatbar.Root";var Mo=o.forwardRef((e,t)=>{let{className:r,style:p,asChild:n,onFocus:l,onInput:i,onChange:a,onPaste:s,onKeyDown:u,submitOnEnter:f=!1,rows:P,...b}=e,c=be(),{open:g,minLines:R,maxLines:M,expandOn:D,disabled:A,readOnly:F,setOpen:V,setValue:H,textareaRef:E,value:j,isValueControlled:G,sendMode:O,paste:Q,appendFilesFromPaste:$,size:ee}=c,q=o.useRef(0),fe=o.useRef(0),_=o.useRef(0),z=o.useCallback(()=>{let d=E.current;if(!d)return;let T=window.getComputedStyle(d),k=parseFloat(T.lineHeight)||20,B=parseFloat(T.paddingTop)||0,te=parseFloat(T.paddingBottom)||0;q.current=k,fe.current=B+te,_.current=Math.ceil(1*k)+B+te},[E]),N=o.useCallback(d=>{let T=E.current;if(!T)return;T.style.height="auto",q.current===0&&z();let k=q.current,B=fe.current,te=d??g,rt=te?R:1,Se=te?M:1,Z=Math.ceil(rt*k)+B,Ie=Math.ceil(Se*k)+B,Ae=Math.max(T.scrollHeight,Z),Ee=Math.min(Ae,Ie);T.style.height=`${Ee}px`,Ae>Ie?(T.style.overflowY="auto",T.style.maxHeight=`${Ie}px`):(T.style.overflowY="hidden",T.style.maxHeight="none")},[g,R,M,E,z]);At(()=>{N()},[N,j,g]),At(()=>{if(!(D==="overflow"||D==="both")||g)return;let d=E.current;if(!d)return;d.style.height="auto",_.current===0&&z(),d.scrollHeight>_.current+1&&(V(!0),N(!0),requestAnimationFrame(()=>N(!0)))},[j,D,g,V,E,z,N]),At(()=>{z(),N()},[z,N,ee]),o.useEffect(()=>{let d=E.current;if(!d||typeof ResizeObserver>"u")return;let T=q.current,k=new ResizeObserver(()=>{let B=window.getComputedStyle(d),te=parseFloat(B.lineHeight)||20;te!==T&&(T=te,z(),requestAnimationFrame(()=>N()))});return k.observe(d),()=>k.disconnect()},[E,z,N]),o.useEffect(()=>{},[]);let Ge=o.useCallback(d=>{A||F||((D==="focus"||D==="both")&&!g&&V(!0),l?.(d))},[A,F,D,g,V,l]),Ne=o.useCallback(d=>{let T=d.currentTarget,k=T.value;H(k),(D==="overflow"||D==="both")&&!g&&(T.style.height="auto",_.current===0&&z(),T.scrollHeight>_.current+1&&(V(!0),N(!0),requestAnimationFrame(()=>N(!0)))),requestAnimationFrame(()=>N()),a?.(d)},[D,g,V,H,a,N,z]),$e=o.useCallback(d=>{if(Q){let k=Array.from(d.clipboardData?.items??[]).filter(B=>B.kind==="file").map(B=>B.getAsFile()).filter(B=>!!B);k.length>0&&(d.preventDefault(),$(k))}setTimeout(()=>{g?N():N(!0)},0),s?.(d)},[Q,g,N,s,$]),de=o.useCallback(d=>{if(!f){u?.(d);return}if(d.key==="Enter"&&!d.shiftKey&&!d.altKey&&!d.ctrlKey&&!d.metaKey&&!d.nativeEvent.isComposing){if(A||F){u?.(d);return}if(O==="never"){u?.(d);return}let k=j.trim().length>0||c.attachments.length>0;if(O==="whenDirty"&&!k){u?.(d);return}d.preventDefault(),c.onSubmit?.({value:j,attachments:c.attachments}),c.clearOnSubmit&&(G||H(""),c.setAttachments([]))}u?.(d)},[f,A,F,O,j,G,H,c,u]),ce=n?X:"textarea";return o.createElement(le.m.div,{className:(0,K.default)("rt-ChatbarField","rt-ChatbarTextarea",r),layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},o.createElement(ce,{...b,ref:d=>{typeof t=="function"?t(d):t&&(t.current=d),E.current=d},className:"rt-ChatbarInput",value:j,onInput:i,onChange:Ne,onFocus:Ge,onPaste:$e,onKeyDown:de,disabled:A,readOnly:F,rows:g?R:1,spellCheck:b.spellCheck??!0,autoCorrect:b.autoCorrect??"on",style:p}))});Mo.displayName="Chatbar.Textarea";var Oo=o.forwardRef((e,t)=>{let{children:r,asChild:p,style:n,className:l,...i}=e;return be().open?null:o.createElement(p?X:"div",{...i,ref:t,className:(0,K.default)("rt-ChatbarInlineStart",l),style:n},r)});Oo.displayName="Chatbar.InlineStart";var Vo=o.forwardRef((e,t)=>{let{children:r,asChild:p,style:n,className:l,...i}=e;return be().open?null:o.createElement(p?X:"div",{...i,ref:t,className:(0,K.default)("rt-ChatbarInlineEnd",l),style:n},r)});Vo.displayName="Chatbar.InlineEnd";var Io=o.forwardRef((e,t)=>{let{asChild:r,forceMount:p,renderAttachment:n,className:l,style:i,...a}=e,s=be();if(!(s.attachments.length>0)&&!p)return null;let f=r?X:"div";return o.createElement(le.m.div,{layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},o.createElement(f,{...a,ref:t,className:(0,K.default)("rt-ChatbarAttachmentsRow",l),style:i,role:"list","aria-label":a["aria-label"]??"Attachments"},o.createElement(St,{className:"rt-ChatbarScrollArea",scrollbars:"horizontal",size:"1"},o.createElement(J,{align:"center",gap:"2",style:{minWidth:"fit-content"}},s.attachments.map(P=>o.createElement(Et,{key:P.id,attachment:P,asChild:!!n},n?.(P)))))))});Io.displayName="Chatbar.AttachmentsRow";var Et=o.forwardRef((e,t)=>{let{attachment:r,asChild:p,className:n,style:l,children:i,...a}=e,s=be(),u=p?X:"div",f=!!r.url&&r.type.startsWith("image/");return o.createElement(u,{...a,ref:t,className:(0,K.default)("rt-ChatbarAttachment",n),style:l,role:"listitem","data-kind":f?"image":"file",title:r.name},i??o.createElement(J,{align:"center",gap:"2",pr:f?void 0:"6"},o.createElement("div",{className:"rt-ChatbarAttachmentPreview","aria-hidden":!0},f?o.createElement("img",{className:"rt-ChatbarAttachmentImage",src:r.url,alt:""}):o.createElement(Nt,null)),!f&&o.createElement(J,{direction:"column",gap:"0",style:{minWidth:0}},o.createElement(Te,{size:s.size,weight:"medium",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},r.name),o.createElement(Te,{size:"1",color:"gray"},Math.ceil(r.size/1024)," KB")),o.createElement(et,{className:"rt-ChatbarAttachmentRemove","aria-label":`Remove ${r.name}`,size:"1",variant:"classic",highContrast:!0,color:"gray",onClick:()=>s.setAttachments(s.attachments.filter(P=>P.id!==r.id))},o.createElement(wt,null))))});Et.displayName="Chatbar.Attachment";var Fo=o.forwardRef((e,t)=>{let{asChild:r,accept:p,multiple:n,className:l,style:i,...a}=e,s=be(),u=o.useRef(null),f=r?X:"button",P=p??s.accept,b=(Array.isArray(P)?P:P?.split(",")??[]).join(",");return o.useEffect(()=>{let c=()=>{s.fileDialogOpenRef.current=!1};return window.addEventListener("focus",c),()=>window.removeEventListener("focus",c)},[s.fileDialogOpenRef]),o.createElement(o.Fragment,null,o.createElement(f,{...a,ref:t,className:(0,K.default)("rt-ChatbarAttachTrigger",l),style:i,type:a.type??"button","aria-label":a["aria-label"]??"Add attachments",onPointerDown:c=>{s.fileDialogOpenRef.current=!0,a.onPointerDown?.(c)},onMouseDown:c=>{s.fileDialogOpenRef.current=!0,a.onMouseDown?.(c)},onClick:c=>{s.fileDialogOpenRef.current=!0,u.current&&u.current.click(),a.onClick?.(c)}}),o.createElement("input",{ref:u,type:"file",accept:b,multiple:n??s.multiple,tabIndex:-1,style:{display:"none"},onChange:c=>{let g=Array.from(c.currentTarget.files??[]);g.length>0&&s.appendFiles(g),s.fileDialogOpenRef.current=!1,c.currentTarget.value=""}}))});Fo.displayName="Chatbar.AttachTrigger";var jo=o.forwardRef((e,t)=>{let{asChild:r,children:p,className:n,style:l,...i}=e;if(!be().open)return null;let s=r?X:"div";return o.createElement(le.m.div,{layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},o.createElement(s,{...i,ref:t,className:(0,K.default)("rt-ChatbarRow",n),style:l},o.createElement(J,{align:"center",justify:"between",width:"100%"},p)))});jo.displayName="Chatbar.Row";var Lo=o.forwardRef((e,t)=>{let{className:r,style:p,...n}=e;return o.createElement("div",{...n,ref:t,className:(0,K.default)("rt-ChatbarRowStart",r),style:p})});Lo.displayName="Chatbar.RowStart";var zo=o.forwardRef((e,t)=>{let{className:r,style:p,...n}=e;return o.createElement("div",{...n,ref:t,className:(0,K.default)("rt-ChatbarRowEnd",r),style:p})});zo.displayName="Chatbar.RowEnd";var Ho=o.forwardRef((e,t)=>{let{asChild:r,clearOnSend:p=!0,disabled:n,children:l,className:i,style:a,size:s,variant:u,"aria-label":f,"aria-labelledby":P,...b}=e,c=be(),R=c.value.trim().length>0||c.attachments.length>0,M=c.sendMode==="always"||c.sendMode==="whenDirty"&&R;if(c.sendMode==="never")return null;let D=A=>{c.disabled||c.readOnly||(c.onSubmit?.({value:c.value,attachments:c.attachments}),p&&(c.isValueControlled||c.setValue(""),c.clearOnSubmit&&c.setAttachments([])),b.onClick?.(A))};return o.createElement(et,{...b,ref:t,size:s??c.size,variant:u??(c.open?"solid":"ghost"),disabled:n||c.disabled||c.readOnly,className:(0,K.default)("rt-ChatbarSend",i),style:{opacity:M?1:0,pointerEvents:M?"auto":"none",...a},asChild:r,onClick:D,"aria-label":f??(P?void 0:"Send"),"aria-labelledby":P},l??o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-arrow-right-icon lucide-arrow-right"},o.createElement("path",{d:"M5 12h14"}),o.createElement("path",{d:"m12 5 7 7-7 7"})))});Ho.displayName="Chatbar.Send";
4
+ - or visible text children`);let h=ze.createElement(xt,{...s,...u,ref:c,className:(0,Eo.default)("rt-IconButton",e)});return p?ze.createElement(Nt,{content:t,side:o,align:a,delayDuration:n,disableHoverableContent:l,id:i},h):h});ot.displayName="IconButton";var g=w(require("react")),qr=g.default.forwardRef((e,t)=>g.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},g.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z"})));qr.displayName="ThickDividerHorizontalIcon";var Yr=g.default.forwardRef((e,t)=>g.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},g.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z"})));Yr.displayName="ThickCheckIcon";var Zr=g.default.forwardRef((e,t)=>g.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},g.default.createElement("path",{d:"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z"})));Zr.displayName="ChevronDownIcon";var Xr=g.default.forwardRef((e,t)=>g.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},g.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z"})));Xr.displayName="ThickChevronRightIcon";var Jr=g.default.forwardRef((e,t)=>g.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},g.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.76174 0.201711C5.45892 -0.0809141 4.98433 -0.0645489 4.70171 0.238264L1.20171 3.98826C0.932757 4.27642 0.932757 4.72359 1.20171 5.01174L4.70171 8.76174C4.98433 9.06455 5.45892 9.08092 5.76174 8.79829C6.06455 8.51567 6.08091 8.04108 5.79829 7.73826L2.77591 4.5L5.79829 1.26174C6.08091 0.958928 6.06455 0.484337 5.76174 0.201711Z"})));Jr.displayName="ThickChevronLeftIcon";var Qr=g.default.forwardRef((e,t)=>g.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},g.default.createElement("circle",{cx:"4.5",cy:"4.5",r:"2"})));Qr.displayName="ThickDotIcon";var At=g.default.forwardRef((e,t)=>g.default.createElement("svg",{...e,ref:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},g.default.createElement("path",{d:"M18 6 6 18"}),g.default.createElement("path",{d:"m6 6 12 12"})));At.displayName="CloseIcon";var en=g.default.forwardRef((e,t)=>g.default.createElement("svg",{...e,ref:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},g.default.createElement("path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"})));en.displayName="PaperclipIcon";var tn=g.default.forwardRef((e,t)=>g.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},g.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),g.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"})));tn.displayName="FileIcon";var kt=g.default.forwardRef((e,t)=>g.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},g.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),g.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),g.default.createElement("path",{d:"M10 9H8"}),g.default.createElement("path",{d:"M16 13H8"}),g.default.createElement("path",{d:"M16 17H8"})));kt.displayName="FileTextIcon";var z=w(require("react")),nt=w(require("classnames")),he=require("radix-ui");var on=["1","2","3"],rn=["vertical","horizontal","both"],Me={...oe,size:{type:"enum",className:"rt-r-size",values:on,default:"1",responsive:!0},...qe,scrollbars:{type:"enum",values:rn,default:"both"}};function Bo(e){let{m:t,mx:o,my:a,mt:n,mr:l,mb:s,ml:c,...i}=e;return{m:t,mx:o,my:a,mt:n,mr:l,mb:s,ml:c,rest:i}}var Mo=ne.m.values,nn=new Set(Mo),Vo=[{key:"m",className:"rt-r-m",customProperties:["--margin"]},{key:"mx",className:"rt-r-mx",customProperties:["--margin-left","--margin-right"]},{key:"my",className:"rt-r-my",customProperties:["--margin-top","--margin-bottom"]},{key:"mt",className:"rt-r-mt",customProperties:["--margin-top"]},{key:"mr",className:"rt-r-mr",customProperties:["--margin-right"]},{key:"mb",className:"rt-r-mb",customProperties:["--margin-bottom"]},{key:"ml",className:"rt-r-ml",customProperties:["--margin-left"]}];function Oo(e){let t,o;for(let a=0;a<Vo.length;a++){let{key:n,className:l,customProperties:s}=Vo[a],c=e[n];if(c===void 0)continue;let[i,p]=Ze({className:l,customProperties:s,propValues:Mo,propValueSet:nn,value:c});i&&(t??(t=[])).push(i),p&&(o=Ce(o,p))}return[t!==void 0?t.join(" "):"",o]}var rt=w(require("react"));function Io(e,t){let{asChild:o,children:a}=e;if(!o)return typeof t=="function"?t(a):t;let n=rt.Children.only(a);return rt.cloneElement(n,{children:typeof t=="function"?t(n.props.children):t})}var Et=z.forwardRef((e,t)=>{let{rest:o,...a}=Bo(e),[n,l]=Oo(a),{asChild:s,children:c,className:i,style:p,type:u,scrollHideDelay:y=u!=="scroll"?0:void 0,dir:v,size:m=Me.size.default,radius:h=Me.radius.default,scrollbars:C=Me.scrollbars.default,...V}=o;return z.createElement(he.ScrollArea.Root,{type:u,scrollHideDelay:y,className:(0,nt.default)("rt-ScrollAreaRoot",n,i),style:Ce(l,p),asChild:s},Io({asChild:s,children:c},x=>z.createElement(z.Fragment,null,z.createElement(he.ScrollArea.Viewport,{...V,ref:t,className:"rt-ScrollAreaViewport"},x),z.createElement("div",{className:"rt-ScrollAreaViewportFocusRing"}),C!=="vertical"?z.createElement(he.ScrollArea.Scrollbar,{"data-radius":h,orientation:"horizontal",className:(0,nt.default)("rt-ScrollAreaScrollbar",ke({className:"rt-r-size",value:m,propValues:Me.size.values}))},z.createElement(he.ScrollArea.Thumb,{className:"rt-ScrollAreaThumb"})):null,C!=="horizontal"?z.createElement(he.ScrollArea.Scrollbar,{"data-radius":h,orientation:"vertical",className:(0,nt.default)("rt-ScrollAreaScrollbar",ke({className:"rt-r-size",value:m,propValues:Me.size.values}))},z.createElement(he.ScrollArea.Thumb,{className:"rt-ScrollAreaThumb"})):null,C==="both"?z.createElement(he.ScrollArea.Corner,{className:"rt-ScrollAreaCorner"}):null)))});Et.displayName="ScrollArea";var Fo=require("react-dropzone"),Bt=typeof window<"u"?r.useLayoutEffect:r.useEffect,jo=r.createContext(null),Pe=()=>{let e=r.useContext(jo);if(!e)throw new Error("Chatbar context not found. Wrap parts in <Chatbar.Root>.");return e},Lo=r.forwardRef((e,t)=>{let{className:o,style:a,children:n,value:l,defaultValue:s="",onValueChange:c,open:i,defaultOpen:p=!1,onOpenChange:u,expandOn:y="both",minLines:v=3,maxLines:m=6,sendMode:h="whenDirty",disabled:C,readOnly:V,onSubmit:x,size:E="2",variant:j,color:M,radius:I,panelBackground:B,material:G,width:Z,maxWidth:ie,asChild:me,attachments:X,defaultAttachments:ve=[],onAttachmentsChange:$,accept:J,multiple:U=!0,maxAttachments:L,maxFileSize:T,paste:He=!0,pasteAccept:Te,clearOnSubmit:We=!0,onAttachmentReject:fe,dropzone:pe=!0,apiRef:d,...R}=e,N=G||B,A=l!=null,[Q,st]=r.useState(s),Se=A?l:Q,K=i!=null,[Oe,Ne]=r.useState(p),Ae=K?i:Oe,at=r.useRef(null),Ge=r.useRef(null),it=r.useRef(!1),de="attachments"in e,[Mt,Ot]=r.useState(ve),ye=r.useMemo(()=>de?X??[]:Mt,[de,X,Mt]),$e=r.useRef(new Set),pt=f=>Array.isArray(f)?f:typeof f=="string"?f.split(",").map(P=>P.trim()):[],Ie=pt(J),It=pt(Te).length>0?pt(Te):Ie,Ft=(f,P)=>{if(P.length===0)return!0;let _=f.type.toLowerCase(),le=f.name.toLowerCase();for(let ee of P){let H=ee.toLowerCase();if(H.includes("/")){let[te,ce]=H.split("/"),[D,je]=_.split("/");if(te==="*"||te===D&&(ce==="*"||ce===je))return!0}else if(H.startsWith(".")&&le.endsWith(H))return!0}return!1},lt=r.useRef(ye);lt.current=ye;let ct=r.useRef(Ie);ct.current=Ie;let jt=r.useRef(It);jt.current=It;let ut=r.useRef(L);ut.current=L;let mt=r.useRef(T);mt.current=T;let ft=r.useRef(fe);ft.current=fe;let Lt=r.useRef($);Lt.current=$;let zt=r.useRef(u);zt.current=u;let Fe=r.useCallback(f=>{let P=lt.current,_=ct.current,le=ut.current,ee=mt.current,H=[],te=[],ce=typeof le=="number"?Math.max(le-P.length,0):1/0;for(let D of f){if(H.length>=ce){te.push({file:D,reason:"count"});continue}if(typeof ee=="number"&&D.size>ee){te.push({file:D,reason:"size"});continue}if(!Ft(D,_)){te.push({file:D,reason:"type"});continue}let je=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,ge=/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(D.name),dt=(D.type||"").toLowerCase().startsWith("image/")||ge?URL.createObjectURL(D):void 0;dt&&$e.current.add(dt),H.push({id:je,name:D.name,size:D.size,type:D.type,file:D,url:dt,status:"idle"})}if(H.length>0){let D=P.concat(H);de||Ot(D),Lt.current?.(D),K||Ne(!0),zt.current?.(!0)}te.length>0&&ft.current?.(te)},[de,K]),Ht=r.useCallback(f=>{let P=ct.current,_=jt.current,le=ut.current,ee=mt.current,H=lt.current,te=_.length>0?_:P,ce=[],D=[],je=typeof le=="number"?Math.max(le-H.length,0):1/0;for(let ge of f){if(ce.length>=je){D.push({file:ge,reason:"count"});continue}if(typeof ee=="number"&&ge.size>ee){D.push({file:ge,reason:"size"});continue}if(!Ft(ge,te)){D.push({file:ge,reason:"type"});continue}ce.push(ge)}ce.length>0&&Fe(ce),D.length>0&&ft.current?.(D)},[Fe]);r.useEffect(()=>{let f=new Set(ye.map(P=>P.url).filter(Boolean));for(let P of Array.from($e.current))f.has(P)||(URL.revokeObjectURL(P),$e.current.delete(P))},[ye]),r.useEffect(()=>{let f=$e.current;return()=>{for(let P of Array.from(f))URL.revokeObjectURL(P);f.clear()}},[]);let Yo=me?q:"div",Wt=r.useCallback(f=>{K||Ne(f),u?.(f)},[K,u]),Gt=r.useCallback(f=>{A||st(f),c?.(f)},[A,c]),$t=r.useCallback(f=>{de||Ot(f),$?.(f)},[de,$]),Zo=r.useCallback(f=>{let P=f.relatedTarget,_=at.current;_&&(P&&_.contains(P)||it.current||(Se?.trim?.()??"").length===0&&ye.length===0&&(K||Ne(!1),u?.(!1)))},[K,u,Se,ye]),{getRootProps:Xo,getInputProps:Jo,isDragActive:Ut,open:Kt}=(0,Fo.useDropzone)({onDrop:(f,P)=>{if(f.length>0&&Fe(f),P.length>0&&fe){let _=P.map(({file:le,errors:ee})=>{let H=ee[0]?.code==="file-too-large"?"size":ee[0]?.code==="file-invalid-type"?"type":"count";return{file:le,reason:H}});fe(_)}},accept:Ie.length>0?Ie.reduce((f,P)=>(P.includes("/")?f[P]=[]:P.startsWith(".")&&(f[P]=[]),f),{}):void 0,multiple:U,maxSize:T,noClick:!0,noKeyboard:!0,disabled:!pe||C});r.useImperativeHandle(d,()=>({focusTextarea:()=>Ge.current?.focus({preventScroll:!0}),openFilePicker:()=>{it.current=!0,Kt()}}),[Kt]);let _t=r.useCallback(f=>{if(!(f instanceof Element))return!1;let P=f;return P.closest(".rt-ChatbarDropOverlay")?!0:!!P.closest('button, [role="button"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex="-1"])')},[]),Qo=r.useCallback(f=>{C||_t(f.target)||f.pointerType==="mouse"&&f.button!==0||(f.preventDefault(),Ge.current?.focus({preventScroll:!0}))},[C,_t,Ge]);return r.createElement(jo.Provider,{value:r.useMemo(()=>({open:Ae,setOpen:Wt,isOpenControlled:K,value:Se,setValue:Gt,isValueControlled:A,size:E,expandOn:y,minLines:v,maxLines:m,sendMode:h,disabled:C,readOnly:V,onSubmit:x,rootRef:at,textareaRef:Ge,attachments:ye,setAttachments:$t,isAttachmentsControlled:de,accept:J,multiple:U,maxAttachments:L,maxFileSize:T,paste:He,pasteAccept:Te,clearOnSubmit:We,onAttachmentReject:fe,dropzone:pe,appendFiles:Fe,appendFilesFromPaste:Ht,fileDialogOpenRef:it}),[Ae,Wt,K,Se,Gt,A,E,y,v,m,h,C,V,x,ye,$t,de,J,U,L,T,He,Te,We,fe,pe,Fe,Ht])},r.createElement(ae.LazyMotion,{features:ae.domAnimation},r.createElement(Yo,{...R,ref:f=>{typeof t=="function"?t(f):t&&(t.current=f),at.current=f},className:(0,W.default)("rt-ChatbarRoot",`rt-r-size-${E}`,o),style:{position:"relative",width:Z,maxWidth:ie,...a},"data-state":Ae?"open":"closed","data-disabled":C?"":void 0,"data-readonly":V?"":void 0,"data-drop-active":pe&&Ut?"":void 0,"data-accent-color":M,"data-radius":I,"data-panel-background":N,"data-material":N,"aria-expanded":Ae,onBlurCapture:Zo},pe&&r.createElement("input",{...Jo()}),r.createElement("div",{...pe?Xo():{},style:{width:"100%",height:"100%"},onPointerDown:Qo},r.createElement(ae.m.div,{className:(0,W.default)("rt-ChatbarBox",`rt-variant-${j??"surface"}`),style:{position:"relative"},"data-accent-color":M,"data-radius":I,"data-panel-background":N,"data-material":N,layout:!0,transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},r.createElement(ae.m.div,{className:"rt-ChatbarGrid",layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},n),pe&&Ut&&r.createElement("div",{className:"rt-ChatbarDropOverlay"},r.createElement("div",{className:"rt-ChatbarDropContent"},r.createElement(we,{color:"gray",size:E,weight:"medium"},"Drop files here to attach"))))))))});Lo.displayName="Chatbar.Root";var zo=r.forwardRef((e,t)=>{let{className:o,style:a,asChild:n,onFocus:l,onInput:s,onChange:c,onPaste:i,onKeyDown:p,submitOnEnter:u=!1,rows:y,...v}=e,m=Pe(),{open:h,minLines:C,maxLines:V,expandOn:x,disabled:E,readOnly:j,setOpen:M,setValue:I,textareaRef:B,value:G,isValueControlled:Z,sendMode:ie,paste:me,appendFilesFromPaste:X,size:ve}=m,$=r.useRef(0),J=r.useRef(0),U=r.useRef(0),L=r.useCallback(()=>{let d=B.current;if(!d)return;let R=window.getComputedStyle(d),N=parseFloat(R.lineHeight)||20,A=parseFloat(R.paddingTop)||0,Q=parseFloat(R.paddingBottom)||0;$.current=N,J.current=A+Q,U.current=Math.ceil(1*N)+A+Q},[B]),T=r.useCallback(d=>{let R=B.current;if(!R)return;R.style.height="auto",$.current===0&&L();let N=$.current,A=J.current,Q=d??h,st=Q?C:1,Se=Q?V:1,K=Math.ceil(st*N)+A,Oe=Math.ceil(Se*N)+A,Ne=Math.max(R.scrollHeight,K),Ae=Math.min(Ne,Oe);R.style.height=`${Ae}px`,Ne>Oe?(R.style.overflowY="auto",R.style.maxHeight=`${Oe}px`):(R.style.overflowY="hidden",R.style.maxHeight="none")},[h,C,V,B,L]);Bt(()=>{T()},[T,G,h]),Bt(()=>{if(!(x==="overflow"||x==="both")||h)return;let d=B.current;if(!d)return;d.style.height="auto",U.current===0&&L(),d.scrollHeight>U.current+1&&(M(!0),T(!0),requestAnimationFrame(()=>T(!0)))},[G,x,h,M,B,L,T]),Bt(()=>{L(),T()},[L,T,ve]),r.useEffect(()=>{let d=B.current;if(!d||typeof ResizeObserver>"u")return;let R=$.current,N=new ResizeObserver(()=>{let A=window.getComputedStyle(d),Q=parseFloat(A.lineHeight)||20;Q!==R&&(R=Q,L(),requestAnimationFrame(()=>T()))});return N.observe(d),()=>N.disconnect()},[B,L,T]),r.useEffect(()=>{},[]);let He=r.useCallback(d=>{E||j||((x==="focus"||x==="both")&&!h&&M(!0),l?.(d))},[E,j,x,h,M,l]),Te=r.useCallback(d=>{let R=d.currentTarget,N=R.value;I(N),(x==="overflow"||x==="both")&&!h&&(R.style.height="auto",U.current===0&&L(),R.scrollHeight>U.current+1&&(M(!0),T(!0),requestAnimationFrame(()=>T(!0)))),requestAnimationFrame(()=>T()),c?.(d)},[x,h,M,I,c,T,L]),We=r.useCallback(d=>{if(me){let N=Array.from(d.clipboardData?.items??[]).filter(A=>A.kind==="file").map(A=>A.getAsFile()).filter(A=>!!A);N.length>0&&(d.preventDefault(),X(N))}setTimeout(()=>{h?T():T(!0)},0),i?.(d)},[me,h,T,i,X]),fe=r.useCallback(d=>{if(!u){p?.(d);return}if(d.key==="Enter"&&!d.shiftKey&&!d.altKey&&!d.ctrlKey&&!d.metaKey&&!d.nativeEvent.isComposing){if(E||j){p?.(d);return}if(ie==="never"){p?.(d);return}let N=G.trim().length>0||m.attachments.length>0;if(ie==="whenDirty"&&!N){p?.(d);return}d.preventDefault(),m.onSubmit?.({value:G,attachments:m.attachments}),m.clearOnSubmit&&(Z||I(""),m.setAttachments([]))}p?.(d)},[u,E,j,ie,G,Z,I,m,p]),pe=n?q:"textarea";return r.createElement(ae.m.div,{className:(0,W.default)("rt-ChatbarField","rt-ChatbarTextarea",o),layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},r.createElement(pe,{...v,ref:d=>{typeof t=="function"?t(d):t&&(t.current=d),B.current=d},className:"rt-ChatbarInput",value:G,onInput:s,onChange:Te,onFocus:He,onPaste:We,onKeyDown:fe,disabled:E,readOnly:j,rows:h?C:1,spellCheck:v.spellCheck??!0,autoCorrect:v.autoCorrect??"on",style:a}))});zo.displayName="Chatbar.Textarea";var Ho=r.forwardRef((e,t)=>{let{children:o,asChild:a,style:n,className:l,...s}=e;return Pe().open?null:r.createElement(a?q:"div",{...s,ref:t,className:(0,W.default)("rt-ChatbarInlineStart",l),style:n},o)});Ho.displayName="Chatbar.InlineStart";var Wo=r.forwardRef((e,t)=>{let{children:o,asChild:a,style:n,className:l,...s}=e;return Pe().open?null:r.createElement(a?q:"div",{...s,ref:t,className:(0,W.default)("rt-ChatbarInlineEnd",l),style:n},o)});Wo.displayName="Chatbar.InlineEnd";var Go=r.forwardRef((e,t)=>{let{asChild:o,forceMount:a,renderAttachment:n,className:l,style:s,...c}=e,i=Pe();if(!(i.attachments.length>0)&&!a)return null;let u=o?q:"div";return r.createElement(ae.m.div,{layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},r.createElement(u,{...c,ref:t,className:(0,W.default)("rt-ChatbarAttachmentsRow",l),style:s,role:"list","aria-label":c["aria-label"]??"Attachments"},r.createElement(Et,{className:"rt-ChatbarScrollArea",scrollbars:"horizontal",size:"1"},r.createElement(Y,{align:"center",gap:"2",style:{minWidth:"fit-content"}},i.attachments.map(y=>r.createElement(Vt,{key:y.id,attachment:y,asChild:!!n},n?.(y)))))))});Go.displayName="Chatbar.AttachmentsRow";var Vt=r.forwardRef((e,t)=>{let{attachment:o,asChild:a,className:n,style:l,children:s,...c}=e,i=Pe(),p=a?q:"div",u=!!o.url&&o.type.startsWith("image/");return r.createElement(p,{...c,ref:t,className:(0,W.default)("rt-ChatbarAttachment",n),style:l,role:"listitem","data-kind":u?"image":"file",title:o.name},s??r.createElement(Y,{align:"center",gap:"2",pr:u?void 0:"6"},r.createElement("div",{className:"rt-ChatbarAttachmentPreview","aria-hidden":!0},u?r.createElement("img",{className:"rt-ChatbarAttachmentImage",src:o.url,alt:""}):r.createElement(kt,null)),!u&&r.createElement(Y,{direction:"column",gap:"0",style:{minWidth:0}},r.createElement(we,{size:i.size,weight:"medium",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},o.name),r.createElement(we,{size:"1",color:"gray"},Math.ceil(o.size/1024)," KB")),r.createElement(ot,{className:"rt-ChatbarAttachmentRemove","aria-label":`Remove ${o.name}`,size:"1",variant:"classic",highContrast:!0,color:"gray",onClick:()=>i.setAttachments(i.attachments.filter(y=>y.id!==o.id))},r.createElement(At,null))))});Vt.displayName="Chatbar.Attachment";var $o=r.forwardRef((e,t)=>{let{asChild:o,accept:a,multiple:n,className:l,style:s,...c}=e,i=Pe(),p=r.useRef(null),u=o?q:"button",y=a??i.accept,v=(Array.isArray(y)?y:y?.split(",")??[]).join(",");return r.useEffect(()=>{let m=()=>{i.fileDialogOpenRef.current=!1};return window.addEventListener("focus",m),()=>window.removeEventListener("focus",m)},[i.fileDialogOpenRef]),r.createElement(r.Fragment,null,r.createElement(u,{...c,ref:t,className:(0,W.default)("rt-ChatbarAttachTrigger",l),style:s,type:c.type??"button","aria-label":c["aria-label"]??"Add attachments",onPointerDown:m=>{i.fileDialogOpenRef.current=!0,c.onPointerDown?.(m)},onMouseDown:m=>{i.fileDialogOpenRef.current=!0,c.onMouseDown?.(m)},onClick:m=>{i.fileDialogOpenRef.current=!0,p.current&&p.current.click(),c.onClick?.(m)}}),r.createElement("input",{ref:p,type:"file",accept:v,multiple:n??i.multiple,tabIndex:-1,style:{display:"none"},onChange:m=>{let h=Array.from(m.currentTarget.files??[]);h.length>0&&i.appendFiles(h),i.fileDialogOpenRef.current=!1,m.currentTarget.value=""}}))});$o.displayName="Chatbar.AttachTrigger";var Uo=r.forwardRef((e,t)=>{let{asChild:o,children:a,className:n,style:l,...s}=e;if(!Pe().open)return null;let i=o?q:"div";return r.createElement(ae.m.div,{layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},r.createElement(i,{...s,ref:t,className:(0,W.default)("rt-ChatbarRow",n),style:l},r.createElement(Y,{align:"center",justify:"between",width:"100%"},a)))});Uo.displayName="Chatbar.Row";var Ko=r.forwardRef((e,t)=>{let{className:o,style:a,...n}=e;return r.createElement("div",{...n,ref:t,className:(0,W.default)("rt-ChatbarRowStart",o),style:a})});Ko.displayName="Chatbar.RowStart";var _o=r.forwardRef((e,t)=>{let{className:o,style:a,...n}=e;return r.createElement("div",{...n,ref:t,className:(0,W.default)("rt-ChatbarRowEnd",o),style:a})});_o.displayName="Chatbar.RowEnd";var qo=r.forwardRef((e,t)=>{let{asChild:o,clearOnSend:a=!0,disabled:n,children:l,className:s,style:c,size:i,variant:p,"aria-label":u,"aria-labelledby":y,...v}=e,m=Pe(),C=m.value.trim().length>0||m.attachments.length>0,V=m.sendMode==="always"||m.sendMode==="whenDirty"&&C;if(m.sendMode==="never")return null;let x=E=>{m.disabled||m.readOnly||(m.onSubmit?.({value:m.value,attachments:m.attachments}),a&&(m.isValueControlled||m.setValue(""),m.clearOnSubmit&&m.setAttachments([])),v.onClick?.(E))};return r.createElement(ot,{...v,ref:t,size:i??m.size,variant:p??(m.open?"solid":"ghost"),disabled:n||m.disabled||m.readOnly,className:(0,W.default)("rt-ChatbarSend",s),style:{opacity:V?1:0,pointerEvents:V?"auto":"none",...c},asChild:o,onClick:x,"aria-label":u??(y?void 0:"Send"),"aria-labelledby":y},l??r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-arrow-right-icon lucide-arrow-right"},r.createElement("path",{d:"M5 12h14"}),r.createElement("path",{d:"m12 5 7 7-7 7"})))});qo.displayName="Chatbar.Send";
5
5
  //# sourceMappingURL=chatbar.js.map