efficient-shell 11.11.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (372) hide show
  1. package/README.md +10 -12
  2. package/dist/{Browser-NRGJ53ST.js → Browser-CXZAXF55.js} +17 -17
  3. package/dist/Calculator-TKQRQGTI.js +29 -0
  4. package/dist/{CurrencyConverter-CJQMDBQW.js → CurrencyConverter-WFC3TAL4.js} +9 -9
  5. package/dist/Files-QM5PW6BX.js +88 -0
  6. package/dist/{Notepad-2XW63REV.js → Notepad-B7CKQ54M.js} +9 -9
  7. package/dist/PdfViewer-3UEC5TNN.js +1 -0
  8. package/dist/{PomodoroTimer-Y5GQX37J.js → PomodoroTimer-JMJORKWZ.js} +68 -68
  9. package/dist/{Preview-K7KDM4XK.js → Preview-OELV5X55.js} +30 -30
  10. package/dist/Sidebar-SZ5OGL6C.js +44 -0
  11. package/dist/{Stock-IHAG62QV.js → Stock-R3436P6X.js} +3 -3
  12. package/dist/{Weather-EQDFEBIH.js → Weather-6N3ZPO2Q.js} +20 -20
  13. package/dist/{WorldClock-VQG7G2Z2.js → WorldClock-BJKYHGLS.js} +6 -6
  14. package/dist/ai/index.js +91 -91
  15. package/dist/apps/index.d.ts +26 -25
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/media-host-check.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/brand.css +1 -1
  20. package/dist/charts/BoxPlotChart.js +1 -1
  21. package/dist/charts/CandlestickChart.js +1 -1
  22. package/dist/charts/CartesianPlot.js +1 -1
  23. package/dist/charts/ChartBrush.js +1 -1
  24. package/dist/charts/ChartFrame.js +1 -1
  25. package/dist/charts/ChartSkeleton.js +1 -1
  26. package/dist/charts/ChartTooltip.js +1 -1
  27. package/dist/charts/ChordChart.js +1 -1
  28. package/dist/charts/ColumnChart.js +1 -1
  29. package/dist/charts/FunnelChart.js +1 -1
  30. package/dist/charts/HeatmapChart.js +1 -1
  31. package/dist/charts/HistogramChart.js +1 -1
  32. package/dist/charts/Meter.js +1 -1
  33. package/dist/charts/PieChart.js +1 -1
  34. package/dist/charts/RadarChart.js +1 -1
  35. package/dist/charts/RadialBarChart.js +1 -1
  36. package/dist/charts/RangeChart.js +1 -1
  37. package/dist/charts/RankedBars.js +1 -1
  38. package/dist/charts/SankeyChart.js +1 -1
  39. package/dist/charts/ScatterChart.js +1 -1
  40. package/dist/charts/SpecChart.js +1 -1
  41. package/dist/charts/StatTile.js +1 -1
  42. package/dist/charts/SunburstChart.js +1 -1
  43. package/dist/charts/TimeSeriesChart.js +1 -1
  44. package/dist/charts/TreemapChart.js +1 -1
  45. package/dist/charts/WaterfallChart.js +1 -1
  46. package/dist/{chunk-7V32O5NF.js → chunk-2UO47XB4.js} +14 -30
  47. package/dist/{chunk-X2DUOIJP.js → chunk-33F35NNM.js} +1 -1
  48. package/dist/{chunk-FUHURDBL.js → chunk-34AHFST2.js} +1 -1
  49. package/dist/{chunk-WDQI3FV6.js → chunk-36VIGB6J.js} +6 -6
  50. package/dist/{chunk-JG26ICX6.js → chunk-3LGPZAVU.js} +2 -2
  51. package/dist/{chunk-3JCOD5L2.js → chunk-3YQICVUP.js} +2 -2
  52. package/dist/{chunk-5B4GRLAA.js → chunk-46EBZ7YI.js} +1 -1
  53. package/dist/{chunk-AHITTM6W.js → chunk-46VLN6KC.js} +1 -1
  54. package/dist/{chunk-E3EHHR73.js → chunk-4ALGGYHV.js} +9 -9
  55. package/dist/{chunk-QOJ2UNS5.js → chunk-4DDL6NXB.js} +1 -1
  56. package/dist/{chunk-62BDGAML.js → chunk-4K7BA3PD.js} +6 -6
  57. package/dist/chunk-4LNO444F.js +11 -0
  58. package/dist/{chunk-225LCPO7.js → chunk-4MERJIJJ.js} +1 -1
  59. package/dist/chunk-56YJIKVI.js +11 -0
  60. package/dist/{chunk-VEGZVUHE.js → chunk-5EWKVVUD.js} +1 -1
  61. package/dist/chunk-5PDHKH2A.js +3 -0
  62. package/dist/{chunk-EYPKBJYG.js → chunk-5PP435FL.js} +1 -1
  63. package/dist/{chunk-6DQANKTL.js → chunk-62RAGXWK.js} +9 -9
  64. package/dist/{chunk-NMQGAP3H.js → chunk-63ZLF7LS.js} +1 -1
  65. package/dist/chunk-6E47JSLM.js +22 -0
  66. package/dist/{chunk-3PZI2C4R.js → chunk-6HO7244M.js} +1 -1
  67. package/dist/{chunk-3ZRYKZGI.js → chunk-6KGIHI6X.js} +10 -10
  68. package/dist/{chunk-OLJUPBY4.js → chunk-6MWLOLLP.js} +1 -1
  69. package/dist/{chunk-K6D7OSKZ.js → chunk-7P2WKDGB.js} +14 -14
  70. package/dist/{chunk-ESWR7YNY.js → chunk-A34PD3XT.js} +16 -16
  71. package/dist/{chunk-KVVZLEUG.js → chunk-A3AKJDLI.js} +1 -1
  72. package/dist/chunk-AEMAGYIZ.js +8 -0
  73. package/dist/{chunk-CLAKVFOB.js → chunk-AICGATHE.js} +48 -48
  74. package/dist/{chunk-57WQVUBX.js → chunk-AIJ6OR6X.js} +2 -2
  75. package/dist/{chunk-WOOKUEED.js → chunk-AQ3LCE2U.js} +1 -1
  76. package/dist/chunk-ATURDO2C.js +14 -0
  77. package/dist/chunk-B7WTHCTF.js +4 -0
  78. package/dist/{chunk-HRG4FYVU.js → chunk-BUHTLO2K.js} +1 -1
  79. package/dist/{chunk-CSLMWGFS.js → chunk-BYLGKRIT.js} +1 -1
  80. package/dist/{chunk-V64CJHMY.js → chunk-C4T4APD6.js} +22 -22
  81. package/dist/{chunk-TA4JGC5C.js → chunk-CCA4LQNB.js} +1 -1
  82. package/dist/{chunk-Y4RHGLXB.js → chunk-CFJL6MML.js} +1 -1
  83. package/dist/{chunk-KKJ55GUZ.js → chunk-CJ4U4C4A.js} +5 -5
  84. package/dist/{chunk-TZXAW32T.js → chunk-CRILBBSU.js} +1 -1
  85. package/dist/{chunk-D4RVWSUT.js → chunk-CRO56LVN.js} +1 -1
  86. package/dist/{chunk-DHMOJX2Z.js → chunk-D7DRZKUI.js} +1 -1
  87. package/dist/{chunk-SGBR443F.js → chunk-DD2ZGHCG.js} +6 -6
  88. package/dist/{chunk-42TLGG33.js → chunk-DSKROZST.js} +1 -1
  89. package/dist/{chunk-CDQUOCXO.js → chunk-DV4B26FJ.js} +1 -1
  90. package/dist/{chunk-VPEH3THH.js → chunk-DW5Y57I2.js} +3 -3
  91. package/dist/{chunk-CAIKDX2M.js → chunk-DWYCSJ6O.js} +2 -2
  92. package/dist/{chunk-UWJNQH2X.js → chunk-E47TNYYE.js} +1 -1
  93. package/dist/{chunk-IIKPM3F4.js → chunk-ED5D2O6E.js} +1 -1
  94. package/dist/{chunk-LXOX5FGH.js → chunk-EFBWQWUS.js} +2 -2
  95. package/dist/chunk-EJBR5Y4X.js +9 -0
  96. package/dist/{chunk-AQGIK2CV.js → chunk-EM6VZSNJ.js} +1 -1
  97. package/dist/{chunk-7R23EKON.js → chunk-EO3IKZCP.js} +1 -1
  98. package/dist/chunk-EOVXFXVV.js +2 -0
  99. package/dist/chunk-EZBE3H2W.js +9 -0
  100. package/dist/{chunk-PMKBWDXO.js → chunk-FGWHTNC3.js} +1 -1
  101. package/dist/{chunk-JPNAEN53.js → chunk-FZM3ZPW3.js} +1 -1
  102. package/dist/{chunk-PZHO4FEN.js → chunk-GCRPI3AL.js} +1 -1
  103. package/dist/{chunk-6LK2BBCC.js → chunk-GEQC4ABV.js} +6 -6
  104. package/dist/{chunk-T74FGTLW.js → chunk-GHMDLZH4.js} +7 -7
  105. package/dist/chunk-GWDTGCQB.js +9 -0
  106. package/dist/{chunk-6LITLCVV.js → chunk-H34KI3HV.js} +9 -9
  107. package/dist/{chunk-LXQHTY3A.js → chunk-H3IGNWT7.js} +3 -3
  108. package/dist/{chunk-VZ52KKNA.js → chunk-HCKCQIWA.js} +6 -6
  109. package/dist/{chunk-R72ZKZDP.js → chunk-HK4QAI2A.js} +2 -2
  110. package/dist/{chunk-QEDVXD3L.js → chunk-HKPVHSZ3.js} +1 -1
  111. package/dist/{chunk-LGTYPLJM.js → chunk-HNUKXGYP.js} +3 -3
  112. package/dist/{chunk-B2AYI45X.js → chunk-HTB5AEZU.js} +6 -6
  113. package/dist/chunk-IJXMWWTM.js +9 -0
  114. package/dist/{chunk-AWQ5SOC5.js → chunk-IK37Q6LY.js} +1 -1
  115. package/dist/{chunk-EV7VAXMO.js → chunk-IS7C6OWZ.js} +9 -9
  116. package/dist/{chunk-YQLKZ5UQ.js → chunk-JAQO3TNE.js} +1 -1
  117. package/dist/chunk-JINTE3G4.js +1 -0
  118. package/dist/{chunk-SKRFI6WB.js → chunk-JQHL4B4C.js} +12 -12
  119. package/dist/{chunk-KZEIQO3V.js → chunk-JSUL7UON.js} +3 -3
  120. package/dist/{chunk-ZOQVYSTB.js → chunk-K46DLEIX.js} +22 -22
  121. package/dist/{chunk-Q7DVGUML.js → chunk-KABXUBIH.js} +1 -1
  122. package/dist/{chunk-CT7AU2TA.js → chunk-KRH7UAD2.js} +1 -1
  123. package/dist/{chunk-PDFV3YQB.js → chunk-KSHNA6W2.js} +1 -1
  124. package/dist/{chunk-7IVTGOGM.js → chunk-L6OPXIZN.js} +1 -1
  125. package/dist/{chunk-ZKBGUDNB.js → chunk-LBGRLG3Y.js} +1 -1
  126. package/dist/{chunk-VCMHBUKI.js → chunk-LE5LWALR.js} +1 -1
  127. package/dist/{chunk-PL4HKGYP.js → chunk-LISPTWW3.js} +1 -1
  128. package/dist/{chunk-HJBR73GS.js → chunk-LJN77RG6.js} +1 -1
  129. package/dist/chunk-LPJGF6LK.js +27 -0
  130. package/dist/{chunk-SWJXWDKX.js → chunk-LXHTCLNX.js} +1 -1
  131. package/dist/chunk-MBY5JIGB.js +1 -0
  132. package/dist/{chunk-RNBC6V2D.js → chunk-MOBJVNLF.js} +11 -11
  133. package/dist/{chunk-R6TDZ7T5.js → chunk-MQXZZBR6.js} +1 -1
  134. package/dist/{chunk-YUAF3FDE.js → chunk-MSAQGUGU.js} +4 -4
  135. package/dist/{chunk-RQDVAUXD.js → chunk-N5KO2IHG.js} +4 -4
  136. package/dist/{chunk-F636NDAU.js → chunk-N7GFQZ2J.js} +8 -8
  137. package/dist/chunk-N7LDQZTL.js +8 -0
  138. package/dist/chunk-NDP2I5HK.js +8 -0
  139. package/dist/{chunk-VVDK7XPH.js → chunk-NIBYHQLT.js} +1 -1
  140. package/dist/{chunk-QQ2LDC6C.js → chunk-NJN5IKWO.js} +1 -1
  141. package/dist/{chunk-KYHDDVTR.js → chunk-NK5RRBXY.js} +6 -6
  142. package/dist/{chunk-WEEQDPU3.js → chunk-NPTHHWXZ.js} +5 -5
  143. package/dist/chunk-NZISMTQE.js +7 -0
  144. package/dist/{chunk-K6LW2QLI.js → chunk-O53EQODF.js} +1 -1
  145. package/dist/{chunk-32EKHIAZ.js → chunk-OAZX7ZGB.js} +12 -12
  146. package/dist/{chunk-IEOCUEJK.js → chunk-OMCM3SIE.js} +7 -7
  147. package/dist/chunk-OMUC6TZT.js +6 -0
  148. package/dist/{chunk-PETBAYS5.js → chunk-OXVRXWJL.js} +12 -12
  149. package/dist/{chunk-ATKFIHDP.js → chunk-P75R4EYJ.js} +4 -4
  150. package/dist/{chunk-I5XNADZ3.js → chunk-PB6XGDLJ.js} +8 -8
  151. package/dist/{chunk-HDABS36W.js → chunk-PLDMQNKD.js} +7 -7
  152. package/dist/{chunk-M57KX3OM.js → chunk-QMTYILTT.js} +1 -1
  153. package/dist/{chunk-5KKJAYKT.js → chunk-QTNMALBN.js} +1 -1
  154. package/dist/{chunk-7HLBVMMQ.js → chunk-RBINX62X.js} +1 -1
  155. package/dist/{chunk-SYZLS2JA.js → chunk-RDKIYORS.js} +1 -1
  156. package/dist/{chunk-SAASFWKB.js → chunk-RDYFZHT3.js} +1 -1
  157. package/dist/{chunk-JRCFOZEU.js → chunk-RLTTAH46.js} +4 -4
  158. package/dist/{chunk-UTITWGVW.js → chunk-RPFONHXQ.js} +1 -1
  159. package/dist/{chunk-2XORVHF2.js → chunk-RSPCCVN4.js} +1 -1
  160. package/dist/{chunk-UVMM7AYO.js → chunk-S262RGL6.js} +1 -1
  161. package/dist/{chunk-JQBVSPF5.js → chunk-S4FPYCUU.js} +3 -3
  162. package/dist/{chunk-C3UY34DC.js → chunk-SCPPW3ZC.js} +4 -4
  163. package/dist/{chunk-PMA6DZ4Q.js → chunk-SOWRW647.js} +6 -6
  164. package/dist/chunk-SZC35EYE.js +28 -0
  165. package/dist/{chunk-6CK44QWU.js → chunk-T4WDJ7IB.js} +29 -29
  166. package/dist/{chunk-ZOQXFS3R.js → chunk-T6BGS26U.js} +1 -1
  167. package/dist/{chunk-XWFLIGDQ.js → chunk-TE6R53YD.js} +1 -1
  168. package/dist/{chunk-O6VIHWYU.js → chunk-TF6DYDNQ.js} +1 -1
  169. package/dist/{chunk-JJZAYAVL.js → chunk-THSKCKAQ.js} +1 -1
  170. package/dist/chunk-TLE6VHMJ.js +8 -0
  171. package/dist/{chunk-PDXOGPWH.js → chunk-TOSUM2OI.js} +1 -1
  172. package/dist/{chunk-SEP35R2E.js → chunk-TVRKONNH.js} +1 -1
  173. package/dist/{chunk-3OHADZYV.js → chunk-U24GFE5L.js} +1 -1
  174. package/dist/{chunk-QAIMZN7M.js → chunk-UDVUVFRS.js} +10 -10
  175. package/dist/{chunk-PVOTOUJG.js → chunk-UIOKWFT4.js} +1 -1
  176. package/dist/chunk-UMFEOZ75.js +4 -0
  177. package/dist/{chunk-IUMFOSFJ.js → chunk-UNJWYV6V.js} +3 -3
  178. package/dist/chunk-UYNFTF6L.js +2 -0
  179. package/dist/{chunk-IGQZANYE.js → chunk-VI4NLOVJ.js} +11 -11
  180. package/dist/{chunk-VU5P4ZM5.js → chunk-VNAOZVSM.js} +13 -13
  181. package/dist/{chunk-OXCFRH33.js → chunk-VOXX4LNC.js} +1 -1
  182. package/dist/{chunk-63545Z3N.js → chunk-VPGQMNW3.js} +1 -1
  183. package/dist/{chunk-GRC46C4V.js → chunk-W4UYDSTI.js} +7 -7
  184. package/dist/{chunk-CJH2BGXY.js → chunk-WGLHB6WE.js} +1 -1
  185. package/dist/{chunk-ALJS3SYS.js → chunk-WPCNJ4UL.js} +1 -1
  186. package/dist/chunk-WRJP33DN.js +6 -0
  187. package/dist/{chunk-NTUZT37J.js → chunk-WRRMZAKK.js} +4 -4
  188. package/dist/chunk-WVIUU4BZ.js +13 -0
  189. package/dist/{chunk-RMSF4UCJ.js → chunk-X3NYVMXJ.js} +1 -1
  190. package/dist/chunk-XNFZLSWW.js +7 -0
  191. package/dist/{chunk-FFNPAJLS.js → chunk-XZ2WQNOX.js} +9 -9
  192. package/dist/chunk-XZU24YKP.js +13 -0
  193. package/dist/chunk-Y3SVPBUT.js +7 -0
  194. package/dist/{chunk-YOXR3VKO.js → chunk-YAZENY3X.js} +1 -1
  195. package/dist/{chunk-FRH2AHPI.js → chunk-YESTUDOK.js} +1 -1
  196. package/dist/{chunk-A4YTWDKD.js → chunk-YIV7CFBG.js} +2 -2
  197. package/dist/{chunk-3X2W7R5B.js → chunk-YJOJ5MUZ.js} +11 -11
  198. package/dist/chunk-YN5K72D6.js +5 -0
  199. package/dist/chunk-YQEGMCSX.js +9 -0
  200. package/dist/{chunk-CG5X5ZLV.js → chunk-YXOFUY4J.js} +1 -1
  201. package/dist/{chunk-6C6M3QXL.js → chunk-ZHFKBWBU.js} +1 -1
  202. package/dist/chunk-ZITMPMUT.js +2 -0
  203. package/dist/{chunk-B2SLXCMY.js → chunk-ZKYBLZPT.js} +8 -8
  204. package/dist/{chunk-DANLBFBD.js → chunk-ZRLWE3JM.js} +1 -1
  205. package/dist/{chunk-IUG4Z2ND.js → chunk-ZU3BD75E.js} +1 -1
  206. package/dist/{chunk-PVVHWLNX.js → chunk-ZU432XW4.js} +1 -1
  207. package/dist/{chunk-5UCRYSQJ.js → chunk-ZYDRBF3H.js} +5 -5
  208. package/dist/{chunk-2ZAFRGRF.js → chunk-ZYJAZ5HH.js} +1 -1
  209. package/dist/data/DataTable.js +1 -1
  210. package/dist/data/EntityList.js +1 -1
  211. package/dist/data/Kanban.js +1 -1
  212. package/dist/data/ListFooter.js +1 -1
  213. package/dist/data/ListLoadError.js +1 -1
  214. package/dist/data/Pagination.js +1 -1
  215. package/dist/data/ResizableTable.js +1 -1
  216. package/dist/file-intake/index.js +1 -1
  217. package/dist/forms/AlignmentGrid.js +1 -1
  218. package/dist/forms/BorderInput.js +1 -1
  219. package/dist/forms/BrandAssetEditor.js +1 -1
  220. package/dist/forms/Button.js +1 -1
  221. package/dist/forms/Calendar.js +1 -1
  222. package/dist/forms/ColorPicker.js +1 -1
  223. package/dist/forms/ComposerAttachments.js +1 -1
  224. package/dist/forms/CornersInput.js +1 -1
  225. package/dist/forms/DatePicker.js +1 -1
  226. package/dist/forms/DateRangePicker.js +1 -1
  227. package/dist/forms/DateTimePicker.js +1 -1
  228. package/dist/forms/DisplayChips.js +1 -1
  229. package/dist/forms/FilePicker.js +1 -1
  230. package/dist/forms/FormErrorSummary.js +1 -1
  231. package/dist/forms/IconButton.js +1 -1
  232. package/dist/forms/IconPicker.js +1 -1
  233. package/dist/forms/ImageFocusPoint.js +1 -1
  234. package/dist/forms/Input.js +1 -1
  235. package/dist/forms/InputNumber.js +1 -1
  236. package/dist/forms/LinkPicker.js +1 -1
  237. package/dist/forms/MediaLibrary.js +1 -1
  238. package/dist/forms/MediaUploadField.js +1 -1
  239. package/dist/forms/MediaUploadGrid.js +1 -1
  240. package/dist/forms/MediaUsedInList.js +1 -1
  241. package/dist/forms/NumericKeypad.js +1 -1
  242. package/dist/forms/PictureTiles.js +1 -1
  243. package/dist/forms/PositionInput.js +1 -1
  244. package/dist/forms/RenameField.js +1 -1
  245. package/dist/forms/Segmented.js +1 -1
  246. package/dist/forms/Select.js +1 -1
  247. package/dist/forms/SidesInput.js +1 -1
  248. package/dist/forms/Slider.js +1 -1
  249. package/dist/forms/Snippet.js +1 -1
  250. package/dist/forms/SplitButton.js +1 -1
  251. package/dist/forms/TagInput.js +1 -1
  252. package/dist/forms/TextToolbar.js +1 -1
  253. package/dist/forms/TimePicker.js +1 -1
  254. package/dist/forms/WidthsBar.js +1 -1
  255. package/dist/forms/mediaLibraryMenu.js +1 -1
  256. package/dist/forms/mediaMoveItems.js +1 -1
  257. package/dist/forms/textAlign.js +1 -1
  258. package/dist/forms/useFileIntake.js +1 -1
  259. package/dist/icons/index.js +1 -1
  260. package/dist/index.js +666 -666
  261. package/dist/locales/zh-Hans.js +1 -1
  262. package/dist/map/index.js +3 -3
  263. package/dist/markdown/index.js +1 -1
  264. package/dist/page-tabs/index.js +5 -5
  265. package/dist/pdf/index.js +1 -1
  266. package/dist/shell/Accordion.js +1 -1
  267. package/dist/shell/AppUpdateBanner.js +1 -1
  268. package/dist/shell/Avatar.js +1 -1
  269. package/dist/shell/Banner.js +1 -1
  270. package/dist/shell/Breadcrumbs.js +1 -1
  271. package/dist/shell/BudgetBar.js +1 -1
  272. package/dist/shell/Card.js +1 -1
  273. package/dist/shell/ColoredBadge.js +1 -1
  274. package/dist/shell/ConfirmDialog.js +1 -1
  275. package/dist/shell/ContainerFillChart.js +1 -1
  276. package/dist/shell/ContextMenu.js +1 -1
  277. package/dist/shell/CountBadge.js +1 -1
  278. package/dist/shell/Dialog.js +1 -1
  279. package/dist/shell/Drawer.js +1 -1
  280. package/dist/shell/DropdownMenu.js +1 -1
  281. package/dist/shell/EditableGrid.js +1 -1
  282. package/dist/shell/EmptyState.js +1 -1
  283. package/dist/shell/GlobalSearch.js +1 -1
  284. package/dist/shell/HelpCenter.js +1 -1
  285. package/dist/shell/IconRail.js +1 -1
  286. package/dist/shell/ImageLightbox.js +1 -1
  287. package/dist/shell/ItemCount.js +1 -1
  288. package/dist/shell/LanguageSelect.js +1 -1
  289. package/dist/shell/Markdown.js +1 -1
  290. package/dist/shell/MetricBar.js +1 -1
  291. package/dist/shell/MetricBarLegend.js +1 -1
  292. package/dist/shell/MilestoneTimeline.js +1 -1
  293. package/dist/shell/PageHeader.js +1 -1
  294. package/dist/shell/PopupMenu.js +1 -1
  295. package/dist/shell/ProductionTimeline.js +1 -1
  296. package/dist/shell/ResizeHandle.js +1 -1
  297. package/dist/shell/Result.js +1 -1
  298. package/dist/shell/SearchableSelect.js +1 -1
  299. package/dist/shell/SettingReset.js +1 -1
  300. package/dist/shell/SettingRow.js +1 -1
  301. package/dist/shell/SidebarLayout.js +1 -1
  302. package/dist/shell/SidebarNav.js +1 -1
  303. package/dist/shell/SortableList.js +1 -1
  304. package/dist/shell/Statistic.js +1 -1
  305. package/dist/shell/StatusBadge.js +1 -1
  306. package/dist/shell/StepChain.js +1 -1
  307. package/dist/shell/Stepper.js +1 -1
  308. package/dist/shell/Tabs.js +1 -1
  309. package/dist/shell/TimeAgo.js +1 -1
  310. package/dist/shell/TimelineTrack.js +1 -1
  311. package/dist/shell/Tooltip.js +1 -1
  312. package/dist/shell/TopNav.js +1 -1
  313. package/dist/shell/TransferProgress.js +1 -1
  314. package/dist/shell/Tree.js +1 -1
  315. package/dist/shell/discardGuard.js +1 -1
  316. package/dist/shell/language.js +1 -1
  317. package/dist/shell/strings.d.ts +0 -265
  318. package/dist/shell/strings.js +1 -1
  319. package/dist/shell/toast.js +1 -1
  320. package/dist/shell.css +1 -12
  321. package/dist/telemetry/index.js +1 -1
  322. package/dist/templates/AuthScreen.js +1 -1
  323. package/dist/templates/ChatTemplate.js +1 -1
  324. package/dist/templates/CheckoutTemplate.js +1 -1
  325. package/dist/templates/DashboardTemplate.js +1 -1
  326. package/dist/templates/DataTablePage.js +1 -1
  327. package/dist/templates/EmailTemplate.js +1 -1
  328. package/dist/templates/ErrorBoundary.js +1 -1
  329. package/dist/templates/ErrorPage.js +1 -1
  330. package/dist/templates/FormLayoutPage.js +1 -1
  331. package/dist/templates/GalleryTemplate.js +1 -1
  332. package/dist/ui/index.js +1 -1
  333. package/dist/version.js +1 -1
  334. package/package.json +3 -8
  335. package/dist/Calculator-YZEGVEQ7.js +0 -29
  336. package/dist/Documents-FIGKS36O.js +0 -84
  337. package/dist/Files-FPNJ46XY.js +0 -88
  338. package/dist/PdfViewer-M4RTCNNE.js +0 -1
  339. package/dist/Sidebar-QP5Y7RBV.js +0 -44
  340. package/dist/Spreadsheet-RQE4OCEK.js +0 -75
  341. package/dist/chunk-2E3K4FSQ.js +0 -13
  342. package/dist/chunk-2EPAXWZZ.js +0 -14
  343. package/dist/chunk-2HAJ33HM.js +0 -9
  344. package/dist/chunk-2NRNKF46.js +0 -9
  345. package/dist/chunk-2XOH3NJZ.js +0 -27
  346. package/dist/chunk-3VR5BOD4.js +0 -8
  347. package/dist/chunk-5YP7MFPK.js +0 -1
  348. package/dist/chunk-6FIYG7IH.js +0 -28
  349. package/dist/chunk-6R32KKIS.js +0 -22
  350. package/dist/chunk-7DI3VQCF.js +0 -2
  351. package/dist/chunk-B2MD232O.js +0 -6
  352. package/dist/chunk-BDUXF7BT.js +0 -4
  353. package/dist/chunk-EC22ACQZ.js +0 -11
  354. package/dist/chunk-FJBJUFD7.js +0 -4
  355. package/dist/chunk-GO6HU2O3.js +0 -7
  356. package/dist/chunk-H56TNUV4.js +0 -1
  357. package/dist/chunk-KU4IWX6F.js +0 -2
  358. package/dist/chunk-MQ445O4X.js +0 -6
  359. package/dist/chunk-MQE2FBJU.js +0 -7
  360. package/dist/chunk-NMTS2L2B.js +0 -8
  361. package/dist/chunk-ODQYWMDF.js +0 -3
  362. package/dist/chunk-OPZXVXX5.js +0 -7
  363. package/dist/chunk-OZM6DE7A.js +0 -8
  364. package/dist/chunk-R7KRBKFH.js +0 -5
  365. package/dist/chunk-RQBQETXQ.js +0 -11
  366. package/dist/chunk-S43DAIIB.js +0 -9
  367. package/dist/chunk-SCZUDGRZ.js +0 -2
  368. package/dist/chunk-SUYQ7QYB.js +0 -13
  369. package/dist/chunk-TXKTITMF.js +0 -8
  370. package/dist/chunk-UG42KUCT.js +0 -9
  371. package/dist/chunk-VEZHFONL.js +0 -9
  372. package/dist/chunk-VTVSMRFX.js +0 -1
@@ -0,0 +1,8 @@
1
+ import{DragBand as e,tooltipBesideBand as t}from"./chunk-CFJL6MML.js";import{niceAxis as r,niceMax as i,linearScale as n,axisGutter as o,bandScale as l}from"./chunk-2JWPNR2U.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{CHART_INK as h}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-MBY5JIGB.js";import{formatPlain as d}from"./chunk-C3QOHMR6.js";import{useRef as u,useState as f,useId as g,useEffect as p}from"react";import{jsx as x,jsxs as y}from"react/jsx-runtime";function v({labels:v,values:M,height:b=220,width:k,bandPadding:w=.24,min:N,max:A,yTickCount:$=4,formatValue:j,yAxisLabel:P,xTickAnchor:E="center",children:L,overlay:R,tooltip:U,onSelect:z,zoom:C,ariaLabel:D,className:F,emptyLabel:I}){const S=c().charts,B=m(),T=j??(e=>d(e,B)),V=I??S.noData,W=u(null),J=a(W),Q=k??J,[Z,G]=f(null),H=g();if(p(()=>{if(null!==Z)return s(e=>"Escape"===e.key&&(G(null),!0))},[Z]),0===v.length||!M.some(Number.isFinite))/* @__PURE__ */
2
+ return x("div",{className:F,ref:W,children:/* @__PURE__ */x("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:b},children:V})});const K=M.filter(Number.isFinite),O=K.every(Number.isInteger),X=void 0===N&&void 0===A?r(Math.min(0,...K),Math.max(0,...K),{intervals:$+1,integer:O}):null,Y=void 0!==N&&void 0===A?r(N,Math.max(N,...K),{intervals:$+1,integer:O,zero:!1}):null,q=X?X.lo:N??Math.min(0,...K),_=X?X.hi:Y?Y.hi:A??i(Math.max(...K,0)),ee=X?X.ticks:Y?[q,...Y.ticks.filter(e=>e>q)]:n([q,_],{from:0,to:1}).ticks($+1),te={top:12,right:16,bottom:26,left:o(ee.map(T),48)+(P?10:0)},re=te.left,ie=Math.max(re+1,Q-te.right),ne=te.top,oe=b-te.bottom,le=n([q,_],{from:oe,to:ne}),ae=l(v.length,{from:re,to:ie},w),he=(ie-re)/Math.max(1,v.length),se=he>=48,ce=se?1:Math.max(1,Math.ceil(v.length/Math.max(1,Math.floor(Q/84)))),me=Math.max(2,Math.floor((he-6)/6.6)),de=e=>se&&e.length>me?`${e.slice(0,me-1).trimEnd()}…`:e;/* @__PURE__ */
3
+ return y("div",{className:`relative ${F??""}`,ref:W,children:[
4
+ /* @__PURE__ */y("svg",{width:"100%",height:b,viewBox:`0 0 ${Q} ${b}`,role:"img","aria-label":D,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>G(null),onBlur:()=>G(null),onKeyDown:e=>{if(z&&null!==Z&&("Enter"===e.key||" "===e.key))return e.preventDefault(),void z(Z);if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1;G(e=>Math.min(v.length-1,Math.max(0,(e??0)+t)))},style:C?{userSelect:"none",touchAction:"pan-y"}:void 0,children:[
5
+ /* @__PURE__ */x("defs",{children:/* @__PURE__ */x("clipPath",{id:H,children:/* @__PURE__ */x("rect",{x:re,y:ne,width:ie-re,height:oe-ne})})}),ee.map(e=>/* @__PURE__ */x("line",{x1:re,y1:le(e),x2:ie,y2:le(e),stroke:h.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
6
+ /* @__PURE__ */x("line",{x1:re,y1:le(Math.max(q,0)),x2:ie,y2:le(Math.max(q,0)),stroke:h.axis,strokeWidth:1,shapeRendering:"crispEdges"}),ee.map(e=>/* @__PURE__ */x("text",{x:re-8,y:le(e)+4,textAnchor:"end",fontSize:11,fill:h.label,style:{fontVariantNumeric:"tabular-nums"},children:T(e)},`t${e}`)),P&&/* @__PURE__ */x("text",{x:14,y:(ne+oe)/2,transform:`rotate(-90 14 ${(ne+oe)/2})`,textAnchor:"middle",fontSize:11,fill:h.label,children:P}),
7
+ /* @__PURE__ */x("g",{clipPath:`url(#${H})`,children:L({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:Q,height:b,clipId:H,active:Z})}),R?.({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:Q,height:b,clipId:H,active:Z}),v.map((e,t)=>t%ce===0?/* @__PURE__ */x("text",{x:"start"===E?ae(t):ae.center(t),y:b-8,textAnchor:"middle",fontSize:11,fill:h.label,style:{fontVariantNumeric:"tabular-nums"},children:de(e)},`x${t}`):null),C?.drag&&/* @__PURE__ */x(e,{x0:ae.center(C.drag[0])-(ie-re)/v.length/2,x1:ae.center(C.drag[1])+(ie-re)/v.length/2,top:ne,bottom:oe}),v.map((e,t)=>/* @__PURE__ */x("rect",{x:ae.center(t)-(ie-re)/v.length/2,y:ne,width:(ie-re)/v.length,height:oe-ne,fill:"transparent",onMouseEnter:()=>G(t),onPointerDown:C?()=>C.press(t):void 0,onPointerEnter:C?()=>C.over(t):void 0,onPointerUp:C?.release,onClick:z?()=>z(t):void 0,style:z?{cursor:"pointer"}:void 0},`h${t}`))]}),U&&null!==Z&&
8
+ /* @__PURE__ */x("div",{className:"pointer-events-none absolute top-2 z-10",style:t(ae.center(Z),ae.bandwidth,Q),children:U(Z)})]})}export{v as CartesianPlot};
@@ -0,0 +1,8 @@
1
+ import{optionMatches as e,OptionSublabel as t}from"./chunk-LJN77RG6.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-FZM3ZPW3.js";import{Tooltip as r}from"./chunk-NJN5IKWO.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as s,POPUP_MAX_WIDTH as a,MENU_MAX_HEIGHT as c}from"./chunk-GLUJS42B.js";import{glassStyle as u}from"./chunk-5FYDNH4Y.js";import{useShellStrings as d}from"./chunk-MBY5JIGB.js";import{useState as m,useRef as h,useMemo as p,useEffect as f}from"react";import{createPortal as v}from"react-dom";import{jsxs as g,jsx as x,Fragment as b}from"react/jsx-runtime";var w={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-accent-tint px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${o.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function y({value:o,onChange:y,options:k=[],placeholder:N,allowFreeText:j=!1,invalid:C,disabled:L,id:D,className:W="",tone:M,tooltip:Y,split:B}){const[E,J]=m(!1),[$,F]=m(""),G=d(),I=h(null),H=h(null),S=h(null),Z=s(I,E),K=e=>k.find(t=>t.value===e)?.label??e,P=p(()=>{const t=new Set(o),n=[],r=$.trim().toLowerCase();for(const o of k)t.has(o.value)||(t.add(o.value),r&&!e(o,r)||n.push(o));return n},[k,o,$]),T=e=>{const t=[...o];for(const n of e){const e=n.trim();if(!e)continue;const o=e.toLowerCase(),r=k.find(t=>t.value===e||t.label.toLowerCase()===o)?.value,l=r??(j?e:null);l&&!t.includes(l)&&t.push(l)}t.length!==o.length&&y(t)},z=e=>{e&&!o.includes(e)?(y([...o,e]),F("")):F("")},A=e=>y(o.filter(t=>t!==e)),O=()=>{const e=$.trim();if(B&&e)return T(e.split(B)),void F("");j&&e?z(e):F("")},R=h(()=>{});R.current=()=>{O(),J(!1)},f(()=>{if(!E)return;const e=e=>{const t=e.target;I.current?.contains(t)||S.current?.contains(t)||(O(),J(!1))};document.addEventListener("mousedown",e);const t=l(()=>R.current());return()=>{document.removeEventListener("mousedown",e),t()}});const U=k.length>0;/* @__PURE__ */
2
+ return g("div",{ref:I,className:"relative",children:[
3
+ /* @__PURE__ */g("div",{onMouseDown:e=>{L||e.target.closest("button")||(e.preventDefault(),H.current?.focus())},className:n({invalid:C,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${L?"bg-gray-50 cursor-not-allowed":""} ${W}`}),children:[o.map(e=>{const t=M?.(e),n=w[t??"accent"],o=/* @__PURE__ */g("span",{"data-tone":t,className:n.chip,children:[
4
+ /* @__PURE__ */x("span",{className:"truncate",children:K(e)}),!L&&/* @__PURE__ */x("button",{type:"button","aria-label":G.select.removeItem?.(K(e))??`${G.select.remove} ${K(e)}`,onClick:()=>A(e),className:n.remove,children:"×"})]},e),l=Y?.(e);return null==l?o:/* @__PURE__ */x(r,{content:l,className:"relative inline-flex max-w-full",children:o},e)}),
5
+ /* @__PURE__ */x("input",{id:D,ref:H,type:"text",autoComplete:"off",role:"combobox","aria-expanded":E&&U,"aria-invalid":C||void 0,disabled:L,value:$,placeholder:0===o.length?N:void 0,onChange:e=>{(e=>{if(B){const t=e.split(B);if(t.length>1)return T(t.slice(0,-1)),void F(t[t.length-1])}F(e)})(e.target.value),J(!0)},onFocus:()=>{!L&&U&&J(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=$.trim(),o=n?P.filter(t=>e(t,n.toLowerCase())):[];1===o.length?z(o[0].value):O()}else"Backspace"===t.key&&""===$&&o.length>0?A(o[o.length-1]):"Escape"===t.key?(J(!1),F(""),H.current?.blur()):"Tab"===t.key&&(O(),J(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-ink-strong placeholder:text-[color:var(--ink-placeholder)] rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),E&&U&&v(
6
+ /* @__PURE__ */x("div",{ref:S,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:Z?.left,right:Z?.right,top:Z?.top,bottom:Z?.bottom,minWidth:Z?.minWidth,maxWidth:Z?.maxWidth??a,width:"max-content",visibility:Z?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:Z?.maxHeight??c},children:0===P.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&o.length>=k.length?G.select.allSelected:G.select.noMatches}):P.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),z(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-row-hover text-ink whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-row-hover text-ink whitespace-nowrap",children:e.sublabel?/* @__PURE__ */g(b,{children:[
7
+ /* @__PURE__ */x("span",{className:"min-w-0 truncate",children:e.label}),
8
+ /* @__PURE__ */x(t,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}export{y as TagInput};
@@ -1 +1 @@
1
- import{useShellLocale as e}from"./chunk-5YP7MFPK.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{jsx as r,jsxs as n}from"react/jsx-runtime";var i={danger:"bg-red-600 text-white",neutral:"bg-gray-600 text-white",accent:"bg-blue-600 text-white"};function a({count:a=0,max:l=99,dot:s=!1,tone:o="danger",showZero:c=!1,children:m,className:u=""}){const h=s||a>0||0===a&&c,d=e(),x=a>l?`${t(l,d)}+`:t(a,d),f=m?"":u,g=h?/* @__PURE__ */r("span",s?{className:`block h-2.5 w-2.5 rounded-full ring-2 ring-white ${i[o]} ${f}`.trim(),"aria-hidden":m?"true":void 0}:{className:`flex h-5 min-w-[1.25rem] items-center justify-center whitespace-nowrap rounded-full px-1 text-xs font-semibold tabular-nums ring-2 ring-white ${i[o]} ${f}`.trim(),children:x}):null;return m?/* @__PURE__ */n("span",{className:`relative inline-flex ${u}`.trim(),children:[m,g&&/* @__PURE__ */r("span",{className:"absolute -right-1.5 -top-1.5 flex",children:g})]}):g}export{a as CountBadge};
1
+ import{useShellLocale as e}from"./chunk-MBY5JIGB.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{jsx as r,jsxs as n}from"react/jsx-runtime";var i={danger:"bg-red-600 text-white",neutral:"bg-gray-600 text-white",accent:"bg-blue-600 text-white"};function a({count:a=0,max:l=99,dot:s=!1,tone:o="danger",showZero:c=!1,children:m,className:u=""}){const h=s||a>0||0===a&&c,d=e(),x=a>l?`${t(l,d)}+`:t(a,d),f=m?"":u,g=h?/* @__PURE__ */r("span",s?{className:`block h-2.5 w-2.5 rounded-full ring-2 ring-white ${i[o]} ${f}`.trim(),"aria-hidden":m?"true":void 0}:{className:`flex h-5 min-w-[1.25rem] items-center justify-center whitespace-nowrap rounded-full px-1 text-xs font-semibold tabular-nums ring-2 ring-white ${i[o]} ${f}`.trim(),children:x}):null;return m?/* @__PURE__ */n("span",{className:`relative inline-flex ${u}`.trim(),children:[m,g&&/* @__PURE__ */r("span",{className:"absolute -right-1.5 -top-1.5 flex",children:g})]}):g}export{a as CountBadge};
@@ -1,4 +1,4 @@
1
- import{onOverlayOpen as t}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as e}from"./chunk-62LW225J.js";import{followAnchor as r,popupBounds as o,VIEWPORT_MARGIN as n,showingBox as i,placeBeside as a,placeArrow as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as s,escapeSurfaceAbove as d}from"./chunk-TWVUQUUD.js";import{solidSurfaceStyle as h}from"./chunk-5FYDNH4Y.js";import{createContext as m,useContext as u,useState as p,useRef as f,useId as x,useEffect as w,isValidElement as g,cloneElement as b}from"react";import{createPortal as v}from"react-dom";import{jsxs as y,jsx as k}from"react/jsx-runtime";var j=m(!1),H=()=>u(j),W={top:"bottom-full left-1/2 -translate-x-1/2 mb-3",bottom:"top-full left-1/2 -translate-x-1/2 mt-3",left:"right-full top-1/2 -translate-y-1/2 mr-3",right:"left-full top-1/2 -translate-y-1/2 ml-3"};function N({content:m,side:u="top",delay:H=200,children:N,className:B="relative inline-flex",describe:T=!0,open:M}){const[D,U]=p(!1),z=(M??D)&&!(null==m||!1===m||""===m),[C,E]=p(null),J=f(void 0),L=f(null),P=f(null),$=x(),F=f(!1),G=()=>{window.clearTimeout(J.current),F.current||(J.current=window.setTimeout(()=>U(!0),H))},R=()=>{window.clearTimeout(J.current),U(!1)},Y=()=>{F.current=!0,R()},I=()=>{F.current=!1,R()};w(()=>()=>window.clearTimeout(J.current),[]),c(()=>{if(!z)return void E(null);const t=()=>{const t=L.current,e=P.current;if(!t||!e)return;const r=o(t),c=Math.max(0,r.right-r.left-2*n),s=Math.max(0,r.bottom-r.top-2*n);e.style.maxWidth=`${c}px`,e.style.maxHeight=`${s}px`;const d=e.getBoundingClientRect();if(d.width<=0||d.height<=0)return;const h=t.getBoundingClientRect();if(!i(t))return void R();const m=a(h,d,u,r,12),p=l(h,m,d,16,6),f={anchor:{left:h.left,top:h.top,width:h.width,height:h.height},left:m.left-h.left,top:m.top-h.top,maxWidth:c,maxHeight:s,side:m.side,arrow:p&&{left:p.x-h.left,top:p.y-h.top}};E(t=>{return t&&(r=f,(e=t).anchor.left===r.anchor.left&&e.anchor.top===r.anchor.top&&e.anchor.width===r.anchor.width&&e.anchor.height===r.anchor.height&&e.left===r.left&&e.top===r.top&&e.maxWidth===r.maxWidth&&e.maxHeight===r.maxHeight&&e.side===r.side&&e.arrow?.left===r.arrow?.left&&e.arrow?.top===r.arrow?.top)?t:f;var e,r})};return t(),r(()=>L.current,t)},[z,u,m]),w(()=>{if(!z)return;const e=s(t=>"Escape"===t.key&&(R(),!d(L.current))),r=t(R);return()=>{e(),r()}},[z]);const Q=z&&T?$:void 0,S=g(N)?b(N,{"aria-describedby":[N.props["aria-describedby"],Q].filter(Boolean).join(" ")||void 0}):N,V=z?h():void 0;/* @__PURE__ */
1
+ import{onOverlayOpen as t}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as e}from"./chunk-62LW225J.js";import{followAnchor as r,popupBounds as o,VIEWPORT_MARGIN as n,showingBox as i,placeBeside as a,placeArrow as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{solidSurfaceStyle as s}from"./chunk-5FYDNH4Y.js";import{registerModalEscapeInterceptor as d,escapeSurfaceAbove as h}from"./chunk-TWVUQUUD.js";import{createContext as m,useContext as u,useState as p,useRef as f,useId as x,useEffect as w,isValidElement as g,cloneElement as b}from"react";import{createPortal as v}from"react-dom";import{jsxs as y,jsx as k}from"react/jsx-runtime";var j=m(!1),H=()=>u(j),W={top:"bottom-full left-1/2 -translate-x-1/2 mb-3",bottom:"top-full left-1/2 -translate-x-1/2 mt-3",left:"right-full top-1/2 -translate-y-1/2 mr-3",right:"left-full top-1/2 -translate-y-1/2 ml-3"};function N({content:m,side:u="top",delay:H=200,children:N,className:B="relative inline-flex",describe:T=!0,open:M}){const[D,U]=p(!1),z=(M??D)&&!(null==m||!1===m||""===m),[C,E]=p(null),J=f(void 0),L=f(null),P=f(null),$=x(),F=f(!1),G=()=>{window.clearTimeout(J.current),F.current||(J.current=window.setTimeout(()=>U(!0),H))},R=()=>{window.clearTimeout(J.current),U(!1)},Y=()=>{F.current=!0,R()},I=()=>{F.current=!1,R()};w(()=>()=>window.clearTimeout(J.current),[]),c(()=>{if(!z)return void E(null);const t=()=>{const t=L.current,e=P.current;if(!t||!e)return;const r=o(t),c=Math.max(0,r.right-r.left-2*n),s=Math.max(0,r.bottom-r.top-2*n);e.style.maxWidth=`${c}px`,e.style.maxHeight=`${s}px`;const d=e.getBoundingClientRect();if(d.width<=0||d.height<=0)return;const h=t.getBoundingClientRect();if(!i(t))return void R();const m=a(h,d,u,r,12),p=l(h,m,d,16,6),f={anchor:{left:h.left,top:h.top,width:h.width,height:h.height},left:m.left-h.left,top:m.top-h.top,maxWidth:c,maxHeight:s,side:m.side,arrow:p&&{left:p.x-h.left,top:p.y-h.top}};E(t=>{return t&&(r=f,(e=t).anchor.left===r.anchor.left&&e.anchor.top===r.anchor.top&&e.anchor.width===r.anchor.width&&e.anchor.height===r.anchor.height&&e.left===r.left&&e.top===r.top&&e.maxWidth===r.maxWidth&&e.maxHeight===r.maxHeight&&e.side===r.side&&e.arrow?.left===r.arrow?.left&&e.arrow?.top===r.arrow?.top)?t:f;var e,r})};return t(),r(()=>L.current,t)},[z,u,m]),w(()=>{if(!z)return;const e=d(t=>"Escape"===t.key&&(R(),!h(L.current))),r=t(R);return()=>{e(),r()}},[z]);const Q=z&&T?$:void 0,S=g(N)?b(N,{"aria-describedby":[N.props["aria-describedby"],Q].filter(Boolean).join(" ")||void 0}):N,V=z?s():void 0;/* @__PURE__ */
2
2
  return y("span",{ref:L,className:B,"aria-describedby":g(N)?void 0:Q,onMouseEnter:G,onMouseLeave:I,onFocus:t=>{let e=!0;try{e=t.target.matches(":focus-visible")}catch{}e&&G()},onBlur:I,onPointerDown:Y,onClick:Y,children:[
3
3
  /* @__PURE__ */k(j.Provider,{value:!0,children:S}),z&&v(
4
4
  /* @__PURE__ */y("span",{className:"pointer-events-none fixed left-0 top-0",style:{zIndex:e.hint,...C?.anchor},children:[
@@ -1,10 +1,10 @@
1
- import{LoadingSpinner as e}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as t,useShellLocale as r}from"./chunk-5YP7MFPK.js";import{formatPlain as a}from"./chunk-C3QOHMR6.js";import{useState as o,useMemo as l,useRef as i,Fragment as s}from"react";import{jsx as d,Fragment as c,jsxs as u}from"react/jsx-runtime";function m({items:m,columns:f,columnOf:p,getId:g,onMove:h,renderCard:x,onCardClick:b,sortInColumn:y,isLoading:v=!1,loadingText:N,emptyState:k,showColumnsWhenEmpty:w=!1,columnEmptyText:C,onAddItem:D,addItemText:E}){const j=t().kanban,I=r(),M=N??j.loading,T=C??j.dropHere,A=E??j.addItem,[H,O]=o(null),[$,F]=o(null),P=l(()=>{const e={};for(const n of f)e[n.value]=[];for(const n of m)(e[p(n)]??=[]).push(n);if(y)for(const n of Object.keys(e))e[n].sort(y);return e},[m,f,p,y]),R=()=>{O(null),F(null)},S=i(null),q=i(/* @__PURE__ */new Map);n(()=>{if(null!==H)return;const e=S.current;if(!e)return;const n=/* @__PURE__ */new Map,t=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const r=e.dataset.kanbanCard,a=e.getBoundingClientRect();n.set(r,a);const o=q.current.get(r);if(o){const n=o.left-a.left,r=o.top-a.top;(n||r)&&t.push([e,n,r])}}),q.current=n,t.length){for(const[e,n,r]of t)e.style.transition="none",e.style.transform=`translate(${n}px, ${r}px)`;requestAnimationFrame(()=>{for(const[e]of t)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[P,H]);return v?/* @__PURE__ */d(e,{size:"sm",padding:"p-4",label:M}):0!==m.length||w?/* @__PURE__ */d("div",{ref:S,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */d("div",{className:"flex gap-3 h-full min-w-max pb-2",children:f.map(e=>{const n=P[e.value]??[],t=null!==$&&$.col===e.value,r=null!==H?n.findIndex(e=>g(e)===H):-1,o=t&&(-1===r||$.index!==r&&$.index!==r+1)?$.index:-1;/* @__PURE__ */
2
- return u("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(t?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:n=>{n.preventDefault(),(e=>{if(H&&$&&$.col===e){const n=(P[e]??[]).findIndex(e=>g(e)===H),t=-1!==n;if(!t||$.index!==n&&$.index!==n+1){const r=t&&$.index>n?$.index-1:$.index;h(H,e,r)}}R()})(e.value)},children:[
1
+ import{LoadingSpinner as e}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as t,useShellLocale as r}from"./chunk-MBY5JIGB.js";import{formatPlain as a}from"./chunk-C3QOHMR6.js";import{useState as o,useMemo as l,useRef as i,Fragment as s}from"react";import{jsx as d,Fragment as c,jsxs as u}from"react/jsx-runtime";function m({items:m,columns:f,columnOf:p,getId:g,onMove:h,renderCard:x,onCardClick:b,sortInColumn:y,isLoading:v=!1,loadingText:N,emptyState:k,showColumnsWhenEmpty:w=!1,columnEmptyText:C,onAddItem:D,addItemText:E}){const I=t().kanban,j=r(),M=N??I.loading,T=C??I.dropHere,A=E??I.addItem,[H,O]=o(null),[$,B]=o(null),R=l(()=>{const e={};for(const n of f)e[n.value]=[];for(const n of m)(e[p(n)]??=[]).push(n);if(y)for(const n of Object.keys(e))e[n].sort(y);return e},[m,f,p,y]),S=()=>{O(null),B(null)},q=i(null),z=i(/* @__PURE__ */new Map);n(()=>{if(null!==H)return;const e=q.current;if(!e)return;const n=/* @__PURE__ */new Map,t=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const r=e.dataset.kanbanCard,a=e.getBoundingClientRect();n.set(r,a);const o=z.current.get(r);if(o){const n=o.left-a.left,r=o.top-a.top;(n||r)&&t.push([e,n,r])}}),z.current=n,t.length){for(const[e,n,r]of t)e.style.transition="none",e.style.transform=`translate(${n}px, ${r}px)`;requestAnimationFrame(()=>{for(const[e]of t)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[R,H]);return v?/* @__PURE__ */d(e,{size:"sm",padding:"p-4",label:M}):0!==m.length||w?/* @__PURE__ */d("div",{ref:q,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */d("div",{className:"flex gap-3 h-full min-w-max pb-2",children:f.map(e=>{const n=R[e.value]??[],t=null!==$&&$.col===e.value,r=null!==H?n.findIndex(e=>g(e)===H):-1,o=t&&(-1===r||$.index!==r&&$.index!==r+1)?$.index:-1;/* @__PURE__ */
2
+ return u("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(t?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:n=>{n.preventDefault(),(e=>{if(H&&$&&$.col===e){const n=(R[e]??[]).findIndex(e=>g(e)===H),t=-1!==n;if(!t||$.index!==n&&$.index!==n+1){const r=t&&$.index>n?$.index-1:$.index;h(H,e,r)}}S()})(e.value)},children:[
3
3
  /* @__PURE__ */u("div",{className:`flex items-center justify-between px-3 py-2 rounded-t-xl text-sm font-medium ${e.accent??"text-gray-700 bg-gray-100"}`,children:[
4
4
  /* @__PURE__ */u("span",{className:"flex items-center gap-2",children:[
5
5
  /* @__PURE__ */d("span",{className:`h-2 w-2 rounded-full ${e.dot??"bg-gray-400"}`}),e.label]}),
6
- /* @__PURE__ */d("span",{className:"text-xs opacity-70",children:a(n.length,I)})]}),
7
- /* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>F(t=>t&&t.col===e.value&&t.index===n.length?t:{col:e.value,index:n.length}),children:[n.map((t,r)=>{const a=g(t),l=a===H;/* @__PURE__ */
6
+ /* @__PURE__ */d("span",{className:"text-xs opacity-70",children:a(n.length,j)})]}),
7
+ /* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>B(t=>t&&t.col===e.value&&t.index===n.length?t:{col:e.value,index:n.length}),children:[n.map((t,r)=>{const a=g(t),l=a===H;/* @__PURE__ */
8
8
  return u(s,{children:[o===r&&/* @__PURE__ */d("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),
9
- /* @__PURE__ */d("div",{"data-kanban-card":a,draggable:!0,onDragStart:e=>{O(a);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:t=>{t.stopPropagation();const a=null!==H?n.findIndex(e=>g(e)===H):-1,o=-1!==a&&a<r?r+1:r;F(n=>n&&n.col===e.value&&n.index===o?n:{col:e.value,index:o})},onDragEnd:R,onClick:b?()=>b(t):void 0,style:null===H?void 0:{opacity:l?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(b?"cursor-pointer":""),children:x(t)})]},a)}),n.length>0&&o===n.length&&/* @__PURE__ */d("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===n.length&&/* @__PURE__ */d("div",{className:"text-2xs text-center rounded-lg transition-all duration-150 "+(t?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:T})]}),D&&/* @__PURE__ */d("div",{className:"p-2 pt-0",children:/* @__PURE__ */u("button",{type:"button",onClick:()=>D(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 min-h-8 py-1 text-xs font-medium text-ink-faint opacity-0 transition hover:bg-gray-100 hover:text-ink focus-visible:opacity-100 group-hover:opacity-100",children:[
10
- /* @__PURE__ */d("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),A]})})]},e.value)})})}):/* @__PURE__ */d(c,{children:k??/* @__PURE__ */d("div",{className:"text-sm text-gray-500 p-4",children:j.empty})})}export{m as Kanban};
9
+ /* @__PURE__ */d("div",{"data-kanban-card":a,draggable:!0,onDragStart:e=>{O(a);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:t=>{t.stopPropagation();const a=null!==H?n.findIndex(e=>g(e)===H):-1,o=-1!==a&&a<r?r+1:r;B(n=>n&&n.col===e.value&&n.index===o?n:{col:e.value,index:o})},onDragEnd:S,onClick:b?()=>b(t):void 0,style:null===H?void 0:{opacity:l?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(b?"cursor-pointer":""),children:x(t)})]},a)}),n.length>0&&o===n.length&&/* @__PURE__ */d("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===n.length&&/* @__PURE__ */d("div",{className:"text-2xs text-center rounded-lg transition-all duration-150 "+(t?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:T})]}),D&&/* @__PURE__ */d("div",{className:"p-2 pt-0",children:/* @__PURE__ */u("button",{type:"button",onClick:()=>D(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 min-h-8 py-1 text-xs font-medium text-ink-faint opacity-0 transition hover:bg-gray-100 hover:text-ink focus-visible:opacity-100 group-hover:opacity-100",children:[
10
+ /* @__PURE__ */d("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),A]})})]},e.value)})})}):/* @__PURE__ */d(c,{children:k??/* @__PURE__ */d("div",{className:"text-sm text-gray-500 p-4",children:I.empty})})}export{m as Kanban};
@@ -1,9 +1,9 @@
1
- import{useShellLocale as e}from"./chunk-5YP7MFPK.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useId as d,Children as n}from"react";import{jsxs as t,jsx as a}from"react/jsx-runtime";var i={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}},l={neutral:"border-line",warning:"border-amber-300",current:"border-line"};function s({children:e,header:r,description:s,footer:c,padded:o=!0,padding:m,headingLevel:b,headerActions:u,"aria-label":p,className:h="",bodyClassName:x="",style:g,tone:f="neutral"}){const y=i[m??(o?"md":"none")],N=d(),v=d(),$=null!=r&&null!=s&&""!==s,w=null!=b&&null!=r,j=`h${b}`,k=null!=p&&""!==p,A=w||k,C=A?"section":"div",M=`rounded-(--radius-card) border ${l[f]} bg-surface shadow-sm ${h}`.trim(),P=n.toArray(e).length>0,B=P?"border-b border-line-subtle ":"",F="current"===f,H=F?"text-base font-semibold text-blue-700":"text-base font-semibold text-ink-strongest",K=F?"rounded-t-(--radius-card) bg-accent-tint ":"",L=`${B}${K}${y.edge} ${H}`;/* @__PURE__ */
2
- return t(C,{className:M,style:g,...k?{"aria-label":p}:w?{"aria-labelledby":N}:{},...$&&A?{"aria-describedby":v}:{},...F?{"aria-current":!0}:{},children:[$?
3
- /* @__PURE__ */t("div",{className:`${B}${K}${y.edge}`,children:[null!=u?/* @__PURE__ */t("div",{className:`flex items-center justify-between gap-3 ${H}`,children:[w?/* @__PURE__ */a(j,{id:N,children:r}):/* @__PURE__ */a("span",{children:r}),u]}):w?/* @__PURE__ */a(j,{id:N,className:H,children:r}):/* @__PURE__ */a("div",{className:H,children:r}),
4
- /* @__PURE__ */a("p",{id:v,className:F?"mt-0.5 text-xs text-gray-600":"mt-0.5 text-xs text-ink-faint",children:s})]}):null!=r&&(null!=u?
1
+ import{useShellLocale as e}from"./chunk-MBY5JIGB.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useId as d,Children as n}from"react";import{jsxs as t,jsx as a}from"react/jsx-runtime";var i={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}},l={neutral:"border-line",warning:"border-amber-300",current:"border-line"};function s({children:e,header:r,description:s,footer:c,padded:o=!0,padding:m,headingLevel:b,headerActions:u,"aria-label":p,className:h="",bodyClassName:x="",style:g,tone:f="neutral"}){const y=i[m??(o?"md":"none")],N=d(),v=d(),$=null!=r&&null!=s&&""!==s,w=null!=b&&null!=r,j=`h${b}`,k=null!=p&&""!==p,B=w||k,A=B?"section":"div",C=`rounded-(--radius-card) border ${l[f]} bg-surface shadow-sm ${h}`.trim(),M=n.toArray(e).length>0,G=M?"border-b border-line-subtle ":"",H="current"===f,I=H?"text-base font-semibold text-blue-700":"text-base font-semibold text-ink-strongest",J=H?"rounded-t-(--radius-card) bg-accent-tint ":"",L=`${G}${J}${y.edge} ${I}`;/* @__PURE__ */
2
+ return t(A,{className:C,style:g,...k?{"aria-label":p}:w?{"aria-labelledby":N}:{},...$&&B?{"aria-describedby":v}:{},...H?{"aria-current":!0}:{},children:[$?
3
+ /* @__PURE__ */t("div",{className:`${G}${J}${y.edge}`,children:[null!=u?/* @__PURE__ */t("div",{className:`flex items-center justify-between gap-3 ${I}`,children:[w?/* @__PURE__ */a(j,{id:N,children:r}):/* @__PURE__ */a("span",{children:r}),u]}):w?/* @__PURE__ */a(j,{id:N,className:I,children:r}):/* @__PURE__ */a("div",{className:I,children:r}),
4
+ /* @__PURE__ */a("p",{id:v,className:H?"mt-0.5 text-xs text-gray-600":"mt-0.5 text-xs text-ink-faint",children:s})]}):null!=r&&(null!=u?
5
5
  /* @__PURE__ */t("div",{className:`${L} flex items-center justify-between gap-3`,children:[w?/* @__PURE__ */a(j,{id:N,children:r}):/* @__PURE__ */a("span",{children:r}),u]}):w?
6
- /* @__PURE__ */a(j,{id:N,className:L,children:r}):/* @__PURE__ */a("div",{className:L,children:r})),P&&/* @__PURE__ */a("div",{className:[y.body,x].filter(Boolean).join(" "),children:e}),c&&/* @__PURE__ */a("div",{className:`border-t border-gray-100 ${y.edge}`,children:c})]})}function c({label:d,value:n,icon:i,delta:l,className:s=""}){const c=e(),o="number"==typeof n&&c?r(n,c):n,m="up"===l?.direction?"text-green-600":"down"===l?.direction?"text-red-600":"text-gray-500",b="up"===l?.direction?"▲":"down"===l?.direction?"▼":"→";/* @__PURE__ */
6
+ /* @__PURE__ */a(j,{id:N,className:L,children:r}):/* @__PURE__ */a("div",{className:L,children:r})),M&&/* @__PURE__ */a("div",{className:[y.body,x].filter(Boolean).join(" "),children:e}),c&&/* @__PURE__ */a("div",{className:`border-t border-gray-100 ${y.edge}`,children:c})]})}function c({label:d,value:n,icon:i,delta:l,className:s=""}){const c=e(),o="number"==typeof n&&c?r(n,c):n,m="up"===l?.direction?"text-green-600":"down"===l?.direction?"text-red-600":"text-gray-500",b="up"===l?.direction?"▲":"down"===l?.direction?"▼":"→";/* @__PURE__ */
7
7
  return t("div",{className:`rounded-(--radius-card) border border-gray-200 bg-white p-4 shadow-sm ${s}`.trim(),children:[
8
8
  /* @__PURE__ */t("div",{className:"flex items-center justify-between text-ink-faint",children:[
9
9
  /* @__PURE__ */a("span",{className:"text-xs font-medium uppercase tracking-wide",children:d}),i]}),
@@ -0,0 +1,7 @@
1
+ import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-4DDL6NXB.js";import{useTabLayer as n,focusableIn as o}from"./chunk-CDAJKLGL.js";import{PopupMenu as i,PopupMenuDivider as a}from"./chunk-6KGIHI6X.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{placeMenu as d,popupBounds as c,followAnchor as u}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as p}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useState as m,useRef as h,useId as g,useCallback as v,useEffect as b}from"react";import{jsxs as y,jsx as x}from"react/jsx-runtime";var k=/(^|[\s:])!?z-/,w={paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:"0.25rem",paddingBottom:"0.25rem"};function D({trigger:D,items:L,align:j="end",side:K="bottom","aria-label":A,className:C="",triggerClassName:E,menuClassName:S="",minWidth:W=180,linkAs:H,disabled:N,id:$,"aria-describedby":I,"aria-disabled":T=!1,onOpenChange:U,footer:B,footerLabel:G}){const[J,q]=m(!1),[M,z]=m(-1),P=h(null),R=h(null),X=h(null),O=h(null),Q=h(null),V=null!=B&&!1!==B,Y=h({text:"",at:0}),F=g(),Z=g(),_=$??Z,ee=h(U);ee.current=U;const te=h(J);te.current=J;const re=v(e=>{q(!1),te.current&&(te.current=!1,ee.current?.(!1)),e&&R.current?.focus()},[]),ne=(t,r)=>{const n=L.length;for(let o=0;o<n;o+=1){const i=((t+r*o)%n+n)%n;if(e(L[i]))return i}return-1},oe=()=>X.current?.closest("[data-popup-menu-tree]")??null;b(()=>{if(!J)return;const e=e=>{const t=e.target;if(P.current?.contains(t)||oe()?.contains(t))return;const r=oe()?.getAttribute("data-popup-menu-tree"),n=t.closest?.("[data-popup-menu-tree]");r&&n?.getAttribute("data-popup-menu-tree")===r||re(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>re(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[J,re]);const ie=v(()=>{const e=oe(),t=R.current;if(!e||!t)return;const r=e.style;r.left="0px",r.top="0px",r.maxWidth="none",r.maxHeight="none";const n={width:e.offsetWidth,height:e.offsetHeight},o=d({trigger:t.getBoundingClientRect(),menu:n,bounds:c(t),align:j,side:K});r.left=`${o.left}px`,r.top=`${o.top}px`,r.maxWidth=`${o.maxWidth}px`,r.maxHeight=`${o.maxHeight}px`,r.overflowY=n.height>o.maxHeight?"auto":"",e.dataset.side=o.side,e.dataset.align=j},[j,K]);p(()=>{J&&ie()}),b(()=>{if(J)return u(()=>R.current,ie)},[J,ie]),b(()=>{if(!J)return;const t=X.current,r=e(L[M])?t?.querySelector(`[data-dropdown-index="${M}"]`):null;(r??t)?.focus({preventScroll:!0})},[J,M]),b(()=>{if(J)return f(e=>"Escape"===e.key&&(re(!0),!0),()=>O.current)},[J,re]),n(O,J&&V);const ae=h(null),le=e=>"first"===e?ne(0,1):ne(L.length-1,-1),se=e=>{z(le(e)),q(!0),te.current||(te.current=!0,ae.current=e,U?.(!0))};p(()=>{const e=ae.current;if(!J||!e)return;ae.current=null;const t=le(e);t!==M&&z(t)});const de=t(L,F),ce="function"==typeof B?B({close:()=>re(!0)}):B,ue={...k.test(S)?{}:{zIndex:s.popup},minWidth:W};/* @__PURE__ */
2
+ return y("div",{ref:P,className:`relative inline-flex ${C}`.trim(),children:[
3
+ /* @__PURE__ */x("button",{ref:R,id:_,type:"button","aria-haspopup":"menu","aria-expanded":J,"aria-controls":J?F:void 0,"aria-label":A,"aria-describedby":I,"aria-disabled":T||void 0,disabled:N,onClick:()=>{T||(J?re(!1):se("first"))},onKeyDown:e=>{T||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),se("first")):"ArrowUp"===e.key&&(e.preventDefault(),se("last")))},className:E??"inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-ink-strongest rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60 "+(A?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"),children:D}),J&&
4
+ /* @__PURE__ */x(i,{portal:!0,className:S,style:ue,children:/* @__PURE__ */y("div",{ref:O,children:[
5
+ /* @__PURE__ */x("div",{ref:X,id:F,role:"menu","aria-orientation":"vertical","aria-label":A,"aria-labelledby":A?void 0:_,"aria-describedby":de,tabIndex:-1,onKeyDown:t=>{if(!t.target.closest?.("[data-popup-submenu-panel]")||"Tab"===t.key)if("ArrowDown"===t.key)t.preventDefault(),z(ne(M+1,1));else if("ArrowUp"===t.key)t.preventDefault(),z(ne(M-1,-1));else if("Home"===t.key)t.preventDefault(),z(ne(0,1));else if("End"===t.key)t.preventDefault(),z(ne(L.length-1,-1));else if("Tab"===t.key){t.preventDefault();const e=!t.shiftKey&&Q.current?o(Q.current)[0]:void 0;e?e.focus({preventScroll:!0}):re(!0)}else if(" "===t.key){const e=t.target;e.matches?.("a[href]")&&(t.preventDefault(),e.click())}else 1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey||(t=>{const r=Date.now(),n=t.key.toLowerCase(),o=r-Y.current.at<500?Y.current.text+n:n;Y.current={text:o,at:r};const i=[...o].every(e=>e===o[0]),a=i?o[0]:o,l=i?M+1:Math.max(M,0),s=X.current,d=L.length;for(let r=0;r<d;r+=1){const n=((l+r)%d+d)%d;if(e(L[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(a))return t.preventDefault(),void z(n)}})(t)},children:r(L,{menuId:F,choose:e=>{e.disabled||(re(!0),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>re(!0),rowProps:(e,t)=>({"data-dropdown-index":e,tabIndex:e===M?0:-1,onMouseEnter:()=>{t.disabled||Q.current?.contains(document.activeElement)||z(e)}}),linkAs:H})}),V&&/* @__PURE__ */y("div",{ref:Q,role:"group","aria-label":G,"data-dropdown-footer":"",onKeyDown:e=>{const t=Q.current;if("Tab"!==e.key||!t||!t.contains(e.target))return;const r=o(t),n=document.activeElement;if(e.shiftKey){if(r.length>0&&n!==r[0])return;e.preventDefault();const t=X.current?.querySelector(`[data-dropdown-index="${M}"]`);return void(t??X.current)?.focus({preventScroll:!0})}r.length>0&&n!==r[r.length-1]||(e.preventDefault(),re(!0))},children:[
6
+ /* @__PURE__ */x("div",{"aria-hidden":"true",children:/* @__PURE__ */x(a,{})}),
7
+ /* @__PURE__ */x("div",{style:w,children:ce})]})]})})]})}export{D as DropdownMenu};
@@ -1,4 +1,4 @@
1
- import{StatCard as e,Card as a}from"./chunk-WEEQDPU3.js";import{Avatar as t}from"./chunk-SEP35R2E.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-B2SLXCMY.js";import{ColumnChart as l}from"./chunk-UG42KUCT.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-JPNAEN53.js";import{Button_default as c}from"./chunk-7DI3VQCF.js";import{TH_ONE_LINE as n}from"./chunk-CJH2BGXY.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
1
+ import{StatCard as e,Card as a}from"./chunk-NPTHHWXZ.js";import{Avatar as t}from"./chunk-TVRKONNH.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-ZKYBLZPT.js";import{ColumnChart as l}from"./chunk-IJXMWWTM.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-FZM3ZPW3.js";import{Button_default as c}from"./chunk-EOVXFXVV.js";import{TH_ONE_LINE as n}from"./chunk-WGLHB6WE.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
2
2
  return o(i,{groups:u,children:/* @__PURE__ */o("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */m("div",{className:"mx-auto max-w-6xl space-y-6",children:[
3
3
  /* @__PURE__ */m("div",{className:"flex items-center justify-between gap-4",children:[
4
4
  /* @__PURE__ */m("div",{children:[
@@ -1,15 +1,15 @@
1
- import{Popover as e}from"./chunk-7JGR7WPD.js";import{InputNumber_default as r}from"./chunk-R72ZKZDP.js";import{parseHexColor as a,hexToHsv as n,hsvToHex as o,hexReadout as t,HUE_GRADIENT as l,HEX_MAX_LENGTH as i,svFromPoint as s,hueFromPoint as c}from"./chunk-S6OB6HJB.js";import{inputClasses as u}from"./chunk-AYZY3YNC.js";import{Tooltip as d}from"./chunk-QQ2LDC6C.js";import{useShellStrings as h}from"./chunk-5YP7MFPK.js";import{forwardRef as g,useState as p,useRef as b,useEffect as m,useId as f}from"react";import{jsx as v,jsxs as w}from"react/jsx-runtime";var x={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},y={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function k(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function C(e,r){if(!e)return y;const a=k(r);if(a>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${a}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`}}function N({size:e="md",selected:r=!1,className:a=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",r?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",x[e],a].filter(Boolean).join(" ")}var $=g(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
2
- return v("button",{ref:l,type:o,"aria-pressed":a,className:N({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(e)})})}),z=(e,r,a)=>Math.min(a,Math.max(r,e)),D=e=>"string"==typeof e?{value:e}:e;function P(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:z(e.s+o[0],0,1),v:z(e.v+o[1],0,1)}:null}function A(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,359);case"ArrowRight":case"ArrowUp":return z(e+n,0,359);case"PageDown":return z(e-10,0,359);case"PageUp":return z(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var I={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function M(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,100);case"ArrowRight":case"ArrowUp":return z(e+n,0,100);case"PageDown":return z(e-10,0,100);case"PageUp":return z(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function j({value:e,onChange:r,label:i,presets:u,clearable:g=!1,fallback:f,dragWrites:x="live",disabled:N=!1,opacity:z,onOpacityChange:j,onClose:K,id:S,className:R=""}){const L=h().color,O=k(z),U=e=>{const r=k(e);N||r===O||j?.(r)},Y=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:O},E=a(f??""),[H,W]=p(()=>n(e||E||"")),q=b(e);m(()=>{e!==q.current&&(q.current=e,e?W(n(e)):E&&W(n(E)))},[e]);const X=a=>{N||a===e||(q.current=a,r(a))},Z=e=>{const r=a(e);r&&(W(n(r)),X(r))},F=e=>{W(e),X(o(e))},[J,Q]=p(!1),G=b(H);G.current=H;const V=e=>({onPointerDown:r=>{if(N||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,G.current);"end"===x?(Q(!0),W(a)):F(a)},onPointerMove:r=>{if(N||!(1&r.buttons))return;const a=e(r,G.current);"end"===x?W(a):F(a)},onPointerUp:r=>{"end"===x&&J&&(Q(!1),F(e(r,G.current)))}}),_=V((e,r)=>({...r,...s(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),ee=V((e,r)=>({...r,h:c(e.clientX,e.currentTarget.getBoundingClientRect())})),re=J?o(H):e,ae=e=>`${Math.round(100*e)}%`,ne=(u??[]).map(D),oe=a(e),te=re||E||"";/* @__PURE__ */
3
- return w("div",{id:S,className:`flex w-56 flex-col gap-3 ${N?"opacity-60":""} ${R}`.trim(),onKeyDown:e=>{"Escape"===e.key&&K&&(e.preventDefault(),e.stopPropagation(),K())},children:[(ne.length>0||g)&&/* @__PURE__ */w("div",{role:"group","aria-label":L.presets,className:"flex flex-wrap gap-2",children:[g&&/* @__PURE__ */v(d,{content:L.clear,children:/* @__PURE__ */v($,{color:"",size:"sm","aria-label":L.clear,selected:""===e,disabled:N,onClick:()=>{N||""===e||(q.current="",r(""))}})}),ne.map(e=>{const r=a(e.value),n=e.label?`${e.label} · ${t(r??e.value)}`:t(r??e.value);/* @__PURE__ */
4
- return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:N,onClick:()=>Z(e.value)})},`${e.label??""}:${e.value}`)})]}),
5
- /* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":L.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*H.v),"aria-valuetext":L.squareValue(Math.round(100*H.s),Math.round(100*H.v)),"aria-disabled":N||void 0,"data-color-square":"",onKeyDown:e=>{if(N)return;const r=P(H,e.key,e.shiftKey);r&&(e.preventDefault(),F(r))},..._,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:o({h:H.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:ae(H.s),top:ae(1-H.v),...I}})}),
6
- /* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":L.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(H.h),"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-hue":"",onKeyDown:e=>{if(N)return;const r=A(H.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),F({...H,h:r}))},...ee,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:l},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:H.h/360*100+"%",background:o({h:H.h,s:1,v:1}),...I}})}),j&&/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":L.opacity(i),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":O,"aria-valuetext":`${O}%`,"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-opacity":"",onKeyDown:e=>{if(N)return;const r=M(O,e.key,e.shiftKey);null!==r&&(e.preventDefault(),U(r))},onPointerDown:e=>{N||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),U(Y(e)))},onPointerMove:e=>{!N&&1&e.buttons&&U(Y(e))},className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:`linear-gradient(to right, transparent, ${te||"black"}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${O}%`,...C(te||"black",O),...I}})}),
1
+ import{Popover as e}from"./chunk-7JGR7WPD.js";import{InputNumber_default as r}from"./chunk-HK4QAI2A.js";import{parseHexColor as a,hexToHsv as n,hsvToHex as o,hexReadout as t,HUE_GRADIENT as l,HEX_MAX_LENGTH as i,svFromPoint as s,hueFromPoint as c}from"./chunk-S6OB6HJB.js";import{inputClasses as u}from"./chunk-AYZY3YNC.js";import{Tooltip as d}from"./chunk-NJN5IKWO.js";import{useShellStrings as h}from"./chunk-MBY5JIGB.js";import{forwardRef as g,useState as p,useRef as b,useEffect as m,useId as f}from"react";import{jsx as v,jsxs as w}from"react/jsx-runtime";var x={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},y={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function k(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function N(e,r){if(!e)return y;const a=k(r);if(a>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${a}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`}}function C({size:e="md",selected:r=!1,className:a=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",r?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",x[e],a].filter(Boolean).join(" ")}var $=g(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
2
+ return v("button",{ref:l,type:o,"aria-pressed":a,className:C({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(e)})})}),z=(e,r,a)=>Math.min(a,Math.max(r,e)),D=e=>"string"==typeof e?{value:e}:e;function I(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:z(e.s+o[0],0,1),v:z(e.v+o[1],0,1)}:null}function A(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,359);case"ArrowRight":case"ArrowUp":return z(e+n,0,359);case"PageDown":return z(e-10,0,359);case"PageUp":return z(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var M={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function P(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,100);case"ArrowRight":case"ArrowUp":return z(e+n,0,100);case"PageDown":return z(e-10,0,100);case"PageUp":return z(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function j({value:e,onChange:r,label:i,presets:u,clearable:g=!1,fallback:f,dragWrites:x="live",disabled:C=!1,opacity:z,onOpacityChange:j,onClose:K,id:B,className:S=""}){const R=h().color,U=k(z),H=e=>{const r=k(e);C||r===U||j?.(r)},L=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:U},W=a(f??""),[Y,E]=p(()=>n(e||W||"")),J=b(e);m(()=>{e!==J.current&&(J.current=e,e?E(n(e)):W&&E(n(W)))},[e]);const q=a=>{C||a===e||(J.current=a,r(a))},X=e=>{const r=a(e);r&&(E(n(r)),q(r))},G=e=>{E(e),q(o(e))},[F,Q]=p(!1),V=b(Y);V.current=Y;const Z=e=>({onPointerDown:r=>{if(C||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,V.current);"end"===x?(Q(!0),E(a)):G(a)},onPointerMove:r=>{if(C||!(1&r.buttons))return;const a=e(r,V.current);"end"===x?E(a):G(a)},onPointerUp:r=>{"end"===x&&F&&(Q(!1),G(e(r,V.current)))}}),_=Z((e,r)=>({...r,...s(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),ee=Z((e,r)=>({...r,h:c(e.clientX,e.currentTarget.getBoundingClientRect())})),re=F?o(Y):e,ae=e=>`${Math.round(100*e)}%`,ne=(u??[]).map(D),oe=a(e),te=re||W||"";/* @__PURE__ */
3
+ return w("div",{id:B,className:`flex w-56 flex-col gap-3 ${C?"opacity-60":""} ${S}`.trim(),onKeyDown:e=>{"Escape"===e.key&&K&&(e.preventDefault(),e.stopPropagation(),K())},children:[(ne.length>0||g)&&/* @__PURE__ */w("div",{role:"group","aria-label":R.presets,className:"flex flex-wrap gap-2",children:[g&&/* @__PURE__ */v(d,{content:R.clear,children:/* @__PURE__ */v($,{color:"",size:"sm","aria-label":R.clear,selected:""===e,disabled:C,onClick:()=>{C||""===e||(J.current="",r(""))}})}),ne.map(e=>{const r=a(e.value),n=e.label?`${e.label} · ${t(r??e.value)}`:t(r??e.value);/* @__PURE__ */
4
+ return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:C,onClick:()=>X(e.value)})},`${e.label??""}:${e.value}`)})]}),
5
+ /* @__PURE__ */v("div",{role:"slider",tabIndex:C?-1:0,"aria-label":R.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*Y.v),"aria-valuetext":R.squareValue(Math.round(100*Y.s),Math.round(100*Y.v)),"aria-disabled":C||void 0,"data-color-square":"",onKeyDown:e=>{if(C)return;const r=I(Y,e.key,e.shiftKey);r&&(e.preventDefault(),G(r))},..._,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:o({h:Y.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:ae(Y.s),top:ae(1-Y.v),...M}})}),
6
+ /* @__PURE__ */v("div",{role:"slider",tabIndex:C?-1:0,"aria-label":R.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(Y.h),"aria-orientation":"horizontal","aria-disabled":C||void 0,"data-color-hue":"",onKeyDown:e=>{if(C)return;const r=A(Y.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),G({...Y,h:r}))},...ee,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:l},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:Y.h/360*100+"%",background:o({h:Y.h,s:1,v:1}),...M}})}),j&&/* @__PURE__ */v("div",{role:"slider",tabIndex:C?-1:0,"aria-label":R.opacity(i),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":U,"aria-valuetext":`${U}%`,"aria-orientation":"horizontal","aria-disabled":C||void 0,"data-color-opacity":"",onKeyDown:e=>{if(C)return;const r=P(U,e.key,e.shiftKey);null!==r&&(e.preventDefault(),H(r))},onPointerDown:e=>{C||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),H(L(e)))},onPointerMove:e=>{!C&&1&e.buttons&&H(L(e))},className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:`linear-gradient(to right, transparent, ${te||"black"}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${U}%`,...N(te||"black",U),...M}})}),
7
7
  /* @__PURE__ */w("div",{className:"flex items-center gap-2",children:[
8
- /* @__PURE__ */v("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:C(te,j?O:null)}),
9
- /* @__PURE__ */v(T,{value:re,placeholder:!e&&E?t(E):void 0,onChange:Z,label:L.hex(i),disabled:N}),j&&/* @__PURE__ */v(B,{value:O,onChange:U,label:L.opacity(i),disabled:N})]})]})}var K={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"},S={sm:"h-6",md:"h-8",lg:"h-10"},R=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-ink-strong placeholder:text-[color:var(--ink-placeholder)] hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function T({value:e,onChange:r,label:n,placeholder:o,disabled:l,id:s,size:c="md",look:d="box",className:h=""}){const[g,b]=p(null),m="text"===d?`${R} ${S[c]} ${h}`.trim():u({size:c,className:`${K[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
10
- return v("input",{id:s,type:"text",value:g??(e?t(e):""),"aria-label":n,placeholder:o,maxLength:i,spellCheck:!1,autoComplete:"off",disabled:l,onChange:n=>{b(n.target.value);const o=a(n.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),b(null))},onBlur:()=>b(null),"data-hex-look":d,className:m})}function B({value:e,onChange:a,label:n,disabled:o,size:t="md"}){/* @__PURE__ */
11
- return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function L({value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:g=!1,opacity:p,onOpacityChange:b,size:m="md",align:x="start",open:y,onOpenChange:$,className:z=""}){const D=h().color,P=k(p),A=f(),I=a(s??""),M=r||I||"",K=r?t(r):I?t(I):D.none;
8
+ /* @__PURE__ */v("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:N(te,j?U:null)}),
9
+ /* @__PURE__ */v(T,{value:re,placeholder:!e&&W?t(W):void 0,onChange:X,label:R.hex(i),disabled:C}),j&&/* @__PURE__ */v(O,{value:U,onChange:H,label:R.opacity(i),disabled:C})]})]})}var K={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"},B={sm:"h-6",md:"h-8",lg:"h-10"},S=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-ink-strong placeholder:text-[color:var(--ink-placeholder)] hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function T({value:e,onChange:r,label:n,placeholder:o,disabled:l,id:s,size:c="md",look:d="box",className:h=""}){const[g,b]=p(null),m="text"===d?`${S} ${B[c]} ${h}`.trim():u({size:c,className:`${K[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
10
+ return v("input",{id:s,type:"text",value:g??(e?t(e):""),"aria-label":n,placeholder:o,maxLength:i,spellCheck:!1,autoComplete:"off",disabled:l,onChange:n=>{b(n.target.value);const o=a(n.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),b(null))},onBlur:()=>b(null),"data-hex-look":d,className:m})}function O({value:e,onChange:a,label:n,disabled:o,size:t="md"}){/* @__PURE__ */
11
+ return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function R({value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:g=!1,opacity:p,onOpacityChange:b,size:m="md",align:x="start",open:y,onOpenChange:$,className:z=""}){const D=h().color,I=k(p),A=f(),M=a(s??""),P=r||M||"",K=r?t(r):M?t(M):D.none;
12
12
  /* @__PURE__ */
13
13
  return w("div",{className:`inline-flex items-center ${b?"flex-wrap justify-end gap-1":g?"gap-1":"gap-2"} ${z}`.trim(),children:[
14
- /* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(M,b?P:null)}),triggerLabel:D.swatch(o,K),triggerClassName:N({size:m}),"aria-label":D.panel(o),align:x,open:y,onOpenChange:$,disabled:u,children:/* @__PURE__ */v(j,{id:A,value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,opacity:p,onOpacityChange:b})}),g&&
15
- /* @__PURE__ */v(T,{value:r,placeholder:!r&&I?t(I):void 0,onChange:e=>{u||e===r||n(e)},label:D.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */v(B,{value:P,onChange:e=>{u||e===P||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{L as ColorPicker,j as ColorPickerPanel,$ as ColorSwatch,T as HexInput,y as NO_COLOR_FILL,k as clampOpacity,C as colorFill,N as colorSwatchClasses,A as stepHue,M as stepOpacity,P as stepSquare};
14
+ /* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(P,b?I:null)}),triggerLabel:D.swatch(o,K),triggerClassName:C({size:m}),"aria-label":D.panel(o),align:x,open:y,onOpenChange:$,disabled:u,children:/* @__PURE__ */v(j,{id:A,value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,opacity:p,onOpacityChange:b})}),g&&
15
+ /* @__PURE__ */v(T,{value:r,placeholder:!r&&M?t(M):void 0,onChange:e=>{u||e===r||n(e)},label:D.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */v(O,{value:I,onChange:e=>{u||e===I||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{R as ColorPicker,j as ColorPickerPanel,$ as ColorSwatch,T as HexInput,y as NO_COLOR_FILL,k as clampOpacity,N as colorFill,C as colorSwatchClasses,A as stepHue,P as stepOpacity,I as stepSquare};
@@ -1,14 +1,14 @@
1
- import{SearchableSelect as e}from"./chunk-SUYQ7QYB.js";import{labelClasses as a}from"./chunk-EQKUFYX6.js";import{Select_default as l}from"./chunk-ESWR7YNY.js";import{isSafeLinkHref as t}from"./chunk-Q5Z3KHT2.js";import{Input_default as r}from"./chunk-LGTYPLJM.js";import{INPUT_SIZES as n}from"./chunk-AYZY3YNC.js";import{Button_default as i}from"./chunk-7DI3VQCF.js";import{Icon as o}from"./chunk-7V32O5NF.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-5YP7MFPK.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},k=e=>t(e.trim());function y(t){const{value:n,kinds:o,rules:y=x,filtersFor:w,label:N,readOnly:C,placeholder:F,className:j="",tidyAddress:O,addressAddon:Y}=t,$=void 0!==t.onApply,E=u().link,T=y.isSafe??k,z=d(),A=c(null),P=c(null),[Q,D]=p({url:n}),K=$?Q.url:n,[U,L]=p(!1),[M,S]=p(null),[W,B]=p(null),[R,V]=p(!1),H=c(null),Z=c(()=>{});Z.current=$?t.onCancel:()=>{},m(()=>{if($)return s(e=>{const a=A.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(Z.current(),!0)},()=>A.current)},[$]),m(()=>{if(!$)return;const e=P.current;e?(e.focus(),e.select()):A.current?.querySelector("button, input")?.focus()},[]);const q=o??[{value:b,label:E.address,target:{type:"text"}}],G=M&&M.against===K?M.kind:y.kindOf(K),I=q.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===G),J=I.find(e=>"text"===e.target.type),X=I.find(e=>e.value===G)??J??I[0];if(!X)return null;const _="text"!==X.target.type,ee=_?y.targetOf(K):K,ae=h(X.target),le=ae.find(e=>e.value===ee),te=e=>({value:e,label:E.unavailable(e)}),re="select"===X.target.type&&ee&&w?w(ee):null,ne=re?y.readFilter(K):null,ie=ne?re?.find(e=>e.param===ne.param):void 0,oe=W&&W.against===K?W.text:K,se=_?K:O?O(oe.trim()).trim():oe.trim(),ue=$&&O?se:oe,de=!_&&""!==ue.trim()&&!T(ue),ce=de&&(!$||U);_&&R&&V(!1);const pe=(e,a)=>{$?D({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},me=(e,a)=>{S(a=>a?{...a,against:e}:a),pe(e,a)},fe=e=>{if(!e)return me("");const a=ae.find(a=>a.value===e);me(e,a?.label)},ve=e=>{L(!1);const a=e.trim();a?T(e)?(B({text:e,against:a}),me(a)):B({text:e,against:K}):(B({text:e,against:""}),me(""))},ge=e=>{const a=e.relatedTarget;if(a&&(a===P.current||H.current?.contains(a)))return;if(V(!1),$||!O||C)return;const l=O(oe.trim());l.trim()!==oe.trim()&&ve(l)},he=()=>{if(!$||!se)return;if(!_&&de)return void L(!0);const e=_&&Q.url===se?Q.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},be=(e,a)=>a&&!e.some(e=>e.value===a)?[te(a),...e]:[...e],xe=(a,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const l=r.some(e=>""===e.value);/* @__PURE__ */
1
+ import{SearchableSelect as e}from"./chunk-XZU24YKP.js";import{labelClasses as a}from"./chunk-EQKUFYX6.js";import{Select_default as l}from"./chunk-A34PD3XT.js";import{isSafeLinkHref as t}from"./chunk-Q5Z3KHT2.js";import{Input_default as r}from"./chunk-HNUKXGYP.js";import{INPUT_SIZES as n}from"./chunk-AYZY3YNC.js";import{Button_default as i}from"./chunk-EOVXFXVV.js";import{Icon as o}from"./chunk-2UO47XB4.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-MBY5JIGB.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},k=e=>t(e.trim());function y(t){const{value:n,kinds:o,rules:y=x,filtersFor:w,label:N,readOnly:C,placeholder:F,className:O="",tidyAddress:j,addressAddon:$}=t,A=void 0!==t.onApply,E=u().link,T=y.isSafe??k,U=d(),X=c(null),Y=c(null),[z,K]=p({url:n}),P=A?z.url:n,[B,D]=p(!1),[V,H]=p(null),[M,Q]=p(null),[W,Z]=p(!1),G=c(null),L=c(()=>{});L.current=A?t.onCancel:()=>{},m(()=>{if(A)return s(e=>{const a=X.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(L.current(),!0)},()=>X.current)},[A]),m(()=>{if(!A)return;const e=Y.current;e?(e.focus(),e.select()):X.current?.querySelector("button, input")?.focus()},[]);const R=o??[{value:b,label:E.address,target:{type:"text"}}],S=V&&V.against===P?V.kind:y.kindOf(P),q=R.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===S),I=q.find(e=>"text"===e.target.type),J=q.find(e=>e.value===S)??I??q[0];if(!J)return null;const _="text"!==J.target.type,ee=_?y.targetOf(P):P,ae=h(J.target),le=ae.find(e=>e.value===ee),te=e=>({value:e,label:E.unavailable(e)}),re="select"===J.target.type&&ee&&w?w(ee):null,ne=re?y.readFilter(P):null,ie=ne?re?.find(e=>e.param===ne.param):void 0,oe=M&&M.against===P?M.text:P,se=_?P:j?j(oe.trim()).trim():oe.trim(),ue=A&&j?se:oe,de=!_&&""!==ue.trim()&&!T(ue),ce=de&&(!A||B);_&&W&&Z(!1);const pe=(e,a)=>{A?K({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},me=(e,a)=>{H(a=>a?{...a,against:e}:a),pe(e,a)},fe=e=>{if(!e)return me("");const a=ae.find(a=>a.value===e);me(e,a?.label)},ve=e=>{D(!1);const a=e.trim();a?T(e)?(Q({text:e,against:a}),me(a)):Q({text:e,against:P}):(Q({text:e,against:""}),me(""))},ge=e=>{const a=e.relatedTarget;if(a&&(a===Y.current||G.current?.contains(a)))return;if(Z(!1),A||!j||C)return;const l=j(oe.trim());l.trim()!==oe.trim()&&ve(l)},he=()=>{if(!A||!se)return;if(!_&&de)return void D(!0);const e=_&&z.url===se?z.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},be=(e,a)=>a&&!e.some(e=>e.value===a)?[te(a),...e]:[...e],xe=(a,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const l=r.some(e=>""===e.value);/* @__PURE__ */
2
2
  return f(e,{"aria-label":a,value:t,options:o,disabled:C,clearable:l,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
3
- return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:C,onChange:n})};let ke;if("text"===X.target.type)ke=/* @__PURE__ */f(r,{ref:P,id:`${z}-address`,size:"sm",type:"text",invalid:ce,"aria-label":E.address,"aria-describedby":ce?`${z}-why`:void 0,placeholder:F??E.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:oe,readOnly:C,onChange:e=>ve(e.target.value),onFocus:()=>V(!0),onBlur:ge,onKeyDown:O&&!$?e=>{"Enter"===e.key&&e.currentTarget.blur()}:void 0});else{const e="groups"===X.target.type?X.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):X.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:X.target.placeholder},...be(e,ee)];ke=xe(X.label,ee,a,fe,e.length>10)}const ye=/* @__PURE__ */v(g,{children:[o&&xe(E.linkType,X.value,I.map(e=>({value:e.value,label:e.label})),e=>{B(null),L(!1);const a=I.find(a=>a.value===e);if(!a||"text"===a.target.type)return void S({kind:e,against:K});const l=h(a.target)[0];S({kind:e,against:l?l.value:""}),l?pe(l.value,l.label):pe("")},!1),ke,Y&&R&&!C&&"text"===X.target.type&&/* @__PURE__ */f("div",{ref:H,onBlur:ge,children:Y({url:oe,onChange:ve})}),re&&xe(E.filter,ne?.param??"",[{value:"",label:E.noFilter},...ne&&!ie?[te(ne.param)]:[],...re.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return me(ee,le?.label);const a=re?.find(a=>a.param===e),l=a?.values[0];l&&me(y.withFilter(ee,{param:e,value:l.value}),l.label)},!1),re&&ne&&xe(E.value,ne.value,be((ie?.values??[]).map(e=>({value:e.value,label:e.label})),ne.value),e=>{if(!ne)return;const a=ie?.values.find(a=>a.value===e);me(y.withFilter(ee,{param:ne.param,value:e}),a?.label)},(ie?.values.length??0)>10),ce&&/* @__PURE__ */f("p",{id:`${z}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:E.unsafe}),X.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:X.hint}),re&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:E.filterHint})]});if(!$)/* @__PURE__ */
4
- return f("div",{ref:A,className:`flex min-w-0 flex-auto flex-col gap-2 ${j}`.trim(),role:N?"group":void 0,"aria-label":N,children:ye});const we=t.onRemove;/* @__PURE__ */
5
- return v("div",{ref:A,role:"dialog","aria-label":N??E.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-line bg-surface p-3 shadow-lg ${j}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),he())},children:[_?/* @__PURE__ */f("span",{className:a({inline:!0}),children:E.title}):/* @__PURE__ */f("label",{htmlFor:`${z}-address`,className:a({inline:!0}),children:E.title}),ye,
3
+ return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:C,onChange:n})};let ke;if("text"===J.target.type)ke=/* @__PURE__ */f(r,{ref:Y,id:`${U}-address`,size:"sm",type:"text",invalid:ce,"aria-label":E.address,"aria-describedby":ce?`${U}-why`:void 0,placeholder:F??E.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:oe,readOnly:C,onChange:e=>ve(e.target.value),onFocus:()=>Z(!0),onBlur:ge,onKeyDown:j&&!A?e=>{"Enter"===e.key&&e.currentTarget.blur()}:void 0});else{const e="groups"===J.target.type?J.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):J.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:J.target.placeholder},...be(e,ee)];ke=xe(J.label,ee,a,fe,e.length>10)}const ye=/* @__PURE__ */v(g,{children:[o&&xe(E.linkType,J.value,q.map(e=>({value:e.value,label:e.label})),e=>{Q(null),D(!1);const a=q.find(a=>a.value===e);if(!a||"text"===a.target.type)return void H({kind:e,against:P});const l=h(a.target)[0];H({kind:e,against:l?l.value:""}),l?pe(l.value,l.label):pe("")},!1),ke,$&&W&&!C&&"text"===J.target.type&&/* @__PURE__ */f("div",{ref:G,onBlur:ge,children:$({url:oe,onChange:ve})}),re&&xe(E.filter,ne?.param??"",[{value:"",label:E.noFilter},...ne&&!ie?[te(ne.param)]:[],...re.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return me(ee,le?.label);const a=re?.find(a=>a.param===e),l=a?.values[0];l&&me(y.withFilter(ee,{param:e,value:l.value}),l.label)},!1),re&&ne&&xe(E.value,ne.value,be((ie?.values??[]).map(e=>({value:e.value,label:e.label})),ne.value),e=>{if(!ne)return;const a=ie?.values.find(a=>a.value===e);me(y.withFilter(ee,{param:ne.param,value:e}),a?.label)},(ie?.values.length??0)>10),ce&&/* @__PURE__ */f("p",{id:`${U}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:E.unsafe}),J.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:J.hint}),re&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:E.filterHint})]});if(!A)/* @__PURE__ */
4
+ return f("div",{ref:X,className:`flex min-w-0 flex-auto flex-col gap-2 ${O}`.trim(),role:N?"group":void 0,"aria-label":N,children:ye});const we=t.onRemove;/* @__PURE__ */
5
+ return v("div",{ref:X,role:"dialog","aria-label":N??E.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-line bg-surface p-3 shadow-lg ${O}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),he())},children:[_?/* @__PURE__ */f("span",{className:a({inline:!0}),children:E.title}):/* @__PURE__ */f("label",{htmlFor:`${U}-address`,className:a({inline:!0}),children:E.title}),ye,
6
6
  /* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[we?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:we,children:E.remove}):null,
7
7
  /* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
8
- /* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>Z.current(),children:E.cancel}),
9
- /* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:he,disabled:C||""===se,children:E.apply})]})]})]})}function w({label:e,text:a,onTextChange:l,link:t,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const k=u().link,[w,N]=p(!1),C=c(null),F=d(),j=()=>{N(!1),C.current?.focus()};/* @__PURE__ */
8
+ /* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>L.current(),children:E.cancel}),
9
+ /* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:he,disabled:C||""===se,children:E.apply})]})]})]})}function w({label:e,text:a,onTextChange:l,link:t,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const k=u().link,[w,N]=p(!1),C=c(null),F=d(),O=()=>{N(!1),C.current?.focus()};/* @__PURE__ */
10
10
  return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
11
11
  /* @__PURE__ */f(r,{size:"md",type:"text",className:"rounded-b-none","aria-label":k.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>l(e.target.value)}),
12
12
  /* @__PURE__ */v("button",{ref:C,type:"button","aria-label":k.linkOf(e,t),"aria-expanded":w,"aria-controls":w?F:void 0,disabled:b,onClick:()=>N(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-line-strong bg-surface-sunken ${n.md} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
13
13
  /* @__PURE__ */f(o,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(t?"text-blue-600":"text-ink-faintest")}),
14
- /* @__PURE__ */f("span",{className:"min-w-0 truncate "+(t?"text-blue-600":"text-ink-faintest"),children:t||k.addLink})]}),w&&/* @__PURE__ */f("div",{id:F,className:"mt-2",children:/* @__PURE__ */f(y,{value:t,label:k.linkOf(e,t),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),j()},onRemove:t?()=>{i(""),j()}:void 0,onCancel:j})})]})}export{y as LinkPicker,w as TextLinkField};
14
+ /* @__PURE__ */f("span",{className:"min-w-0 truncate "+(t?"text-blue-600":"text-ink-faintest"),children:t||k.addLink})]}),w&&/* @__PURE__ */f("div",{id:F,className:"mt-2",children:/* @__PURE__ */f(y,{value:t,label:k.linkOf(e,t),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),O()},onRemove:t?()=>{i(""),O()}:void 0,onCancel:O})})]})}export{y as LinkPicker,w as TextLinkField};
@@ -0,0 +1,6 @@
1
+ import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-HK4QAI2A.js";import{Tooltip as i}from"./chunk-NJN5IKWO.js";import{useShellStrings as l}from"./chunk-MBY5JIGB.js";import{useId as a,useRef as s,useState as c,useEffect as u,Fragment as d}from"react";import{jsxs as h,jsx as f}from"react/jsx-runtime";var m=(e,t,r)=>Math.min(r,Math.max(t,e)),p=e=>e.reduce((e,t)=>e+t,0),v=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var g,b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:M=!1,className:j=""}){const A=l().widths,B=a(),R=m(Math.round(x)||1,1,n),z=e($,R),K=z??[...t[R]??[]],I=[...K,100-p(K)],O=P||M,S=s(null),D=s({onChange:k,shown:K,locked:O,n:R,stored:z});D.current={onChange:k,shown:K,locked:O,n:R,stored:z};const T=t=>{const{onChange:r,shown:n,locked:o,n:i}=D.current;if(o)return!1;const l=e(t,i);return!(!l||v(l,n))&&(r(l),!0)},E=(e,t,n)=>{const o=e[t]+e[t+1],i=[...e];i[t]=m(Math.round(n),r,o-r),i[t+1]=o-i[t],T(i.slice(0,-1))&&(ne.current=null)},H=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const n=t.shiftKey?10:1,o=I[e]+I[e+1],i="ArrowRight"===t.key?I[e]+n:"ArrowLeft"===t.key?I[e]-n:"PageUp"===t.key?I[e]+10:"PageDown"===t.key?I[e]-10:"Home"===t.key?r:"End"===t.key?o-r:null;null!==i&&(t.preventDefault(),E(I,e,i))},G=s(null),[J,L]=c(null),W=()=>{G.current=null,L(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};u(()=>W,[]);const F=e=>t=>{if(0!==t.button||O)return;t.preventDefault();const r=S.current?.getBoundingClientRect().width??0;r<=0||(G.current={i:e,x:t.clientX,width:r,from:I,moved:!1,pointer:t.pointerId},L(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},U=e=>{const t=G.current;if(!t)return;if(0===e.buttons)return void W();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}E(t.from,t.i,t.from[t.i]+r/t.width*100)},X=e=>{const t=G.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),W())},q=(e,t)=>{const{shown:n}=D.current,o=function(e,t,n){const o=e.length,i=[...e];if(o<2)return i;const l=m(Math.round(n),r,100-(o-1)*r);let a=l-i[t];i[t]=l;const s=[...Array.from({length:o-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(a<0)return i[s[0]]-=a,i;for(const e of s){if(a<=0)break;const t=Math.min(a,i[e]-r);i[e]-=t,a-=t}return i}([...n,100-p(n)],e,t);return T(o.slice(0,-1))?o:null},[Q,V]=c(0);u(()=>{const e=S.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>V(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const Y=s(null),[Z,_]=c(null),[ee,te]=c([]),re=(e,t)=>_(r=>t?e:r===e?null:r),ne=s(null),oe=(e,t)=>{const r=ne.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:o,stored:i}=D.current;var l,a;return o||(l=i,a=r.stored,void 0===l||void 0===a?l===a:v(l,a))||n(r.stored),!0},ie=I.join(",");u(()=>{const e=null===Z?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===g&&(g=document.createElement("canvas").getContext("2d")),!g)return[];const o=g;return r.flatMap((e,r)=>{if(r===t)return[];const i=e.getBoundingClientRect(),l=getComputedStyle(e);o.font=`${l.fontWeight} ${l.fontSize} ${l.fontFamily}`;const a=o.measureText(e.value).width/2,s=(i.left+i.right)/2;return s+a>n.left&&s-a<n.right?[r]:[]})}(Y.current,Z);te(t=>v(t,e)?t:e)},[Z,ie,Q]);const le=A.hint(R,r),ae=I.slice(0,-1).map((e,t)=>p(I.slice(0,t+1)));/* @__PURE__ */
2
+ return h("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":R>1?B:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${M?"opacity-60":""} ${j}`.trim(),children:[
3
+ /* @__PURE__ */h("div",{ref:Y,"data-widths-bar":"",className:"relative h-8",children:[
4
+ /* @__PURE__ */f("div",{ref:S,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:I.map((e,t)=>/* @__PURE__ */f("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[t%2]} ${t%2==0?"bg-accent-tint":""}`,children:1===R&&/* @__PURE__ */f("span",{"data-widths-label":"",children:`${e}%`})},t))}),
5
+ /* @__PURE__ */f("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),R>1&&I.map((e,t)=>/* @__PURE__ */h(d,{children:[(()=>{const n=Z===t,l=p(I.slice(0,t)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
6
+ return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>Q>0&&Q*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:r,max:100-(R-1)*r,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:M,"aria-label":A.column(t+1),"aria-describedby":B,"data-widths-label":"",onChange:e=>{null===e||oe(t,e)||q(t,e)},onRevert:e=>((e,t)=>{D.current.locked||null===t||oe(e,t)||q(e,t)})(t,e),onFocus:()=>{ne.current={column:t,share:e,stored:D.current.stored},re(t,!0)},onBlur:()=>re(t,!1),className:`absolute inset-0 text-xs font-medium ${w[t%2]} ${ee.includes(t)&&!n?"opacity-0":""}`})})})})(),t<R-1&&/* @__PURE__ */f("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[t]}%`},children:/* @__PURE__ */f(i,{content:A.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */f("div",{role:"separator",tabIndex:M?-1:0,"aria-orientation":"vertical","aria-label":A.divider(t+1,t+2),"aria-valuenow":I[t],"aria-valuemin":r,"aria-valuemax":I[t]+I[t+1]-r,"aria-valuetext":A.dividerValue(t+1,I[t],t+2,I[t+1]),"aria-disabled":O||void 0,onKeyDown:O?void 0:H(t),onPointerDown:F(t),onPointerMove:U,onPointerUp:X,onPointerCancel:X,onLostPointerCapture:()=>{G.current&&W()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(O?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */f("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(O?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${J===t?"w-1":y}`)})})})})]},t))]}),R>1&&/* @__PURE__ */f("span",{id:B,className:"sr-only",children:le})]})}export{x as WidthsBar};
@@ -1,23 +1,23 @@
1
- import{toast_default as e}from"./chunk-KVVZLEUG.js";import{Icon as t}from"./chunk-7V32O5NF.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import{useShellStrings as r}from"./chunk-5YP7MFPK.js";import{createContext as a,useContext as o,useRef as i,useState as s,useEffect as l}from"react";import*as c from"pdfjs-dist";import{createPortal as d}from"react-dom";import{jsx as u,jsxs as m}from"react/jsx-runtime";function h(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var p=a(null);function f({children:e}){const t=o(p);return t?d(e,t):
2
- /* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=r().pdf,k=i(null),C=i(null),N=i(null),[M,j]=s(null),[E,P]=s(1),[z,_]=s(0),[D,L]=s(1),[W,S]=s(!0),[$,O]=s(!0),T=i(x.loadFailed);T.current=x.loadFailed,l(()=>{let t=!1;return O(!0),P(1),g&&(c.GlobalWorkerOptions.workerSrc=g),c.getDocument({url:a,...y(w)}).promise.then(e=>{t||(j(e),_(e.numPages),O(!1))}).catch(()=>{t||(e.error(T.current),O(!1))}),()=>{t=!0}},[a,g,w]),l(()=>{if(!M||!W||!N.current)return;const e=()=>{const e=N.current;e&&M.getPage(E).then(t=>{if(!N.current)return;const n=t.getViewport({scale:1}),r=b(d,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});L(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(N.current),()=>t.disconnect()},[M,E,W,d]),l(()=>{if(!M||!k.current)return;let e=!1,t=null,n=null;return M.getPage(E).then(r=>{if(e||!k.current)return;const a=r.getViewport({scale:D}),o=k.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const s=C.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new c.TextLayer({textContentSource:r.streamTextContent(),container:s,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",s.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[M,E,D]),l(()=>{const e=()=>C.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const A="page"===d?x.fitPage:x.fitWidth,U="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
1
+ import{toast_default as e}from"./chunk-A3AKJDLI.js";import{Icon as t}from"./chunk-2UO47XB4.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import{useShellStrings as r}from"./chunk-MBY5JIGB.js";import{createContext as a,useContext as o,useRef as i,useState as s,useEffect as l}from"react";import*as c from"pdfjs-dist";import{createPortal as d}from"react-dom";import{jsx as u,jsxs as m}from"react/jsx-runtime";function h(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var p=a(null);function f({children:e}){const t=o(p);return t?d(e,t):
2
+ /* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=r().pdf,k=i(null),C=i(null),N=i(null),[M,j]=s(null),[E,z]=s(1),[_,D]=s(0),[P,L]=s(1),[W,A]=s(!0),[S,$]=s(!0),O=i(x.loadFailed);O.current=x.loadFailed,l(()=>{let t=!1;return $(!0),z(1),g&&(c.GlobalWorkerOptions.workerSrc=g),c.getDocument({url:a,...y(w)}).promise.then(e=>{t||(j(e),D(e.numPages),$(!1))}).catch(()=>{t||(e.error(O.current),$(!1))}),()=>{t=!0}},[a,g,w]),l(()=>{if(!M||!W||!N.current)return;const e=()=>{const e=N.current;e&&M.getPage(E).then(t=>{if(!N.current)return;const n=t.getViewport({scale:1}),r=b(d,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});L(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(N.current),()=>t.disconnect()},[M,E,W,d]),l(()=>{if(!M||!k.current)return;let e=!1,t=null,n=null;return M.getPage(E).then(r=>{if(e||!k.current)return;const a=r.getViewport({scale:P}),o=k.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const s=C.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new c.TextLayer({textContentSource:r.streamTextContent(),container:s,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",s.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[M,E,P]),l(()=>{const e=()=>C.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const T="page"===d?x.fitPage:x.fitWidth,U="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
3
3
  return m("div",{className:"flex flex-col h-full",children:[
4
4
  /* @__PURE__ */m(f,{children:[
5
- /* @__PURE__ */u("button",{type:"button","aria-label":x.previousPage,onClick:()=>P(e=>Math.max(1,e-1)),disabled:E<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(t,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
6
- /* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(E,z)}),
7
- /* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>P(e=>Math.min(z,e+1)),disabled:E>=z,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(t,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
5
+ /* @__PURE__ */u("button",{type:"button","aria-label":x.previousPage,onClick:()=>z(e=>Math.max(1,e-1)),disabled:E<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(t,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
6
+ /* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(E,_)}),
7
+ /* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>z(e=>Math.min(_,e+1)),disabled:E>=_,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(t,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
8
8
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
9
- /* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{S(!1),L(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:U,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"−"})}),
10
- /* @__PURE__ */m("select",{value:W?"fit":v.includes(Math.round(100*D))?Math.round(100*D):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(S(!1),L(Number(t)/100)):S(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":x.zoom,title:x.zoom,children:[
11
- /* @__PURE__ */u("option",{value:"fit",children:A}),!W&&!v.includes(Math.round(100*D))&&/* @__PURE__ */m("option",{value:"custom",children:[Math.round(100*D),"%"]}),v.map(e=>/* @__PURE__ */m("option",{value:e,children:[e,"%"]},e))]}),
12
- /* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{S(!1),L(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:U,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"+"})}),
13
- /* @__PURE__ */u("button",{type:"button",onClick:()=>S(!0),"aria-pressed":W,className:U+(W?" bg-gray-200 text-gray-900":""),title:x.fitHint,children:x.fit}),
9
+ /* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{A(!1),L(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:U,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"−"})}),
10
+ /* @__PURE__ */m("select",{value:W?"fit":v.includes(Math.round(100*P))?Math.round(100*P):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(A(!1),L(Number(t)/100)):A(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":x.zoom,title:x.zoom,children:[
11
+ /* @__PURE__ */u("option",{value:"fit",children:T}),!W&&!v.includes(Math.round(100*P))&&/* @__PURE__ */m("option",{value:"custom",children:[Math.round(100*P),"%"]}),v.map(e=>/* @__PURE__ */m("option",{value:e,children:[e,"%"]},e))]}),
12
+ /* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{A(!1),L(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:U,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"+"})}),
13
+ /* @__PURE__ */u("button",{type:"button",onClick:()=>A(!0),"aria-pressed":W,className:U+(W?" bg-gray-200 text-gray-900":""),title:x.fitHint,children:x.fit}),
14
14
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
15
- /* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!M)return;const t=window.open("","_blank");if(!t)return void e.error(x.allowPopups);const n=[];for(let e=1;e<=z;e++)n.push(M.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(n).then(e=>{var n;t.document.write(`<html><head><title>${n=o,n.replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),t.document.write(e.map(e=>`<img src="${e}"/>`).join("")),t.document.write("</body></html>"),t.document.close(),setTimeout(()=>{t.print(),t.close()},300)})},className:U,children:[
15
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!M)return;const t=window.open("","_blank");if(!t)return void e.error(x.allowPopups);const n=[];for(let e=1;e<=_;e++)n.push(M.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(n).then(e=>{var n;t.document.write(`<html><head><title>${n=o,n.replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),t.document.write(e.map(e=>`<img src="${e}"/>`).join("")),t.document.write("</body></html>"),t.document.close(),setTimeout(()=>{t.print(),t.close()},300)})},className:U,children:[
16
16
  /* @__PURE__ */u(t,{name:"print",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.print]}),
17
17
  /* @__PURE__ */m("button",{type:"button",onClick:h??(()=>{const e=document.createElement("a");e.href=a,e.download=o,e.click()}),className:U,children:[
18
18
  /* @__PURE__ */u(t,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.download]}),p&&/* @__PURE__ */m("button",{type:"button",onClick:p,className:U,children:[
19
19
  /* @__PURE__ */u(t,{name:"email",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.email]})]}),
20
- /* @__PURE__ */u("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!M)return;if(e.ctrlKey||e.metaKey)return;const t=N.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&E<z?(e.preventDefault(),P(e=>Math.min(z,e+1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=0)})):e.deltaY<0&&n&&E>1&&(e.preventDefault(),P(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=N.current.scrollHeight)}))},onKeyDown:e=>{if(!M)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?E<z&&(e.preventDefault(),P(e=>Math.min(z,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?E>1&&(e.preventDefault(),P(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),P(1)):"End"===e.key&&(e.preventDefault(),P(z)))},children:$?/* @__PURE__ */u(n,{size:"sm",padding:"",className:"h-full",label:x.loading}):/* @__PURE__ */m("div",{className:"min-h-full flex items-center justify-center p-4",children:[
20
+ /* @__PURE__ */u("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!M)return;if(e.ctrlKey||e.metaKey)return;const t=N.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&E<_?(e.preventDefault(),z(e=>Math.min(_,e+1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=0)})):e.deltaY<0&&n&&E>1&&(e.preventDefault(),z(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=N.current.scrollHeight)}))},onKeyDown:e=>{if(!M)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?E<_&&(e.preventDefault(),z(e=>Math.min(_,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?E>1&&(e.preventDefault(),z(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),z(1)):"End"===e.key&&(e.preventDefault(),z(_)))},children:S?/* @__PURE__ */u(n,{size:"sm",padding:"",className:"h-full",label:x.loading}):/* @__PURE__ */m("div",{className:"min-h-full flex items-center justify-center p-4",children:[
21
21
  /* @__PURE__ */u("style",{children:'\n.preview-pdf-textlayer {\n position: absolute;\n inset: 0;\n overflow: clip;\n line-height: 1;\n text-align: initial;\n text-size-adjust: none;\n forced-color-adjust: none;\n transform-origin: 0 0;\n caret-color: CanvasText;\n --min-font-size: 1;\n --text-scale-factor: calc(var(--total-scale-factor, 1) * var(--min-font-size));\n --min-font-size-inv: calc(1 / var(--min-font-size));\n}\n.preview-pdf-textlayer :is(span, br) {\n color: transparent;\n position: absolute;\n white-space: pre;\n cursor: text;\n transform-origin: 0% 0%;\n}\n.preview-pdf-textlayer > :not(.markedContent),\n.preview-pdf-textlayer .markedContent span:not(.markedContent) {\n z-index: 1;\n --font-height: 0;\n font-size: calc(var(--text-scale-factor) * var(--font-height));\n --scale-x: 1;\n --rotate: 0deg;\n transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));\n}\n.preview-pdf-textlayer .markedContent {\n display: contents;\n}\n.preview-pdf-textlayer span[role="img"] {\n user-select: none;\n cursor: default;\n}\n.preview-pdf-textlayer ::selection {\n background: rgba(0, 80, 255, 0.25);\n}\n.preview-pdf-textlayer br::selection {\n background: transparent;\n}\n.preview-pdf-textlayer .endOfContent {\n display: block;\n position: absolute;\n inset: 100% 0 0;\n z-index: 0;\n cursor: default;\n user-select: none;\n}\n.preview-pdf-textlayer.selecting .endOfContent {\n top: 0;\n}\n'}),
22
22
  /* @__PURE__ */m("div",{className:"relative shadow-lg rounded",children:[
23
23
  /* @__PURE__ */u("canvas",{ref:k,className:"block rounded"}),
@@ -1,4 +1,4 @@
1
- import{InputNumber_default as e}from"./chunk-R72ZKZDP.js";import{IconButton_default as r}from"./chunk-VCMHBUKI.js";import{Icon as a}from"./chunk-7V32O5NF.js";import{Tooltip as i}from"./chunk-QQ2LDC6C.js";import{useShellStrings as n}from"./chunk-5YP7MFPK.js";import{useState as l,useRef as o}from"react";import{jsxs as t,jsx as s}from"react/jsx-runtime";var d={tl:"",tr:"rotate-90",br:"rotate-180",bl:"-rotate-90"},c=["tl","tr","bl","br"];function u({label:u,value:m,corners:f,onChange:p,radius:h=null,onRadiusChange:v,radiusLabel:b,radiusMin:k=0,radiusMax:g,radiusStep:x=1,radiusPlaceholder:w,disabled:y=!1,disabledReason:j,id:C,className:K=""}){const A=n(),M=function(e){const r=c.map(r=>e.find(e=>e.value===r));for(const a of e){if(c.includes(a.value))continue;const e=r.findIndex(e=>void 0===e);-1===e?r.push(a):r[e]=a}return r.filter(e=>void 0!==e)}(f),[N,D]=l(0),R=o(null);/* @__PURE__ */
2
- return t("div",{id:C,role:"group","aria-label":u,className:`flex min-w-0 flex-wrap items-center gap-2 ${K}`.trim(),children:[v&&
3
- /* @__PURE__ */s("div",{className:"w-30 shrink-0",children:/* @__PURE__ */s(e,{value:h,onChange:v,min:k,max:g,step:x,precision:0,placeholder:w,prefix:/* @__PURE__ */s("span",{"data-radius-mark":"","aria-hidden":"true",children:A.corners.radiusMark}),suffix:A.corners.unit,steppers:"compact",disabled:y,"aria-label":b??A.corners.radius})}),
4
- /* @__PURE__ */s("div",{ref:R,"data-corners-grid":"",className:"grid shrink-0 grid-cols-2 gap-1",onKeyDown:e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;const r=Array.from(R.current?.querySelectorAll("button[data-corner]")??[]),a=r.indexOf(document.activeElement);if(-1===a)return;const i=a%2,n=Math.floor(a/2),l="ArrowRight"===e.key?2*n+1:"ArrowLeft"===e.key?2*n:"ArrowDown"===e.key?2+i:"ArrowUp"===e.key?i:null;null!==l&&(e.preventDefault(),l<r.length&&r[l].focus())},children:M.map((e,n)=>{const l=m.includes(e.value),o=y||!0===e.disabled,t=o&&(!0===e.disabled&&e.title||(y?j:void 0))||void 0,c=/* @__PURE__ */s(r,{"aria-pressed":l,"aria-label":e.label,"aria-disabled":o||void 0,disabledReason:t,"data-corner":e.value,size:"sm",tabIndex:n===N?0:-1,onFocus:()=>D(n),onClick:()=>{o||p(l?m.filter(r=>r!==e.value):[...m,e.value])},children:/* @__PURE__ */s(a,{name:"corner",strokeWidth:2,className:["h-4 w-4",d[e.value]??""].filter(Boolean).join(" ")})},e.value);return t?c:/* @__PURE__ */s(i,{content:e.title??e.label,children:c},e.value)})})]})}export{u as CornersInput};
1
+ import{InputNumber_default as e}from"./chunk-HK4QAI2A.js";import{IconButton_default as r}from"./chunk-LE5LWALR.js";import{Icon as a}from"./chunk-2UO47XB4.js";import{Tooltip as i}from"./chunk-NJN5IKWO.js";import{useShellStrings as n}from"./chunk-MBY5JIGB.js";import{useState as l,useRef as o}from"react";import{jsxs as t,jsx as s}from"react/jsx-runtime";var d={tl:"",tr:"rotate-90",br:"rotate-180",bl:"-rotate-90"},c=["tl","tr","bl","br"];function u({label:u,value:m,corners:f,onChange:p,radius:h=null,onRadiusChange:v,radiusLabel:b,radiusMin:k=0,radiusMax:g,radiusStep:x=1,radiusPlaceholder:w,disabled:y=!1,disabledReason:A,id:j,className:N=""}){const K=n(),I=function(e){const r=c.map(r=>e.find(e=>e.value===r));for(const a of e){if(c.includes(a.value))continue;const e=r.findIndex(e=>void 0===e);-1===e?r.push(a):r[e]=a}return r.filter(e=>void 0!==e)}(f),[L,M]=l(0),R=o(null);/* @__PURE__ */
2
+ return t("div",{id:j,role:"group","aria-label":u,className:`flex min-w-0 flex-wrap items-center gap-2 ${N}`.trim(),children:[v&&
3
+ /* @__PURE__ */s("div",{className:"w-30 shrink-0",children:/* @__PURE__ */s(e,{value:h,onChange:v,min:k,max:g,step:x,precision:0,placeholder:w,prefix:/* @__PURE__ */s("span",{"data-radius-mark":"","aria-hidden":"true",children:K.corners.radiusMark}),suffix:K.corners.unit,steppers:"compact",disabled:y,"aria-label":b??K.corners.radius})}),
4
+ /* @__PURE__ */s("div",{ref:R,"data-corners-grid":"",className:"grid shrink-0 grid-cols-2 gap-1",onKeyDown:e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;const r=Array.from(R.current?.querySelectorAll("button[data-corner]")??[]),a=r.indexOf(document.activeElement);if(-1===a)return;const i=a%2,n=Math.floor(a/2),l="ArrowRight"===e.key?2*n+1:"ArrowLeft"===e.key?2*n:"ArrowDown"===e.key?2+i:"ArrowUp"===e.key?i:null;null!==l&&(e.preventDefault(),l<r.length&&r[l].focus())},children:I.map((e,n)=>{const l=m.includes(e.value),o=y||!0===e.disabled,t=o&&(!0===e.disabled&&e.title||(y?A:void 0))||void 0,c=/* @__PURE__ */s(r,{"aria-pressed":l,"aria-label":e.label,"aria-disabled":o||void 0,disabledReason:t,"data-corner":e.value,size:"sm",tabIndex:n===L?0:-1,onFocus:()=>M(n),onClick:()=>{o||p(l?m.filter(r=>r!==e.value):[...m,e.value])},children:/* @__PURE__ */s(a,{name:"corner",strokeWidth:2,className:["h-4 w-4",d[e.value]??""].filter(Boolean).join(" ")})},e.value);return t?c:/* @__PURE__ */s(i,{content:e.title??e.label,children:c},e.value)})})]})}export{u as CornersInput};
@@ -1,4 +1,4 @@
1
- import{Markdown as e}from"./chunk-63545Z3N.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-7V32O5NF.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-5YP7MFPK.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[N,v]=a(""),[w,k]=a(null),[C,j]=a({}),M=N.trim().toLowerCase(),_=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),L=e=>!M||e.title.toLowerCase().includes(M)||e.body.toLowerCase().includes(M)||e.category_label.toLowerCase().includes(M),Y=n(()=>_.map(e=>({...e,docs:e.docs.filter(L)})).filter(e=>e.docs.length>0),[_,M]),A=n(()=>Y.flatMap(e=>e.docs),[Y]),E=(w?A.find(e=>e.slug===w):void 0)??A[0]??null,P=e=>!!M||(C[e]??e===E?.category);/* @__PURE__ */
1
+ import{Markdown as e}from"./chunk-VPGQMNW3.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-2UO47XB4.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-MBY5JIGB.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[N,v]=a(""),[w,k]=a(null),[C,j]=a({}),M=N.trim().toLowerCase(),B=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),_=e=>!M||e.title.toLowerCase().includes(M)||e.body.toLowerCase().includes(M)||e.category_label.toLowerCase().includes(M),L=n(()=>B.map(e=>({...e,docs:e.docs.filter(_)})).filter(e=>e.docs.length>0),[B,M]),Y=n(()=>L.flatMap(e=>e.docs),[L]),A=(w?Y.find(e=>e.slug===w):void 0)??Y[0]??null,E=e=>!!M||(C[e]??e===A?.category);/* @__PURE__ */
2
2
  return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
3
3
  /* @__PURE__ */i("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
4
4
  /* @__PURE__ */i("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
@@ -6,16 +6,16 @@ return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
6
6
  /* @__PURE__ */o("div",{className:"px-3 py-2 border-b border-line-subtle shrink-0",children:/* @__PURE__ */i("div",{className:"relative",children:[
7
7
  /* @__PURE__ */o(l,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${t}`,"aria-hidden":"true"}),
8
8
  /* @__PURE__ */o("input",{type:"text",value:N,onChange:e=>v(e.target.value),placeholder:y.help.searchPlaceholder,className:"w-full rounded-md border border-line-strong bg-surface h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
9
- /* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===Y.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:M?y.help.noResults:b??y.help.empty}):Y.map(e=>{const t=P(e.key);/* @__PURE__ */
9
+ /* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===L.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:M?y.help.noResults:b??y.help.empty}):L.map(e=>{const t=E(e.key);/* @__PURE__ */
10
10
  return i("div",{className:"py-0.5",children:[
11
- /* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!P(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
11
+ /* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!E(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
12
12
  /* @__PURE__ */o(d,{open:t}),
13
- /* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=E?.slug===e.slug;/* @__PURE__ */
13
+ /* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=A?.slug===e.slug;/* @__PURE__ */
14
14
  return i("button",{type:"button",onClick:()=>k(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
15
15
  /* @__PURE__ */o("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */o("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:y.help.draft})]},e.slug)})]},e.key)})})]}),
16
- /* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:E?/* @__PURE__ */i(c,{children:[
16
+ /* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:A?/* @__PURE__ */i(c,{children:[
17
17
  /* @__PURE__ */i("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
18
18
  /* @__PURE__ */i("div",{className:"min-w-0",children:[
19
- /* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:E.title}),
20
- /* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[E.category_label,!1===E.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(E),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
21
- /* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(E):E.body?/* @__PURE__ */o(e,{children:E.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};
19
+ /* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:A.title}),
20
+ /* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[A.category_label,!1===A.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(A),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
21
+ /* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(A):A.body?/* @__PURE__ */o(e,{children:A.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};