efficient-shell 9.11.0 → 9.14.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 (316) hide show
  1. package/README.md +23 -1
  2. package/dist/{Browser-XPDD6RSI.js → Browser-42NYVAPR.js} +13 -13
  3. package/dist/Calculator-PCTFUS5O.js +29 -0
  4. package/dist/{CurrencyConverter-AW7BB3DD.js → CurrencyConverter-OIXAMDP7.js} +8 -8
  5. package/dist/{Documents-7SVXJFXI.js → Documents-V2OKP6JZ.js} +26 -26
  6. package/dist/{Files-H4TP2FLK.js → Files-OAMTKHYK.js} +78 -78
  7. package/dist/{Notepad-XP5TPXS5.js → Notepad-3LG227K2.js} +10 -10
  8. package/dist/{PdfViewer-FFQOKKFW.js → PdfViewer-DFBPEUY5.js} +1 -1
  9. package/dist/{PomodoroTimer-5VCWY4QT.js → PomodoroTimer-AYGPGA6Q.js} +12 -12
  10. package/dist/{Preview-3ZNKGYVJ.js → Preview-BBQWQ4DG.js} +28 -28
  11. package/dist/Sidebar-RHGWTAPS.js +44 -0
  12. package/dist/{Spreadsheet-VZGSCFFQ.js → Spreadsheet-MS5FU7ET.js} +14 -14
  13. package/dist/{Stock-2VWS2IQJ.js → Stock-GSQNTV7E.js} +4 -4
  14. package/dist/{Weather-4MEYBP4D.js → Weather-5XLO2GLO.js} +17 -17
  15. package/dist/{WorldClock-Y4YRJ43F.js → WorldClock-CG3NF4GA.js} +6 -6
  16. package/dist/ai/index.d.ts +42 -1
  17. package/dist/ai/index.js +59 -56
  18. package/dist/ai.css +1 -1
  19. package/dist/apps/index.js +1 -1
  20. package/dist/bin/media-host-check.js +1 -1
  21. package/dist/bin/ui-check.js +1 -1
  22. package/dist/brand.css +1 -1
  23. package/dist/charts/BoxPlotChart.js +1 -1
  24. package/dist/charts/CandlestickChart.js +1 -1
  25. package/dist/charts/CartesianPlot.js +1 -1
  26. package/dist/charts/ChartBrush.js +1 -1
  27. package/dist/charts/ChartFrame.js +1 -1
  28. package/dist/charts/ChartSkeleton.js +1 -1
  29. package/dist/charts/ChordChart.js +1 -1
  30. package/dist/charts/ColumnChart.js +1 -1
  31. package/dist/charts/FunnelChart.js +1 -1
  32. package/dist/charts/HeatmapChart.js +1 -1
  33. package/dist/charts/HistogramChart.js +1 -1
  34. package/dist/charts/Meter.js +1 -1
  35. package/dist/charts/PieChart.js +1 -1
  36. package/dist/charts/RadarChart.js +1 -1
  37. package/dist/charts/RadialBarChart.js +1 -1
  38. package/dist/charts/RangeChart.js +1 -1
  39. package/dist/charts/RankedBars.js +1 -1
  40. package/dist/charts/SankeyChart.js +1 -1
  41. package/dist/charts/ScatterChart.js +1 -1
  42. package/dist/charts/SpecChart.js +1 -1
  43. package/dist/charts/StatTile.js +1 -1
  44. package/dist/charts/SunburstChart.js +1 -1
  45. package/dist/charts/TimeSeriesChart.js +1 -1
  46. package/dist/charts/TreemapChart.js +1 -1
  47. package/dist/charts/WaterfallChart.js +1 -1
  48. package/dist/chunk-25STFYV3.js +8 -0
  49. package/dist/{chunk-BNKULSCG.js → chunk-2OE5VVBE.js} +1 -1
  50. package/dist/{chunk-BRHKQMRH.js → chunk-2TQ6BLSN.js} +6 -6
  51. package/dist/{chunk-VZV7Q5V2.js → chunk-3AZBI76O.js} +1 -1
  52. package/dist/{chunk-NRGBXEBU.js → chunk-43T5JGFB.js} +1 -1
  53. package/dist/{chunk-QLYOGT3U.js → chunk-4E4GWE4L.js} +17 -17
  54. package/dist/{chunk-E6EUGQGA.js → chunk-4WZRNPIG.js} +1 -1
  55. package/dist/{chunk-5CVQN2BR.js → chunk-53KQSCMG.js} +7 -7
  56. package/dist/{chunk-65DYHG73.js → chunk-5VTRKWKO.js} +1 -1
  57. package/dist/{chunk-7WLFHDWA.js → chunk-66JYKX4T.js} +1 -1
  58. package/dist/{chunk-M5MAIJQQ.js → chunk-6L2UAAGT.js} +1 -1
  59. package/dist/{chunk-ODOEH5QZ.js → chunk-6TCJOVFX.js} +2 -2
  60. package/dist/{chunk-HRAK46H7.js → chunk-6YQPLI5M.js} +12 -12
  61. package/dist/{chunk-3MHBALGV.js → chunk-76IDLFXI.js} +1 -1
  62. package/dist/{chunk-D4KZOYXQ.js → chunk-7BDZZANS.js} +1 -1
  63. package/dist/{chunk-CJI3POCE.js → chunk-7KDGW6BR.js} +1 -1
  64. package/dist/{chunk-QCFN3ET4.js → chunk-7VCAMNCH.js} +1 -1
  65. package/dist/{chunk-VBNA237H.js → chunk-A4HA7EXR.js} +1 -1
  66. package/dist/{chunk-SGR4V5YI.js → chunk-A7CCSRPB.js} +1 -1
  67. package/dist/chunk-AEJNFA2K.js +6 -0
  68. package/dist/{chunk-CBMXYXBH.js → chunk-AG2OLB3E.js} +9 -9
  69. package/dist/{chunk-ZPW3KQ27.js → chunk-APXQMZSV.js} +28 -28
  70. package/dist/chunk-AVAYZK3Z.js +3 -0
  71. package/dist/{chunk-FNSVXN7B.js → chunk-B4DR72FR.js} +1 -1
  72. package/dist/{chunk-WZQCRTXF.js → chunk-B7AHMB3U.js} +1 -1
  73. package/dist/{chunk-TQH6E5V2.js → chunk-BDAKGS7O.js} +1 -1
  74. package/dist/chunk-BGNJQMAZ.js +1 -0
  75. package/dist/{chunk-MCMUJDEP.js → chunk-BMQCUHSD.js} +1 -1
  76. package/dist/{chunk-GVAWCTJN.js → chunk-C45OKLRM.js} +7 -7
  77. package/dist/{chunk-JECMVR4S.js → chunk-C6MV6IAX.js} +8 -8
  78. package/dist/{chunk-5RAOFJYT.js → chunk-CBGKLHPB.js} +6 -6
  79. package/dist/{chunk-KTRNAMHY.js → chunk-CL7SBEBQ.js} +1 -1
  80. package/dist/{chunk-4SZ3NNVF.js → chunk-D46AP6U5.js} +4 -4
  81. package/dist/{chunk-E72USUUR.js → chunk-D7X2HMMA.js} +9 -9
  82. package/dist/{chunk-GP5UNEKY.js → chunk-DKQWFQAV.js} +1 -1
  83. package/dist/{chunk-IBIUI2D3.js → chunk-DL6QIWVR.js} +1 -1
  84. package/dist/{chunk-7JJUI52C.js → chunk-DPDRFLBY.js} +3 -3
  85. package/dist/{chunk-H2XCQJRG.js → chunk-DXHLUB36.js} +1 -1
  86. package/dist/{chunk-YBU7NOD7.js → chunk-E7WY4GZ3.js} +1 -1
  87. package/dist/{chunk-RLLONZJJ.js → chunk-EGEWU776.js} +1 -1
  88. package/dist/{chunk-46YVA2BF.js → chunk-ELUTQZGP.js} +1 -1
  89. package/dist/{chunk-BJONHLET.js → chunk-EQN65XOO.js} +1 -1
  90. package/dist/chunk-EXJZUNNW.js +29 -0
  91. package/dist/{chunk-EWJELWIT.js → chunk-F24QTMTY.js} +3 -3
  92. package/dist/{chunk-QSUQC4AN.js → chunk-FTWWJHFX.js} +1 -1
  93. package/dist/{chunk-KAHYUBXM.js → chunk-GKK7DR2H.js} +8 -8
  94. package/dist/{chunk-NGQHXTUK.js → chunk-GKZUAT3K.js} +1 -1
  95. package/dist/{chunk-DRNB7KDC.js → chunk-GMRZX2ET.js} +1 -1
  96. package/dist/{chunk-UEIJSV45.js → chunk-GNU3U2TP.js} +1 -1
  97. package/dist/{chunk-FKA6ZVQO.js → chunk-GQK3U2IO.js} +9 -9
  98. package/dist/{chunk-UL4G6JY2.js → chunk-GRBBQ3VF.js} +1 -1
  99. package/dist/{chunk-73W7537K.js → chunk-GXGBBMGV.js} +1 -1
  100. package/dist/{chunk-FPGRKHUW.js → chunk-HAFB45DT.js} +7 -7
  101. package/dist/{chunk-6O2W4X2V.js → chunk-HI6IE5HI.js} +1 -1
  102. package/dist/chunk-HJPCHES5.js +8 -0
  103. package/dist/{chunk-ZC3CCRPG.js → chunk-IGEFUHYE.js} +5 -5
  104. package/dist/{chunk-KOSV4UPK.js → chunk-IKQVK3I3.js} +3 -3
  105. package/dist/{chunk-2GPHHW7C.js → chunk-IWEL2ZCV.js} +1 -1
  106. package/dist/{chunk-P65C5TUU.js → chunk-IWJRSC7M.js} +1 -1
  107. package/dist/{chunk-KECOZKJU.js → chunk-J53OQCKC.js} +7 -7
  108. package/dist/{chunk-BF7PZFKT.js → chunk-JB3WKDD7.js} +1 -1
  109. package/dist/{chunk-IENPHB5B.js → chunk-JJP54OT4.js} +1 -1
  110. package/dist/{chunk-MUHWI4GK.js → chunk-JKZJVQIB.js} +5 -5
  111. package/dist/{chunk-XS4HFUTW.js → chunk-JWX7QRGE.js} +1 -1
  112. package/dist/chunk-KAVFW5CU.js +7 -0
  113. package/dist/{chunk-VANJPZ3H.js → chunk-KCV7BFKJ.js} +1 -1
  114. package/dist/chunk-KE5U4KKG.js +4 -0
  115. package/dist/{chunk-2AHLONPR.js → chunk-KJXF5WAJ.js} +1 -1
  116. package/dist/{chunk-5EM5US6A.js → chunk-KTKMM2XW.js} +1 -1
  117. package/dist/chunk-LKW3YAZN.js +11 -0
  118. package/dist/chunk-LPUGK2MC.js +2 -0
  119. package/dist/{chunk-5Y7JITHW.js → chunk-M33225G6.js} +1 -1
  120. package/dist/{chunk-REGXKU74.js → chunk-M5YG57UP.js} +1 -1
  121. package/dist/{chunk-2XBJNB7D.js → chunk-M7H3OCIL.js} +50 -50
  122. package/dist/{chunk-IEPSBXMU.js → chunk-ME4VRJMK.js} +11 -11
  123. package/dist/{chunk-XREN3AKD.js → chunk-MNIULUQY.js} +10 -10
  124. package/dist/{chunk-AG63JVX7.js → chunk-MPALY3CL.js} +5 -5
  125. package/dist/{chunk-AGETTWMK.js → chunk-MRUJRFIX.js} +5 -5
  126. package/dist/{chunk-64R3IYAM.js → chunk-MVQMAIZM.js} +1 -1
  127. package/dist/{chunk-5Q3PFKB5.js → chunk-MZ26SYFY.js} +1 -1
  128. package/dist/{chunk-BYHKYYL6.js → chunk-NDEIZUMG.js} +1 -1
  129. package/dist/{chunk-2LDOLQ7F.js → chunk-NDKQDIWN.js} +5 -5
  130. package/dist/{chunk-WIOG2NOJ.js → chunk-NFJDLIRM.js} +5 -5
  131. package/dist/{chunk-IQWIYZB5.js → chunk-NU2YQSOP.js} +2 -2
  132. package/dist/{chunk-EGAV5LSX.js → chunk-O25B75XX.js} +1 -1
  133. package/dist/{chunk-4XZXY2AF.js → chunk-OQW42DOR.js} +1 -1
  134. package/dist/{chunk-3FBYM6O5.js → chunk-OUKDGO4N.js} +8 -8
  135. package/dist/{chunk-LYX55RI3.js → chunk-P6LB3I3D.js} +1 -1
  136. package/dist/{chunk-ZA6S5XVM.js → chunk-PF5CKD4C.js} +2 -2
  137. package/dist/{chunk-4YKRYIA7.js → chunk-PKHZTFBK.js} +1 -1
  138. package/dist/{chunk-TBLN4MDQ.js → chunk-PKIDVVAE.js} +2 -2
  139. package/dist/{chunk-YWR2WRDR.js → chunk-PUCPFBYO.js} +1 -1
  140. package/dist/{chunk-5AWV5R6E.js → chunk-PUIQFTCO.js} +6 -6
  141. package/dist/{chunk-PWBLGKQ3.js → chunk-Q3MNSM7W.js} +4 -4
  142. package/dist/chunk-QMUAY24U.js +8 -0
  143. package/dist/{chunk-VR4GSAFM.js → chunk-QO35WRYA.js} +17 -17
  144. package/dist/{chunk-5XNN2SSR.js → chunk-QRJRGP2K.js} +8 -8
  145. package/dist/{chunk-6TRE326A.js → chunk-QSW3YHPK.js} +4 -4
  146. package/dist/{chunk-T76X2SHR.js → chunk-R2QDO7NY.js} +3 -3
  147. package/dist/{chunk-JQDRM6UK.js → chunk-R5EJJ6HC.js} +1 -1
  148. package/dist/{chunk-V5QEPNPK.js → chunk-RBIGSJ2J.js} +1 -1
  149. package/dist/{chunk-N52D37FS.js → chunk-RPMWF42S.js} +5 -5
  150. package/dist/{chunk-QMYQ4B5A.js → chunk-RQNZ2PVW.js} +4 -4
  151. package/dist/{chunk-TRUPMMDJ.js → chunk-RYS3URDC.js} +11 -11
  152. package/dist/chunk-SKETTGCJ.js +2 -0
  153. package/dist/{chunk-IVY7CCTS.js → chunk-SVQJZF66.js} +5 -5
  154. package/dist/{chunk-EOWOVR55.js → chunk-SWO4VPOB.js} +1 -1
  155. package/dist/chunk-TIUFFVP5.js +9 -0
  156. package/dist/{chunk-T7O2TNNX.js → chunk-TXMAWCR7.js} +1 -1
  157. package/dist/{chunk-NCRLKFXD.js → chunk-U5DMF2TX.js} +1 -1
  158. package/dist/{chunk-T2ITXX7R.js → chunk-UB5TLWZN.js} +7 -7
  159. package/dist/{chunk-7IC4JMFA.js → chunk-UX5L3MOB.js} +4 -4
  160. package/dist/{chunk-4DBPKTVX.js → chunk-UXPZQID4.js} +15 -15
  161. package/dist/{chunk-H4YFANH5.js → chunk-VC42SDAC.js} +1 -1
  162. package/dist/{chunk-5Y6LGPZI.js → chunk-VG5NGCMQ.js} +7 -7
  163. package/dist/{chunk-I5XVZLDH.js → chunk-VO3ZB7C6.js} +7 -7
  164. package/dist/{chunk-KQSUSVMF.js → chunk-VSAI5TH7.js} +21 -21
  165. package/dist/{chunk-YQB5OYDC.js → chunk-VVVWVOG7.js} +1 -1
  166. package/dist/chunk-VVZE27M4.js +7 -0
  167. package/dist/{chunk-O4NPQ23Q.js → chunk-VXP5L6DI.js} +1 -1
  168. package/dist/{chunk-D7JY2KHG.js → chunk-W244OMOU.js} +6 -6
  169. package/dist/{chunk-NBKQADMY.js → chunk-WFANOFHG.js} +5 -5
  170. package/dist/{chunk-IZQ3XTD2.js → chunk-WUMHSI4U.js} +1 -1
  171. package/dist/chunk-X2PZMXDP.js +1 -0
  172. package/dist/{chunk-X4BKHXU5.js → chunk-X6TJR6M2.js} +7 -7
  173. package/dist/{chunk-R7JTTKG2.js → chunk-XILZGSMX.js} +3 -3
  174. package/dist/chunk-XOKANFQD.js +22 -0
  175. package/dist/{chunk-7YZJLFAK.js → chunk-XSJJPACH.js} +10 -10
  176. package/dist/{chunk-XI45TSEK.js → chunk-YFUMK2E7.js} +1 -1
  177. package/dist/{chunk-JVYSRH6U.js → chunk-YJSX6JAC.js} +1 -1
  178. package/dist/{chunk-2SJDTKQA.js → chunk-YL6LLHJA.js} +21 -21
  179. package/dist/{chunk-N3CTLEJS.js → chunk-YVTKTWZX.js} +6 -6
  180. package/dist/{chunk-QLOKT22X.js → chunk-ZCV377AG.js} +1 -1
  181. package/dist/{chunk-UZGVIHFI.js → chunk-ZF545DXX.js} +15 -15
  182. package/dist/{chunk-FEPBXJUR.js → chunk-ZG2HMC7S.js} +1 -1
  183. package/dist/{chunk-G6LOKIFC.js → chunk-ZMVCN4OA.js} +9 -9
  184. package/dist/{chunk-CB6ROWOC.js → chunk-ZOBLEXIU.js} +1 -1
  185. package/dist/{chunk-O426Q7KC.js → chunk-ZPCADTM5.js} +1 -1
  186. package/dist/{chunk-5VYBPDZ2.js → chunk-ZREDCRTL.js} +1 -1
  187. package/dist/data/DataTable.js +1 -1
  188. package/dist/data/Kanban.js +1 -1
  189. package/dist/data/ListFooter.js +1 -1
  190. package/dist/data/ListLoadError.js +1 -1
  191. package/dist/data/Pagination.js +1 -1
  192. package/dist/file-intake/index.js +1 -1
  193. package/dist/format/index.js +1 -1
  194. package/dist/forms/BorderInput.js +1 -1
  195. package/dist/forms/BrandAssetEditor.js +1 -1
  196. package/dist/forms/Calendar.js +1 -1
  197. package/dist/forms/ColorPicker.js +1 -1
  198. package/dist/forms/ComposerAttachments.js +1 -1
  199. package/dist/forms/CornersInput.js +1 -1
  200. package/dist/forms/DatePicker.js +1 -1
  201. package/dist/forms/DateRangePicker.js +1 -1
  202. package/dist/forms/DateTimePicker.js +1 -1
  203. package/dist/forms/DisplayChips.js +1 -1
  204. package/dist/forms/FilePicker.js +1 -1
  205. package/dist/forms/FormErrorSummary.js +1 -1
  206. package/dist/forms/IconPicker.js +1 -1
  207. package/dist/forms/ImageFocusPoint.js +1 -1
  208. package/dist/forms/InputNumber.js +1 -1
  209. package/dist/forms/LinkPicker.js +1 -1
  210. package/dist/forms/MediaLibrary.js +1 -1
  211. package/dist/forms/MediaUploadField.js +1 -1
  212. package/dist/forms/MediaUploadGrid.js +1 -1
  213. package/dist/forms/MediaUsedInList.js +1 -1
  214. package/dist/forms/NumericKeypad.js +1 -1
  215. package/dist/forms/PositionInput.js +1 -1
  216. package/dist/forms/Select.js +1 -1
  217. package/dist/forms/SidesInput.js +1 -1
  218. package/dist/forms/Slider.js +1 -1
  219. package/dist/forms/Snippet.js +1 -1
  220. package/dist/forms/SplitButton.js +1 -1
  221. package/dist/forms/TagInput.js +1 -1
  222. package/dist/forms/TextToolbar.d.ts +8 -2
  223. package/dist/forms/TextToolbar.js +1 -1
  224. package/dist/forms/TimePicker.js +1 -1
  225. package/dist/forms/WidthsBar.js +1 -1
  226. package/dist/forms/mediaLibraryMenu.js +1 -1
  227. package/dist/forms/mediaMoveItems.js +1 -1
  228. package/dist/forms/textAlign.js +1 -1
  229. package/dist/forms/useFileIntake.js +1 -1
  230. package/dist/icons/index.js +1 -1
  231. package/dist/index.d.ts +9 -1
  232. package/dist/index.js +154 -154
  233. package/dist/locales/zh-Hans.js +1 -1
  234. package/dist/map/index.js +7 -7
  235. package/dist/page-tabs/index.js +5 -5
  236. package/dist/pdf/index.js +1 -1
  237. package/dist/shell/Accordion.js +1 -1
  238. package/dist/shell/AppUpdateBanner.js +1 -1
  239. package/dist/shell/Avatar.js +1 -1
  240. package/dist/shell/Banner.js +1 -1
  241. package/dist/shell/Breadcrumbs.js +1 -1
  242. package/dist/shell/BudgetBar.js +1 -1
  243. package/dist/shell/Card.js +1 -1
  244. package/dist/shell/ColoredBadge.js +1 -1
  245. package/dist/shell/ConfirmDialog.js +1 -1
  246. package/dist/shell/ContainerFillChart.js +1 -1
  247. package/dist/shell/ContextMenu.js +1 -1
  248. package/dist/shell/CountBadge.js +1 -1
  249. package/dist/shell/Dialog.js +1 -1
  250. package/dist/shell/Drawer.js +1 -1
  251. package/dist/shell/DropdownMenu.js +1 -1
  252. package/dist/shell/EditableGrid.js +1 -1
  253. package/dist/shell/EmptyState.js +1 -1
  254. package/dist/shell/GlobalSearch.js +1 -1
  255. package/dist/shell/HelpCenter.js +1 -1
  256. package/dist/shell/IconRail.js +1 -1
  257. package/dist/shell/ImageLightbox.js +1 -1
  258. package/dist/shell/ItemCount.js +1 -1
  259. package/dist/shell/LanguageSelect.js +1 -1
  260. package/dist/shell/Markdown.js +1 -1
  261. package/dist/shell/MetricBar.js +1 -1
  262. package/dist/shell/MetricBarLegend.js +1 -1
  263. package/dist/shell/MilestoneTimeline.js +1 -1
  264. package/dist/shell/PageHeader.js +1 -1
  265. package/dist/shell/PopupMenu.js +1 -1
  266. package/dist/shell/ProductionTimeline.js +1 -1
  267. package/dist/shell/ResizeHandle.js +1 -1
  268. package/dist/shell/Result.js +1 -1
  269. package/dist/shell/SearchableSelect.js +1 -1
  270. package/dist/shell/SettingReset.js +1 -1
  271. package/dist/shell/SettingRow.js +1 -1
  272. package/dist/shell/SidebarLayout.js +1 -1
  273. package/dist/shell/SidebarNav.js +1 -1
  274. package/dist/shell/SortableList.js +1 -1
  275. package/dist/shell/Statistic.js +1 -1
  276. package/dist/shell/TimeAgo.js +1 -1
  277. package/dist/shell/TimelineTrack.js +1 -1
  278. package/dist/shell/TopNav.js +1 -1
  279. package/dist/shell/TransferProgress.js +1 -1
  280. package/dist/shell/Tree.js +1 -1
  281. package/dist/shell/language.js +1 -1
  282. package/dist/shell/strings.d.ts +2 -0
  283. package/dist/shell/strings.js +1 -1
  284. package/dist/shell/toast.js +1 -1
  285. package/dist/telemetry/index.js +1 -1
  286. package/dist/templates/AuthScreen.js +1 -1
  287. package/dist/templates/ChatTemplate.js +1 -1
  288. package/dist/templates/CheckoutTemplate.js +1 -1
  289. package/dist/templates/DashboardTemplate.js +1 -1
  290. package/dist/templates/DataTablePage.js +1 -1
  291. package/dist/templates/EmailTemplate.js +1 -1
  292. package/dist/templates/ErrorBoundary.js +1 -1
  293. package/dist/templates/ErrorPage.js +1 -1
  294. package/dist/templates/FormLayoutPage.js +1 -1
  295. package/dist/templates/GalleryTemplate.js +1 -1
  296. package/dist/ui/index.js +1 -1
  297. package/dist/version.js +1 -1
  298. package/package.json +1 -1
  299. package/dist/Calculator-IZXBE6R7.js +0 -29
  300. package/dist/Sidebar-TLJ7N3AQ.js +0 -44
  301. package/dist/chunk-3XRBVYTO.js +0 -2
  302. package/dist/chunk-4CPE5NBC.js +0 -8
  303. package/dist/chunk-5R6RNUDB.js +0 -7
  304. package/dist/chunk-GCB5S2OI.js +0 -8
  305. package/dist/chunk-GVH3NG6G.js +0 -22
  306. package/dist/chunk-HHOXLECO.js +0 -29
  307. package/dist/chunk-J7OKOVSL.js +0 -11
  308. package/dist/chunk-JG6DATT4.js +0 -1
  309. package/dist/chunk-LFPJ263N.js +0 -6
  310. package/dist/chunk-PEM7UXQ3.js +0 -1
  311. package/dist/chunk-POCQ7ZL4.js +0 -3
  312. package/dist/chunk-PVR4KU7H.js +0 -7
  313. package/dist/chunk-QYJQAY6C.js +0 -2
  314. package/dist/chunk-RSHNWBW2.js +0 -4
  315. package/dist/chunk-SC6HJBQA.js +0 -8
  316. package/dist/chunk-UYDP4DK3.js +0 -9
@@ -1,16 +1,16 @@
1
- import{Popover as e}from"./chunk-7JGR7WPD.js";import{InputNumber_default as r}from"./chunk-ODOEH5QZ.js";import{InSettingRowContext as a}from"./chunk-L65BESIE.js";import{parseHexColor as n,hexToHsv as o,hsvToHex as t,hexReadout as l,HUE_GRADIENT as i,HEX_MAX_LENGTH as s,svFromPoint as c,hueFromPoint as u}from"./chunk-S6OB6HJB.js";import{inputClasses as d}from"./chunk-AYZY3YNC.js";import{Tooltip as h}from"./chunk-BCDG4N6L.js";import{useShellStrings as g}from"./chunk-PEM7UXQ3.js";import{forwardRef as p,useState as b,useRef as m,useEffect as f,useId as v}from"react";import{jsx as w,jsxs as x}from"react/jsx-runtime";var k={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 C(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=C(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 $({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",k[e],a].filter(Boolean).join(" ")}var z=p(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
2
- return w("button",{ref:l,type:o,"aria-pressed":a,className:$({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(e)})})}),D=(e,r,a)=>Math.min(a,Math.max(r,e)),P=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:D(e.s+o[0],0,1),v:D(e.v+o[1],0,1)}:null}function A(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return D(e-n,0,359);case"ArrowRight":case"ArrowUp":return D(e+n,0,359);case"PageDown":return D(e-10,0,359);case"PageUp":return D(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 j(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return D(e-n,0,100);case"ArrowRight":case"ArrowUp":return D(e+n,0,100);case"PageDown":return D(e-10,0,100);case"PageUp":return D(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function S({value:e,onChange:r,label:s,presets:d,clearable:p=!1,fallback:v,dragWrites:k="live",disabled:$=!1,opacity:D,onOpacityChange:S,onClose:B,id:E,className:K=""}){const L=g().color,R=C(D),U=e=>{const r=C(e);$||r===R||S?.(r)},H=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:R},W=n(v??""),[X,Y]=b(()=>o(e||W||"")),q=m(e);f(()=>{e!==q.current&&(q.current=e,e?Y(o(e)):W&&Y(o(W)))},[e]);const G=a=>{$||a===e||(q.current=a,r(a))},J=e=>{const r=n(e);r&&(Y(o(r)),G(r))},Q=e=>{Y(e),G(t(e))},[Z,F]=b(!1),V=m(X);V.current=X;const _=e=>({onPointerDown:r=>{if($||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,V.current);"end"===k?(F(!0),Y(a)):Q(a)},onPointerMove:r=>{if($||!(1&r.buttons))return;const a=e(r,V.current);"end"===k?Y(a):Q(a)},onPointerUp:r=>{"end"===k&&Z&&(F(!1),Q(e(r,V.current)))}}),ee=_((e,r)=>({...r,...c(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),re=_((e,r)=>({...r,h:u(e.clientX,e.currentTarget.getBoundingClientRect())})),ae=Z?t(X):e,ne=e=>`${Math.round(100*e)}%`,oe=(d??[]).map(P),te=n(e),le=ae||W||"";
1
+ import{Popover as e}from"./chunk-7JGR7WPD.js";import{InputNumber_default as r}from"./chunk-6TCJOVFX.js";import{InSettingRowContext as a}from"./chunk-L65BESIE.js";import{parseHexColor as n,hexToHsv as o,hsvToHex as t,hexReadout as l,HUE_GRADIENT as i,HEX_MAX_LENGTH as s,svFromPoint as c,hueFromPoint as u}from"./chunk-S6OB6HJB.js";import{inputClasses as d}from"./chunk-AYZY3YNC.js";import{Tooltip as h}from"./chunk-BCDG4N6L.js";import{useShellStrings as g}from"./chunk-X2PZMXDP.js";import{forwardRef as p,useState as b,useRef as m,useEffect as f,useId as v}from"react";import{jsx as w,jsxs as x}from"react/jsx-runtime";var k={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 C(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=C(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 $({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",k[e],a].filter(Boolean).join(" ")}var z=p(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
2
+ return w("button",{ref:l,type:o,"aria-pressed":a,className:$({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(e)})})}),D=(e,r,a)=>Math.min(a,Math.max(r,e)),P=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:D(e.s+o[0],0,1),v:D(e.v+o[1],0,1)}:null}function A(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return D(e-n,0,359);case"ArrowRight":case"ArrowUp":return D(e+n,0,359);case"PageDown":return D(e-10,0,359);case"PageUp":return D(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 j(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return D(e-n,0,100);case"ArrowRight":case"ArrowUp":return D(e+n,0,100);case"PageDown":return D(e-10,0,100);case"PageUp":return D(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function S({value:e,onChange:r,label:s,presets:d,clearable:p=!1,fallback:v,dragWrites:k="live",disabled:$=!1,opacity:D,onOpacityChange:S,onClose:B,id:T,className:K=""}){const R=g().color,E=C(D),U=e=>{const r=C(e);$||r===E||S?.(r)},X=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:E},H=n(v??""),[W,Y]=b(()=>o(e||H||"")),q=m(e);f(()=>{e!==q.current&&(q.current=e,e?Y(o(e)):H&&Y(o(H)))},[e]);const J=a=>{$||a===e||(q.current=a,r(a))},F=e=>{const r=n(e);r&&(Y(o(r)),J(r))},G=e=>{Y(e),J(t(e))},[V,Z]=b(!1),Q=m(W);Q.current=W;const _=e=>({onPointerDown:r=>{if($||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,Q.current);"end"===k?(Z(!0),Y(a)):G(a)},onPointerMove:r=>{if($||!(1&r.buttons))return;const a=e(r,Q.current);"end"===k?Y(a):G(a)},onPointerUp:r=>{"end"===k&&V&&(Z(!1),G(e(r,Q.current)))}}),ee=_((e,r)=>({...r,...c(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),re=_((e,r)=>({...r,h:u(e.clientX,e.currentTarget.getBoundingClientRect())})),ae=V?t(W):e,ne=e=>`${Math.round(100*e)}%`,oe=(d??[]).map(P),te=n(e),le=ae||H||"";
3
3
  /* @__PURE__ */
4
- return w(a.Provider,{value:!1,children:/* @__PURE__ */x("div",{id:E,className:`flex w-56 flex-col gap-3 ${$?"opacity-60":""} ${K}`.trim(),onKeyDown:e=>{"Escape"===e.key&&B&&(e.preventDefault(),e.stopPropagation(),B())},children:[(oe.length>0||p)&&/* @__PURE__ */x("div",{role:"group","aria-label":L.presets,className:"flex flex-wrap gap-2",children:[p&&/* @__PURE__ */w(h,{content:L.clear,children:/* @__PURE__ */w(z,{color:"",size:"sm","aria-label":L.clear,selected:""===e,disabled:$,onClick:()=>{$||""===e||(q.current="",r(""))}})}),oe.map(e=>{const r=n(e.value),a=e.label?`${e.label} · ${l(r??e.value)}`:l(r??e.value);/* @__PURE__ */
5
- return w(h,{content:a,children:/* @__PURE__ */w(z,{color:r??e.value,size:"sm","aria-label":a,selected:null!==r&&r===te,disabled:$,onClick:()=>J(e.value)})},`${e.label??""}:${e.value}`)})]}),
6
- /* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":L.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*X.v),"aria-valuetext":L.squareValue(Math.round(100*X.s),Math.round(100*X.v)),"aria-disabled":$||void 0,"data-color-square":"",onKeyDown:e=>{if($)return;const r=I(X,e.key,e.shiftKey);r&&(e.preventDefault(),Q(r))},...ee,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:t({h:X.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */w("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:ne(X.s),top:ne(1-X.v),...M}})}),
7
- /* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":L.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(X.h),"aria-orientation":"horizontal","aria-disabled":$||void 0,"data-color-hue":"",onKeyDown:e=>{if($)return;const r=A(X.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),Q({...X,h:r}))},...re,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:i},children:/* @__PURE__ */w("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:X.h/360*100+"%",background:t({h:X.h,s:1,v:1}),...M}})}),S&&/* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":L.opacity(s),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":R,"aria-valuetext":`${R}%`,"aria-orientation":"horizontal","aria-disabled":$||void 0,"data-color-opacity":"",onKeyDown:e=>{if($)return;const r=j(R,e.key,e.shiftKey);null!==r&&(e.preventDefault(),U(r))},onPointerDown:e=>{$||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),U(H(e)))},onPointerMove:e=>{!$&&1&e.buttons&&U(H(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, ${le||"black"}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`},children:/* @__PURE__ */w("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:`${R}%`,...N(le||"black",R),...M}})}),
4
+ return w(a.Provider,{value:!1,children:/* @__PURE__ */x("div",{id:T,className:`flex w-56 flex-col gap-3 ${$?"opacity-60":""} ${K}`.trim(),onKeyDown:e=>{"Escape"===e.key&&B&&(e.preventDefault(),e.stopPropagation(),B())},children:[(oe.length>0||p)&&/* @__PURE__ */x("div",{role:"group","aria-label":R.presets,className:"flex flex-wrap gap-2",children:[p&&/* @__PURE__ */w(h,{content:R.clear,children:/* @__PURE__ */w(z,{color:"",size:"sm","aria-label":R.clear,selected:""===e,disabled:$,onClick:()=>{$||""===e||(q.current="",r(""))}})}),oe.map(e=>{const r=n(e.value),a=e.label?`${e.label} · ${l(r??e.value)}`:l(r??e.value);/* @__PURE__ */
5
+ return w(h,{content:a,children:/* @__PURE__ */w(z,{color:r??e.value,size:"sm","aria-label":a,selected:null!==r&&r===te,disabled:$,onClick:()=>F(e.value)})},`${e.label??""}:${e.value}`)})]}),
6
+ /* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":R.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*W.v),"aria-valuetext":R.squareValue(Math.round(100*W.s),Math.round(100*W.v)),"aria-disabled":$||void 0,"data-color-square":"",onKeyDown:e=>{if($)return;const r=I(W,e.key,e.shiftKey);r&&(e.preventDefault(),G(r))},...ee,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:t({h:W.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */w("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:ne(W.s),top:ne(1-W.v),...M}})}),
7
+ /* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":R.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(W.h),"aria-orientation":"horizontal","aria-disabled":$||void 0,"data-color-hue":"",onKeyDown:e=>{if($)return;const r=A(W.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),G({...W,h:r}))},...re,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:i},children:/* @__PURE__ */w("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:W.h/360*100+"%",background:t({h:W.h,s:1,v:1}),...M}})}),S&&/* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":R.opacity(s),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":E,"aria-valuetext":`${E}%`,"aria-orientation":"horizontal","aria-disabled":$||void 0,"data-color-opacity":"",onKeyDown:e=>{if($)return;const r=j(E,e.key,e.shiftKey);null!==r&&(e.preventDefault(),U(r))},onPointerDown:e=>{$||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),U(X(e)))},onPointerMove:e=>{!$&&1&e.buttons&&U(X(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, ${le||"black"}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`},children:/* @__PURE__ */w("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:`${E}%`,...N(le||"black",E),...M}})}),
8
8
  /* @__PURE__ */x("div",{className:"flex items-center gap-2",children:[
9
- /* @__PURE__ */w("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:N(le,S?R:null)}),
10
- /* @__PURE__ */w(O,{value:ae,placeholder:!e&&W?l(W):void 0,onChange:J,label:L.hex(s),disabled:$}),S&&/* @__PURE__ */w(T,{value:R,onChange:U,label:L.opacity(s),disabled:$})]})]})})}var B={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)]"},E={sm:"h-6",md:"h-8",lg:"h-10"},K=["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 O({value:e,onChange:r,label:a,placeholder:o,disabled:t,id:i,size:c="md",look:u="box",className:h=""}){const[g,p]=b(null),m="text"===u?`${K} ${E[c]} ${h}`.trim():d({size:c,className:`${B[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
11
- return w("input",{id:i,type:"text",value:g??(e?l(e):""),"aria-label":a,placeholder:o,maxLength:s,spellCheck:!1,autoComplete:"off",disabled:t,onChange:a=>{p(a.target.value);const o=n(a.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),p(null))},onBlur:()=>p(null),"data-hex-look":u,className:m})}function T({value:e,onChange:a,label:n,disabled:o,size:t="md"}){/* @__PURE__ */
12
- return w("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */w(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:a,label:o,presets:t,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:h=!1,opacity:p,onOpacityChange:b,size:m="md",align:f="start",open:k,onOpenChange:y,className:z=""}){const D=g().color,P=C(p),I=v(),A=n(s??""),M=r||A||"",j=r?l(r):A?l(A):D.none;
9
+ /* @__PURE__ */w("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:N(le,S?E:null)}),
10
+ /* @__PURE__ */w(L,{value:ae,placeholder:!e&&H?l(H):void 0,onChange:F,label:R.hex(s),disabled:$}),S&&/* @__PURE__ */w(O,{value:E,onChange:U,label:R.opacity(s),disabled:$})]})]})})}var B={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)]"},T={sm:"h-6",md:"h-8",lg:"h-10"},K=["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 L({value:e,onChange:r,label:a,placeholder:o,disabled:t,id:i,size:c="md",look:u="box",className:h=""}){const[g,p]=b(null),m="text"===u?`${K} ${T[c]} ${h}`.trim():d({size:c,className:`${B[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
11
+ return w("input",{id:i,type:"text",value:g??(e?l(e):""),"aria-label":a,placeholder:o,maxLength:s,spellCheck:!1,autoComplete:"off",disabled:t,onChange:a=>{p(a.target.value);const o=n(a.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),p(null))},onBlur:()=>p(null),"data-hex-look":u,className:m})}function O({value:e,onChange:a,label:n,disabled:o,size:t="md"}){/* @__PURE__ */
12
+ return w("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */w(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:a,label:o,presets:t,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:h=!1,opacity:p,onOpacityChange:b,size:m="md",align:f="start",open:k,onOpenChange:y,className:z=""}){const D=g().color,P=C(p),I=v(),A=n(s??""),M=r||A||"",j=r?l(r):A?l(A):D.none;
13
13
  /* @__PURE__ */
14
14
  return x("div",{className:`inline-flex items-center ${b?"flex-wrap justify-end gap-1":h?"gap-1":"gap-2"} ${z}`.trim(),children:[
15
15
  /* @__PURE__ */w(e,{id:d,trigger:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(M,b?P:null)}),triggerLabel:D.swatch(o,j),triggerClassName:$({size:m}),"aria-label":D.panel(o),align:f,open:k,onOpenChange:y,disabled:u,children:/* @__PURE__ */w(S,{id:I,value:r,onChange:a,label:o,presets:t,clearable:i,fallback:s,dragWrites:c,disabled:u,opacity:p,onOpacityChange:b})}),h&&
16
- /* @__PURE__ */w(O,{value:r,placeholder:!r&&A?l(A):void 0,onChange:e=>{u||e===r||a(e)},label:D.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */w(T,{value:P,onChange:e=>{u||e===P||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{L as ColorPicker,S as ColorPickerPanel,z as ColorSwatch,O as HexInput,y as NO_COLOR_FILL,C as clampOpacity,N as colorFill,$ as colorSwatchClasses,A as stepHue,j as stepOpacity,I as stepSquare};
16
+ /* @__PURE__ */w(L,{value:r,placeholder:!r&&A?l(A):void 0,onChange:e=>{u||e===r||a(e)},label:D.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */w(O,{value:P,onChange:e=>{u||e===P||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{R as ColorPicker,S as ColorPickerPanel,z as ColorSwatch,L as HexInput,y as NO_COLOR_FILL,C as clampOpacity,N as colorFill,$ as colorSwatchClasses,A as stepHue,j as stepOpacity,I as stepSquare};
@@ -1,14 +1,14 @@
1
- import{CountBadge as e}from"./chunk-5Q3PFKB5.js";import{isShown as t}from"./chunk-HCP7WOAL.js";import{SettingRowNameContext as a,SettingAutoContext as i,InSettingRowContext as n}from"./chunk-L65BESIE.js";import{useShellStrings as s}from"./chunk-PEM7UXQ3.js";import{useId as l}from"react";import{jsx as r,jsxs as d}from"react/jsx-runtime";var c={default:{pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},compact:{pad:"py-2",gap:"gap-2",text:"text-sm",bodyTop:"mt-2",bodyPad:"pt-2"}};function m({label:m,icon:o,action:p,value:h,readout:u,description:x,children:f,controlId:v,labelId:g,unknownText:N="—",quiet:w=!1,size:y="default",viewState:b,divider:k=!0,showWhen:$,values:j,context:P,className:T=""}){const B=s(),E=l();if(!t($,j,P))return null;const I=c[y],F=void 0!==h||void 0===f&&null==p,L=null==h||""===h,Q=w?"text-gray-500":"text-gray-800",S=L?"text-gray-400":w?"text-gray-500":"text-gray-900",V=null!=u&&!1!==u,W=`${I.text} font-medium ${Q}${"compact"===y?" whitespace-nowrap":""}`,q=g??("compact"===y?E:void 0),z=v?/* @__PURE__ */r("label",{htmlFor:v,id:q,className:W,children:m}):/* @__PURE__ */r("span",{id:q,className:W,children:m}),A="auto"===b?/* @__PURE__ */r("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-line px-1 text-2xs font-normal leading-4 text-ink-faint",children:B.settingView.auto}):"edited"===b?/* @__PURE__ */d("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
1
+ import{CountBadge as e}from"./chunk-MZ26SYFY.js";import{SettingRowNameContext as t,SettingAutoContext as a,InSettingRowContext as i}from"./chunk-L65BESIE.js";import{isShown as n}from"./chunk-HCP7WOAL.js";import{useShellStrings as s}from"./chunk-X2PZMXDP.js";import{useId as l}from"react";import{jsx as r,jsxs as d}from"react/jsx-runtime";var c={default:{pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},compact:{pad:"py-2",gap:"gap-2",text:"text-sm",bodyTop:"mt-2",bodyPad:"pt-2"}};function m({label:m,icon:o,action:p,value:h,readout:u,description:x,children:f,controlId:v,labelId:g,unknownText:N="—",quiet:w=!1,size:y="default",viewState:b,divider:k=!0,showWhen:$,values:j,context:P,className:T=""}){const I=s(),S=l();if(!n($,j,P))return null;const B=c[y],E=void 0!==h||void 0===f&&null==p,F=null==h||""===h,L=w?"text-gray-500":"text-gray-800",M=F?"text-gray-400":w?"text-gray-500":"text-gray-900",V=null!=u&&!1!==u,W=`${B.text} font-medium ${L}${"compact"===y?" whitespace-nowrap":""}`,X=g??("compact"===y?S:void 0),Y=v?/* @__PURE__ */r("label",{htmlFor:v,id:X,className:W,children:m}):/* @__PURE__ */r("span",{id:X,className:W,children:m}),Z="auto"===b?/* @__PURE__ */r("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-line px-1 text-2xs font-normal leading-4 text-ink-faint",children:I.settingView.auto}):"edited"===b?/* @__PURE__ */d("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
2
2
  /* @__PURE__ */r("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */r(e,{dot:!0,tone:"accent"})}),
3
- /* @__PURE__ */r("span",{className:"sr-only",children:B.settingView.edited})]}):null,C=/* @__PURE__ */r(a.Provider,{value:q,children:/* @__PURE__ */r(i.Provider,{value:"auto"===b,children:L?N:h})}),H=[k?"border-t border-line-subtle first:border-t-0":"",I.pad,T].filter(Boolean).join(" "),K=null!=f&&!1!==f&&/* @__PURE__ */r("div",{className:`${I.bodyTop} border-t border-line-subtle ${I.bodyPad}`,children:f});/* @__PURE__ */
4
- return d("div",V?{className:H,"data-setting-row":"compact"===y?y:void 0,children:[
3
+ /* @__PURE__ */r("span",{className:"sr-only",children:I.settingView.edited})]}):null,q=/* @__PURE__ */r(t.Provider,{value:X,children:/* @__PURE__ */r(a.Provider,{value:"auto"===b,children:F?N:h})}),z=[k?"border-t border-line-subtle first:border-t-0":"",B.pad,T].filter(Boolean).join(" "),A=null!=f&&!1!==f&&/* @__PURE__ */r("div",{className:`${B.bodyTop} border-t border-line-subtle ${B.bodyPad}`,children:f});/* @__PURE__ */
4
+ return d("div",V?{className:z,"data-setting-row":"compact"===y?y:void 0,children:[
5
5
  /* @__PURE__ */d("div",{"data-setting-line":"",className:"flex flex-wrap items-center justify-between gap-x-2 gap-y-2",children:[
6
- /* @__PURE__ */r("div",{"data-setting-name":"compact"===y?"":void 0,className:"flex-1 basis-0",children:/* @__PURE__ */d("div",{className:`flex min-w-0 items-center gap-2 ${Q}`,children:[null!=o&&/* @__PURE__ */r("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),z,A]})}),
6
+ /* @__PURE__ */r("div",{"data-setting-name":"compact"===y?"":void 0,className:"flex-1 basis-0",children:/* @__PURE__ */d("div",{className:`flex min-w-0 items-center gap-2 ${L}`,children:[null!=o&&/* @__PURE__ */r("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),Y,Z]})}),
7
7
  /* @__PURE__ */d("div",{"data-setting-end":"",className:"ml-auto flex shrink-0 items-center gap-1",children:[
8
- /* @__PURE__ */r("span",{"data-setting-readout":"",className:`whitespace-nowrap ${I.text} ${w?"text-ink-faint":"text-ink-strongest"}`,children:u}),("compact"===y||null!=p)&&/* @__PURE__ */r("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:p})]})]}),x&&/* @__PURE__ */r("p",{className:"mt-0.5 text-xs text-ink-faint",children:x}),void 0!==h&&/* @__PURE__ */r("div",{"data-setting-value":"",className:`mt-2 flex justify-end ${I.text} ${S}`,children:/* @__PURE__ */r(n.Provider,{value:"compact"===y,children:C})}),K]}:{className:H,"data-setting-row":"compact"===y?y:void 0,children:[
9
- /* @__PURE__ */d("div",{className:"compact"===y?"flex flex-wrap items-center justify-between gap-x-2 gap-y-2":`flex items-center justify-between ${I.gap}`,children:[
8
+ /* @__PURE__ */r("span",{"data-setting-readout":"",className:`whitespace-nowrap ${B.text} ${w?"text-ink-faint":"text-ink-strongest"}`,children:u}),("compact"===y||null!=p)&&/* @__PURE__ */r("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:p})]})]}),x&&/* @__PURE__ */r("p",{className:"mt-0.5 text-xs text-ink-faint",children:x}),void 0!==h&&/* @__PURE__ */r("div",{"data-setting-value":"",className:`mt-2 flex justify-end ${B.text} ${M}`,children:/* @__PURE__ */r(i.Provider,{value:"compact"===y,children:q})}),A]}:{className:z,"data-setting-row":"compact"===y?y:void 0,children:[
9
+ /* @__PURE__ */d("div",{className:"compact"===y?"flex flex-wrap items-center justify-between gap-x-2 gap-y-2":`flex items-center justify-between ${B.gap}`,children:[
10
10
  /* @__PURE__ */d("div",{"data-setting-name":"compact"===y?"":void 0,className:"compact"===y?"flex-1 basis-0":"min-w-0 flex-1",children:[null!=o?
11
- /* @__PURE__ */d("div",{className:`flex min-w-0 items-center gap-2 ${Q}`,children:[
12
- /* @__PURE__ */r("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),z,A]}):A?/* @__PURE__ */d("div",{className:"flex min-w-0 items-center gap-2",children:[z,A]}):z,x&&/* @__PURE__ */r("p",{className:"mt-0.5 text-xs text-ink-faint",children:x})]}),"compact"===y?
13
- /* @__PURE__ */d("div",{"data-setting-end":"",className:"ml-auto flex shrink-0 items-center gap-1",children:[F&&/* @__PURE__ */r("div",{"data-setting-value":"",className:`flex items-center justify-end ${I.text} ${S}`,children:/* @__PURE__ */r(n.Provider,{value:!0,children:C})}),
14
- /* @__PURE__ */r("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:p})]}):null!=p?/* @__PURE__ */d("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[F&&/* @__PURE__ */r("div",{className:`${I.text} ${S}`,children:C}),p]}):F&&/* @__PURE__ */r("div",{className:`shrink-0 ${I.text} ${S}`,children:C})]}),K]})}export{m as SettingRow};
11
+ /* @__PURE__ */d("div",{className:`flex min-w-0 items-center gap-2 ${L}`,children:[
12
+ /* @__PURE__ */r("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),Y,Z]}):Z?/* @__PURE__ */d("div",{className:"flex min-w-0 items-center gap-2",children:[Y,Z]}):Y,x&&/* @__PURE__ */r("p",{className:"mt-0.5 text-xs text-ink-faint",children:x})]}),"compact"===y?
13
+ /* @__PURE__ */d("div",{"data-setting-end":"",className:"ml-auto flex shrink-0 items-center gap-1",children:[E&&/* @__PURE__ */r("div",{"data-setting-value":"",className:`flex items-center justify-end ${B.text} ${M}`,children:/* @__PURE__ */r(i.Provider,{value:!0,children:q})}),
14
+ /* @__PURE__ */r("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:p})]}):null!=p?/* @__PURE__ */d("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[E&&/* @__PURE__ */r("div",{className:`${B.text} ${M}`,children:q}),p]}):E&&/* @__PURE__ */r("div",{className:`shrink-0 ${B.text} ${M}`,children:q})]}),A]})}export{m as SettingRow};
@@ -1,7 +1,7 @@
1
- import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-JVYSRH6U.js";import{Icon as i}from"./chunk-FSPFV4MI.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
2
- return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:P,rowRef:D,className:B=""}){const I=x||!!p,S=n(u),$=l(null),A=s(),F=[P?.["aria-describedby"],j?A:void 0].filter(Boolean).join(" ")||void 0,H=P?.tabIndex;a(()=>{const e=$.current;if(!e||void 0!==H)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const J="comfortable"===S?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},K=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
1
+ import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-YJSX6JAC.js";import{Icon as i}from"./chunk-FSPFV4MI.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
2
+ return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:P,rowRef:D,className:A=""}){const B=x||!!p,I=n(u),J=l(null),S=s(),$=[P?.["aria-describedby"],j?S:void 0].filter(Boolean).join(" ")||void 0,C=P?.tabIndex;a(()=>{const e=J.current;if(!e||void 0!==C)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const F="comfortable"===I?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},K=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
3
3
  /* @__PURE__ */d("span",{"data-list-row-name":"",className:"min-w-0 flex-1 break-words font-semibold text-(--ink-strongest)",children:f})]});/* @__PURE__ */
4
- return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":I||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-surface transition-colors duration-(--motion-fast)",w?"":I?"border-blue-300":"border-line hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${J[k]}`}),
5
- /* @__PURE__ */c("div",{...P,ref:e=>{var r,t;$.current=e,t=e,"function"==typeof(r=D)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":P?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":F,onKeyDown:e=>{if(P?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",B].filter(Boolean).join(" "),children:[
4
+ return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":B||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-surface transition-colors duration-(--motion-fast)",w?"":B?"border-blue-300":"border-line hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${F[k]}`}),
5
+ /* @__PURE__ */c("div",{...P,ref:e=>{var r,t;J.current=e,t=e,"function"==typeof(r=D)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":P?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":$,onKeyDown:e=>{if(P?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",A].filter(Boolean).join(" "),children:[
6
6
  /* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[K&&(h?/* @__PURE__ */c("button",{type:"button","aria-expanded":!!p,onClick:h,"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 self-stretch rounded-sm py-2 text-left text-(--ink-strongest) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[K,
7
- /* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:K})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:A})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};
7
+ /* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:K})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:S})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};
@@ -1,12 +1,12 @@
1
- import{IconButton_default as e}from"./chunk-RUTUVS4H.js";import{CloseGlyph as t}from"./chunk-D4KZOYXQ.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-LYX55RI3.js";import{Button_default as s}from"./chunk-NHH2MXFU.js";import{Icon as i}from"./chunk-FSPFV4MI.js";import{useShellStrings as c}from"./chunk-PEM7UXQ3.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
1
+ import{CloseGlyph as e}from"./chunk-7BDZZANS.js";import{IconButton_default as t}from"./chunk-RUTUVS4H.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-P6LB3I3D.js";import{Button_default as s}from"./chunk-NHH2MXFU.js";import{Icon as i}from"./chunk-FSPFV4MI.js";import{useShellStrings as c}from"./chunk-X2PZMXDP.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
2
2
  return d(i,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function p({className:e="h-4 w-4"}){/* @__PURE__ */
3
3
  return d(i,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function h({intake:e,dropLabel:t,className:n="",children:r}){const a=c().files;/* @__PURE__ */
4
4
  return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,children:[r,
5
- /* @__PURE__ */d("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */d("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function f({files:e,onRemove:r,disabled:a=!1,className:s=""}){const i=c().files,m=l(/* @__PURE__ */new Map);o(()=>{const t=new Set(e);for(const[e,n]of m.current)t.has(e)||(URL.revokeObjectURL(n),m.current.delete(e))},[e]),o(()=>()=>{for(const e of m.current.values())URL.revokeObjectURL(e);m.current.clear()},[]);const h=e=>{if(!e.type.startsWith("image/")||"undefined"==typeof URL||"function"!=typeof URL.createObjectURL)return null;let t=m.current.get(e);return t||(t=URL.createObjectURL(e),m.current.set(e,t)),t};return 0===e.length?null:/* @__PURE__ */d("ul",{className:`flex flex-wrap gap-2 ${s}`,children:e.map((e,s)=>{const c=h(e);/* @__PURE__ */
5
+ /* @__PURE__ */d("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */d("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function f({files:t,onRemove:r,disabled:a=!1,className:s=""}){const i=c().files,m=l(/* @__PURE__ */new Map);o(()=>{const e=new Set(t);for(const[t,n]of m.current)e.has(t)||(URL.revokeObjectURL(n),m.current.delete(t))},[t]),o(()=>()=>{for(const e of m.current.values())URL.revokeObjectURL(e);m.current.clear()},[]);const h=e=>{if(!e.type.startsWith("image/")||"undefined"==typeof URL||"function"!=typeof URL.createObjectURL)return null;let t=m.current.get(e);return t||(t=URL.createObjectURL(e),m.current.set(e,t)),t};return 0===t.length?null:/* @__PURE__ */d("ul",{className:`flex flex-wrap gap-2 ${s}`,children:t.map((t,s)=>{const c=h(t);/* @__PURE__ */
6
6
  return u("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-line bg-surface-sunken py-1 pl-2 pr-1 text-xs text-ink",children:[c?/* @__PURE__ */d("img",{src:c,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */d("span",{className:"text-gray-400",children:/* @__PURE__ */d(p,{})}),
7
- /* @__PURE__ */d("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
8
- /* @__PURE__ */d("span",{className:"shrink-0 tabular-nums text-gray-400",children:n(e.size,i)}),r&&/* @__PURE__ */d("button",{type:"button",disabled:a,onClick:()=>r(s),"aria-label":i.remove(e.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */d(t,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${s}`)})})}function b({onClick:t,count:n=0,variant:r="button",label:a,disabled:i=!1}){const l=c().files,o=a??l.attach,p=n>0?`${o} (${n})`:o;return"icon"===r?/* @__PURE__ */u("span",{className:"relative inline-flex",children:[
9
- /* @__PURE__ */d(e,{"aria-label":p,onClick:t,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),n>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:n})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:t,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:j,className:N="",children:v}){const L=r({accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),y=l([]);return o(()=>{j&&L.rejections.length>0&&L.rejections!==y.current&&(y.current=L.rejections,j(L.rejections))},[L.rejections,j]),/* @__PURE__ */u(h,{intake:L,dropLabel:p,className:N,children:[v,
7
+ /* @__PURE__ */d("span",{className:"min-w-0 truncate",title:t.name,children:t.name}),
8
+ /* @__PURE__ */d("span",{className:"shrink-0 tabular-nums text-gray-400",children:n(t.size,i)}),r&&/* @__PURE__ */d("button",{type:"button",disabled:a,onClick:()=>r(s),"aria-label":i.remove(t.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */d(e,{className:"h-3.5 w-3.5"})})]},`${t.name}-${t.size}-${s}`)})})}function b({onClick:e,count:n=0,variant:r="button",label:a,disabled:i=!1}){const l=c().files,o=a??l.attach,p=n>0?`${o} (${n})`:o;return"icon"===r?/* @__PURE__ */u("span",{className:"relative inline-flex",children:[
9
+ /* @__PURE__ */d(t,{"aria-label":p,onClick:e,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),n>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:n})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:j,className:N="",children:v}){const L=r({accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),y=l([]);return o(()=>{j&&L.rejections.length>0&&L.rejections!==y.current&&(y.current=L.rejections,j(L.rejections))},[L.rejections,j]),/* @__PURE__ */u(h,{intake:L,dropLabel:p,className:N,children:[v,
10
10
  /* @__PURE__ */d(f,{files:e,disabled:m,onRemove:n=>{L.clearRejections(),t(e.filter((e,t)=>t!==n))},className:"mt-2"}),
11
11
  /* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
12
12
  /* @__PURE__ */d(b,{onClick:L.open,count:e.length,variant:g,label:x,disabled:m}),k]}),
@@ -1,2 +1,2 @@
1
- import{ShellStringsProvider as t}from"./chunk-PEM7UXQ3.js";import{createContext as e,useEffect as a,useCallback as n,useMemo as r,useContext as l}from"react";import{jsx as o}from"react/jsx-runtime";var g={tag:"en",name:"English",locale:null},c="react-os-shell:language",u=t=>"string"==typeof t?t:t.tag;function i(t){try{const e=new Intl.Locale(t).maximize();return{language:e.language,script:e.script}}catch{return null}}function s(t,e){const a=e.map(u),n=t.toLowerCase(),r=a.find(t=>t.toLowerCase()===n);if(r)return r;const l=i(t);if(!l)return;const o=a.map(t=>({tag:t,parts:i(t)})).filter(t=>t.parts?.language===l.language);return(o.find(t=>t.parts?.script===l.script)??o[0])?.tag}function f(){try{return globalThis.localStorage?.getItem(c)??null}catch{return null}}function m(t){try{return globalThis.localStorage?.setItem(c,t),globalThis.localStorage?.getItem(c)===t}catch{return!1}}function h({offered:t,fallback:e,saved:a=f(),preferred:n=globalThis.navigator?.languages??[]}){const r=e??(t.length>0?u(t[0]):g.tag);if(a){const e=s(a,t);if(e)return e}for(const e of n){const a=s(e,t);if(a)return a}return r}var d=e({language:g.tag,languages:[g],setLanguage:async()=>{}}),p=()=>globalThis.location?.reload();function b({languages:e,language:l,strings:g,onChange:c,reload:u=p,children:i}){const s=e.find(t=>t.tag===l),f=s?void 0===s.locale?s.tag:s.locale??void 0:void 0;a(()=>{const t=globalThis.document?.documentElement;if(!t)return;const e=t.getAttribute("lang");return t.setAttribute("lang",l),()=>{null===e?t.removeAttribute("lang"):t.setAttribute("lang",e)}},[l]);const h=n(async t=>{if(t!==l&&e.some(e=>e.tag===t)){m(t);try{await(c?.(t))}catch{}u&&u()}},[l,e,c,u]),b=r(()=>({language:l,languages:e,setLanguage:h}),[l,e,h]);/* @__PURE__ */
1
+ import{ShellStringsProvider as t}from"./chunk-X2PZMXDP.js";import{createContext as e,useEffect as a,useCallback as n,useMemo as r,useContext as l}from"react";import{jsx as o}from"react/jsx-runtime";var g={tag:"en",name:"English",locale:null},c="react-os-shell:language",u=t=>"string"==typeof t?t:t.tag;function i(t){try{const e=new Intl.Locale(t).maximize();return{language:e.language,script:e.script}}catch{return null}}function s(t,e){const a=e.map(u),n=t.toLowerCase(),r=a.find(t=>t.toLowerCase()===n);if(r)return r;const l=i(t);if(!l)return;const o=a.map(t=>({tag:t,parts:i(t)})).filter(t=>t.parts?.language===l.language);return(o.find(t=>t.parts?.script===l.script)??o[0])?.tag}function f(){try{return globalThis.localStorage?.getItem(c)??null}catch{return null}}function m(t){try{return globalThis.localStorage?.setItem(c,t),globalThis.localStorage?.getItem(c)===t}catch{return!1}}function h({offered:t,fallback:e,saved:a=f(),preferred:n=globalThis.navigator?.languages??[]}){const r=e??(t.length>0?u(t[0]):g.tag);if(a){const e=s(a,t);if(e)return e}for(const e of n){const a=s(e,t);if(a)return a}return r}var d=e({language:g.tag,languages:[g],setLanguage:async()=>{}}),p=()=>globalThis.location?.reload();function b({languages:e,language:l,strings:g,onChange:c,reload:u=p,children:i}){const s=e.find(t=>t.tag===l),f=s?void 0===s.locale?s.tag:s.locale??void 0:void 0;a(()=>{const t=globalThis.document?.documentElement;if(!t)return;const e=t.getAttribute("lang");return t.setAttribute("lang",l),()=>{null===e?t.removeAttribute("lang"):t.setAttribute("lang",e)}},[l]);const h=n(async t=>{if(t!==l&&e.some(e=>e.tag===t)){m(t);try{await(c?.(t))}catch{}u&&u()}},[l,e,c,u]),b=r(()=>({language:l,languages:e,setLanguage:h}),[l,e,h]);/* @__PURE__ */
2
2
  return o(d.Provider,{value:b,children:/* @__PURE__ */o(t,{value:g,locale:f,children:i})})}function v(){return l(d)}export{g as ENGLISH,c as SHELL_LANGUAGE_STORAGE_KEY,b as ShellLanguageProvider,s as matchShellLanguage,f as readSavedShellLanguage,h as resolveShellLanguage,m as saveShellLanguage,v as useShellLanguage};
@@ -1 +1 @@
1
- import{useShellLocale as e}from"./chunk-PEM7UXQ3.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-X2PZMXDP.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,3 +1,3 @@
1
- import{Icon as e}from"./chunk-FSPFV4MI.js";import{useShellStrings as t}from"./chunk-PEM7UXQ3.js";import{useState as r,useRef as o,useEffect as c,useCallback as i}from"react";import{jsx as n}from"react/jsx-runtime";function a(e){const[t,n]=r(!1),a=o(void 0);c(()=>()=>clearTimeout(a.current),[]);return{copied:t,copy:i(t=>{t?.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{n(!0),clearTimeout(a.current),a.current=setTimeout(()=>n(!1),1500)},()=>{})},[e])}}function u({copied:t,className:r="w-4 h-4"}){/* @__PURE__ */
1
+ import{Icon as e}from"./chunk-FSPFV4MI.js";import{useShellStrings as t}from"./chunk-X2PZMXDP.js";import{useState as r,useRef as o,useEffect as c,useCallback as i}from"react";import{jsx as n}from"react/jsx-runtime";function a(e){const[t,n]=r(!1),a=o(void 0);c(()=>()=>clearTimeout(a.current),[]);return{copied:t,copy:i(t=>{t?.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{n(!0),clearTimeout(a.current),a.current=setTimeout(()=>n(!1),1500)},()=>{})},[e])}}function u({copied:t,className:r="w-4 h-4"}){/* @__PURE__ */
2
2
  return n(e,t?{name:"check",className:`${r} text-green-600`,"aria-hidden":"true"}:{name:"copy",className:r,"aria-hidden":"true"})}function m({text:e}){const{copied:r,copy:o}=a(e),c=t().copy;/* @__PURE__ */
3
3
  return n("button",{onClick:o,title:r?c.copiedValue:c.copyValue(e),className:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors",children:/* @__PURE__ */n(u,{copied:r})})}export{m as CopyButton,u as CopyGlyph,a as useCopyText};
@@ -1,8 +1,8 @@
1
- import{optionMatches as e,OptionSublabel as t}from"./chunk-5F7HMNCX.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-LNARMEEZ.js";import{Tooltip as r}from"./chunk-BCDG4N6L.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-DTJRIWFR.js";import{useShellStrings as d}from"./chunk-PEM7UXQ3.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:E="",tone:M,tooltip:W,split:$}){const[B,F]=m(!1),[G,H]=m(""),I=d(),J=h(null),R=h(null),S=h(null),T=s(J,B),Y=e=>k.find(t=>t.value===e)?.label??e,A=p(()=>{const t=new Set(o),n=[],r=G.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,G]),P=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)},U=e=>{e&&!o.includes(e)?(y([...o,e]),H("")):H("")},X=e=>y(o.filter(t=>t!==e)),Z=()=>{const e=G.trim();if($&&e)return P(e.split($)),void H("");j&&e?U(e):H("")},z=h(()=>{});z.current=()=>{Z(),F(!1)},f(()=>{if(!B)return;const e=e=>{const t=e.target;J.current?.contains(t)||S.current?.contains(t)||(Z(),F(!1))};document.addEventListener("mousedown",e);const t=l(()=>z.current());return()=>{document.removeEventListener("mousedown",e),t()}});const K=k.length>0;/* @__PURE__ */
1
+ import{optionMatches as e,OptionSublabel as t}from"./chunk-5F7HMNCX.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-LNARMEEZ.js";import{Tooltip as r}from"./chunk-BCDG4N6L.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-DTJRIWFR.js";import{useShellStrings as d}from"./chunk-X2PZMXDP.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:E="",tone:M,tooltip:W,split:$}){const[B,F]=m(!1),[G,H]=m(""),I=d(),J=h(null),P=h(null),R=h(null),S=s(J,B),T=e=>k.find(t=>t.value===e)?.label??e,X=p(()=>{const t=new Set(o),n=[],r=G.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,G]),Y=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]),H("")):H("")},A=e=>y(o.filter(t=>t!==e)),z=()=>{const e=G.trim();if($&&e)return Y(e.split($)),void H("");j&&e?Z(e):H("")},K=h(()=>{});K.current=()=>{z(),F(!1)},f(()=>{if(!B)return;const e=e=>{const t=e.target;J.current?.contains(t)||R.current?.contains(t)||(z(),F(!1))};document.addEventListener("mousedown",e);const t=l(()=>K.current());return()=>{document.removeEventListener("mousedown",e),t()}});const U=k.length>0;/* @__PURE__ */
2
2
  return g("div",{ref:J,className:"relative",children:[
3
- /* @__PURE__ */g("div",{onMouseDown:e=>{L||e.target.closest("button")||(e.preventDefault(),R.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":""} ${E}`}),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:Y(e)}),!L&&/* @__PURE__ */x("button",{type:"button","aria-label":I.select.removeItem?.(Y(e))??`${I.select.remove} ${Y(e)}`,onClick:()=>X(e),className:n.remove,children:"×"})]},e),l=W?.(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:R,type:"text",autoComplete:"off",role:"combobox","aria-expanded":B&&K,"aria-invalid":C||void 0,disabled:L,value:G,placeholder:0===o.length?N:void 0,onChange:e=>{(e=>{if($){const t=e.split($);if(t.length>1)return P(t.slice(0,-1)),void H(t[t.length-1])}H(e)})(e.target.value),F(!0)},onFocus:()=>{!L&&K&&F(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=G.trim(),o=n?A.filter(t=>e(t,n.toLowerCase())):[];1===o.length?U(o[0].value):Z()}else"Backspace"===t.key&&""===G&&o.length>0?X(o[o.length-1]):"Escape"===t.key?(F(!1),H(""),R.current?.blur()):"Tab"===t.key&&(Z(),F(!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"})]}),B&&K&&v(
6
- /* @__PURE__ */x("div",{ref:S,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:T?.left,right:T?.right,top:T?.top,bottom:T?.bottom,minWidth:T?.minWidth,maxWidth:T?.maxWidth??a,width:"max-content",visibility:T?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:T?.maxHeight??c},children:0===A.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&o.length>=k.length?I.select.allSelected:I.select.noMatches}):A.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),U(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:[
3
+ /* @__PURE__ */g("div",{onMouseDown:e=>{L||e.target.closest("button")||(e.preventDefault(),P.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":""} ${E}`}),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:T(e)}),!L&&/* @__PURE__ */x("button",{type:"button","aria-label":I.select.removeItem?.(T(e))??`${I.select.remove} ${T(e)}`,onClick:()=>A(e),className:n.remove,children:"×"})]},e),l=W?.(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:P,type:"text",autoComplete:"off",role:"combobox","aria-expanded":B&&U,"aria-invalid":C||void 0,disabled:L,value:G,placeholder:0===o.length?N:void 0,onChange:e=>{(e=>{if($){const t=e.split($);if(t.length>1)return Y(t.slice(0,-1)),void H(t[t.length-1])}H(e)})(e.target.value),F(!0)},onFocus:()=>{!L&&U&&F(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=G.trim(),o=n?X.filter(t=>e(t,n.toLowerCase())):[];1===o.length?Z(o[0].value):z()}else"Backspace"===t.key&&""===G&&o.length>0?A(o[o.length-1]):"Escape"===t.key?(F(!1),H(""),P.current?.blur()):"Tab"===t.key&&(z(),F(!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"})]}),B&&U&&v(
6
+ /* @__PURE__ */x("div",{ref:R,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:S?.left,right:S?.right,top:S?.top,bottom:S?.bottom,minWidth:S?.minWidth,maxWidth:S?.maxWidth??a,width:"max-content",visibility:S?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:S?.maxHeight??c},children:0===X.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&o.length>=k.length?I.select.allSelected:I.select.noMatches}):X.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
7
  /* @__PURE__ */x("span",{className:"min-w-0 truncate",children:e.label}),
8
8
  /* @__PURE__ */x(t,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}export{y as TagInput};
@@ -1,5 +1,5 @@
1
- import{InputNumber_default as e}from"./chunk-ODOEH5QZ.js";import{useSettingAuto as t,useInSettingRow as i}from"./chunk-L65BESIE.js";import{useShellStrings as n}from"./chunk-PEM7UXQ3.js";import{createContext as r,useState as l,useMemo as a,useId as o,useRef as d,useContext as s,useEffect as u,useLayoutEffect as c}from"react";import{jsx as m,jsxs as f}from"react/jsx-runtime";var p=(e,t,i)=>Math.min(i,Math.max(t,e));function h(e){const t=String(e),i=/e-(\d+)$/.exec(t);return i?Number(i[1]):t.split(".")[1]?.length??0}var v=8,x=40;function b(e){return Math.max(1,...e.map(e=>(e??"").length))}var w="undefined"==typeof window?u:c;function y(e,t,i,n){return Number(p(e,t,i).toFixed(n))}var g=r(null);function S({children:e}){const[t,i]=l({}),n=a(()=>(e,t)=>i(i=>{if(null===t){if(!(e in i))return i;const t={...i};return delete t[e],t}return i[e]===t?i:{...i,[e]:t}}),[]),r=a(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
2
- return m(g.Provider,{value:r,children:e})}function z({value:r,onChange:a,min:c,max:S,step:z=1,shiftStep:F,precision:$,inputMin:k,inputMax:E,suffix:L,showInput:N=!0,emptyLabel:j,placeholderValue:M,stepFrom:K,label:A,"aria-labelledby":C,valueText:D,id:O,disabled:R,size:B="md",boxSize:I="sm",className:P="",auto:Q}){const U=n(),V=o(),W=t(),q=Q??W,H=o(),T=O??V,X=$??h(z),Z=k??c,G=E??S,J=void 0!==j||void 0!==M,Y=K??M,_=p(r??M??c,c,S),ee=d(null),[te,ie]=l(null),ne=Boolean(L);w(()=>{const e=()=>{const e=ee.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,i)=>e+(parseFloat(t[i])||0),0);i<=0||ie(e=>e&&e.frame===i&&e.fontSize===t.fontSize?e:{frame:i,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ne,N]);const re=e=>D?D(e):"string"==typeof L?`${e.toFixed(X)} ${L}`:void 0,le=null==r?j??(null!=M?re(M)??String(M):void 0):re(r),ae=`calc(${b([c.toFixed(X),S.toFixed(X),r?.toFixed(X),j,M?.toFixed(X)])}ch + ${(te?.frame??10+(ne?x:v))+2}px)`,oe=s(g),de=o(),se=oe?.set;w(()=>{se&&se(de,N?ae:null)},[se,de,ae,N]),u(()=>()=>se?.(de,null),[se,de]);const ue=i();/* @__PURE__ */
3
- return f("div",{"data-slider":"",className:`flex w-full min-w-0 items-center ${ue?"flex-wrap gap-2":"gap-3"} ${P}`.trim(),children:[
4
- /* @__PURE__ */m("input",{id:T,type:"range",min:c,max:S,step:z,value:_,disabled:R,"aria-label":C?void 0:A,"aria-labelledby":C,"aria-valuetext":le,"aria-describedby":q?H:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&null!=F;if(!i&&!(null==r&&null!=Y))return;e.preventDefault();a(y((r??Y??_)+t*(i?F??z:z),c,S,X))},onChange:e=>a(y(Number(e.target.value),c,S,X)),className:`min-w-24 flex-1 ${ue?"basis-24":""} cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 ${"sm"===B?"h-1":"h-1.5"}`}),N&&
5
- /* @__PURE__ */m("div",{ref:ee,"data-slider-box":"",className:ue?"ml-auto shrink-0":"shrink-0 text-xs",style:ue?void 0:{width:oe?.width??ae,...te?{fontSize:te.fontSize}:{}},children:/* @__PURE__ */m(e,{value:r,onChange:e=>{null!=e?e<Z||e>G||a(e):J&&a(null)},min:Z,max:G,step:z,shiftStep:F,stepFrom:Y,precision:X,snap:!0,allowEmpty:J,suffix:L,disabled:R,placeholder:j??(null!=M?M.toFixed(X):void 0),size:ue?void 0:I,auto:q,"aria-label":A?U.slider.value(A):void 0,"aria-labelledby":A?void 0:C})}),q&&/* @__PURE__ */m("span",{id:H,hidden:!0,children:U.settingView.auto})]})}export{z as Slider,S as SliderGroup,y as settleSliderValue,b as sliderBoxChars,h as stepDecimals};
1
+ import{InputNumber_default as e}from"./chunk-6TCJOVFX.js";import{useSettingAuto as t,useInSettingRow as i}from"./chunk-L65BESIE.js";import{useShellStrings as n}from"./chunk-X2PZMXDP.js";import{createContext as r,useState as l,useMemo as a,useId as o,useRef as d,useContext as s,useEffect as u,useLayoutEffect as c}from"react";import{jsx as m,jsxs as f}from"react/jsx-runtime";var p=(e,t,i)=>Math.min(i,Math.max(t,e));function h(e){const t=String(e),i=/e-(\d+)$/.exec(t);return i?Number(i[1]):t.split(".")[1]?.length??0}var v=8,x=40;function b(e){return Math.max(1,...e.map(e=>(e??"").length))}var w="undefined"==typeof window?u:c;function y(e,t,i,n){return Number(p(e,t,i).toFixed(n))}var g=r(null);function S({children:e}){const[t,i]=l({}),n=a(()=>(e,t)=>i(i=>{if(null===t){if(!(e in i))return i;const t={...i};return delete t[e],t}return i[e]===t?i:{...i,[e]:t}}),[]),r=a(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
2
+ return m(g.Provider,{value:r,children:e})}function z({value:r,onChange:a,min:c,max:S,step:z=1,shiftStep:F,precision:$,inputMin:k,inputMax:L,suffix:N,showInput:j=!0,emptyLabel:M,placeholderValue:C,stepFrom:E,label:K,"aria-labelledby":A,valueText:D,id:P,disabled:R,size:V="md",boxSize:X="sm",className:B="",auto:I}){const O=n(),T=o(),W=t(),q=I??W,J=o(),U=P??T,Z=$??h(z),G=k??c,H=L??S,Q=void 0!==M||void 0!==C,Y=E??C,_=p(r??C??c,c,S),ee=d(null),[te,ie]=l(null),ne=Boolean(N);w(()=>{const e=()=>{const e=ee.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,i)=>e+(parseFloat(t[i])||0),0);i<=0||ie(e=>e&&e.frame===i&&e.fontSize===t.fontSize?e:{frame:i,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ne,j]);const re=e=>D?D(e):"string"==typeof N?`${e.toFixed(Z)} ${N}`:void 0,le=null==r?M??(null!=C?re(C)??String(C):void 0):re(r),ae=`calc(${b([c.toFixed(Z),S.toFixed(Z),r?.toFixed(Z),M,C?.toFixed(Z)])}ch + ${(te?.frame??10+(ne?x:v))+2}px)`,oe=s(g),de=o(),se=oe?.set;w(()=>{se&&se(de,j?ae:null)},[se,de,ae,j]),u(()=>()=>se?.(de,null),[se,de]);const ue=i();/* @__PURE__ */
3
+ return f("div",{"data-slider":"",className:`flex w-full min-w-0 items-center ${ue?"flex-wrap gap-2":"gap-3"} ${B}`.trim(),children:[
4
+ /* @__PURE__ */m("input",{id:U,type:"range",min:c,max:S,step:z,value:_,disabled:R,"aria-label":A?void 0:K,"aria-labelledby":A,"aria-valuetext":le,"aria-describedby":q?J:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&null!=F;if(!i&&!(null==r&&null!=Y))return;e.preventDefault();a(y((r??Y??_)+t*(i?F??z:z),c,S,Z))},onChange:e=>a(y(Number(e.target.value),c,S,Z)),className:`min-w-24 flex-1 ${ue?"basis-24":""} cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 ${"sm"===V?"h-1":"h-1.5"}`}),j&&
5
+ /* @__PURE__ */m("div",{ref:ee,"data-slider-box":"",className:ue?"ml-auto shrink-0":"shrink-0 text-xs",style:ue?void 0:{width:oe?.width??ae,...te?{fontSize:te.fontSize}:{}},children:/* @__PURE__ */m(e,{value:r,onChange:e=>{null!=e?e<G||e>H||a(e):Q&&a(null)},min:G,max:H,step:z,shiftStep:F,stepFrom:Y,precision:Z,snap:!0,allowEmpty:Q,suffix:N,disabled:R,placeholder:M??(null!=C?C.toFixed(Z):void 0),size:ue?void 0:X,auto:q,"aria-label":K?O.slider.value(K):void 0,"aria-labelledby":K?void 0:A})}),q&&/* @__PURE__ */m("span",{id:J,hidden:!0,children:O.settingView.auto})]})}export{z as Slider,S as SliderGroup,y as settleSliderValue,b as sliderBoxChars,h as stepDecimals};
@@ -1,2 +1,2 @@
1
- import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-XS4HFUTW.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-FPGRKHUW.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:D=!0}){const L=s(null),S=a(),[U,j]=d(null),A=s(w);A.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});j(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const W=s(null),C=s(!1);m(()=>(W.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||W.current?.focus?.({preventScroll:!0})}),[]),m(()=>{U&&!C.current&&D&&(C.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[U,D]),m(()=>{if(D)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[D]),m(()=>u(e=>"Escape"===e.key&&(A.current(),!0),()=>L.current),[]),m(()=>{const e=()=>A.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const F=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void A.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),T=U?{left:U.left,top:U.top,maxHeight:U.maxHeight,...U.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
2
- return p(n,{portal:!0,minWidth:x,style:T,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:S,role:"menu","aria-label":b,"aria-describedby":y?t(y,S):void 0,"data-context-menu":"",onKeyDown:F,children:[y&&e(y,{menuId:S,choose:e=>{e.disabled||(A.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>A.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
1
+ import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-JWX7QRGE.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-HAFB45DT.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:D=!0}){const L=s(null),A=a(),[j,S]=d(null),U=s(w);U.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});S(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const C=s(null),T=s(!1);m(()=>(C.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||C.current?.focus?.({preventScroll:!0})}),[]),m(()=>{j&&!T.current&&D&&(T.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[j,D]),m(()=>{if(D)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[D]),m(()=>u(e=>"Escape"===e.key&&(U.current(),!0),()=>L.current),[]),m(()=>{const e=()=>U.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const W=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void U.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),F=j?{left:j.left,top:j.top,maxHeight:j.maxHeight,...j.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
2
+ return p(n,{portal:!0,minWidth:x,style:F,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:A,role:"menu","aria-label":b,"aria-describedby":y?t(y,A):void 0,"data-context-menu":"",onKeyDown:W,children:[y&&e(y,{menuId:A,choose:e=>{e.disabled||(U.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>U.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
@@ -1,4 +1,4 @@
1
- import{DropdownMenu as e}from"./chunk-PVR4KU7H.js";import{Fragment as t}from"react";import{jsxs as a,jsx as r,Fragment as n}from"react/jsx-runtime";var i="relative inline-flex items-center gap-2 px-4 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40",s="bg-blue-50 text-blue-600",l="text-gray-600 hover:bg-gray-50 hover:text-gray-900";function c(){/* @__PURE__ */
1
+ import{DropdownMenu as e}from"./chunk-VVZE27M4.js";import{Fragment as t}from"react";import{jsxs as a,jsx as r,Fragment as n}from"react/jsx-runtime";var i="relative inline-flex items-center gap-2 px-4 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40",s="bg-blue-50 text-blue-600",l="text-gray-600 hover:bg-gray-50 hover:text-gray-900";function c(){/* @__PURE__ */
2
2
  return r("span",{className:"my-3 w-px shrink-0 bg-gray-200","aria-hidden":!0})}function m({item:e,active:t,caret:i}){/* @__PURE__ */
3
3
  return a(n,{children:[e.icon&&/* @__PURE__ */r("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
4
4
  /* @__PURE__ */r("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */r("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),i&&/* @__PURE__ */r("span",{className:"-ml-1 text-xs","aria-hidden":!0,children:"▾"}),t&&/* @__PURE__ */r("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]})}function d({items:n,activeKey:d,onSelect:o,brand:u,actions:b,linkAs:h,className:g}){/* @__PURE__ */
@@ -1 +1 @@
1
- import{buttonClasses as t}from"./chunk-UQYNPYF4.js";import{SPINNER_RING as e}from"./chunk-MRJKZWWV.js";import{currentShellStrings as n}from"./chunk-PEM7UXQ3.js";var o="http://www.w3.org/2000/svg",s={},r=/* @__PURE__ */new Map;function i(t,e){let n=document.getElementById(t);return n||(n=document.createElement("div"),n.id=t,n.className=e,document.body.appendChild(n)),n}var a={success:"M5 13l4 4L19 7",error:"M6 18L18 6M6 6l12 12",warning:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",bell:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"};function c(t,e){const n=document.createElementNS(o,"svg");n.setAttribute("class",e),n.setAttribute("fill","none"),n.setAttribute("viewBox","0 0 24 24"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","2");const s=document.createElementNS(o,"path");return s.setAttribute("stroke-linecap","round"),s.setAttribute("stroke-linejoin","round"),s.setAttribute("d",a[t]),n.appendChild(s),n}function l(t,e){const n=document.createElement("div");return n.className=t,void 0!==e&&(n.textContent=e),n}function d(n,o,a){const d={...s,...a},u=d.placement??"top",m=d.sticky??!1,p=`${u}|${n}|${o}`;if(d.dedupe){const t=r.get(p);if(t)return t.restart(),{dismiss:t.dismiss}}"loading"!==n&&!1!==d.sound&&import("./sounds-E5OTSJLX.js").then(t=>{"success"===n?t.playSuccess():"error"===n?t.playError():t.playNotification()}).catch(()=>{});const f="bottom"===u?i("toast-container-bottom","fixed bottom-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col-reverse gap-2 items-center pointer-events-none"):i("toast-container","fixed top-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col gap-2 items-center pointer-events-none"),h="bottom"===u?"translateY(10px)":"translateY(-10px)",y=l("pointer-events-auto cursor-pointer rosh-toast");if(y.style.opacity="0",y.style.transform=`${h} scale(0.95)`,y.setAttribute("role","error"===n?"alert":"status"),y.setAttribute("aria-atomic","true"),"loading"===n){const t=document.createElement("span");t.setAttribute("aria-hidden","true"),t.className=`${e} h-4 w-4 rosh-tone-loading`,y.appendChild(t)}else y.appendChild(c(n,`h-4 w-4 rosh-tone-${n}`));const v=document.createElement("span");if(v.textContent=o,y.appendChild(v),d.action){const{label:e,onClick:n}=d.action,o=document.createElement("button");o.type="button",o.className=t({variant:"link",size:"sm"}),o.textContent=e,o.addEventListener("click",t=>{t.stopPropagation(),g||(n(),x("action"))}),y.appendChild(o)}let b;f.appendChild(y),requestAnimationFrame(()=>{y.style.opacity="1",y.style.transform="translateY(0) scale(1)"});let g=!1;const x=t=>{g||(g=!0,b&&clearTimeout(b),r.delete(p),y.style.opacity="0",y.style.transform=`${h} scale(0.95)`,setTimeout(()=>y.remove(),300),d.onClose?.(t))},w=()=>x("dismissed"),E=d.duration??("info"===n?4500:3e3),C=()=>{b&&clearTimeout(b),m||(b=setTimeout(()=>x("timeout"),E))};return C(),y.addEventListener("mouseenter",()=>{b&&clearTimeout(b)}),y.addEventListener("mouseleave",()=>{g||C()}),y.addEventListener("click",w),r.set(p,{el:y,restart:C,dismiss:w}),{dismiss:w}}var u=8e3,m=/* @__PURE__ */new Map,p=!1;var f={success:(t,e)=>d("success",t,e),error:(t,e)=>d("error",t,e),warning:(t,e)=>d("warning",t,e),info:(t,e)=>d("info",t,e),notify:(t,e)=>function(t,e){!1!==(e?.sound??s.sound)&&import("./sounds-E5OTSJLX.js").then(t=>t.playNotification()).catch(()=>{});const o=i("notif-container","fixed top-4 right-4 z-(--z-toast) flex flex-col gap-3 items-end pointer-events-none"),r=l("pointer-events-auto cursor-pointer rosh-notif");r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)";const a=l("rosh-notif-badge");a.appendChild(c("bell","h-5 w-5"));const d=l("rosh-notif-body");d.append(l("rosh-notif-title",n().toast.notification),l("notif-msg rosh-notif-msg",t));const u=document.createElement("button");u.className="rosh-notif-close",u.textContent="×",r.append(a,d,u);const m=()=>{r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)",setTimeout(()=>r.remove(),300)};u.addEventListener("click",t=>{t.stopPropagation(),m()}),r.addEventListener("click",m),o.appendChild(r),requestAnimationFrame(()=>{r.style.opacity="1",r.style.transform="translateX(0) scale(1)"}),setTimeout(m,e?.duration??1e4)}(t,e),promise:(t,e,n)=>{const o=d("loading",e.loading,{...n,sticky:!0});return t.then(t=>{o.dismiss(),d("success","function"==typeof e.success?e.success(t):e.success,n)},t=>{o.dismiss(),d("error","function"==typeof e.error?e.error(t):e.error,n)}),t},configure:t=>{s={...t}},undoable:function(t,e){p||"undefined"==typeof window||(p=!0,window.addEventListener("pagehide",()=>{const t=[...m.values()];m.clear();for(const e of t)e.run({keepalive:!0})}));const o=/* @__PURE__ */Symbol("undoable");let s=!1,r=null;const i=async t=>{if(!s){s=!0,m.delete(o);try{await(t?e.commit(t):e.commit())}catch(t){e.onFail?.(t)}}},a=()=>!s&&(s=!0,m.delete(o),e.undo(),!0);return m.set(o,{run:i}),r=d("success",t,{sound:!1,placement:e.placement,duration:e.duration??8e3,action:{label:e.actionLabel??n().toast.undo,onClick:()=>{a()}},onClose:t=>{"action"!==t&&i()}}),{undo:()=>{const t=a();return t&&r?.dismiss(),t},commit:async()=>{if(s)return;const t=i();r?.dismiss(),await t}}}};export{u as UNDOABLE_MS,f as toast_default};
1
+ import{buttonClasses as t}from"./chunk-UQYNPYF4.js";import{SPINNER_RING as e}from"./chunk-MRJKZWWV.js";import{currentShellStrings as n}from"./chunk-X2PZMXDP.js";var o="http://www.w3.org/2000/svg",s={},r=/* @__PURE__ */new Map;function i(t,e){let n=document.getElementById(t);return n||(n=document.createElement("div"),n.id=t,n.className=e,document.body.appendChild(n)),n}var a={success:"M5 13l4 4L19 7",error:"M6 18L18 6M6 6l12 12",warning:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",bell:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"};function c(t,e){const n=document.createElementNS(o,"svg");n.setAttribute("class",e),n.setAttribute("fill","none"),n.setAttribute("viewBox","0 0 24 24"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","2");const s=document.createElementNS(o,"path");return s.setAttribute("stroke-linecap","round"),s.setAttribute("stroke-linejoin","round"),s.setAttribute("d",a[t]),n.appendChild(s),n}function l(t,e){const n=document.createElement("div");return n.className=t,void 0!==e&&(n.textContent=e),n}function d(n,o,a){const d={...s,...a},u=d.placement??"top",m=d.sticky??!1,p=`${u}|${n}|${o}`;if(d.dedupe){const t=r.get(p);if(t)return t.restart(),{dismiss:t.dismiss}}"loading"!==n&&!1!==d.sound&&import("./sounds-E5OTSJLX.js").then(t=>{"success"===n?t.playSuccess():"error"===n?t.playError():t.playNotification()}).catch(()=>{});const f="bottom"===u?i("toast-container-bottom","fixed bottom-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col-reverse gap-2 items-center pointer-events-none"):i("toast-container","fixed top-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col gap-2 items-center pointer-events-none"),h="bottom"===u?"translateY(10px)":"translateY(-10px)",y=l("pointer-events-auto cursor-pointer rosh-toast");if(y.style.opacity="0",y.style.transform=`${h} scale(0.95)`,y.setAttribute("role","error"===n?"alert":"status"),y.setAttribute("aria-atomic","true"),"loading"===n){const t=document.createElement("span");t.setAttribute("aria-hidden","true"),t.className=`${e} h-4 w-4 rosh-tone-loading`,y.appendChild(t)}else y.appendChild(c(n,`h-4 w-4 rosh-tone-${n}`));const v=document.createElement("span");if(v.textContent=o,y.appendChild(v),d.action){const{label:e,onClick:n}=d.action,o=document.createElement("button");o.type="button",o.className=t({variant:"link",size:"sm"}),o.textContent=e,o.addEventListener("click",t=>{t.stopPropagation(),g||(n(),x("action"))}),y.appendChild(o)}let b;f.appendChild(y),requestAnimationFrame(()=>{y.style.opacity="1",y.style.transform="translateY(0) scale(1)"});let g=!1;const x=t=>{g||(g=!0,b&&clearTimeout(b),r.delete(p),y.style.opacity="0",y.style.transform=`${h} scale(0.95)`,setTimeout(()=>y.remove(),300),d.onClose?.(t))},w=()=>x("dismissed"),E=d.duration??("info"===n?4500:3e3),C=()=>{b&&clearTimeout(b),m||(b=setTimeout(()=>x("timeout"),E))};return C(),y.addEventListener("mouseenter",()=>{b&&clearTimeout(b)}),y.addEventListener("mouseleave",()=>{g||C()}),y.addEventListener("click",w),r.set(p,{el:y,restart:C,dismiss:w}),{dismiss:w}}var u=8e3,m=/* @__PURE__ */new Map,p=!1;var f={success:(t,e)=>d("success",t,e),error:(t,e)=>d("error",t,e),warning:(t,e)=>d("warning",t,e),info:(t,e)=>d("info",t,e),notify:(t,e)=>function(t,e){!1!==(e?.sound??s.sound)&&import("./sounds-E5OTSJLX.js").then(t=>t.playNotification()).catch(()=>{});const o=i("notif-container","fixed top-4 right-4 z-(--z-toast) flex flex-col gap-3 items-end pointer-events-none"),r=l("pointer-events-auto cursor-pointer rosh-notif");r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)";const a=l("rosh-notif-badge");a.appendChild(c("bell","h-5 w-5"));const d=l("rosh-notif-body");d.append(l("rosh-notif-title",n().toast.notification),l("notif-msg rosh-notif-msg",t));const u=document.createElement("button");u.className="rosh-notif-close",u.textContent="×",r.append(a,d,u);const m=()=>{r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)",setTimeout(()=>r.remove(),300)};u.addEventListener("click",t=>{t.stopPropagation(),m()}),r.addEventListener("click",m),o.appendChild(r),requestAnimationFrame(()=>{r.style.opacity="1",r.style.transform="translateX(0) scale(1)"}),setTimeout(m,e?.duration??1e4)}(t,e),promise:(t,e,n)=>{const o=d("loading",e.loading,{...n,sticky:!0});return t.then(t=>{o.dismiss(),d("success","function"==typeof e.success?e.success(t):e.success,n)},t=>{o.dismiss(),d("error","function"==typeof e.error?e.error(t):e.error,n)}),t},configure:t=>{s={...t}},undoable:function(t,e){p||"undefined"==typeof window||(p=!0,window.addEventListener("pagehide",()=>{const t=[...m.values()];m.clear();for(const e of t)e.run({keepalive:!0})}));const o=/* @__PURE__ */Symbol("undoable");let s=!1,r=null;const i=async t=>{if(!s){s=!0,m.delete(o);try{await(t?e.commit(t):e.commit())}catch(t){e.onFail?.(t)}}},a=()=>!s&&(s=!0,m.delete(o),e.undo(),!0);return m.set(o,{run:i}),r=d("success",t,{sound:!1,placement:e.placement,duration:e.duration??8e3,action:{label:e.actionLabel??n().toast.undo,onClick:()=>{a()}},onClose:t=>{"action"!==t&&i()}}),{undo:()=>{const t=a();return t&&r?.dismiss(),t},commit:async()=>{if(s)return;const t=i();r?.dismiss(),await t}}}};export{u as UNDOABLE_MS,f as toast_default};
@@ -1,23 +1,23 @@
1
- import{toast_default as e}from"./chunk-4XZXY2AF.js";import{Icon as t}from"./chunk-FSPFV4MI.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import{useShellStrings as r}from"./chunk-PEM7UXQ3.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,S]=s(1),[W,L]=s(!0),[$,A]=s(!0),T=i(x.loadFailed);T.current=x.loadFailed,l(()=>{let t=!1;return A(!0),P(1),g&&(c.GlobalWorkerOptions.workerSrc=g),c.getDocument({url:a,...y(w)}).promise.then(e=>{t||(j(e),_(e.numPages),A(!1))}).catch(()=>{t||(e.error(T.current),A(!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});S(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 O="page"===d?x.fitPage:x.fitWidth,F="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-OQW42DOR.js";import{Icon as t}from"./chunk-FSPFV4MI.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import{useShellStrings as r}from"./chunk-X2PZMXDP.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,D]=s(0),[_,W]=s(1),[S,L]=s(!0),[O,$]=s(!0),T=i(x.loadFailed);T.current=x.loadFailed,l(()=>{let t=!1;return $(!0),P(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(T.current),$(!1))}),()=>{t=!0}},[a,g,w]),l(()=>{if(!M||!S||!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});W(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(N.current),()=>t.disconnect()},[M,E,S,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:_}),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,_]),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,F="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
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
6
  /* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(E,z)}),
7
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})}),
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:()=>{L(!1),S(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:F,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&&(L(!1),S(Number(t)/100)):L(!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:O}),!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:()=>{L(!1),S(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:F,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"+"})}),
13
- /* @__PURE__ */u("button",{type:"button",onClick:()=>L(!0),"aria-pressed":W,className:F+(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:()=>{L(!1),W(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:F,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"−"})}),
10
+ /* @__PURE__ */m("select",{value:S?"fit":v.includes(Math.round(100*_))?Math.round(100*_):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(L(!1),W(Number(t)/100)):L(!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}),!S&&!v.includes(Math.round(100*_))&&/* @__PURE__ */m("option",{value:"custom",children:[Math.round(100*_),"%"]}),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:()=>{L(!1),W(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:F,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"+"})}),
13
+ /* @__PURE__ */u("button",{type:"button",onClick:()=>L(!0),"aria-pressed":S,className:F+(S?" 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
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:F,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:F,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:F,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<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:O?/* @__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 +1 @@
1
- import{DEFAULT_SHELL_STRINGS as e,useShellStrings as t}from"./chunk-PEM7UXQ3.js";import{useRef as r,useState as n,useCallback as s}from"react";import{jsx as a}from"react/jsx-runtime";function o(e,t){const r=(t??"").split(",").map(e=>e.trim().toLocaleLowerCase()).filter(Boolean);if(0===r.length||r.includes("*")||r.includes("*/*"))return!0;const n=e.name.toLocaleLowerCase(),s=e.type.toLocaleLowerCase();return r.some(e=>e.startsWith(".")?n.endsWith(e):e.endsWith("/*")?s.startsWith(e.slice(0,-1)):s===e)}var l=(t,r=e.files)=>t<1024?r.bytes(t):t<1048576?r.kilobytes(Math.round(t/1024)):r.megabytes(t/1048576),i=e=>Array.from(e.dataTransfer?.types??[]).includes("Files");function c(e){const t=e.clipboardData;if(!t)return[];if(t.files&&t.files.length>0)return Array.from(t.files);const r=[];for(const e of Array.from(t.items??[]))if("file"===e.kind){const t=e.getAsFile();t&&r.push(t)}return r}function u({onAccept:e,accept:a,maxSizeBytes:u,maxFiles:f,multiple:p=!0,currentCount:m=0,acceptHint:d,disabled:h=!1}){const g=t().files,y=r(null),[x,v]=n(!1),[D,L]=n([]),b=r(0),A="string"==typeof d?d:"",j=s(t=>{if(h||!t)return;const r=Array.from(t);if(0===r.length)return;const n=[],s=[];for(const e of p?r:r.slice(0,1))o(e,a)?null!=u&&e.size>u?s.push({file:e,reason:"size",message:g.tooLarge(e.name,l(e.size,g),l(u,g))}):p&&null!=f&&m+n.length>=f?s.push({file:e,reason:"count",message:g.tooMany(e.name,f)}):n.push(e):s.push({file:e,reason:"type",message:g.notAccepted(e.name,A)});L(s),n.length&&e(n),y.current&&(y.current.value="")},[h,p,a,A,u,f,m,e,g]),k=s(()=>{h||y.current?.click()},[h]),z=s(()=>L([]),[]);return{inputRef:y,inputProps:{ref:y,type:"file",accept:a||void 0,multiple:p,disabled:h,tabIndex:-1,"aria-hidden":!0,className:"hidden",onChange:e=>j(e.target.files)},zoneProps:h?{}:{onDragEnter:e=>{i(e)&&(e.preventDefault(),b.current+=1,v(!0))},onDragOver:e=>{i(e)&&(e.preventDefault(),x||v(!0))},onDragLeave:e=>{i(e)&&(b.current=Math.max(0,b.current-1),0===b.current&&v(!1))},onDrop:e=>{i(e)&&(e.preventDefault(),b.current=0,v(!1),j(e.dataTransfer.files))}},pasteProps:h?{}:{onPaste:e=>{const t=c(e);0!==t.length&&(e.preventDefault(),j(t))}},open:k,take:j,dragOver:x,rejections:D,clearRejections:z}}function f({rejections:e,className:t="mt-2"}){return 0===e.length?null:/* @__PURE__ */a("ul",{role:"alert",className:`${t} flex flex-col gap-0.5`,children:e.map(({file:e,message:t},r)=>/* @__PURE__ */a("li",{className:"text-xs text-red-600",children:t},`${e.name}-${r}`))})}export{f as FileIntakeAlert,o as acceptsFile,l as humanSize,i as isFileDrag,c as pastedFiles,u as useFileIntake};
1
+ import{DEFAULT_SHELL_STRINGS as e,useShellStrings as t}from"./chunk-X2PZMXDP.js";import{useRef as r,useState as n,useCallback as s}from"react";import{jsx as a}from"react/jsx-runtime";function o(e,t){const r=(t??"").split(",").map(e=>e.trim().toLocaleLowerCase()).filter(Boolean);if(0===r.length||r.includes("*")||r.includes("*/*"))return!0;const n=e.name.toLocaleLowerCase(),s=e.type.toLocaleLowerCase();return r.some(e=>e.startsWith(".")?n.endsWith(e):e.endsWith("/*")?s.startsWith(e.slice(0,-1)):s===e)}var l=(t,r=e.files)=>t<1024?r.bytes(t):t<1048576?r.kilobytes(Math.round(t/1024)):r.megabytes(t/1048576),i=e=>Array.from(e.dataTransfer?.types??[]).includes("Files");function c(e){const t=e.clipboardData;if(!t)return[];if(t.files&&t.files.length>0)return Array.from(t.files);const r=[];for(const e of Array.from(t.items??[]))if("file"===e.kind){const t=e.getAsFile();t&&r.push(t)}return r}function u({onAccept:e,accept:a,maxSizeBytes:u,maxFiles:f,multiple:p=!0,currentCount:m=0,acceptHint:d,disabled:h=!1}){const g=t().files,y=r(null),[x,v]=n(!1),[D,L]=n([]),b=r(0),A="string"==typeof d?d:"",P=s(t=>{if(h||!t)return;const r=Array.from(t);if(0===r.length)return;const n=[],s=[];for(const e of p?r:r.slice(0,1))o(e,a)?null!=u&&e.size>u?s.push({file:e,reason:"size",message:g.tooLarge(e.name,l(e.size,g),l(u,g))}):p&&null!=f&&m+n.length>=f?s.push({file:e,reason:"count",message:g.tooMany(e.name,f)}):n.push(e):s.push({file:e,reason:"type",message:g.notAccepted(e.name,A)});L(s),n.length&&e(n),y.current&&(y.current.value="")},[h,p,a,A,u,f,m,e,g]),j=s(()=>{h||y.current?.click()},[h]),k=s(()=>L([]),[]);return{inputRef:y,inputProps:{ref:y,type:"file",accept:a||void 0,multiple:p,disabled:h,tabIndex:-1,"aria-hidden":!0,className:"hidden",onChange:e=>P(e.target.files)},zoneProps:h?{}:{onDragEnter:e=>{i(e)&&(e.preventDefault(),b.current+=1,v(!0))},onDragOver:e=>{i(e)&&(e.preventDefault(),x||v(!0))},onDragLeave:e=>{i(e)&&(b.current=Math.max(0,b.current-1),0===b.current&&v(!1))},onDrop:e=>{i(e)&&(e.preventDefault(),b.current=0,v(!1),P(e.dataTransfer.files))}},pasteProps:h?{}:{onPaste:e=>{const t=c(e);0!==t.length&&(e.preventDefault(),P(t))}},open:j,take:P,dragOver:x,rejections:D,clearRejections:k}}function f({rejections:e,className:t="mt-2"}){return 0===e.length?null:/* @__PURE__ */a("ul",{role:"alert",className:`${t} flex flex-col gap-0.5`,children:e.map(({file:e,message:t},r)=>/* @__PURE__ */a("li",{className:"text-xs text-red-600",children:t},`${e.name}-${r}`))})}export{f as FileIntakeAlert,o as acceptsFile,l as humanSize,i as isFileDrag,c as pastedFiles,u as useFileIntake};
@@ -1,2 +1,2 @@
1
- import{useShellPrefs as t}from"./chunk-KC3EX26K.js";import{toast_default as e}from"./chunk-4XZXY2AF.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(R(),F()):"none"!==t&&0!==m||R()}function I(){g.running||(w({running:!0}),p=setInterval(C,1e3),"focus"===g.mode&&F())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),R())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function C(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);R(),N(s,{volume:u,repeat:d});const t="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(t)}catch{}try{e.info(t)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function N(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>P(t,n),2500*e)}function P(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,_={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function O(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function F(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=O(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*_[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function R(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function G(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=O(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*_[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var V="pomodoro_tasks",X="pomodoro_tasks_migrated";function j(){return Math.random().toString(36).slice(2,11)}function E(){/* @__PURE__ */
2
- return(new Date).toISOString()}var K=null,W=[],q=!1,J=null,L=/* @__PURE__ */new Set;function Y(){for(const t of L)t()}function Z(t){W=t,Y()}function $(){const t=K;return t?J=t.list().then(e=>{K===t&&(W=e,q=!0,Y())}).catch(()=>{K===t&&(q=!0,Y())}).finally(()=>{J=null}):(W=[],q=!0,Y(),Promise.resolve())}function z(t){K=t,W=[],q=!1,t?$():Y()}function H(t){return L.add(t),!K||q||J||$(),()=>{L.delete(t)}}function Q(){return W}function U(){const e=function(){const{prefs:e,save:n}=t(),r=a(()=>{const t=e.todo_tasks;return Array.isArray(t)?t:[]},[e.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=j(),n=E(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:E()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(H,Q,Q),i=o(t=>{const n=K;if(!n)return e.addTask(t);const o="tmp-"+j(),a=E(),r={done:!1,...t,name:t.name.trim(),id:o,createdAt:a,updatedAt:a};return Z([...W,r]),n.create({...t,name:t.name.trim()}).then(t=>Z(W.map(e=>e.id===o?{...r,...t}:e))).catch(()=>Z(W.filter(t=>t.id!==o))),o},[e]),c=o((t,n)=>{const o=K;if(!o)return e.updateTask(t,n);Z(W.map(e=>e.id===t?{...e,...n,id:t,updatedAt:E()}:e)),o.update(t,n).catch(()=>{$()})},[e]),l=o(t=>{const n=K;if(!n)return e.removeTask(t);const o=W;Z(W.filter(e=>e.id!==t)),n.remove(t).catch(()=>Z(o))},[e]),s=o(t=>{if(!K)return e.toggleDone(t);const n=W.find(e=>e.id===t);n&&c(t,{done:!n.done})},[e,c]),u=o(t=>{K||e.setAllTasks(t)},[e]);return null===K?e:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(X))return;const n=localStorage.getItem(V);if(!n)return void localStorage.setItem(X,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(V),void localStorage.setItem(X,"1");const a=E(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||j(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(V),localStorage.setItem(X,"1")}catch{try{localStorage.setItem(X,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,N as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,G as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,z as setShellTodoProvider,S as subscribePomo,U as useTodoTasks};
1
+ import{toast_default as t}from"./chunk-OQW42DOR.js";import{useShellPrefs as e}from"./chunk-KC3EX26K.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(F(),R()):"none"!==t&&0!==m||F()}function I(){g.running||(w({running:!0}),p=setInterval(C,1e3),"focus"===g.mode&&R())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),F())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function C(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);F(),N(s,{volume:u,repeat:d});const e="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(e)}catch{}try{t.info(e)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function N(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>P(t,n),2500*e)}function P(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,O={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function _(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function R(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=_(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*O[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function F(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function G(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=_(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*O[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var V="pomodoro_tasks",W="pomodoro_tasks_migrated";function j(){return Math.random().toString(36).slice(2,11)}function E(){/* @__PURE__ */
2
+ return(new Date).toISOString()}var K=null,q=[],J=!1,L=null,Q=/* @__PURE__ */new Set;function X(){for(const t of Q)t()}function $(t){q=t,X()}function z(){const t=K;return t?L=t.list().then(e=>{K===t&&(q=e,J=!0,X())}).catch(()=>{K===t&&(J=!0,X())}).finally(()=>{L=null}):(q=[],J=!0,X(),Promise.resolve())}function H(t){K=t,q=[],J=!1,t?z():X()}function U(t){return Q.add(t),!K||J||L||z(),()=>{Q.delete(t)}}function Y(){return q}function Z(){const t=function(){const{prefs:t,save:n}=e(),r=a(()=>{const e=t.todo_tasks;return Array.isArray(e)?e:[]},[t.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=j(),n=E(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:E()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(U,Y,Y),i=o(e=>{const n=K;if(!n)return t.addTask(e);const o="tmp-"+j(),a=E(),r={done:!1,...e,name:e.name.trim(),id:o,createdAt:a,updatedAt:a};return $([...q,r]),n.create({...e,name:e.name.trim()}).then(t=>$(q.map(e=>e.id===o?{...r,...t}:e))).catch(()=>$(q.filter(t=>t.id!==o))),o},[t]),c=o((e,n)=>{const o=K;if(!o)return t.updateTask(e,n);$(q.map(t=>t.id===e?{...t,...n,id:e,updatedAt:E()}:t)),o.update(e,n).catch(()=>{z()})},[t]),l=o(e=>{const n=K;if(!n)return t.removeTask(e);const o=q;$(q.filter(t=>t.id!==e)),n.remove(e).catch(()=>$(o))},[t]),s=o(e=>{if(!K)return t.toggleDone(e);const n=q.find(t=>t.id===e);n&&c(e,{done:!n.done})},[t,c]),u=o(e=>{K||t.setAllTasks(e)},[t]);return null===K?t:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(W))return;const n=localStorage.getItem(V);if(!n)return void localStorage.setItem(W,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(V),void localStorage.setItem(W,"1");const a=E(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||j(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(V),localStorage.setItem(W,"1")}catch{try{localStorage.setItem(W,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,N as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,G as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,H as setShellTodoProvider,S as subscribePomo,Z as useTodoTasks};
@@ -1,4 +1,4 @@
1
- import{useWindowMenuItem as e,Modal as t}from"./chunk-2XBJNB7D.js";import{navIcons as r}from"./chunk-CY5N5OA3.js";import{VERSION as s}from"./chunk-JG6DATT4.js";import{Icon as n}from"./chunk-FSPFV4MI.js";import{DEFAULT_SHELL_STRINGS as o,useShellStrings as i,splitAround as a}from"./chunk-PEM7UXQ3.js";import{useState as m,useCallback as c,isValidElement as l,cloneElement as d}from"react";import{jsx as p,jsxs as h}from"react/jsx-runtime";var f=o.aboutApp,u={spreadsheet:{name:"Spreadsheets",version:"1.2.0",route:"/spreadsheet",description:f.spreadsheet},notepad:{name:"Notepad",version:"1.0.2",route:"/notepad",description:f.notepad},documents:{name:"Documents",version:"1.1.1",route:"/documents",description:f.documents},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:f.preview},files:{name:"Files",version:"1.1.4",route:"/files",description:f.files},browser:{name:"Browser",version:"1.0.2",route:"/browser",description:f.browser}},x=/* @__PURE__ */p(n,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),v=/* @__PURE__ */p(n,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function w({app:n}){const o=u[n],[f,w]=m(!1),N=c(()=>w(!0),[]),b=i().aboutApp,k=b.title(o.name);if(e(k,N,x),!f)return null;const g=r[o.route],y=l(g)?d(g,{className:"h-9 w-9"}):v,[j,A]=a(b.partOf);/* @__PURE__ */
1
+ import{useWindowMenuItem as e,Modal as t}from"./chunk-M7H3OCIL.js";import{navIcons as r}from"./chunk-CY5N5OA3.js";import{VERSION as s}from"./chunk-BGNJQMAZ.js";import{Icon as n}from"./chunk-FSPFV4MI.js";import{DEFAULT_SHELL_STRINGS as o,useShellStrings as i,splitAround as a}from"./chunk-X2PZMXDP.js";import{useState as m,useCallback as c,isValidElement as l,cloneElement as d}from"react";import{jsx as p,jsxs as h}from"react/jsx-runtime";var f=o.aboutApp,u={spreadsheet:{name:"Spreadsheets",version:"1.2.0",route:"/spreadsheet",description:f.spreadsheet},notepad:{name:"Notepad",version:"1.0.2",route:"/notepad",description:f.notepad},documents:{name:"Documents",version:"1.1.1",route:"/documents",description:f.documents},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:f.preview},files:{name:"Files",version:"1.1.4",route:"/files",description:f.files},browser:{name:"Browser",version:"1.0.2",route:"/browser",description:f.browser}},x=/* @__PURE__ */p(n,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),v=/* @__PURE__ */p(n,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function w({app:n}){const o=u[n],[f,w]=m(!1),N=c(()=>w(!0),[]),b=i().aboutApp,k=b.title(o.name);if(e(k,N,x),!f)return null;const g=r[o.route],y=l(g)?d(g,{className:"h-9 w-9"}):v,[j,A]=a(b.partOf);/* @__PURE__ */
2
2
  return p(t,{open:!0,onClose:()=>w(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */h("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
3
3
  /* @__PURE__ */p("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:y}),
4
4
  /* @__PURE__ */p("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:o.name}),
@@ -1,5 +1,5 @@
1
- import{areaBetween as e,curvePath as i}from"./chunk-VFC6QUEN.js";import{ChartTooltip as l}from"./chunk-TLRCTNUF.js";import{CartesianPlot as t}from"./chunk-4CPE5NBC.js";import{resolveSeriesColor as r,CHART_INK as a}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as n}from"./chunk-PEM7UXQ3.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{jsx as s,jsxs as m,Fragment as c}from"react/jsx-runtime";function u({rows:u,labels:d,variant:p="area",curve:f="linear",height:k=220,width:g,max:b,min:x,formatValue:w,yAxisLabel:y,color:j,tone:L,label:v,className:C,emptyLabel:M,radius:N=3}){const F=o().charts,O=n(),U=w??(e=>h(e,O)),A=v??F.range,E=u.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),P=r(0,j,L);/* @__PURE__ */
2
- return s(t,{labels:d,values:E,height:k,width:g,max:b,min:x,formatValue:U,yAxisLabel:y,className:C,emptyLabel:M,bandPadding:"bar"===p?.34:0,ariaLabel:F.rangeLabel(A,d.length),tooltip:e=>/* @__PURE__ */s(l,{title:d[e],rows:[{key:"high",label:F.high,color:P,value:null==u[e]?void 0:U(u[e].high)},{key:"low",label:F.low,color:P,value:null==u[e]?void 0:U(u[e].low)}]}),children:({x:l,y:t,active:r})=>"bar"===p?/* @__PURE__ */s("g",{children:u.map((e,i)=>/* @__PURE__ */s("rect",{x:l(i),y:t(e.high),width:Math.max(1,l.bandwidth),height:Math.max(1,t(e.low)-t(e.high)),rx:N,fill:P,fillOpacity:null===r||r===i?.85:.4},i))}):/* @__PURE__ */m("g",{children:[(()=>{const r=u.map((e,i)=>[l.center(i),t(e.high)]),a=u.map((e,i)=>[l.center(i),t(e.low)]);/* @__PURE__ */
1
+ import{areaBetween as e,curvePath as i}from"./chunk-VFC6QUEN.js";import{ChartTooltip as l}from"./chunk-TLRCTNUF.js";import{CartesianPlot as t}from"./chunk-25STFYV3.js";import{resolveSeriesColor as r,CHART_INK as a}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as n}from"./chunk-X2PZMXDP.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{jsx as s,jsxs as m,Fragment as c}from"react/jsx-runtime";function u({rows:u,labels:d,variant:p="area",curve:f="linear",height:k=220,width:g,max:b,min:x,formatValue:w,yAxisLabel:y,color:j,tone:L,label:v,className:M,emptyLabel:F,radius:N=3}){const C=o().charts,O=n(),T=w??(e=>h(e,O)),V=v??C.range,A=u.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),P=r(0,j,L);/* @__PURE__ */
2
+ return s(t,{labels:d,values:A,height:k,width:g,max:b,min:x,formatValue:T,yAxisLabel:y,className:M,emptyLabel:F,bandPadding:"bar"===p?.34:0,ariaLabel:C.rangeLabel(V,d.length),tooltip:e=>/* @__PURE__ */s(l,{title:d[e],rows:[{key:"high",label:C.high,color:P,value:null==u[e]?void 0:T(u[e].high)},{key:"low",label:C.low,color:P,value:null==u[e]?void 0:T(u[e].low)}]}),children:({x:l,y:t,active:r})=>"bar"===p?/* @__PURE__ */s("g",{children:u.map((e,i)=>/* @__PURE__ */s("rect",{x:l(i),y:t(e.high),width:Math.max(1,l.bandwidth),height:Math.max(1,t(e.low)-t(e.high)),rx:N,fill:P,fillOpacity:null===r||r===i?.85:.4},i))}):/* @__PURE__ */m("g",{children:[(()=>{const r=u.map((e,i)=>[l.center(i),t(e.high)]),a=u.map((e,i)=>[l.center(i),t(e.low)]);/* @__PURE__ */
3
3
  return m(c,{children:[
4
4
  /* @__PURE__ */s("path",{d:e(i(r,f),a),fill:P,fillOpacity:.2,stroke:"none"}),
5
5
  /* @__PURE__ */s("path",{d:i(r,f),fill:"none",stroke:P,strokeWidth:2,strokeLinejoin:"round"}),
@@ -1,4 +1,4 @@
1
- import{Button_default as e}from"./chunk-NHH2MXFU.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{useShellStrings as t}from"./chunk-PEM7UXQ3.js";import{jsxs as a,jsx as d}from"react/jsx-runtime";function n({title:n,message:o,onRetry:s,variant:i="dashed"}){const m=t().list;/* @__PURE__ */
1
+ import{Button_default as e}from"./chunk-NHH2MXFU.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{useShellStrings as t}from"./chunk-X2PZMXDP.js";import{jsxs as a,jsx as d}from"react/jsx-runtime";function n({title:n,message:o,onRetry:s,variant:i="dashed"}){const m=t().list;/* @__PURE__ */
2
2
  return a("div",{className:`flex flex-col items-center justify-center text-center ${"card"===i?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===i?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
3
3
  /* @__PURE__ */d(r,{name:"warning",className:"h-10 w-10 text-red-300 mb-3",strokeWidth:1,"aria-hidden":"true"}),
4
4
  /* @__PURE__ */d("h3",{className:"text-sm font-medium text-gray-900",children:n??m.loadError}),