efficient-shell 12.32.0 → 12.33.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 (312) hide show
  1. package/README.md +34 -2
  2. package/dist/{Browser-36SDGA64.js → Browser-TYVPZ2NT.js} +16 -16
  3. package/dist/{Calculator-GDHNFSB6.js → Calculator-2N7WJ6NR.js} +23 -23
  4. package/dist/{CurrencyConverter-PXCCCUS2.js → CurrencyConverter-LJ73P5P7.js} +7 -7
  5. package/dist/{Files-NVUIAUO5.js → Files-VUZWJMCE.js} +103 -103
  6. package/dist/{Notepad-QA2CD6GC.js → Notepad-LXLUGQUN.js} +8 -8
  7. package/dist/PdfViewer-OLQBTKOC.js +1 -0
  8. package/dist/{PomodoroTimer-HD2ZNOUV.js → PomodoroTimer-T34U5BLE.js} +20 -20
  9. package/dist/Preview-VRYWLVJY.js +177 -0
  10. package/dist/Sidebar-I5QQHJSA.js +44 -0
  11. package/dist/{Stock-EDZSOJAQ.js → Stock-BV36WRZA.js} +3 -3
  12. package/dist/{Weather-OTVZZEE7.js → Weather-YQQT5XYX.js} +20 -20
  13. package/dist/{WorldClock-PDKFE5S7.js → WorldClock-WN2X3YIV.js} +7 -7
  14. package/dist/ai/index.js +49 -49
  15. package/dist/apps/ImageAnnotator.js +1 -1
  16. package/dist/apps/index.d.ts +51 -1
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/media-host-check.js +1 -1
  19. package/dist/bin/ui-check.js +1 -1
  20. package/dist/brand.css +1 -1
  21. package/dist/charts/BoxPlotChart.js +1 -1
  22. package/dist/charts/CandlestickChart.js +1 -1
  23. package/dist/charts/CartesianPlot.js +1 -1
  24. package/dist/charts/ChartBrush.js +1 -1
  25. package/dist/charts/ChartFrame.js +1 -1
  26. package/dist/charts/ChartSkeleton.js +1 -1
  27. package/dist/charts/ChordChart.js +1 -1
  28. package/dist/charts/ColumnChart.js +1 -1
  29. package/dist/charts/FunnelChart.js +1 -1
  30. package/dist/charts/HeatmapChart.js +1 -1
  31. package/dist/charts/HistogramChart.js +1 -1
  32. package/dist/charts/Meter.js +1 -1
  33. package/dist/charts/PieChart.js +1 -1
  34. package/dist/charts/RadarChart.js +1 -1
  35. package/dist/charts/RadialBarChart.js +1 -1
  36. package/dist/charts/RangeChart.js +1 -1
  37. package/dist/charts/RankedBars.js +1 -1
  38. package/dist/charts/SankeyChart.js +1 -1
  39. package/dist/charts/ScatterChart.js +1 -1
  40. package/dist/charts/SpecChart.js +1 -1
  41. package/dist/charts/StatTile.js +1 -1
  42. package/dist/charts/SunburstChart.js +1 -1
  43. package/dist/charts/TimeSeriesChart.js +1 -1
  44. package/dist/charts/TreemapChart.js +1 -1
  45. package/dist/charts/WaterfallChart.js +1 -1
  46. package/dist/chunk-2FQBY4ED.js +6 -0
  47. package/dist/{chunk-MMSQZKJY.js → chunk-2LRSUDGN.js} +6 -6
  48. package/dist/{chunk-QB4LAGMN.js → chunk-2UBR4YUF.js} +1 -1
  49. package/dist/{chunk-NDGPJKE3.js → chunk-3DV5YLAI.js} +5 -5
  50. package/dist/chunk-3RX5KCUH.js +9 -0
  51. package/dist/{chunk-246K337V.js → chunk-3TCGXYUC.js} +1 -1
  52. package/dist/{chunk-3MAGUYG2.js → chunk-3U4IIEEY.js} +1 -1
  53. package/dist/{chunk-OU3J5TOO.js → chunk-3YCU6V3U.js} +1 -1
  54. package/dist/{chunk-V2OE6OTK.js → chunk-44ZHEIJZ.js} +13 -13
  55. package/dist/{chunk-DGFC5BX4.js → chunk-4HJNHI4A.js} +1 -1
  56. package/dist/{chunk-A6YUCAGF.js → chunk-4HJX2M4W.js} +1 -1
  57. package/dist/{chunk-QXTCEUFC.js → chunk-4RSBPRCQ.js} +1 -1
  58. package/dist/{chunk-BEN2LJWQ.js → chunk-4YWQE67T.js} +1 -1
  59. package/dist/{chunk-UJ23EKXU.js → chunk-5LHEPE4B.js} +1 -1
  60. package/dist/{chunk-ZP3UAWJL.js → chunk-5PSFENSW.js} +15 -15
  61. package/dist/{chunk-FXS2P23Q.js → chunk-5UPLN44S.js} +9 -9
  62. package/dist/{chunk-HWV6UDFC.js → chunk-65JCQLM4.js} +1 -1
  63. package/dist/{chunk-AGNHOSES.js → chunk-6D6Q3ZCG.js} +6 -6
  64. package/dist/{chunk-PUXSFLWR.js → chunk-6SOS6OBB.js} +1 -1
  65. package/dist/{chunk-5R3NDBCD.js → chunk-6XPS3H5Z.js} +9 -9
  66. package/dist/{chunk-DRIO2Y4R.js → chunk-75TPMXA7.js} +4 -4
  67. package/dist/{chunk-S54Z2JAZ.js → chunk-7VIRSTRC.js} +7 -7
  68. package/dist/{chunk-BXPEEPYH.js → chunk-7WMFHPKS.js} +1 -1
  69. package/dist/chunk-A6KFGANR.js +23 -0
  70. package/dist/{chunk-NZ74N2IQ.js → chunk-AEMTJGD4.js} +1 -1
  71. package/dist/{chunk-AFVI75RH.js → chunk-AJ5GLMGD.js} +7 -7
  72. package/dist/{chunk-VERSP62V.js → chunk-AKKDFFUO.js} +1 -1
  73. package/dist/{chunk-DWGMTMDU.js → chunk-APGIPXR7.js} +1 -1
  74. package/dist/{chunk-LQC5U5YT.js → chunk-ARBS2EZ6.js} +1 -1
  75. package/dist/{chunk-FKJPBQ6I.js → chunk-B3KQELHS.js} +6 -6
  76. package/dist/chunk-B447IHIL.js +4 -0
  77. package/dist/{chunk-LOJAJARD.js → chunk-BLXEDMZM.js} +6 -6
  78. package/dist/{chunk-TBXFRW3E.js → chunk-BLXHT72M.js} +1 -1
  79. package/dist/{chunk-VI54L75G.js → chunk-BNPJHOAC.js} +9 -9
  80. package/dist/{chunk-3TR6C5V4.js → chunk-BRFUQAVC.js} +1 -1
  81. package/dist/{chunk-M3FBPZ4G.js → chunk-BSEQJM7X.js} +1 -1
  82. package/dist/{chunk-BIBQAEHV.js → chunk-BXZLSY2S.js} +1 -1
  83. package/dist/{chunk-6MA7VXZR.js → chunk-CBXEMPZL.js} +3 -3
  84. package/dist/{chunk-COF2CF5R.js → chunk-CCPUNN4F.js} +1 -1
  85. package/dist/{chunk-YG6ONZIB.js → chunk-COHFFGFE.js} +2 -2
  86. package/dist/{chunk-ZFQI3EVU.js → chunk-CVXJKHPD.js} +6 -6
  87. package/dist/chunk-D53FU245.js +8 -0
  88. package/dist/{chunk-OL2XKAX2.js → chunk-DASRJ26L.js} +1 -1
  89. package/dist/{chunk-L6XEON5Q.js → chunk-DEJIH3ZQ.js} +1 -1
  90. package/dist/{chunk-A7JAHN75.js → chunk-DFOKJAIS.js} +1 -1
  91. package/dist/{chunk-RIULA2CH.js → chunk-DGFFDZCY.js} +11 -11
  92. package/dist/{chunk-K4BM6PPZ.js → chunk-DU7TJVX5.js} +1 -1
  93. package/dist/{chunk-ZGY2OK7Q.js → chunk-DYOFTZOC.js} +9 -9
  94. package/dist/{chunk-OA55OBDP.js → chunk-E44RNULN.js} +1 -1
  95. package/dist/{chunk-XKBCF6SK.js → chunk-E6PDAYBR.js} +10 -10
  96. package/dist/chunk-EEFUXXYJ.js +22 -0
  97. package/dist/{chunk-WJTZE3PL.js → chunk-EQFWFQOZ.js} +10 -10
  98. package/dist/{chunk-XR7SPONC.js → chunk-F3MO56N4.js} +1 -1
  99. package/dist/chunk-FBMYLCCE.js +11 -0
  100. package/dist/{chunk-VW3ZUWW2.js → chunk-FCILLVVT.js} +61 -61
  101. package/dist/{chunk-CYTK7DCA.js → chunk-FCWBO7I3.js} +12 -12
  102. package/dist/{chunk-RPSNYIDY.js → chunk-FEQQMRHJ.js} +3 -3
  103. package/dist/chunk-FOE2QHDE.js +13 -0
  104. package/dist/{chunk-LNXYVWEF.js → chunk-FUNGLFQE.js} +3 -3
  105. package/dist/{chunk-26Y66IXU.js → chunk-FVORTWUY.js} +2 -2
  106. package/dist/{chunk-X4IFSC57.js → chunk-FXG7TOZN.js} +1 -1
  107. package/dist/{chunk-XOXTMWV3.js → chunk-G5U7IRH4.js} +2 -2
  108. package/dist/{chunk-J44SUUOG.js → chunk-GAGCE2ML.js} +1 -1
  109. package/dist/{chunk-IBLRSK7V.js → chunk-GHLXZDLU.js} +1 -1
  110. package/dist/{chunk-OWFJRER6.js → chunk-H4GOJ26X.js} +1 -1
  111. package/dist/chunk-HTHD7STJ.js +9 -0
  112. package/dist/{chunk-B7UT3W4C.js → chunk-HTHNDX32.js} +1 -1
  113. package/dist/{chunk-Y7XX6Z3M.js → chunk-HWJQLLJA.js} +8 -8
  114. package/dist/chunk-I4RJAMLJ.js +1 -0
  115. package/dist/{chunk-R3W6LZBG.js → chunk-ID35S5Y6.js} +1 -1
  116. package/dist/{chunk-QJ6HVBAA.js → chunk-IEW5JTIR.js} +4 -4
  117. package/dist/{chunk-XBC7CBVJ.js → chunk-IFLIE3EQ.js} +1 -1
  118. package/dist/{chunk-5XOF3O4B.js → chunk-IODIQ77P.js} +1 -1
  119. package/dist/{chunk-CHRK5R3Y.js → chunk-IRCASURW.js} +8 -8
  120. package/dist/{chunk-KDG7NWYX.js → chunk-ITEOA45V.js} +1 -1
  121. package/dist/{chunk-7IRO4JAA.js → chunk-IYTOOV7Q.js} +1 -1
  122. package/dist/{chunk-NQ43KRRX.js → chunk-JOYGSKWG.js} +9 -9
  123. package/dist/chunk-JTMR3EH3.js +28 -0
  124. package/dist/{chunk-3UMS74TZ.js → chunk-JWUNK2PW.js} +1 -1
  125. package/dist/{chunk-LUAA4LKY.js → chunk-KITSIQCV.js} +16 -16
  126. package/dist/{chunk-PK5KDLIG.js → chunk-KRCWLZV7.js} +12 -12
  127. package/dist/{chunk-ZHVWK5NL.js → chunk-KV6XCHAG.js} +18 -18
  128. package/dist/{chunk-JI55MXP4.js → chunk-KZQRUVII.js} +7 -7
  129. package/dist/{chunk-DHLXSL3Y.js → chunk-LPAOHDUE.js} +1 -1
  130. package/dist/chunk-LSONG4QV.js +1 -0
  131. package/dist/{chunk-HGGDOMBV.js → chunk-MZCYB2MW.js} +1 -1
  132. package/dist/{chunk-25M4CAB3.js → chunk-NDWX5Z4D.js} +1 -1
  133. package/dist/{chunk-Q2LKH6RN.js → chunk-NGG6DYNN.js} +1 -1
  134. package/dist/{chunk-RSRTE7RG.js → chunk-NLHGFQ54.js} +1 -1
  135. package/dist/{chunk-QYKWVZ3R.js → chunk-NUDL6UO3.js} +1 -1
  136. package/dist/{chunk-YELYAGCX.js → chunk-P62QGXRW.js} +12 -12
  137. package/dist/{chunk-4U2OUX65.js → chunk-PA3OU3Y7.js} +5 -5
  138. package/dist/{chunk-X6AMAYXV.js → chunk-PC3MYH2K.js} +2 -2
  139. package/dist/{chunk-V7BHDLP2.js → chunk-PGATHOTX.js} +1 -1
  140. package/dist/{chunk-QUN3RSMN.js → chunk-PR6FNBKR.js} +1 -1
  141. package/dist/{chunk-6AAGZ34A.js → chunk-PZNF2TEB.js} +9 -9
  142. package/dist/{chunk-CAIUI3DC.js → chunk-Q6GECV4J.js} +1 -1
  143. package/dist/{chunk-BLC6HAU3.js → chunk-QDEQHT2T.js} +1 -1
  144. package/dist/{chunk-QXLYU5FR.js → chunk-QDIPNQ6M.js} +1 -1
  145. package/dist/{chunk-JZ4V3RHK.js → chunk-QO7UHTUE.js} +4 -4
  146. package/dist/chunk-QXXMRV4E.js +2 -0
  147. package/dist/{chunk-JTJDXCJU.js → chunk-R5SVNFUG.js} +4 -4
  148. package/dist/{chunk-FE6J5S5X.js → chunk-R5TSUJTK.js} +6 -6
  149. package/dist/{chunk-7JR2O3IX.js → chunk-RJ24VXBZ.js} +6 -6
  150. package/dist/chunk-RMEYKJEH.js +8 -0
  151. package/dist/{chunk-K73KBA5C.js → chunk-ROKUEMAK.js} +4 -4
  152. package/dist/{chunk-IE5XWHDU.js → chunk-ROPVIMIR.js} +1 -1
  153. package/dist/chunk-RTGGGZ2R.js +2 -0
  154. package/dist/{chunk-JLQ7N54N.js → chunk-S26FG4RF.js} +15 -15
  155. package/dist/{chunk-RLFZRIO4.js → chunk-SQ4ZFG2B.js} +1 -1
  156. package/dist/{chunk-VTDW5GLS.js → chunk-TAEO2JC6.js} +1 -1
  157. package/dist/{chunk-QPSKEDR7.js → chunk-TDG5WGLR.js} +1 -1
  158. package/dist/{chunk-KFNQVNND.js → chunk-TMSSR5UH.js} +1 -1
  159. package/dist/{chunk-G3NE4SGZ.js → chunk-UHQBHSWL.js} +8 -8
  160. package/dist/{chunk-6ZTVZIPI.js → chunk-V3KQIY6T.js} +6 -6
  161. package/dist/{chunk-AFLG5E4O.js → chunk-V5VAKDLS.js} +6 -6
  162. package/dist/chunk-VMKTA5HL.js +6 -0
  163. package/dist/{chunk-JYVHFRKK.js → chunk-VUM6BYAX.js} +5 -5
  164. package/dist/{chunk-IYM5N7FH.js → chunk-VVXBBU6R.js} +3 -3
  165. package/dist/{chunk-5XHJ3H6Y.js → chunk-VWYICGVA.js} +1 -1
  166. package/dist/{chunk-QTWHMCCX.js → chunk-W5HT23P7.js} +11 -11
  167. package/dist/{chunk-XOQH6VSU.js → chunk-WEZ2RO72.js} +11 -11
  168. package/dist/{chunk-JIBU7YY4.js → chunk-WKWZILZA.js} +2 -2
  169. package/dist/chunk-WUEH6DLJ.js +14 -0
  170. package/dist/{chunk-NQA267J3.js → chunk-X22SFR5F.js} +5 -5
  171. package/dist/{chunk-PTEKHRNX.js → chunk-XBX3N3VG.js} +15 -15
  172. package/dist/{chunk-5OJFYNEZ.js → chunk-XCY7A5UM.js} +1 -1
  173. package/dist/{chunk-QBQMMOP6.js → chunk-XPSWZQR4.js} +2 -2
  174. package/dist/{chunk-M2TQQKJO.js → chunk-XYMEC63O.js} +1 -1
  175. package/dist/{chunk-T5UMQZ5X.js → chunk-Y43S6YS5.js} +11 -11
  176. package/dist/{chunk-KTKFCR6T.js → chunk-YAM3L5N4.js} +1 -1
  177. package/dist/{chunk-K4RY57UX.js → chunk-YEEMRWBS.js} +1 -1
  178. package/dist/{chunk-LOMNX5VH.js → chunk-YM7AWNMY.js} +1 -1
  179. package/dist/{chunk-555KW6TM.js → chunk-YMUHIJDJ.js} +4 -4
  180. package/dist/{chunk-PR5CON2G.js → chunk-YW6BODBX.js} +1 -1
  181. package/dist/{chunk-AJ2EEWZT.js → chunk-ZDCCYRFF.js} +2 -2
  182. package/dist/{chunk-4XN6ACGV.js → chunk-ZDDMFFQK.js} +1 -1
  183. package/dist/{chunk-Q2T5DRIK.js → chunk-ZGIAMYTI.js} +1 -1
  184. package/dist/{chunk-E6GGE7E5.js → chunk-ZHR2HNT2.js} +14 -14
  185. package/dist/data/DataTable.js +1 -1
  186. package/dist/data/EntityList.js +1 -1
  187. package/dist/data/Gantt.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/data/ResizableTable.js +1 -1
  193. package/dist/file-intake/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/TagInput.js +1 -1
  221. package/dist/forms/TextToolbar.js +1 -1
  222. package/dist/forms/TimePicker.js +1 -1
  223. package/dist/forms/WidthsBar.js +1 -1
  224. package/dist/forms/mediaLibraryMenu.js +1 -1
  225. package/dist/forms/mediaMoveItems.js +1 -1
  226. package/dist/forms/textAlign.js +1 -1
  227. package/dist/forms/useFileIntake.js +1 -1
  228. package/dist/index.js +665 -665
  229. package/dist/locales/zh-Hans.js +1 -1
  230. package/dist/map/index.js +2 -2
  231. package/dist/model-viewer/index.js +3 -3
  232. package/dist/page-tabs/index.js +5 -5
  233. package/dist/pdf/index.js +1 -1
  234. package/dist/shell/Accordion.js +1 -1
  235. package/dist/shell/AppUpdateBanner.js +1 -1
  236. package/dist/shell/Avatar.js +1 -1
  237. package/dist/shell/Banner.js +1 -1
  238. package/dist/shell/Breadcrumbs.js +1 -1
  239. package/dist/shell/BudgetBar.js +1 -1
  240. package/dist/shell/Card.js +1 -1
  241. package/dist/shell/ColoredBadge.js +1 -1
  242. package/dist/shell/ConfirmDialog.js +1 -1
  243. package/dist/shell/ContainerFillChart.js +1 -1
  244. package/dist/shell/CountBadge.js +1 -1
  245. package/dist/shell/Dialog.js +1 -1
  246. package/dist/shell/Drawer.js +1 -1
  247. package/dist/shell/EditableGrid.js +1 -1
  248. package/dist/shell/EmptyState.js +1 -1
  249. package/dist/shell/GlobalSearch.js +1 -1
  250. package/dist/shell/HelpCenter.js +1 -1
  251. package/dist/shell/IconRail.js +1 -1
  252. package/dist/shell/ImageLightbox.js +1 -1
  253. package/dist/shell/ItemCount.js +1 -1
  254. package/dist/shell/LanguageSelect.js +1 -1
  255. package/dist/shell/Markdown.js +1 -1
  256. package/dist/shell/MetricBar.js +1 -1
  257. package/dist/shell/MetricBarLegend.js +1 -1
  258. package/dist/shell/MilestoneTimeline.js +1 -1
  259. package/dist/shell/PageHeader.js +1 -1
  260. package/dist/shell/ProductionTimeline.js +1 -1
  261. package/dist/shell/ResizeHandle.js +1 -1
  262. package/dist/shell/Result.js +1 -1
  263. package/dist/shell/SearchableSelect.js +1 -1
  264. package/dist/shell/SettingReset.js +1 -1
  265. package/dist/shell/SettingRow.js +1 -1
  266. package/dist/shell/SidebarLayout.js +1 -1
  267. package/dist/shell/SidebarNav.js +1 -1
  268. package/dist/shell/SortableList.js +1 -1
  269. package/dist/shell/Statistic.js +1 -1
  270. package/dist/shell/TimeAgo.js +1 -1
  271. package/dist/shell/TimelineTrack.js +1 -1
  272. package/dist/shell/TransferProgress.js +1 -1
  273. package/dist/shell/Tree.js +1 -1
  274. package/dist/shell/discardGuard.js +1 -1
  275. package/dist/shell/language.js +1 -1
  276. package/dist/shell/strings.d.ts +8 -0
  277. package/dist/shell/strings.js +1 -1
  278. package/dist/shell/toast.js +1 -1
  279. package/dist/telemetry/index.js +1 -1
  280. package/dist/templates/AuthScreen.js +1 -1
  281. package/dist/templates/ChatTemplate.js +1 -1
  282. package/dist/templates/CheckoutTemplate.js +1 -1
  283. package/dist/templates/DashboardTemplate.js +1 -1
  284. package/dist/templates/DataTablePage.js +1 -1
  285. package/dist/templates/EmailTemplate.js +1 -1
  286. package/dist/templates/ErrorBoundary.js +1 -1
  287. package/dist/templates/ErrorPage.js +1 -1
  288. package/dist/templates/FormLayoutPage.js +1 -1
  289. package/dist/templates/GalleryTemplate.js +1 -1
  290. package/dist/ui/index.js +1 -1
  291. package/dist/version.js +1 -1
  292. package/package.json +1 -1
  293. package/dist/PdfViewer-627HEAIL.js +0 -1
  294. package/dist/Preview-FW2KT6FQ.js +0 -177
  295. package/dist/Sidebar-QNJNEBT2.js +0 -44
  296. package/dist/chunk-2PNG5UR6.js +0 -22
  297. package/dist/chunk-3ECUHYHI.js +0 -28
  298. package/dist/chunk-7CHEHWGL.js +0 -9
  299. package/dist/chunk-ADNUV6OV.js +0 -8
  300. package/dist/chunk-AWY2ZOXT.js +0 -14
  301. package/dist/chunk-ESL5TDNA.js +0 -1
  302. package/dist/chunk-GX4CDXPK.js +0 -9
  303. package/dist/chunk-H74VN7OI.js +0 -2
  304. package/dist/chunk-H7WMOY62.js +0 -1
  305. package/dist/chunk-JROPOGQP.js +0 -2
  306. package/dist/chunk-M3D5FW5R.js +0 -6
  307. package/dist/chunk-NMWV6BOL.js +0 -8
  308. package/dist/chunk-OQGCQQ7H.js +0 -6
  309. package/dist/chunk-PPVZMIBL.js +0 -4
  310. package/dist/chunk-R3ZEDJDZ.js +0 -13
  311. package/dist/chunk-VVI4Y6XA.js +0 -23
  312. package/dist/chunk-XFC7AWPW.js +0 -11
@@ -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-L6XEON5Q.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-DEJIH3ZQ.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,11 +1,11 @@
1
- import{FormField as e}from"./chunk-6KBDNYRW.js";import{ImageFocusPoint as i}from"./chunk-555KW6TM.js";import{Segmented as a}from"./chunk-HNIIDDLJ.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as s,UploadGlyph as l,zoneFocusClass as c,dropzoneClass as d}from"./chunk-COF2CF5R.js";import{TransferProgress as u}from"./chunk-K73KBA5C.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-KDG7NWYX.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{useShellStrings as b}from"./chunk-L6XEON5Q.js";import{useState as f,useRef as g,useEffect as v,useId as y}from"react";import{jsxs as k,jsx as x,Fragment as N}from"react/jsx-runtime";var j=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:C,label:F,hint:$,error:z,required:O,className:U,accept:P="image/*",maxSizeBytes:K,fit:D="cover",height:I,shape:q="rect",placeholder:B,cta:H,acceptHint:S,showFilename:W=!0,allowReplace:A=!0,allowRemove:V=!0,replaceLabel:X,removeLabel:Y,busy:_=!1,busyLabel:E,choosingLabel:G,pickFailedLabel:J,progress:M,disabled:Q=!1,kind:T,onKindChange:Z,focus:ee,onFocusChange:ie,focusLabel:ae}){const te=b().media,re="circle"===q,oe=I??(re?96:112),ne=H??te.cta,se=T??(/video/.test(P)&&!/image/.test(P)?"video":"image"),le="string"==typeof Y&&Y?Y:te.remove,[ce,de]=f(!1),[ue,me]=f(!1),he=g(!0);v(()=>()=>{he.current=!1},[]);const pe=_||ce,be=ce&&!_?G??te.choosing:E??te.uploading,fe=z??(ue?J??te.pickFailed:void 0),ge=e=>{if(!R)return;me(!1);const i=R(e);i&&"function"==typeof i.then&&(de(!0),i.then(e=>{he.current&&(de(!1),"string"==typeof e&&e&&L(e))},()=>{he.current&&(de(!1),me(!0))}))},ve=y(),ye=g(null),[ke,xe]=f(null);v(()=>()=>{ye.current&&URL.revokeObjectURL(ye.current)},[]);const Ne=Q||pe,je=!!w&&(t(w,P)||w===ke),we=B??r(P,te),Le=X??(je||"video"===se?te.changeVideo:te.changeImage),Re=e=>{R?ge(e):C?C(e):(e=>{ye.current&&URL.revokeObjectURL(ye.current);const i=URL.createObjectURL(e);ye.current=i,xe(e.type.startsWith("video/")?i:null),L(i)})(e)},Ce=m({accept:P,maxSizeBytes:K,acceptHint:S,multiple:!1,disabled:Ne,onAccept:([e])=>Re(e)}),{dragOver:Fe}=Ce,$e=()=>{Ne||(R?ge():Ce.open())},ze=w?o(w):"",Oe=!re&&!je&&!!ie,Ue=Q||!A&&!V?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:[re?"absolute inset-0 flex items-center justify-center gap-1 p-1 text-(--status-on-solid)":"absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[A&&/* @__PURE__ */k("button",{id:Oe?void 0:ve,type:"button","aria-labelledby":`${ve}-change`,onClick:()=>$e(),disabled:pe,className:re?`w-8 shrink-0 ${j}`:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${j}`,children:[
1
+ import{FormField as e}from"./chunk-6KBDNYRW.js";import{ImageFocusPoint as i}from"./chunk-YMUHIJDJ.js";import{Segmented as a}from"./chunk-HNIIDDLJ.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as s,UploadGlyph as l,zoneFocusClass as c,dropzoneClass as d}from"./chunk-CCPUNN4F.js";import{TransferProgress as u}from"./chunk-ROKUEMAK.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-ITEOA45V.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{useShellStrings as b}from"./chunk-DEJIH3ZQ.js";import{useState as f,useRef as g,useEffect as v,useId as y}from"react";import{jsxs as k,jsx as x,Fragment as N}from"react/jsx-runtime";var j=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:C,label:U,hint:$,error:F,required:z,className:I,accept:O="image/*",maxSizeBytes:P,fit:D="cover",height:H,shape:q="rect",placeholder:J,cta:K,acceptHint:S,showFilename:A=!0,allowReplace:B=!0,allowRemove:E=!0,replaceLabel:V,removeLabel:M,busy:W=!1,busyLabel:Y,choosingLabel:_,pickFailedLabel:Q,progress:T,disabled:Z=!1,kind:G,onKindChange:X,focus:ee,onFocusChange:ie,focusLabel:ae}){const te=b().media,re="circle"===q,oe=H??(re?96:112),ne=K??te.cta,se=G??(/video/.test(O)&&!/image/.test(O)?"video":"image"),le="string"==typeof M&&M?M:te.remove,[ce,de]=f(!1),[ue,me]=f(!1),he=g(!0);v(()=>()=>{he.current=!1},[]);const pe=W||ce,be=ce&&!W?_??te.choosing:Y??te.uploading,fe=F??(ue?Q??te.pickFailed:void 0),ge=e=>{if(!R)return;me(!1);const i=R(e);i&&"function"==typeof i.then&&(de(!0),i.then(e=>{he.current&&(de(!1),"string"==typeof e&&e&&L(e))},()=>{he.current&&(de(!1),me(!0))}))},ve=y(),ye=g(null),[ke,xe]=f(null);v(()=>()=>{ye.current&&URL.revokeObjectURL(ye.current)},[]);const Ne=Z||pe,je=!!w&&(t(w,O)||w===ke),we=J??r(O,te),Le=V??(je||"video"===se?te.changeVideo:te.changeImage),Re=e=>{R?ge(e):C?C(e):(e=>{ye.current&&URL.revokeObjectURL(ye.current);const i=URL.createObjectURL(e);ye.current=i,xe(e.type.startsWith("video/")?i:null),L(i)})(e)},Ce=m({accept:O,maxSizeBytes:P,acceptHint:S,multiple:!1,disabled:Ne,onAccept:([e])=>Re(e)}),{dragOver:Ue}=Ce,$e=()=>{Ne||(R?ge():Ce.open())},Fe=w?o(w):"",ze=!re&&!je&&!!ie,Ie=Z||!B&&!E?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:[re?"absolute inset-0 flex items-center justify-center gap-1 p-1 text-(--status-on-solid)":"absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[B&&/* @__PURE__ */k("button",{id:ze?void 0:ve,type:"button","aria-labelledby":`${ve}-change`,onClick:()=>$e(),disabled:pe,className:re?`w-8 shrink-0 ${j}`:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${j}`,children:[
2
2
  /* @__PURE__ */x(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
3
- /* @__PURE__ */x("span",{id:`${ve}-change`,className:re?"sr-only":"truncate",children:Le})]}),V&&/* @__PURE__ */x("button",{type:"button","aria-label":le,onClick:()=>{ye.current&&(URL.revokeObjectURL(ye.current),ye.current=null),xe(null),L("")},disabled:pe,className:`${re?"":"ml-auto "}w-8 shrink-0 ${j}`,children:/* @__PURE__ */x(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Pe=/* @__PURE__ */k("div",{...Ce.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden border transition-colors",re?"shrink-0 rounded-full":"rounded-(--radius-control)",Oe?"":"bg-gray-100",Fe?"border-blue-500":"border-line"].join(" "),style:Oe?void 0:re?{height:oe,width:oe}:{height:oe},children:[Oe?
4
- /* @__PURE__ */x(i,{value:ee??"",onChange:e=>ie?.(e),label:ae??te.focus,image:w,hint:null,id:ve,disabled:Ne,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):je?/* @__PURE__ */x("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":ze||void 0,className:"h-full w-full",style:{objectFit:D}}):/* @__PURE__ */x("img",{src:w??void 0,alt:ze,className:"h-full w-full",style:{objectFit:D,objectPosition:ee||void 0}}),W&&!re&&w&&/* @__PURE__ */x(n,{children:ze}),Ue,pe&&/* @__PURE__ */x(s,{label:be,progress:M,rounded:re?"rounded-full":"rounded-md"})]}),Ke=/* @__PURE__ */k(N,{children:[
3
+ /* @__PURE__ */x("span",{id:`${ve}-change`,className:re?"sr-only":"truncate",children:Le})]}),E&&/* @__PURE__ */x("button",{type:"button","aria-label":le,onClick:()=>{ye.current&&(URL.revokeObjectURL(ye.current),ye.current=null),xe(null),L("")},disabled:pe,className:`${re?"":"ml-auto "}w-8 shrink-0 ${j}`,children:/* @__PURE__ */x(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Oe=/* @__PURE__ */k("div",{...Ce.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden border transition-colors",re?"shrink-0 rounded-full":"rounded-(--radius-control)",ze?"":"bg-gray-100",Ue?"border-blue-500":"border-line"].join(" "),style:ze?void 0:re?{height:oe,width:oe}:{height:oe},children:[ze?
4
+ /* @__PURE__ */x(i,{value:ee??"",onChange:e=>ie?.(e),label:ae??te.focus,image:w,hint:null,id:ve,disabled:Ne,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):je?/* @__PURE__ */x("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Fe||void 0,className:"h-full w-full",style:{objectFit:D}}):/* @__PURE__ */x("img",{src:w??void 0,alt:Fe,className:"h-full w-full",style:{objectFit:D,objectPosition:ee||void 0}}),A&&!re&&w&&/* @__PURE__ */x(n,{children:Fe}),Ie,pe&&/* @__PURE__ */x(s,{label:be,progress:T,rounded:re?"rounded-full":"rounded-md"})]}),Pe=/* @__PURE__ */k(N,{children:[
5
5
  /* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:we}),
6
- /* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:ne}),S&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:S})]}),De=/* @__PURE__ */k("button",{type:"button",id:ve,onClick:()=>$e(),disabled:Ne,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":O||void 0,"aria-describedby":fe?`${ve}-error`:$?`${ve}-hint`:void 0,...Ce.zoneProps,"data-media-circle":"",className:["group/zone flex w-full items-center gap-4 rounded-lg text-left",Ne?"cursor-not-allowed opacity-60":"cursor-pointer",c(Ne)].join(" "),children:[
7
- /* @__PURE__ */x("span",{className:["flex shrink-0 items-center justify-center rounded-full border-2 border-dashed text-ink-faintest transition-colors",Fe?"border-accent-fill bg-accent-tint":"border-line-strong bg-surface-sunken group-hover/zone:bg-accent-tint"].join(" "),style:{height:oe,width:oe},children:/* @__PURE__ */x(l,{})}),
8
- /* @__PURE__ */x("span",{className:"flex min-w-0 flex-col items-start gap-1 [&>span]:px-0",children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:M}):Ke})]}),Ie=re?De:/* @__PURE__ */x("button",{type:"button",id:ve,onClick:()=>$e(),disabled:Ne,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":O||void 0,"aria-describedby":fe?`${ve}-error`:$?`${ve}-hint`:void 0,...Ce.zoneProps,className:d(Fe,Ne,c(Ne)),style:{minHeight:oe},children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:M}):/* @__PURE__ */k(N,{children:[
9
- /* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(l,{})}),Ke]})});/* @__PURE__ */
10
- return k(e,{label:F,htmlFor:ve,hint:$,error:fe,required:O,className:U,children:[Z&&/* @__PURE__ */x("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */x(a,{value:se,onChange:e=>Z(e),options:[{value:"image",label:te.image,icon:/* @__PURE__ */x(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:Ne},{value:"video",label:te.video,icon:/* @__PURE__ */x(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:Ne}],block:!0,size:"md",label:"string"==typeof F&&F?F:te.upload})}),w?Pe:Ie,!R&&/* @__PURE__ */x("input",{...Ce.inputProps}),
6
+ /* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:ne}),S&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:S})]}),De=/* @__PURE__ */k("button",{type:"button",id:ve,onClick:()=>$e(),disabled:Ne,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":z||void 0,"aria-describedby":fe?`${ve}-error`:$?`${ve}-hint`:void 0,...Ce.zoneProps,"data-media-circle":"",className:["group/zone flex w-full items-center gap-4 rounded-lg text-left",Ne?"cursor-not-allowed opacity-60":"cursor-pointer",c(Ne)].join(" "),children:[
7
+ /* @__PURE__ */x("span",{className:["flex shrink-0 items-center justify-center rounded-full border-2 border-dashed text-ink-faintest transition-colors",Ue?"border-accent-fill bg-accent-tint":"border-line-strong bg-surface-sunken group-hover/zone:bg-accent-tint"].join(" "),style:{height:oe,width:oe},children:/* @__PURE__ */x(l,{})}),
8
+ /* @__PURE__ */x("span",{className:"flex min-w-0 flex-col items-start gap-1 [&>span]:px-0",children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:T}):Pe})]}),He=re?De:/* @__PURE__ */x("button",{type:"button",id:ve,onClick:()=>$e(),disabled:Ne,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":z||void 0,"aria-describedby":fe?`${ve}-error`:$?`${ve}-hint`:void 0,...Ce.zoneProps,className:d(Ue,Ne,c(Ne)),style:{minHeight:oe},children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:T}):/* @__PURE__ */k(N,{children:[
9
+ /* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(l,{})}),Pe]})});/* @__PURE__ */
10
+ return k(e,{label:U,htmlFor:ve,hint:$,error:fe,required:z,className:I,children:[X&&/* @__PURE__ */x("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */x(a,{value:se,onChange:e=>X(e),options:[{value:"image",label:te.image,icon:/* @__PURE__ */x(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:Ne},{value:"video",label:te.video,icon:/* @__PURE__ */x(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:Ne}],block:!0,size:"md",label:"string"==typeof U&&U?U:te.upload})}),w?Oe:He,!R&&/* @__PURE__ */x("input",{...Ce.inputProps}),
11
11
  /* @__PURE__ */x(h,{rejections:Ce.rejections})]})}export{w as MediaUploadField};
@@ -1,8 +1,8 @@
1
- import{optionMatches as e,OptionSublabel as t}from"./chunk-K5YT5PMJ.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-JMGDGNM7.js";import{Tooltip as r}from"./chunk-SOZCWT6I.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as s,POPUP_MAX_WIDTH as a,MENU_MAX_HEIGHT as c}from"./chunk-GLUJS42B.js";import{glassStyle as u}from"./chunk-5FYDNH4Y.js";import{useShellStrings as d}from"./chunk-L6XEON5Q.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:M="",tone:E,tooltip:W,split:Y}){const[$,G]=m(!1),[J,S]=m(""),T=d(),B=h(null),F=h(null),H=h(null),I=s(B,$),K=e=>k.find(t=>t.value===e)?.label??e,O=p(()=>{const t=new Set(o),n=[],r=J.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,J]),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)},Z=e=>{e&&!o.includes(e)?(y([...o,e]),S("")):S("")},z=e=>y(o.filter(t=>t!==e)),A=()=>{const e=J.trim();if(Y&&e)return P(e.split(Y)),void S("");j&&e?Z(e):S("")},Q=h(()=>{});Q.current=()=>{A(),G(!1)},f(()=>{if(!$)return;const e=e=>{const t=e.target;B.current?.contains(t)||H.current?.contains(t)||(A(),G(!1))};document.addEventListener("mousedown",e);const t=l(()=>Q.current());return()=>{document.removeEventListener("mousedown",e),t()}});const U=k.length>0;/* @__PURE__ */
2
- return g("div",{ref:B,className:"relative",children:[
3
- /* @__PURE__ */g("div",{onMouseDown:e=>{L||e.target.closest("button")||(e.preventDefault(),F.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":""} ${M}`}),children:[o.map(e=>{const t=E?.(e),n=w[t??"accent"],o=/* @__PURE__ */g("span",{"data-tone":t,className:n.chip,children:[
4
- /* @__PURE__ */x("span",{className:"truncate",children:K(e)}),!L&&/* @__PURE__ */x("button",{type:"button","aria-label":T.select.removeItem?.(K(e))??`${T.select.remove} ${K(e)}`,onClick:()=>z(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:F,type:"text",autoComplete:"off",role:"combobox","aria-expanded":$&&U,"aria-invalid":C||void 0,disabled:L,value:J,placeholder:0===o.length?N:void 0,onChange:e=>{(e=>{if(Y){const t=e.split(Y);if(t.length>1)return P(t.slice(0,-1)),void S(t[t.length-1])}S(e)})(e.target.value),G(!0)},onFocus:()=>{!L&&U&&G(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=J.trim(),o=n?O.filter(t=>e(t,n.toLowerCase())):[];1===o.length?Z(o[0].value):A()}else"Backspace"===t.key&&""===J&&o.length>0?z(o[o.length-1]):"Escape"===t.key?(G(!1),S(""),F.current?.blur()):"Tab"===t.key&&(A(),G(!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"})]}),$&&U&&v(
6
- /* @__PURE__ */x("div",{ref:H,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:I?.left,right:I?.right,top:I?.top,bottom:I?.bottom,minWidth:I?.minWidth,maxWidth:I?.maxWidth??a,width:"max-content",visibility:I?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:I?.maxHeight??c},children:0===O.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&o.length>=k.length?T.select.allSelected:T.select.noMatches}):O.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:[
1
+ import{optionMatches as e,OptionSublabel as t}from"./chunk-K5YT5PMJ.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-JMGDGNM7.js";import{Tooltip as r}from"./chunk-SOZCWT6I.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as s,POPUP_MAX_WIDTH as a,MENU_MAX_HEIGHT as c}from"./chunk-GLUJS42B.js";import{glassStyle as u}from"./chunk-5FYDNH4Y.js";import{useShellStrings as d}from"./chunk-DEJIH3ZQ.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:D,id:L,className:M="",tone:E,tooltip:W,split:Y}){const[J,$]=m(!1),[G,H]=m(""),I=d(),S=h(null),T=h(null),B=h(null),F=s(S,J),Z=e=>k.find(t=>t.value===e)?.label??e,K=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)},z=e=>{e&&!o.includes(e)?(y([...o,e]),H("")):H("")},A=e=>y(o.filter(t=>t!==e)),O=()=>{const e=G.trim();if(Y&&e)return P(e.split(Y)),void H("");j&&e?z(e):H("")},Q=h(()=>{});Q.current=()=>{O(),$(!1)},f(()=>{if(!J)return;const e=e=>{const t=e.target;S.current?.contains(t)||B.current?.contains(t)||(O(),$(!1))};document.addEventListener("mousedown",e);const t=l(()=>Q.current());return()=>{document.removeEventListener("mousedown",e),t()}});const U=k.length>0;/* @__PURE__ */
2
+ return g("div",{ref:S,className:"relative",children:[
3
+ /* @__PURE__ */g("div",{onMouseDown:e=>{D||e.target.closest("button")||(e.preventDefault(),T.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)] ${D?"bg-gray-50 cursor-not-allowed":""} ${M}`}),children:[o.map(e=>{const t=E?.(e),n=w[t??"accent"],o=/* @__PURE__ */g("span",{"data-tone":t,className:n.chip,children:[
4
+ /* @__PURE__ */x("span",{className:"truncate",children:Z(e)}),!D&&/* @__PURE__ */x("button",{type:"button","aria-label":I.select.removeItem?.(Z(e))??`${I.select.remove} ${Z(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:L,ref:T,type:"text",autoComplete:"off",role:"combobox","aria-expanded":J&&U,"aria-invalid":C||void 0,disabled:D,value:G,placeholder:0===o.length?N:void 0,onChange:e=>{(e=>{if(Y){const t=e.split(Y);if(t.length>1)return P(t.slice(0,-1)),void H(t[t.length-1])}H(e)})(e.target.value),$(!0)},onFocus:()=>{!D&&U&&$(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=G.trim(),o=n?K.filter(t=>e(t,n.toLowerCase())):[];1===o.length?z(o[0].value):O()}else"Backspace"===t.key&&""===G&&o.length>0?A(o[o.length-1]):"Escape"===t.key?($(!1),H(""),T.current?.blur()):"Tab"===t.key&&(O(),$(!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"})]}),J&&U&&v(
6
+ /* @__PURE__ */x("div",{ref:B,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:F?.left,right:F?.right,top:F?.top,bottom:F?.bottom,minWidth:F?.minWidth,maxWidth:F?.maxWidth??a,width:"max-content",visibility:F?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:F?.maxHeight??c},children:0===K.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}):K.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,7 +1,7 @@
1
- import{squarify as e}from"./chunk-46BYGPGD.js";import{AccessibleTable as t}from"./chunk-HY6CBG4M.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{ChartTooltip as r}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as i,CHART_INK as o}from"./chunk-TZFACUMR.js";import{useShellStrings as n,useShellLocale as m}from"./chunk-L6XEON5Q.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as u}from"react";import{jsx as s,jsxs as f}from"react/jsx-runtime";function p({items:p,height:d=320,width:v,gap:x=2,radius:g=3,formatValue:y,color:k,className:b,emptyLabel:j}){const M=n().charts,w=m(),N=y??(e=>h(e,w)),$=j??M.nothingToBreakDown,C=c(null),B=a(C),F=v??B,[Y,z]=u(null),{highlighted:A}=l(),D=e(p,F,d);if(0===D.length)/* @__PURE__ */
2
- return s("div",{className:b,ref:C,children:/* @__PURE__ */s("p",{className:"py-8 text-center text-sm text-gray-500",children:$})});const E=k??i(0),G=Math.max(...D.map(e=>e.value),1),H=e=>34+e/G*62,L=e=>`color-mix(in oklab, ${E} ${H(e).toFixed(0)}%, ${o.surface})`,O=e=>H(e)>=55?o.surface:o.label,Q=Y??A,V=Y?D.find(e=>e.key===Y):void 0;/* @__PURE__ */
1
+ import{squarify as e}from"./chunk-46BYGPGD.js";import{AccessibleTable as t}from"./chunk-HY6CBG4M.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{ChartTooltip as r}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as i,CHART_INK as o}from"./chunk-TZFACUMR.js";import{useShellStrings as n,useShellLocale as m}from"./chunk-DEJIH3ZQ.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as u}from"react";import{jsx as s,jsxs as f}from"react/jsx-runtime";function p({items:p,height:d=320,width:v,gap:x=2,radius:g=3,formatValue:y,color:k,className:b,emptyLabel:j}){const M=n().charts,w=m(),N=y??(e=>h(e,w)),$=j??M.nothingToBreakDown,C=c(null),B=a(C),D=v??B,[F,H]=u(null),{highlighted:Y}=l(),z=e(p,D,d);if(0===z.length)/* @__PURE__ */
2
+ return s("div",{className:b,ref:C,children:/* @__PURE__ */s("p",{className:"py-8 text-center text-sm text-gray-500",children:$})});const A=k??i(0),E=Math.max(...z.map(e=>e.value),1),G=e=>34+e/E*62,I=e=>`color-mix(in oklab, ${A} ${G(e).toFixed(0)}%, ${o.surface})`,Q=e=>G(e)>=55?o.surface:o.label,V=F??Y,Z=F?z.find(e=>e.key===F):void 0;/* @__PURE__ */
3
3
  return f("div",{className:`relative ${b??""}`,ref:C,children:[
4
- /* @__PURE__ */s("svg",{width:"100%",height:d,viewBox:`0 0 ${F} ${d}`,role:"img","aria-label":M.treemap(p.length),onMouseLeave:()=>z(null),children:D.map(e=>{const t=Math.max(0,e.width-x),l=Math.max(0,e.height-x),a=t>6.2*e.label.length+12&&l>30,r=a&&l>44;/* @__PURE__ */
5
- return f("g",{opacity:Q&&Q!==e.key?.55:1,onMouseEnter:()=>z(e.key),children:[
6
- /* @__PURE__ */s("rect",{x:e.x+x/2,y:e.y+x/2,width:t,height:l,rx:g,fill:L(e.value)}),a&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+18,fontSize:12,fontWeight:600,fill:O(e.value),children:e.label}),r&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+34,fontSize:11,fill:O(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:N(e.value)})]},e.key)})}),V&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(r,{title:V.label,rows:[{key:"value",label:M.value,color:L(V.value),value:N(V.value)}]})}),
7
- /* @__PURE__ */s(t,{caption:M.treemap(p.length),head:[M.tableItem,M.value],rows:D.map(e=>[e.label,N(e.value)])})]})}export{p as TreemapChart};
4
+ /* @__PURE__ */s("svg",{width:"100%",height:d,viewBox:`0 0 ${D} ${d}`,role:"img","aria-label":M.treemap(p.length),onMouseLeave:()=>H(null),children:z.map(e=>{const t=Math.max(0,e.width-x),l=Math.max(0,e.height-x),a=t>6.2*e.label.length+12&&l>30,r=a&&l>44;/* @__PURE__ */
5
+ return f("g",{opacity:V&&V!==e.key?.55:1,onMouseEnter:()=>H(e.key),children:[
6
+ /* @__PURE__ */s("rect",{x:e.x+x/2,y:e.y+x/2,width:t,height:l,rx:g,fill:I(e.value)}),a&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+18,fontSize:12,fontWeight:600,fill:Q(e.value),children:e.label}),r&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+34,fontSize:11,fill:Q(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:N(e.value)})]},e.key)})}),Z&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(r,{title:Z.label,rows:[{key:"value",label:M.value,color:I(Z.value),value:N(Z.value)}]})}),
7
+ /* @__PURE__ */s(t,{caption:M.treemap(p.length),head:[M.tableItem,M.value],rows:z.map(e=>[e.label,N(e.value)])})]})}export{p as TreemapChart};
@@ -0,0 +1,6 @@
1
+ import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-ZDCCYRFF.js";import{Tooltip as i}from"./chunk-SOZCWT6I.js";import{useShellStrings as l}from"./chunk-DEJIH3ZQ.js";import{useId as a,useRef as s,useState as c,useEffect as u,Fragment as d}from"react";import{jsxs as h,jsx as f}from"react/jsx-runtime";var m=(e,t,r)=>Math.min(r,Math.max(t,e)),p=e=>e.reduce((e,t)=>e+t,0),v=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var g,b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:C,label:k,"aria-labelledby":N,readOnly:P=!1,disabled:M=!1,className:R=""}){const j=l().widths,z=a(),D=m(Math.round(x)||1,1,n),S=e($,D),A=S??[...t[D]??[]],B=[...A,100-p(A)],O=P||M,T=s(null),E=s({onChange:C,shown:A,locked:O,n:D,stored:S});E.current={onChange:C,shown:A,locked:O,n:D,stored:S};const I=t=>{const{onChange:r,shown:n,locked:o,n:i}=E.current;if(o)return!1;const l=e(t,i);return!(!l||v(l,n))&&(r(l),!0)},K=(e,t,n)=>{const o=e[t]+e[t+1],i=[...e];i[t]=m(Math.round(n),r,o-r),i[t+1]=o-i[t],I(i.slice(0,-1))&&(ne.current=null)},F=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const n=t.shiftKey?10:1,o=B[e]+B[e+1],i="ArrowRight"===t.key?B[e]+n:"ArrowLeft"===t.key?B[e]-n:"PageUp"===t.key?B[e]+10:"PageDown"===t.key?B[e]-10:"Home"===t.key?r:"End"===t.key?o-r:null;null!==i&&(t.preventDefault(),K(B,e,i))},H=s(null),[L,W]=c(null),Z=()=>{H.current=null,W(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};u(()=>Z,[]);const G=e=>t=>{if(0!==t.button||O)return;t.preventDefault();const r=T.current?.getBoundingClientRect().width??0;r<=0||(H.current={i:e,x:t.clientX,width:r,from:B,moved:!1,pointer:t.pointerId},W(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},J=e=>{const t=H.current;if(!t)return;if(0===e.buttons)return void Z();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}K(t.from,t.i,t.from[t.i]+r/t.width*100)},U=e=>{const t=H.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),Z())},X=(e,t)=>{const{shown:n}=E.current,o=function(e,t,n){const o=e.length,i=[...e];if(o<2)return i;const l=m(Math.round(n),r,100-(o-1)*r);let a=l-i[t];i[t]=l;const s=[...Array.from({length:o-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(a<0)return i[s[0]]-=a,i;for(const e of s){if(a<=0)break;const t=Math.min(a,i[e]-r);i[e]-=t,a-=t}return i}([...n,100-p(n)],e,t);return I(o.slice(0,-1))?o:null},[q,Q]=c(0);u(()=>{const e=T.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Q(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const V=s(null),[Y,_]=c(null),[ee,te]=c([]),re=(e,t)=>_(r=>t?e:r===e?null:r),ne=s(null),oe=(e,t)=>{const r=ne.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:o,stored:i}=E.current;var l,a;return o||(l=i,a=r.stored,void 0===l||void 0===a?l===a:v(l,a))||n(r.stored),!0},ie=B.join(",");u(()=>{const e=null===Y?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===g&&(g=document.createElement("canvas").getContext("2d")),!g)return[];const o=g;return r.flatMap((e,r)=>{if(r===t)return[];const i=e.getBoundingClientRect(),l=getComputedStyle(e);o.font=`${l.fontWeight} ${l.fontSize} ${l.fontFamily}`;const a=o.measureText(e.value).width/2,s=(i.left+i.right)/2;return s+a>n.left&&s-a<n.right?[r]:[]})}(V.current,Y);te(t=>v(t,e)?t:e)},[Y,ie,q]);const le=j.hint(D,r),ae=B.slice(0,-1).map((e,t)=>p(B.slice(0,t+1)));/* @__PURE__ */
2
+ return h("div",{role:"group","aria-label":N?void 0:k,"aria-labelledby":N,"aria-describedby":D>1?z:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${M?"opacity-60":""} ${R}`.trim(),children:[
3
+ /* @__PURE__ */h("div",{ref:V,"data-widths-bar":"",className:"relative h-8",children:[
4
+ /* @__PURE__ */f("div",{ref:T,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:B.map((e,t)=>/* @__PURE__ */f("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[t%2]} ${t%2==0?"bg-accent-tint":""}`,children:1===D&&/* @__PURE__ */f("span",{"data-widths-label":"",children:`${e}%`})},t))}),
5
+ /* @__PURE__ */f("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),D>1&&B.map((e,t)=>/* @__PURE__ */h(d,{children:[(()=>{const n=Y===t,l=p(B.slice(0,t)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
6
+ return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>q>0&&q*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:r,max:100-(D-1)*r,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:M,"aria-label":j.column(t+1),"aria-describedby":z,"data-widths-label":"",onChange:e=>{null===e||oe(t,e)||X(t,e)},onRevert:e=>((e,t)=>{E.current.locked||null===t||oe(e,t)||X(e,t)})(t,e),onFocus:()=>{ne.current={column:t,share:e,stored:E.current.stored},re(t,!0)},onBlur:()=>re(t,!1),className:`absolute inset-0 text-xs font-medium ${w[t%2]} ${ee.includes(t)&&!n?"opacity-0":""}`})})})})(),t<D-1&&/* @__PURE__ */f("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[t]}%`},children:/* @__PURE__ */f(i,{content:j.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */f("div",{role:"separator",tabIndex:M?-1:0,"aria-orientation":"vertical","aria-label":j.divider(t+1,t+2),"aria-valuenow":B[t],"aria-valuemin":r,"aria-valuemax":B[t]+B[t+1]-r,"aria-valuetext":j.dividerValue(t+1,B[t],t+2,B[t+1]),"aria-disabled":O||void 0,onKeyDown:O?void 0:F(t),onPointerDown:G(t),onPointerMove:J,onPointerUp:U,onPointerCancel:U,onLostPointerCapture:()=>{H.current&&Z()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(O?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */f("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(O?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${L===t?"w-1":y}`)})})})})]},t))]}),D>1&&/* @__PURE__ */f("span",{id:z,className:"sr-only",children:le})]})}export{x as WidthsBar};
@@ -1,9 +1,9 @@
1
- import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-QUN3RSMN.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{useBrowserState as a}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-L6XEON5Q.js";import{useId as o,useRef as c,useEffect as s,Children as u,isValidElement as d}from"react";import{jsx as m,jsxs as h,Fragment as p}from"react/jsx-runtime";function f({children:e,count:t,countLabel:n}){return null==t?/* @__PURE__ */m("p",{className:"px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e}):/* @__PURE__ */h("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:[
1
+ import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-PR6FNBKR.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{useBrowserState as a}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-DEJIH3ZQ.js";import{useId as o,useRef as c,useEffect as s,Children as u,isValidElement as d}from"react";import{jsx as m,jsxs as h,Fragment as p}from"react/jsx-runtime";function f({children:e,count:t,countLabel:n}){return null==t?/* @__PURE__ */m("p",{className:"px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e}):/* @__PURE__ */h("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:[
2
2
  /* @__PURE__ */m("span",{className:"min-w-0 truncate",children:e}),
3
- /* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),N=i().severity,v=y?n(y,N):void 0,j=e(),S=o(),I=c(null),C=c(l);C.current=l,s(()=>{if(j&&d)return j.report(S,()=>C.current,I.current)},[j,d,S]);const L=/* @__PURE__ */h(p,{children:[null!=x&&/* @__PURE__ */m("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:x}),y&&
4
- /* @__PURE__ */m("span",{"aria-hidden":"true",title:v,className:`shrink-0 h-1.5 w-1.5 rounded-full ${y.fill}`}),
5
- /* @__PURE__ */m("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof l?l:void 0,children:l}),y&&/* @__PURE__ */m("span",{className:"sr-only",children:v}),null!=a&&/* @__PURE__ */m(r,{count:a,label:u,active:d}),null!=g&&/* @__PURE__ */m("span",{className:"shrink-0",children:g})]});/* @__PURE__ */
6
- return m("button",1===k?{ref:I,type:"button",onClick:f,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */m("span",{className:b(d),children:L})}:{ref:I,type:"button",onClick:f,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(d?"bg-accent-tint font-medium text-blue-700":"text-ink hover:bg-gray-100"),children:L})}function g({label:e,count:t,countLabel:n,children:i,defaultExpanded:c=!0,storageKey:s}){const p=o(),[f,b]=a(()=>{if(s){let e=null;try{e=window.localStorage.getItem(s)}catch{}if("1"===e||"0"===e)return"1"===e}return c},c),x=!f&&u.toArray(i).some(e=>d(e)&&!0===e.props.active);/* @__PURE__ */
3
+ /* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),v=i().severity,N=y?n(y,v):void 0,j=e(),S=o(),I=c(null),C=c(l);C.current=l,s(()=>{if(j&&d)return j.report(S,()=>C.current,I.current)},[j,d,S]);const D=/* @__PURE__ */h(p,{children:[null!=x&&/* @__PURE__ */m("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:x}),y&&
4
+ /* @__PURE__ */m("span",{"aria-hidden":"true",title:N,className:`shrink-0 h-1.5 w-1.5 rounded-full ${y.fill}`}),
5
+ /* @__PURE__ */m("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof l?l:void 0,children:l}),y&&/* @__PURE__ */m("span",{className:"sr-only",children:N}),null!=a&&/* @__PURE__ */m(r,{count:a,label:u,active:d}),null!=g&&/* @__PURE__ */m("span",{className:"shrink-0",children:g})]});/* @__PURE__ */
6
+ return m("button",1===k?{ref:I,type:"button",onClick:f,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */m("span",{className:b(d),children:D})}:{ref:I,type:"button",onClick:f,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(d?"bg-accent-tint font-medium text-blue-700":"text-ink hover:bg-gray-100"),children:D})}function g({label:e,count:t,countLabel:n,children:i,defaultExpanded:c=!0,storageKey:s}){const p=o(),[f,b]=a(()=>{if(s){let e=null;try{e=window.localStorage.getItem(s)}catch{}if("1"===e||"0"===e)return"1"===e}return c},c),x=!f&&u.toArray(i).some(e=>d(e)&&!0===e.props.active);/* @__PURE__ */
7
7
  return h("div",{children:[
8
8
  /* @__PURE__ */h("button",{type:"button",onClick:()=>{const e=!f;if(b(e),s)try{window.localStorage.setItem(s,e?"1":"0")}catch{}},"aria-expanded":f,"aria-controls":p,className:"flex w-full items-center gap-2 rounded-lg h-8 px-3 text-sm font-medium text-left "+(x?"bg-accent-tint text-blue-700":"text-ink-strong hover:bg-gray-100"),children:[
9
9
  /* @__PURE__ */m("span",{className:"min-w-0 truncate",title:e,children:e}),
@@ -1,4 +1,4 @@
1
- import{AccessibleTable as e}from"./chunk-HY6CBG4M.js";import{arcPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as l}from"./chunk-WDQI3FV6.js";import{CHART_INK as a,resolveSeriesColor as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as o}from"./chunk-L6XEON5Q.js";import{formatPlain as h,formatPercent as c}from"./chunk-C3QOHMR6.js";import{useState as u}from"react";import{jsx as s,jsxs as d}from"react/jsx-runtime";function m(e,t,r,l,a,n,i,o){if(l>=8)return;const h=e.reduce((e,t)=>e+p(t,8-l),0);if(h<=0)return;let c=t;e.forEach((e,t)=>{const u=p(e,8-l),s=u/h*r,d=`${i}/${e.key}`,f=0===l?t:a,b=0===l?e.key:n;o.push({id:d,label:e.label,value:u,depth:l,start:c,end:c+s,branch:f,branchKey:b}),e.children?.length&&m(e.children,c,s,l+1,f,b,d,o),c+=s})}function p(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+p(r,t-1),0):Math.max(0,e.value??0)}function f({nodes:p,size:f=320,innerRadius:b=44,ringGap:v=2,formatValue:k,centerLabel:x,className:g,emptyLabel:y}){const M=i().charts,$=o(),j=k??(e=>h(e,$)),N=y??M.nothingToBreakDown,[w,C]=u(null),{highlighted:E}=r(),L=[];if(m(p,-Math.PI/2,2*Math.PI,0,0,"","",L),0===L.length)/* @__PURE__ */return s("p",{className:`text-sm text-gray-500 ${g??""}`,children:N});const F=Math.max(...L.map(e=>e.depth))+1,I=f/2,Q=f/2,z=(f/2-8-b)/F,A=L.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),B=e=>`color-mix(in oklab, ${n(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${a.surface})`,H=e=>null!==w?e.id===w:null===E||e.branchKey===E,O=w?L.find(e=>e.id===w):void 0,R=e=>c(e.value/A*100,1,$);/* @__PURE__ */
1
+ import{AccessibleTable as e}from"./chunk-HY6CBG4M.js";import{arcPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as l}from"./chunk-WDQI3FV6.js";import{CHART_INK as a,resolveSeriesColor as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as o}from"./chunk-DEJIH3ZQ.js";import{formatPlain as h,formatPercent as c}from"./chunk-C3QOHMR6.js";import{useState as u}from"react";import{jsx as s,jsxs as d}from"react/jsx-runtime";function m(e,t,r,l,a,n,i,o){if(l>=8)return;const h=e.reduce((e,t)=>e+p(t,8-l),0);if(h<=0)return;let c=t;e.forEach((e,t)=>{const u=p(e,8-l),s=u/h*r,d=`${i}/${e.key}`,f=0===l?t:a,b=0===l?e.key:n;o.push({id:d,label:e.label,value:u,depth:l,start:c,end:c+s,branch:f,branchKey:b}),e.children?.length&&m(e.children,c,s,l+1,f,b,d,o),c+=s})}function p(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+p(r,t-1),0):Math.max(0,e.value??0)}function f({nodes:p,size:f=320,innerRadius:b=44,ringGap:v=2,formatValue:k,centerLabel:x,className:g,emptyLabel:y}){const M=i().charts,$=o(),j=k??(e=>h(e,$)),N=y??M.nothingToBreakDown,[w,C]=u(null),{highlighted:E}=r(),I=[];if(m(p,-Math.PI/2,2*Math.PI,0,0,"","",I),0===I.length)/* @__PURE__ */return s("p",{className:`text-sm text-gray-500 ${g??""}`,children:N});const F=Math.max(...I.map(e=>e.depth))+1,H=f/2,L=f/2,Q=(f/2-8-b)/F,z=I.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),A=e=>`color-mix(in oklab, ${n(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${a.surface})`,B=e=>null!==w?e.id===w:null===E||e.branchKey===E,D=w?I.find(e=>e.id===w):void 0,R=e=>c(e.value/z*100,1,$);/* @__PURE__ */
2
2
  return d("div",{className:`relative ${g??""}`,children:[
3
- /* @__PURE__ */d("svg",{width:"100%",height:f,viewBox:`0 0 ${f} ${f}`,role:"img","aria-label":M.sunburst(j(A),F),onMouseLeave:()=>C(null),children:[L.map(e=>/* @__PURE__ */s("path",{d:t(I,Q,b+e.depth*z+v/2,b+(e.depth+1)*z-v/2,e.start,e.end),fill:B(e),fillOpacity:H(e)?1:.45,stroke:a.surface,strokeWidth:1,onMouseEnter:()=>C(e.id)},e.id)),x&&/* @__PURE__ */s("text",{x:I,y:Q+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:a.label,children:x})]}),O&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(l,{title:O.label,rows:[{key:"value",label:M.value,color:B(O),value:j(O.value)},{key:"share",label:M.share,color:a.muted,value:R(O)}]})}),
4
- /* @__PURE__ */s(e,{caption:M.sunburst(j(A),F),head:[M.tableLevel,M.tableItem,M.value,M.share],rows:L.map(e=>[e.depth+1,e.label,j(e.value),R(e)])})]})}export{f as SunburstChart};
3
+ /* @__PURE__ */d("svg",{width:"100%",height:f,viewBox:`0 0 ${f} ${f}`,role:"img","aria-label":M.sunburst(j(z),F),onMouseLeave:()=>C(null),children:[I.map(e=>/* @__PURE__ */s("path",{d:t(H,L,b+e.depth*Q+v/2,b+(e.depth+1)*Q-v/2,e.start,e.end),fill:A(e),fillOpacity:B(e)?1:.45,stroke:a.surface,strokeWidth:1,onMouseEnter:()=>C(e.id)},e.id)),x&&/* @__PURE__ */s("text",{x:H,y:L+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:a.label,children:x})]}),D&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(l,{title:D.label,rows:[{key:"value",label:M.value,color:A(D),value:j(D.value)},{key:"share",label:M.share,color:a.muted,value:R(D)}]})}),
4
+ /* @__PURE__ */s(e,{caption:M.sunburst(j(z),F),head:[M.tableLevel,M.tableItem,M.value,M.share],rows:I.map(e=>[e.depth+1,e.label,j(e.value),R(e)])})]})}export{f as SunburstChart};
@@ -1,4 +1,4 @@
1
- import{ChartSkeleton as e}from"./chunk-RSRTE7RG.js";import{ChartHighlightProvider as r,useHighlight as a}from"./chunk-CNYAHYE6.js";import{CHART_INK as t,resolveSeriesColor as s}from"./chunk-TZFACUMR.js";import{useShellStrings as l}from"./chunk-L6XEON5Q.js";import{jsx as n,jsxs as o,Fragment as c}from"react/jsx-runtime";function i({shape:e,colour:r}){const a="shrink-0";switch(e){case"circle":/* @__PURE__ */
1
+ import{ChartSkeleton as e}from"./chunk-NLHGFQ54.js";import{ChartHighlightProvider as r,useHighlight as a}from"./chunk-CNYAHYE6.js";import{CHART_INK as t,resolveSeriesColor as s}from"./chunk-TZFACUMR.js";import{useShellStrings as l}from"./chunk-DEJIH3ZQ.js";import{jsx as n,jsxs as o,Fragment as c}from"react/jsx-runtime";function i({shape:e,colour:r}){const a="shrink-0";switch(e){case"circle":/* @__PURE__ */
2
2
  return n("span",{className:`${a} h-2.5 w-2.5 rounded-full`,style:{backgroundColor:r}});case"circle-outline":/* @__PURE__ */
3
3
  return n("span",{className:`${a} h-2.5 w-2.5 rounded-full border-2`,style:{borderColor:r}});case"rounded-square-outline":/* @__PURE__ */
4
4
  return n("span",{className:`${a} h-2.5 w-2.5 rounded-sm border-2`,style:{borderColor:r}});case"square":/* @__PURE__ */
@@ -1,14 +1,14 @@
1
- import{fromDateKey as e,toMonthKey as t,toDateKey as r,fromMonthKey as a}from"./chunk-2HMNOLKX.js";import{calendarNames as n,firstDayOfWeek as o}from"./chunk-Y3JW2GW5.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{useBrowserValue as i}from"./chunk-D65T4H6J.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-L6XEON5Q.js";import{useMemo as g,useState as u,useRef as d,useEffect as h}from"react";import{jsxs as m,jsx as f,Fragment as b}from"react/jsx-runtime";var y="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";var v=()=>r(/* @__PURE__ */new Date);var p=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),x=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),a=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),a))};function w({value:w,endValue:D,mode:M="single",onSelect:N,min:Y,max:k,month:F,defaultMonth:j,onMonthChange:A,weekStartsOn:C,quickJump:S=!0,markedDates:O,readOnly:P=!1,"aria-label":q,className:K=""}){const W=g(()=>new Set(O??[]),[O]),E=e(w),H=i(v,null),J=e(H),L=s().calendar,$=c(),I=n($),R=i(()=>o($),0),U=C??R,V=()=>{if(!J)return null;const e=t(J);return Y&&e<Y.slice(0,7)?Y.slice(0,7):k&&e>k.slice(0,7)?k.slice(0,7):e},[X,B]=u(()=>j||(E?t(E):V())),G=F??X??V(),Q=null===G?null:function(e,t){return a(e)??t}(G,J),[T,z]=u(()=>w??H),Z=d(null),_=d(!1),[ee,te]=u("days"),re=g(()=>Q?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),a=(r.getDay()-t+7)%7,n=new Date(r.getFullYear(),r.getMonth(),1-a);return Array.from({length:42},(e,t)=>new Date(n.getFullYear(),n.getMonth(),n.getDate()+t))}(Q,U):[],[G,U]),ae=e=>!!Y&&e<Y||!!k&&e>k,ne=T??H,oe=re.some(e=>r(e)===ne),le=Q?re.find(e=>e.getMonth()===Q.getMonth())??re[0]:null,ie=oe&&ne?ne:le?r(le):"";if(h(()=>{_.current&&(_.current=!1,Z.current?.querySelector('[data-active="true"]')?.focus())},[ie,G]),!Q)/* @__PURE__ */
2
- return m("div",{className:K,"aria-hidden":"true","data-calendar-pending":"",children:[
1
+ import{fromDateKey as e,toMonthKey as t,toDateKey as r,fromMonthKey as a}from"./chunk-2HMNOLKX.js";import{calendarNames as n,firstDayOfWeek as o}from"./chunk-Y3JW2GW5.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{useBrowserValue as i}from"./chunk-D65T4H6J.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-DEJIH3ZQ.js";import{useMemo as g,useState as u,useRef as d,useEffect as h}from"react";import{jsxs as m,jsx as f,Fragment as b}from"react/jsx-runtime";var y="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";var v=()=>r(/* @__PURE__ */new Date);var p=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),x=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),a=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),a))};function w({value:w,endValue:D,mode:M="single",onSelect:N,min:Y,max:k,month:F,defaultMonth:j,onMonthChange:A,weekStartsOn:C,quickJump:S=!0,markedDates:P,readOnly:q=!1,"aria-label":H,className:J=""}){const K=g(()=>new Set(P??[]),[P]),O=e(w),W=i(v,null),E=e(W),I=s().calendar,$=c(),L=n($),R=i(()=>o($),0),U=C??R,V=()=>{if(!E)return null;const e=t(E);return Y&&e<Y.slice(0,7)?Y.slice(0,7):k&&e>k.slice(0,7)?k.slice(0,7):e},[B,G]=u(()=>j||(O?t(O):V())),Q=F??B??V(),T=null===Q?null:function(e,t){return a(e)??t}(Q,E),[X,Z]=u(()=>w??W),z=d(null),_=d(!1),[ee,te]=u("days"),re=g(()=>T?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),a=(r.getDay()-t+7)%7,n=new Date(r.getFullYear(),r.getMonth(),1-a);return Array.from({length:42},(e,t)=>new Date(n.getFullYear(),n.getMonth(),n.getDate()+t))}(T,U):[],[Q,U]),ae=e=>!!Y&&e<Y||!!k&&e>k,ne=X??W,oe=re.some(e=>r(e)===ne),le=T?re.find(e=>e.getMonth()===T.getMonth())??re[0]:null,ie=oe&&ne?ne:le?r(le):"";if(h(()=>{_.current&&(_.current=!1,z.current?.querySelector('[data-active="true"]')?.focus())},[ie,Q]),!T)/* @__PURE__ */
2
+ return m("div",{className:J,"aria-hidden":"true","data-calendar-pending":"",children:[
3
3
  /* @__PURE__ */f("div",{className:"mb-2 h-6"}),
4
- /* @__PURE__ */f("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */f("div",0===t?{className:"py-1 text-xs",children:" "}:{className:y,children:/* @__PURE__ */f("span",{className:"aspect-square"})},t))})]});const se=e=>"years"===ee?new Date(Q.getFullYear()+12*e,Q.getMonth(),1):"months"===ee?new Date(Q.getFullYear()+e,Q.getMonth(),1):x(Q,e),ce=e=>{const r=t(e);void 0===F&&B(r),A?.(r)},ge=q??I.monthYear(Q.getFullYear(),Q.getMonth());/* @__PURE__ */
5
- return m("div",{className:K,children:[
4
+ /* @__PURE__ */f("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */f("div",0===t?{className:"py-1 text-xs",children:" "}:{className:y,children:/* @__PURE__ */f("span",{className:"aspect-square"})},t))})]});const se=e=>"years"===ee?new Date(T.getFullYear()+12*e,T.getMonth(),1):"months"===ee?new Date(T.getFullYear()+e,T.getMonth(),1):x(T,e),ce=e=>{const r=t(e);void 0===F&&G(r),A?.(r)},ge=H??L.monthYear(T.getFullYear(),T.getMonth());/* @__PURE__ */
5
+ return m("div",{className:J,children:[
6
6
  /* @__PURE__ */m("div",{className:"mb-2 flex items-center justify-between px-1",children:[
7
- /* @__PURE__ */f("button",{type:"button","aria-label":"years"===ee?L.previousYears:"months"===ee?L.previousYear:L.previousMonth,onClick:()=>ce(se(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */f(l,{name:"chevron-left",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
8
- /* @__PURE__ */f("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:S?/* @__PURE__ */m(b,{children:["years"!==ee&&/* @__PURE__ */f("button",{type:"button","aria-label":L.chooseMonth(I.months[Q.getMonth()]),onClick:()=>te(e=>"months"===e?"days":"months"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:I.months[Q.getMonth()]}),
9
- /* @__PURE__ */f("button",{type:"button","aria-label":L.chooseYear(Q.getFullYear()),onClick:()=>te(e=>"years"===e?"days":"years"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:Q.getFullYear()})]}):/* @__PURE__ */f("span",{children:I.monthYear(Q.getFullYear(),Q.getMonth())})}),
10
- /* @__PURE__ */f("button",{type:"button","aria-label":"years"===ee?L.nextYears:"months"===ee?L.nextYear:L.nextMonth,onClick:()=>ce(se(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */f(l,{name:"chevron-right",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===ee&&/* @__PURE__ */f("div",{role:"group","aria-label":L.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:I.monthsShort.map((e,t)=>/* @__PURE__ */f("button",{type:"button","aria-pressed":t===Q.getMonth(),onClick:()=>{ce(new Date(Q.getFullYear(),t,1)),te("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===Q.getMonth()?"bg-blue-600 font-semibold text-white":J&&t===J.getMonth()&&Q.getFullYear()===J.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===ee&&/* @__PURE__ */f("div",{role:"group","aria-label":L.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=Q.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */f("button",{type:"button","aria-pressed":e===Q.getFullYear(),onClick:()=>{ce(new Date(e,Q.getMonth(),1)),te("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===Q.getFullYear()?"bg-blue-600 font-semibold text-white":e===J?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
11
- /* @__PURE__ */m("div",{ref:Z,role:"grid","aria-label":ge,className:"space-y-1","aria-readonly":P||void 0,onKeyDown:a=>{const n=e(ie)??J??Q,o={ArrowLeft:()=>p(n,-1),ArrowRight:()=>p(n,1),ArrowUp:()=>p(n,-7),ArrowDown:()=>p(n,7),Home:()=>p(n,-(n.getDay()-U+7)%7),End:()=>p(n,6-(n.getDay()-U+7)%7),PageUp:()=>x(n,a.shiftKey?-12:-1),PageDown:()=>x(n,a.shiftKey?12:1)};if(o[a.key])return a.preventDefault(),l=o[a.key](),_.current=!0,z(r(l)),void(t(l)!==G&&ce(l));var l;"Enter"!==a.key&&" "!==a.key||(a.preventDefault(),P||ae(ie)||N(ie))},hidden:"days"!==ee,children:[
7
+ /* @__PURE__ */f("button",{type:"button","aria-label":"years"===ee?I.previousYears:"months"===ee?I.previousYear:I.previousMonth,onClick:()=>ce(se(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */f(l,{name:"chevron-left",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
8
+ /* @__PURE__ */f("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:S?/* @__PURE__ */m(b,{children:["years"!==ee&&/* @__PURE__ */f("button",{type:"button","aria-label":I.chooseMonth(L.months[T.getMonth()]),onClick:()=>te(e=>"months"===e?"days":"months"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:L.months[T.getMonth()]}),
9
+ /* @__PURE__ */f("button",{type:"button","aria-label":I.chooseYear(T.getFullYear()),onClick:()=>te(e=>"years"===e?"days":"years"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:T.getFullYear()})]}):/* @__PURE__ */f("span",{children:L.monthYear(T.getFullYear(),T.getMonth())})}),
10
+ /* @__PURE__ */f("button",{type:"button","aria-label":"years"===ee?I.nextYears:"months"===ee?I.nextYear:I.nextMonth,onClick:()=>ce(se(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */f(l,{name:"chevron-right",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===ee&&/* @__PURE__ */f("div",{role:"group","aria-label":I.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:L.monthsShort.map((e,t)=>/* @__PURE__ */f("button",{type:"button","aria-pressed":t===T.getMonth(),onClick:()=>{ce(new Date(T.getFullYear(),t,1)),te("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===T.getMonth()?"bg-blue-600 font-semibold text-white":E&&t===E.getMonth()&&T.getFullYear()===E.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===ee&&/* @__PURE__ */f("div",{role:"group","aria-label":I.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=T.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */f("button",{type:"button","aria-pressed":e===T.getFullYear(),onClick:()=>{ce(new Date(e,T.getMonth(),1)),te("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===T.getFullYear()?"bg-blue-600 font-semibold text-white":e===E?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
11
+ /* @__PURE__ */m("div",{ref:z,role:"grid","aria-label":ge,className:"space-y-1","aria-readonly":q||void 0,onKeyDown:a=>{const n=e(ie)??E??T,o={ArrowLeft:()=>p(n,-1),ArrowRight:()=>p(n,1),ArrowUp:()=>p(n,-7),ArrowDown:()=>p(n,7),Home:()=>p(n,-(n.getDay()-U+7)%7),End:()=>p(n,6-(n.getDay()-U+7)%7),PageUp:()=>x(n,a.shiftKey?-12:-1),PageDown:()=>x(n,a.shiftKey?12:1)};if(o[a.key])return a.preventDefault(),l=o[a.key](),_.current=!0,Z(r(l)),void(t(l)!==Q&&ce(l));var l;"Enter"!==a.key&&" "!==a.key||(a.preventDefault(),q||ae(ie)||N(ie))},hidden:"days"!==ee,children:[
12
12
  /* @__PURE__ */f("div",{role:"row",className:`${y} text-center text-xs font-medium text-ink-faint`,children:Array.from({length:7},(e,t)=>(t+U)%7).map(e=>
13
- /* @__PURE__ */f("div",{role:"columnheader","aria-label":I.weekdays[e],className:"py-1",children:/* @__PURE__ */f("abbr",{title:I.weekdays[e],className:"no-underline",children:I.weekdaysShort[e]})},e))}),Array.from({length:6},(e,t)=>/* @__PURE__ */f("div",{role:"row",className:`${y} text-center text-sm`,children:re.slice(7*t,7*t+7).map(e=>{const t=r(e),a=e.getMonth()!==Q.getMonth(),n=t===w||"range"===M&&t===D,o=(e=>!("range"!==M||!w||!D)&&e>w&&e<D)(t),l=ae(t),i=I.longDate(e.getFullYear(),e.getMonth(),e.getDate()),s=e=>["relative w-full aspect-square rounded-md transition-colors",e?"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",l?"cursor-not-allowed text-gray-300":n?"bg-accent-fill font-semibold text-on-accent":o?"bg-accent-tint-strong text-blue-800":a?"text-ink-faint"+(e?" hover:bg-gray-100":""):"text-ink"+(e?" hover:bg-gray-100":""),t!==H||n?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),c=W.has(t)&&/* @__PURE__ */f("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(n?"bg-surface":a?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
14
- return f("div",{role:"gridcell","aria-selected":n,"aria-label":P?i:void 0,children:P?/* @__PURE__ */m("span",{"aria-hidden":"true",className:`grid place-items-center ${s(!1)}`,children:[e.getDate(),c]}):/* @__PURE__ */m("button",{type:"button","data-active":t===ie,tabIndex:t===ie?0:-1,disabled:l,"aria-label":i,"aria-current":t===H?"date":void 0,onClick:()=>{z(t),N(t)},className:s(!0),children:[e.getDate(),c]})},t)})},t))]})]})}export{w as Calendar};
13
+ /* @__PURE__ */f("div",{role:"columnheader","aria-label":L.weekdays[e],className:"py-1",children:/* @__PURE__ */f("abbr",{title:L.weekdays[e],className:"no-underline",children:L.weekdaysShort[e]})},e))}),Array.from({length:6},(e,t)=>/* @__PURE__ */f("div",{role:"row",className:`${y} text-center text-sm`,children:re.slice(7*t,7*t+7).map(e=>{const t=r(e),a=e.getMonth()!==T.getMonth(),n=t===w||"range"===M&&t===D,o=(e=>!("range"!==M||!w||!D)&&e>w&&e<D)(t),l=ae(t),i=L.longDate(e.getFullYear(),e.getMonth(),e.getDate()),s=e=>["relative w-full aspect-square rounded-md transition-colors",e?"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",l?"cursor-not-allowed text-gray-300":n?"bg-accent-fill font-semibold text-on-accent":o?"bg-accent-tint-strong text-blue-800":a?"text-ink-faint"+(e?" hover:bg-gray-100":""):"text-ink"+(e?" hover:bg-gray-100":""),t!==W||n?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),c=K.has(t)&&/* @__PURE__ */f("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(n?"bg-surface":a?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
14
+ return f("div",{role:"gridcell","aria-selected":n,"aria-label":q?i:void 0,children:q?/* @__PURE__ */m("span",{"aria-hidden":"true",className:`grid place-items-center ${s(!1)}`,children:[e.getDate(),c]}):/* @__PURE__ */m("button",{type:"button","data-active":t===ie,tabIndex:t===ie?0:-1,disabled:l,"aria-label":i,"aria-current":t===W?"date":void 0,onClick:()=>{Z(t),N(t)},className:s(!0),children:[e.getDate(),c]})},t)})},t))]})]})}export{w as Calendar};
@@ -1,14 +1,14 @@
1
- import{useHighlight as e}from"./chunk-CNYAHYE6.js";import{usePlotWidth as t}from"./chunk-MAFUXCPZ.js";import{ChartTooltip as l}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as a,CHART_INK as n,STATUS_VARS as r}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as i}from"./chunk-L6XEON5Q.js";import{formatPercent as u,formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as c,useState as m,useRef as s}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";function x({stages:x,shape:v="funnel",height:p,width:$,gap:g=4,minBandWidth:M=0,formatValue:y,color:b,className:k,emptyLabel:N}){const A=o().charts,L=i(),S=y??(e=>h(e,L)),j=N??A.noStages,z=c(),[V,F]=m(null),{highlighted:W}=e(),w=s(null),C=t(w,560),E=$??C;if(0===x.length)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${k??""}`,children:j});const Z=b??a(0),H=p??54*x.length,Q=Math.max(...x.map(e=>e.value),1),B="bars"===v,O=B?Math.round(Math.min(132,Math.max(80,.24*E))):Math.round(Math.min(168,Math.max(104,.38*E))),R=e=>{const t=x[e-1]?.value;return null!=t&&t>0?100*(1-x[e].value/t):null},U=e=>{const t=R(e);return{count:S(x[e].value),drop:null!=t?`−${u(t,1,L)}`:""}},X=B?Math.ceil(Math.max(...x.map((e,t)=>{const{count:l,drop:a}=U(t);return.62*(l.length+(a?a.length+1:0))*12}))+16):0,Y=E-O-X,D=Math.max(B?2:0,Math.min(M,Y)),I=e=>Math.max(D,Y*Math.max(0,e/Q)),P=e=>I(e)/2,T=O+Y/2,q=e=>46+e/Math.max(1,x.length-1)*54,G=e=>`color-mix(in oklab, ${Z} ${q(e).toFixed(0)}%, ${n.surface})`,J=e=>q(e)>=55?n.surface:n.label,K=(e,t)=>null!==V?V!==e:null!==W&&W!==t,_=null!==V?x[V]:void 0;/* @__PURE__ */
2
- return f("div",{className:`relative ${k??""}`,ref:w,children:[
3
- /* @__PURE__ */f("svg",{width:"100%",height:H,viewBox:`0 0 ${E} ${H}`,role:"img","aria-labelledby":z,onMouseLeave:()=>F(null),children:[
4
- /* @__PURE__ */d("title",{id:z,children:A.funnel(x.length,S(x[0].value),S(x[x.length-1].value))}),x.map((e,t)=>{const l=t*H/x.length+g/2,a=(t+1)*H/x.length-g/2,r=(l+a)/2,o=u(e.value/(x[0].value||1)*100,0,L),i=.62*o.length*12+12;if(B){const u=O,h=u+I(e.value),{count:c,drop:m}=U(t);/* @__PURE__ */
1
+ import{useHighlight as e}from"./chunk-CNYAHYE6.js";import{usePlotWidth as t}from"./chunk-MAFUXCPZ.js";import{ChartTooltip as l}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as a,CHART_INK as n,STATUS_VARS as r}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as i}from"./chunk-DEJIH3ZQ.js";import{formatPercent as u,formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as c,useState as m,useRef as s}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";function x({stages:x,shape:v="funnel",height:p,width:$,gap:g=4,minBandWidth:M=0,formatValue:y,color:b,className:k,emptyLabel:A}){const N=o().charts,L=i(),S=y??(e=>h(e,L)),j=A??N.noStages,z=c(),[V,F]=m(null),{highlighted:W}=e(),Z=s(null),w=t(Z,560),C=$??w;if(0===x.length)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${k??""}`,children:j});const E=b??a(0),H=p??54*x.length,Q=Math.max(...x.map(e=>e.value),1),B="bars"===v,D=B?Math.round(Math.min(132,Math.max(80,.24*C))):Math.round(Math.min(168,Math.max(104,.38*C))),I=e=>{const t=x[e-1]?.value;return null!=t&&t>0?100*(1-x[e].value/t):null},R=e=>{const t=I(e);return{count:S(x[e].value),drop:null!=t?`−${u(t,1,L)}`:""}},U=B?Math.ceil(Math.max(...x.map((e,t)=>{const{count:l,drop:a}=R(t);return.62*(l.length+(a?a.length+1:0))*12}))+16):0,Y=C-D-U,J=Math.max(B?2:0,Math.min(M,Y)),O=e=>Math.max(J,Y*Math.max(0,e/Q)),P=e=>O(e)/2,T=D+Y/2,X=e=>46+e/Math.max(1,x.length-1)*54,q=e=>`color-mix(in oklab, ${E} ${X(e).toFixed(0)}%, ${n.surface})`,G=e=>X(e)>=55?n.surface:n.label,K=(e,t)=>null!==V?V!==e:null!==W&&W!==t,_=null!==V?x[V]:void 0;/* @__PURE__ */
2
+ return f("div",{className:`relative ${k??""}`,ref:Z,children:[
3
+ /* @__PURE__ */f("svg",{width:"100%",height:H,viewBox:`0 0 ${C} ${H}`,role:"img","aria-labelledby":z,onMouseLeave:()=>F(null),children:[
4
+ /* @__PURE__ */d("title",{id:z,children:N.funnel(x.length,S(x[0].value),S(x[x.length-1].value))}),x.map((e,t)=>{const l=t*H/x.length+g/2,a=(t+1)*H/x.length-g/2,r=(l+a)/2,o=u(e.value/(x[0].value||1)*100,0,L),i=.62*o.length*12+12;if(B){const u=D,h=u+O(e.value),{count:c,drop:m}=R(t);/* @__PURE__ */
5
5
  return f("g",{opacity:K(t,e.key)?.45:1,onMouseEnter:()=>F(t),children:[
6
- /* @__PURE__ */d("path",{d:`M${u},${l} L${h},${l} L${h},${a} L${u},${a} Z`,fill:G(t)}),
7
- /* @__PURE__ */d("text",{x:O-12,y:r+4,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),h-u>=i&&/* @__PURE__ */d("text",{x:u+8,y:r+4,textAnchor:"start",fontSize:12,fontWeight:600,fill:J(t),style:{fontVariantNumeric:"tabular-nums"},children:o}),
6
+ /* @__PURE__ */d("path",{d:`M${u},${l} L${h},${l} L${h},${a} L${u},${a} Z`,fill:q(t)}),
7
+ /* @__PURE__ */d("text",{x:D-12,y:r+4,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),h-u>=i&&/* @__PURE__ */d("text",{x:u+8,y:r+4,textAnchor:"start",fontSize:12,fontWeight:600,fill:G(t),style:{fontVariantNumeric:"tabular-nums"},children:o}),
8
8
  /* @__PURE__ */f("text",{"data-funnel-value":"true",x:h+8,y:r+4,textAnchor:"start",fontSize:12,fill:n.label,style:{fontVariantNumeric:"tabular-nums"},children:[
9
- /* @__PURE__ */d("tspan",{fontWeight:600,children:c}),m&&/* @__PURE__ */d("tspan",{fill:n.muted,children:` ${m}`})]})]},e.key)}const h=P(e.value),c="cone"===v?P(x[t+1]?.value??e.value):h,m=R(t),s=2*Math.min(h,c)>=i;/* @__PURE__ */
9
+ /* @__PURE__ */d("tspan",{fontWeight:600,children:c}),m&&/* @__PURE__ */d("tspan",{fill:n.muted,children:` ${m}`})]})]},e.key)}const h=P(e.value),c="cone"===v?P(x[t+1]?.value??e.value):h,m=I(t),s=2*Math.min(h,c)>=i;/* @__PURE__ */
10
10
  return f("g",{opacity:K(t,e.key)?.45:1,onMouseEnter:()=>F(t),children:[
11
- /* @__PURE__ */d("path",{d:`M${T-h},${l} L${T+h},${l} L${T+c},${a} L${T-c},${a} Z`,fill:G(t)}),
12
- /* @__PURE__ */d("text",{x:O-14,y:r-2,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),
13
- /* @__PURE__ */f("text",{x:O-14,y:r+14,textAnchor:"end",fontSize:11,fill:n.muted,style:{fontVariantNumeric:"tabular-nums"},children:[S(e.value),null!=m?` · −${u(m,1,L)}`:""]}),
14
- /* @__PURE__ */d("text",{x:s?T:T+Math.max(h,c)+6,y:r+4,textAnchor:s?"middle":"start",fontSize:12,fontWeight:600,fill:s?J(t):n.label,style:{fontVariantNumeric:"tabular-nums"},children:o})]},e.key)})]}),_&&null!==V&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(l,{title:_.label,rows:[{key:"value",label:A.count,color:G(V),value:S(_.value)},{key:"share",label:A.ofFirstStage,color:n.muted,value:u(_.value/(x[0].value||1)*100,0,L)},...V>0&&x[V-1].value>0?[{key:"drop",label:A.droppedHere,color:r.critical,value:`−${u(100*(1-_.value/x[V-1].value),1,L)}`}]:[]]})})]})}export{x as FunnelChart};
11
+ /* @__PURE__ */d("path",{d:`M${T-h},${l} L${T+h},${l} L${T+c},${a} L${T-c},${a} Z`,fill:q(t)}),
12
+ /* @__PURE__ */d("text",{x:D-14,y:r-2,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),
13
+ /* @__PURE__ */f("text",{x:D-14,y:r+14,textAnchor:"end",fontSize:11,fill:n.muted,style:{fontVariantNumeric:"tabular-nums"},children:[S(e.value),null!=m?` · −${u(m,1,L)}`:""]}),
14
+ /* @__PURE__ */d("text",{x:s?T:T+Math.max(h,c)+6,y:r+4,textAnchor:s?"middle":"start",fontSize:12,fontWeight:600,fill:s?G(t):n.label,style:{fontVariantNumeric:"tabular-nums"},children:o})]},e.key)})]}),_&&null!==V&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(l,{title:_.label,rows:[{key:"value",label:N.count,color:q(V),value:S(_.value)},{key:"share",label:N.ofFirstStage,color:n.muted,value:u(_.value/(x[0].value||1)*100,0,L)},...V>0&&x[V-1].value>0?[{key:"drop",label:N.droppedHere,color:r.critical,value:`−${u(100*(1-_.value/x[V-1].value),1,L)}`}]:[]]})})]})}export{x as FunnelChart};
@@ -1,4 +1,4 @@
1
- import{useWindowMenuItem as e,Modal as t}from"./chunk-VW3ZUWW2.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-H7WMOY62.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-L6XEON5Q.js";import{useState as l,useCallback as m,isValidElement as c,cloneElement as p}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var h=i.aboutApp,x={notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:h.notepad},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.0",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:h.browser}},u=/* @__PURE__ */d(s,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),w=/* @__PURE__ */d(s,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function v({app:s}){const i=x[s],[h,v]=l(!1),N=m(()=>v(!0),[]),b=o().aboutApp,k=b.title(i.name);if(e(k,N,u),!h)return null;const g=r[i.route],y=c(g)?p(g,{className:"h-9 w-9"}):w,[j,W]=a(b.partOf);/* @__PURE__ */
1
+ import{useWindowMenuItem as e,Modal as t}from"./chunk-FCILLVVT.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-LSONG4QV.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-DEJIH3ZQ.js";import{useState as l,useCallback as m,isValidElement as c,cloneElement as p}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var h=i.aboutApp,x={notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:h.notepad},preview:{name:"Preview",version:"1.5.0",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.0",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:h.browser}},u=/* @__PURE__ */d(s,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),w=/* @__PURE__ */d(s,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function v({app:s}){const i=x[s],[h,v]=l(!1),N=m(()=>v(!0),[]),b=o().aboutApp,k=b.title(i.name);if(e(k,N,u),!h)return null;const g=r[i.route],y=c(g)?p(g,{className:"h-9 w-9"}):w,[j,V]=a(b.partOf);/* @__PURE__ */
2
2
  return d(t,{open:!0,onClose:()=>v(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */f("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
3
3
  /* @__PURE__ */d("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__ */d("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:i.name}),
@@ -6,4 +6,4 @@ return d(t,{open:!0,onClose:()=>v(!1),title:k,size:"sm",compact:!0,bodyScroll:!1
6
6
  /* @__PURE__ */d("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:b[s]}),
7
7
  /* @__PURE__ */f("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
8
8
  /* @__PURE__ */f("p",{className:"text-2xs text-ink-faint",children:[j,
9
- /* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),W]}),n&&/* @__PURE__ */d("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(n)})]})]})})}export{v as AboutApp,x as BUILTIN_APP_INFO};
9
+ /* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),V]}),n&&/* @__PURE__ */d("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(n)})]})]})})}export{v as AboutApp,x as BUILTIN_APP_INFO};
@@ -0,0 +1,14 @@
1
+ import{SearchableSelect as e}from"./chunk-P62QGXRW.js";import{labelClasses as a}from"./chunk-EQKUFYX6.js";import{Select_default as l}from"./chunk-KITSIQCV.js";import{isSafeLinkHref as t}from"./chunk-Z5TE3MEG.js";import{Input_default as r}from"./chunk-PT4GMPUB.js";import{INPUT_SIZES as n}from"./chunk-AYZY3YNC.js";import{Button_default as i}from"./chunk-EVYD6UFQ.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-DEJIH3ZQ.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},k=e=>t(e.trim());function y(t){const{value:n,kinds:o,rules:y=x,filtersFor:w,label:C,readOnly:N,placeholder:F,className:j="",tidyAddress:O,addressAddon:E}=t,T=void 0!==t.onApply,$=u().link,D=y.isSafe??k,P=d(),z=c(null),A=c(null),[Q,U]=p({url:n}),S=T?Q.url:n,[Y,I]=p(!1),[K,M]=p(null),[R,V]=p(null),[W,B]=p(!1),G=c(null),Z=c(()=>{});Z.current=T?t.onCancel:()=>{},m(()=>{if(T)return s(e=>{const a=z.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(Z.current(),!0)},()=>z.current)},[T]),m(()=>{if(!T)return;const e=A.current;e?(e.focus(),e.select()):z.current?.querySelector("button, input")?.focus()},[]);const H=o??[{value:b,label:$.address,target:{type:"text"}}],L=K&&K.against===S?K.kind:y.kindOf(S),X=H.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===L),q=X.find(e=>"text"===e.target.type),J=X.find(e=>e.value===L)??q??X[0];if(!J)return null;const _="text"!==J.target.type,ee=_?y.targetOf(S):S,ae=h(J.target),le=ae.find(e=>e.value===ee),te=e=>({value:e,label:$.unavailable(e)}),re="select"===J.target.type&&ee&&w?w(ee):null,ne=re?y.readFilter(S):null,ie=ne?re?.find(e=>e.param===ne.param):void 0,oe=R&&R.against===S?R.text:S,se=_?S:O?O(oe.trim()).trim():oe.trim(),ue=T&&O?se:oe,de=!_&&""!==ue.trim()&&!D(ue),ce=de&&(!T||Y);_&&W&&B(!1);const pe=(e,a)=>{T?U({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},me=(e,a)=>{M(a=>a?{...a,against:e}:a),pe(e,a)},fe=e=>{if(!e)return me("");const a=ae.find(a=>a.value===e);me(e,a?.label)},ve=e=>{I(!1);const a=e.trim();a?D(e)?(V({text:e,against:a}),me(a)):V({text:e,against:S}):(V({text:e,against:""}),me(""))},ge=e=>{const a=e.relatedTarget;if(a&&(a===A.current||G.current?.contains(a)))return;if(B(!1),T||!O||N)return;const l=O(oe.trim());l.trim()!==oe.trim()&&ve(l)},he=()=>{if(!T||!se)return;if(!_&&de)return void I(!0);const e=_&&Q.url===se?Q.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},be=(e,a)=>a&&!e.some(e=>e.value===a)?[te(a),...e]:[...e],xe=(a,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const l=r.some(e=>""===e.value);/* @__PURE__ */
2
+ return f(e,{"aria-label":a,value:t,options:o,disabled:N,clearable:l,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
3
+ return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:N,onChange:n})};let ke;if("text"===J.target.type)ke=/* @__PURE__ */f(r,{ref:A,id:`${P}-address`,size:"sm",type:"text",invalid:ce,"aria-label":$.address,"aria-describedby":ce?`${P}-why`:void 0,placeholder:F??$.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:oe,readOnly:N,onChange:e=>ve(e.target.value),onFocus:()=>B(!0),onBlur:ge,onKeyDown:O&&!T?e=>{"Enter"===e.key&&e.currentTarget.blur()}:void 0});else{const e="groups"===J.target.type?J.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):J.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:J.target.placeholder},...be(e,ee)];ke=xe(J.label,ee,a,fe,e.length>10)}const ye=/* @__PURE__ */v(g,{children:[o&&xe($.linkType,J.value,X.map(e=>({value:e.value,label:e.label})),e=>{V(null),I(!1);const a=X.find(a=>a.value===e);if(!a||"text"===a.target.type)return void M({kind:e,against:S});const l=h(a.target)[0];M({kind:e,against:l?l.value:""}),l?pe(l.value,l.label):pe("")},!1),ke,E&&W&&!N&&"text"===J.target.type&&/* @__PURE__ */f("div",{ref:G,onBlur:ge,children:E({url:oe,onChange:ve})}),re&&xe($.filter,ne?.param??"",[{value:"",label:$.noFilter},...ne&&!ie?[te(ne.param)]:[],...re.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return me(ee,le?.label);const a=re?.find(a=>a.param===e),l=a?.values[0];l&&me(y.withFilter(ee,{param:e,value:l.value}),l.label)},!1),re&&ne&&xe($.value,ne.value,be((ie?.values??[]).map(e=>({value:e.value,label:e.label})),ne.value),e=>{if(!ne)return;const a=ie?.values.find(a=>a.value===e);me(y.withFilter(ee,{param:ne.param,value:e}),a?.label)},(ie?.values.length??0)>10),ce&&/* @__PURE__ */f("p",{id:`${P}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:$.unsafe}),J.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:J.hint}),re&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:$.filterHint})]});if(!T)/* @__PURE__ */
4
+ return f("div",{ref:z,className:`flex min-w-0 flex-auto flex-col gap-2 ${j}`.trim(),role:C?"group":void 0,"aria-label":C,children:ye});const we=t.onRemove;/* @__PURE__ */
5
+ return v("div",{ref:z,role:"dialog","aria-label":C??$.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-line bg-surface p-3 shadow-lg ${j}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),he())},children:[_?/* @__PURE__ */f("span",{className:a({inline:!0}),children:$.title}):/* @__PURE__ */f("label",{htmlFor:`${P}-address`,className:a({inline:!0}),children:$.title}),ye,
6
+ /* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[we?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:we,children:$.remove}):null,
7
+ /* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
8
+ /* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>Z.current(),children:$.cancel}),
9
+ /* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:he,disabled:N||""===se,children:$.apply})]})]})]})}function w({label:e,text:a,onTextChange:l,link:t,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const k=u().link,[w,C]=p(!1),N=c(null),F=d(),j=()=>{C(!1),N.current?.focus()};/* @__PURE__ */
10
+ return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
11
+ /* @__PURE__ */f(r,{size:"md",type:"text",className:"rounded-b-none","aria-label":k.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>l(e.target.value)}),
12
+ /* @__PURE__ */v("button",{ref:N,type:"button","aria-label":k.linkOf(e,t),"aria-expanded":w,"aria-controls":w?F:void 0,disabled:b,onClick:()=>C(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-line-strong bg-surface-sunken ${n.md} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
13
+ /* @__PURE__ */f(o,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(t?"text-blue-600":"text-ink-faintest")}),
14
+ /* @__PURE__ */f("span",{className:"min-w-0 truncate "+(t?"text-blue-600":"text-ink-faintest"),children:t||k.addLink})]}),w&&/* @__PURE__ */f("div",{id:F,className:"mt-2",children:/* @__PURE__ */f(y,{value:t,label:k.linkOf(e,t),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),j()},onRemove:t?()=>{i(""),j()}:void 0,onCancel:j})})]})}export{y as LinkPicker,w as TextLinkField};
@@ -1,13 +1,13 @@
1
- import{useShellStrings as e}from"./chunk-L6XEON5Q.js";import{jsxs as t,jsx as a,Fragment as l}from"react/jsx-runtime";var n=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function s({items:s,getVolume:i,getInstructionVolume:r,getActualVolume:c,qtyField:m="instruction",showNewIndicator:d=!1,getInstructionQty:u=e=>e.quantity,getActualQty:h=e=>e.actual_qty,isFilled:o,isNew:g=e=>Boolean(e._isNew),className:x,style:f}){const p=e().containers,N=o?s.filter(o):s,y=e=>n(u(e)),b=e=>n(h(e)),w=N.some(e=>null!=h(e)&&b(e)>0),v=e=>w?y(e):"actual"===m?h(e)??u(e)??0:u(e)??0,M=N.reduce((e,t)=>e+n(v(t)),0),$=N.filter(e=>g(e)).length,k=N.filter(e=>g(e)).reduce((e,t)=>e+n(v(t)),0),j=N.reduce((e,t)=>e+y(t),0),I=N.reduce((e,t)=>e+b(t),0),V=e=>i?.(e)??0,q=r??(e=>V(e)*y(e)),A=c??(e=>V(e)*b(e)),Q=N.reduce((e,t)=>e+q(t),0),F=N.reduce((e,t)=>e+A(t),0),_=w?Math.max(Q,F):"actual"===m&&F||Q,B=_<=34.65?"20ft":"40ft",E="20ft"===B?33:67,L=_>0?Math.max(1,Math.ceil(_/E)):0,O=L*E,S=_>0&&_>=.95*O&&_<=1.1*O;if(0===N.length)return null;const X=(e,t)=>E>0?Math.max(0,Math.min((e-t*E)/E*100,100)):0;/* @__PURE__ */
1
+ import{useShellStrings as e}from"./chunk-DEJIH3ZQ.js";import{jsxs as t,jsx as a,Fragment as l}from"react/jsx-runtime";var n=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function s({items:s,getVolume:i,getInstructionVolume:r,getActualVolume:c,qtyField:m="instruction",showNewIndicator:d=!1,getInstructionQty:u=e=>e.quantity,getActualQty:h=e=>e.actual_qty,isFilled:o,isNew:g=e=>Boolean(e._isNew),className:x,style:f}){const p=e().containers,y=o?s.filter(o):s,N=e=>n(u(e)),b=e=>n(h(e)),w=y.some(e=>null!=h(e)&&b(e)>0),v=e=>w?N(e):"actual"===m?h(e)??u(e)??0:u(e)??0,M=y.reduce((e,t)=>e+n(v(t)),0),$=y.filter(e=>g(e)).length,k=y.filter(e=>g(e)).reduce((e,t)=>e+n(v(t)),0),I=y.reduce((e,t)=>e+N(t),0),j=y.reduce((e,t)=>e+b(t),0),V=e=>i?.(e)??0,q=r??(e=>V(e)*N(e)),A=c??(e=>V(e)*b(e)),Q=y.reduce((e,t)=>e+q(t),0),F=y.reduce((e,t)=>e+A(t),0),_=w?Math.max(Q,F):"actual"===m&&F||Q,B=_<=34.65?"20ft":"40ft",D="20ft"===B?33:67,E=_>0?Math.max(1,Math.ceil(_/D)):0,H=E*D,J=_>0&&_>=.95*H&&_<=1.1*H;if(0===y.length)return null;const S=(e,t)=>D>0?Math.max(0,Math.min((e-t*D)/D*100,100)):0;/* @__PURE__ */
2
2
  return t("div",{className:`mt-2 px-1 space-y-2 ${x??""}`.trim(),style:f,children:[
3
3
  /* @__PURE__ */t("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[
4
- /* @__PURE__ */t("span",{children:[`${p.items(N.length)} · ${p.pieces(M)}`,w&&j!==I&&/* @__PURE__ */a("span",{className:"ml-1 text-gray-400",children:p.split(j,I)})]}),d&&$>0&&/* @__PURE__ */t("span",{className:"flex items-center gap-1 text-green-600",children:[
5
- /* @__PURE__ */a("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),p.added($,k)]})]}),_>0?/* @__PURE__ */t("div",{className:"space-y-2",children:[Array.from({length:L}).map((e,l)=>{const n=X(Q,l),s=X(F,l),i=w,r=Math.max(n,s),c=Math.min(n,s),m=n>=s,d=i?m?"bg-blue-500":"bg-green-500":"bg-blue-500",u=i?m?"bg-green-500":"bg-blue-500":"";/* @__PURE__ */
4
+ /* @__PURE__ */t("span",{children:[`${p.items(y.length)} · ${p.pieces(M)}`,w&&I!==j&&/* @__PURE__ */a("span",{className:"ml-1 text-gray-400",children:p.split(I,j)})]}),d&&$>0&&/* @__PURE__ */t("span",{className:"flex items-center gap-1 text-green-600",children:[
5
+ /* @__PURE__ */a("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),p.added($,k)]})]}),_>0?/* @__PURE__ */t("div",{className:"space-y-2",children:[Array.from({length:E}).map((e,l)=>{const n=S(Q,l),s=S(F,l),i=w,r=Math.max(n,s),c=Math.min(n,s),m=n>=s,d=i?m?"bg-blue-500":"bg-green-500":"bg-blue-500",u=i?m?"bg-green-500":"bg-blue-500":"";/* @__PURE__ */
6
6
  return t("div",{className:"flex items-center gap-2",children:[
7
7
  /* @__PURE__ */a("span",{className:"text-2xs text-ink-faintest w-8 shrink-0",children:B}),
8
8
  /* @__PURE__ */t("div",{className:"relative flex-1 h-4 bg-gray-100 rounded-full overflow-hidden border border-gray-200",children:[
9
9
  /* @__PURE__ */a("div",{className:`absolute inset-y-0 left-0 ${d} transition-all`,style:{width:`${r}%`}}),i&&c>0&&/* @__PURE__ */a("div",{className:`absolute inset-y-0 left-0 ${u} transition-all`,style:{width:`${c}%`}})]}),
10
- /* @__PURE__ */a("span",{className:"text-2xs text-ink-faint w-16 text-right",children:i?p.fill(Math.min(F-l*E,E),E):p.fill(Math.min(Q-l*E,E),E)})]},`bar-${l}`)}),
10
+ /* @__PURE__ */a("span",{className:"text-2xs text-ink-faint w-16 text-right",children:i?p.fill(Math.min(F-l*D,D),D):p.fill(Math.min(Q-l*D,D),D)})]},`bar-${l}`)}),
11
11
  /* @__PURE__ */t("div",{className:"flex items-center justify-between text-xs pt-0.5",children:[
12
12
  /* @__PURE__ */t("span",{className:"text-gray-500 inline-flex items-center gap-1",children:[p.total,w?/* @__PURE__ */t(l,{children:[
13
13
  /* @__PURE__ */t("span",{className:"inline-flex items-center gap-1 text-blue-700",children:[
@@ -15,4 +15,4 @@ return t("div",{className:"flex items-center gap-2",children:[
15
15
  /* @__PURE__ */a("span",{className:"text-gray-400",children:"/"}),
16
16
  /* @__PURE__ */t("span",{className:"inline-flex items-center gap-1 text-green-700",children:[
17
17
  /* @__PURE__ */a("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500"}),p.loaded(F)]})]}):/* @__PURE__ */a("b",{className:"text-gray-700",children:p.volume(_)})]}),
18
- /* @__PURE__ */t("span",{className:"font-medium "+(S?"text-green-600":"text-gray-500"),children:[S&&"✓ ",L," × ",B]})]})]}):/* @__PURE__ */a("div",{className:"text-xs text-gray-400",children:p.noVolume})]})}export{s as ContainerFillChart};
18
+ /* @__PURE__ */t("span",{className:"font-medium "+(J?"text-green-600":"text-gray-500"),children:[J&&"✓ ",E," × ",B]})]})]}):/* @__PURE__ */a("div",{className:"text-xs text-gray-400",children:p.noVolume})]})}export{s as ContainerFillChart};
@@ -1,26 +1,26 @@
1
- import{Segmented as e}from"./chunk-HNIIDDLJ.js";import{toDateKey as t,fromDateKey as n}from"./chunk-2HMNOLKX.js";import{calendarNames as r,formatDate as o}from"./chunk-Y3JW2GW5.js";import{LoadingSpinner as a}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{useShellStrings as s,useShellLocale as l}from"./chunk-L6XEON5Q.js";import{useState as d,useRef as c,useId as u,useMemo as h}from"react";import{jsx as m,Fragment as f,jsxs as b}from"react/jsx-runtime";var g=864e5,p={day:32,week:16,month:4},y=44;function w(e){const t="string"==typeof e?n(e.slice(0,10)):null;return t?Math.round(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())/g):null}function x(e){return new Date(e*g).toISOString().slice(0,10)}function k(e){return new Date(e*g)}function v(e){return((e+3)%7+7)%7}function D(e){return e-v(e)}function N(e){const t=k(e);return Math.round(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),1)/g)}function M(e){const t=k(e);return Math.round(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,1)/g)}function C(e){return Math.round(Date.UTC(k(e).getUTCFullYear(),0,1)/g)}function $(e){return Math.round(Date.UTC(k(e).getUTCFullYear()+1,0,1)/g)}var T={day:3,week:7,month:14},j={day:28,week:84,month:182};function U(e,t,n){return(e-t.startDay)*p[n]}function X(e,t,n){return U(e,t,n)+p[n]/2}function P(e,t,n,r){const o=[];let a=e.startDay;if(n(a)!==a){const n=Math.min(r(a),e.endDay);o.push({startDay:a,endDay:n,x:U(a,e,t),width:(n-a)*p[t]}),a=n}for(;a<e.endDay;){const n=Math.min(r(a),e.endDay);o.push({startDay:a,endDay:n,x:U(a,e,t),width:(n-a)*p[t]}),a=n}return o}function S(e,t,n,r){if(null===e&&null===t)return{kind:"none"};if(null===e)return{kind:"milestone",day:t,cx:U(t,n,r)+p[r]/2};const o=null===t?e:Math.min(e,t),a=null===t?e:Math.max(e,t);return{kind:"bar",startDay:o,endDay:a,x:U(o,n,r),width:(a-o+1)*p[r]}}function I(e){return"bar"===e.kind?{inX:e.x,outX:e.x+e.width}:"milestone"===e.kind?{inX:e.cx-9,outX:e.cx+9}:null}function z(e,t,n,r,o=44,a=10){let i;if(n-e>=2*a){const o=e+a;i=[[e,t],[o,t],[o,r],[n,r]]}else{const s=t+(r>=t?1:-1)*o/2,l=e+a,d=n-a;i=[[e,t],[l,t],[l,s],[d,s],[d,r],[n,r]]}return i.filter((e,t)=>0===t||e[0]!==i[t-1][0]||e[1]!==i[t-1][1])}function R(e){return e.map(([e,t],n)=>`${0===n?"M":"L"}${e} ${t}`).join(" ")}function Y(e,t,n=5){return`${e},${t} ${e-n},${t-n} ${e-n},${t+n}`}function L(e,t,n,r){if("move"===e)return{start:null===t?null:t+r,end:null===n?null:n+r};if("start"===e){if(null===t)return{start:t,end:n};const e=t+r;return{start:null===n?e:Math.min(e,n),end:n}}if(null===n)return{start:t,end:n};const o=n+r;return{start:t,end:null===t?o:Math.max(o,t)}}function F({rows:n,groups:g=[],dependencies:U=[],scale:F,onScaleChange:H,onRowClick:W,onRowChange:A,readOnly:K=!1,today:Q,isLoading:E=!1,emptyState:O,labelHeader:J,labelWidth:G=240,className:V=""}){const Z=s().gantt,q=l(),B=r(q),_=!!A&&!K,[ee,te]=d(null),ne=c(!1),re=c(null),oe=u(),ae=w(Q)??w(t(/* @__PURE__ */new Date)),ie=h(()=>{const e=/* @__PURE__ */new Map;for(const t of n){const n=w(t.start),r=w(t.end);e.set(t.id,ee&&ee.id===t.id?L(ee.mode,ee.start,ee.end,ee.delta):{start:n,end:r})}return e},[n,ee]),se=h(()=>{const e=[ae];for(const t of n){const n=w(t.start),r=w(t.end);null!==n&&e.push(n),null!==r&&e.push(r)}return function(e,t){const n=e.filter(e=>Number.isFinite(e)),r=n.length?Math.min(...n):0,o=n.length?Math.max(...n):0;let a=r-T[t],i=o+1+T[t];const s=j[t]-(i-a);return s>0&&(a-=Math.floor(s/2),i+=Math.ceil(s/2)),"week"===t?(a=D(a),i=D(i-1)+7):"month"===t&&(a=N(a),i=M(i-1)),{startDay:a,endDay:i}}(e,F)},[n,F,ae]),le=h(()=>function(e,t){return"day"===t?{major:P(e,t,N,M),minor:P(e,t,e=>e,e=>e+1)}:"week"===t?{major:P(e,t,N,M),minor:P(e,t,D,e=>D(e)+7)}:{major:P(e,t,C,$),minor:P(e,t,N,M)}}(se,F),[se,F]),de=function(e,t){return(e.endDay-e.startDay)*p[t]}(se,F),ce=h(()=>function(e,t){const n=new Set(t.map(e=>e.id)),r=/* @__PURE__ */new Map,o=[];for(const t of e)if(null!=t.groupId&&n.has(t.groupId)){const e=r.get(t.groupId)??[];e.push(t),r.set(t.groupId,e)}else o.push(t);const a=o.map(e=>({kind:"row",row:e}));for(const e of t){a.push({kind:"group",group:e});for(const t of r.get(e.id)??[])a.push({kind:"row",row:t})}return a}(n,g),[n,g]),ue=h(()=>{const e=/* @__PURE__ */new Map;return ce.forEach((t,n)=>{if("row"!==t.kind)return;const r=ie.get(t.row.id);e.set(t.row.id,{shape:S(r.start,r.end,se,F),line:n})}),e},[ce,ie,se,F]),he=h(()=>{const e=[];for(const t of U){const n=ue.get(t.from),r=ue.get(t.to);if(!n||!r)continue;const o=I(n.shape),a=I(r.shape);if(!o||!a)continue;const i=n.line*y+22,s=r.line*y+22,l=z(o.outX,i,a.inX,s);e.push({key:`${t.from}>${t.to}`,d:R(l),head:Y(a.inX,s)})}return e},[U,ue]);i(()=>{const e=re.current;if(!e)return;const t=e.clientWidth-G;e.scrollLeft=Math.max(0,X(ae,se,F)-t/4)},[F]);if(E)/* @__PURE__ */return m(a,{size:"sm",padding:"p-4",label:Z.loading});if(0===n.length&&0===g.length)/* @__PURE__ */
2
- return m(f,{children:O??/* @__PURE__ */m("div",{className:"text-sm text-ink-faint p-4",children:Z.empty})});const me=(e,t,n)=>{A?.(e.id,{start:null===t?null:x(t),end:null===n?null:x(n)})},fe=(e,t,n)=>{if(ne.current=!1,_&&0===e.button){e.stopPropagation();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}te({id:t.id,mode:n,originX:e.clientX,start:w(t.start),end:w(t.end),delta:0})}},be=e=>{if(!ee)return;const t=function(e,t){const n=Math.round(e/p[t]);return 0===n?0:n}(e.clientX-ee.originX,F);t!==ee.delta&&te({...ee,delta:t})},ge=e=>{if(ee){if(0!==ee.delta){const t=L(ee.mode,ee.start,ee.end,ee.delta);ne.current=!0,me(e,t.start,t.end)}te(null)}},pe=(e,t)=>{if("Enter"===e.key||" "===e.key)return e.preventDefault(),void W?.(t);if(!_||"ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();const n="ArrowRight"===e.key?1:-1,r=L(e.shiftKey?"end":"move",w(t.start),w(t.end),n);me(t,r.start,r.end)},ye=e=>{ne.current?ne.current=!1:W?.(e)},we=e=>o(x(e),{locale:q}),xe=(e,t)=>{const n=k(e.startDay),r=n.getUTCFullYear(),o=n.getUTCMonth();return"major"===t?"month"===F?String(r):"week"===F?B.shortMonthYear(r,o):B.monthYear(r,o):"month"===F?B.monthsShort[o]:String(n.getUTCDate())},ke=ce.length*y,ve=X(ae,se,F),De=ve>=0&&ve<=de;/* @__PURE__ */
3
- return b("div",{className:`flex min-h-0 flex-col ${V}`,children:[
1
+ import{Segmented as e}from"./chunk-HNIIDDLJ.js";import{toDateKey as t,fromDateKey as n}from"./chunk-2HMNOLKX.js";import{calendarNames as r,formatDate as o}from"./chunk-Y3JW2GW5.js";import{LoadingSpinner as a}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{useShellStrings as s,useShellLocale as l}from"./chunk-DEJIH3ZQ.js";import{useState as d,useRef as c,useId as u,useMemo as h}from"react";import{jsx as m,Fragment as f,jsxs as b}from"react/jsx-runtime";var g=864e5,p={day:32,week:16,month:4},y=44;function w(e){const t="string"==typeof e?n(e.slice(0,10)):null;return t?Math.round(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())/g):null}function x(e){return new Date(e*g).toISOString().slice(0,10)}function k(e){return new Date(e*g)}function v(e){return((e+3)%7+7)%7}function D(e){return e-v(e)}function N(e){const t=k(e);return Math.round(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),1)/g)}function M(e){const t=k(e);return Math.round(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,1)/g)}function C(e){return Math.round(Date.UTC(k(e).getUTCFullYear(),0,1)/g)}function $(e){return Math.round(Date.UTC(k(e).getUTCFullYear()+1,0,1)/g)}var T={day:3,week:7,month:14},j={day:28,week:84,month:182};function U(e,t,n){return(e-t.startDay)*p[n]}function I(e,t,n){return U(e,t,n)+p[n]/2}function P(e,t,n,r){const o=[];let a=e.startDay;if(n(a)!==a){const n=Math.min(r(a),e.endDay);o.push({startDay:a,endDay:n,x:U(a,e,t),width:(n-a)*p[t]}),a=n}for(;a<e.endDay;){const n=Math.min(r(a),e.endDay);o.push({startDay:a,endDay:n,x:U(a,e,t),width:(n-a)*p[t]}),a=n}return o}function S(e,t,n,r){if(null===e&&null===t)return{kind:"none"};if(null===e)return{kind:"milestone",day:t,cx:U(t,n,r)+p[r]/2};const o=null===t?e:Math.min(e,t),a=null===t?e:Math.max(e,t);return{kind:"bar",startDay:o,endDay:a,x:U(o,n,r),width:(a-o+1)*p[r]}}function X(e){return"bar"===e.kind?{inX:e.x,outX:e.x+e.width}:"milestone"===e.kind?{inX:e.cx-9,outX:e.cx+9}:null}function z(e,t,n,r,o=44,a=10){let i;if(n-e>=2*a){const o=e+a;i=[[e,t],[o,t],[o,r],[n,r]]}else{const s=t+(r>=t?1:-1)*o/2,l=e+a,d=n-a;i=[[e,t],[l,t],[l,s],[d,s],[d,r],[n,r]]}return i.filter((e,t)=>0===t||e[0]!==i[t-1][0]||e[1]!==i[t-1][1])}function R(e){return e.map(([e,t],n)=>`${0===n?"M":"L"}${e} ${t}`).join(" ")}function Y(e,t,n=5){return`${e},${t} ${e-n},${t-n} ${e-n},${t+n}`}function H(e,t,n,r){if("move"===e)return{start:null===t?null:t+r,end:null===n?null:n+r};if("start"===e){if(null===t)return{start:t,end:n};const e=t+r;return{start:null===n?e:Math.min(e,n),end:n}}if(null===n)return{start:t,end:n};const o=n+r;return{start:t,end:null===t?o:Math.max(o,t)}}function F({rows:n,groups:g=[],dependencies:U=[],scale:F,onScaleChange:L,onRowClick:W,onRowChange:A,readOnly:K=!1,today:Q,isLoading:E=!1,emptyState:J,labelHeader:O,labelWidth:Z=240,className:G=""}){const V=s().gantt,q=l(),B=r(q),_=!!A&&!K,[ee,te]=d(null),ne=c(!1),re=c(null),oe=u(),ae=w(Q)??w(t(/* @__PURE__ */new Date)),ie=h(()=>{const e=/* @__PURE__ */new Map;for(const t of n){const n=w(t.start),r=w(t.end);e.set(t.id,ee&&ee.id===t.id?H(ee.mode,ee.start,ee.end,ee.delta):{start:n,end:r})}return e},[n,ee]),se=h(()=>{const e=[ae];for(const t of n){const n=w(t.start),r=w(t.end);null!==n&&e.push(n),null!==r&&e.push(r)}return function(e,t){const n=e.filter(e=>Number.isFinite(e)),r=n.length?Math.min(...n):0,o=n.length?Math.max(...n):0;let a=r-T[t],i=o+1+T[t];const s=j[t]-(i-a);return s>0&&(a-=Math.floor(s/2),i+=Math.ceil(s/2)),"week"===t?(a=D(a),i=D(i-1)+7):"month"===t&&(a=N(a),i=M(i-1)),{startDay:a,endDay:i}}(e,F)},[n,F,ae]),le=h(()=>function(e,t){return"day"===t?{major:P(e,t,N,M),minor:P(e,t,e=>e,e=>e+1)}:"week"===t?{major:P(e,t,N,M),minor:P(e,t,D,e=>D(e)+7)}:{major:P(e,t,C,$),minor:P(e,t,N,M)}}(se,F),[se,F]),de=function(e,t){return(e.endDay-e.startDay)*p[t]}(se,F),ce=h(()=>function(e,t){const n=new Set(t.map(e=>e.id)),r=/* @__PURE__ */new Map,o=[];for(const t of e)if(null!=t.groupId&&n.has(t.groupId)){const e=r.get(t.groupId)??[];e.push(t),r.set(t.groupId,e)}else o.push(t);const a=o.map(e=>({kind:"row",row:e}));for(const e of t){a.push({kind:"group",group:e});for(const t of r.get(e.id)??[])a.push({kind:"row",row:t})}return a}(n,g),[n,g]),ue=h(()=>{const e=/* @__PURE__ */new Map;return ce.forEach((t,n)=>{if("row"!==t.kind)return;const r=ie.get(t.row.id);e.set(t.row.id,{shape:S(r.start,r.end,se,F),line:n})}),e},[ce,ie,se,F]),he=h(()=>{const e=[];for(const t of U){const n=ue.get(t.from),r=ue.get(t.to);if(!n||!r)continue;const o=X(n.shape),a=X(r.shape);if(!o||!a)continue;const i=n.line*y+22,s=r.line*y+22,l=z(o.outX,i,a.inX,s);e.push({key:`${t.from}>${t.to}`,d:R(l),head:Y(a.inX,s)})}return e},[U,ue]);i(()=>{const e=re.current;if(!e)return;const t=e.clientWidth-Z;e.scrollLeft=Math.max(0,I(ae,se,F)-t/4)},[F]);if(E)/* @__PURE__ */return m(a,{size:"sm",padding:"p-4",label:V.loading});if(0===n.length&&0===g.length)/* @__PURE__ */
2
+ return m(f,{children:J??/* @__PURE__ */m("div",{className:"text-sm text-ink-faint p-4",children:V.empty})});const me=(e,t,n)=>{A?.(e.id,{start:null===t?null:x(t),end:null===n?null:x(n)})},fe=(e,t,n)=>{if(ne.current=!1,_&&0===e.button){e.stopPropagation();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}te({id:t.id,mode:n,originX:e.clientX,start:w(t.start),end:w(t.end),delta:0})}},be=e=>{if(!ee)return;const t=function(e,t){const n=Math.round(e/p[t]);return 0===n?0:n}(e.clientX-ee.originX,F);t!==ee.delta&&te({...ee,delta:t})},ge=e=>{if(ee){if(0!==ee.delta){const t=H(ee.mode,ee.start,ee.end,ee.delta);ne.current=!0,me(e,t.start,t.end)}te(null)}},pe=(e,t)=>{if("Enter"===e.key||" "===e.key)return e.preventDefault(),void W?.(t);if(!_||"ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();const n="ArrowRight"===e.key?1:-1,r=H(e.shiftKey?"end":"move",w(t.start),w(t.end),n);me(t,r.start,r.end)},ye=e=>{ne.current?ne.current=!1:W?.(e)},we=e=>o(x(e),{locale:q}),xe=(e,t)=>{const n=k(e.startDay),r=n.getUTCFullYear(),o=n.getUTCMonth();return"major"===t?"month"===F?String(r):"week"===F?B.shortMonthYear(r,o):B.monthYear(r,o):"month"===F?B.monthsShort[o]:String(n.getUTCDate())},ke=ce.length*y,ve=I(ae,se,F),De=ve>=0&&ve<=de;/* @__PURE__ */
3
+ return b("div",{className:`flex min-h-0 flex-col ${G}`,children:[
4
4
  /* @__PURE__ */b("div",{className:"flex items-center justify-end gap-2 pb-2",children:[
5
- /* @__PURE__ */m("button",{type:"button",onClick:()=>{const e=re.current;if(!e)return;const t=e.clientWidth-G;e.scrollTo?.({left:Math.max(0,X(ae,se,F)-t/4),behavior:"smooth"})},className:"min-h-8 rounded-(--radius-control) border border-line bg-surface px-3 text-xs font-medium text-ink hover:bg-row-hover",children:Z.today}),H&&/* @__PURE__ */m(e,{size:"sm",label:Z.scale,value:F,onChange:H,options:[{value:"day",label:Z.day},{value:"week",label:Z.week},{value:"month",label:Z.month}]})]}),
6
- /* @__PURE__ */m("div",{ref:re,"data-gantt-scroller":"",className:"relative min-h-0 flex-1 overflow-auto grid-scroll rounded-(--radius-card) border border-line bg-surface",children:/* @__PURE__ */b("div",{className:"relative",style:{width:G+de,minHeight:48+ke},children:[
5
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>{const e=re.current;if(!e)return;const t=e.clientWidth-Z;e.scrollTo?.({left:Math.max(0,I(ae,se,F)-t/4),behavior:"smooth"})},className:"min-h-8 rounded-(--radius-control) border border-line bg-surface px-3 text-xs font-medium text-ink hover:bg-row-hover",children:V.today}),L&&/* @__PURE__ */m(e,{size:"sm",label:V.scale,value:F,onChange:L,options:[{value:"day",label:V.day},{value:"week",label:V.week},{value:"month",label:V.month}]})]}),
6
+ /* @__PURE__ */m("div",{ref:re,"data-gantt-scroller":"",className:"relative min-h-0 flex-1 overflow-auto grid-scroll rounded-(--radius-card) border border-line bg-surface",children:/* @__PURE__ */b("div",{className:"relative",style:{width:Z+de,minHeight:48+ke},children:[
7
7
  /* @__PURE__ */b("div",{className:"sticky top-0 z-20 flex border-b border-line bg-surface",style:{height:48},children:[
8
- /* @__PURE__ */m("div",{className:"sticky left-0 z-10 flex shrink-0 items-end border-r border-line bg-surface px-3 pb-1 text-xs font-medium text-ink-muted",style:{width:G},children:J??Z.task}),
9
- /* @__PURE__ */b("div",{className:"relative shrink-0",style:{width:de},"aria-hidden":!0,children:[le.major.map(e=>/* @__PURE__ */m("div",{className:"absolute top-0 border-l border-line-subtle text-xs font-medium leading-6 text-ink",style:{left:e.x,width:e.width,height:24},children:/* @__PURE__ */m("span",{className:"sticky inline-block whitespace-nowrap px-2",style:{left:G},children:xe(e,"major")})},`M${e.startDay}`)),le.minor.map(e=>/* @__PURE__ */m("div",{className:`absolute truncate border-l border-line-subtle text-2xs leading-6 text-ink-faint ${"day"===F?"text-center":"px-1"} ${e.startDay===ae&&"day"===F?"font-semibold text-danger":""}`,style:{left:e.x,width:e.width,top:24,height:24},children:xe(e,"minor")},`m${e.startDay}`)),De&&"day"!==F&&/* @__PURE__ */m("span",{className:"absolute bottom-1 -translate-x-1/2 rounded-(--radius-control) bg-danger px-1 text-2xs font-medium leading-4 text-on-accent",style:{left:ve},children:Z.today})]})]}),
10
- /* @__PURE__ */b("div",{className:"pointer-events-none absolute",style:{left:G,top:48,width:de,height:ke},"aria-hidden":!0,children:["day"===F&&le.minor.filter(e=>v(e.startDay)>=5).map(e=>/* @__PURE__ */m("div",{className:"absolute inset-y-0 bg-surface-sunken",style:{left:e.x,width:e.width}},`w${e.startDay}`)),le.minor.map(e=>/* @__PURE__ */m("div",{className:"absolute inset-y-0 w-px bg-line-subtle",style:{left:e.x}},`g${e.startDay}`))]}),
8
+ /* @__PURE__ */m("div",{className:"sticky left-0 z-10 flex shrink-0 items-end border-r border-line bg-surface px-3 pb-1 text-xs font-medium text-ink-muted",style:{width:Z},children:O??V.task}),
9
+ /* @__PURE__ */b("div",{className:"relative shrink-0",style:{width:de},"aria-hidden":!0,children:[le.major.map(e=>/* @__PURE__ */m("div",{className:"absolute top-0 border-l border-line-subtle text-xs font-medium leading-6 text-ink",style:{left:e.x,width:e.width,height:24},children:/* @__PURE__ */m("span",{className:"sticky inline-block whitespace-nowrap px-2",style:{left:Z},children:xe(e,"major")})},`M${e.startDay}`)),le.minor.map(e=>/* @__PURE__ */m("div",{className:`absolute truncate border-l border-line-subtle text-2xs leading-6 text-ink-faint ${"day"===F?"text-center":"px-1"} ${e.startDay===ae&&"day"===F?"font-semibold text-danger":""}`,style:{left:e.x,width:e.width,top:24,height:24},children:xe(e,"minor")},`m${e.startDay}`)),De&&"day"!==F&&/* @__PURE__ */m("span",{className:"absolute bottom-1 -translate-x-1/2 rounded-(--radius-control) bg-danger px-1 text-2xs font-medium leading-4 text-on-accent",style:{left:ve},children:V.today})]})]}),
10
+ /* @__PURE__ */b("div",{className:"pointer-events-none absolute",style:{left:Z,top:48,width:de,height:ke},"aria-hidden":!0,children:["day"===F&&le.minor.filter(e=>v(e.startDay)>=5).map(e=>/* @__PURE__ */m("div",{className:"absolute inset-y-0 bg-surface-sunken",style:{left:e.x,width:e.width}},`w${e.startDay}`)),le.minor.map(e=>/* @__PURE__ */m("div",{className:"absolute inset-y-0 w-px bg-line-subtle",style:{left:e.x}},`g${e.startDay}`))]}),
11
11
  /* @__PURE__ */m("div",{role:"list",children:ce.map(e=>{if("group"===e.kind)/* @__PURE__ */
12
12
  return b("div",{role:"listitem",className:"flex",style:{height:y},children:[
13
- /* @__PURE__ */m("div",{className:"sticky left-0 z-10 flex shrink-0 items-center border-r border-b border-line bg-surface-sunken px-3 text-sm font-semibold text-ink",style:{width:G},children:/* @__PURE__ */m("span",{className:"truncate",children:e.group.label})}),
14
- /* @__PURE__ */m("div",{className:"shrink-0 border-b border-line-subtle",style:{width:de}})]},`g:${e.group.id}`);const t=e.row,n=ue.get(t.id).shape,r=function(e){return e.done?{className:"border text-ink-muted",style:{background:"var(--status-neutral-soft)",borderColor:"var(--status-neutral-line)"}}:e.tone?{className:"text-on-accent",style:{background:`var(--status-${e.tone}-solid)`}}:{className:"bg-accent-fill text-on-accent"}}(t),o=ee?.id===t.id,a=t.done?`, ${Z.done}`:"";/* @__PURE__ */
13
+ /* @__PURE__ */m("div",{className:"sticky left-0 z-10 flex shrink-0 items-center border-r border-b border-line bg-surface-sunken px-3 text-sm font-semibold text-ink",style:{width:Z},children:/* @__PURE__ */m("span",{className:"truncate",children:e.group.label})}),
14
+ /* @__PURE__ */m("div",{className:"shrink-0 border-b border-line-subtle",style:{width:de}})]},`g:${e.group.id}`);const t=e.row,n=ue.get(t.id).shape,r=function(e){return e.done?{className:"border text-ink-muted",style:{background:"var(--status-neutral-soft)",borderColor:"var(--status-neutral-line)"}}:e.tone?{className:"text-on-accent",style:{background:`var(--status-${e.tone}-solid)`}}:{className:"bg-accent-fill text-on-accent"}}(t),o=ee?.id===t.id,a=t.done?`, ${V.done}`:"";/* @__PURE__ */
15
15
  return b("div",{role:"listitem",className:"flex",style:{height:y},"data-gantt-row":t.id,children:[
16
- /* @__PURE__ */m("div",{className:"sticky left-0 z-10 flex shrink-0 border-r border-b border-line-subtle bg-surface",style:{width:G},children:/* @__PURE__ */m("button",{type:"button",tabIndex:"none"===n.kind&&W?0:-1,onClick:()=>W?.(t),className:`flex w-full min-w-0 items-center px-3 text-left text-sm hover:bg-row-hover ${t.done?"text-ink-faint line-through":"text-ink"} ${W?"cursor-pointer":"cursor-default"}`,children:/* @__PURE__ */m("span",{className:"truncate",children:t.label})})}),
16
+ /* @__PURE__ */m("div",{className:"sticky left-0 z-10 flex shrink-0 border-r border-b border-line-subtle bg-surface",style:{width:Z},children:/* @__PURE__ */m("button",{type:"button",tabIndex:"none"===n.kind&&W?0:-1,onClick:()=>W?.(t),className:`flex w-full min-w-0 items-center px-3 text-left text-sm hover:bg-row-hover ${t.done?"text-ink-faint line-through":"text-ink"} ${W?"cursor-pointer":"cursor-default"}`,children:/* @__PURE__ */m("span",{className:"truncate",children:t.label})})}),
17
17
  /* @__PURE__ */b("div",{className:"relative shrink-0 border-b border-line-subtle",style:{width:de},children:["bar"===n.kind&&/* @__PURE__ */b(f,{children:[
18
- /* @__PURE__ */m("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"aria-label":Z.barName(t.label,we(n.startDay),we(n.endDay))+a,"aria-describedby":_?oe:void 0,onKeyDown:e=>pe(e,t),onClick:()=>ye(t),onPointerDown:e=>fe(e,t,"move"),onPointerMove:be,onPointerUp:()=>ge(t),onPointerCancel:()=>te(null),className:`group/bar absolute rounded-(--radius-control) shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${_?o?"cursor-grabbing":"cursor-grab":W?"cursor-pointer":""} ${o?"opacity-80":""}`,style:{...r.style,left:n.x,width:n.width,top:10,height:24,touchAction:_?"none":void 0},children:_&&/* @__PURE__ */b(f,{children:[
18
+ /* @__PURE__ */m("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"aria-label":V.barName(t.label,we(n.startDay),we(n.endDay))+a,"aria-describedby":_?oe:void 0,onKeyDown:e=>pe(e,t),onClick:()=>ye(t),onPointerDown:e=>fe(e,t,"move"),onPointerMove:be,onPointerUp:()=>ge(t),onPointerCancel:()=>te(null),className:`group/bar absolute rounded-(--radius-control) shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${_?o?"cursor-grabbing":"cursor-grab":W?"cursor-pointer":""} ${o?"opacity-80":""}`,style:{...r.style,left:n.x,width:n.width,top:10,height:24,touchAction:_?"none":void 0},children:_&&/* @__PURE__ */b(f,{children:[
19
19
  /* @__PURE__ */m("span",{"aria-hidden":!0,"data-gantt-handle":"start",className:"absolute inset-y-0 left-0 w-2 cursor-ew-resize rounded-l-(--radius-control) group-hover/bar:bg-scrim-soft",onPointerDown:e=>fe(e,t,"start")}),
20
20
  /* @__PURE__ */m("span",{"aria-hidden":!0,"data-gantt-handle":"end",className:"absolute inset-y-0 right-0 w-2 cursor-ew-resize rounded-r-(--radius-control) group-hover/bar:bg-scrim-soft",onPointerDown:e=>fe(e,t,"end")})]})}),
21
21
  /* @__PURE__ */m("span",{"aria-hidden":!0,className:"pointer-events-none absolute whitespace-nowrap text-xs leading-none text-ink-muted",style:{left:n.x+n.width+16,top:16},children:t.label})]}),"milestone"===n.kind&&/* @__PURE__ */b(f,{children:[
22
- /* @__PURE__ */m("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"data-gantt-milestone":"","aria-label":Z.milestoneName(t.label,we(n.day))+a,"aria-describedby":_?oe:void 0,onKeyDown:e=>pe(e,t),onClick:()=>ye(t),onPointerDown:e=>fe(e,t,"move"),onPointerMove:be,onPointerUp:()=>ge(t),onPointerCancel:()=>te(null),className:`absolute rotate-45 rounded-sm shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${_?o?"cursor-grabbing":"cursor-grab":W?"cursor-pointer":""}`,style:{...r.style,left:n.cx-9/Math.SQRT2,top:22-9/Math.SQRT2,width:18/Math.SQRT2,height:18/Math.SQRT2,touchAction:_?"none":void 0}}),
22
+ /* @__PURE__ */m("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"data-gantt-milestone":"","aria-label":V.milestoneName(t.label,we(n.day))+a,"aria-describedby":_?oe:void 0,onKeyDown:e=>pe(e,t),onClick:()=>ye(t),onPointerDown:e=>fe(e,t,"move"),onPointerMove:be,onPointerUp:()=>ge(t),onPointerCancel:()=>te(null),className:`absolute rotate-45 rounded-sm shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${_?o?"cursor-grabbing":"cursor-grab":W?"cursor-pointer":""}`,style:{...r.style,left:n.cx-9/Math.SQRT2,top:22-9/Math.SQRT2,width:18/Math.SQRT2,height:18/Math.SQRT2,touchAction:_?"none":void 0}}),
23
23
  /* @__PURE__ */m("span",{"aria-hidden":!0,className:"pointer-events-none absolute whitespace-nowrap text-xs leading-none text-ink-muted",style:{left:n.cx+9+16,top:16},children:t.label})]})]})]},t.id)})}),
24
- /* @__PURE__ */m("svg",{className:"pointer-events-none absolute overflow-visible text-ink-faint",style:{left:G,top:48,width:de,height:ke},width:de,height:ke,"aria-hidden":!0,children:he.map(e=>/* @__PURE__ */b("g",{"data-gantt-arrow":e.key,children:[
24
+ /* @__PURE__ */m("svg",{className:"pointer-events-none absolute overflow-visible text-ink-faint",style:{left:Z,top:48,width:de,height:ke},width:de,height:ke,"aria-hidden":!0,children:he.map(e=>/* @__PURE__ */b("g",{"data-gantt-arrow":e.key,children:[
25
25
  /* @__PURE__ */m("path",{d:e.d,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round"}),
26
- /* @__PURE__ */m("polygon",{points:e.head,fill:"currentColor"})]},e.key))}),De&&/* @__PURE__ */m("div",{"data-gantt-today":"",className:"pointer-events-none absolute z-0 w-0.5 -translate-x-1/2 bg-danger",style:{left:G+ve,top:48,height:ke},"aria-hidden":!0}),_&&/* @__PURE__ */m("span",{id:oe,hidden:!0,children:Z.moveHint})]})})]})}export{F as Gantt};
26
+ /* @__PURE__ */m("polygon",{points:e.head,fill:"currentColor"})]},e.key))}),De&&/* @__PURE__ */m("div",{"data-gantt-today":"",className:"pointer-events-none absolute z-0 w-0.5 -translate-x-1/2 bg-danger",style:{left:Z+ve,top:48,height:ke},"aria-hidden":!0}),_&&/* @__PURE__ */m("span",{id:oe,hidden:!0,children:V.moveHint})]})})]})}export{F as Gantt};