efficient-shell 13.21.0 → 13.22.1

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 (319) hide show
  1. package/README.md +13 -0
  2. package/dist/{Browser-AE7OYSTS.js → Browser-ZNJ3OZSE.js} +13 -13
  3. package/dist/Calculator-BPQPQUZN.js +29 -0
  4. package/dist/CurrencyConverter-M4UJI6VQ.js +21 -0
  5. package/dist/{Files-Y5UGT3RX.js → Files-4HACSJ7C.js} +77 -77
  6. package/dist/Notepad-SK2E5VOK.js +24 -0
  7. package/dist/{PdfViewer-EELX35ZI.js → PdfViewer-FWGHFO4N.js} +1 -1
  8. package/dist/{PomodoroTimer-6XHLOAJD.js → PomodoroTimer-BR5NOA24.js} +48 -48
  9. package/dist/{Preview-XQXSRAGY.js → Preview-CLV2ZAU5.js} +26 -26
  10. package/dist/Sidebar-MY66ILZY.js +44 -0
  11. package/dist/{Stock-36O4LW46.js → Stock-LZ2QHPU4.js} +3 -3
  12. package/dist/{Weather-BN6AJJ4S.js → Weather-Q22ZW7ZQ.js} +20 -20
  13. package/dist/{WorldClock-TUVIRPTM.js → WorldClock-4MSSRLC7.js} +6 -6
  14. package/dist/ai/index.js +118 -118
  15. package/dist/apps/ImageAnnotator.js +1 -1
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/browser-check.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-23YQNCZ4.js +23 -0
  47. package/dist/chunk-2AEYVQ2R.js +2 -0
  48. package/dist/{chunk-MVOYVN3S.js → chunk-2YHS5E27.js} +1 -1
  49. package/dist/{chunk-X4E4RPFE.js → chunk-2YUAR2EH.js} +5 -5
  50. package/dist/{chunk-MUNP5Z24.js → chunk-3AMCLA5Q.js} +1 -1
  51. package/dist/{chunk-PPLPDP6D.js → chunk-3AUN7JSM.js} +1 -1
  52. package/dist/{chunk-FDDM7VMQ.js → chunk-3BQMICGG.js} +1 -1
  53. package/dist/{chunk-NILGK2KJ.js → chunk-3EYJ4G7L.js} +1 -1
  54. package/dist/{chunk-FXSGIT53.js → chunk-3GJVTK4H.js} +8 -8
  55. package/dist/chunk-3SIHJWR2.js +28 -0
  56. package/dist/chunk-3SKXWFGG.js +15 -0
  57. package/dist/{chunk-XD3M5ZXM.js → chunk-3TD3GH53.js} +6 -6
  58. package/dist/{chunk-4U5M37SF.js → chunk-4PJFL26P.js} +1 -1
  59. package/dist/{chunk-NA4XPE7S.js → chunk-53HHYEN4.js} +3 -3
  60. package/dist/{chunk-OF5X4HKC.js → chunk-5JUXMNUC.js} +1 -1
  61. package/dist/{chunk-TB2ARUE2.js → chunk-5OHFBS2B.js} +1 -1
  62. package/dist/chunk-5ZOYYL46.js +4 -0
  63. package/dist/{chunk-TPKNHQIE.js → chunk-66NJCU4W.js} +8 -8
  64. package/dist/{chunk-BCQSNK2Z.js → chunk-6CFI4YGI.js} +4 -4
  65. package/dist/{chunk-LKAGXURQ.js → chunk-6MFKKTCE.js} +17 -17
  66. package/dist/{chunk-QNWC3RWK.js → chunk-6NXPOZ6X.js} +1 -1
  67. package/dist/{chunk-F4VILY3O.js → chunk-72UHB4JU.js} +1 -1
  68. package/dist/{chunk-7I5RJPY7.js → chunk-7AVPMO4F.js} +1 -1
  69. package/dist/{chunk-KYQKMBSY.js → chunk-7B6JPNOD.js} +5 -5
  70. package/dist/{chunk-JB4WXBJB.js → chunk-7G5HKAGV.js} +5 -5
  71. package/dist/{chunk-SUSJFGXN.js → chunk-7N42VDGT.js} +9 -9
  72. package/dist/{chunk-J4CVYOY3.js → chunk-7N6CVTWO.js} +10 -10
  73. package/dist/{chunk-YCXQDUTW.js → chunk-7PAZO65L.js} +6 -6
  74. package/dist/{chunk-4G7PJ325.js → chunk-A5FC4LR7.js} +1 -1
  75. package/dist/{chunk-G5UGCAWN.js → chunk-A6TOHNJY.js} +1 -1
  76. package/dist/{chunk-HPZLV3KD.js → chunk-AFYLMXOJ.js} +5 -5
  77. package/dist/{chunk-XAT2MKNU.js → chunk-AH2NEKEN.js} +4 -4
  78. package/dist/{chunk-G7SILKUY.js → chunk-AQVPWUJ3.js} +5 -5
  79. package/dist/{chunk-63E4ZZYI.js → chunk-BEXFMSNK.js} +2 -2
  80. package/dist/{chunk-HOROMBJB.js → chunk-BL347U3N.js} +6 -6
  81. package/dist/{chunk-SOXZRLSD.js → chunk-BUMY4LIP.js} +3 -3
  82. package/dist/{chunk-OUYGLDQN.js → chunk-BUUAALHH.js} +7 -7
  83. package/dist/{chunk-7CBWSLCW.js → chunk-C7Z3ZMJH.js} +12 -12
  84. package/dist/{chunk-SF4IIV5Z.js → chunk-CJQPC2P3.js} +2 -2
  85. package/dist/{chunk-5POQCJL6.js → chunk-CUJ537IY.js} +4 -4
  86. package/dist/{chunk-E7BQZL7X.js → chunk-D4432YRW.js} +1 -1
  87. package/dist/{chunk-RDVC32EV.js → chunk-D5HFWOW7.js} +16 -16
  88. package/dist/{chunk-GEITUFYK.js → chunk-D5PXRJHA.js} +19 -19
  89. package/dist/{chunk-VRJKV44O.js → chunk-DAUE6ULT.js} +1 -1
  90. package/dist/chunk-DEE6FKE7.js +92 -0
  91. package/dist/{chunk-YWMCW5BN.js → chunk-DTRJLQWO.js} +1 -1
  92. package/dist/{chunk-WJMPTW3G.js → chunk-DV6TUXCZ.js} +1 -1
  93. package/dist/{chunk-23LK4PLJ.js → chunk-E4GF7M4S.js} +8 -8
  94. package/dist/chunk-EJJTDUN3.js +22 -0
  95. package/dist/{chunk-RA2UNNJC.js → chunk-F3EBYHIE.js} +10 -10
  96. package/dist/chunk-FBI3XJWH.js +11 -0
  97. package/dist/{chunk-WJTNQ7YD.js → chunk-FE7H6RXE.js} +2 -2
  98. package/dist/{chunk-YQ5JHHLE.js → chunk-FMBUR4EU.js} +1 -1
  99. package/dist/{chunk-IOLUF3UL.js → chunk-GKYGPCGL.js} +1 -1
  100. package/dist/{chunk-Q4MOT7TY.js → chunk-GPU7LLTJ.js} +1 -1
  101. package/dist/{chunk-ZCGT5YNR.js → chunk-GRAFJD3L.js} +1 -1
  102. package/dist/{chunk-L4ZQY4ZG.js → chunk-GZRNOIEE.js} +3 -3
  103. package/dist/{chunk-VQ35LXDC.js → chunk-I2NVBDKH.js} +1 -1
  104. package/dist/{chunk-EZYXY67W.js → chunk-IJG4UEKF.js} +8 -8
  105. package/dist/{chunk-3SIRRK3F.js → chunk-J5OAQAAD.js} +4 -4
  106. package/dist/{chunk-SZFULV7I.js → chunk-J5W63XNR.js} +6 -6
  107. package/dist/{chunk-GNRH43N3.js → chunk-JJYTN72U.js} +2 -2
  108. package/dist/{chunk-HMOKKMIV.js → chunk-JLSXDYS4.js} +2 -2
  109. package/dist/{chunk-EFVQQF6F.js → chunk-JXJNQHPY.js} +19 -19
  110. package/dist/{chunk-HPHDLN6E.js → chunk-JYR4V4AG.js} +2 -2
  111. package/dist/{chunk-EG5MU7XL.js → chunk-JZ43635V.js} +1 -1
  112. package/dist/{chunk-KQCJWK55.js → chunk-KC2EQCBE.js} +6 -6
  113. package/dist/chunk-KUPN5WRE.js +1 -0
  114. package/dist/{chunk-P52LXNUU.js → chunk-L744YF4X.js} +1 -1
  115. package/dist/{chunk-SXHV5OLA.js → chunk-LC2UF3AA.js} +1 -1
  116. package/dist/{chunk-GUSENWAH.js → chunk-LLDGRPLF.js} +1 -1
  117. package/dist/{chunk-KNZ7YTFH.js → chunk-LLSGIMLG.js} +1 -1
  118. package/dist/{chunk-JPSWWIBW.js → chunk-LQIHBIXG.js} +6 -6
  119. package/dist/{chunk-UC5IC3AM.js → chunk-LRMDLZMM.js} +9 -9
  120. package/dist/{chunk-SHHRC5XK.js → chunk-LUARJHUK.js} +9 -9
  121. package/dist/chunk-M36B3M2H.js +8 -0
  122. package/dist/{chunk-2J3C2RR4.js → chunk-M3HTP2N6.js} +6 -6
  123. package/dist/{chunk-BZRFD4DK.js → chunk-M4REKOGO.js} +1 -1
  124. package/dist/{chunk-ZNV75GAG.js → chunk-MEFB2KGF.js} +1 -1
  125. package/dist/{chunk-U2ZTHOQL.js → chunk-MMA3WTF2.js} +4 -4
  126. package/dist/chunk-MRZLFZNJ.js +6 -0
  127. package/dist/chunk-N64YAF5N.js +2 -0
  128. package/dist/chunk-N6PMH6DU.js +6 -0
  129. package/dist/chunk-NRHG4R2Q.js +1 -0
  130. package/dist/{chunk-G2JPTPRS.js → chunk-OFMZ6JM6.js} +13 -13
  131. package/dist/chunk-ONWFKCMB.js +14 -0
  132. package/dist/{chunk-XWJT6TFU.js → chunk-OSMRYND3.js} +1 -1
  133. package/dist/{chunk-6OCA7RKQ.js → chunk-P234FPKJ.js} +1 -1
  134. package/dist/{chunk-IUQJGFEO.js → chunk-P3JPSO3E.js} +8 -8
  135. package/dist/{chunk-ZVDYRXNP.js → chunk-P4VOUPRF.js} +6 -6
  136. package/dist/{chunk-ENDYHUUR.js → chunk-P73ZJ6QR.js} +1 -1
  137. package/dist/{chunk-5HFKVEWW.js → chunk-PFOTEDSQ.js} +1 -1
  138. package/dist/{chunk-H75CQD46.js → chunk-PHYHKDSW.js} +1 -1
  139. package/dist/{chunk-FBS55WOX.js → chunk-PLESHI3E.js} +7 -7
  140. package/dist/{chunk-42DF7CDB.js → chunk-PPI4WJ3V.js} +7 -7
  141. package/dist/{chunk-M2TQOJ3G.js → chunk-PSVGB7KT.js} +1 -1
  142. package/dist/{chunk-223XYIIH.js → chunk-Q2RNFBYS.js} +1 -1
  143. package/dist/{chunk-6OGX7V7L.js → chunk-Q36KB5RQ.js} +7 -7
  144. package/dist/{chunk-WPGSU4QG.js → chunk-Q7CM4UDG.js} +2 -2
  145. package/dist/{chunk-BVX7LUAW.js → chunk-QJUMBOL2.js} +6 -6
  146. package/dist/{chunk-25T4YQO7.js → chunk-QPVYBN4J.js} +2 -2
  147. package/dist/{chunk-FUPU7Z2G.js → chunk-QRPPWLKU.js} +7 -7
  148. package/dist/{chunk-7SVSHJOO.js → chunk-QZ2XRFDP.js} +6 -6
  149. package/dist/{chunk-IE6TRMIW.js → chunk-R3BSWWGB.js} +1 -1
  150. package/dist/{chunk-CCLK2RPQ.js → chunk-R7CYBBJY.js} +13 -13
  151. package/dist/{chunk-FFRJ6QZK.js → chunk-RB3BMRNA.js} +1 -1
  152. package/dist/{chunk-FZYUTZEV.js → chunk-RFWBNKKB.js} +10 -10
  153. package/dist/{chunk-S25KELFW.js → chunk-RKSCB5BJ.js} +5 -5
  154. package/dist/{chunk-F3E3CEZM.js → chunk-RM2I6DIF.js} +1 -1
  155. package/dist/{chunk-QBMMORYP.js → chunk-ROYHU3E5.js} +1 -1
  156. package/dist/chunk-S4RD6UJU.js +8 -0
  157. package/dist/{chunk-RDETBXMP.js → chunk-SAHRIE35.js} +1 -1
  158. package/dist/{chunk-MOKABQCY.js → chunk-SAMPXZF3.js} +3 -3
  159. package/dist/{chunk-W2TPXKCV.js → chunk-SCNQK5NF.js} +1 -1
  160. package/dist/{chunk-ABTVRB23.js → chunk-SKVLTYGN.js} +1 -1
  161. package/dist/{chunk-SM3N5UJ2.js → chunk-TDUOBP55.js} +9 -9
  162. package/dist/{chunk-BG3C4ALM.js → chunk-TJ5YMXVB.js} +1 -1
  163. package/dist/{chunk-VFSAJMNX.js → chunk-TNGIXSTM.js} +1 -1
  164. package/dist/{chunk-BNPWUCZX.js → chunk-TSCJG6UM.js} +1 -1
  165. package/dist/{chunk-ETQ45TBW.js → chunk-TTYTOLVV.js} +1 -1
  166. package/dist/{chunk-DO3DSSAW.js → chunk-U73K3ICC.js} +1 -1
  167. package/dist/{chunk-FRCTA5FS.js → chunk-UAXL44HH.js} +1 -1
  168. package/dist/{chunk-CWVQH2SP.js → chunk-UDJPSHVI.js} +1 -1
  169. package/dist/{chunk-L2WBCXG7.js → chunk-UFJR63AO.js} +1 -1
  170. package/dist/{chunk-YT5HMLC7.js → chunk-UJY5RUZ5.js} +1 -1
  171. package/dist/{chunk-R6GXVLY7.js → chunk-UMIRPFQJ.js} +1 -1
  172. package/dist/{chunk-WRV6QKJN.js → chunk-UVPDEGIA.js} +1 -1
  173. package/dist/{chunk-KEVJBI5Q.js → chunk-VTCMO3K7.js} +1 -1
  174. package/dist/{chunk-2TXQCA4C.js → chunk-W24THMLI.js} +8 -8
  175. package/dist/{chunk-VXSYHTBP.js → chunk-W3454ZES.js} +1 -1
  176. package/dist/{chunk-EFO72DEI.js → chunk-WCAABJEV.js} +1 -1
  177. package/dist/{chunk-OZ4R6U2M.js → chunk-WREUA43Q.js} +1 -1
  178. package/dist/{chunk-ELPW25CA.js → chunk-XX34ZFYB.js} +4 -4
  179. package/dist/chunk-XYQFTFI7.js +24 -0
  180. package/dist/{chunk-UFX7F3KG.js → chunk-XYVFJLAU.js} +1 -1
  181. package/dist/{chunk-A7VNKVZO.js → chunk-XYXCZIJY.js} +4 -4
  182. package/dist/{chunk-ZCN5BU4U.js → chunk-YBE66FBR.js} +1 -1
  183. package/dist/{chunk-6QH7I2V5.js → chunk-Z6J4KXY3.js} +2 -2
  184. package/dist/{chunk-NY6MLFBX.js → chunk-ZBGPAUOH.js} +5 -5
  185. package/dist/{chunk-LADP6AJY.js → chunk-ZFWCTHR4.js} +7 -7
  186. package/dist/{chunk-ORV2AVIJ.js → chunk-ZRWZHWKI.js} +2 -2
  187. package/dist/data/DataTable.js +1 -1
  188. package/dist/data/EntityList.js +1 -1
  189. package/dist/data/Gantt.js +1 -1
  190. package/dist/data/Kanban.js +1 -1
  191. package/dist/data/ListFooter.js +1 -1
  192. package/dist/data/ListLoadError.js +1 -1
  193. package/dist/data/Pagination.js +1 -1
  194. package/dist/data/ResizableTable.js +1 -1
  195. package/dist/file-intake/index.js +1 -1
  196. package/dist/forms/BorderInput.js +1 -1
  197. package/dist/forms/BrandAssetEditor.js +1 -1
  198. package/dist/forms/Calendar.js +1 -1
  199. package/dist/forms/ColorPicker.js +1 -1
  200. package/dist/forms/ComposerAttachments.js +1 -1
  201. package/dist/forms/CornersInput.js +1 -1
  202. package/dist/forms/DatePicker.js +1 -1
  203. package/dist/forms/DateRangePicker.js +1 -1
  204. package/dist/forms/DateTimePicker.js +1 -1
  205. package/dist/forms/DisplayChips.js +1 -1
  206. package/dist/forms/FilePicker.js +1 -1
  207. package/dist/forms/FormErrorSummary.js +1 -1
  208. package/dist/forms/IconPicker.js +1 -1
  209. package/dist/forms/ImageFocusPoint.js +1 -1
  210. package/dist/forms/Input.js +1 -1
  211. package/dist/forms/InputNumber.js +1 -1
  212. package/dist/forms/LinkPicker.js +1 -1
  213. package/dist/forms/MediaLibrary.js +1 -1
  214. package/dist/forms/MediaUploadField.js +1 -1
  215. package/dist/forms/MediaUploadGrid.js +1 -1
  216. package/dist/forms/MediaUsedInList.js +1 -1
  217. package/dist/forms/NumericKeypad.js +1 -1
  218. package/dist/forms/PositionInput.js +1 -1
  219. package/dist/forms/RenameField.js +1 -1
  220. package/dist/forms/Select.js +1 -1
  221. package/dist/forms/SidesInput.js +1 -1
  222. package/dist/forms/Slider.js +1 -1
  223. package/dist/forms/Snippet.js +1 -1
  224. package/dist/forms/TagInput.js +1 -1
  225. package/dist/forms/TextToolbar.js +1 -1
  226. package/dist/forms/TimePicker.js +1 -1
  227. package/dist/forms/WidthsBar.js +1 -1
  228. package/dist/forms/mediaLibraryMenu.js +1 -1
  229. package/dist/forms/mediaMoveItems.js +1 -1
  230. package/dist/forms/textAlign.js +1 -1
  231. package/dist/forms/useFileIntake.js +1 -1
  232. package/dist/icons/index.js +1 -1
  233. package/dist/index.d.ts +24 -2
  234. package/dist/index.js +506 -506
  235. package/dist/locales/zh-Hans.js +1 -1
  236. package/dist/map/index.js +3 -3
  237. package/dist/model-viewer/index.js +3 -3
  238. package/dist/page-tabs/index.js +5 -5
  239. package/dist/pdf/index.js +1 -1
  240. package/dist/shell/Accordion.js +1 -1
  241. package/dist/shell/AppUpdateBanner.js +1 -1
  242. package/dist/shell/Avatar.js +1 -1
  243. package/dist/shell/Banner.js +1 -1
  244. package/dist/shell/Breadcrumbs.js +1 -1
  245. package/dist/shell/BudgetBar.js +1 -1
  246. package/dist/shell/Card.js +1 -1
  247. package/dist/shell/ColoredBadge.js +1 -1
  248. package/dist/shell/ConfirmDialog.js +1 -1
  249. package/dist/shell/ContainerFillChart.js +1 -1
  250. package/dist/shell/CountBadge.js +1 -1
  251. package/dist/shell/Dialog.js +1 -1
  252. package/dist/shell/Drawer.js +1 -1
  253. package/dist/shell/EditableGrid.js +1 -1
  254. package/dist/shell/EmptyState.js +1 -1
  255. package/dist/shell/GlobalSearch.js +1 -1
  256. package/dist/shell/HelpCenter.js +1 -1
  257. package/dist/shell/IconRail.js +1 -1
  258. package/dist/shell/ImageLightbox.js +1 -1
  259. package/dist/shell/ItemCount.js +1 -1
  260. package/dist/shell/LanguageSelect.js +1 -1
  261. package/dist/shell/Markdown.js +1 -1
  262. package/dist/shell/MetricBar.js +1 -1
  263. package/dist/shell/MetricBarLegend.js +1 -1
  264. package/dist/shell/MilestoneTimeline.js +1 -1
  265. package/dist/shell/PageHeader.js +1 -1
  266. package/dist/shell/ProductionTimeline.js +1 -1
  267. package/dist/shell/ResizeHandle.js +1 -1
  268. package/dist/shell/Result.js +1 -1
  269. package/dist/shell/SearchableSelect.js +1 -1
  270. package/dist/shell/SettingReset.js +1 -1
  271. package/dist/shell/SettingRow.js +1 -1
  272. package/dist/shell/SidebarLayout.js +1 -1
  273. package/dist/shell/SidebarNav.js +1 -1
  274. package/dist/shell/SortableList.js +1 -1
  275. package/dist/shell/Statistic.js +1 -1
  276. package/dist/shell/TimeAgo.js +1 -1
  277. package/dist/shell/TimelineTrack.js +1 -1
  278. package/dist/shell/TransferProgress.js +1 -1
  279. package/dist/shell/Tree.js +1 -1
  280. package/dist/shell/discardGuard.js +1 -1
  281. package/dist/shell/language.js +1 -1
  282. package/dist/shell/strings.d.ts +3 -0
  283. package/dist/shell/strings.js +1 -1
  284. package/dist/shell/toast.js +1 -1
  285. package/dist/telemetry/index.js +1 -1
  286. package/dist/templates/AuthScreen.js +1 -1
  287. package/dist/templates/ChatTemplate.js +1 -1
  288. package/dist/templates/CheckoutTemplate.js +1 -1
  289. package/dist/templates/DashboardTemplate.js +1 -1
  290. package/dist/templates/DataTablePage.js +1 -1
  291. package/dist/templates/EmailTemplate.js +1 -1
  292. package/dist/templates/ErrorBoundary.js +1 -1
  293. package/dist/templates/ErrorPage.js +1 -1
  294. package/dist/templates/FormLayoutPage.js +1 -1
  295. package/dist/templates/GalleryTemplate.js +1 -1
  296. package/dist/ui/index.js +1 -1
  297. package/dist/version.js +1 -1
  298. package/package.json +1 -1
  299. package/dist/Calculator-QEQU3W2L.js +0 -29
  300. package/dist/CurrencyConverter-L22FF4ST.js +0 -21
  301. package/dist/Notepad-YZOEXYE3.js +0 -24
  302. package/dist/Sidebar-UCCVJFSY.js +0 -44
  303. package/dist/chunk-ABPVCVCT.js +0 -22
  304. package/dist/chunk-BWQHABH7.js +0 -4
  305. package/dist/chunk-CILE3ZCC.js +0 -2
  306. package/dist/chunk-D4WO73XD.js +0 -91
  307. package/dist/chunk-FMLUQCFB.js +0 -2
  308. package/dist/chunk-GMLOMLCS.js +0 -24
  309. package/dist/chunk-HC5KQZFG.js +0 -8
  310. package/dist/chunk-IUVGHHR3.js +0 -1
  311. package/dist/chunk-JPE4TYRQ.js +0 -14
  312. package/dist/chunk-KGAYYSFE.js +0 -6
  313. package/dist/chunk-LQCNIQ3I.js +0 -8
  314. package/dist/chunk-LZOKBMAF.js +0 -1
  315. package/dist/chunk-OXWBSZL2.js +0 -23
  316. package/dist/chunk-PBSCF2ML.js +0 -15
  317. package/dist/chunk-QNXTVDIC.js +0 -11
  318. package/dist/chunk-UTQN5AIO.js +0 -6
  319. package/dist/chunk-XXTAMF3O.js +0 -28
@@ -1,24 +0,0 @@
1
- import{getNumberingConfigs as e}from"./chunk-ABTVRB23.js";import{SidebarLayout as t}from"./chunk-2TXQCA4C.js";import"./chunk-QWK6DRSN.js";import"./chunk-HMOKKMIV.js";import{timeAgo as r}from"./chunk-OJI4ROSD.js";import"./chunk-NHKT5IH6.js";import"./chunk-36BRD5J3.js";import"./chunk-JRQMX4PK.js";import"./chunk-LF27WIN2.js";import{AboutApp as n}from"./chunk-SOXZRLSD.js";import{useWindowManager as o,client_default as i}from"./chunk-D4WO73XD.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-YI4T5I5D.js";import"./chunk-M2TQOJ3G.js";import"./chunk-FBZUEZK7.js";import"./chunk-5A7MWTXX.js";import"./chunk-BG3C4ALM.js";import"./chunk-GMLOMLCS.js";import"./chunk-UTQN5AIO.js";import"./chunk-EIFNESXS.js";import"./chunk-SXHV5OLA.js";import"./chunk-SF4IIV5Z.js";import"./chunk-FRCTA5FS.js";import"./chunk-VWGWZY7A.js";import"./chunk-UVHXVSB2.js";import"./chunk-WRV6QKJN.js";import"./chunk-AW7TOB6N.js";import"./chunk-4U5M37SF.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as c}from"./chunk-DPFEQQQU.js";import"./chunk-LZOKBMAF.js";import"./chunk-DWGYC7OD.js";import"./chunk-YDJ5IZOU.js";import"./chunk-THAPVKEJ.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-UTISUEO4.js";import"./chunk-BUFAJJDZ.js";import{Icon as s}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-TD3ZQD5R.js";import"./chunk-F2RAIGCG.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-VY3UA6AR.js";import"./chunk-WCCS4VFE.js";import"./chunk-ZDXRSY2Y.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import{toast_default as l}from"./chunk-VQ35LXDC.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-IUVGHHR3.js";import"./chunk-C3QOHMR6.js";import{useRef as a,useEffect as p,useState as d,useCallback as m}from"react";import{useQuery as u}from"@tanstack/react-query";import{jsxs as h,Fragment as g,jsx as x}from"react/jsx-runtime";var k=[{key:"yellow",bg:"bg-yellow-100",border:"border-yellow-300",text:"text-yellow-900",dot:"bg-yellow-400"},{key:"blue",bg:"bg-blue-100",border:"border-blue-300",text:"text-blue-900",dot:"bg-blue-400"},{key:"green",bg:"bg-green-100",border:"border-green-300",text:"text-green-900",dot:"bg-green-400"},{key:"pink",bg:"bg-pink-100",border:"border-pink-300",text:"text-pink-900",dot:"bg-pink-400"},{key:"purple",bg:"bg-purple-100",border:"border-purple-300",text:"text-purple-900",dot:"bg-purple-400"},{key:"orange",bg:"bg-orange-100",border:"border-orange-300",text:"text-orange-900",dot:"bg-orange-400"},{key:"white",bg:"bg-white",border:"border-gray-300",text:"text-gray-900",dot:"bg-gray-300"}];var y={sales_order:{entityType:"order",endpoint:"/orders/sales-orders/"},purchase_order:{entityType:"purchase_order",endpoint:"/purchase-orders/"},invoice:{entityType:"invoice",endpoint:"/invoicing/invoices/"},vendor_invoice:{entityType:"vendor_invoice",endpoint:"/invoicing/vendor-invoices/"},shipment:{entityType:"shipment",endpoint:"/shipments/delivery-notes/"},receipt:{entityType:"payment",endpoint:"/invoicing/payments/"},vendor_payment:{entityType:"vendor_payment",endpoint:"/invoicing/vendor-payments/"},vendor_price_sheet:{entityType:"vendor_price_sheet",endpoint:"/pricing/manufacturer-price-sheets/"},client_price_sheet:{entityType:"price_sheet",endpoint:"/pricing/price-sheets/"},qc_report:{entityType:"qc_report",endpoint:"/qc-reports/"},warranty_claim:{entityType:"warranty_claim",endpoint:"/warranty-claims/claims/"},vendor_shipment:{entityType:"vendor_shipment",endpoint:"/shipments/goods-receipts/"}},b=/\[([ xX]?)\]/g;function f(){const{openEntity:f}=o(),{prefs:j,save:N}=c(),{data:v}=u({queryKey:["numbering-configs"],queryFn:()=>e(),retry:!1}),T=a({});p(()=>{if(!v)return;const e={};for(const t of v){const r=y[t.entity_type];if(!r)continue;const n=(t.prefix||"").replace("#","").toUpperCase();if(n&&(e[n]={...r,prefix:t.prefix}),t.alt_prefix){const n=t.alt_prefix.replace("#","").toUpperCase();n&&(e[n]={...r,prefix:t.alt_prefix})}}T.current=e},[v]);const w=j.notepad_notes||[],[C,S]=d(null),[_,D]=d(""),[O,U]=d(""),[W,R]=d("yellow"),[X,I]=d(!1),[F,V]=d(!1),Z=a(null),A=a();p(()=>{if(!C&&w.length>0){const e=w[0];S(e.id),D(e.title),U(e.content),R(e.color)}},[w.length]);const M=m(e=>{N({notepad_notes:e})},[N]),Q=m(()=>{if(!C||!X)return;const e=w.map(e=>e.id===C?{...e,title:_,content:O,color:W,updated_at:/* @__PURE__ */(new Date).toISOString()}:e);M(e),I(!1)},[C,X,_,O,W,w,M]);p(()=>{if(X)return A.current&&clearTimeout(A.current),A.current=setTimeout(Q,800),()=>{A.current&&clearTimeout(A.current)}},[X,Q]),p(()=>()=>{X&&Q()},[]);const $=e=>{X&&Q(),S(e.id),D(e.title),U(e.content),R(e.color),I(!1),V(!1)},J=e=>{const t=O.slice(0,e),r=O.slice(e).match(/^\[([ xX]?)\]/);if(!r)return;const n="x"===r[1]||"X"===r[1]?"[ ]":"[x]",o=O.slice(e+r[0].length);U(t+n+o),I(!0)},K=async(e,t)=>{const r=T.current[e];if(!r)return;const n=`${e}#${t}`;try{const{data:e}=await i.get(r.endpoint,{params:{search:n,page_size:1}}),t=(e?.results??e??[])[0];t?f(r.entityType,t.id,t,n):l.error(`${n} not found`)}catch{l.error(`Failed to look up ${n}`)}},H="Start writing...\n\nTips:\n [] Type [] for a checkbox, click to toggle\n SO#35001 Type XX#NNNNN to link entities (SO, PO, CI, VI, PL, etc.)",B=/* @__PURE__ */h(g,{children:[
2
- /* @__PURE__ */x("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */h("button",{onClick:()=>{X&&Q();const e={id:`note-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:"",content:"",color:"yellow",updated_at:/* @__PURE__ */(new Date).toISOString()},t=[e,...w];M(t),S(e.id),D(""),U(""),R("yellow"),I(!1),V(!0),setTimeout(()=>Z.current?.focus(),50)},className:"w-full flex items-center justify-center gap-2 rounded-lg bg-accent-fill text-on-accent px-3 min-h-8 py-1 text-sm font-medium hover:bg-accent-fill-hover transition-colors",children:[
3
- /* @__PURE__ */x(s,{name:"add",className:"h-4 w-4",strokeWidth:2}),"New Note"]})}),
4
- /* @__PURE__ */x("div",{className:"flex-1 overflow-y-auto",children:0===w.length?/* @__PURE__ */x("p",{className:"text-sm text-gray-400 text-center py-8 px-4",children:"No notes yet. Create one to get started."}):w.map(e=>{const t=(n=e.color,k.find(e=>e.key===n)||k[0]);var n;/* @__PURE__ */
5
- return h("button",{onClick:()=>$(e),className:"w-full text-left px-3 py-3 border-b border-line-subtle transition-colors "+(C===e.id?"bg-accent-tint":"hover:bg-row-hover"),children:[
6
- /* @__PURE__ */h("div",{className:"flex items-center gap-2",children:[
7
- /* @__PURE__ */x("div",{className:`w-3 h-3 rounded-full shrink-0 ${t.dot}`}),
8
- /* @__PURE__ */x("span",{className:"text-sm font-medium text-gray-900 truncate flex-1",children:e.title||"Untitled"})]}),
9
- /* @__PURE__ */x("p",{className:"text-xs text-ink-faintest mt-0.5 truncate ml-5",children:e.content.replace(/\[[ xX]?\]/g,"").slice(0,60)||"Empty note"}),
10
- /* @__PURE__ */x("p",{className:"text-2xs text-gray-300 mt-0.5 ml-5",children:r(e.updated_at)})]},e.id)})})]});/* @__PURE__ */
11
- return h("div",{className:"h-full",children:[
12
- /* @__PURE__ */x(n,{app:"notepad"}),
13
- /* @__PURE__ */x(t,{sidebar:B,storageKey:"notepad.sidebarWidth",defaultWidth:224,minWidth:180,maxWidth:360,children:C?/* @__PURE__ */h("div",{className:"flex-1 flex flex-col min-w-0",children:[
14
- /* @__PURE__ */h("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-200",children:[
15
- /* @__PURE__ */x("input",{value:_,onChange:e=>{D(e.target.value),I(!0)},placeholder:"Note title...",className:"flex-1 text-lg font-semibold text-gray-900 outline-none bg-transparent placeholder:text-gray-300"}),
16
- /* @__PURE__ */x("div",{className:"flex gap-1",children:k.map(e=>/* @__PURE__ */x("button",{onClick:()=>{R(e.key),I(!0)},className:`w-5 h-5 rounded-full border-2 transition-all ${e.dot} ${W===e.key?"border-gray-600 scale-110":"border-transparent hover:border-gray-400"}`,title:e.key},e.key))}),
17
- /* @__PURE__ */x("button",{onClick:()=>(e=>{const t=w.filter(t=>t.id!==e);if(M(t),C===e){const e=t[0];e?$(e):(S(null),D(""),U(""))}})(C),title:"Delete note",className:"p-1 rounded text-gray-300 hover:text-red-500 transition-colors",children:/* @__PURE__ */x(s,{name:"trash",className:"h-4 w-4",strokeWidth:1.5})})]}),F?/* @__PURE__ */x("textarea",{ref:Z,value:O,onChange:e=>{U(e.target.value),I(!0)},onBlur:()=>{V(!1),X&&Q()},placeholder:H,className:"flex-1 p-4 text-sm text-gray-700 outline-none resize-none bg-transparent leading-relaxed placeholder:text-gray-300 font-mono"}):/* @__PURE__ */x("div",{onClick:()=>{V(!0),setTimeout(()=>Z.current?.focus(),50)},className:"flex-1 p-4 text-sm text-gray-700 overflow-y-auto leading-relaxed cursor-text",children:O?(e=>{if(!e)return[];const t=e.split("\n");return t.map((e,r)=>{const n=[];let o=0;const i=[],c=/([A-Z]{2,4})#(\d{4,6})/g;let l;for(;null!==(l=c.exec(e));){const e=l[1],t=l[2];if(T.current[e]){const n=l.index,o=l[0];i.push({idx:n,len:o.length,render:()=>/* @__PURE__ */x("button",{onClick:()=>K(e,t),className:"text-blue-600 hover:text-blue-800 hover:underline font-medium cursor-pointer",children:o},`ref-${r}-${n}`)})}}b.lastIndex=0;let a=0;for(let e=0;e<r;e++)a+=t[e].length+1;for(;null!==(l=b.exec(e));){const e="x"===l[1]||"X"===l[1],t=l.index,n=a+t;i.push({idx:t,len:l[0].length,render:()=>/* @__PURE__ */x("button",{onClick:()=>J(n),className:`inline-flex items-center justify-center w-4 h-4 rounded border ${e?"bg-blue-500 border-blue-500 text-white":"border-gray-400 bg-white hover:border-blue-400"} cursor-pointer align-text-bottom mr-0.5`,children:e&&/* @__PURE__ */x(s,{name:"check",className:"w-3 h-3",strokeWidth:3})},`cb-${r}-${t}`)})}i.sort((e,t)=>e.idx-t.idx);for(const t of i)t.idx>o&&n.push(/* @__PURE__ */x("span",{children:e.slice(o,t.idx)},`t-${r}-${o}`)),n.push(t.render()),o=t.idx+t.len;o<e.length&&n.push(/* @__PURE__ */x("span",{children:e.slice(o)},`t-${r}-${o}`)),0===n.length&&n.push(/* @__PURE__ */x("span",{children:"​"},`empty-${r}`));const p=/^\[x\]/i.test(e.trimStart());/* @__PURE__ */
18
- return x("div",{className:p?"line-through text-gray-400":"",children:n},r)})})(O):/* @__PURE__ */x("p",{className:"text-gray-300 whitespace-pre-line",children:H})}),
19
- /* @__PURE__ */h("div",{className:"px-4 min-h-8 py-1 border-t border-line-subtle flex items-center gap-4 text-2xs text-ink-faintest",children:[
20
- /* @__PURE__ */x("span",{children:"[] checkbox"}),
21
- /* @__PURE__ */x("span",{children:"SO#35001 entity link"}),
22
- /* @__PURE__ */x("span",{className:"ml-auto",children:F?"Editing":"Click to edit"})]})]}):/* @__PURE__ */x("div",{className:"flex-1 flex items-center justify-center",children:/* @__PURE__ */h("div",{className:"text-center text-gray-400",children:[
23
- /* @__PURE__ */x(s,{name:"page",className:"h-12 w-12 mx-auto mb-3 text-gray-300",strokeWidth:1}),
24
- /* @__PURE__ */x("p",{className:"text-sm",children:"Select a note or create a new one"})]})})})]})}export{f as default};
@@ -1,44 +0,0 @@
1
- import{useAuth as e,parseOpenSections as t,readStored as r,RAIL_OPEN_SECTIONS_KEY as n,RAIL_WIDTH_KEY as i,toggleOpenSection as a,writeStored as o}from"./chunk-AQH6MAYK.js";import{ResizeHandle as l}from"./chunk-HMOKKMIV.js";import{openGlobalSearch as s}from"./chunk-2J3C2RR4.js";import{partitionNav as c,visibleNavChildren as d,visibleSectionItems as m,rowsContainRoute as u}from"./chunk-HGOWQO63.js";import{BrandMark as h}from"./chunk-MI67DI3H.js";import{IconButton_default as p}from"./chunk-NWS5G7FE.js";import{RAIL_MENU_GAP as b,navSections as f,startMenuCategories as g,RAIL_W as x,TAB_STRIP_H as k,RAIL_COLLAPSED_INSET as y,RAIL_MAX_W as v,RAIL_MIN_W as N,navIcons as j,sectionIcons as w}from"./chunk-4LXCCZDM.js";import"./chunk-5A7MWTXX.js";import"./chunk-UVHXVSB2.js";import"./chunk-2QY5BJLA.js";import{PopupMenu as C,PopupMenuItem as S,PopupMenuDivider as $}from"./chunk-THAPVKEJ.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-BUFAJJDZ.js";import{Icon as A}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-F2RAIGCG.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-VY3UA6AR.js";import"./chunk-WCCS4VFE.js";import"./chunk-ZDXRSY2Y.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import{useShellStrings as L}from"./chunk-IUVGHHR3.js";import"./chunk-C3QOHMR6.js";import{useMemo as z,useState as W,useRef as H,useEffect as I,isValidElement as R,cloneElement as T}from"react";import{jsx as K,jsxs as M,Fragment as D}from"react/jsx-runtime";var V="undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform),J=150,O=250;function P(e,t,r){const n=Math.max(8,r-t.bottom);return{left:e+b,bottom:n,maxHeight:r-n-8,overflowY:"auto"}}var Q=(e,t)=>["flex h-(--row-height-menu) w-full items-center gap-3 rounded-md px-3 text-left text-sm font-medium transition-colors",t?"justify-center px-0":"",e?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-100 hover:text-gray-900"].join(" "),U="flex size-8 shrink-0 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900",Y="flex size-[18px] shrink-0 items-center justify-center [&>svg]:size-[18px]";function E({open:e,children:t}){const r=H(null);return I(()=>{r.current?.toggleAttribute("inert",!e)},[e]),/* @__PURE__ */K("div",{ref:r,className:"grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none",style:{gridTemplateRows:e?"1fr":"0fr",opacity:e?1:0},"aria-hidden":!e,"data-fold":e?"open":"closed",children:/* @__PURE__ */K("div",{className:"min-h-0 overflow-hidden",children:t})})}function F({open:e}){/* @__PURE__ */
2
- return K(A,{name:"chevron-down",className:"size-4 shrink-0 transition-transform "+(e?"rotate-180":""),strokeWidth:2,"aria-hidden":"true"})}function B({dir:e}){/* @__PURE__ */
3
- return K(A,"left"===e?{name:"chevron-double-left",className:"size-[18px] shrink-0",strokeWidth:1.5,"aria-hidden":"true"}:{name:"chevron-double-right",className:"size-[18px] shrink-0",strokeWidth:1.5,"aria-hidden":"true"})}function G({className:e}){/* @__PURE__ */
4
- return K(A,{name:"search",className:e,strokeWidth:2,"aria-hidden":"true"})}var X=e=>.75+1.75*e+"rem";function Z({width:b,openWidth:J=x,collapsed:O,onToggleCollapsed:Z,onResize:_,onHome:q,onOpen:ee,activeRoute:te,profile:re,user:ne,onLogout:ie,onSwitchToDesktop:ae,onReportBug:oe,onClose:le,navSections:se=f,navIcons:ce=j,sectionIcons:de=w,categories:me=g,productName:ue,productIcon:he,tagline:pe,adaptiveLogo:be=!1,logoHasAlpha:fe=null,logoIsLight:ge=null}){const xe=L().layout,{hasAnyPerm:ke}=e(),ye=z(()=>c(se,me,ke),[se,me,ke]),[ve,Ne]=W(()=>t(r(n))),je=z(()=>[...ye.topItems.filter(e=>d(e,ke).length>0).map(e=>`child:${e.to}`),...[...ye.erpSections,...ye.systemSections,...ye.virtualSections,...ye.footerSections].map(e=>e.label)],[ye,ke]),we=(e,t=je)=>Ne(r=>{const i=a(r,e,t);return o(n,JSON.stringify([...i])),i}),[Ce,Se]=W(!1),$e=H(null),Ae=O&&!le,[Le,ze]=W(!1),We=H("pointer"),He=H(void 0),Ie=H(!1),Re=H(null),Te=()=>{clearTimeout(He.current),He.current=void 0},Ke=e=>{Te(),We.current=e,ze(!0)},Me=()=>{Te(),ze(!1)};I(()=>{Te(),ze(!1)},[O]),I(()=>()=>Te(),[]),I(()=>{if(!Le)return;const e=e=>{const t=e.target;t&&(Re.current?.contains(t)||t.closest?.('[data-popup-menu-tree], [role="menu"]'))||(Te(),ze(!1))};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[Le]);const De=O&&!Le,Ve=O&&Le?J:b,Je=(e,t)=>{Me(),e.onSelect?e.onSelect():ee(e.to,!!t&&(e=>e.metaKey||e.ctrlKey||1===e.button)(t))},Oe=(e,t)=>{const r=t[e];/* @__PURE__ */
5
- return K("span",{className:Y,"aria-hidden":"true",children:r&&R(r)?T(r,{className:"size-[18px]"}):r})},Pe=e=>e.filter(e=>d(e,ke).length>0).map(e=>`child:${e.to}`),Qe=(e,t,r=je)=>{const n=d(e,ke),i=e.menuLabel??e.label;if(n.length>0){const a=`child:${e.to}`,o=ve.has(a),l=!o&&u(n,te,ke);/* @__PURE__ */
6
- return M("div",{children:[
7
- /* @__PURE__ */M("button",{type:"button",onClick:()=>we(a,r),"aria-expanded":o,className:Q(l,!1),style:t>0?{paddingLeft:X(t)}:void 0,children:[0===t&&Oe(e.to,ce),
8
- /* @__PURE__ */K("span",{className:"min-w-0 flex-1 truncate",children:i}),
9
- /* @__PURE__ */K(F,{open:o})]}),
10
- /* @__PURE__ */K(E,{open:o,children:/* @__PURE__ */K("div",{className:"space-y-0.5 pt-0.5",children:n.map(e=>Qe(e,t+1,Pe(n)))})}),e.dividerAfter&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:X(t)},"aria-hidden":"true"})]},e.to)}const a=e.to===te;/* @__PURE__ */
11
- return M("div",{children:[
12
- /* @__PURE__ */M("button",{type:"button",onClick:t=>Je(e,t),onAuxClick:t=>{1===t.button&&Je(e,t)},"aria-current":a?"page":void 0,className:Q(a,!1),style:t>0?{paddingLeft:X(t)}:void 0,children:[0===t&&Oe(e.to,ce),
13
- /* @__PURE__ */K("span",{className:"min-w-0 flex-1 truncate",children:i})]}),e.dividerAfter&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:X(t)},"aria-hidden":"true"})]},e.to)},Ue=(e,t)=>{const r=t?e.items:m(e,ke);if(0===r.length)return null;const n="icon"in e&&e.icon?/* @__PURE__ */K("span",{className:Y,"aria-hidden":"true",children:e.icon}):Oe(e.label,de),i=e.menuLabel??e.label,a=u(r,te,ke),o="dividerAfter"in e&&e.dividerAfter;if(De)/* @__PURE__ */
14
- return M("div",{children:[
15
- /* @__PURE__ */K("button",{type:"button",title:i,"aria-label":i,"aria-expanded":!1,onClick:()=>{ve.has(e.label)||we(e.label),Ke("tap")},className:Q(a,!0),children:n}),o&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label);const l=ve.has(e.label),s=`rosh-rail-${e.label.replace(/[^a-z0-9]+/gi,"-").toLowerCase()}`;/* @__PURE__ */
16
- return M("div",{children:[
17
- /* @__PURE__ */M("button",{type:"button",onClick:()=>we(e.label),"aria-expanded":l,"aria-controls":s,className:Q(!l&&a,!1),children:[n,
18
- /* @__PURE__ */K("span",{className:"min-w-0 flex-1 truncate",children:i}),
19
- /* @__PURE__ */K(F,{open:l})]}),
20
- /* @__PURE__ */K(E,{open:l,children:/* @__PURE__ */K("div",{id:s,role:"group","aria-label":i,className:"space-y-0.5 pt-0.5",children:r.map(e=>Qe(e,1,Pe(r)))})}),o&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label)},Ye=re?.first_name?`${re.first_name} ${re.last_name||""}`.trim():ne?.email||"",Ee=(re?.first_name?.charAt(0)||ne?.email?.charAt(0)||"?").toUpperCase(),Fe=re?.avatar_url?/* @__PURE__ */K("img",{src:re.avatar_url,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):/* @__PURE__ */K("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-blue-600 text-xs font-semibold text-white",children:Ee}),Be=Ce?$e.current?.getBoundingClientRect():void 0,Ge=De?"":"px-3",Xe=De?{paddingInline:y}:void 0,Ze=`${O?xe.expandSidebar:xe.collapseSidebar} (${V?"⌘":"Ctrl"} .)`,_e=q?{run:q,label:xe.goHome,title:xe.goHome}:le?null:{run:Z,label:O?xe.expandSidebar:xe.collapseSidebar,title:Ze},qe=/* @__PURE__ */M(D,{children:[he&&/* @__PURE__ */K(h,{src:he,alt:"",slot:"compact",surface:"light",adaptive:be,hasAlpha:fe,isLight:ge,size:28,decorative:!0}),!De&&/* @__PURE__ */M("span",{className:"min-w-0 text-left leading-tight",children:[
21
- /* @__PURE__ */K("span",{className:"block truncate text-base font-bold tracking-wide text-gray-900",children:ue??"Apps"}),pe&&/* @__PURE__ */K("span",{className:"block truncate text-2xs font-medium text-gray-500",children:pe})]})]}),et=ye.erpSections.length>0||ye.systemSections.length>0||ye.virtualSections.length>0;/* @__PURE__ */
22
- return M("aside",{ref:Re,"aria-label":xe.navLabel,"data-rail-peek":Le?"":void 0,className:`fixed left-0 top-0 z-(--z-sidebar) flex h-dvh flex-col border-r border-line bg-surface text-ink-strong ${O?"overflow-hidden transition-[width] duration-150 ease-out motion-reduce:transition-none":""} ${Le?"rounded-r-(--radius-panel)":""}`,style:{width:Ve,boxShadow:Le?"var(--elevation-popup)":void 0},onPointerEnter:e=>{"touch"!==e.pointerType&&(Ie.current=!0,Ae&&(Le?Te():(Te(),He.current=setTimeout(()=>Ke("pointer"),150))))},onPointerLeave:e=>{"touch"!==e.pointerType&&(Ie.current=!1,Ae&&(Te(),Le&&!Ce&&"pointer"===We.current&&(He.current=setTimeout(Me,250))))},onFocus:e=>{Ae&&!Le&&(e=>{try{return e.matches(":focus-visible")}catch{return!1}})(e.target)&&Ke("focus")},onBlur:e=>{if(!Le||"focus"!==We.current)return;const t=e.relatedTarget;t&&Re.current?.contains(t)||Ce||Ie.current||Me()},onKeyDown:e=>{"Escape"===e.key&&Le&&Me()},children:[
23
- /* @__PURE__ */M("div",{className:"flex shrink-0 items-center border-b border-gray-200 "+(De?"justify-center":"justify-between gap-2 pl-4 pr-2"),style:{height:k},children:[_e?/* @__PURE__ */K("button",{type:"button",onClick:_e.run,"aria-label":_e.label,title:_e.title,className:"flex min-w-0 items-center gap-2 rounded-md transition-colors hover:bg-gray-100 "+(De?"justify-center p-0.5":"-ml-1 p-1"),children:qe}):/* @__PURE__ */K("span",{className:"flex min-w-0 items-center gap-2",children:qe}),le?/* @__PURE__ */K(p,{onClick:le,"aria-label":xe.closeMenu,children:/* @__PURE__ */K(A,{name:"close",className:"size-[18px]",strokeWidth:1.5,"aria-hidden":"true"})}):O?Le&&
24
- /* @__PURE__ */K("button",{type:"button",onClick:()=>{Me(),Z()},"aria-label":xe.keepSidebarOpen,title:`${xe.keepSidebarOpen} (${V?"⌘":"Ctrl"} .)`,className:U,children:/* @__PURE__ */K(B,{dir:"right"})}):/* @__PURE__ */K("button",{type:"button",onClick:Z,"aria-label":xe.collapseSidebar,title:`${xe.collapseSidebar} (${V?"⌘":"Ctrl"} .)`,className:U,children:/* @__PURE__ */K(B,{dir:"left"})})]}),
25
- /* @__PURE__ */K("div",{className:`shrink-0 pt-3 ${Ge}`,style:Xe,children:De?/* @__PURE__ */K("button",{type:"button",onClick:s,"aria-label":xe.search,title:`${xe.search} (${V?"⌘K":"Ctrl K"})`,className:Q(!1,!0),children:/* @__PURE__ */K(G,{className:"size-[18px] shrink-0"})}):/* @__PURE__ */M("button",{type:"button",onClick:s,className:"flex h-(--row-height-menu) w-full items-center gap-2 rounded-md border border-line bg-surface px-3 text-left transition-colors hover:bg-gray-100",children:[
26
- /* @__PURE__ */K(G,{className:"size-3.5 text-gray-500"}),
27
- /* @__PURE__ */K("span",{className:"min-w-0 flex-1 truncate text-sm text-ink-faint",children:xe.search}),
28
- /* @__PURE__ */K("kbd",{className:"rounded border border-line bg-gray-100 px-2 py-0.5 font-mono text-2xs font-semibold text-ink-faint",children:V?"⌘K":"Ctrl K"})]})}),
29
- /* @__PURE__ */M("nav",{"aria-label":xe.navLabel,className:`min-h-0 flex-1 overflow-y-auto pb-4 pt-3 ${Ge} ${De?"space-y-1":"space-y-0.5"}`,style:Xe,children:[De&&/* @__PURE__ */K("button",{type:"button",onClick:Z,"aria-label":xe.expandSidebar,title:`${xe.expandSidebar} (${V?"⌘":"Ctrl"} .)`,className:`${Q(!1,!0)} mb-3`,children:/* @__PURE__ */K(B,{dir:"right"})}),ye.topItems.map(e=>{if(!De)return Qe(e,0);const t=d(e,ke),r=e.to===te||u(t,te,ke),n=e.menuLabel??e.label;/* @__PURE__ */
30
- return M("div",{children:[
31
- /* @__PURE__ */K("button",{type:"button",title:n,"aria-label":n,onClick:r=>{if(0===t.length)return void Je(e,r);const n=`child:${e.to}`;ve.has(n)||we(n),Ke("tap")},className:Q(r,!0),children:Oe(e.to,ce)}),e.dividerAfter&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.to)}),ye.topItems.length>0&&et&&!ye.topItems[ye.topItems.length-1].dividerAfter&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.erpSections.map(e=>Ue(e,!1)),ye.systemSections.map(e=>Ue(e,!1)),ye.virtualSections.map(e=>Ue(e,!0)),ye.footerSections.length>0&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.footerSections.map(e=>Ue(e,!1))]}),
32
- /* @__PURE__ */K("div",{className:`shrink-0 border-t border-gray-200 py-2 ${Ge}`,style:Xe,children:/* @__PURE__ */M("button",{ref:$e,type:"button",onClick:()=>Se(e=>!e),"aria-haspopup":"menu","aria-expanded":Ce,"aria-label":De?xe.accountMenu(Ye):void 0,className:"flex w-full items-center gap-3 rounded-md hover:bg-gray-100 "+(De?"justify-center py-2":"px-2 py-2"),children:[Fe,!De&&/* @__PURE__ */M("span",{className:"min-w-0 flex-1 text-left",children:[
33
- /* @__PURE__ */K("span",{className:"block truncate text-sm font-semibold text-ink-strong",children:Ye}),ne?.email&&Ye!==ne.email&&/* @__PURE__ */K("span",{className:"block truncate text-2xs text-ink-faint",children:ne.email})]})]})}),_&&!O&&!le&&/* @__PURE__ */K(l,{side:"left",width:b,onResize:_,min:N,max:v,defaultWidth:x,storageKey:i,label:xe.resizeSidebar}),Ce&&Be&&/* @__PURE__ */M(C,{portal:!0,minWidth:224,onClose:()=>{Se(!1),Le&&"pointer"===We.current&&!Ie.current&&Me()},style:P(Ve,Be,window.innerHeight),children:[De&&/* @__PURE__ */M("div",{className:"border-b border-line px-3 py-3",children:[
34
- /* @__PURE__ */K("p",{className:"truncate text-sm font-semibold text-gray-800",children:Ye}),ne?.email&&/* @__PURE__ */K("p",{className:"truncate text-xs text-gray-500",children:ne.email})]}),
35
- /* @__PURE__ */M(S,{onClick:()=>{Se(!1),Me(),ee("/profile",!1)},children:[
36
- /* @__PURE__ */K(A,{name:"account",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.profile]}),ye.footerItems.map(e=>/* @__PURE__ */M(S,{onClick:()=>{Se(!1),Je(e)},children:[
37
- /* @__PURE__ */K("span",{className:"h-4 w-4 [&>svg]:size-4","aria-hidden":"true",children:ce[e.to]}),e.menuLabel??e.label]},e.to)),oe&&/* @__PURE__ */M(S,{onClick:()=>{Se(!1),Me(),oe()},children:[
38
- /* @__PURE__ */K(A,{name:"error",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.reportIssue]}),
39
- /* @__PURE__ */K($,{}),ae&&/* @__PURE__ */M(D,{children:[
40
- /* @__PURE__ */M(S,{onClick:()=>{Se(!1),Me(),ae()},children:[
41
- /* @__PURE__ */K(A,{name:"desktop",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.switchToDesktop]}),
42
- /* @__PURE__ */K($,{})]}),
43
- /* @__PURE__ */M(S,{danger:!0,onClick:()=>{Se(!1),Me(),ie()},children:[
44
- /* @__PURE__ */K(A,{name:"logout",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.signOut]})]})]})}export{O as RAIL_PEEK_CLOSE_MS,J as RAIL_PEEK_OPEN_MS,P as accountMenuPosition,Z as default};
@@ -1,22 +0,0 @@
1
- import{ChartBrush as t}from"./chunk-MOKABQCY.js";import{ChartDot as e}from"./chunk-CK2YOGUS.js";import{stepPath as a,curvePath as r,areaBetween as o,areaFrom as l}from"./chunk-VFC6QUEN.js";import{ChartDefs as n,MOTION as i,stagger as s,fillFor as c,dashFor as d,maskId as m}from"./chunk-465RRWBY.js";import{ChartSkeleton as h}from"./chunk-ZNV75GAG.js";import{useHighlight as u,highlightOpacity as f}from"./chunk-CNYAHYE6.js";import{useDragZoom as p,DragBand as g,ChartZoomSummary as y,tooltipBesideBand as k}from"./chunk-KNZ7YTFH.js";import{pairedAxes as x,niceAxis as v,niceMax as b,linearScale as M,axisGutter as N,bandScale as w,ladderScale as j}from"./chunk-2JWPNR2U.js";import{ChartTooltip as $}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as V,CHART_INK as A,STATUS_VARS as z}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as R}from"./chunk-TWVUQUUD.js";import{usePlotWidth as W}from"./chunk-MAFUXCPZ.js";import{useShellStrings as C,useShellLocale as L}from"./chunk-IUVGHHR3.js";import{formatPercent as S,formatPlain as D}from"./chunk-C3QOHMR6.js";import{useRef as E,useState as T,useId as U,useEffect as I}from"react";import{jsx as F,jsxs as P}from"react/jsx-runtime";var O=12,Y=16,B=26,H=52,Q=t=>"number"==typeof t&&Number.isFinite(t);function G({series:G,labels:K,height:Z=200,stacked:J=!1,stackMode:X="value",levels:q,curve:_="linear",tension:tt=0,max:et,yTickCount:at=4,formatValue:rt,formatTooltipValue:ot,tooltipLabels:lt,yAxisLabel:nt,referenceLines:it,labelEndpoints:st=!1,dots:ct,dotVariant:dt="border",pulse:mt=!1,brush:ht=!1,range:ut,onRangeChange:ft,zoomable:pt=!0,columnStrip:gt,onSelect:yt,loading:kt=!1,animate:xt=!0,reveal:vt="left-to-right",fillVariant:bt="gradient",gridStyle:Mt="solid",width:Nt,className:wt,emptyLabel:jt}){const $t=C().charts,Vt=L(),At=rt??(t=>D(t,Vt)),zt=ot??At,Rt=jt??$t.noData,Wt=E(null),Ct=W(Wt),Lt=Nt??Ct,[St,Dt]=T(null),[Et,Tt]=T(null),{highlighted:Ut}=u(),It=U(),Ft=ut??Et,Pt=p(ht&&Ft?Ft[1]-Ft[0]+1:K.length,pt);if(I(()=>{if(null!==St)return R(t=>"Escape"===t.key&&(Dt(null),!0))},[St]),kt)/* @__PURE__ */
2
- return F("div",{className:wt,ref:Wt,children:/* @__PURE__ */F(h,{height:Z,width:Nt??Ct})});const Ot=K,Yt=ut??Et??[0,Math.max(0,Ot.length-1)],[Bt,Ht]=Yt,Qt=t=>Pt.slice(ht?t.slice(Bt,Ht+1):t),Gt=lt?Qt(lt):void 0,Kt=G.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(Q)).map(t=>({...t,data:Qt(t.data),pointTones:t.pointTones?Qt(t.pointTones):void 0})),Zt=t=>(ht?Bt:0)+(Pt.view?.[0]??0)+t;if(K=Qt(Ot),0===Kt.length||0===K.length)/* @__PURE__ */
3
- return F("div",{className:wt,ref:Wt,children:/* @__PURE__ */F("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:Z},children:Rt})});const Jt=K.map((t,e)=>Kt.reduce((t,a)=>t+(Q(a.data[e])?a.data[e]:0),0)),Xt=(t,e)=>Jt[e]>0?t/Jt[e]:null,qt=[];if(J){let t=K.map(()=>0);for(const e of Kt)t=t.map((t,a)=>t+(Q(e.data[a])?e.data[a]:0)),qt.push("percent"===X?t.map((t,e)=>Xt(t,e)):[...t])}const _t=!!q&&q.length>0,te=t=>"right"===t.axis,ee=!J&&!_t&&void 0===et&&Kt.some(te)&&Kt.some(t=>!te(t)),ae=gt&&!J?gt:null,re=t=>!!ae&&"column"===t.mode,oe=(ee?Kt.filter(t=>!te(t)):Kt).filter(t=>!re(t)),le=ee?Kt.filter(te).flatMap(t=>t.data.filter(Q)):[],ne=J?(qt.at(-1)??[]).filter(Q):oe.flatMap(t=>t.data.filter(Q)),ie=ee?x([Math.min(0,...ne),Math.max(0,...ne)],[Math.min(0,...le),Math.max(0,...le)],{intervals:at+1,integerLeft:ne.every(Number.isInteger),integerRight:le.every(Number.isInteger)}):null,se=ie?ie.left:J&&"percent"===X||_t||void 0!==et?null:v(J?0:Math.min(0,...ne),Math.max(0,...ne),{intervals:at+1,integer:ne.every(Number.isInteger)}),ce=se?se.lo:0,de=J&&"percent"===X?1:se?se.hi:et??b(Math.max(...ne,0)),me=J&&"percent"===X?t=>S(Math.round(100*t),0,Vt):At,he=_t?q:se?se.ticks:M([ce,de],{from:0,to:1}).ticks(at+1),ue=N(he.map(me),H),fe=ie?N(ie.right.ticks.map(At),Y):Y,pe={left:ue,right:Math.max(ue+1,Lt-fe),top:O,bottom:Z-B},ge=w(K.length,{from:pe.left,to:pe.right}),ye=_t?j(q,{from:pe.bottom,to:pe.top}):null,ke=M([ce,de],{from:pe.bottom,to:pe.top}),xe=ke(Math.max(ce,0)),ve=t=>ye?ye(t):ke(t),be=Kt.filter(re),Me=Math.max(0,...K.map((t,e)=>be.reduce((t,a)=>t+Math.max(0,Q(a.data[e])?a.data[e]:0),0))),Ne=t=>xe-(Me>0?t/Me:0)*(pe.bottom-pe.top)*(ae??0),we=ie?M([ie.right.lo,ie.right.hi],{from:pe.bottom,to:pe.top}):null,je=t=>we&&te(t)?we:ve,$e=ye?ye.levels.map(t=>({value:t,y:ye(t)})):he.map(t=>({value:t,y:ke(t)})),Ve=t=>e=>{e.preventDefault(),Dt(e=>{const a=(e??0)+t;return Math.min(K.length-1,Math.max(0,a))})},Ae=Math.max(1,Math.ceil(K.length/Math.max(1,Math.floor(Lt/96))));/* @__PURE__ */
4
- return P("div",{className:`relative ${wt??""}`,ref:Wt,children:[
5
- /* @__PURE__ */P("svg",{width:"100%",height:Z,viewBox:`0 0 ${Lt} ${Z}`,role:"img","aria-label":$t.overIntervals(Kt.map(t=>t.label),K.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Dt(null),onBlur:()=>Dt(null),style:pt?{userSelect:"none",touchAction:"pan-y"}:void 0,onKeyDown:t=>{if(yt&&null!==St&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void yt(Zt(St));"ArrowRight"===t.key&&Ve(1)(t),"ArrowLeft"===t.key&&Ve(-1)(t)},children:[
6
- /* @__PURE__ */F("defs",{children:/* @__PURE__ */F("clipPath",{id:It,children:/* @__PURE__ */F("rect",{x:pe.left,y:pe.top,width:pe.right-pe.left,height:pe.bottom-pe.top})})}),
7
- /* @__PURE__ */F(n,{id:It,fills:Kt.map((t,e)=>({color:V(t.slot,t.color,t.tone),variant:t.fillVariant??bt})),fadeFrom:J?.42:.3,reveal:!!xt&&vt}),$e.map(t=>/* @__PURE__ */F("line",{x1:pe.left,y1:t.y,x2:pe.right,y2:t.y,stroke:A.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===Mt?"3 3":void 0},`grid-${t.value}`)),
8
- /* @__PURE__ */F("line",{x1:pe.left,y1:xe,x2:pe.right,y2:xe,stroke:A.axis,strokeWidth:1,shapeRendering:"crispEdges"}),$e.map(t=>/* @__PURE__ */F("text",{x:pe.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:me(t.value)},`ytick-${t.value}`)),ie&&$e.map((t,e)=>/* @__PURE__ */F("text",{x:pe.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:At(ie.right.ticks[e])},`ytick-r-${t.value}`)),nt&&/* @__PURE__ */F("text",{x:12,y:(pe.top+pe.bottom)/2,transform:`rotate(-90 12 ${(pe.top+pe.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:A.label,children:nt}),
9
- /* @__PURE__ */F("g",{clipPath:`url(#${It})`,mask:xt&&vt?`url(#${m(It)})`:void 0,children:Kt.map((t,e)=>{const n=V(t.slot,t.color,t.tone),m=t.mode??(J?"area":"line"),h=f(t.key,Ut);if("step"===m){const e=K.map((e,a)=>({start:ge(a),end:ge.end(a),value:t.data[a]})).filter(t=>Q(t.value)).map(e=>({start:e.start,end:e.end,y:je(t)(e.value)}));/* @__PURE__ */
10
- return F("path",{d:a(e),fill:"none",stroke:n,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:h??void 0,className:"rosh-viz-mark"},t.key)}const u=K.map((a,r)=>{const o=J?qt[e]?.[r]:t.data[r];return Q(o)?[ge.center(r),je(t)(o)]:null}).filter(t=>null!==t);if(0===u.length)return null;if("column"===m){const a=Math.max(1,.62*ge.bandwidth),r="solid"===t.fillVariant,o=je(t);return re(t)?/* @__PURE__ */F("g",{opacity:h??void 0,className:"rosh-viz-mark",children:K.map((o,l)=>{const i=t.data[l];if(!Q(i)||i<=0)return null;const s=((t,e)=>be.slice(0,be.findIndex(e=>e.key===Kt[t]?.key)).reduce((t,a)=>t+Math.max(0,Q(a.data[e])?a.data[e]:0),0))(e,l),c=Ne(s+i),d=Ne(s)-(s>0?1:0);/* @__PURE__ */
11
- return F("rect",{x:ge.center(l)-a/2,y:c,width:a,height:Math.max(0,d-c),rx:2,fill:t.pointTones?.[l]?z[t.pointTones[l]]:n,fillOpacity:r?1:.55},l)})},t.key):/* @__PURE__ */F("g",{opacity:h??void 0,className:"rosh-viz-mark",children:K.map((l,c)=>{const d=J?qt[e]?.[c]:t.data[c];if(!Q(d))return null;const m=o(d);/* @__PURE__ */
12
- return F("rect",{x:ge.center(c)-a/2,y:Math.min(m,xe),width:a,height:Math.abs(xe-m),rx:2,fill:n,fillOpacity:r?1:.35,className:xt?i.rise:void 0,style:xt?s(c,26):void 0},c)})},t.key)}const p=r(u,_,tt),g=J&&e>0?K.map((t,a)=>[ge.center(a),ve(qt[e-1]?.[a]??0)-2]):null,y=g?o(p,g):l(p,u,xe);/* @__PURE__ */
13
- return P("g",{opacity:h??void 0,className:"rosh-viz-mark",children:[("area"===m||J)&&
14
- /* @__PURE__ */F("path",{d:y,fill:c(It,e,t.fillVariant??bt,n),stroke:"none"}),
15
- /* @__PURE__ */F("path",{d:p,fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:d(t.stroke??(t.forecast?"animated-dashed":"solid")),className:xt&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?i.march:void 0})]},t.key)})}),it?.map((t,e)=>{const a=t.color??z[t.tone??"critical"],r=ve(t.value);/* @__PURE__ */
16
- return P("g",{children:[
17
- /* @__PURE__ */F("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */F("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Kt.map((t,a)=>{if("column"===t.mode)return null;const r=ct??(st?"last":"none"),o=V(t.slot,t.color,t.tone),l=[...t.data].map(Q).lastIndexOf(!0),n="all"===r?K.map((t,e)=>e).filter(e=>Q(J?qt[a]?.[e]:t.data[e])):l>=0?[l]:[];/* @__PURE__ */
18
- return P("g",{children:[n.map(r=>{const n=J?qt[a]?.[r]:t.data[r];return Q(n)?/* @__PURE__ */F(e,{cx:ge.center(r),cy:je(t)(n),color:o,variant:dt,pulse:mt&&r===l,title:`${K[r]}: ${t.label} ${At(n)}`},r):null}),st&&l>=0&&Q(J?qt[a]?.[l]:t.data[l])&&/* @__PURE__ */F("text",{x:ge.center(l)-10,y:je(t)(J?qt[a]?.[l]:t.data[l])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:At(J?qt[a]?.[l]:t.data[l])})]},`dots-${t.key}`)}),K.map((t,e)=>e%Ae===0?/* @__PURE__ */F("text",{x:ge.center(e),y:Z-8,textAnchor:"middle",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==St&&/* @__PURE__ */F("line",{x1:ge.center(St),y1:pe.top,x2:ge.center(St),y2:pe.bottom,stroke:A.axis,strokeWidth:1}),ae&&Me>0&&
19
- /* @__PURE__ */P("g",{pointerEvents:"none","data-column-strip":"true",children:[
20
- /* @__PURE__ */F("line",{x1:pe.left,y1:Ne(Me),x2:pe.right,y2:Ne(Me),stroke:A.grid,strokeWidth:1,strokeDasharray:"2 3",shapeRendering:"crispEdges"}),
21
- /* @__PURE__ */F("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:At(Me)})]}),Pt.drag&&/* @__PURE__ */F(g,{x0:ge(Pt.drag[0]),x1:ge(Pt.drag[1])+ge.bandwidth,top:pe.top,bottom:pe.bottom}),K.map((t,e)=>/* @__PURE__ */F("rect",{x:ge(e),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>Dt(e),onPointerDown:()=>Pt.press(e),onPointerEnter:()=>Pt.over(e),onPointerUp:Pt.release,onClick:yt?()=>yt(Zt(e)):void 0,style:yt?{cursor:"pointer"}:void 0},`hit-${e}`))]}),Pt.view&&/* @__PURE__ */F(y,{from:Gt?.[0]??K[0],to:Gt?.at(-1)??K[K.length-1],count:K.length,total:J&&"percent"!==X?zt(Jt.reduce((t,e)=>t+e,0)):ae?zt(be.reduce((t,e)=>t+e.data.filter(Q).reduce((t,e)=>t+e,0),0)):void 0,rows:(ae?be:Kt).filter(t=>t.data.some(Q)).map(t=>{const e=t.data.filter(Q),a=V(t.slot,t.color,t.tone);if(0===e.length)return{key:t.key,label:t.label,color:a,value:"—"};const r=e.reduce((t,e)=>t+e,0),o=J||"column"===t.mode?zt(r):$t.zoomLevel(zt(r/e.length),zt(Math.max(...e)));return{key:t.key,label:t.label,color:a,value:o}}),onClear:Pt.clear}),ht&&Ot.length>2&&/* @__PURE__ */F(t,{className:"mt-1",labels:Ot,width:Lt,data:G[0]?.data??[],range:Yt,onRangeChange:t=>{ft?ft(t):Tt(t)}}),null!==St&&
22
- /* @__PURE__ */F("div",{className:"pointer-events-none absolute top-2 z-10",style:k(ge.center(St),ge.bandwidth,Lt),children:/* @__PURE__ */F($,{title:Gt?.[St]??K[St],rows:Kt.map((t,e)=>({key:t.key,label:t.label,color:V(t.slot,t.color,t.tone),value:Q(t.data[St])?J&&"percent"===X?`${S(100*(Xt(t.data[St],St)??0),1,Vt)} · ${zt(t.data[St])}`:zt(t.data[St]):void 0})),footnote:J&&"percent"===X?$t.inBucket(zt(Jt[St])):void 0})})]})}export{G as TimeSeriesChart};
@@ -1,4 +0,0 @@
1
- import{AccessibleTable as e}from"./chunk-ZDFMYAQB.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-IUVGHHR3.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,F]=u(null),{highlighted:I}=r(),A=[];if(m(p,-Math.PI/2,2*Math.PI,0,0,"","",A),0===A.length)/* @__PURE__ */return s("p",{className:`text-sm text-gray-500 ${g??""}`,children:N});const C=Math.max(...A.map(e=>e.depth))+1,E=f/2,H=f/2,L=(f/2-8-b)/C,Q=A.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),R=e=>`color-mix(in oklab, ${n(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${a.surface})`,V=e=>null!==w?e.id===w:null===I||e.branchKey===I,z=w?A.find(e=>e.id===w):void 0,B=e=>c(e.value/Q*100,1,$);/* @__PURE__ */
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(Q),C),onMouseLeave:()=>F(null),children:[A.map(e=>/* @__PURE__ */s("path",{d:t(E,H,b+e.depth*L+v/2,b+(e.depth+1)*L-v/2,e.start,e.end),fill:R(e),fillOpacity:V(e)?1:.45,stroke:a.surface,strokeWidth:1,onMouseEnter:()=>F(e.id)},e.id)),x&&/* @__PURE__ */s("text",{x:E,y:H+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:a.label,children:x})]}),z&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(l,{title:z.label,rows:[{key:"value",label:M.value,color:R(z),value:j(z.value)},{key:"share",label:M.share,color:a.muted,value:B(z)}]})}),
4
- /* @__PURE__ */s(e,{caption:M.sunburst(j(Q),C),head:[M.tableLevel,M.tableItem,M.value,M.share],rows:A.map(e=>[e.depth+1,e.label,j(e.value),B(e)])})]})}export{f as SunburstChart};
@@ -1,2 +0,0 @@
1
- import{CartesianPlot as t}from"./chunk-HC5KQZFG.js";import{binValues as o}from"./chunk-2JWPNR2U.js";import{ChartTooltip as r}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as e,useShellLocale as i}from"./chunk-IUVGHHR3.js";import{formatPlain as m,formatFixed as n}from"./chunk-C3QOHMR6.js";import{jsx as l}from"react/jsx-runtime";function c({values:c,bins:s=10,precomputed:h,height:u=220,width:p,color:b,tone:f,formatBound:d,formatCount:x,yAxisLabel:g,label:k,className:y,emptyLabel:j}){const v=e().charts,w=i(),A=d??(t=>Number.isInteger(t)?m(t,w):n(t,1,w)),L=x??(t=>m(t,w)),C=g??v.countAxis,H=k??v.distribution,M=h??o(c??[],s),N=a(0,b,f),R=M.map(t=>A(t.from)),F=M.map(t=>t.count);/* @__PURE__ */
2
- return l(t,{labels:R,values:F,height:u,width:p,bandPadding:0,xTickAnchor:"start",formatValue:L,yAxisLabel:C,className:y,emptyLabel:j,ariaLabel:v.histogram(H,M.length,(c??[]).length),tooltip:t=>/* @__PURE__ */l(r,{title:`${A(M[t].from)} – ${A(M[t].to)}`,rows:[{key:"count",label:v.observations,color:N,value:L(M[t].count)}]}),children:({x:t,y:o,bottom:r,active:a})=>/* @__PURE__ */l("g",{children:M.map((e,i)=>/* @__PURE__ */l("rect",{x:t(i)+.5,y:o(e.count),width:Math.max(1,t.bandwidth-1),height:Math.max(0,r-o(e.count)),fill:N,fillOpacity:null===a||a===i?.85:.42},i))})})}export{c as HistogramChart};
@@ -1,91 +0,0 @@
1
- import{computeMaximizedBox as e,isSidebarStripReserved as t,boxFillsWorkArea as n,readAlwaysMaximizedFlag as r,WORK_AREA_CHANGED_EVENT as o,scrollerIsFluid as i,growBoxToWidth as a,widthToFit as s,navIcons as l}from"./chunk-4LXCCZDM.js";import{reportBoundaryError as c}from"./chunk-KNUR2UEG.js";import{isStaleChunkError as u}from"./chunk-JDCM2VHG.js";import{WindowInsetContext as d,NO_WINDOW_DRAG as h}from"./chunk-YI4T5I5D.js";import{Result as m}from"./chunk-M2TQOJ3G.js";import{CMD_Z as f,CMD_SHIFT_Z as p}from"./chunk-FBZUEZK7.js";import{CopyButton as w}from"./chunk-BG3C4ALM.js";import{confirm as y}from"./chunk-GMLOMLCS.js";import{useModalDragAside as g}from"./chunk-EIFNESXS.js";import{ItemCount as v}from"./chunk-SXHV5OLA.js";import{isInOverlayOver as b}from"./chunk-SF4IIV5Z.js";import{dialogA11y as x}from"./chunk-VWGWZY7A.js";import{ColoredBadge as k}from"./chunk-WRV6QKJN.js";import{ROW_HEIGHTS as E}from"./chunk-AW7TOB6N.js";import{LoadingSpinner as M}from"./chunk-4U5M37SF.js";import{activationOrder as C,activeListeners as S,ModalActionsContext as L,subscribeActive as N,getActiveModalId as T,KEY_ACTIVATED_SELECTOR as z}from"./chunk-F3ZOO23R.js";import{useShellAuth as A}from"./chunk-2QY5BJLA.js";import{useIsMobile as D,useIsPhone as I}from"./chunk-UGTRSRIW.js";import{useShellPrefs as P}from"./chunk-DPFEQQQU.js";import{focusableIn as R}from"./chunk-DWGYC7OD.js";import{StatusBadge as O}from"./chunk-YDJ5IZOU.js";import{PopupMenu as $,PopupMenuItem as W,PopupMenuDivider as K,PopupMenuLabel as j}from"./chunk-THAPVKEJ.js";import{Button_default as F}from"./chunk-UTISUEO4.js";import{Icon as B}from"./chunk-ISVODSRP.js";import{LoadingSpinner as q}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as H}from"./chunk-62LW225J.js";import{shellHttp as U,isShellHttpConfigured as Y}from"./chunk-STKJA4PV.js";import{fitBoxScale as X,fitFrameStyle as V}from"./chunk-M6UKCZHT.js";import{runEscapeInterceptors as G}from"./chunk-TWVUQUUD.js";import{useShellStrings as J}from"./chunk-IUVGHHR3.js";import{createContext as _,createElement as Z,useContext as Q,Component as ee,useLayoutEffect as te,useRef as ne,useEffect as re,useState as oe,useSyncExternalStore as ie,useCallback as ae,isValidElement as se,Fragment as le,Children as ce,cloneElement as ue,useMemo as de,useId as he,useReducer as me,Suspense as fe}from"react";import{jsxs as pe,jsx as we,Fragment as ye}from"react/jsx-runtime";import{createPortal as ge}from"react-dom";import{useLocation as ve}from"react-router-dom";import{useQueryClient as be,useQuery as xe}from"@tanstack/react-query";function ke(e){return"component"in e}function Ee(e){return"endpoint"in e}var Me={};function Ce(e){Me=e}var Se=new Proxy({},{get:(e,t)=>Me[t],has:(e,t)=>t in Me,ownKeys:()=>Object.keys(Me),getOwnPropertyDescriptor(e,t){if(t in Me)return{configurable:!0,enumerable:!0,value:Me[t]}}});function Le(){return Y()}var Ne=U,Te=_({});function ze({value:e,children:t}){return Z(Te.Provider,{value:e},t)}function Ae(){return Q(Te)}var De=_(null);function Ie(){return Q(De)?.pageSearch??""}var Pe=null,Re=/* @__PURE__ */new Set;function Oe(e){Pe!==e&&(Pe=e,Re.forEach(e=>e()))}function $e(){return Pe}function We(e){return Re.add(e),()=>{Re.delete(e)}}var Ke=null;function je(e){Ke=e}function Fe({error:e,onReload:t}){const n=u(e);/* @__PURE__ */
2
- return pe("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
3
- /* @__PURE__ */we(B,{name:"warning",className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
4
- /* @__PURE__ */pe("div",{className:"min-w-0",children:[
5
- /* @__PURE__ */we("p",{className:"text-sm font-medium text-gray-700",children:n?"This window needs the latest version of the app":"This window crashed"}),
6
- /* @__PURE__ */we("p",{className:"mt-1 text-xs text-gray-400 max-w-sm break-words",children:n?"A new version was deployed while this tab was open. Reload the page to pick it up.":e.message||String(e)})]}),
7
- /* @__PURE__ */we("button",{type:"button",onClick:n?()=>window.location.reload():t,className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg",children:n?"Reload page":"Reload window"})]})}var Be=class extends ee{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){console.error("[efficient-shell] window content crashed:",e,t.componentStack),c(e)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */we(Fe,{error:e,onReload:this.reset}):this.props.children}},qe=_(null),He="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function Ue({className:e="",auto:t=!1}){const n=Q(qe),r=J().undo,o=n?.claimOwnMount;if(te(()=>{if(!t&&o)return o(!0),()=>o(!1)},[t,o]),!n||!n.enabled)return null;const{undo:i,redo:a,canUndo:s,canRedo:l,undoLabel:c,redoLabel:u}=n;/* @__PURE__ */
8
- return pe("div",{className:`flex items-center gap-2 ${e}`,"data-undo-controls":t?"shell":"form",children:[
9
- /* @__PURE__ */we("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",f):r.nothingToUndo,className:He,children:r.undo}),
10
- /* @__PURE__ */we("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",p):r.nothingToRedo,className:He,children:r.redo})]})}var Ye=/* @__PURE__ */new Set([408,429]);function Xe(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function Ve(e){const t=Xe(e);return null!=t&&(t>=400&&t<500&&!Ye.has(t))}function Ge(e,t){return!Ve(t)&&e<3}function Je(e){if("page"!==e.type)return!0;const t=e.route?Se[e.route]:void 0;if(!t||!ke(t))return!0;const n=t;return!n.widget&&!n.utility}function _e(e){const t=e.route?Se[e.route]:void 0;if(!t||!ke(t))return;const n=t;return n.taskbarGroup?n.taskbarGroup:{key:e.route,label:n.label,icon:e.route}}var Ze=(e,t)=>!!t&&"page"===e.type&&e.route===t;var Qe="flex-1 min-h-0";function et(){const e=J().record;/* @__PURE__ */
11
- return we(q,{label:e.loading,padding:"",className:Qe})}function tt(e){return e??void 0}function nt({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:o}){const i=J().record;if(t||e&&n)/* @__PURE__ */return we(et,{});if(r){const e=Xe(r);if(401===e)/* @__PURE__ */
12
- return we(m,{status:"warning",title:i.signInRequired,subTitle:i.signInBody,className:Qe});if(403===e)/* @__PURE__ */
13
- return we(m,{status:"403",className:Qe});if(404===e||410===e)/* @__PURE__ */
14
- return we(m,{status:"404",title:i.notFound,className:Qe});const t=null==e||408===e||429===e||e>=500;/* @__PURE__ */
15
- return we(m,{status:"500",title:i.loadFailed,subTitle:t?i.checkConnection:i.rejected,extra:t?/* @__PURE__ */we(F,{variant:"secondary",size:"sm",onClick:o,children:i.retry}):void 0,className:Qe})}/* @__PURE__ */
16
- return we(m,{status:"404",title:i.notFound,className:Qe})}function rt({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */we(ye,{children:t(e)}):/* @__PURE__ */we(nt,{...n})}var ot=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function it(e){return"string"==typeof e&&(e.startsWith("new-")||ot.test(e))}function at(e){if(it(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var st=_({openWindows:[],openEntity:()=>{},openPage:()=>{},reorderWindows:()=>{},closeEntity:()=>{},minimize:()=>{},items:[],restore:()=>{},remove:()=>{},restoreIfMinimized:()=>!1,openItems:[]}),lt=_(null);function ct(e){const t=Q(lt),n=ne(null);null===n.current&&(n.current=/* @__PURE__ */Symbol("window-dirty")),te(()=>{if(t)return t(n.current,e)},[t,e]),re(()=>{if(!t||!e)return;const n=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t,e])}function ut(){const e=ne(/* @__PURE__ */new Map),[t,n]=oe(!1);return{dirty:t,registerDirty:ae((t,r)=>{const o=()=>{const t=Array.from(e.current.values()).some(Boolean);n(e=>e===t?e:t)};return e.current.set(t,r),o(),()=>{e.current.delete(t),o()}},[])}}function dt(){return Q(st)}function ht(e){if("page"!==e.type&&at(e))return null;const t="page"===e.type?"page":e.entityType||"",n="page"===e.type?e.route||"":e.entityId||"";return t&&n?{entityType:t,entityId:n,label:e.label}:null}function mt({item:e,onClose:t,accentRgb:n}){const{dirty:r,registerDirty:o}=ut(),i=Se[e.route];if(!i||!ke(i))return null;const a=i,s=a.component;/* @__PURE__ */
17
- return we(io,{open:!0,onClose:t,icon:l[e.route],title:a.label,size:a.size||"2xl",dirty:r,allowPinOnTop:a.allowPinOnTop,initialPosition:a.initialPosition,widget:a.widget,compact:a.compact,appStyle:a.appStyle,flushBody:a.flushBody,autoHeight:a.autoHeight,autoMinHeight:a.autoMinHeight,autoWidth:a.autoWidth,dimensions:a.dimensions,windowKey:e.id,openedFromKey:e.openedFrom,accentRgb:n,children:/* @__PURE__ */we(lt.Provider,{value:o,children:/* @__PURE__ */we(fe,{fallback:/* @__PURE__ */we("div",{className:"flex items-center justify-center py-12",children:/* @__PURE__ */we(M,{})}),children:/* @__PURE__ */we(s,{})})})})}function ft({entityType:e,entityId:t,label:n}){const r=J(),o=be(),{data:i}=xe({queryKey:["my-profile-sidebar"],enabled:Le(),queryFn:()=>Ne.get("/auth/me/").then(e=>e.data)}),a=(i?.preferences||{}).favorite_documents||[],s=a.some(n=>n.entityType===e&&n.entityId===t);/* @__PURE__ */
18
- return we("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];Ne.patch("/auth/me/",{preferences:{favorite_documents:r}}).then(()=>{o.invalidateQueries({queryKey:["my-profile-sidebar"]})})},title:s?r.taskbar.removeFromDesktop:r.taskbar.addToDesktop,className:"shrink-0 transition-colors "+(s?"text-yellow-500 hover:text-yellow-600":"text-gray-300 hover:text-yellow-400"),children:/* @__PURE__ */we(B,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var pt=/* @__PURE__ */new Set,wt=()=>"hidden";function yt({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=Se[e.entityType];if(!o||!Ee(o))return null;const i=o,[a,s]=oe(!1),{dirty:c,registerDirty:u}=ut(),d=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=it(e.entityId),f=Ae(),p=(w=e.id,ie(N,()=>{const e=Xn.get(w);return null!=e&&Fn.has(e)}));var w;const y=!i.selfFetching&&!h&&!m&&Le(),g=xe({queryKey:[d,e.entityId],queryFn:()=>{return Ne.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:tt(e.entitySnapshot),initialDataUpdatedAt:0,enabled:y,staleTime:0,refetchOnWindowFocus:()=>{return void 0===(e=f.entityRefetchOnWindowFocus)||("function"==typeof e?e():e);var e},refetchOnMount:"always",refetchInterval:e=>function(e,t={}){if(Ve(e))return!1;if(t.minimized)return!1;const n=t.hostInterval;if(void 0===n)return 6e4;const r="function"==typeof n?n():n;return"number"==typeof r&&r>0&&r}(e.state.error,{minimized:p,hostInterval:f.entityRefetchInterval}),refetchIntervalInBackground:!1,retry:Ge}),v=g.data,b=g.refetch;re(()=>{var t;if(y)return t=t=>{t!==e.id||pt.has(t)||b({cancelRefetch:!1})},lr.add(t),()=>{lr.delete(t)}},[b,e.id,y]);const x=ae(()=>{a&&!c?s(!1):t()},[a,c,t]),k=(i.useEdit??wt)(v??null),E=!i.useEdit||m||h?void 0:{state:k,editing:a,onEdit:()=>s(!0),onDiscard:()=>s(!1)},C=i.selfFetching?e.label:v?i.title(v,a,s):e.label,S=i.icon,L=S?l[S]:null,T=C,z=!i.selfFetching&&v&&i.footer&&!h?i.footer(v):void 0;return i.rendersOwnModal?i.selfFetching?/* @__PURE__ */we(fe,{fallback:/* @__PURE__ */we(M,{}),children:i.render(v??e.entitySnapshot,t,e.entityId,a,s)}):null!=v?/* @__PURE__ */we(fe,{fallback:/* @__PURE__ */we(io,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */we(et,{})}),children:i.render(v,t,e.entityId,a,s)}):/* @__PURE__ */we(io,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */we(nt,{isPending:g.isPending,isFetching:g.isFetching,enabled:y,error:g.error,onRetry:b})}):/* @__PURE__ */we(io,{open:!0,onClose:x,onMinimize:n,initialBox:e.savedBox,icon:L,title:T,footer:z,copyText:e.label,windowKey:e.id,openedFromKey:e.openedFrom,size:i.size||"2xl",dirty:c,editing:a||m||h,edit:E,dimensions:i.dimensions,autoHeight:i.autoHeight,autoMinHeight:i.autoMinHeight,autoWidth:i.autoWidth,appStyle:i.appStyle,flushBody:i.flushBody,accentRgb:r,children:/* @__PURE__ */we(lt.Provider,{value:u,children:/* @__PURE__ */we(fe,{fallback:/* @__PURE__ */we(et,{}),children:i.selfFetching?i.render(null,t,e.entityId,a,s):/* @__PURE__ */we(rt,{entity:v,isPending:g.isPending,isFetching:g.isFetching,enabled:y,error:g.error,onRetry:b,children:n=>i.render(n,t,e.entityId,a,s)})})})})}function gt(e){return document.querySelector(`[data-modal-panel][data-window-key="${e}"]`)}function vt(e){return document.querySelector(`[data-modal-panel][data-window-root][data-window-owner="${e}"]`)}function bt(e){const t=gt(e),n=t??vt(e);if(!n)return;if(t&&!Er(t))return r=e,void window.dispatchEvent(new CustomEvent("modal-reveal",{detail:{windowKey:r}}));var r;const o=n.getAttribute("data-modal-id");o&&cr(o)}function xt(){const e=T();if(!e)return;const t=document.querySelector(`[data-modal-panel][data-modal-id="${e}"]`);return t?.getAttribute("data-window-key")??void 0}var kt=/* @__PURE__ */new Map;function Et(){const e=xt();if(e)return kt.get(e)}function Mt(e){const t=document.querySelectorAll("[data-modal-panel]");for(const n of Array.from(t)){const t=n.querySelector("[data-window-title]");if(t?.textContent?.includes(e))return n}return null}var Ct="rosh-peek-style",St=H.peek,Lt=H.taskbarPreview;function Nt(e){"undefined"!=typeof document&&(!function(){if("undefined"==typeof document||document.getElementById(Ct))return;const e=document.createElement("style");e.id=Ct,e.textContent=`body.rosh-peeking [data-modal-panel]{transition:opacity .18s ease}body.rosh-peeking [data-modal-panel]:not([data-peek-focus]){opacity:.4}body.rosh-peeking [data-modal-panel][data-peek-focus]{opacity:1}body.rosh-peeking [data-modal-panel][data-peek-focus]:not([data-pinned-top]){z-index:${St}!important}html.rosh-reduce-transparency body.rosh-peeking [data-modal-panel]:not([data-peek-focus]){opacity:.92}@media (prefers-reduced-motion:reduce){body.rosh-peeking [data-modal-panel]{transition:none}}`,document.head.appendChild(e)}(),document.querySelectorAll("[data-modal-panel][data-peek-focus]").forEach(e=>e.removeAttribute("data-peek-focus")),e&&e.setAttribute("data-peek-focus",""),document.body.classList.toggle("rosh-peeking",!!e))}function Tt(){"undefined"!=typeof document&&(document.body.classList.remove("rosh-peeking"),document.querySelectorAll("[data-modal-panel][data-peek-focus]").forEach(e=>e.removeAttribute("data-peek-focus")))}function zt({id:e,label:t,maxW:n,maxH:r,titleAbove:o=!1,onClick:i,onClose:a}){const s=J(),l=ne(null),[c,u]=oe({w:n,h:Math.round(.75*r)}),[d,h]=oe(!1);return te(()=>{const o=l.current;if(!o)return;const i=gt(e)??Mt(t);if(!i)return void h(!1);const a=i.getBoundingClientRect();if(0===a.width||0===a.height)return void h(!1);const s=X({width:n,height:r},a),c=Math.max(80,Math.round(a.width*s)),d=Math.max(60,Math.round(a.height*s));u({w:c,h:d}),h(!0);const m=i.cloneNode(!0);m.style.position="absolute",m.style.top="0",m.style.left="0",m.style.right="auto",m.style.bottom="auto",m.style.width=a.width+"px",m.style.height=a.height+"px";const f=V(a.width,s);return Object.assign(m.style,{transform:f.transform??"",transformOrigin:f.transformOrigin}),m.style.pointerEvents="none",m.style.animation="none",m.style.zIndex="auto",m.removeAttribute("data-modal-panel"),m.removeAttribute("data-modal-id"),m.removeAttribute("data-window-key"),m.removeAttribute("role"),m.removeAttribute("aria-labelledby"),m.removeAttribute("aria-label"),m.querySelectorAll('[role="dialog"], [data-portal]').forEach(e=>{e.style.display="none"}),o.innerHTML="",o.appendChild(m),()=>{o.innerHTML=""}},[e,t,n,r]),/* @__PURE__ */pe("div",{style:{width:c.w,height:c.h},className:"relative rounded-md overflow-hidden bg-white/95 border border-line-strong shadow-(--elevation-panel) cursor-pointer ring-2 ring-transparent group-hover:ring-blue-400 transition shrink-0",onClick:i,children:[
19
- /* @__PURE__ */we("div",{ref:l,className:"absolute inset-0 z-0 overflow-hidden"}),!d&&/* @__PURE__ */pe("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-gray-400 bg-gray-50",children:[
20
- /* @__PURE__ */we(B,{name:"window",className:"h-6 w-6",strokeWidth:1.5}),
21
- /* @__PURE__ */we("span",{className:"mt-1 text-3xs uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */we("div",{className:"absolute bottom-0 left-0 right-0 z-10 px-2 py-1 text-2xs font-medium text-on-accent bg-gradient-to-t from-black/80 to-transparent truncate pointer-events-none",children:t}),a&&/* @__PURE__ */we("button",{onClick:e=>{e.stopPropagation(),a()},className:"absolute top-1 right-1 z-20 h-5 w-5 rounded-full bg-gray-900/90 ring-1 ring-white/80 shadow-sm hover:bg-red-500 text-on-accent flex items-center justify-center",title:s.taskbar.closeWindow,children:/* @__PURE__ */we(B,{name:"close",className:"h-3 w-3",strokeWidth:3})})]})}function At({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=J(),s=e.length>1,l=ne(null),[c,u]=oe({left:-9999,top:-9999,ready:!1}),[d,h]=oe(()=>"undefined"!=typeof document&&getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom");te(()=>{const e=l.current;if(!e)return;const n=()=>{const n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";h(o);let i,a=n.left+n.width/2-r.width/2;"top"===o?i=n.bottom+8:"left"===o?(a=n.right+8,i=n.top+n.height/2-r.height/2):"right"===o?(a=n.left-r.width-8,i=n.top+n.height/2-r.height/2):i=n.top-r.height-8,a=Math.max(8,Math.min(a,window.innerWidth-r.width-8)),i=Math.max(8,Math.min(i,window.innerHeight-r.height-8)),u({left:a,top:i,ready:!0})};n();const r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t,e.length]),re(()=>Tt,[]);const m="top"===d,f=(m?"mt-1":"mb-1")+" max-w-[240px] truncate text-2xs font-medium text-ink-strongest bg-white/80 px-2 py-0.5 rounded shadow-sm ring-2 ring-transparent transition group-hover:ring-blue-400";return ge(
22
- /* @__PURE__ */we("div",{ref:l,"data-taskbar-preview":"",style:{position:"fixed",left:c.left,top:c.top,zIndex:Lt,maxWidth:"calc(100vw - 16px)",opacity:c.ready?1:0},className:s?"flex gap-2 flex-wrap":"",onMouseEnter:o,onMouseLeave:()=>{Tt(),i()},children:e.map(e=>{const t=gt(e.id)??Mt(e.label),o=t?function(e){if(Er(e))return null;const t=e.getBoundingClientRect(),n=fr(),r=t.left+t.width/2-(n.x+n.w/2),o=t.top+t.height/2-(n.y+n.h/2);return 180*Math.atan2(o,r)/Math.PI}(t):null;/* @__PURE__ */
23
- return pe("div",{className:"group flex flex-col items-center",onMouseEnter:()=>Nt(t),children:[!m&&/* @__PURE__ */we("span",{className:f,children:e.label}),
24
- /* @__PURE__ */we(zt,{id:e.id,label:e.label,maxW:240,maxH:160,titleAbove:!0,onClick:()=>n(e.id),onClose:()=>r(e.id)}),m&&/* @__PURE__ */we("span",{className:f,children:e.label}),null!==o&&/* @__PURE__ */pe("span",{title:a.taskbar.offscreenHint,className:"mt-1 inline-flex items-center gap-1 rounded bg-amber-500 px-2 py-0.5 text-2xs font-semibold text-on-accent shadow-sm",children:[
25
- /* @__PURE__ */we(B,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function Dt(e,t){const n=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";return"top"===n?{left:Math.min(e,window.innerWidth-220),top:t+4}:"left"===n?{left:e+4,top:Math.min(t,window.innerHeight-160)}:"right"===n?{right:window.innerWidth-e+4,top:Math.min(t,window.innerHeight-160)}:{left:Math.min(e,window.innerWidth-220),bottom:window.innerHeight-t+4}}function It({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=J(),[a,s]=oe(null);re(()=>{let e,t;const n=()=>{clearInterval(e),clearTimeout(t),e=void 0},r=()=>{const e=document.getElementById("taskbar-windows");return s(t=>t===e?t:e),!!e},o=()=>{n(),r()||(e=setInterval(()=>{r()&&n()},100),t=setTimeout(n,5e3))};return o(),window.addEventListener("react-os-shell:layout-mode-changed",o),()=>{n(),window.removeEventListener("react-os-shell:layout-mode-changed",o)}},[]);const c=ie(N,T),[,u]=oe(0);re(()=>{const e=()=>u(e=>e+1);return window.addEventListener("modal-geometry",e),window.addEventListener("resize",e),()=>{window.removeEventListener("modal-geometry",e),window.removeEventListener("resize",e)}},[]);const[,d]=oe(0);re(()=>{const e=()=>d(e=>e+1);return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[]);const h=e=>{const t=Mt(e),n=t?.querySelector("[data-window-title]");return n?.textContent?.trim()||e},[m,f]=oe(null),[p,w]=oe(null),[y,g]=oe(null),b=ne(null),x=()=>{b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{f(null),w(null)},150)},k=e.filter(e=>!e.route||!Se[e.route]?.utility);if(!a||!a.isConnected||0===k.length)return null;const E=[],M=/* @__PURE__ */new Map;for(const e of k){const t=e.route?Se[e.route]:void 0,n=t?.taskbarGroup,r=n?.key??e.route??`entity:${e.id}`,o=M.get(r);if(void 0!==o)E[o].items.push(e);else{M.set(r,E.length);const o=n?.label??t?.label??e.label;E.push({key:r,route:n?.icon??e.route,label:o,items:[e]})}}return ge(
26
- /* @__PURE__ */pe(ye,{children:[E.map(e=>{const n=e.route?l[e.route]:null,r=e.items[e.items.length-1];let a=!1;if(c){const t=document.querySelector(`[data-modal-id="${c}"]`);if(t){const n=t.querySelector("[data-window-title]"),r=n?.textContent??"";a=e.items.some(e=>r.includes(e.label))}}const s=e.items.length>1,u=e.items.some(e=>{const t=gt(e.id)??Mt(e.label);return!!t&&!Er(t)});/* @__PURE__ */
27
- return pe("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.currentTarget,void(y||(b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{f(n),w(r)},350)));var n,r},onMouseLeave:x,onDoubleClick:e=>{e.stopPropagation(),window.dispatchEvent(new CustomEvent("modal-center",{detail:{windowKey:r.id,label:r.label}}))},onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),b.current&&(clearTimeout(b.current),b.current=null),f(null),w(null),s?g({x:t.clientX,y:t.clientY,items:e.items,label:e.label}):window.dispatchEvent(new CustomEvent("modal-context-menu",{detail:{windowKey:r.id,label:r.label,x:t.clientX,y:t.clientY}}))},style:{width:"var(--window-tab-width, 200px)",fontSize:"var(--window-tab-font-size, 12px)"},"data-tab-group":e.key,className:"group relative flex items-center gap-2 rounded-lg px-3 py-2 font-medium transition-all min-w-0 shrink "+(a?"bg-blue-100/60 border border-blue-400/60 text-blue-700":"bg-gray-50/40 border border-gray-200/40 text-gray-700 hover:bg-gray-200/40"),children:[n&&se(n)?ue(n,{className:"h-3.5 w-3.5 shrink-0"}):/* @__PURE__ */we(B,{name:"expand",className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),
28
- /* @__PURE__ */we("span",{className:"truncate flex-1",children:s?e.label:h(r.label)}),u&&/* @__PURE__ */we("span",{title:i.taskbar.offscreenDot,className:"shrink-0 h-1.5 w-1.5 rounded-full bg-amber-500"}),s&&/* @__PURE__ */we(v,{count:e.items.length,label:i.count.windows(e.items.length)}),!s&&/* @__PURE__ */we("span",{role:"button",onClick:e=>{e.stopPropagation(),t(r.id)},className:"ml-auto text-gray-400 hover:text-red-500 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:/* @__PURE__ */we(B,{name:"close",className:"h-3 w-3",strokeWidth:2})})]},e.key)}),
29
- /* @__PURE__ */we("div",{className:"flex-1"}),k.length>=2&&/* @__PURE__ */pe("button",{onClick:n,title:i.taskbar.expose,className:"flex items-center gap-1 rounded px-2 py-1 text-2xs font-medium text-blue-600 border border-blue-300 hover:bg-accent-tint transition-colors shrink-0",children:[
30
- /* @__PURE__ */we(B,{name:"grid",className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),y&&/* @__PURE__ */pe($,{portal:!0,minWidth:200,style:Dt(y.x,y.y),onClose:()=>g(null),children:[
31
- /* @__PURE__ */we(j,{children:y.label}),
32
- /* @__PURE__ */pe(W,{onClick:()=>{g(null),y.items.forEach(e=>function(e){const t=Xn.get(e);t&&ur(t)}(e.id))},children:[
33
- /* @__PURE__ */we(B,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),i.taskbar.minimizeAllWindows]}),
34
- /* @__PURE__ */pe(W,{onClick:()=>{g(null),y.items.forEach(e=>o(e.id))},children:[
35
- /* @__PURE__ */we("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */we("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75h6.5v6.5h-6.5zM13.75 8.75h6.5v6.5h-6.5z"})}),i.taskbar.restoreAllWindows]}),
36
- /* @__PURE__ */we(K,{}),
37
- /* @__PURE__ */pe(W,{danger:!0,onClick:()=>{g(null),y.items.forEach(e=>t(e.id))},children:[
38
- /* @__PURE__ */we(B,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${y.items.length})`]})]}),m&&p&&/* @__PURE__ */we(At,{items:m,anchorEl:p,onActivate:e=>{o(e),f(null),w(null)},onClose:e=>{t(e),f(null),w(null)},onMouseEnter:()=>{b.current&&(clearTimeout(b.current),b.current=null)},onMouseLeave:x})]}),a)}var Pt=["/login","/forgot-password","/reset-password","/force-change-password"];function Rt({children:e,windowAccentForRoute:t}){const n=ve(),r=Pt.some(e=>n.pathname.startsWith(e)),[o,i]=oe([]),a=ne(o);te(()=>{a.current=o},[o]);const s=ie(We,$e,$e),l=ne(/* @__PURE__ */new Map),c=e=>{const t=Je(e),n=!!s&&"page"===e.type&&e.route===s,r=e.pageSearch||void 0,o=l.current.get(e.id);if(o&&o.tab===t&&o.home===n&&o.pageSearch===r)return o;const i={key:e.id,tab:t,home:n,...r?{pageSearch:r}:{}};return l.current.set(e.id,i),i};re(()=>{kt.clear();for(const e of o)e.route&&kt.set(e.id,e.route)},[o]);const u=ae(e=>{i(t=>t.filter(t=>t.id!==e))},[]),d=ae(e=>{var t;gt(e)||vt(e)?(t=e,window.dispatchEvent(new CustomEvent($r,{detail:{windowKey:t}}))):u(e)},[u]),h=(e,t=!1)=>{const n=Bn;t&&pt.add(e),setTimeout(()=>{const r=document.querySelector(`[data-modal-panel][data-window-key="${e}"]`),o=r?.getAttribute("data-modal-id");var i,a;!o||(i=o,a=n,(qn.get(i)??-1)>a)||cr(o),t&&pt.delete(e)},50)},m=(e,t,n)=>{const r=Ke;if(n||!r)return[...e,t];const o=function(e,t,n){if(!Je(t))return e.length;if(t.shellOwned&&Ze(t,n.home))return 0;const r=Ze(t,n.home)?void 0:_e(t)?.key;if(r){let t=-1;if(e.forEach((e,o)=>{Je(e)&&!Ze(e,n.home)&&_e(e)?.key===r&&(t=o)}),t>=0)return t+1}if("page"===t.type&&t.route&&!Ze(t,n.home)&&n.favorites.includes(t.route))return e.length>0&&Ze(e[0],n.home)?1:0;const o=t.openedFrom?e.findIndex(e=>e.id===t.openedFrom):-1;if(o>=0){const t=/* @__PURE__ */new Set([e[o].id]);let r=o+1;for(;r<e.length&&e[r].openedFrom&&t.has(e[r].openedFrom);)t.add(e[r].id),r++;const i=t=>Je(e[t])&&!Ze(e[t],n.home)?_e(e[t])?.key:void 0;for(;r>0&&r<e.length&&void 0!==i(r)&&i(r)===i(r-1);)r++;return r}return e.length}(e,t,{home:$e(),favorites:r.favorites});return[...e.slice(0,o),t,...e.slice(o)]},f=ae(e=>{i(t=>function(e,t){const n=new Set(t),r=new Map(e.map(e=>[e.id,e])),o=t.map(e=>r.get(e)).filter(e=>!!e);if(o.length!==n.size)return e;let i=0;const a=e.map(e=>n.has(e.id)?o[i++]:e);return a.every((t,n)=>t===e[n])?e:a}(t,e))},[]),p=ae((e,t,n,r,o,a={})=>{if(!Se[e]||!Ee(Se[e]))return;const s=`${e}:${t}`,l=xt();i(i=>{const c=i.find(n=>n.entityType===e&&String(n.entityId)===String(t));return c?(h(c.id),i):(h(s,!0),m(i,{id:s,type:"modal",label:r||t,route:o||window.location.pathname,entityType:e,entityId:t,entitySnapshot:tt(n),openedFrom:l},!!a.append))})},[]),w=ae((e,t={})=>{if(!Se[e]||!ke(Se[e]))return;const n=Se[e],{reuse:r=!1,background:o=!1,shellOwned:s,search:l,append:c=!1}=t,u=e=>{var t;o?(t=e,Zn.add(t)):h(e)};if(n.widget){const t=a.current.find(t=>"page"===t.type&&t.route===e);if(t)return void d(t.id)}const f=xt();i(t=>{if(n.multiInstance){const i=t.filter(t=>"page"===t.type&&t.route===e);if(s&&i.length>0)return t;if(r&&!l&&i.length>0)return o||h(i[i.length-1].id),t;const a=`page:${e}:${Math.random().toString(36).slice(2,8)}`;return u(a),m(t,{id:a,type:"page",label:n.label,route:e,openedFrom:f,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)}const i=t.find(t=>"page"===t.type&&t.route===e);if(i)return n.widget?t:(o||h(i.id),l&&i.pageSearch!==l?t.map(e=>e===i?{...e,pageSearch:l}:e):t);const a=`page:${e}`;return u(a),m(t,{id:a,type:"page",label:n.label,route:e,openedFrom:f,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)})},[d]),y=ae(()=>{},[]),g=ae(()=>{},[]),v=d,b=d;/* @__PURE__ */
39
- return pe(st.Provider,{value:{openWindows:o,openEntity:p,openPage:w,reorderWindows:f,closeEntity:v,minimize:y,items:[],openItems:o,restore:g,remove:b,restoreIfMinimized:()=>!1},children:[e,
40
- /* @__PURE__ */we(It,{openWindows:o,onRemove:d,onSplitView:ro,onActivate:e=>{document.querySelectorAll("[data-modal-panel]").forEach(t=>{const n=t.querySelector("[data-window-title]");if(n?.textContent?.includes(e)){const e=t.getAttribute("data-modal-id");e&&cr(e)}})},onActivateById:bt}),
41
- /* @__PURE__ */we(oo,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
42
- /* @__PURE__ */
43
- return we(De.Provider,{value:c(e),children:/* @__PURE__ */we(Be,{fallback:(t,n)=>/* @__PURE__ */we(io,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */we(Fe,{error:t,onReload:n})}),children:/* @__PURE__ */we(hn,{spec:ht(e),children:/* @__PURE__ */we(mo,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */we(mt,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */we(yt,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var Ot=400;function $t({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=ne(null),s=ne(!1);n&&!s.current&&(a.current="undefined"==typeof document?null:document.activeElement),s.current=n;const l=ne(!1),c=ne(void 0),u=ne(i),d=u.current&&!i;u.current=i;const h=()=>{l.current=!0,clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},Ot)};re(()=>{n&&!r&&h()},[n,r]),re(()=>{d&&n&&!r&&h()},[d]),re(()=>()=>clearTimeout(c.current),[]),re(()=>{if(!n||r||!o||i||!l.current)return;l.current=!1;const a=e.current;if(!a||a.contains(document.activeElement))return;if(document.activeElement?.closest('[aria-modal="true"]'))return;const s=t.current?R(t.current)[0]:void 0;s?s.focus():(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus())},[n,r,o,i,e,t]),te(()=>{if(!n||r)return;const t=e.current;return()=>{const e=a.current,n=document.activeElement;(!n||n===document.body||!!t?.contains(n))&&e&&e.isConnected&&!t?.contains(e)&&e.focus?.()}},[n,r,e])}var Wt=null,Kt=/* @__PURE__ */new Set;function jt(){return Wt}function Ft(e){if(Wt!==e){Wt=e;for(const e of Kt)e()}}function Bt(e){return Kt.add(e),()=>{Kt.delete(e)}}var qt=!1,Ht={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},Ut=()=>{};function Yt(e){qt=e,Ht={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function Xt(e,t){qt&&("submenu"===e?Ht.submenus++:Ht.menus++,Ht.menuKey=t)}function Vt(e){if(!qt)return Ut;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!qt)return;const r=performance.now()-t;"move"===e?Ht.moveMs+=r:Ht.resizeMs+=r}}function Gt(){const e=Ht;return Ht={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var Jt=/* @__PURE__ */new Set([O,k]),_t=e=>Jt.has(e)||"function"==typeof e&&"badge"===e.titleRole,Zt=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),Qt=/* @__PURE__ */new Set(["svg"]);function en(e){const t=[],n={text:"",accessories:[],badges:[],actions:[]};return tn(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function tn(e,t,n){if(null==e||"boolean"==typeof e)return;if("string"==typeof e||"number"==typeof e)return void n.push(String(e));if(Array.isArray(e))return void e.forEach(e=>tn(e,t,n));if(!se(e))return;const r=e;if(r.type===w)return void(void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text));if(r.type===le)return void ce.toArray(r.props.children).forEach(e=>tn(e,t,n));if("string"==typeof r.type){if(Qt.has(r.type))return;if(!Zt.has(r.type))return n.push(" "),ce.toArray(r.props.children).forEach(e=>tn(e,t,n)),void n.push(" ")}const o=ue(r,{key:`title-part-${t.accessories.length}`});t.accessories.push(o),(_t(r.type)?t.badges:t.actions).push(o)}var nn=/* @__PURE__ */new Map,rn=/* @__PURE__ */new Set,on=0;function an(){on++,rn.forEach(e=>e())}function sn(e){return nn.get(e)}function ln(e){return rn.add(e),()=>{rn.delete(e)}}function cn(){return on}var un=_(""),dn=_(null);function hn({spec:e,children:t}){/* @__PURE__ */
44
- return we(dn.Provider,{value:e,children:t})}var mn=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),fn='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600';function pn(e){return wn(e).replace(/\s+/g," ").trim()}function wn(e){if(null==e||"boolean"==typeof e)return"";if("string"==typeof e)return e;if("number"==typeof e)return String(e);if(Array.isArray(e))return e.map(wn).join("");if(se(e)){const t=e,n="string"==typeof t.type?t.type:"";return mn.has(n)?"":` ${wn(t.props?.children)} `}return""}function yn(e){const t=Q(un);re(()=>{if(!t)return;const n=n=>{n.detail===t&&e()};return window.addEventListener("widget-open-settings",n),()=>window.removeEventListener("widget-open-settings",n)},[e,t])}var gn={};function vn(e,t,n){const r=Q(un);re(()=>{if(!r)return;gn[r]||(gn[r]=[]);const o={label:e,icon:n,onClick:t};return gn[r].push(o),()=>{gn[r]=(gn[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function bn({title:e}){const t=ne(null);return re(()=>{const n=setTimeout(()=>{const n=t.current?.closest("[data-modal-id]"),r=n?.getAttribute("data-modal-id");r&&window.dispatchEvent(new CustomEvent("window-title-update",{detail:{id:r,title:e}}))},0);return()=>clearTimeout(n)},[e]),/* @__PURE__ */we("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function xn(e){}function kn(){return Q(un)}function En({children:e,position:t="right",quiet:n=!1}){const r=Q(L),[o,i]=oe(null);return re(()=>{if(!r)return;const e="left"===t?r.leftRef:r.rightRef,o=()=>!!e.current&&(i(e.current),n||r.notify(),!0);if(o())return;const a=setInterval(()=>{o()&&clearInterval(a)},50),s=setTimeout(()=>clearInterval(a),2e3);return()=>{clearInterval(a),clearTimeout(s)}},[r,t,n]),o?ge(e,o):null}function Mn({onClick:e,children:t,className:n}){const r=Q(L);/* @__PURE__ */
45
- return we("button",{type:"button",onClick:async()=>{if(r?.isDirty){const{confirm:e}=await(import("./shell/ConfirmDialog.js"));if(!await e({title:"Discard changes?",message:"You have unsaved changes. Are you sure you want to cancel? All changes will be lost.",confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"}))return}e()},className:n||"bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50",children:t||"Cancel"})}var Cn="erp_window_positions",Sn={};try{const e=localStorage.getItem(Cn);e&&(Sn=JSON.parse(e))}catch{}var Ln=null;function Nn(){Ln&&clearTimeout(Ln),Ln=setTimeout(()=>{try{localStorage.setItem(Cn,JSON.stringify(Sn))}catch{}},500)}var Tn="erp_activation_order",zn=[];try{const e=localStorage.getItem(Tn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(zn=t)}catch{}var An=null;function Dn(){An&&clearTimeout(An),An=setTimeout(()=>{try{localStorage.setItem(Tn,JSON.stringify(zn))}catch{}},500)}function In(e,t){Sn[e]||(Sn[e]=t,Nn())}function Pn(e){return Sn[e]?{...Sn[e]}:null}function Rn(e,t){Sn[e]=t,Nn()}function On(){const r=e(),o=t();let i=!1;for(const e of Object.keys(Sn))n(Sn[e],r,o)&&(delete Sn[e],i=!0);i&&Nn()}var $n={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},Wn=4e3,Kn=()=>{if("undefined"==typeof document)return"large";const e=getComputedStyle(document.documentElement).getPropertyValue("--default-window-size")?.trim();return"small"===e||"medium"===e||"maximized"===e?e:"large"},jn={small:.8,medium:1,large:1.25,maximized:1.25},Fn=/* @__PURE__ */new Set,Bn=0,qn=/* @__PURE__ */new Map;var Hn=0;function Un(){return Hn}function Yn(){Hn++,S.forEach(e=>e())}var Xn=/* @__PURE__ */new Map,Vn=/* @__PURE__ */new Map,Gn=/* @__PURE__ */new Map;function Jn(){for(let e=C.length-1;e>=0;e--){const t=Gn.get(C[e]);if(t?.tab)return t.owner}return null}function _n(){return ie(N,Jn,()=>null)}var Zn=/* @__PURE__ */new Set;var Qn=null;function er(e){Qn=null,cr(e)}function tr(e){Qn=e;const t=Xn.get(e);t&&er(t)}var nr=/* @__PURE__ */new Map;function rr(e){return nr.get(e)?.holdsChanges()??!1}function or(e){const t=nr.get(e);return t?t.ask():Promise.resolve(!0)}function ir(e){Qn===e&&(Qn=null)}function ar(e,t,n){if(n&&Gn.set(e,n),t)if(Xn.set(t,e),Vn.set(e,t),Zn.delete(t)){C.unshift(e);const n=zn.indexOf(t);-1!==n&&zn.splice(n,1),zn.unshift(t),Dn()}else!function(e,t){const n=zn.indexOf(t);if(-1===n)return void C.push(e);let r=C.length;for(let e=0;e<C.length;e++){const t=Vn.get(C[e]);if(t&&zn.indexOf(t)>n){r=e;break}}C.splice(r,0,e)}(e,t),-1===zn.indexOf(t)&&(zn.push(t),Dn());else C.push(e);Yn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&Qn===t&&er(e)}function sr(e){return e?Gn.get(e)?.owner??Vn.get(e)??null:null}var lr=/* @__PURE__ */new Set;function cr(e){const t=sr(T()),n=C.indexOf(e);-1!==n&&C.splice(n,1),C.push(e);const r=Gn.get(e);if(r?.root)for(const[e,t]of Gn){if(t.root||t.owner!==r.owner||Fn.has(e))continue;const n=C.indexOf(e);-1!==n&&C.splice(n,1),C.push(e)}Fn.delete(e);const o=Vn.get(e);if(o){const e=zn.indexOf(o);-1!==e&&zn.splice(e,1),zn.push(o),Dn(),Qn&&Qn!==o&&(Qn=null)}Yn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const i=sr(T());i&&i!==t&&lr.forEach(e=>e(i))}function ur(e){const t=C.indexOf(e);-1!==t&&C.splice(t,1),Fn.add(e),qn.set(e,++Bn);const n=Vn.get(e);if(n){const e=zn.indexOf(n);-1!==e&&(zn.splice(e,1),Dn())}Yn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var dr=/* @__PURE__ */new Set;var hr=8,mr=32;function fr(){return e()}var pr="flex size-6 shrink-0 items-center justify-center rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",wr="flex size-3 items-center justify-center rounded-full text-gray-900/70",yr="size-2 opacity-0 group-hover/controls:opacity-100 group-focus-within/controls:opacity-100",gr=E.windowBar,vr=80,br=384,xr=400;function kr(e,t=fr()){const n=Math.min(Math.max(e.x,t.x+vr-e.w),t.x+t.w-vr),r=Math.min(Math.max(e.y,t.y),t.y+t.h-gr);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function Er(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=fr();return t.left>=n.x-1&&t.top>=n.y-1&&t.right<=n.x+n.w+1&&t.bottom<=n.y+n.h+1}function Mr(e){const t=fr(),n=Math.floor(t.w/2),r=Math.floor(t.h/2);switch(e){case"top":return{x:t.x,y:t.y,w:t.w,h:t.h};case"left":return{x:t.x,y:t.y,w:n,h:t.h};case"right":return{x:t.x+n,y:t.y,w:t.w-n,h:t.h};case"tl":return{x:t.x,y:t.y,w:n,h:r};case"tr":return{x:t.x+n,y:t.y,w:t.w-n,h:r};case"bl":return{x:t.x,y:t.y+r,w:n,h:t.h-r};case"br":return{x:t.x+n,y:t.y+r,w:t.w-n,h:t.h-r}}}var Cr=null;function Sr(e){const t=(Cr||((Cr=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none",`z-index: ${H.snapPreview}`,"border-radius: 8px","background: rgba(59, 130, 246, 0.18)","border: 2px solid rgb(59, 130, 246)","transition: left 120ms ease, top 120ms ease, width 120ms ease, height 120ms ease, opacity 120ms ease","opacity: 0","display: none"].join(";"),document.body.appendChild(Cr)),Cr);t.style.display="block",t.style.left=`${e.x}px`,t.style.top=`${e.y}px`,t.style.width=`${e.w}px`,t.style.height=`${e.h}px`,t.style.opacity="1"}function Lr(){Cr&&(Cr.style.opacity="0",Cr.style.display="none")}var Nr=[{zone:"left",labelKey:"snapLeft",region:"inset-y-0 left-0 w-1/2"},{zone:"right",labelKey:"snapRight",region:"inset-y-0 right-0 w-1/2"},{zone:"tl",labelKey:"snapTopLeft",region:"top-0 left-0 h-1/2 w-1/2"},{zone:"tr",labelKey:"snapTopRight",region:"top-0 right-0 h-1/2 w-1/2"},{zone:"bl",labelKey:"snapBottomLeft",region:"bottom-0 left-0 h-1/2 w-1/2"},{zone:"br",labelKey:"snapBottomRight",region:"bottom-0 right-0 h-1/2 w-1/2"}],Tr=350,zr=200;function Ar({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o,children:i}){const[a,s]=oe(!1),l=ne(void 0),c=ne(void 0);re(()=>()=>{clearTimeout(l.current),clearTimeout(c.current)},[]);const u=()=>{clearTimeout(c.current),l.current=setTimeout(()=>s(!0),Tr)},d=()=>{clearTimeout(l.current),c.current=setTimeout(()=>s(!1),zr)};/* @__PURE__ */
46
- return pe("span",{className:"relative inline-flex",onMouseEnter:u,onMouseLeave:d,children:[
47
- /* @__PURE__ */we("button",{onClick:t,onFocus:u,onBlur:d,"aria-label":e?o.windowed:o.maximize,title:e?o.windowed:o.maximize,className:r,children:i}),a&&/* @__PURE__ */we("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(c.current),onMouseLeave:d,className:"absolute left-0 top-full z-30 mt-1 grid w-max grid-cols-2 gap-1 rounded-lg border border-line bg-surface p-2 shadow-lg",children:Nr.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */we("button",{type:"button","aria-label":o[t],title:o[t],onClick:()=>{s(!1),n(e)},onFocus:()=>clearTimeout(c.current),onBlur:d,className:"relative h-7 w-11 rounded border border-gray-300 bg-gray-50 hover:border-blue-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",children:/* @__PURE__ */we("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var Dr="rosh-gesture-style";var Ir={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},Pr=4;function Rr(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(Dr))return;const e=document.createElement("style");e.id=Dr,e.textContent="body.rosh-gesturing [data-modal-panel]{will-change:transform}",document.head.appendChild(e)}();try{e.setPointerCapture(t)}catch{}document.body.classList.add("rosh-gesturing");const o=document.createElement("div");o.setAttribute("data-drag-shield",""),o.style.cssText=`position:fixed;inset:0;z-index:2147483647;cursor:${n};background:transparent;touch-action:none`,document.body.appendChild(o);const i=Vt(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function Or(e){const t=C.indexOf(e);if(-1===t)return-1;const n=H.window+t*H.windowStep,r=Gn.get(e);if(!r||r.root)return n;let o=-1;for(const[e,t]of Gn){if(!t.root||t.owner!==r.owner)continue;const n=C.indexOf(e);-1!==n&&(o=Math.max(o,H.window+n*H.windowStep))}return o>=n?o+2+Math.min(t,7):n}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=C.length-1;e>=0;e--)dr.has(C[e])||C.splice(e,1);zn=zn.filter(e=>{const t=Xn.get(e);return null!=t&&dr.has(t)}),Dn(),Yn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var $r="modal-close-request";function Wr(e){ie(N,Un);const t=Q(L);if(C.length<=1)return!0;if(e){const t=Xn.get(e);if(null!=t)return T()===t}return t?.active??null!=T()}var Kr=!1,jr=/* @__PURE__ */new Set;function Fr(e){return jr.add(e),()=>jr.delete(e)}function Br(){return Kr}function qr(e){Kr!==e&&(Kr=e,jr.forEach(e=>e()))}function Hr(){qr(!Kr)}function Ur(){qr(!1)}var Yr=null,Xr=/* @__PURE__ */new Set;function Vr(e){return Xr.add(e),()=>Xr.delete(e)}function Gr(){return Yr}function Jr(e){Yr!==e&&(Yr=e,Xr.forEach(e=>e()))}var _r=null,Zr=/* @__PURE__ */new Set;function Qr(e){return Zr.add(e),()=>Zr.delete(e)}function eo(){return _r}function to(e){_r!==e&&(_r=e,Zr.forEach(e=>e()))}function no(){if(!_r)return void qr(!1);Jr(_r),to(null),qr(!1)}function ro(){qr(!Kr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function oo(){const e=ie(Fr,Br),[t,n]=oe(e),[r,o]=oe(e);return re(()=>{if(e){n(!0);const e=requestAnimationFrame(()=>o(!0));return()=>cancelAnimationFrame(e)}o(!1);const t=setTimeout(()=>n(!1),280);return()=>clearTimeout(t)},[e]),t&&"undefined"!=typeof document?ge(
48
- /* @__PURE__ */we("div",{onMouseDown:e=>{e.stopPropagation(),qr(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:H.expose,cursor:"pointer",opacity:r?1:0,transition:"opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1)",pointerEvents:r?"auto":"none"}}),document.body):null}function io({open:t,onClose:l,title:c,icon:u,copyText:m,size:f="lg",dirty:p=!1,onNext:w,onPrev:v,footer:k,bodyScroll:M,onMinimize:S,initialBox:A,actions:R,actionsLeft:O,editing:j=!1,edit:q,allowPinOnTop:U,initialPosition:Y,widget:V,compact:_,appStyle:Z,flushBody:ee,autoHeight:se,autoMinHeight:le,autoWidth:ce,widgetMenu:ue,dimensions:me,windowKey:fe,openedFromKey:ve,accentRgb:be,children:xe}){const[ke,Ee]=oe(()=>r()),Me=D()&&!ke,Ce=I()&&!!V,[Se,Le]=oe(0),[Ne,Te]=oe(!1),ze=ne(null),Ae=ne(0);re(()=>{Ae.current=Se},[Se]);const Ie=ae(e=>{Me&&(ze.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},Te(!0),Ft(ve??null))},[Me,ve]),Pe=ie(Bt,jt);re(()=>{if(!Ne)return;const e=e=>{if(!ze.current)return;const t=e.clientX-ze.current.startX;if(Math.abs(e.clientY-ze.current.startY)>Math.abs(t)+12)return ze.current=null,Te(!1),Le(0),void Ft(null);Le(Math.max(0,t))},t=()=>{if(!ze.current)return;const e=.3*window.innerWidth,t=Ae.current>e;ze.current=null,Te(!1),t?(Le(window.innerWidth),setTimeout(()=>{l(),Le(0),Ft(null)},180)):(Le(0),Ft(null))};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[Ne]);const[Re,Oe]=oe(c),$e=J(),We=$e.window;re(()=>{Oe(c)},[c]);const Ke=de(()=>pn(Re).trim()||void 0,[Re]),je=he(),[Fe,He]=oe(!1),Ye=ne(!1),[Xe,Ve]=oe(!1),[Ge,Je]=oe(null),_e=Q(dn),Ze=Q(De),{prefs:Qe,save:et}=P(),tt=!!Qe.window_accent_stripe,nt=Qe.favorite_documents||[],rt=!!_e&&nt.some(e=>e.entityType===_e.entityType&&e.entityId===_e.entityId),ot=ae(()=>{if(!_e)return;const e=rt?nt.filter(e=>!(e.entityType===_e.entityType&&e.entityId===_e.entityId)):[...nt,{entityType:_e.entityType,entityId:_e.entityId,label:_e.label}];et({favorite_documents:e})},[_e,rt,nt,et]),[it,at]=oe(null),[st,lt]=oe("top-right"===Y?"right":"left"),ut=ne(!1),ht=ne(null);te(()=>{const e=ht.current;e&&(be?e.style.setProperty("--window-accent-rgb",be):e.style.removeProperty("--window-accent-rgb"))},[be]);const mt=ne(!1),ft=ne(null),pt=ne(null),wt=ne(null),[yt,gt]=oe(!1),vt=ne(null),bt=ne(null),xt=ne(null),[kt,Et]=oe(!1);te(()=>{const e=bt.current,t=xt.current;if(!e||!t)return;const n=()=>Et(function(e,t){return e.scrollWidth>t.clientWidth}(t,e));if(n(),"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[null!=k&&!1!==k]);const Mt=!!q&&!V&&!_&&!Z&&(q.editing||"hidden"!==q.state),Ct=!!(k||R||O)||yt||Mt,St=Q(qe),Lt=""!==Q(un),Nt=ne(null);Nt.current=Ze?{owner:Ze.key,tab:Ze.tab,root:!Lt}:null;const Tt=fe||(Ze&&!Lt?Ze.key:null),zt=!!St&&!Lt&&St.enabled&&St.hasState&&(j||St.declaredEditable)&&!St.handMounted&&Ct&&!V&&!_&&!Z&&!Me,At=40,{minimize:Dt,items:It,restoreIfMinimized:Pt,openWindows:Rt}=dt(),Ot=ne(`modal-${Math.random().toString(36).slice(2,8)}`).current,Wt=g(Ot);re(()=>{if(V)return dr.add(Ot),()=>{dr.delete(Ot)}},[V,Ot]),re(()=>{const e=e=>{const t=e.detail;t?.id===Ot&&Oe(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[Ot]);const[Kt,qt]=oe(H.window),Ht=function(e){const t=ie(N,T);return C.length<=1||t===e}(Ot),Ut=ne(q);Ut.current=q;const Yt=!!q&&!q.editing&&"enabled"===q.state;re(()=>{if(!t||!Ht||!Yt)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(b(e.target,ht.current)||(e.preventDefault(),e.stopPropagation(),Ut.current?.onEdit()))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Ht,Yt]);const Xt=function(e){return ie(N,()=>Fn.has(e))}(Ot);$t({panelRef:ht,bodyRef:ft,open:t,widget:!!V,active:Ht,minimized:Xt});const Vt=ie(Fr,Br),Gt=ie(Vr,Gr),Jt=ie(Qr,eo),_t=!U&&!V,Zt=Vt&&_t,[Qt,tn]=oe(!1),rn=Zt&&Jt===Ot,[on,sn]=oe(!1),ln=on&&_t&&Gt===Ot?"picked":null,cn=ne(Zt);re(()=>{if(cn.current&&!Zt){sn(!0);const e=setTimeout(()=>{sn(!1),Yr===Ot&&Jr(null)},700);return cn.current=Zt,()=>clearTimeout(e)}cn.current=Zt},[Zt,Ot]),re(()=>{Zt||tn(!1)},[Zt]),re(()=>{const e=pt.current,t=wt.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>gt(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[t]),re(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&ht.current){const t=ht.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=pt.current,n=wt.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const hn=ne(!1),mn=ae(e,[]),wn=ae(()=>{const t=e(),n=me?me[0]:$n[f]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=jn[Kn()],l=me?Math.min(me[1],i):(()=>{const e=("sm"===f?500:"md"===f?600:"lg"===f?700:"xl"===f?800:920)*s;return Math.max(320,Math.min(e,t.h-80))})(),c="cascade"!==(getComputedStyle(document.documentElement).getPropertyValue("--window-position")?.trim()||"cascade")||r()?0:30*(C.length-1),u=Math.max(At,(i-l)/2),d=(o-a)/2,h=t.h-At-l-u;return"top-right"===Y?{x:t.x+t.w-a-At,y:t.y+At,w:a,h:l}:"top-left"===Y?{x:t.x+At,y:t.y+At,w:a,h:l}:{x:t.x+Math.max(At,(o-a)/2+At)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,h)),w:a,h:l}},[f]),yn=ne(!1);t||(yn.current=!1);const vn=fe||m||null;re(()=>{if(!t)return;ar(Ot,vn,Nt.current??void 0),fe||cr(Ot),hn.current=!1,qt(Or(Ot));const e=()=>{qt(Or(Ot))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===fe;if(!e.label)return!1;const t=ht.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(cr(Ot),An.current)return;const t=fr(),n=Math.min(Bn.current.w,t.w-40),o=Math.min(Bn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;kn({x:i,y:a,w:n,h:o}),On(!1)},i=e=>{const t=e.detail;r(t)&&(cr(Ot),Je({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==fe)return;cr(Ot);const t=Bn.current,n=function(e,t=fr()){const n=Math.min(e.w,t.w),r=Math.min(e.h,t.h);return{w:n,h:r,x:Math.min(Math.max(e.x,t.x),t.x+t.w-n),y:Math.min(Math.max(e.y,t.y),t.y+t.h-r)}}(t);if(n.x===t.x&&n.y===t.y&&n.w===t.w&&n.h===t.h)return;const r=ht.current,o="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(r&&!o){let e=!1;const t=()=>{e||(e=!0,r.style.transition="",window.dispatchEvent(new CustomEvent("modal-geometry")))};r.style.transition="left .28s ease, top .28s ease, width .28s ease, height .28s ease",r.addEventListener("transitionend",t,{once:!0}),window.setTimeout(t,400)}kn(n)};return window.addEventListener("modal-reorder",e),window.addEventListener("modal-split-view",n),window.addEventListener("modal-center",o),window.addEventListener("modal-reveal",a),window.addEventListener("modal-context-menu",i),()=>{!function(e){const t=C.indexOf(e);-1!==t&&(C.splice(t,1),Yn()),Fn.delete(e),qn.delete(e),Gn.delete(e);const n=Vn.get(e);n&&(Vn.delete(e),Xn.delete(n))}(Ot),window.removeEventListener("modal-reorder",e),window.removeEventListener("modal-split-view",n),window.removeEventListener("modal-center",o),window.removeEventListener("modal-reveal",a),window.removeEventListener("modal-context-menu",i),window.dispatchEvent(new CustomEvent("modal-reorder"))}},[t,Ot,vn,mn]);const bn=!V&&"maximized"===Kn(),[xn,kn]=oe(()=>{if(vn&&Sn[vn]){const e={...Sn[vn]};return me&&(e.w=me[0],se||(e.h=me[1])),kr(e)}return A?{x:A.x,y:A.y,w:A.w,h:A.h}:bn?mn():wn()}),[En,Mn]=oe(()=>!se),Cn=ne(ke),Ln=ne(null);re(()=>{const e=()=>{const e=r();e!==Cn.current&&Ln.current?.(e),Cn.current=e,Ee(e),qt(Or(Ot))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[Ot]);const Tn=ke&&!!Ze?.tab&&!Lt&&!V&&!Me,zn=Tn,An=ne(zn);An.current=zn;const Dn=_n(),In=ke&&!!Ze?.tab&&!V&&!Me&&!Vt&&Dn!==Ze.key,Pn=!!V&&ke&&!Vt&&null!==Dn,[Rn,On]=oe(()=>vn&&Sn[vn]||A?zn:zn||bn),Bn=ne(xn);Bn.current=xn;const Hn=ne(Rn);te(()=>{Hn.current=Rn},[Rn]),te(()=>{if(En||Tn)return;const e=ht.current,t=ft.current;if(!e||!t)return;const n=le??(V?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const s=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&l.unobserve(a),l.observe(c),a=c);const u=e.offsetHeight-t.offsetHeight,d=t.style.flex,h=t.style.overflowY,m=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const f=t.offsetHeight,p=c.offsetHeight;t.style.flex=d,t.style.height=m,t.style.overflowY=h;const w=c.offsetHeight>p+4,y=Math.max(n,window.innerHeight-r-Math.max(0,Bn.current.y)-24),g=w?Math.min(Bn.current.h,y):Math.min(Math.max(n,u+f),y),v=Math.abs(g-o)>1;v&&(o=g,kn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),V||(g<=n?i&&(clearTimeout(i),i=null):(v||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&Mn(!0)},160)))},l=new ResizeObserver(s);s(),vt.current&&l.observe(vt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[En,V,le,Ct,Tn]),te(()=>{if(!se||!En||V||!t)return;const e=vt.current;if(!e)return;let n=e.offsetHeight;const r=new ResizeObserver(()=>{if(!e.isConnected)return;const t=e.offsetHeight,r=t-n,o=t>0!=n>0;if(n=t,!o||0===r||Rn)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=le??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,Bn.current.y)-24);kn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[se,En,V,t,Rn,le]);const Un=!1!==ce&&!V&&!Z&&!Me,[Jn,Zn]=oe(()=>!Un);te(()=>{if(Jn||!t)return;if(!Un||Rn)return void Zn(!0);const n=ht.current,r=ft.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let l=Bn.current.w,c=0;const u=()=>Zn(!0),d=()=>{c=0;const t=Bn.current;if(Math.abs(t.w-l)>1||document.body.classList.contains("rosh-gesturing"))return void u();const d=e(),h=d.w-80;if(t.w>=h)return void u();const m=[],f=[];for(const e of[r,...Array.from(r.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||o.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(m.push(e),f.push(t))}if(!m.length)return;const p=Math.min(h,t.w+Math.max(...f)),w=p-t.w,y=n.style.width;n.style.width=`${p}px`;const g=m.map((e,t)=>({over:f[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{i(e,w)||o.add(m[t])});const v=a(t,s(t.w,w,g),d,At);v!==t&&(l=v.w,kn(v))};d();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(u,Wn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Jn,t,Un,Rn]);const Qn=ne(null),er=!(!Ze?.tab||Lt||V||Me);Ln.current=t=>{if(!er)return;if(t)return Qn.current||(Qn.current={box:{...Bn.current},maximized:Hn.current}),void(Hn.current=!0);const r=Qn.current;Qn.current=null;const o=e();if(r?.maximized)return Hn.current=!0,On(!0),void kn(o);const i=r?.box??(vn?Sn[vn]:void 0);if(Hn.current=!1,On(!1),i&&!n(i,o,!1)){const e={...i};me&&(e.w=me[0],se||(e.h=me[1])),kn(kr(e))}else kn(wn())},re(()=>{zn&&(Hn.current=!0,On(!0),kn(mn()))},[zn,mn]),re(()=>{if(V)return;const e=()=>{const e=vn?Sn[vn]:void 0;if(Hn.current=!1,On(!1),e){const t={...e};me&&(t.w=me[0],se||(t.h=me[1])),kn(kr(t))}else kn(wn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[V,wn,vn]),re(()=>{t&&vn&&!Tn&&(Sn[vn]=xn,Nn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[xn,t,vn,Tn]),re(()=>{if(!t)return;const e=()=>{Hn.current?kn(mn()):document.body.classList.contains("rosh-gesturing")||kn(kr)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Rn&&(n=new MutationObserver(e),n.observe(document.body,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["class"]})),()=>{window.removeEventListener("resize",e),window.removeEventListener(o,e),n?.disconnect()}},[t,Rn,mn]),re(()=>{if(t&&(He(!1),Ye.current=!1,ut.current=!1,Zn(!Un),!An.current)){if(vn&&Sn[vn]){const e=Sn[vn];return void kn(t=>kr({...e,...se?{h:t.h}:{},...Un?{x:t.x,w:t.w}:{}}))}A&&(kn({x:A.x,y:A.y,w:A.w,h:A.h}),On(A.maximized))}},[t]),re(()=>{if(!t||"auto"!==p)return;let e;const n=t=>{ht.current?.contains(t.target)&&!Ye.current&&(Ye.current=!0,e=setTimeout(()=>He(!0),0))};return document.addEventListener("input",n,!0),document.addEventListener("change",n,!0),()=>{clearTimeout(e),document.removeEventListener("input",n,!0),document.removeEventListener("change",n,!0)}},[t,p]);const tr="auto"===p?Fe:!0===p,rr=Ze&&!Lt?Ze.key:null,or=de(()=>en(Re),[Re]),ir=ne({shortcutSpec:_e,isOnDesktop:rt,toggleDesktopShortcut:ot,taskbarStrings:$e.taskbar});te(()=>{ir.current={shortcutSpec:_e,isOnDesktop:rt,toggleDesktopShortcut:ot,taskbarStrings:$e.taskbar}});const sr=ne(null);sr.current||(sr.current={open:(e,t)=>Je({x:e,y:t}),items:()=>{const e=ir.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of gn[Ot]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),re(()=>{if(t&&rr)return()=>{return e=rr,void(nn.delete(e)&&an());var e}},[t,rr]),ct(!(fe||!t)&&tr);const lr=ae(()=>tr||"auto"===p&&Ye.current,[tr,p]),gr=ae(async e=>{if(ut.current)return!1;if(!lr())return!0;ut.current=!0;const t=Ke,n="close"===e?"Are you sure you want to close?":"discard"===e?"Are you sure you want to stop editing?":"Are you sure you want to continue?",r=await y({title:"Discard changes?",message:t?`“${t}” has unsaved changes. ${n} All changes will be lost.`:`You have unsaved changes. ${n} All changes will be lost.`,confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});return ut.current=!1,r},[lr,Ke]),vr=ae(()=>ut.current?Promise.resolve():lr()?gr("close").then(e=>{e&&l()}):(l(),Promise.resolve()),[lr,gr,l]),Er=ae(async()=>{await gr("discard")&&(Ye.current=!1,He(!1),Ut.current?.onDiscard())},[gr]),Cr=ae(async()=>{const e=await gr("switch");return e&&(Ye.current=!1,He(!1)),e},[gr]),Nr=ne(()=>!1);te(()=>{Nr.current=lr}),te(()=>{if(!t||!fe)return;const e={holdsChanges:()=>Nr.current(),ask:Cr};return nr.set(fe,e),()=>{nr.get(fe)===e&&nr.delete(fe)}},[t,fe,Cr]),te(()=>{if(!t||!Tt)return;const e=e=>{e.detail?.windowKey===Tt&&vr()};return window.addEventListener($r,e),()=>window.removeEventListener($r,e)},[t,Tt,vr]);const Tr=ne(null),zr=ae(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Je(null),cr(Ot),An.current)return void e.preventDefault();e.preventDefault();const t=e.currentTarget,n=e.pointerId;let r=null;const o=e.clientX,i=e.clientY,a=ht.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Tr.current){const t=Tr.current;Tr.current=null,d=t.w,u=t.h;const n=s?Math.min(Math.max(20,e.clientX-s.left),t.w-20):t.w/2;l=e.clientX-n,c=e.clientY-12,a&&(a.style.width=`${d}px`,a.style.height=`${u}px`,a.style.left=`${l}px`,a.style.top=`${c}px`)}else l=s?s.left:Bn.current.x,c=s?s.top:Bn.current.y,u=s?s.height:Bn.current.h,d=s?s.width:Bn.current.w;On(!1),kn(e=>({...e,x:l,y:c,w:d,h:u}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<Pr&&Math.abs(e.clientY-i)<Pr)return;r=Rr(t,n,"move","move"),a&&(a.style.transition="none")}const s=l+e.clientX-o,u=Math.max(0,c+e.clientY-i);if(a&&(a.style.transform=`translate(${s-l}px, ${u-c}px)`),Bn.current={...Bn.current,x:s,y:u},!V){const t=function(e,t){const n=fr(),r=e<=n.x+hr,o=e>=n.x+n.w-hr,i=t<=n.y+hr,a=t>=n.y+n.h-hr,s=e<=n.x+mr,l=e>=n.x+n.w-mr,c=t<=n.y+mr,u=t>=n.y+n.h-mr;return i&&s?"tl":i&&l?"tr":a&&s?"bl":a&&l?"br":c&&r?"tl":c&&o?"tr":u&&r?"bl":u&&o?"br":i?"top":r?"left":o?"right":null}(e.clientX,e.clientY);t!==h&&(h=t,t?Sr(Mr(t)):Lr())}},f=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",f),r?.(),Lr();const e=kr({...Bn.current});if(Bn.current=e,!V&&h){Tr.current={x:l,y:c,w:d,h:u};const e=Mr(h);return a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.width=`${e.w}px`,a.style.height=`${e.h}px`,a.style.transform="",a.style.transition=""),void kn(e)}if(V){const t=e.x+e.w/2,n=window.innerWidth/2;lt(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),kn(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",f)},[]),Dr=ae((e,t)=>{if(0!==e.button)return;e.preventDefault(),e.stopPropagation();const n=e.currentTarget,r=e.pointerId;let o=null;const i=e.clientX,a=e.clientY,s=ht.current,l=s?.getBoundingClientRect(),c=l?l.left:Bn.current.x,u=l?l.top:Bn.current.y,d=l?l.width:Bn.current.w,h=l?l.height:Bn.current.h,m="sw"===t||"nw"===t||"w"===t,f="ne"===t||"nw"===t||"n"===t,p="se"===t||"ne"===t||"e"===t,w="se"===t||"sw"===t||"s"===t;On(!1),kn({x:c,y:u,w:d,h:h}),Bn.current={x:c,y:u,w:d,h:h};let y=0,g=null;const v=()=>{if(y=0,!g)return;const e=g;g=null,Bn.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},b=e=>{if(!o){if(Math.abs(e.clientX-i)<Pr&&Math.abs(e.clientY-a)<Pr)return;o=Rr(n,r,Ir[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(p&&(o=Math.max(br,d+e)),w&&(i=Math.max(xr,h+t)),m){const t=Math.max(br,d-e);n=c+d-t,o=t}if(f){const e=Math.max(xr,h-t);r=u+h-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(v))},x=()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),v(),o?.(),kn({...Bn.current})};window.addEventListener("pointermove",b),window.addEventListener("pointerup",x)},[]),Wr=ae(e=>{if(e.target.closest("button, input, a, kbd, select, textarea"))return;const t={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!t&&"Enter"!==e.key)return;if(e.preventDefault(),e.stopPropagation(),cr(Ot),"Enter"===e.key)return void(Rn?(On(!1),kn(wn())):(On(!0),kn(mn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Tr.current||(Tr.current={...Bn.current})};if(r<0)return e(),On(!0),void kn(mn());if(r>0){if(Rn)return On(!1),void kn(wn());if(Tr.current){const e=kr(Tr.current);return Tr.current=null,Bn.current=e,void kn(e)}return void ur(Ot)}e(),On(!1);const t=Mr(n<0?"left":"right");return Bn.current=t,void kn(t)}if(Rn)return;const o=Bn.current,i=e.shiftKey?{...o,w:Math.max(br,o.w+24*n),h:Math.max(xr,o.h+24*r)}:kr({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Bn.current=i,kn(i)},[Ot,Rn,wn,mn]),Kr=ae(e=>{Tr.current||(Tr.current={...Bn.current}),On(!1);const t=Mr(e);Bn.current=t,kn(t),cr(Ot)},[Ot]),jr=!V&&!Tn&&!Me,[Hr,Ur]=oe(0),Xr=jr&&!_&&!Z&&(!!R||!!O||yt||Mt||zt),_r=jr&&Hr>0,Zr=ne(_r);Zr.current=_r;const to=!!_||!!Z,no=to?"h-(--row-height-compact-bar)":"h-(--row-height-window-bar)",ro=ae(e=>{const t=e.closest("[data-window-body]");if(!t)return null;const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return Math.abs(n.left-r.left)>2||Math.abs(n.top-r.top)>2?null:(Ur(e=>e+1),()=>Ur(e=>Math.max(0,e-1)))},[]),oo=de(()=>jr?{compact:to,over:_r,claim:ro}:null,[jr,to,_r,ro]),io=ae(e=>{if(Zt)return;e.preventDefault(),e.stopPropagation();const t=0===e.clientX&&0===e.clientY,n=e.currentTarget.getBoundingClientRect();Je(t?{x:n.left,y:n.bottom+4}:{x:e.clientX,y:e.clientY})},[Zt]),ao=!!be&&tt&&!V&&!Me,so=zn||Zt?{}:{tabIndex:0,role:"group","aria-label":Ke?`${Ke} — ${We.windowSuffix}`:We.windowSuffix,"aria-keyshortcuts":"ArrowUp ArrowDown ArrowLeft ArrowRight Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+ArrowRight Control+ArrowUp Control+ArrowDown Control+ArrowLeft Control+ArrowRight Enter",onKeyDown:Wr},lo=()=>{On(!0),kn(mn())},co=ae(()=>{const e=ht.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(fn);t&&!t.disabled&&t.click()}},[]);re(()=>{if(!t)return;if(V)return;const e=e=>{if(C[C.length-1]===Ot&&!b(e.target,ht.current)&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),co();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&ht.current?.contains(t)))return;if(t.closest(z))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,co,Ot,V]),re(()=>{if(!t)return;const e=e=>{C[C.length-1]===Ot&&(b(e.target,ht.current)||((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:Ot}})),Ye.current=!1,He(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:Ot}})))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),re(()=>{if(!t)return;if(V)return;const e=e=>{if("Escape"===e.key&&C[C.length-1]===Ot){if(G(e))return e.preventDefault(),void e.stopPropagation();if(Tn&&!j)return;e.preventDefault(),e.stopPropagation(),vr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,vr,Ot,V,Tn,j]);const uo=t&&(void 0!==w||void 0!==v),[ho]=oe(()=>{if("undefined"==typeof document)return null;const e=document.createElement("span");return e.className="flex shrink-0 items-center gap-2",e.setAttribute("data-tab-actions",""),e}),mo=Tn&&!Ze?.home&&or.actions.length>0;re(()=>{t&&rr&&function(e,t){const n=nn.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(nn.set(e,t),an())}(rr,{title:or.text||Ke,dirty:tr,copy:or.copy,actions:mo&&ho?ho:void 0,menu:sr.current??void 0})},[t,rr,Ke,tr,or.text,or.copy,mo,ho]);const fo=ae(e=>{const t=document.getElementById("nav-boundary-toast");t&&t.remove();const n="bottom"===e?["That's the last one, chief.","You've hit rock bottom... of the list.","End of the line, buddy.","Nothing left. Go outside.","Congratulations, you scrolled to the void.","There's no more. I checked.","You've reached the edge of the known universe.","Plot twist: there is no next one.","Even scrolling has limits. Unlike your ambition.","Last one. Time to touch grass."]:["Already at the top. Overachiever.","There is no item above this. Trust me.","You're #1. Literally.","Can't go higher. You've peaked.","This is it. The summit. The top.","First item. No VIP lounge above this.","Going up? Nope. Elevator's broken.","You want negative indexes? Bold.","Top of the list. Top of the world.","The only way is down from here."],r=n[Math.floor(Math.random()*n.length)],o=document.createElement("div");o.id="nav-boundary-toast",o.className="fixed bottom-6 left-1/2 -translate-x-1/2 z-(--z-toast) bg-gray-900 text-on-accent flex min-h-10 items-center px-5 py-3 rounded-lg shadow-lg text-sm font-medium transition-opacity duration-300",o.textContent=r,document.body.appendChild(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),300)},2e3)},[]);if(re(()=>{if(!t)return;const e=e=>{if(C[C.length-1]!==Ot)return;if(b(e.target,ht.current))return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&uo&&(e.preventDefault(),w?w():fo("bottom")),"k"===e.key&&uo&&(e.preventDefault(),v?v():fo("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,w,v,uo,fo,Ot]),!t||yn.current)return null;const po=Zt?function(e){if("undefined"==typeof document)return null;const t=Array.from(document.querySelectorAll("[data-modal-panel]")).filter(e=>{const t=e;return!t.hasAttribute("data-utility")&&!t.hasAttribute("data-widget")&&"none"!==t.style.display});t.sort((e,t)=>(e.getAttribute("data-modal-id")||"").localeCompare(t.getAttribute("data-modal-id")||""));const n=t.findIndex(t=>t.getAttribute("data-modal-id")===e),r=t.length;if(n<0||r<1)return null;const o=Math.ceil(Math.sqrt(r)),i=Math.ceil(r/o),a=Math.floor(n/o),s=n%o,l=r-o*(i-1),c=a===i-1&&l<o,u=fr(),d=(u.w-20*(o+1))/o,h=(u.h-14*(i+1)-22*i)/i,m=c?(o-l)*(d+20)/2:0;return{x:u.x+20+s*(d+20)+m,y:u.y+14+a*(h+14+22),w:d,h:h}}(Ot):null,wo=Zt&&po?X({width:po.w,height:po.h},{width:xn.w,height:xn.h}):1,yo=(()=>{if(Zt&&po){const e=wo,t=xn.w*e,n=xn.h*e,r=po.x+(po.w-t)/2-xn.x,o=po.y+(po.h-n)/2-xn.y,i=Qt||rn;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:H.expose+(i?20:10),boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(on&&_t){const e="picked"===ln;return{transition:e?"transform 640ms cubic-bezier(0.34, 1.42, 0.64, 1), box-shadow 600ms":"transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms",...e?{zIndex:H.expose+30}:{}}}return null})(),go=x({modal:!1,titleId:!V&&(Tn?!Ze?.home:!Me)?je:void 0,label:or.text||Ke}),vo=/* @__PURE__ */pe("div",{children:[
49
- /* @__PURE__ */pe("div",{ref:ht,"data-modal-panel":!0,"data-modal-id":Ot,"data-window-key":fe||void 0,...U?{"data-utility":""}:{},...Xe?{"data-pinned-top":""}:{},...V?{"data-widget":""}:{},...Ze?{"data-window-owner":Ze.key}:{},...Ze&&!Lt?{"data-window-root":""}:{},...Tn?{"data-window-tab":""}:{},...go,className:Tn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(V?Ht?"shadow-xl":"shadow-lg":"border "+(Ht?"shadow-xl border-line":"shadow-lg border-line-strong")),onPointerDown:e=>{if(!Zr.current||Zt||0!==e.button)return;const t=e.target;if(t.closest("[data-modal-panel]")!==ht.current)return;if(t.closest("[data-window-chrome]"))return;const n=e.currentTarget.getBoundingClientRect(),r=n.height/(e.currentTarget.offsetHeight||n.height),o=(to?E.compactBar:E.windowBar)*r;e.clientY-n.top>o||t.closest(h)||zr(e)},onContextMenu:e=>{const t=e.target;t.closest("[data-window-strip]")&&t.closest("[data-modal-panel]")===ht.current&&io(e)},onMouseDownCapture:e=>{if(mt.current=!1,Zt){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),Jr(Ot),qr(!1),void cr(Ot)}if(!Ht&&!V&&!Xe&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===ht.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),mt.current=!0,Je(null),cr(Ot),window.addEventListener("mouseup",()=>{setTimeout(()=>{mt.current=!1},0)},{once:!0}))}},onClickCapture:e=>{mt.current&&(mt.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(Zt)return;Je(null);e.target.closest("[data-modal-panel]")===ht.current&&(e.target.closest("button, input, a, select, textarea")||cr(Ot))},style:Me?{zIndex:Kt+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${Se}px)`,transition:Ne?"none":"transform 180ms ease-out",...V?{display:"none"}:{},...Kt<0?{display:"none"}:{},...Ht||Xe||Pe&&fe===Pe?{}:{display:"none"},...Wt?{visibility:"hidden",pointerEvents:"none"}:{}}:{zIndex:Xe?H.pinnedWindow:Kt+1,width:xn.w,height:xn.h,top:xn.y,...V&&"right"===st?{right:window.innerWidth-xn.x-xn.w}:{left:xn.x},...Kt<0&&!Xe?{display:"none"}:{},...Ce?{display:"none"}:{},...In||Pn||Wt?{visibility:"hidden",pointerEvents:"none"}:{},...yo??{}},children:[Me&&!V&&/* @__PURE__ */we("div",{onPointerDown:Ie,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),
50
- /* @__PURE__ */pe("div",{"data-window-surface":"",className:"flex min-h-0 flex-1 flex-col "+(jr?"backdrop-blur-sm":""),style:jr?{backgroundColor:Ht?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"}:void 0,children:[V?null:Tn?Ze?.home?null:/* @__PURE__ */pe(ye,{children:[
51
- /* @__PURE__ */we("h2",{id:je,"data-window-title":!0,className:"sr-only",children:or.text||Ke}),mo&&ho&&ge(
52
- /* @__PURE__ */we(ye,{children:or.actions}),ho),or.badges.length>0&&/* @__PURE__ */we("div",{"data-window-chrome":"","data-record-bar":"",className:"flex h-9 shrink-0 select-none items-center gap-2 overflow-hidden border-b border-gray-200 px-4",style:{backgroundColor:"rgb(var(--window-content-rgb))"},children:or.badges})]}):Me?null:
53
- /* @__PURE__ */pe("div",{onPointerDown:zr,onContextMenu:io,"data-window-chrome":"",..._r?{"data-window-controls-over":""}:{},...so,className:_r?`absolute left-0 z-10 flex ${no} items-center px-3 select-none focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400`:`flex items-center gap-3 ${no} px-3 shrink-0 cursor-move select-none focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400`,style:{touchAction:"none",..._r?{top:ao?3:0}:{}},children:[!Zt&&/* @__PURE__ */pe("div",{"data-window-controls":"",className:"group/controls flex shrink-0 items-center",children:[
54
- /* @__PURE__ */we("button",{type:"button",onClick:vr,"aria-label":We.close,title:We.close,className:pr,children:/* @__PURE__ */we("span",{"aria-hidden":"true",className:`${wr} ${Ht?"bg-red-500":"bg-gray-300 group-hover/controls:bg-red-500"}`,children:/* @__PURE__ */we(B,{name:"close",className:yr,strokeWidth:3})})}),!_&&/* @__PURE__ */we("button",{type:"button",onClick:()=>ur(Ot),"aria-label":We.minimize,title:We.minimize,className:pr,children:/* @__PURE__ */we("span",{"aria-hidden":"true",className:`${wr} ${Ht?"bg-amber-400":"bg-gray-300 group-hover/controls:bg-amber-400"}`,children:/* @__PURE__ */we("span",{className:"h-0.5 w-2 rounded-full bg-current opacity-0 group-hover/controls:opacity-100 group-focus-within/controls:opacity-100"})})}),!_&&/* @__PURE__ */we(Ar,{maximized:Rn,onToggleMax:()=>{Rn?(On(!1),kn(wn())):lo()},onSnap:Kr,buttonClassName:pr,strings:We,children:/* @__PURE__ */we("span",{"aria-hidden":"true",className:`${wr} ${Ht?"bg-green-500":"bg-gray-300 group-hover/controls:bg-green-500"}`,children:/* @__PURE__ */we(B,{name:Rn?"collapse":"expand",className:yr,strokeWidth:3})})}),U&&/* @__PURE__ */we("button",{type:"button",onClick:()=>Ve(e=>!e),"aria-label":Xe?We.unpin:We.pinOnTop,title:Xe?We.unpin:We.pinOnTop,className:"ml-1 p-0.5 rounded hover:bg-gray-200 "+(Xe?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */we(B,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:Xe?"currentColor":"none",strokeWidth:1.5})})]}),_r?
55
- /* @__PURE__ */we("h2",{id:je,"data-window-title":!0,className:"sr-only",children:or.text||Ke}):/* @__PURE__ */we("div",{"data-window-title":!0,title:Ke,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Ht?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:/* @__PURE__ */we("span",{id:je,className:"truncate",children:Zt?pn(Re):Re})})]}),ao&&/* @__PURE__ */we("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${Ht?.9:.55})`}}),
56
- /* @__PURE__ */we(un.Provider,{value:Ot,children:/* @__PURE__ */we(d.Provider,{value:oo,children:/* @__PURE__ */we(L.Provider,{value:{rightRef:pt,leftRef:wt,notify:()=>gt(!0),active:Ht,isDirty:tr,footerOpen:Ct&&!V&&!_&&!Z&&!Me},children:/* @__PURE__ */we("div",{ref:ft,"data-window-body":"",...V?{onPointerDown:zr,onContextMenu:e=>{e.preventDefault(),at({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${V?"p-0 cursor-move":Z||ee?"p-0":_?"p-2":"p-4"} ${V||Tn||jr?"":"backdrop-blur-sm"} ${!1===M||Z||ee?"overflow-hidden":"overflow-y-auto overscroll-contain"+(jr?Xr?" mr-1":" mb-2 mr-1":"")} ${V?"rounded-2xl select-none":""}`,style:{...V?{touchAction:"none"}:{},backgroundColor:V||jr?"transparent":Tn?"rgb(var(--window-content-rgb))":Ht?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */we(Be,{children:xe})})})})}),V&&it&&/* @__PURE__ */pe($,{minWidth:160,style:{left:it.x,top:it.y},onClose:()=>at(null),children:[
57
- /* @__PURE__ */we(W,{onClick:()=>{at(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:Ot}))},children:"Settings"}),
58
- /* @__PURE__ */we(K,{}),ue&&/* @__PURE__ */pe(ye,{children:[ue,
59
- /* @__PURE__ */we(K,{})]}),
60
- /* @__PURE__ */pe(W,{onClick:()=>{at(null),Ve(e=>!e)},children:[
61
- /* @__PURE__ */we("span",{className:"flex-1",children:"Always on Top"}),Xe&&/* @__PURE__ */we(B,{name:"check",className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
62
- /* @__PURE__ */we(K,{}),
63
- /* @__PURE__ */we(W,{onClick:()=>{at(null),vr()},children:"Close"})]}),
64
- /* @__PURE__ */pe("div",{onPointerDown:zr,ref:vt,"data-modal-footer":"",...jr?{"data-modal-footer-bare":""}:{},className:jr?"px-4 py-2 shrink-0 flex items-center justify-between text-xs select-none cursor-move"+(Xr?"":" hidden"):`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${Tn?"":" cursor-move"}${Ht&&!Tn?" backdrop-blur-sm":""}${V||_||Z||Me||!Ct?" hidden":""}`,style:jr?{touchAction:"none"}:{touchAction:"none",backgroundColor:Tn?"rgb(var(--window-footer-rgb))":Ht?"rgb(var(--window-footer-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-footer-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
65
- /* @__PURE__ */pe("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[zt&&/* @__PURE__ */we(Ue,{auto:!0}),O,
66
- /* @__PURE__ */we("div",{ref:wt,"data-modal-actions-left":!0,className:"flex items-center gap-2 shrink-0"}),null!=k&&!1!==k&&!jr&&
67
- /* @__PURE__ */we("div",{ref:bt,"data-modal-footer-facts":"",className:"min-w-0 flex-1 overflow-hidden",children:/* @__PURE__ */we("div",{ref:xt,className:"inline-flex items-center gap-2 whitespace-nowrap"+(kt?" invisible":""),children:k})})]}),
68
- /* @__PURE__ */pe("div",{"data-modal-footer-right":"",className:"flex items-center gap-2 ml-auto shrink-0",children:[Mt&&q&&(q.editing?/* @__PURE__ */we(F,{variant:"secondary",size:"sm","data-modal-discard":"",onClick:()=>{Er()},children:We.discard}):"object"==typeof q.state?/* @__PURE__ */we(F,{variant:"secondary",size:"sm","data-modal-edit":"","aria-disabled":!0,disabledReason:q.state.disabledReason,children:We.edit}):/* @__PURE__ */we(F,{variant:"secondary",size:"sm","data-modal-edit":"",onClick:()=>q.onEdit(),children:We.edit})),
69
- /* @__PURE__ */we("div",{ref:pt,"data-modal-actions":!0,className:"flex items-center gap-2"}),R]})]})]}),!V&&!Me&&!Zt&&Ht&&!zn&&/* @__PURE__ */pe(ye,{children:[
70
- /* @__PURE__ */we("div",{onPointerDown:e=>Dr(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
71
- /* @__PURE__ */we("div",{onPointerDown:e=>Dr(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
72
- /* @__PURE__ */we("div",{onPointerDown:e=>Dr(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
73
- /* @__PURE__ */we("div",{onPointerDown:e=>Dr(e,"nw"),className:"absolute top-0 left-0 w-3 h-3 cursor-nwse-resize z-10"}),
74
- /* @__PURE__ */we("div",{onPointerDown:e=>Dr(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
75
- /* @__PURE__ */we("div",{onPointerDown:e=>Dr(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
76
- /* @__PURE__ */we("div",{onPointerDown:e=>Dr(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
77
- /* @__PURE__ */we("div",{onPointerDown:e=>Dr(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),Zt&&/* @__PURE__ */we("div",{className:"absolute inset-0",style:{zIndex:H.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>tn(!0),onMouseLeave:()=>tn(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),cr(Ot),qr(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:Qt&&/* @__PURE__ */we("button",{type:"button","data-expose-close":!0,"aria-label":$e.taskbar.closeWindow,title:"Close",className:"absolute flex items-center justify-center rounded-full bg-black/55 text-on-accent shadow-lg ring-1 ring-white/40 transition-colors hover:bg-red-500",style:{top:8,right:8,width:30,height:30,transform:`scale(${1/wo})`,transformOrigin:"top right",zIndex:H.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),vr()},children:/* @__PURE__ */we(B,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),Zt&&po&&/* @__PURE__ */we("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:po.x,top:po.y+po.h+4,width:po.w,zIndex:H.expose+(Qt?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:pn(Re)})]}),bo=Ge&&/* @__PURE__ */pe($,{style:{left:Ge.x,top:Ge.y},onClose:()=>Je(null),minWidth:160,children:[!V&&!_&&!Tn&&/* @__PURE__ */pe(ye,{children:[
78
- /* @__PURE__ */pe(W,{onClick:()=>{ur(Ot),Je(null)},children:[
79
- /* @__PURE__ */we(B,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),We.minimize]}),!zn&&/* @__PURE__ */pe(W,Rn?{onClick:()=>{On(!1),kn(wn()),Je(null)},children:[
80
- /* @__PURE__ */we(B,{name:"collapse",className:"h-4 w-4",strokeWidth:1.5}),We.windowed]}:{onClick:()=>{lo(),Je(null)},children:[
81
- /* @__PURE__ */we(B,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),We.maximize]})]}),U&&!Tn&&/* @__PURE__ */pe(W,{onClick:()=>{Ve(e=>!e),Je(null)},children:[
82
- /* @__PURE__ */we(B,{name:"bookmark-square",className:"h-4 w-4 "+(Xe?"text-blue-600":""),fill:Xe?"currentColor":"none",strokeWidth:1.5}),Xe?We.unpin:We.pinOnTop]}),_e&&/* @__PURE__ */pe(W,{onClick:()=>{Je(null),ot()},children:[
83
- /* @__PURE__ */we(B,{name:"star",className:"h-4 w-4",fill:rt?"currentColor":"none",strokeWidth:1.5}),rt?$e.taskbar.removeFromDesktop:$e.taskbar.addToDesktop]}),(gn[Ot]||[]).length>0&&/* @__PURE__ */we(ye,{children:(gn[Ot]||[]).map((e,t)=>/* @__PURE__ */pe(W,{onClick:()=>{Je(null),e.onClick()},children:[e.icon,e.label]},t))}),!(Tn&&Ze?.home)&&/* @__PURE__ */pe(ye,{children:[
84
- /* @__PURE__ */we(K,{}),
85
- /* @__PURE__ */pe(W,{danger:!0,onClick:()=>{Je(null),vr()},children:[
86
- /* @__PURE__ */we(B,{name:"close",className:"h-4 w-4"}),We.close]})]})]}),xo=!!fe&&Rt.some(e=>e.id===fe),ko=!Xt||xo||V?null:/* @__PURE__ */pe("div",{"data-modal-restore-tab":!0,"data-modal-id":Ot,className:"fixed left-1/2 z-(--z-restore-tab) flex -translate-x-1/2 items-center gap-1 rounded-lg border border-line-strong bg-surface px-2 py-1 shadow-lg",style:{bottom:"calc(var(--taskbar-height, 0px) + 12px)"},children:[
87
- /* @__PURE__ */we("button",{type:"button",onClick:()=>cr(Ot),title:We.restore,className:"max-w-[16rem] truncate rounded px-2 py-0.5 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900",children:Ke||We.windowSuffix}),
88
- /* @__PURE__ */we("button",{type:"button",onClick:()=>cr(Ot),title:We.restore,"aria-label":We.restore,className:"rounded px-2 py-0.5 text-xs leading-none text-ink-faintest hover:bg-gray-100 hover:text-gray-600",children:"▴"}),
89
- /* @__PURE__ */we("button",{type:"button",onClick:()=>{vr()},title:We.close,"aria-label":We.close,className:"rounded px-2 py-0.5 text-xs leading-none text-ink-faintest hover:bg-gray-100 hover:text-gray-600",children:"✕"})]});return ge(
90
- /* @__PURE__ */pe(dn.Provider,{value:null,children:[vo,bo,ko]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{Kr&&"Escape"===e.key&&(to(null),qr(!1))});var ao=100,so={past:[],future:[]};function lo(e,t){switch(t.type){case"record":{const n=e.past[e.past.length-1];if(null!==t.step.coalesceKey&&n?.coalesceKey===t.step.coalesceKey)return 0===e.future.length?e:{...e,future:[]};const r=[...e.past,t.step];return{past:r.length>ao?r.slice(r.length-ao):r,future:[]}}case"undo":return 0===e.past.length?e:{past:e.past.slice(0,-1),future:[t.redoStep,...e.future]};case"redo":return 0===e.future.length?e:{past:[...e.past,t.undoStep],future:e.future.slice(1)};case"clear":return 0===e.past.length&&0===e.future.length?e:so}}var co=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var uo=500,ho=250;function mo({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,i]=me(lo,so),a=ne(/* @__PURE__ */new Map),[s,l]=oe(0),c=s>0,[u,d]=oe(0),[h,m]=oe(0),f=h>0,{hasAnyPerm:p}=A(),w=t&&0===u&&(!(n&&n.length>0)||p(n)),y=ne(null),g=ne(!1),v=ae(()=>{const e={};for(const[t,n]of a.current)e[t]=n.getLast();return e},[]),b=ae((e,t)=>{a.current.has(e)||l(e=>e+1),a.current.set(e,t)},[]),x=ae(e=>{a.current.delete(e)&&l(e=>e-1)},[]),k=ae(e=>{d(t=>t+(e?1:-1))},[]),E=ae(e=>{m(t=>t+(e?1:-1))},[]),[M,C]=oe(0),S=M>0,N=ae(e=>{C(t=>t+(e?1:-1))},[]),T=Q(qe),z=T?.claimReadOnly;re(()=>{if(z&&!w)return z(!0),()=>z(!1)},[z,w]);const D=T?.claimOwnMount;re(()=>{if(D&&S)return D(!0),()=>D(!1)},[D,S]);const I=ne({last:0,count:0,tripped:!1}),P=ne(!1),R=ae((e,t,n)=>{if(g.current)return void(n&&function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}(n.prev,n.next)||(P.current=!0));if(!w||y.current)return;const r=I.current;if(r.tripped)return;const o=Date.now();if(o-r.last>ho&&(r.count=0),r.last=o,++r.count>uo)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${uo} undo steps with no pause between them, which no user action can do. The value passed to useUndoable for this slice is almost certainly rebuilt on every render (a .map/.filter/object literal in the call) rather than held in state, so it reads as changed every time — and since recording a step re-renders the form, that is a loop. Undo recording is now off for this form to keep the tab responsive.`);y.current={values:v(),label:e,coalesceKey:t},queueMicrotask(()=>{const e=y.current;y.current=null,e&&i({type:"record",step:e})})},[w,v]),O=ae(e=>{for(const[t,n]of Object.entries(e)){const e=a.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),$=ae(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};O(e.values),i({type:"undo",redoStep:t})},[o.past,v,O]),W=ae(()=>{const e=o.future[0];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};O(e.values),i({type:"redo",undoStep:t})},[o.future,v,O]),[K,j]=oe(0),F=ne(0),B=ne(0),q=ne(!1),H=ae(()=>{g.current=!0,P.current=!1,y.current=null,F.current+=1,B.current=F.current,j(F.current)},[]),U=ne(void 0),Y=ae(e=>{void 0!==e&&(void 0!==U.current&&e!==U.current&&(q.current=!0),U.current=e),H()},[H]);re(()=>{g.current&&K===B.current&&(g.current=!1,y.current=null,(P.current||q.current)&&i({type:"clear"}),P.current=!1,q.current=!1)},[K]);const X=ae(()=>{q.current=!0,i({type:"clear"}),H()},[H]),V=w&&o.past.length>0,G=w&&o.future.length>0,J=Wr(r),_=ne({undo:$,redo:W,canUndo:V,canRedo:G});_.current={undo:$,redo:W,canUndo:V,canRedo:G},re(()=>{if(!J||!w)return;const e=e=>{const t=function(e){if(!e.metaKey&&!e.ctrlKey||e.altKey)return null;const t=e.key.toLowerCase(),n="z"===t?e.shiftKey?"redo":"undo":"y"!==t||!e.ctrlKey||e.metaKey||e.shiftKey?null:"redo";if(!n)return null;const r=e.target;return r?.isContentEditable||r?.tagName&&co.has(r.tagName.toUpperCase())?null:n}(e);if(!t)return;const n=_.current;("undo"===t?n.canUndo:n.canRedo)&&(e.preventDefault(),"undo"===t?n.undo():n.redo())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[J,w]);const Z=de(()=>({register:b,unregister:x,record:R,undo:$,redo:W,clear:X,baseline:Y,canUndo:V,canRedo:G,enabled:w,hasState:c,handMounted:S,claimOwnMount:N,claimReadOnly:k,declaredEditable:f,claimEditable:E,undoLabel:V?o.past[o.past.length-1].label:null,redoLabel:G?o.future[0].label:null}),[b,x,R,$,W,X,Y,V,G,w,c,S,N,k,f,E,o.past,o.future]),ee=""!==kn(),te=Q(L)?.footerOpen??!1,ie=ee&&w&&c&&!S&&te;/* @__PURE__ */
91
- return pe(qe.Provider,{value:Z,children:[ie&&/* @__PURE__ */we(En,{position:"left",quiet:!0,children:/* @__PURE__ */we(Ue,{auto:!0})}),e]})}function fo(){const e=Q(qe),t=ae(()=>{},[]);return{undo:e?.undo??t,redo:e?.redo??t,clear:e?.clear??t,baseline:e?.baseline??t,canUndo:e?.canUndo??!1,canRedo:e?.canRedo??!1,undoLabel:e?.undoLabel??null,redoLabel:e?.redoLabel??null,enabled:e?.enabled??!1,hasState:e?.hasState??!1}}function po(e){const t=Q(qe),n=t?.claimReadOnly,r=t?.claimEditable;re(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function wo(e,t,n){const r=Q(qe),o=he(),i=ne(e),a=ne(t);a.current=t,re(()=>{if(r)return r.register(o,{getLast:()=>i.current,setLast:e=>{i.current=e},apply:e=>a.current(e)}),()=>r.unregister(o)},[r,o]);const{label:s,coalesceKey:l=null}=n,c=ne(r);c.current=r;const u=ne({label:s,coalesceKey:l});u.current={label:s,coalesceKey:l},re(()=>{const t=c.current;t&&(Object.is(e,i.current)||(t.record(u.current.label,u.current.coalesceKey,{prev:i.current,next:e}),i.current=e))},[e])}function yo(e,t){const[n,r]=oe(e);return wo(n,e=>r(()=>e),t),[n,r]}export{Mn as CancelButton,ze as DesktopHostProvider,ft as DocFavStar,nt as EntityWindowFallback,et as EntityWindowLoading,rt as EntityWindowState,fn as MODAL_SUBMIT_SELECTOR,io as Modal,En as ModalActions,Ue as UndoControls,mo as UndoProvider,Se as WINDOW_REGISTRY,Fe as WindowCrashedFallback,Be as WindowErrorBoundary,Rt as WindowManagerProvider,bn as WindowTitle,bt as activateWindowById,Vt as beginWindowGesture,ir as cancelWindowFront,Ne as client_default,no as commitExposeHighlight,or as confirmWindowDiscard,Gt as drainPerfEvents,Ur as exitExposeMode,On as forgetMaximizedWindowBoxes,Et as getActiveWindowRoute,eo as getExposeHighlight,cn as getWindowChromeVersion,Pn as getWindowPosition,it as isDraftEntityId,at as isDraftEntityWindow,Ee as isEntityEntry,ke as isPageEntry,Le as isShellApiClientConfigured,Je as isTabWindow,Xt as markMenuOpen,sn as readWindowChrome,tr as requestWindowFront,to as setExposeHighlight,Yt as setPerfCollecting,Oe as setShellHomeRoute,je as setShellTabStrip,Ce as setShellWindowRegistry,In as setWindowDefaultPosition,Rn as setWindowPosition,en as splitTitle,Qr as subscribeExposeHighlight,ln as subscribeWindowChrome,_e as tabGroupOf,Hr as toggleExposeMode,_n as useCurrentTabKey,Ae as useDesktopHost,kn as useEnclosingModalId,Wr as useIsActiveWindow,Ie as usePageSearch,fo as useUndo,po as useUndoCanEdit,wo as useUndoable,yo as useUndoableState,yn as useWidgetSettings,ct as useWindowDirty,dt as useWindowManager,vn as useWindowMenuItem,xn as useWindowTitle,rr as windowHoldsChanges};
@@ -1,2 +0,0 @@
1
- import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineTrack as n,TimelineMilestoneIcon as s}from"./chunk-LKAGXURQ.js";import{toDayMs as i,fmtSliderDate as t}from"./chunk-5CFERCYW.js";import{DAY_MS as a}from"./chunk-JRQMX4PK.js";import{useBrowserValueOnce as l}from"./chunk-WCCS4VFE.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-IUVGHHR3.js";import{jsx as h}from"react/jsx-runtime";function m({title:m,heading:d,subject:c,milestones:p,summary:u,endDate:g,phaseLabels:k,variant:v="card",edgeCaptions:f,highlightKeys:y=null,onHoverChange:b}){const j=l(Date.now,null),C=[],M=[],x=o().timeline,H=r();for(const e of p){const n=i(e.date??null);null===n?M.push({key:e.key,label:e.label,kind:e.kind}):C.push({...e,ms:n})}C.sort((e,n)=>e.ms-n.ms);const K=i(g??null);let L,R,w=!0;0===C.length?(R=K??j??0,L=R-30*a,w=null!==K||null!==j):(L=C[0].ms,R=K??C[C.length-1].ms,R-L<a&&(R=L+a));const N=C.length>0?Math.max(0,Math.round((R-L)/a)):0,O=u??(N>0?x.duration(N):void 0),D=[C.length>0?x.started(t(C[0].ms,H)):void 0,O,M.length>0?x.reached(C.length,p.length):void 0],E=C.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(n=e.kind,"dfm"===n?1:0),caption:e.caption,provisional:e.provisional};var n}),F={};for(const e of C)e.phase&&(F[e.phase]=F[e.phase]||[]).push(e.ms);const G=Object.entries(F).filter(([,e])=>e.length>=2).map(([e,n])=>({key:e,label:k?.[e]??e,minMs:Math.min(...n),maxMs:Math.max(...n)})),Q="rail"===v,S=w&&/* @__PURE__ */h("div",{className:"select-none",children:/* @__PURE__ */h(n,{axis:Q?"spread":"compressed",labels:Q?"none":"lanes",items:E,pending:M,phases:G,startMs:L,endMs:R,todayMs:j??void 0,edgeCaptions:f,highlightKeys:y,onHoverChange:b,ariaLabel:x.milestones(m)})});/* @__PURE__ */
2
- return h("div",Q?{className:"shrink-0","data-timeline-variant":"rail",children:S}:{className:"shrink-0",children:/* @__PURE__ */h(e,{icon:/* @__PURE__ */h(s,{}),heading:d??m,subject:c,meta:D,children:S})})}export{m as MilestoneTimeline};
@@ -1,24 +0,0 @@
1
- import{Dialog as e}from"./chunk-UTQN5AIO.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{HEADING_TEXT as n}from"./chunk-BWJZTHZ6.js";import{buttonClasses as t}from"./chunk-UQYNPYF4.js";import{useShellStrings as o,splitAround as l}from"./chunk-IUVGHHR3.js";import{createContext as i,useContext as s,useState as c,useRef as a,useCallback as u,useEffect as d}from"react";import{jsxs as m,jsx as h,Fragment as f}from"react/jsx-runtime";var p=i(()=>Promise.resolve(!1)),g=()=>s(p),b=()=>Promise.resolve(!1),v=e=>b(e),y=()=>Promise.resolve(!1),x=e=>y(e),N=()=>Promise.resolve(null),k=e=>N(e),w={danger:{icon:"text-red-600 bg-red-100",button:t({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:t({variant:"warning"})},info:{icon:"text-blue-600 bg-accent-tint-strong",button:t({variant:"primary"})}},C=t({variant:"secondary"}),P=t({variant:"primary"}),L="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function j(){/* @__PURE__ */
2
- return h(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function F({children:r}){const[t,i]=c(!1),[s,g]=c({message:""}),[v,x]=c(0),k=a(),F=a(null),T=a(0),E=a([]),$=a(null),D=a(null),H=u(e=>{F.current=e.id,k.current=e.resolve,x(e.id),g(e.options),i(!0)},[]),I=u(e=>{const r="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++T.current,options:r,resolve:e};null===F.current?H(n):E.current.push(n)})},[H]),[U,V]=c(!1),[W,K]=c({message:""}),[O,Q]=c(""),R=a(),S=u(e=>(K(e),Q(""),V(!0),new Promise(e=>{R.current=e})),[]),[Y,Z]=c(!1),[A,B]=c({}),[G,J]=c(""),q=a(),z=u(e=>{const r="string"==typeof e?{message:e}:e;return B(r),J(r.defaultValue??""),Z(!0),new Promise(e=>{q.current=e})},[]);d(()=>{b=I,y=S,N=z},[I,S,z]);const M=(e,r)=>{if(F.current!==e)return;const n=k.current,t=E.current.shift();t?H(t):(F.current=null,k.current=void 0,i(!1)),n?.(r)},X=e=>{V(!1),Q(""),R.current?.(e)},_=e=>{if(e){const e=G.trim();if(!e&&!A.allowEmpty)return Z(!1),void q.current?.(null);Z(!1),q.current?.(e)}else Z(!1),q.current?.(null)},ee=s.variant||(s.confirmLabel?.toLowerCase().includes("delete")||s.message.toLowerCase().includes("delete")?"danger":"info"),re=w[ee],ne=w["warning"===W.variant?"warning":"danger"],te=W.confirmWord,oe=null==te||O===te,le=o().dialog,[ie,se]=l(le.typeToConfirm);/* @__PURE__ */
3
- return m(p.Provider,{value:I,children:[r,
4
- /* @__PURE__ */h(e,{open:t,onClose:()=>M(v,!1),initialFocus:$,footer:/* @__PURE__ */m(f,{children:[
5
- /* @__PURE__ */h("button",{ref:$,type:"button",onClick:()=>M(v,!1),className:C,children:s.cancelLabel||le.cancel}),
6
- /* @__PURE__ */h("button",{type:"button",onClick:()=>M(v,!0),className:re.button,children:s.confirmLabel||le.ok})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
7
- /* @__PURE__ */h("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${re.icon}`,children:/* @__PURE__ */h(j,{})}),
8
- /* @__PURE__ */m("div",{className:"flex-1",children:[
9
- /* @__PURE__ */h("h2",{className:n,children:s.title||le.confirmTitle}),
10
- /* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:s.message})]})]})}),
11
- /* @__PURE__ */h(e,{open:U,onClose:()=>X(!1),initialFocus:null!=te?void 0:D,footer:/* @__PURE__ */m(f,{children:[
12
- /* @__PURE__ */h("button",{ref:D,type:"button",onClick:()=>X(!1),className:C,children:W.cancelLabel||le.destructiveCancel}),
13
- /* @__PURE__ */h("button",{type:"button",onClick:()=>X(!0),disabled:!oe,className:ne.button,children:te??W.confirmLabel??le.destructiveConfirm})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
14
- /* @__PURE__ */h("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ne.icon}`,children:/* @__PURE__ */h(j,{})}),
15
- /* @__PURE__ */m("div",{className:"flex-1",children:[
16
- /* @__PURE__ */h("h2",{className:`${n} pr-6`,children:W.title||le.destructiveTitle}),
17
- /* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:W.message}),null!=te&&/* @__PURE__ */m(f,{children:[
18
- /* @__PURE__ */m("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
19
- /* @__PURE__ */h("kbd",{className:"rounded border border-line-strong bg-surface-sunken px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:te}),se]}),
20
- /* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:O,onChange:e=>Q(e.target.value),onKeyDown:e=>{"Enter"===e.key&&O===te&&X(!0)},placeholder:te,className:`mt-2 ${L} focus:border-red-500`})]})]})]})}),
21
- /* @__PURE__ */m(e,{open:Y,onClose:()=>_(!1),title:A.title||le.promptTitle,footer:/* @__PURE__ */m(f,{children:[
22
- /* @__PURE__ */h("button",{type:"button",onClick:()=>_(!1),className:C,children:A.cancelLabel||le.cancel}),
23
- /* @__PURE__ */h("button",{type:"button",onClick:()=>_(!0),disabled:!A.allowEmpty&&!G.trim(),className:P,children:A.confirmLabel||le.ok})]}),children:[A.message&&/* @__PURE__ */h("p",{className:"text-sm text-gray-600",children:A.message}),
24
- /* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:G,onChange:e=>J(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:A.placeholder,className:`mt-3 ${L} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{F as ConfirmProvider,v as confirm,x as confirmDestructive,k as prompt,g as useConfirm};
@@ -1,8 +0,0 @@
1
- import{DragBand as e,tooltipBesideBand as t}from"./chunk-KNZ7YTFH.js";import{niceAxis as r,niceMax as i,linearScale as n,axisGutter as o,bandScale as l}from"./chunk-2JWPNR2U.js";import{CHART_INK as a}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as h}from"./chunk-TWVUQUUD.js";import{usePlotWidth as s}from"./chunk-MAFUXCPZ.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-IUVGHHR3.js";import{formatPlain as d}from"./chunk-C3QOHMR6.js";import{useRef as u,useState as f,useId as g,useEffect as p}from"react";import{jsx as x,jsxs as y}from"react/jsx-runtime";function v({labels:v,values:b,height:k=220,width:M,bandPadding:w=.24,min:N,max:A,yTickCount:$=4,formatValue:j,yAxisLabel:P,xTickAnchor:R="center",children:U,overlay:E,tooltip:z,onSelect:D,zoom:C,ariaLabel:F,className:I,emptyLabel:L}){const S=c().charts,T=m(),V=j??(e=>d(e,T)),H=L??S.noData,W=u(null),Z=s(W),B=M??Z,[K,Q]=f(null),G=g();if(p(()=>{if(null!==K)return h(e=>"Escape"===e.key&&(Q(null),!0))},[K]),0===v.length||!b.some(Number.isFinite))/* @__PURE__ */
2
- return x("div",{className:I,ref:W,children:/* @__PURE__ */x("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:H})});const J=b.filter(Number.isFinite),O=J.every(Number.isInteger),X=void 0===N&&void 0===A?r(Math.min(0,...J),Math.max(0,...J),{intervals:$+1,integer:O}):null,Y=void 0!==N&&void 0===A?r(N,Math.max(N,...J),{intervals:$+1,integer:O,zero:!1}):null,q=X?X.lo:N??Math.min(0,...J),_=X?X.hi:Y?Y.hi:A??i(Math.max(...J,0)),ee=X?X.ticks:Y?[q,...Y.ticks.filter(e=>e>q)]:n([q,_],{from:0,to:1}).ticks($+1),te={top:12,right:16,bottom:26,left:o(ee.map(V),48)+(P?10:0)},re=te.left,ie=Math.max(re+1,B-te.right),ne=te.top,oe=k-te.bottom,le=n([q,_],{from:oe,to:ne}),ae=l(v.length,{from:re,to:ie},w),he=(ie-re)/Math.max(1,v.length),se=he>=48,ce=se?1:Math.max(1,Math.ceil(v.length/Math.max(1,Math.floor(B/84)))),me=Math.max(2,Math.floor((he-6)/6.6)),de=e=>se&&e.length>me?`${e.slice(0,me-1).trimEnd()}…`:e;/* @__PURE__ */
3
- return y("div",{className:`relative ${I??""}`,ref:W,children:[
4
- /* @__PURE__ */y("svg",{width:"100%",height:k,viewBox:`0 0 ${B} ${k}`,role:"img","aria-label":F,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Q(null),onBlur:()=>Q(null),onKeyDown:e=>{if(D&&null!==K&&("Enter"===e.key||" "===e.key))return e.preventDefault(),void D(K);if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1;Q(e=>Math.min(v.length-1,Math.max(0,(e??0)+t)))},style:C?{userSelect:"none",touchAction:"pan-y"}:void 0,children:[
5
- /* @__PURE__ */x("defs",{children:/* @__PURE__ */x("clipPath",{id:G,children:/* @__PURE__ */x("rect",{x:re,y:ne,width:ie-re,height:oe-ne})})}),ee.map(e=>/* @__PURE__ */x("line",{x1:re,y1:le(e),x2:ie,y2:le(e),stroke:a.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
6
- /* @__PURE__ */x("line",{x1:re,y1:le(Math.max(q,0)),x2:ie,y2:le(Math.max(q,0)),stroke:a.axis,strokeWidth:1,shapeRendering:"crispEdges"}),ee.map(e=>/* @__PURE__ */x("text",{x:re-8,y:le(e)+4,textAnchor:"end",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:V(e)},`t${e}`)),P&&/* @__PURE__ */x("text",{x:14,y:(ne+oe)/2,transform:`rotate(-90 14 ${(ne+oe)/2})`,textAnchor:"middle",fontSize:11,fill:a.label,children:P}),
7
- /* @__PURE__ */x("g",{clipPath:`url(#${G})`,children:U({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:B,height:k,clipId:G,active:K})}),E?.({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:B,height:k,clipId:G,active:K}),v.map((e,t)=>t%ce===0?/* @__PURE__ */x("text",{x:"start"===R?ae(t):ae.center(t),y:k-8,textAnchor:"middle",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:de(e)},`x${t}`):null),C?.drag&&/* @__PURE__ */x(e,{x0:ae.center(C.drag[0])-(ie-re)/v.length/2,x1:ae.center(C.drag[1])+(ie-re)/v.length/2,top:ne,bottom:oe}),v.map((e,t)=>/* @__PURE__ */x("rect",{x:ae.center(t)-(ie-re)/v.length/2,y:ne,width:(ie-re)/v.length,height:oe-ne,fill:"transparent",onMouseEnter:()=>Q(t),onPointerDown:C?()=>C.press(t):void 0,onPointerEnter:C?()=>C.over(t):void 0,onPointerUp:C?.release,onClick:D?()=>D(t):void 0,style:D?{cursor:"pointer"}:void 0},`h${t}`))]}),z&&null!==K&&
8
- /* @__PURE__ */x("div",{className:"pointer-events-none absolute top-2 z-10",style:t(ae.center(K),ae.bandwidth,B),children:z(K)})]})}export{v as CartesianPlot};