efficient-shell 13.15.0 → 13.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/README.md +20 -1
  2. package/dist/Browser-547OGMQH.js +44 -0
  3. package/dist/Calculator-4UBMDAJO.js +29 -0
  4. package/dist/CurrencyConverter-H3HHXXKT.js +21 -0
  5. package/dist/{Files-EN4DDZYV.js → Files-GPPTZPDS.js} +80 -80
  6. package/dist/Notepad-GAZ7CZQB.js +24 -0
  7. package/dist/PdfViewer-EELX35ZI.js +1 -0
  8. package/dist/PomodoroTimer-JVCYYGRD.js +91 -0
  9. package/dist/{Preview-OSQHIS3Z.js → Preview-GSD54EUE.js} +33 -33
  10. package/dist/Sidebar-UCCVJFSY.js +44 -0
  11. package/dist/{Stock-2P4NWUNB.js → Stock-S266KGAF.js} +4 -4
  12. package/dist/{Weather-7LIQ4POB.js → Weather-TE4TTTQA.js} +22 -22
  13. package/dist/{WorldClock-KHBYIJQZ.js → WorldClock-5TPBHBYA.js} +7 -7
  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/charts/BoxPlotChart.js +1 -1
  21. package/dist/charts/CandlestickChart.js +1 -1
  22. package/dist/charts/CartesianPlot.js +1 -1
  23. package/dist/charts/ChordChart.js +1 -1
  24. package/dist/charts/ColumnChart.js +1 -1
  25. package/dist/charts/FlowChart.js +1 -1
  26. package/dist/charts/FunnelChart.js +1 -1
  27. package/dist/charts/HeatmapChart.js +1 -1
  28. package/dist/charts/HistogramChart.js +1 -1
  29. package/dist/charts/PieChart.js +1 -1
  30. package/dist/charts/RadarChart.js +1 -1
  31. package/dist/charts/RadialBarChart.js +1 -1
  32. package/dist/charts/RangeChart.js +1 -1
  33. package/dist/charts/SankeyChart.js +1 -1
  34. package/dist/charts/ScatterChart.js +1 -1
  35. package/dist/charts/SpecChart.js +1 -1
  36. package/dist/charts/SunburstChart.js +1 -1
  37. package/dist/charts/TimeSeriesChart.js +1 -1
  38. package/dist/charts/TreemapChart.js +1 -1
  39. package/dist/charts/WaterfallChart.js +1 -1
  40. package/dist/{chunk-JNSRDEB6.js → chunk-2J3C2RR4.js} +10 -10
  41. package/dist/{chunk-D3T3JCUC.js → chunk-34HRPEQD.js} +1 -1
  42. package/dist/{chunk-PT4GMPUB.js → chunk-3SIRRK3F.js} +3 -3
  43. package/dist/{chunk-OWAYSIQH.js → chunk-42DF7CDB.js} +5 -5
  44. package/dist/{chunk-4OBSVO6U.js → chunk-4G7PJ325.js} +1 -1
  45. package/dist/{chunk-3OUG6QAD.js → chunk-5EHIWKUZ.js} +1 -1
  46. package/dist/chunk-5URXJCNC.js +2 -0
  47. package/dist/{chunk-OEPQIIYL.js → chunk-63E4ZZYI.js} +1 -1
  48. package/dist/{chunk-CKTFXTJL.js → chunk-6OCA7RKQ.js} +1 -1
  49. package/dist/{chunk-HVHIXX6O.js → chunk-6OGX7V7L.js} +10 -10
  50. package/dist/{chunk-WP43XYL6.js → chunk-6QH7I2V5.js} +2 -2
  51. package/dist/{chunk-G53Y6EPJ.js → chunk-7CBWSLCW.js} +13 -13
  52. package/dist/{chunk-DVVB2CY5.js → chunk-7I5RJPY7.js} +1 -1
  53. package/dist/{chunk-22N3KA7A.js → chunk-7IXU4YT4.js} +4 -4
  54. package/dist/{chunk-VYHVIKP6.js → chunk-7SVSHJOO.js} +10 -10
  55. package/dist/{chunk-XEPA5J6K.js → chunk-A7VNKVZO.js} +4 -4
  56. package/dist/{chunk-I6JTDAOB.js → chunk-BNPWUCZX.js} +1 -1
  57. package/dist/{chunk-M5K4AX4E.js → chunk-BUFAJJDZ.js} +1 -1
  58. package/dist/{chunk-WJ7U6TGK.js → chunk-BVX7LUAW.js} +4 -4
  59. package/dist/chunk-BWQHABH7.js +4 -0
  60. package/dist/{chunk-G4D2WM3J.js → chunk-BZRFD4DK.js} +3 -3
  61. package/dist/{chunk-U6DRRCCG.js → chunk-C5OPAULN.js} +1 -1
  62. package/dist/{chunk-MEF4JVXP.js → chunk-CCLK2RPQ.js} +14 -14
  63. package/dist/{chunk-IJNQ2BUY.js → chunk-CILE3ZCC.js} +2 -2
  64. package/dist/{chunk-KC3EX26K.js → chunk-DPFEQQQU.js} +1 -1
  65. package/dist/{chunk-ZYU5HAIC.js → chunk-E7BQZL7X.js} +1 -1
  66. package/dist/{chunk-XHD6Q6JV.js → chunk-EFO72DEI.js} +1 -1
  67. package/dist/{chunk-YM2Z4LZ2.js → chunk-EFVQQF6F.js} +17 -17
  68. package/dist/{chunk-GO2TZ35U.js → chunk-EJOKROMB.js} +1 -1
  69. package/dist/{chunk-4IYHQNKZ.js → chunk-ENDYHUUR.js} +1 -1
  70. package/dist/{chunk-4F3SUYN5.js → chunk-ETQ45TBW.js} +1 -1
  71. package/dist/chunk-EX3DARI3.js +7 -0
  72. package/dist/{chunk-JPCPO4MX.js → chunk-EZYXY67W.js} +8 -8
  73. package/dist/chunk-F2RAIGCG.js +6 -0
  74. package/dist/{chunk-ZDMZM7HD.js → chunk-FBZUEZK7.js} +2 -2
  75. package/dist/{chunk-GURY4WS5.js → chunk-FFRJ6QZK.js} +1 -1
  76. package/dist/{chunk-F5B5WOQ7.js → chunk-FKMARSJZ.js} +2 -2
  77. package/dist/chunk-FMLUQCFB.js +2 -0
  78. package/dist/chunk-FRTDUHQF.js +1 -0
  79. package/dist/{chunk-AWWNMSDN.js → chunk-FXSGIT53.js} +10 -10
  80. package/dist/{chunk-YMHCLK3F.js → chunk-FZYUTZEV.js} +10 -10
  81. package/dist/chunk-G2JPTPRS.js +13 -0
  82. package/dist/{chunk-YDFDTRZF.js → chunk-G7SILKUY.js} +5 -5
  83. package/dist/{chunk-DEYVAMJQ.js → chunk-GEITUFYK.js} +13 -13
  84. package/dist/{chunk-GSLZ46DJ.js → chunk-GMLOMLCS.js} +13 -13
  85. package/dist/{chunk-6LS6Q77E.js → chunk-GUSENWAH.js} +1 -1
  86. package/dist/{chunk-YDQBELHJ.js → chunk-H5PSCQJ2.js} +6 -6
  87. package/dist/{chunk-J6QC45OS.js → chunk-HC5KQZFG.js} +5 -5
  88. package/dist/{chunk-LXPDURUL.js → chunk-HMOKKMIV.js} +2 -2
  89. package/dist/{chunk-RFR2K7JO.js → chunk-HPHDLN6E.js} +2 -2
  90. package/dist/{chunk-I5EVMLPB.js → chunk-IJ4JX6WP.js} +4 -4
  91. package/dist/{chunk-UGEX7SVM.js → chunk-IUQJGFEO.js} +8 -8
  92. package/dist/{chunk-5HBAJ2UA.js → chunk-J4CVYOY3.js} +13 -13
  93. package/dist/{chunk-CUZQVBPC.js → chunk-JDLJ7DHV.js} +1 -1
  94. package/dist/chunk-JPE4TYRQ.js +14 -0
  95. package/dist/{chunk-4Q2CZ4US.js → chunk-JPSWWIBW.js} +6 -6
  96. package/dist/{chunk-XOQGBU25.js → chunk-K2FVP22A.js} +1 -1
  97. package/dist/{chunk-7RGHV3J5.js → chunk-KGAYYSFE.js} +6 -6
  98. package/dist/{chunk-KLUCEASW.js → chunk-KQCJWK55.js} +6 -6
  99. package/dist/{chunk-OLSA36VX.js → chunk-KSK4VZIM.js} +6 -6
  100. package/dist/{chunk-ZNKZ6J65.js → chunk-L4ZQY4ZG.js} +3 -3
  101. package/dist/chunk-LADP6AJY.js +9 -0
  102. package/dist/{chunk-W6NGPSMM.js → chunk-LGGATDPH.js} +17 -17
  103. package/dist/{chunk-PALWXHBQ.js → chunk-LKAGXURQ.js} +20 -20
  104. package/dist/chunk-LNCAIY64.js +15 -0
  105. package/dist/chunk-LQCNIQ3I.js +8 -0
  106. package/dist/{chunk-QQK7HKNK.js → chunk-LUCO5PS6.js} +1 -1
  107. package/dist/chunk-M6UKCZHT.js +2 -0
  108. package/dist/{chunk-QVQO3EFL.js → chunk-MHQW6NAE.js} +11 -11
  109. package/dist/{chunk-VCR3RADH.js → chunk-MVOYVN3S.js} +1 -1
  110. package/dist/{chunk-N2FX4O3H.js → chunk-MZ3JADHG.js} +1 -1
  111. package/dist/{chunk-SV5RRBVA.js → chunk-NWS5G7FE.js} +1 -1
  112. package/dist/{chunk-UXGNF3OG.js → chunk-OF5X4HKC.js} +1 -1
  113. package/dist/{chunk-JFRBUVHX.js → chunk-OIEFMLYI.js} +3 -3
  114. package/dist/{chunk-A4WNUFLT.js → chunk-OOGUQEPT.js} +1 -1
  115. package/dist/chunk-OUYGLDQN.js +24 -0
  116. package/dist/chunk-OXWBSZL2.js +23 -0
  117. package/dist/{chunk-NISLELJF.js → chunk-P4J26R5P.js} +1 -1
  118. package/dist/{chunk-TTLVTJR6.js → chunk-POQUUMRS.js} +2 -2
  119. package/dist/{chunk-2YK6ZB7C.js → chunk-PPLPDP6D.js} +1 -1
  120. package/dist/chunk-PTYB2GGI.js +1 -0
  121. package/dist/{chunk-QIPO4EVJ.js → chunk-Q4MOT7TY.js} +1 -1
  122. package/dist/{chunk-7TJZ5AJE.js → chunk-QNXTVDIC.js} +6 -6
  123. package/dist/{chunk-7JG64RQW.js → chunk-QSJMLHBD.js} +1 -1
  124. package/dist/{chunk-7NO4IENQ.js → chunk-R5WBDXI2.js} +1 -1
  125. package/dist/{chunk-NYKOATR5.js → chunk-RDETBXMP.js} +1 -1
  126. package/dist/{chunk-I6QVXM2M.js → chunk-RDVC32EV.js} +15 -15
  127. package/dist/chunk-RJVIKGHJ.js +4 -0
  128. package/dist/{chunk-ZOCE74ED.js → chunk-SF4IIV5Z.js} +2 -2
  129. package/dist/{chunk-RZ3OQFOD.js → chunk-SHHRC5XK.js} +8 -8
  130. package/dist/{chunk-OBZZLLMQ.js → chunk-SLEA47VA.js} +1 -1
  131. package/dist/chunk-SM3N5UJ2.js +69 -0
  132. package/dist/{chunk-F6UJLCMI.js → chunk-SUSJFGXN.js} +9 -9
  133. package/dist/{chunk-FTKLODQK.js → chunk-SXHV5OLA.js} +1 -1
  134. package/dist/{chunk-65FZQ572.js → chunk-SZFULV7I.js} +6 -6
  135. package/dist/{chunk-HZ7TUMNL.js → chunk-TB2ARUE2.js} +1 -1
  136. package/dist/{chunk-G67CJAQ2.js → chunk-TD3ZQD5R.js} +1 -1
  137. package/dist/chunk-THAPVKEJ.js +15 -0
  138. package/dist/{chunk-GKNF53YM.js → chunk-TKCCJRPE.js} +1 -1
  139. package/dist/{chunk-HNIIDDLJ.js → chunk-TNALBYLY.js} +1 -1
  140. package/dist/{chunk-6CDWPEND.js → chunk-TPKNHQIE.js} +8 -8
  141. package/dist/{chunk-42RCQEEJ.js → chunk-U5RG34NE.js} +11 -11
  142. package/dist/{chunk-VADWTS7H.js → chunk-UFWBPTCM.js} +5 -5
  143. package/dist/{chunk-23LK4PLJ.js → chunk-UGEA3C5C.js} +5 -5
  144. package/dist/{chunk-EVYD6UFQ.js → chunk-UTISUEO4.js} +2 -2
  145. package/dist/chunk-UTQN5AIO.js +6 -0
  146. package/dist/chunk-UVHXVSB2.js +1 -0
  147. package/dist/{chunk-QMBMK6PP.js → chunk-VKZC3NPM.js} +2 -2
  148. package/dist/chunk-VLX7L2AM.js +1 -0
  149. package/dist/{chunk-UZFFSZFI.js → chunk-VQBKRBBR.js} +1 -1
  150. package/dist/{chunk-GLUJS42B.js → chunk-VY3UA6AR.js} +1 -1
  151. package/dist/chunk-WCCS4VFE.js +1 -0
  152. package/dist/{chunk-P5C7DI5A.js → chunk-WPGSU4QG.js} +5 -5
  153. package/dist/{chunk-WLG7BE55.js → chunk-WRV6QKJN.js} +1 -1
  154. package/dist/{chunk-LHHJHTWP.js → chunk-WZWSFYXJ.js} +1 -1
  155. package/dist/{chunk-S6YEPA4I.js → chunk-X4E4RPFE.js} +5 -5
  156. package/dist/{chunk-M7W63T6H.js → chunk-XAT2MKNU.js} +8 -8
  157. package/dist/chunk-XD3M5ZXM.js +7 -0
  158. package/dist/{chunk-QOYKBINM.js → chunk-XQVGBVHC.js} +1 -1
  159. package/dist/{chunk-CGKY4ZRA.js → chunk-XU4I2DMR.js} +2 -2
  160. package/dist/{chunk-E6FDUFPH.js → chunk-XVMCSUAV.js} +1 -1
  161. package/dist/chunk-XXTAMF3O.js +28 -0
  162. package/dist/{chunk-6HYO2W3O.js → chunk-YCXQDUTW.js} +5 -5
  163. package/dist/{chunk-WU2ZA6J2.js → chunk-YDJ5IZOU.js} +1 -1
  164. package/dist/{chunk-LLYMOV4S.js → chunk-YQ5JHHLE.js} +1 -1
  165. package/dist/{chunk-BWLC56GZ.js → chunk-YT5HMLC7.js} +1 -1
  166. package/dist/{chunk-G4PPHQ23.js → chunk-YWMCW5BN.js} +1 -1
  167. package/dist/{chunk-WF4A2HSB.js → chunk-ZCN5BU4U.js} +1 -1
  168. package/dist/{chunk-HY6CBG4M.js → chunk-ZDFMYAQB.js} +1 -1
  169. package/dist/chunk-ZDXRSY2Y.js +1 -0
  170. package/dist/chunk-ZI2FDUYJ.js +99 -0
  171. package/dist/chunk-ZISKHQZY.js +3 -0
  172. package/dist/{chunk-DVHRL3G6.js → chunk-ZVDYRXNP.js} +6 -6
  173. package/dist/{chunk-3DWVSQIJ.js → chunk-ZYKY4Z7R.js} +1 -1
  174. package/dist/data/DataTable.js +1 -1
  175. package/dist/data/EntityList.js +1 -1
  176. package/dist/data/Gantt.js +1 -1
  177. package/dist/data/Kanban.js +1 -1
  178. package/dist/data/ListLoadError.js +1 -1
  179. package/dist/data/ResizableTable.js +1 -1
  180. package/dist/data/statusColumn.js +1 -1
  181. package/dist/data/useColumnConfig.js +1 -1
  182. package/dist/data/useSort.js +1 -1
  183. package/dist/forms/AlignmentGrid.js +1 -1
  184. package/dist/forms/BorderInput.js +1 -1
  185. package/dist/forms/BrandAssetEditor.js +1 -1
  186. package/dist/forms/Button.js +1 -1
  187. package/dist/forms/Calendar.js +1 -1
  188. package/dist/forms/ColorPicker.js +1 -1
  189. package/dist/forms/ComposerAttachments.js +1 -1
  190. package/dist/forms/CornersInput.js +1 -1
  191. package/dist/forms/DatePicker.js +1 -1
  192. package/dist/forms/DateRangePicker.js +1 -1
  193. package/dist/forms/DisplayChips.js +1 -1
  194. package/dist/forms/FilePicker.js +1 -1
  195. package/dist/forms/IconButton.js +1 -1
  196. package/dist/forms/IconPicker.js +1 -1
  197. package/dist/forms/Input.js +1 -1
  198. package/dist/forms/InputNumber.js +1 -1
  199. package/dist/forms/LinkPicker.js +1 -1
  200. package/dist/forms/MediaLibrary.js +1 -1
  201. package/dist/forms/MediaUploadField.js +1 -1
  202. package/dist/forms/MediaUploadGrid.js +1 -1
  203. package/dist/forms/MediaUsedInList.js +1 -1
  204. package/dist/forms/NumericKeypad.js +1 -1
  205. package/dist/forms/PictureTiles.js +1 -1
  206. package/dist/forms/PositionInput.js +1 -1
  207. package/dist/forms/RenameField.js +1 -1
  208. package/dist/forms/Segmented.js +1 -1
  209. package/dist/forms/Select.js +1 -1
  210. package/dist/forms/SidesInput.js +1 -1
  211. package/dist/forms/Slider.js +1 -1
  212. package/dist/forms/Snippet.js +1 -1
  213. package/dist/forms/SplitButton.js +1 -1
  214. package/dist/forms/TagInput.js +1 -1
  215. package/dist/forms/TextToolbar.js +1 -1
  216. package/dist/forms/UnitMenu.js +1 -1
  217. package/dist/forms/WidthsBar.js +1 -1
  218. package/dist/forms/dropdownPosition.js +1 -1
  219. package/dist/hooks/index.d.ts +29 -0
  220. package/dist/hooks/index.js +2 -0
  221. package/dist/hooks/useTheme.js +1 -1
  222. package/dist/icons/brands.node.js +1 -1
  223. package/dist/icons/efficient-glyphs.js +1 -1
  224. package/dist/icons/efficient-looks.js +1 -1
  225. package/dist/icons/efficient.js +1 -1
  226. package/dist/icons/looks/map.js +1 -1
  227. package/dist/icons/payment.js +1 -1
  228. package/dist/icons/sets.js +1 -1
  229. package/dist/index.d.ts +4 -40
  230. package/dist/index.js +335 -335
  231. package/dist/map/index.js +7 -7
  232. package/dist/markdown/index.js +1 -1
  233. package/dist/page-tabs/index.js +5 -5
  234. package/dist/pdf/index.js +1 -1
  235. package/dist/shell/AppUpdateBanner.js +1 -1
  236. package/dist/shell/ColoredBadge.js +1 -1
  237. package/dist/shell/ConfirmDialog.js +1 -1
  238. package/dist/shell/ContextMenu.js +1 -1
  239. package/dist/shell/Dialog.js +1 -1
  240. package/dist/shell/Drawer.js +1 -1
  241. package/dist/shell/DropdownMenu.js +1 -1
  242. package/dist/shell/EditableGrid.js +1 -1
  243. package/dist/shell/FitFrame.d.ts +46 -0
  244. package/dist/shell/FitFrame.js +2 -0
  245. package/dist/shell/FloatingBar.js +1 -1
  246. package/dist/shell/GlobalSearch.js +1 -1
  247. package/dist/shell/HelpCenter.js +1 -1
  248. package/dist/shell/IconRail.js +1 -1
  249. package/dist/shell/ImageLightbox.js +1 -1
  250. package/dist/shell/ItemCount.js +1 -1
  251. package/dist/shell/Kbd.js +1 -1
  252. package/dist/shell/LanguageSelect.js +1 -1
  253. package/dist/shell/Markdown.js +1 -1
  254. package/dist/shell/MilestoneTimeline.js +1 -1
  255. package/dist/shell/Popover.js +1 -1
  256. package/dist/shell/PopupMenu.js +1 -1
  257. package/dist/shell/ProductionTimeline.js +1 -1
  258. package/dist/shell/ResizeHandle.js +1 -1
  259. package/dist/shell/SearchableSelect.js +1 -1
  260. package/dist/shell/SettingReset.js +1 -1
  261. package/dist/shell/ShellPrefs.js +1 -1
  262. package/dist/shell/SidebarLayout.js +1 -1
  263. package/dist/shell/SidebarNav.js +1 -1
  264. package/dist/shell/SortableList.js +1 -1
  265. package/dist/shell/StatusBadge.js +1 -1
  266. package/dist/shell/Tabs.js +1 -1
  267. package/dist/shell/TimelineTrack.js +1 -1
  268. package/dist/shell/Tooltip.js +1 -1
  269. package/dist/shell/TopNav.js +1 -1
  270. package/dist/shell/TransferProgress.js +1 -1
  271. package/dist/shell/Tree.js +1 -1
  272. package/dist/shell/discardGuard.js +1 -1
  273. package/dist/telemetry/index.js +1 -1
  274. package/dist/templates/AuthScreen.js +1 -1
  275. package/dist/templates/ChatTemplate.js +1 -1
  276. package/dist/templates/CheckoutTemplate.js +1 -1
  277. package/dist/templates/DashboardTemplate.js +1 -1
  278. package/dist/templates/DataTablePage.js +1 -1
  279. package/dist/templates/EmailTemplate.js +1 -1
  280. package/dist/templates/ErrorBoundary.js +1 -1
  281. package/dist/templates/FormLayoutPage.js +1 -1
  282. package/dist/templates/GalleryTemplate.js +1 -1
  283. package/dist/ui/index.d.ts +1 -0
  284. package/dist/ui/index.js +1 -1
  285. package/dist/version.js +1 -1
  286. package/package.json +6 -1
  287. package/dist/Browser-KHMTFVKZ.js +0 -44
  288. package/dist/Calculator-OKVS4UOJ.js +0 -29
  289. package/dist/CurrencyConverter-ZA2NGJWI.js +0 -21
  290. package/dist/Notepad-PHQNEUKW.js +0 -24
  291. package/dist/PdfViewer-PFQGQRQX.js +0 -1
  292. package/dist/PomodoroTimer-PW7BRZUJ.js +0 -91
  293. package/dist/Sidebar-GYGYAXS2.js +0 -44
  294. package/dist/chunk-3DSGJIC7.js +0 -7
  295. package/dist/chunk-3J4SFHC7.js +0 -15
  296. package/dist/chunk-3QNZ7YGZ.js +0 -99
  297. package/dist/chunk-47UTEV3P.js +0 -23
  298. package/dist/chunk-6QKTQOEV.js +0 -69
  299. package/dist/chunk-7KWYVQMX.js +0 -2
  300. package/dist/chunk-7QSDPSXP.js +0 -1
  301. package/dist/chunk-AOLJKOO6.js +0 -28
  302. package/dist/chunk-ASDYAASN.js +0 -3
  303. package/dist/chunk-CBUBDXJ2.js +0 -1
  304. package/dist/chunk-D65T4H6J.js +0 -1
  305. package/dist/chunk-DQTYV6AC.js +0 -9
  306. package/dist/chunk-EV5BEEVO.js +0 -1
  307. package/dist/chunk-FHNQC2MA.js +0 -1
  308. package/dist/chunk-GOAFMGUI.js +0 -15
  309. package/dist/chunk-HNPJ3V3I.js +0 -6
  310. package/dist/chunk-KXPXLUNM.js +0 -4
  311. package/dist/chunk-MHCNQKEK.js +0 -4
  312. package/dist/chunk-O2PVZC5D.js +0 -8
  313. package/dist/chunk-QTVE3OSD.js +0 -7
  314. package/dist/chunk-RDGXSAOD.js +0 -2
  315. package/dist/chunk-SOZCWT6I.js +0 -6
  316. package/dist/chunk-WWCAVO3R.js +0 -14
  317. package/dist/chunk-XMFJDT6Y.js +0 -13
  318. package/dist/chunk-YGKLZBWC.js +0 -24
  319. /package/dist/{chunk-HOHHRNCB.js → chunk-FRCTA5FS.js} +0 -0
  320. /package/dist/{chunk-VG6BT2UG.js → chunk-YRQ5WGOM.js} +0 -0
@@ -1,91 +0,0 @@
1
- import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-7JG64RQW.js";import{subscribePomo as o,getPomoSnapshot as a,setPomoDurations as n,setPomoAlarm as r,setPomoAlarmConfig as s,setPomoBehaviour as i,setPomoFocusSound as l,useTodoTasks as c,pomodoroToday as u,migratePomodoroTasksOnce as d,pomoSwitchMode as m,pomoPause as h,pomoStart as p,ALARM_OPTIONS as g,playAlarm as k,FOCUS_SOUND_OPTIONS as f,previewFocusSound as b}from"./chunk-RFR2K7JO.js";import{PLACEHOLDER_INK as x}from"./chunk-AYZY3YNC.js";import{formatTime as v}from"./chunk-NHKT5IH6.js";import"./chunk-36BRD5J3.js";import"./chunk-JRQMX4PK.js";import{pad2 as y}from"./chunk-LF27WIN2.js";import{useWidgetSettings as N}from"./chunk-3QNZ7YGZ.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-M2TQOJ3G.js";import"./chunk-5A7MWTXX.js";import"./chunk-ZDMZM7HD.js";import"./chunk-BG3C4ALM.js";import"./chunk-GSLZ46DJ.js";import"./chunk-HNPJ3V3I.js";import"./chunk-EIFNESXS.js";import"./chunk-FTKLODQK.js";import"./chunk-ZOCE74ED.js";import"./chunk-HOHHRNCB.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-WLG7BE55.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-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-WU2ZA6J2.js";import"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as j}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./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-IUVGHHR3.js";import"./chunk-C3QOHMR6.js";import{useSyncExternalStore as S,useEffect as w,useMemo as B,useState as M,useRef as T,useCallback as P}from"react";import{jsxs as I,Fragment as D,jsx as A}from"react/jsx-runtime";var V="pomodoro_appearance",L="pomodoro_active_task_id",R={focus:"Pomodoro",short:"Short Break",long:"Long Break"},W={focus:"#0f172a",short:"#508a52",long:"#5b7898"};var $=25,J=5,E=15,F=!1,G=!1,H=4,O=!0,Q=!0,Z="bell",U=100,K=1,Y="none",_=50,X=(e,t,o,a)=>"number"==typeof e&&isFinite(e)?Math.max(t,Math.min(o,Math.round(e))):a;function z(){const t=S(o,a,a),{prefs:k,save:b}=C(),x=function(e){const t=e&&"object"==typeof e?e:{};return{focusMinutes:X(t.focusMinutes,1,120,$),shortBreakMinutes:X(t.shortBreakMinutes,1,120,J),longBreakMinutes:X(t.longBreakMinutes,1,120,E),autoStartBreaks:"boolean"==typeof t.autoStartBreaks?t.autoStartBreaks:F,autoStartPomodoros:"boolean"==typeof t.autoStartPomodoros?t.autoStartPomodoros:G,longBreakInterval:X(t.longBreakInterval,1,20,H),autoCheckTasks:"boolean"==typeof t.autoCheckTasks?t.autoCheckTasks:O,checkToBottom:"boolean"==typeof t.checkToBottom?t.checkToBottom:Q,alarmSound:g.some(e=>e.id===t.alarmSound)?t.alarmSound:Z,alarmVolume:X(t.alarmVolume,0,100,U),alarmRepeat:X(t.alarmRepeat,1,5,K),focusSound:f.some(e=>e.id===t.focusSound)?t.focusSound:Y,focusVolume:X(t.focusVolume,0,100,_)}}(k.pomodoro_settings);w(()=>{n({focus:60*x.focusMinutes,short:60*x.shortBreakMinutes,long:60*x.longBreakMinutes})},[x.focusMinutes,x.shortBreakMinutes,x.longBreakMinutes]),w(()=>{r(x.alarmSound),s(x.alarmVolume,x.alarmRepeat)},[x.alarmSound,x.alarmVolume,x.alarmRepeat]),w(()=>{i({autoStartBreaks:x.autoStartBreaks,autoStartPomodoros:x.autoStartPomodoros,longBreakInterval:x.longBreakInterval})},[x.autoStartBreaks,x.autoStartPomodoros,x.longBreakInterval]),w(()=>{l(x.focusSound,x.focusVolume)},[x.focusSound,x.focusVolume]),w(()=>{if("undefined"!=typeof Notification&&"default"===Notification.permission)try{Notification.requestPermission()}catch{}},[]);const z=c(),ee=z.tasks,te=B(()=>u(),[]),oe=function(e,t){return B(()=>t?(e=>{const t=[],o=[];for(const a of e)(a.done?o:t).push(a);return[...t,...o]})(e):e,[e,t])}(B(()=>ee.filter(e=>!!e.dueDate&&(e.dueDate===te||e.dueDate<te&&!e.done)),[ee,te]),x.checkToBottom),[ae,ne]=M(()=>localStorage.getItem(L)),[re,se]=M(!1),[ie,le]=M(null),ce=T(!1);w(()=>{ce.current||(ce.current=!0,d(ee,z.setAllTasks))},[]),w(()=>{try{ae?localStorage.setItem(L,ae):localStorage.removeItem(L)}catch{}},[ae]),w(()=>{if(!ie)return;const e=()=>le(null),t=setTimeout(()=>document.addEventListener("click",e),0);return()=>{clearTimeout(t),document.removeEventListener("click",e)}},[ie]);const ue=T(t.streak);w(()=>{if(t.streak>ue.current&&ae){const e=ee.find(e=>e.id===ae);if(e){const t=(e.completed??0)+1,o=e.estimated??0,a=x.autoCheckTasks&&o>0&&t>=o;z.updateTask(ae,{completed:t,done:e.done||a})}}ue.current=t.streak},[t.streak,ae,x.autoCheckTasks,ee,z]);const me=oe.reduce((e,t)=>e+(t.completed??0),0),he=oe.reduce((e,t)=>e+Math.max(t.estimated??0,t.completed??0),0),pe=oe.reduce((e,t)=>t.done?e:e+Math.max(0,(t.estimated??0)-(t.completed??0)),0),ge=t.running&&"focus"===t.mode?t.remaining:0,ke=pe*x.focusMinutes*60+ge,fe=new Date(Date.now()+1e3*ke),be=v(fe.toISOString(),{clock:{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}}),xe=(ke/3600).toFixed(1),ve=ae?ee.find(e=>e.id===ae)??null:null,ye=y(Math.floor(t.remaining/60)),Ne=y(t.remaining%60),[Ce,je]=M(()=>e(V)),[Se,we]=M(!1),[Be,Me]=M(Ce),[Te,Pe]=M(x);N(P(()=>{Me({...Ce}),Pe({...x}),we(!0)},[Ce,x]));const Ie="focus"!==t.mode,De=W[t.mode],Ae=Ie?(Ve=De,Le=Ce.activeOpacity/100,`rgba(${parseInt(Ve.slice(1,3),16)}, ${parseInt(Ve.slice(3,5),16)}, ${parseInt(Ve.slice(5,7),16)}, ${Le})`):`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${Ce.activeOpacity/100})`;var Ve,Le;const Re={primary:Ie?"text-white":"text-gray-900",secondary:Ie?"text-white/85":"text-gray-700",muted:Ie?"text-white/65":"text-gray-500",tabActive:Ie?"bg-white/15 text-white":"bg-gray-200 text-gray-900",tabInactive:Ie?"text-white/75 hover:bg-white/10":"text-gray-500 hover:bg-gray-200",divider:Ie?"border-white/30":"border-gray-200",softDivider:Ie?"border-white/20":"border-gray-200",iconBtn:Ie?"bg-black/15 hover:bg-black/25 text-white/85":"bg-gray-200 hover:bg-gray-300 text-gray-600",addTaskBtn:Ie?"border-white/45 text-white/90 hover:bg-white/[0.06]":"border-gray-300 text-gray-500 hover:bg-gray-200/50"},We=Ie?De:"#0f172a";/* @__PURE__ */
2
- return I(D,{children:[
3
- /* @__PURE__ */I("div",{className:`flex flex-col h-full select-none transition-colors duration-300 ${Re.primary}`,style:{backgroundColor:Ae,backdropFilter:Ce.activeBlur>0?`blur(${Ce.activeBlur}px)`:void 0},children:[
4
- /* @__PURE__ */A("div",{className:"px-3 pt-3 flex justify-center gap-2",children:["focus","short","long"].map(e=>/* @__PURE__ */A("button",{onClick:()=>m(e),className:`px-3 py-1 text-sm font-bold rounded transition-colors ${t.mode===e?Re.tabActive:Re.tabInactive}`,children:R[e]},e))}),
5
- /* @__PURE__ */I("div",{className:"text-center font-bold tabular-nums leading-none tracking-tight mt-3",style:{fontSize:"4.5rem"},children:[ye,":",Ne]}),
6
- /* @__PURE__ */A("div",{className:"flex justify-center mt-3 mb-2",children:/* @__PURE__ */A("button",{onClick:()=>t.running?h():p(),className:"bg-surface px-12 py-3 rounded-md font-bold text-base shadow-[0_4px_0_rgba(0,0,0,0.12)] hover:shadow-[0_3px_0_rgba(0,0,0,0.12)] active:translate-y-1 active:shadow-none transition-all",style:{color:We,letterSpacing:"0.08em"},children:t.running?"PAUSE":"START"})}),
7
- /* @__PURE__ */A("div",{className:"px-3 py-3 text-center",children:ve?/* @__PURE__ */I(D,{children:[
8
- /* @__PURE__ */I("div",{className:`text-xs leading-tight ${Re.muted}`,children:["#",(ve.completed??0)+1]}),
9
- /* @__PURE__ */A("div",{className:`text-base font-medium leading-tight truncate mt-0.5 ${Re.primary}`,children:ve.name})]}):/* @__PURE__ */A("div",{className:`text-xs italic ${Re.muted}`,children:"No task selected"})}),
10
- /* @__PURE__ */I("div",{className:"px-3 mt-1 flex items-center justify-between",children:[
11
- /* @__PURE__ */A("h3",{className:`text-base font-bold tracking-tight ${Re.primary}`,children:"Tasks"}),
12
- /* @__PURE__ */A("button",{className:`rounded p-1 transition-colors ${Re.iconBtn}`,"aria-label":"Tasks menu",tabIndex:-1,children:/* @__PURE__ */A(j,{name:"more-vertical",look:"solid",className:"h-4 w-4"})})]}),
13
- /* @__PURE__ */A("div",{className:`border-t mx-3 mt-2 ${Re.divider}`}),
14
- /* @__PURE__ */I("div",{className:"flex-1 px-3 py-3 space-y-2 overflow-y-auto",children:[oe.map(e=>{const t=e.id===ae;/* @__PURE__ */
15
- return I("div",{onClick:()=>ne(e.id),className:"bg-surface text-ink-strong rounded-md flex items-center pr-2 py-3 shadow-sm cursor-pointer transition-shadow hover:shadow-(--elevation-panel) "+(t?"border-l-4 border-gray-700 pl-2":"pl-3 border-l-4 border-transparent"),children:[
16
- /* @__PURE__ */A("button",{onClick:t=>{var o;t.stopPropagation(),o=e.id,z.toggleDone(o)},className:"shrink-0",children:e.done?/* @__PURE__ */A("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",style:{color:We},children:/* @__PURE__ */A("path",{d:"M10 0a10 10 0 100 20 10 10 0 000-20zm-1 14.5l-4.5-4.5 1.4-1.4 3.1 3.1 6.1-6.1 1.4 1.4z"})}):/* @__PURE__ */A("svg",{className:"h-5 w-5 text-gray-300",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:/* @__PURE__ */A("circle",{cx:"12",cy:"12",r:"10"})})}),
17
- /* @__PURE__ */A("span",{className:"ml-3 flex-1 font-semibold truncate "+(e.done?"line-through text-gray-400":"text-gray-800"),children:e.name}),
18
- /* @__PURE__ */I("span",{className:"text-sm tabular-nums mr-2 shrink-0",children:[
19
- /* @__PURE__ */A("span",{className:"font-bold text-gray-500",children:e.completed??0}),
20
- /* @__PURE__ */A("span",{className:"text-gray-400",children:" / "}),
21
- /* @__PURE__ */A("span",{className:"text-gray-400",children:e.estimated??"–"})]}),
22
- /* @__PURE__ */I("div",{className:"relative",children:[
23
- /* @__PURE__ */A("button",{onClick:t=>{t.stopPropagation(),le(ie===e.id?null:e.id)},className:"rounded p-1 bg-gray-100 hover:bg-gray-200",children:/* @__PURE__ */A(j,{name:"more-vertical",look:"solid",className:"h-4 w-4 text-ink-faint"})}),ie===e.id&&/* @__PURE__ */A("div",{className:"absolute right-0 top-full mt-1 bg-white text-gray-800 rounded shadow-lg border border-gray-200 z-10 min-w-[110px] overflow-hidden",onClick:e=>e.stopPropagation(),children:/* @__PURE__ */A("button",{onClick:t=>{var o;t.stopPropagation(),o=e.id,z.removeTask(o),ae===o&&ne(null),le(null)},className:"block w-full px-3 h-8 text-sm text-left hover:bg-red-50 text-red-600",children:"Delete"})})]})]},e.id)}),re?/* @__PURE__ */A(de,{onSubmit:(e,t)=>{const o=e.trim();if(!o)return;const a=z.addTask({name:o,estimated:t,completed:0,dueDate:te});ae||ne(a),se(!1)},onCancel:()=>se(!1),accentColor:We}):/* @__PURE__ */I("button",{onClick:()=>se(!0),className:`w-full border-2 border-dashed rounded-md py-3 font-semibold flex items-center justify-center gap-2 transition-colors ${Re.addTaskBtn}`,children:[
24
- /* @__PURE__ */A(j,{name:"add-circle",className:"h-5 w-5",strokeWidth:2}),"Add Task"]})]}),
25
- /* @__PURE__ */I("div",{className:`border-t px-3 py-3 flex items-center justify-center gap-5 text-sm ${Re.softDivider}`,children:[
26
- /* @__PURE__ */I("span",{className:Re.secondary,children:["Pomos: ",
27
- /* @__PURE__ */A("span",{className:`font-bold ${Re.primary}`,children:me}),
28
- /* @__PURE__ */A("span",{className:Re.muted,children:" / "}),
29
- /* @__PURE__ */A("span",{className:`font-bold ${Re.primary}`,children:he})]}),ke>0&&/* @__PURE__ */I("span",{className:Re.secondary,children:["Finish At: ",
30
- /* @__PURE__ */A("span",{className:`font-bold ${Re.primary}`,children:be}),
31
- /* @__PURE__ */I("span",{className:Re.muted,children:[" (",xe,"h)"]})]})]})]}),
32
- /* @__PURE__ */A(q,{open:Se,onClose:()=>we(!1),onSave:()=>{je(Be),localStorage.setItem(V,JSON.stringify(Be)),b({pomodoro_settings:Te}),we(!1)},configAppearance:Be,setConfigAppearance:Me,configPrefs:Te,setConfigPrefs:Pe})]})}function q({open:e,onClose:o,onSave:a,configAppearance:n,setConfigAppearance:r,configPrefs:s,setConfigPrefs:i}){const l=(e,t)=>i(o=>({...o,[e]:t}));/* @__PURE__ */
33
- return I(t,{open:e,onClose:o,title:"Pomodoro Settings",appearance:n,onAppearanceChange:r,onSave:a,children:[
34
- /* @__PURE__ */I(ee,{icon:/* @__PURE__ */A(le,{}),label:"TIMER",children:[
35
- /* @__PURE__ */I("div",{children:[
36
- /* @__PURE__ */A("p",{className:"text-sm font-bold text-gray-800 mb-2",children:"Time (minutes)"}),
37
- /* @__PURE__ */I("div",{className:"grid grid-cols-3 gap-3",children:[
38
- /* @__PURE__ */A(ae,{label:"Pomodoro",value:s.focusMinutes,onChange:e=>l("focusMinutes",e),max:120}),
39
- /* @__PURE__ */A(ae,{label:"Short Break",value:s.shortBreakMinutes,onChange:e=>l("shortBreakMinutes",e),max:120}),
40
- /* @__PURE__ */A(ae,{label:"Long Break",value:s.longBreakMinutes,onChange:e=>l("longBreakMinutes",e),max:120})]})]}),
41
- /* @__PURE__ */A(te,{label:"Auto Start Breaks",children:/* @__PURE__ */A(se,{checked:s.autoStartBreaks,onChange:e=>l("autoStartBreaks",e)})}),
42
- /* @__PURE__ */A(te,{label:"Auto Start Pomodoros",children:/* @__PURE__ */A(se,{checked:s.autoStartPomodoros,onChange:e=>l("autoStartPomodoros",e)})}),
43
- /* @__PURE__ */A(te,{label:"Long Break interval",children:/* @__PURE__ */A(ne,{value:s.longBreakInterval,onChange:e=>l("longBreakInterval",e),min:1,max:20,className:"w-14 text-center"})})]}),
44
- /* @__PURE__ */I(ee,{icon:/* @__PURE__ */A(ce,{}),label:"TASK",children:[
45
- /* @__PURE__ */A(te,{label:"Auto Check Tasks",info:'If you enable "Auto Check Tasks", the active task will be automatically checked when the actual pomodoro count reaches the estimated count.',children:/* @__PURE__ */A(se,{checked:s.autoCheckTasks,onChange:e=>l("autoCheckTasks",e)})}),
46
- /* @__PURE__ */A(te,{label:"Check to Bottom",info:'If you enable "Check to Bottom", the checked task will be automatically moved to the bottom of the task list.',children:/* @__PURE__ */A(se,{checked:s.checkToBottom,onChange:e=>l("checkToBottom",e)})})]}),
47
- /* @__PURE__ */I(ee,{icon:/* @__PURE__ */A(ue,{}),label:"SOUND",children:[
48
- /* @__PURE__ */A(te,{label:"Alarm Sound",children:/* @__PURE__ */I("div",{className:"flex items-center gap-2",children:[
49
- /* @__PURE__ */A(re,{value:s.alarmSound,onChange:e=>l("alarmSound",e),options:g.map(e=>({id:e.id,label:e.label}))}),"off"!==s.alarmSound&&/* @__PURE__ */A("button",{type:"button",onClick:()=>k(s.alarmSound,{volume:s.alarmVolume,repeat:1}),className:"px-2 py-1 text-2xs rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:"Play"})]})}),
50
- /* @__PURE__ */A(oe,{value:s.alarmVolume,onChange:e=>l("alarmVolume",e)}),
51
- /* @__PURE__ */A(te,{label:"repeat",children:/* @__PURE__ */A(ne,{value:s.alarmRepeat,onChange:e=>l("alarmRepeat",e),min:1,max:5,className:"w-14 text-center"})}),
52
- /* @__PURE__ */A(te,{label:"Focus Sound",children:/* @__PURE__ */I("div",{className:"flex items-center gap-2",children:[
53
- /* @__PURE__ */A(re,{value:s.focusSound,onChange:e=>l("focusSound",e),options:f}),"none"!==s.focusSound&&/* @__PURE__ */A("button",{type:"button",onClick:()=>b(s.focusSound,s.focusVolume),className:"px-2 py-1 text-2xs rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:"Play"})]})}),
54
- /* @__PURE__ */A(oe,{value:s.focusVolume,onChange:e=>l("focusVolume",e)})]})]})}function ee({icon:e,label:t,children:o}){/* @__PURE__ */
55
- return I("div",{className:"border-t border-gray-200 pt-3 first:border-0 first:pt-0",children:[
56
- /* @__PURE__ */I("div",{className:"flex items-center gap-2 mb-3 text-ink-faintest",children:[e,
57
- /* @__PURE__ */A("span",{className:"text-xs font-bold tracking-[0.15em]",children:t})]}),
58
- /* @__PURE__ */A("div",{className:"space-y-3",children:o})]})}function te({label:e,info:t,children:o}){/* @__PURE__ */
59
- return I("div",{className:"flex items-center justify-between gap-3",children:[
60
- /* @__PURE__ */I("div",{className:"flex items-center gap-2 min-w-0",children:[
61
- /* @__PURE__ */A("span",{className:"text-sm font-semibold text-gray-800",children:e}),t&&/* @__PURE__ */A(ie,{title:t})]}),
62
- /* @__PURE__ */A("div",{className:"shrink-0",children:o})]})}function oe({value:e,onChange:t}){/* @__PURE__ */
63
- return I("div",{className:"flex items-center justify-end gap-3",children:[
64
- /* @__PURE__ */A("span",{className:"text-xs text-gray-400 w-7 text-right tabular-nums",children:e}),
65
- /* @__PURE__ */A("input",{type:"range",min:0,max:100,value:e,onChange:e=>t(parseInt(e.target.value,10)),className:"w-40 accent-blue-500"})]})}function ae({label:e,value:t,onChange:o,min:a=1,max:n=99}){/* @__PURE__ */
66
- return I("label",{className:"flex flex-col",children:[
67
- /* @__PURE__ */A("span",{className:"text-xs font-semibold text-gray-500 mb-1",children:e}),
68
- /* @__PURE__ */A(ne,{value:t,onChange:o,min:a,max:n})]})}function ne({value:e,onChange:t,min:o=1,max:a=99,className:n=""}){/* @__PURE__ */
69
- return A("input",{type:"number",min:o,max:a,value:e,onChange:e=>t(Math.max(o,Math.min(a,parseInt(e.target.value,10)||o))),className:`bg-gray-100 border-0 rounded-md px-2 h-8 text-sm font-medium text-ink-strong focus:outline-none focus:ring-2 focus:ring-blue-500 w-full ${n}`})}function re({value:e,onChange:t,options:o}){/* @__PURE__ */
70
- return I("div",{className:"relative",children:[
71
- /* @__PURE__ */A("select",{value:e,onChange:e=>t(e.target.value),className:"appearance-none bg-gray-100 border-0 rounded-md pl-3 pr-8 h-8 text-sm font-medium text-ink-strong focus:outline-none focus:ring-2 focus:ring-blue-500 cursor-pointer",children:o.map(e=>/* @__PURE__ */A("option",{value:e.id,children:e.label},e.id))}),
72
- /* @__PURE__ */A(j,{name:"chevron-down",className:`absolute right-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 pointer-events-none ${x}`,strokeWidth:2.5})]})}function se({checked:e,onChange:t}){/* @__PURE__ */
73
- return A("button",{type:"button",role:"switch","aria-checked":e,onClick:()=>t(!e),className:"relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(e?"bg-emerald-500":"bg-gray-300"),children:/* @__PURE__ */A("span",{className:"absolute h-5 w-5 rounded-full bg-white shadow transition-transform "+(e?"translate-x-[22px]":"translate-x-0.5")})})}function ie({title:e}){/* @__PURE__ */
74
- return A("span",{title:e,className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-gray-300 text-on-accent text-3xs font-bold cursor-help",children:"i"})}function le(){/* @__PURE__ */
75
- return I("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[
76
- /* @__PURE__ */A("circle",{cx:"12",cy:"12",r:"9"}),
77
- /* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 7v5l3 2"})]})}function ce(){/* @__PURE__ */
78
- return I("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[
79
- /* @__PURE__ */A("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}),
80
- /* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4"})]})}function ue(){/* @__PURE__ */
81
- return I("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[
82
- /* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5L6 9H2v6h4l5 4V5z"}),
83
- /* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.5 8.5a5 5 0 010 7M19 5a9 9 0 010 14"})]})}function de({onSubmit:e,onCancel:t,accentColor:o}){const[a,n]=M(""),[r,s]=M(1),i=()=>e(a,r);/* @__PURE__ */
84
- return I("div",{className:"bg-surface text-ink-strong rounded-md p-3 shadow-(--elevation-panel)",children:[
85
- /* @__PURE__ */A("input",{autoFocus:!0,value:a,onChange:e=>n(e.target.value),placeholder:"What are you working on?",onKeyDown:e=>{"Enter"===e.key&&i(),"Escape"===e.key&&t()},className:"w-full text-base font-medium bg-transparent border-0 outline-none placeholder-gray-400"}),
86
- /* @__PURE__ */I("div",{className:"flex items-center justify-between mt-2",children:[
87
- /* @__PURE__ */A("span",{className:"text-xs font-semibold text-gray-500",children:"Est Pomodoros"}),
88
- /* @__PURE__ */A("input",{type:"number",min:1,max:20,value:r,onChange:e=>s(Math.max(1,Math.min(20,parseInt(e.target.value,10)||1))),className:"w-16 bg-gray-100 rounded px-2 py-1 text-sm text-right border-0 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),
89
- /* @__PURE__ */I("div",{className:"flex gap-2 mt-3 justify-end",children:[
90
- /* @__PURE__ */A("button",{onClick:t,className:"px-3 py-1 text-sm text-gray-500 hover:bg-gray-100 rounded",children:"Cancel"}),
91
- /* @__PURE__ */A("button",{onClick:i,className:"px-4 py-1 text-sm font-semibold text-white rounded shadow-sm",style:{backgroundColor:o},children:"Save"})]})]})}export{z 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-LXPDURUL.js";import{openGlobalSearch as s}from"./chunk-JNSRDEB6.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-SV5RRBVA.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 w,sectionIcons as j}from"./chunk-4LXCCZDM.js";import"./chunk-5A7MWTXX.js";import"./chunk-7QSDPSXP.js";import"./chunk-2QY5BJLA.js";import{PopupMenu as S,PopupMenuItem as C,PopupMenuDivider as L}from"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-M5K4AX4E.js";import{Icon as $}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import{useShellStrings as A}from"./chunk-IUVGHHR3.js";import"./chunk-C3QOHMR6.js";import{useMemo as z,useState as W,useRef as I,useEffect as H,isValidElement as T,cloneElement as R}from"react";import{jsx as D,jsxs as M,Fragment as K}from"react/jsx-runtime";var P="undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform),O=150,Q=250;function U(e,t,r){const n=Math.max(8,r-t.bottom);return{left:e+b,bottom:n,maxHeight:r-n-8,overflowY:"auto"}}var B=(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(" "),J="flex size-8 shrink-0 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900",E="flex size-[18px] shrink-0 items-center justify-center [&>svg]:size-[18px]";function X({open:e,children:t}){const r=I(null);return H(()=>{r.current?.toggleAttribute("inert",!e)},[e]),/* @__PURE__ */D("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__ */D("div",{className:"min-h-0 overflow-hidden",children:t})})}function G({open:e}){/* @__PURE__ */
2
- return D($,{name:"chevron-down",className:"size-4 shrink-0 transition-transform "+(e?"rotate-180":""),strokeWidth:2,"aria-hidden":"true"})}function V({dir:e}){/* @__PURE__ */
3
- return D($,"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 Y({className:e}){/* @__PURE__ */
4
- return D($,{name:"search",className:e,strokeWidth:2,"aria-hidden":"true"})}var F=e=>.75+1.75*e+"rem";function _({width:b,openWidth:O=x,collapsed:Q,onToggleCollapsed:_,onResize:Z,onHome:q,onOpen:ee,activeRoute:te,profile:re,user:ne,onLogout:ie,onSwitchToDesktop:ae,onReportBug:oe,onClose:le,navSections:se=f,navIcons:ce=w,sectionIcons:de=j,categories:me=g,productName:ue,productIcon:he,tagline:pe,adaptiveLogo:be=!1,logoHasAlpha:fe=null,logoIsLight:ge=null}){const xe=A().layout,{hasAnyPerm:ke}=e(),ye=z(()=>c(se,me,ke),[se,me,ke]),[ve,Ne]=W(()=>t(r(n))),we=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]),je=(e,t=we)=>Ne(r=>{const i=a(r,e,t);return o(n,JSON.stringify([...i])),i}),[Se,Ce]=W(!1),Le=I(null),$e=Q&&!le,[Ae,ze]=W(!1),We=I("pointer"),Ie=I(void 0),He=I(!1),Te=I(null),Re=()=>{clearTimeout(Ie.current),Ie.current=void 0},De=e=>{Re(),We.current=e,ze(!0)},Me=()=>{Re(),ze(!1)};H(()=>{Re(),ze(!1)},[Q]),H(()=>()=>Re(),[]),H(()=>{if(!Ae)return;const e=e=>{const t=e.target;t&&(Te.current?.contains(t)||t.closest?.('[data-popup-menu-tree], [role="menu"]'))||(Re(),ze(!1))};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[Ae]);const Ke=Q&&!Ae,Pe=Q&&Ae?O:b,Oe=(e,t)=>{Me(),e.onSelect?e.onSelect():ee(e.to,!!t&&(e=>e.metaKey||e.ctrlKey||1===e.button)(t))},Qe=(e,t)=>{const r=t[e];/* @__PURE__ */
5
- return D("span",{className:E,"aria-hidden":"true",children:r&&T(r)?R(r,{className:"size-[18px]"}):r})},Ue=e=>e.filter(e=>d(e,ke).length>0).map(e=>`child:${e.to}`),Be=(e,t,r=we)=>{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:()=>je(a,r),"aria-expanded":o,className:B(l,!1),style:t>0?{paddingLeft:F(t)}:void 0,children:[0===t&&Qe(e.to,ce),
8
- /* @__PURE__ */D("span",{className:"min-w-0 flex-1 truncate",children:i}),
9
- /* @__PURE__ */D(G,{open:o})]}),
10
- /* @__PURE__ */D(X,{open:o,children:/* @__PURE__ */D("div",{className:"space-y-0.5 pt-0.5",children:n.map(e=>Be(e,t+1,Ue(n)))})}),e.dividerAfter&&/* @__PURE__ */D("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:F(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=>Oe(e,t),onAuxClick:t=>{1===t.button&&Oe(e,t)},"aria-current":a?"page":void 0,className:B(a,!1),style:t>0?{paddingLeft:F(t)}:void 0,children:[0===t&&Qe(e.to,ce),
13
- /* @__PURE__ */D("span",{className:"min-w-0 flex-1 truncate",children:i})]}),e.dividerAfter&&/* @__PURE__ */D("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:F(t)},"aria-hidden":"true"})]},e.to)},Je=(e,t)=>{const r=t?e.items:m(e,ke);if(0===r.length)return null;const n="icon"in e&&e.icon?/* @__PURE__ */D("span",{className:E,"aria-hidden":"true",children:e.icon}):Qe(e.label,de),i=e.menuLabel??e.label,a=u(r,te,ke),o="dividerAfter"in e&&e.dividerAfter;if(Ke)/* @__PURE__ */
14
- return M("div",{children:[
15
- /* @__PURE__ */D("button",{type:"button",title:i,"aria-label":i,"aria-expanded":!1,onClick:()=>{ve.has(e.label)||je(e.label),De("tap")},className:B(a,!0),children:n}),o&&/* @__PURE__ */D("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:()=>je(e.label),"aria-expanded":l,"aria-controls":s,className:B(!l&&a,!1),children:[n,
18
- /* @__PURE__ */D("span",{className:"min-w-0 flex-1 truncate",children:i}),
19
- /* @__PURE__ */D(G,{open:l})]}),
20
- /* @__PURE__ */D(X,{open:l,children:/* @__PURE__ */D("div",{id:s,role:"group","aria-label":i,className:"space-y-0.5 pt-0.5",children:r.map(e=>Be(e,1,Ue(r)))})}),o&&/* @__PURE__ */D("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label)},Ee=re?.first_name?`${re.first_name} ${re.last_name||""}`.trim():ne?.email||"",Xe=(re?.first_name?.charAt(0)||ne?.email?.charAt(0)||"?").toUpperCase(),Ge=re?.avatar_url?/* @__PURE__ */D("img",{src:re.avatar_url,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):/* @__PURE__ */D("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-blue-600 text-xs font-semibold text-white",children:Xe}),Ve=Se?Le.current?.getBoundingClientRect():void 0,Ye=Ke?"":"px-3",Fe=Ke?{paddingInline:y}:void 0,_e=`${Q?xe.expandSidebar:xe.collapseSidebar} (${P?"⌘":"Ctrl"} .)`,Ze=q?{run:q,label:xe.goHome,title:xe.goHome}:le?null:{run:_,label:Q?xe.expandSidebar:xe.collapseSidebar,title:_e},qe=/* @__PURE__ */M(K,{children:[he&&/* @__PURE__ */D(h,{src:he,alt:"",slot:"compact",surface:"light",adaptive:be,hasAlpha:fe,isLight:ge,size:28,decorative:!0}),!Ke&&/* @__PURE__ */M("span",{className:"min-w-0 text-left leading-tight",children:[
21
- /* @__PURE__ */D("span",{className:"block truncate text-base font-bold tracking-wide text-gray-900",children:ue??"Apps"}),pe&&/* @__PURE__ */D("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:Te,"aria-label":xe.navLabel,"data-rail-peek":Ae?"":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 ${Q?"overflow-hidden transition-[width] duration-150 ease-out motion-reduce:transition-none":""} ${Ae?"rounded-r-(--radius-panel)":""}`,style:{width:Pe,boxShadow:Ae?"var(--elevation-popup)":void 0},onPointerEnter:e=>{"touch"!==e.pointerType&&(He.current=!0,$e&&(Ae?Re():(Re(),Ie.current=setTimeout(()=>De("pointer"),150))))},onPointerLeave:e=>{"touch"!==e.pointerType&&(He.current=!1,$e&&(Re(),Ae&&!Se&&"pointer"===We.current&&(Ie.current=setTimeout(Me,250))))},onFocus:e=>{$e&&!Ae&&(e=>{try{return e.matches(":focus-visible")}catch{return!1}})(e.target)&&De("focus")},onBlur:e=>{if(!Ae||"focus"!==We.current)return;const t=e.relatedTarget;t&&Te.current?.contains(t)||Se||He.current||Me()},onKeyDown:e=>{"Escape"===e.key&&Ae&&Me()},children:[
23
- /* @__PURE__ */M("div",{className:"flex shrink-0 items-center border-b border-gray-200 "+(Ke?"justify-center":"justify-between gap-2 pl-4 pr-2"),style:{height:k},children:[Ze?/* @__PURE__ */D("button",{type:"button",onClick:Ze.run,"aria-label":Ze.label,title:Ze.title,className:"flex min-w-0 items-center gap-2 rounded-md transition-colors hover:bg-gray-100 "+(Ke?"justify-center p-0.5":"-ml-1 p-1"),children:qe}):/* @__PURE__ */D("span",{className:"flex min-w-0 items-center gap-2",children:qe}),le?/* @__PURE__ */D(p,{onClick:le,"aria-label":xe.closeMenu,children:/* @__PURE__ */D($,{name:"close",className:"size-[18px]",strokeWidth:1.5,"aria-hidden":"true"})}):Q?Ae&&
24
- /* @__PURE__ */D("button",{type:"button",onClick:()=>{Me(),_()},"aria-label":xe.keepSidebarOpen,title:`${xe.keepSidebarOpen} (${P?"⌘":"Ctrl"} .)`,className:J,children:/* @__PURE__ */D(V,{dir:"right"})}):/* @__PURE__ */D("button",{type:"button",onClick:_,"aria-label":xe.collapseSidebar,title:`${xe.collapseSidebar} (${P?"⌘":"Ctrl"} .)`,className:J,children:/* @__PURE__ */D(V,{dir:"left"})})]}),
25
- /* @__PURE__ */D("div",{className:`shrink-0 pt-3 ${Ye}`,style:Fe,children:Ke?/* @__PURE__ */D("button",{type:"button",onClick:s,"aria-label":xe.search,title:`${xe.search} (${P?"⌘K":"Ctrl K"})`,className:B(!1,!0),children:/* @__PURE__ */D(Y,{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__ */D(Y,{className:"size-3.5 text-gray-500"}),
27
- /* @__PURE__ */D("span",{className:"min-w-0 flex-1 truncate text-sm text-ink-faint",children:xe.search}),
28
- /* @__PURE__ */D("kbd",{className:"rounded border border-line bg-gray-100 px-2 py-0.5 font-mono text-2xs font-semibold text-ink-faint",children:P?"⌘K":"Ctrl K"})]})}),
29
- /* @__PURE__ */M("nav",{"aria-label":xe.navLabel,className:`min-h-0 flex-1 overflow-y-auto pb-4 pt-3 ${Ye} ${Ke?"space-y-1":"space-y-0.5"}`,style:Fe,children:[Ke&&/* @__PURE__ */D("button",{type:"button",onClick:_,"aria-label":xe.expandSidebar,title:`${xe.expandSidebar} (${P?"⌘":"Ctrl"} .)`,className:`${B(!1,!0)} mb-3`,children:/* @__PURE__ */D(V,{dir:"right"})}),ye.topItems.map(e=>{if(!Ke)return Be(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__ */D("button",{type:"button",title:n,"aria-label":n,onClick:r=>{if(0===t.length)return void Oe(e,r);const n=`child:${e.to}`;ve.has(n)||je(n),De("tap")},className:B(r,!0),children:Qe(e.to,ce)}),e.dividerAfter&&/* @__PURE__ */D("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__ */D("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.erpSections.map(e=>Je(e,!1)),ye.systemSections.map(e=>Je(e,!1)),ye.virtualSections.map(e=>Je(e,!0)),ye.footerSections.length>0&&/* @__PURE__ */D("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.footerSections.map(e=>Je(e,!1))]}),
32
- /* @__PURE__ */D("div",{className:`shrink-0 border-t border-gray-200 py-2 ${Ye}`,style:Fe,children:/* @__PURE__ */M("button",{ref:Le,type:"button",onClick:()=>Ce(e=>!e),"aria-haspopup":"menu","aria-expanded":Se,"aria-label":Ke?xe.accountMenu(Ee):void 0,className:"flex w-full items-center gap-3 rounded-md hover:bg-gray-100 "+(Ke?"justify-center py-2":"px-2 py-2"),children:[Ge,!Ke&&/* @__PURE__ */M("span",{className:"min-w-0 flex-1 text-left",children:[
33
- /* @__PURE__ */D("span",{className:"block truncate text-sm font-semibold text-ink-strong",children:Ee}),ne?.email&&Ee!==ne.email&&/* @__PURE__ */D("span",{className:"block truncate text-2xs text-ink-faint",children:ne.email})]})]})}),Z&&!Q&&!le&&/* @__PURE__ */D(l,{side:"left",width:b,onResize:Z,min:N,max:v,defaultWidth:x,storageKey:i,label:xe.resizeSidebar}),Se&&Ve&&/* @__PURE__ */M(S,{portal:!0,minWidth:224,onClose:()=>{Ce(!1),Ae&&"pointer"===We.current&&!He.current&&Me()},style:U(Pe,Ve,window.innerHeight),children:[Ke&&/* @__PURE__ */M("div",{className:"border-b border-line px-3 py-3",children:[
34
- /* @__PURE__ */D("p",{className:"truncate text-sm font-semibold text-gray-800",children:Ee}),ne?.email&&/* @__PURE__ */D("p",{className:"truncate text-xs text-gray-500",children:ne.email})]}),
35
- /* @__PURE__ */M(C,{onClick:()=>{Ce(!1),Me(),ee("/profile",!1)},children:[
36
- /* @__PURE__ */D($,{name:"account",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.profile]}),ye.footerItems.map(e=>/* @__PURE__ */M(C,{onClick:()=>{Ce(!1),Oe(e)},children:[
37
- /* @__PURE__ */D("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(C,{onClick:()=>{Ce(!1),Me(),oe()},children:[
38
- /* @__PURE__ */D($,{name:"error",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.reportIssue]}),
39
- /* @__PURE__ */D(L,{}),ae&&/* @__PURE__ */M(K,{children:[
40
- /* @__PURE__ */M(C,{onClick:()=>{Ce(!1),Me(),ae()},children:[
41
- /* @__PURE__ */D($,{name:"desktop",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.switchToDesktop]}),
42
- /* @__PURE__ */D(L,{})]}),
43
- /* @__PURE__ */M(C,{danger:!0,onClick:()=>{Ce(!1),Me(),ie()},children:[
44
- /* @__PURE__ */D($,{name:"logout",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.signOut]})]})]})}export{Q as RAIL_PEEK_CLOSE_MS,O as RAIL_PEEK_OPEN_MS,U as accountMenuPosition,_ as default};
@@ -1,7 +0,0 @@
1
- import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-UZFFSZFI.js";import{useTabLayer as n,focusableIn as o}from"./chunk-DWGYC7OD.js";import{PopupMenu as i,PopupMenuDivider as a}from"./chunk-GOAFMGUI.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{placeMenu as d,popupBounds as c,followAnchor as u}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as p}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useState as m,useRef as h,useId as g,useCallback as v,useEffect as b}from"react";import{jsxs as y,jsx as x}from"react/jsx-runtime";var k="inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-ink-strongest rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60",w=/(^|[\s:])!?z-/,D={paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:"0.25rem",paddingBottom:"0.25rem"};function j({trigger:j,items:S,align:W="end",side:$="bottom","aria-label":A,className:C="",triggerClassName:E,menuClassName:L="",minWidth:K=180,linkAs:U,disabled:H,id:I,"aria-describedby":N,"aria-disabled":T=!1,onOpenChange:G,footer:B,footerLabel:F}){const[M,q]=m(!1),[J,O]=m(-1),z=h(null),P=h(null),R=h(null),Y=h(null),Z=h(null),Q=null!=B&&!1!==B,V=h({text:"",at:0}),X=g(),_=g(),ee=I??_,te=h(G);te.current=G;const re=h(M);re.current=M;const ne=v(e=>{q(!1),re.current&&(re.current=!1,te.current?.(!1)),e&&P.current?.focus()},[]),oe=(t,r)=>{const n=S.length;for(let o=0;o<n;o+=1){const i=((t+r*o)%n+n)%n;if(e(S[i]))return i}return-1},ie=()=>R.current?.closest("[data-popup-menu-tree]")??null;b(()=>{if(!M)return;const e=e=>{const t=e.target;if(z.current?.contains(t)||ie()?.contains(t))return;const r=ie()?.getAttribute("data-popup-menu-tree"),n=t.closest?.("[data-popup-menu-tree]");r&&n?.getAttribute("data-popup-menu-tree")===r||ne(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>ne(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[M,ne]);const ae=v(()=>{const e=ie(),t=P.current;if(!e||!t)return;const r=e.style;r.left="0px",r.top="0px",r.maxWidth="none",r.maxHeight="none";const n={width:e.offsetWidth,height:e.offsetHeight},o=d({trigger:t.getBoundingClientRect(),menu:n,bounds:c(t),align:W,side:$});r.left=`${o.left}px`,r.top=`${o.top}px`,r.maxWidth=`${o.maxWidth}px`,r.maxHeight=`${o.maxHeight}px`,r.overflowY=n.height>o.maxHeight?"auto":"",e.dataset.side=o.side,e.dataset.align=W},[W,$]);p(()=>{M&&ae()}),b(()=>{if(M)return u(()=>P.current,ae)},[M,ae]),b(()=>{if(!M)return;const t=R.current,r=e(S[J])?t?.querySelector(`[data-dropdown-index="${J}"]`):null;(r??t)?.focus({preventScroll:!0})},[M,J]),b(()=>{if(M)return f(e=>"Escape"===e.key&&(ne(!0),!0),()=>Y.current)},[M,ne]),n(Y,M&&Q);const le=h(null),se=t=>{const r=S.findIndex(t=>"radio"===t.type&&"colour"===t.mark&&t.checked&&e(t));return r>=0?r:"first"===t?oe(0,1):oe(S.length-1,-1)},de=e=>{O(se(e)),q(!0),re.current||(re.current=!0,le.current=e,G?.(!0))};p(()=>{const e=le.current;if(!M||!e)return;le.current=null;const t=se(e);t!==J&&O(t)});const ce=t(S,X),ue="function"==typeof B?B({close:()=>ne(!0)}):B,pe={...w.test(L)?{}:{zIndex:s.popup},minWidth:K};/* @__PURE__ */
2
- return y("div",{ref:z,className:`relative inline-flex ${C}`.trim(),children:[
3
- /* @__PURE__ */x("button",{ref:P,id:ee,type:"button","aria-haspopup":"menu","aria-expanded":M,"aria-controls":M?X:void 0,"aria-label":A,"aria-describedby":N,"aria-disabled":T||void 0,disabled:H,onClick:()=>{T||(M?ne(!1):de("first"))},onKeyDown:e=>{T||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),de("first")):"ArrowUp"===e.key&&(e.preventDefault(),de("last")))},className:E??`${k} ${A?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"}`,children:j}),M&&
4
- /* @__PURE__ */x(i,{portal:!0,className:L,style:pe,children:/* @__PURE__ */y("div",{ref:Y,children:[
5
- /* @__PURE__ */x("div",{ref:R,id:X,role:"menu","aria-orientation":"vertical","aria-label":A,"aria-labelledby":A?void 0:ee,"aria-describedby":ce,tabIndex:-1,onKeyDown:t=>{if(!t.target.closest?.("[data-popup-submenu-panel]")||"Tab"===t.key)if("ArrowDown"===t.key)t.preventDefault(),O(oe(J+1,1));else if("ArrowUp"===t.key)t.preventDefault(),O(oe(J-1,-1));else if("Home"===t.key)t.preventDefault(),O(oe(0,1));else if("End"===t.key)t.preventDefault(),O(oe(S.length-1,-1));else if("Tab"===t.key){t.preventDefault();const e=!t.shiftKey&&Z.current?o(Z.current)[0]:void 0;e?e.focus({preventScroll:!0}):ne(!0)}else if(" "===t.key){const e=t.target;e.matches?.("a[href]")&&(t.preventDefault(),e.click())}else 1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey||(t=>{const r=Date.now(),n=t.key.toLowerCase(),o=r-V.current.at<500?V.current.text+n:n;V.current={text:o,at:r};const i=[...o].every(e=>e===o[0]),a=i?o[0]:o,l=i?J+1:Math.max(J,0),s=R.current,d=S.length;for(let r=0;r<d;r+=1){const n=((l+r)%d+d)%d;if(e(S[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(a))return t.preventDefault(),void O(n)}})(t)},children:r(S,{menuId:X,choose:e=>{e.disabled||(ne(!0),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>ne(!0),rowProps:(e,t)=>({"data-dropdown-index":e,tabIndex:e===J?0:-1,onMouseEnter:()=>{t.disabled||Z.current?.contains(document.activeElement)||O(e)}}),linkAs:U})}),Q&&/* @__PURE__ */y("div",{ref:Z,role:"group","aria-label":F,"data-dropdown-footer":"",onKeyDown:e=>{const t=Z.current;if("Tab"!==e.key||!t||!t.contains(e.target))return;const r=o(t),n=document.activeElement;if(e.shiftKey){if(r.length>0&&n!==r[0])return;e.preventDefault();const t=R.current?.querySelector(`[data-dropdown-index="${J}"]`);return void(t??R.current)?.focus({preventScroll:!0})}r.length>0&&n!==r[r.length-1]||(e.preventDefault(),ne(!0))},children:[
6
- /* @__PURE__ */x("div",{"aria-hidden":"true",children:/* @__PURE__ */x(a,{})}),
7
- /* @__PURE__ */x("div",{style:D,children:ue})]})]})})]})}export{j as DropdownMenu,k as TRIGGER_CLASS};
@@ -1,15 +0,0 @@
1
- import{AccessibleTable as e}from"./chunk-HY6CBG4M.js";import{polygonPoints as t}from"./chunk-VFC6QUEN.js";import{ChartDefs as r,maskId as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{angleScale as o}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-IUVGHHR3.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:v="polygon",rings:M=4,formatValue:N,animate:j=!0,className:$,emptyLabel:C}){const W=m().charts,F=c(),R=N??(e=>h(e,F)),w=C??W.nothingToCompare,H=p(),[A,L]=u(null),{highlighted:U}=a(),V=x;if(k.length<3||0===V.length)/* @__PURE__ */
2
- return d("p",{className:`text-sm text-gray-500 ${$??""}`,children:w});const Y=y/2,z=y/2,B=y/2-46,E=o(k.length),Q=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...V.map(e=>e.values[t]??0).filter(Number.isFinite))),T=(e,t)=>{const r=Math.max(0,Math.min(1,t/Q[e])),l=E.center(e)-E.step/2;return[Y+B*r*Math.cos(l),z+B*r*Math.sin(l)]},G=(e,t)=>null!==A?A!==e:null!==U&&U!==t,I=null!==A?V[A]:void 0;/* @__PURE__ */
3
- return f("div",{className:`relative ${$??""}`,children:[
4
- /* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":H,onMouseLeave:()=>L(null),children:[
5
- /* @__PURE__ */d("title",{id:H,children:W.acrossMeasures(V.map(e=>e.label),k.length)}),Array.from({length:M},(e,r)=>{const l=B*(r+1)/M;return"circle"===v?/* @__PURE__ */d("circle",{cx:Y,cy:z,r:l,fill:"none",stroke:i.grid,strokeWidth:1},r):/* @__PURE__ */d("path",{d:g(t(Y,z,l,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},r)}),k.map((e,t)=>{const[r,l]=T(t,Q[t]);/* @__PURE__ */
6
- return f("g",{children:[
7
- /* @__PURE__ */d("line",{x1:Y,y1:z,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
8
- /* @__PURE__ */d("text",{x:Y+(B+18)*Math.cos(E.center(t)-E.step/2),y:z+(B+18)*Math.sin(E.center(t)-E.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
9
- /* @__PURE__ */d(r,{id:H,reveal:!!j&&"center-out"}),V.map((e,t)=>{const r=s(t,3,e.color,e.tone),a=k.map((t,r)=>T(r,e.values[r]??0));/* @__PURE__ */
10
- return f("g",{opacity:G(t,e.key)?.3:1,onMouseEnter:()=>L(t),mask:j?`url(#${l(H)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:r,fillOpacity:.18,stroke:"none"}),
11
- /* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),I&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:I.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(A,3,I.color,I.tone),value:R(I.values[t]??0)}))})}),
12
- /* @__PURE__ */d("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:V.map((e,t)=>/* @__PURE__ */f("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
13
- /* @__PURE__ */d("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:s(t,3,e.color,e.tone)}}),
14
- /* @__PURE__ */d("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
15
- /* @__PURE__ */d(e,{caption:W.acrossMeasures(V.map(e=>e.label),k.length),head:[W.tableSeries,...k.map(e=>e.label)],rows:V.map(e=>[e.label,...k.map((t,r)=>R(e.values[r]??0))])})]})}export{k as RADAR_SERIES_CAP,x as RadarChart};
@@ -1,99 +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{Result as d}from"./chunk-M2TQOJ3G.js";import{CMD_Z as h,CMD_SHIFT_Z as m}from"./chunk-ZDMZM7HD.js";import{CopyButton as p}from"./chunk-BG3C4ALM.js";import{confirm as f}from"./chunk-GSLZ46DJ.js";import{useModalDragAside as w}from"./chunk-EIFNESXS.js";import{ItemCount as y}from"./chunk-FTKLODQK.js";import{isInOverlayOver as g}from"./chunk-ZOCE74ED.js";import{dialogA11y as v}from"./chunk-VWGWZY7A.js";import{ColoredBadge as b}from"./chunk-WLG7BE55.js";import{ROW_HEIGHTS as x}from"./chunk-AW7TOB6N.js";import{LoadingSpinner as k}from"./chunk-4U5M37SF.js";import{activationOrder as E,activeListeners as C,ModalActionsContext as M,subscribeActive as N,getActiveModalId as S,KEY_ACTIVATED_SELECTOR as L}from"./chunk-F3ZOO23R.js";import{useShellAuth as z}from"./chunk-2QY5BJLA.js";import{useIsMobile as T,useIsPhone as A}from"./chunk-UGTRSRIW.js";import{useShellPrefs as D}from"./chunk-KC3EX26K.js";import{focusableIn as I}from"./chunk-DWGYC7OD.js";import{StatusBadge as P}from"./chunk-WU2ZA6J2.js";import{PopupMenu as W,PopupMenuItem as R,PopupMenuDivider as K,PopupMenuLabel as O}from"./chunk-GOAFMGUI.js";import{Button_default as $}from"./chunk-EVYD6UFQ.js";import{Icon as j}from"./chunk-ISVODSRP.js";import{LoadingSpinner as F}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as q}from"./chunk-62LW225J.js";import{shellHttp as B,isShellHttpConfigured as H}from"./chunk-STKJA4PV.js";import{runEscapeInterceptors as U}from"./chunk-TWVUQUUD.js";import{useShellStrings as Y}from"./chunk-IUVGHHR3.js";import{createContext as X,createElement as V,useContext as G,Component as J,useLayoutEffect as _,useRef as Z,useEffect as Q,useState as ee,useSyncExternalStore as te,useCallback as ne,isValidElement as re,Fragment as oe,Children as ie,cloneElement as ae,useMemo as se,useId as le,useReducer as ce,Suspense as ue}from"react";import{jsxs as de,jsx as he,Fragment as me}from"react/jsx-runtime";import{createPortal as pe}from"react-dom";import{useLocation as fe}from"react-router-dom";import{useQueryClient as we,useQuery as ye}from"@tanstack/react-query";function ge(e){return"component"in e}function ve(e){return"endpoint"in e}var be={};function xe(e){be=e}var ke=new Proxy({},{get:(e,t)=>be[t],has:(e,t)=>t in be,ownKeys:()=>Object.keys(be),getOwnPropertyDescriptor(e,t){if(t in be)return{configurable:!0,enumerable:!0,value:be[t]}}});function Ee(){return H()}var Ce=B,Me=X({});function Ne({value:e,children:t}){return V(Me.Provider,{value:e},t)}function Se(){return G(Me)}var Le=X(null);function ze(){return G(Le)?.pageSearch??""}var Te=null,Ae=/* @__PURE__ */new Set;function De(e){Te!==e&&(Te=e,Ae.forEach(e=>e()))}function Ie(){return Te}function Pe(e){return Ae.add(e),()=>{Ae.delete(e)}}var We=null;function Re(e){We=e}function Ke({error:e,onReload:t}){const n=u(e);/* @__PURE__ */
2
- return de("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
3
- /* @__PURE__ */he(j,{name:"warning",className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
4
- /* @__PURE__ */de("div",{className:"min-w-0",children:[
5
- /* @__PURE__ */he("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__ */he("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__ */he("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 Oe=class extends J{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__ */he(Ke,{error:e,onReload:this.reset}):this.props.children}},$e=X(null),je="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function Fe({className:e="",auto:t=!1}){const n=G($e),r=Y().undo,o=n?.claimOwnMount;if(_(()=>{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 de("div",{className:`flex items-center gap-2 ${e}`,"data-undo-controls":t?"shell":"form",children:[
9
- /* @__PURE__ */he("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",h):r.nothingToUndo,className:je,children:r.undo}),
10
- /* @__PURE__ */he("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",m):r.nothingToRedo,className:je,children:r.redo})]})}var qe=/* @__PURE__ */new Set([408,429]);function Be(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function He(e){const t=Be(e);return null!=t&&(t>=400&&t<500&&!qe.has(t))}function Ue(e,t){return!He(t)&&e<3}function Ye(e){if("page"!==e.type)return!0;const t=e.route?ke[e.route]:void 0;if(!t||!ge(t))return!0;const n=t;return!n.widget&&!n.utility}function Xe(e){const t=e.route?ke[e.route]:void 0;if(!t||!ge(t))return;const n=t;return n.taskbarGroup?n.taskbarGroup:{key:e.route,label:n.label,icon:e.route}}var Ve=(e,t)=>!!t&&"page"===e.type&&e.route===t;var Ge="flex-1 min-h-0";function Je(){const e=Y().record;/* @__PURE__ */
11
- return he(F,{label:e.loading,padding:"",className:Ge})}function _e(e){return e??void 0}function Ze({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:o}){const i=Y().record;if(t||e&&n)/* @__PURE__ */return he(Je,{});if(r){const e=Be(r);if(401===e)/* @__PURE__ */
12
- return he(d,{status:"warning",title:i.signInRequired,subTitle:i.signInBody,className:Ge});if(403===e)/* @__PURE__ */
13
- return he(d,{status:"403",className:Ge});if(404===e||410===e)/* @__PURE__ */
14
- return he(d,{status:"404",title:i.notFound,className:Ge});const t=null==e||408===e||429===e||e>=500;/* @__PURE__ */
15
- return he(d,{status:"500",title:i.loadFailed,subTitle:t?i.checkConnection:i.rejected,extra:t?/* @__PURE__ */he($,{variant:"secondary",size:"sm",onClick:o,children:i.retry}):void 0,className:Ge})}/* @__PURE__ */
16
- return he(d,{status:"404",title:i.notFound,className:Ge})}function Qe({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */he(me,{children:t(e)}):/* @__PURE__ */he(Ze,{...n})}var et=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function tt(e){return"string"==typeof e&&(e.startsWith("new-")||et.test(e))}function nt(e){if(tt(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var rt=X({openWindows:[],openEntity:()=>{},openPage:()=>{},reorderWindows:()=>{},closeEntity:()=>{},minimize:()=>{},items:[],restore:()=>{},remove:()=>{},restoreIfMinimized:()=>!1,openItems:[]}),ot=X(null);function it(e){const t=G(ot),n=Z(null);null===n.current&&(n.current=/* @__PURE__ */Symbol("window-dirty")),_(()=>{if(t)return t(n.current,e)},[t,e]),Q(()=>{if(!t||!e)return;const n=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t,e])}function at(){const e=Z(/* @__PURE__ */new Map),[t,n]=ee(!1);return{dirty:t,registerDirty:ne((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 st(){return G(rt)}function lt(e){if("page"!==e.type&&nt(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 ct({item:e,onClose:t,accentRgb:n}){const{dirty:r,registerDirty:o}=at(),i=ke[e.route];if(!i||!ge(i))return null;const a=i,s=a.component;/* @__PURE__ */
17
- return he(Zr,{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__ */he(ot.Provider,{value:o,children:/* @__PURE__ */he(ue,{fallback:/* @__PURE__ */he("div",{className:"flex items-center justify-center py-12",children:/* @__PURE__ */he(k,{})}),children:/* @__PURE__ */he(s,{})})})})}function ut({entityType:e,entityId:t,label:n}){const r=Y(),o=we(),{data:i}=ye({queryKey:["my-profile-sidebar"],enabled:Ee(),queryFn:()=>Ce.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 he("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];Ce.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__ */he(j,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var dt=/* @__PURE__ */new Set,ht=()=>"hidden";function mt({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=ke[e.entityType];if(!o||!ve(o))return null;const i=o,[a,s]=ee(!1),{dirty:c,registerDirty:u}=at(),d=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=tt(e.entityId),p=Se(),f=(w=e.id,te(N,()=>{const e=Bn.get(w);return null!=e&&Kn.has(e)}));var w;const y=!i.selfFetching&&!h&&!m&&Ee(),g=ye({queryKey:[d,e.entityId],queryFn:()=>{return Ce.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:_e(e.entitySnapshot),initialDataUpdatedAt:0,enabled:y,staleTime:0,refetchOnWindowFocus:()=>{return void 0===(e=p.entityRefetchOnWindowFocus)||("function"==typeof e?e():e);var e},refetchOnMount:"always",refetchInterval:e=>function(e,t={}){if(He(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:f,hostInterval:p.entityRefetchInterval}),refetchIntervalInBackground:!1,retry:Ue}),v=g.data,b=g.refetch;Q(()=>{var t;if(y)return t=t=>{t!==e.id||dt.has(t)||b({cancelRefetch:!1})},or.add(t),()=>{or.delete(t)}},[b,e.id,y]);const x=ne(()=>{a&&!c?s(!1):t()},[a,c,t]),E=(i.useEdit??ht)(v??null),C=!i.useEdit||m||h?void 0:{state:E,editing:a,onEdit:()=>s(!0),onDiscard:()=>s(!1)},M=i.selfFetching?e.label:v?i.title(v,a,s):e.label,S=i.icon,L=S?l[S]:null,z=M,T=!i.selfFetching&&v&&i.footer&&!h?i.footer(v):void 0;return i.rendersOwnModal?i.selfFetching?/* @__PURE__ */he(ue,{fallback:/* @__PURE__ */he(k,{}),children:i.render(v??e.entitySnapshot,t,e.entityId,a,s)}):null!=v?/* @__PURE__ */he(ue,{fallback:/* @__PURE__ */he(Zr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */he(Je,{})}),children:i.render(v,t,e.entityId,a,s)}):/* @__PURE__ */he(Zr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */he(Ze,{isPending:g.isPending,isFetching:g.isFetching,enabled:y,error:g.error,onRetry:b})}):/* @__PURE__ */he(Zr,{open:!0,onClose:x,onMinimize:n,initialBox:e.savedBox,icon:L,title:z,footer:T,copyText:e.label,windowKey:e.id,openedFromKey:e.openedFrom,size:i.size||"2xl",dirty:c,editing:a||m||h,edit:C,dimensions:i.dimensions,autoHeight:i.autoHeight,autoMinHeight:i.autoMinHeight,autoWidth:i.autoWidth,appStyle:i.appStyle,flushBody:i.flushBody,accentRgb:r,children:/* @__PURE__ */he(ot.Provider,{value:u,children:/* @__PURE__ */he(ue,{fallback:/* @__PURE__ */he(Je,{}),children:i.selfFetching?i.render(null,t,e.entityId,a,s):/* @__PURE__ */he(Qe,{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 pt(e){return document.querySelector(`[data-modal-panel][data-window-key="${e}"]`)}function ft(e){return document.querySelector(`[data-modal-panel][data-window-root][data-window-owner="${e}"]`)}function wt(e){const t=pt(e),n=t??ft(e);if(!n)return;if(t&&!wr(t))return r=e,void window.dispatchEvent(new CustomEvent("modal-reveal",{detail:{windowKey:r}}));var r;const o=n.getAttribute("data-modal-id");o&&ir(o)}function yt(){const e=S();if(!e)return;const t=document.querySelector(`[data-modal-panel][data-modal-id="${e}"]`);return t?.getAttribute("data-window-key")??void 0}var gt=/* @__PURE__ */new Map;function vt(){const e=yt();if(e)return gt.get(e)}function bt(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 xt="rosh-peek-style",kt=q.peek,Et=q.taskbarPreview;function Ct(e){"undefined"!=typeof document&&(!function(){if("undefined"==typeof document||document.getElementById(xt))return;const e=document.createElement("style");e.id=xt,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:${kt}!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 Mt(){"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 Nt({id:e,label:t,maxW:n,maxH:r,titleAbove:o=!1,onClick:i,onClose:a}){const s=Y(),l=Z(null),[c,u]=ee({w:n,h:Math.round(.75*r)}),[d,h]=ee(!1);return _(()=>{const o=l.current;if(!o)return;const i=pt(e)??bt(t);if(!i)return void h(!1);const a=i.getBoundingClientRect();if(0===a.width||0===a.height)return void h(!1);const s=Math.min(n/a.width,r/a.height),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);return 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",m.style.transform=`scale(${s})`,m.style.transformOrigin="top left",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__ */de("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__ */he("div",{ref:l,className:"absolute inset-0 z-0 overflow-hidden"}),!d&&/* @__PURE__ */de("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-gray-400 bg-gray-50",children:[
20
- /* @__PURE__ */he(j,{name:"window",className:"h-6 w-6",strokeWidth:1.5}),
21
- /* @__PURE__ */he("span",{className:"mt-1 text-3xs uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */he("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__ */he("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__ */he(j,{name:"close",className:"h-3 w-3",strokeWidth:3})})]})}function St({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=Y(),s=e.length>1,l=Z(null),[c,u]=ee({left:-9999,top:-9999,ready:!1}),[d,h]=ee(()=>"undefined"!=typeof document&&getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom");_(()=>{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]),Q(()=>Mt,[]);const m="top"===d,p=(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 pe(
22
- /* @__PURE__ */he("div",{ref:l,"data-taskbar-preview":"",style:{position:"fixed",left:c.left,top:c.top,zIndex:Et,maxWidth:"calc(100vw - 16px)",opacity:c.ready?1:0},className:s?"flex gap-2 flex-wrap":"",onMouseEnter:o,onMouseLeave:()=>{Mt(),i()},children:e.map(e=>{const t=pt(e.id)??bt(e.label),o=t?function(e){if(wr(e))return null;const t=e.getBoundingClientRect(),n=ur(),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 de("div",{className:"group flex flex-col items-center",onMouseEnter:()=>Ct(t),children:[!m&&/* @__PURE__ */he("span",{className:p,children:e.label}),
24
- /* @__PURE__ */he(Nt,{id:e.id,label:e.label,maxW:240,maxH:160,titleAbove:!0,onClick:()=>n(e.id),onClose:()=>r(e.id)}),m&&/* @__PURE__ */he("span",{className:p,children:e.label}),null!==o&&/* @__PURE__ */de("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__ */he(j,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function Lt(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 zt({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=Y(),[a,s]=ee(null);Q(()=>{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=te(N,S),[,u]=ee(0);Q(()=>{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]=ee(0);Q(()=>{const e=()=>d(e=>e+1);return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[]);const h=e=>{const t=bt(e),n=t?.querySelector("[data-window-title]");return n?.textContent?.trim()||e},[m,p]=ee(null),[f,w]=ee(null),[g,v]=ee(null),b=Z(null),x=()=>{b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{p(null),w(null)},150)},k=e.filter(e=>!e.route||!ke[e.route]?.utility);if(!a||!a.isConnected||0===k.length)return null;const E=[],C=/* @__PURE__ */new Map;for(const e of k){const t=e.route?ke[e.route]:void 0,n=t?.taskbarGroup,r=n?.key??e.route??`entity:${e.id}`,o=C.get(r);if(void 0!==o)E[o].items.push(e);else{C.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 pe(
26
- /* @__PURE__ */de(me,{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=pt(e.id)??bt(e.label);return!!t&&!wr(t)});/* @__PURE__ */
27
- return de("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.currentTarget,void(g||(b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{p(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),p(null),w(null),s?v({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&&re(n)?ae(n,{className:"h-3.5 w-3.5 shrink-0"}):/* @__PURE__ */he(j,{name:"expand",className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),
28
- /* @__PURE__ */he("span",{className:"truncate flex-1",children:s?e.label:h(r.label)}),u&&/* @__PURE__ */he("span",{title:i.taskbar.offscreenDot,className:"shrink-0 h-1.5 w-1.5 rounded-full bg-amber-500"}),s&&/* @__PURE__ */he(y,{count:e.items.length,label:i.count.windows(e.items.length)}),!s&&/* @__PURE__ */he("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__ */he(j,{name:"close",className:"h-3 w-3",strokeWidth:2})})]},e.key)}),
29
- /* @__PURE__ */he("div",{className:"flex-1"}),k.length>=2&&/* @__PURE__ */de("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__ */he(j,{name:"grid",className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),g&&/* @__PURE__ */de(W,{portal:!0,minWidth:200,style:Lt(g.x,g.y),onClose:()=>v(null),children:[
31
- /* @__PURE__ */he(O,{children:g.label}),
32
- /* @__PURE__ */de(R,{onClick:()=>{v(null),g.items.forEach(e=>function(e){const t=Bn.get(e);t&&ar(t)}(e.id))},children:[
33
- /* @__PURE__ */he(j,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),i.taskbar.minimizeAllWindows]}),
34
- /* @__PURE__ */de(R,{onClick:()=>{v(null),g.items.forEach(e=>o(e.id))},children:[
35
- /* @__PURE__ */he("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */he("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__ */he(K,{}),
37
- /* @__PURE__ */de(R,{danger:!0,onClick:()=>{v(null),g.items.forEach(e=>t(e.id))},children:[
38
- /* @__PURE__ */he(j,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${g.items.length})`]})]}),m&&f&&/* @__PURE__ */he(St,{items:m,anchorEl:f,onActivate:e=>{o(e),p(null),w(null)},onClose:e=>{t(e),p(null),w(null)},onMouseEnter:()=>{b.current&&(clearTimeout(b.current),b.current=null)},onMouseLeave:x})]}),a)}var Tt=["/login","/forgot-password","/reset-password","/force-change-password"];function At({children:e,windowAccentForRoute:t}){const n=fe(),r=Tt.some(e=>n.pathname.startsWith(e)),[o,i]=ee([]),a=Z(o);_(()=>{a.current=o},[o]);const s=te(Pe,Ie,Ie),l=Z(/* @__PURE__ */new Map),c=e=>{const t=Ye(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};Q(()=>{gt.clear();for(const e of o)e.route&&gt.set(e.id,e.route)},[o]);const u=ne(e=>{i(t=>t.filter(t=>t.id!==e))},[]),d=ne(e=>{var t;pt(e)||ft(e)?(t=e,window.dispatchEvent(new CustomEvent(Tr,{detail:{windowKey:t}}))):u(e)},[u]),h=(e,t=!1)=>{const n=On;t&&dt.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,($n.get(i)??-1)>a)||ir(o),t&&dt.delete(e)},50)},m=(e,t,n)=>{const r=We;if(n||!r)return[...e,t];const o=function(e,t,n){if(!Ye(t))return e.length;if(t.shellOwned&&Ve(t,n.home))return 0;const r=Ve(t,n.home)?void 0:Xe(t)?.key;if(r){let t=-1;if(e.forEach((e,o)=>{Ye(e)&&!Ve(e,n.home)&&Xe(e)?.key===r&&(t=o)}),t>=0)return t+1}if("page"===t.type&&t.route&&!Ve(t,n.home)&&n.favorites.includes(t.route))return e.length>0&&Ve(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=>Ye(e[t])&&!Ve(e[t],n.home)?Xe(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:Ie(),favorites:r.favorites});return[...e.slice(0,o),t,...e.slice(o)]},p=ne(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))},[]),f=ne((e,t,n,r,o,a={})=>{if(!ke[e]||!ve(ke[e]))return;const s=`${e}:${t}`,l=yt();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:_e(n),openedFrom:l},!!a.append))})},[]),w=ne((e,t={})=>{if(!ke[e]||!ge(ke[e]))return;const n=ke[e],{reuse:r=!1,background:o=!1,shellOwned:s,search:l,append:c=!1}=t,u=e=>{var t;o?(t=e,Vn.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 p=yt();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:p,...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:p,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)})},[d]),y=ne(()=>{},[]),g=ne(()=>{},[]),v=d,b=d;/* @__PURE__ */
39
- return de(rt.Provider,{value:{openWindows:o,openEntity:f,openPage:w,reorderWindows:p,closeEntity:v,minimize:y,items:[],openItems:o,restore:g,remove:b,restoreIfMinimized:()=>!1},children:[e,
40
- /* @__PURE__ */he(zt,{openWindows:o,onRemove:d,onSplitView:Jr,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&&ir(e)}})},onActivateById:wt}),
41
- /* @__PURE__ */he(_r,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
42
- /* @__PURE__ */
43
- return he(Le.Provider,{value:c(e),children:/* @__PURE__ */he(Oe,{fallback:(t,n)=>/* @__PURE__ */he(Zr,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */he(Ke,{error:t,onReload:n})}),children:/* @__PURE__ */he(ln,{spec:lt(e),children:/* @__PURE__ */he(io,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */he(ct,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */he(mt,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var Dt=400;function It({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=Z(null),s=Z(!1);n&&!s.current&&(a.current="undefined"==typeof document?null:document.activeElement),s.current=n;const l=Z(!1),c=Z(void 0),u=Z(i),d=u.current&&!i;u.current=i;const h=()=>{l.current=!0,clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},Dt)};Q(()=>{n&&!r&&h()},[n,r]),Q(()=>{d&&n&&!r&&h()},[d]),Q(()=>()=>clearTimeout(c.current),[]),Q(()=>{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?I(t.current)[0]:void 0;s?s.focus():(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus())},[n,r,o,i,e,t]),_(()=>{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 Pt=null,Wt=/* @__PURE__ */new Set;function Rt(){return Pt}function Kt(e){if(Pt!==e){Pt=e;for(const e of Wt)e()}}function Ot(e){return Wt.add(e),()=>{Wt.delete(e)}}var $t=!1,jt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},Ft=()=>{};function qt(e){$t=e,jt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function Bt(e,t){$t&&("submenu"===e?jt.submenus++:jt.menus++,jt.menuKey=t)}function Ht(e){if(!$t)return Ft;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!$t)return;const r=performance.now()-t;"move"===e?jt.moveMs+=r:jt.resizeMs+=r}}function Ut(){const e=jt;return jt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var Yt=/* @__PURE__ */new Set([P,b]),Xt=e=>Yt.has(e)||"function"==typeof e&&"badge"===e.titleRole,Vt=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),Gt=/* @__PURE__ */new Set(["svg"]);function Jt(e){const t=[],n={text:"",accessories:[],badges:[],actions:[]};return _t(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function _t(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=>_t(e,t,n));if(!re(e))return;const r=e;if(r.type===p)return void(void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text));if(r.type===oe)return void ie.toArray(r.props.children).forEach(e=>_t(e,t,n));if("string"==typeof r.type){if(Gt.has(r.type))return;if(!Vt.has(r.type))return n.push(" "),ie.toArray(r.props.children).forEach(e=>_t(e,t,n)),void n.push(" ")}const o=ae(r,{key:`title-part-${t.accessories.length}`});t.accessories.push(o),(Xt(r.type)?t.badges:t.actions).push(o)}var Zt=/* @__PURE__ */new Map,Qt=/* @__PURE__ */new Set,en=0;function tn(){en++,Qt.forEach(e=>e())}function nn(e){return Zt.get(e)}function rn(e){return Qt.add(e),()=>{Qt.delete(e)}}function on(){return en}var an=X(""),sn=X(null);function ln({spec:e,children:t}){/* @__PURE__ */
44
- return he(sn.Provider,{value:e,children:t})}var cn=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),un='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600';function dn(e){return hn(e).replace(/\s+/g," ").trim()}function hn(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(hn).join("");if(re(e)){const t=e,n="string"==typeof t.type?t.type:"";return cn.has(n)?"":` ${hn(t.props?.children)} `}return""}function mn(e){const t=G(an);Q(()=>{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 pn={};function fn(e,t,n){const r=G(an);Q(()=>{if(!r)return;pn[r]||(pn[r]=[]);const o={label:e,icon:n,onClick:t};return pn[r].push(o),()=>{pn[r]=(pn[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function wn({title:e}){const t=Z(null);return Q(()=>{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__ */he("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function yn(e){}function gn(){return G(an)}function vn({children:e,position:t="right",quiet:n=!1}){const r=G(M),[o,i]=ee(null);return Q(()=>{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?pe(e,o):null}function bn({onClick:e,children:t,className:n}){const r=G(M);/* @__PURE__ */
45
- return he("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 xn="erp_window_positions",kn={};try{const e=localStorage.getItem(xn);e&&(kn=JSON.parse(e))}catch{}var En=null;function Cn(){En&&clearTimeout(En),En=setTimeout(()=>{try{localStorage.setItem(xn,JSON.stringify(kn))}catch{}},500)}var Mn="erp_activation_order",Nn=[];try{const e=localStorage.getItem(Mn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(Nn=t)}catch{}var Sn=null;function Ln(){Sn&&clearTimeout(Sn),Sn=setTimeout(()=>{try{localStorage.setItem(Mn,JSON.stringify(Nn))}catch{}},500)}function zn(e,t){kn[e]||(kn[e]=t,Cn())}function Tn(e){return kn[e]?{...kn[e]}:null}function An(e,t){kn[e]=t,Cn()}function Dn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(kn))n(kn[e],r,o)&&(delete kn[e],i=!0);i&&Cn()}var In={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},Pn=4e3,Wn=()=>{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"},Rn={small:.8,medium:1,large:1.25,maximized:1.25},Kn=/* @__PURE__ */new Set,On=0,$n=/* @__PURE__ */new Map;var jn=0;function Fn(){return jn}function qn(){jn++,C.forEach(e=>e())}var Bn=/* @__PURE__ */new Map,Hn=/* @__PURE__ */new Map,Un=/* @__PURE__ */new Map;function Yn(){for(let e=E.length-1;e>=0;e--){const t=Un.get(E[e]);if(t?.tab)return t.owner}return null}function Xn(){return te(N,Yn,()=>null)}var Vn=/* @__PURE__ */new Set;var Gn=null;function Jn(e){Gn=null,ir(e)}function _n(e){Gn=e;const t=Bn.get(e);t&&Jn(t)}var Zn=/* @__PURE__ */new Map;function Qn(e){return Zn.get(e)?.holdsChanges()??!1}function er(e){const t=Zn.get(e);return t?t.ask():Promise.resolve(!0)}function tr(e){Gn===e&&(Gn=null)}function nr(e,t,n){if(n&&Un.set(e,n),t)if(Bn.set(t,e),Hn.set(e,t),Vn.delete(t)){E.unshift(e);const n=Nn.indexOf(t);-1!==n&&Nn.splice(n,1),Nn.unshift(t),Ln()}else!function(e,t){const n=Nn.indexOf(t);if(-1===n)return void E.push(e);let r=E.length;for(let e=0;e<E.length;e++){const t=Hn.get(E[e]);if(t&&Nn.indexOf(t)>n){r=e;break}}E.splice(r,0,e)}(e,t),-1===Nn.indexOf(t)&&(Nn.push(t),Ln());else E.push(e);qn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&Gn===t&&Jn(e)}function rr(e){return e?Un.get(e)?.owner??Hn.get(e)??null:null}var or=/* @__PURE__ */new Set;function ir(e){const t=rr(S()),n=E.indexOf(e);-1!==n&&E.splice(n,1),E.push(e);const r=Un.get(e);if(r?.root)for(const[e,t]of Un){if(t.root||t.owner!==r.owner||Kn.has(e))continue;const n=E.indexOf(e);-1!==n&&E.splice(n,1),E.push(e)}Kn.delete(e);const o=Hn.get(e);if(o){const e=Nn.indexOf(o);-1!==e&&Nn.splice(e,1),Nn.push(o),Ln(),Gn&&Gn!==o&&(Gn=null)}qn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const i=rr(S());i&&i!==t&&or.forEach(e=>e(i))}function ar(e){const t=E.indexOf(e);-1!==t&&E.splice(t,1),Kn.add(e),$n.set(e,++On);const n=Hn.get(e);if(n){const e=Nn.indexOf(n);-1!==e&&(Nn.splice(e,1),Ln())}qn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var sr=/* @__PURE__ */new Set;var lr=8,cr=32;function ur(){return e()}var dr=x.windowBar,hr=80,mr=384,pr=400;function fr(e,t=ur()){const n=Math.min(Math.max(e.x,t.x+hr-e.w),t.x+t.w-hr),r=Math.min(Math.max(e.y,t.y),t.y+t.h-dr);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function wr(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=ur();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 yr(e){const t=ur(),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 gr=null;function vr(e){const t=(gr||((gr=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none",`z-index: ${q.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(gr)),gr);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 br(){gr&&(gr.style.opacity="0",gr.style.display="none")}var xr=[{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"}],kr=350,Er=200;function Cr({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o}){const[i,a]=ee(!1),s=Z(void 0),l=Z(void 0);Q(()=>()=>{clearTimeout(s.current),clearTimeout(l.current)},[]);const c=()=>{clearTimeout(l.current),s.current=setTimeout(()=>a(!0),kr)},u=()=>{clearTimeout(s.current),l.current=setTimeout(()=>a(!1),Er)};/* @__PURE__ */
46
- return de("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u,children:[
47
- /* @__PURE__ */he("button",{onClick:t,onFocus:c,onBlur:u,"aria-label":e?o.windowed:o.maximize,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */he("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(l.current),onMouseLeave:u,className:"absolute right-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:xr.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */he("button",{type:"button","aria-label":o[t],title:o[t],onClick:()=>{a(!1),n(e)},onFocus:()=>clearTimeout(l.current),onBlur:u,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__ */he("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var Mr="rosh-gesture-style";var Nr={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},Sr=4;function Lr(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(Mr))return;const e=document.createElement("style");e.id=Mr,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=Ht(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function zr(e){const t=E.indexOf(e);if(-1===t)return-1;const n=q.window+t*q.windowStep,r=Un.get(e);if(!r||r.root)return n;let o=-1;for(const[e,t]of Un){if(!t.root||t.owner!==r.owner)continue;const n=E.indexOf(e);-1!==n&&(o=Math.max(o,q.window+n*q.windowStep))}return o>=n?o+2+Math.min(t,7):n}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=E.length-1;e>=0;e--)sr.has(E[e])||E.splice(e,1);Nn=Nn.filter(e=>{const t=Bn.get(e);return null!=t&&sr.has(t)}),Ln(),qn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var Tr="modal-close-request";function Ar(e){te(N,Fn);const t=G(M);if(E.length<=1)return!0;if(e){const t=Bn.get(e);if(null!=t)return S()===t}return t?.active??null!=S()}var Dr=!1,Ir=/* @__PURE__ */new Set;function Pr(e){return Ir.add(e),()=>Ir.delete(e)}function Wr(){return Dr}function Rr(e){Dr!==e&&(Dr=e,Ir.forEach(e=>e()))}function Kr(){Rr(!Dr)}function Or(){Rr(!1)}var $r=null,jr=/* @__PURE__ */new Set;function Fr(e){return jr.add(e),()=>jr.delete(e)}function qr(){return $r}function Br(e){$r!==e&&($r=e,jr.forEach(e=>e()))}var Hr=null,Ur=/* @__PURE__ */new Set;function Yr(e){return Ur.add(e),()=>Ur.delete(e)}function Xr(){return Hr}function Vr(e){Hr!==e&&(Hr=e,Ur.forEach(e=>e()))}function Gr(){if(!Hr)return void Rr(!1);Br(Hr),Vr(null),Rr(!1)}function Jr(){Rr(!Dr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function _r(){const e=te(Pr,Wr),[t,n]=ee(e),[r,o]=ee(e);return Q(()=>{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?pe(
48
- /* @__PURE__ */he("div",{onMouseDown:e=>{e.stopPropagation(),Rr(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:q.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 Zr({open:t,onClose:l,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:y,footer:b,bodyScroll:x,onMinimize:k,initialBox:C,actions:z,actionsLeft:I,editing:P=!1,edit:O,allowPinOnTop:F,initialPosition:B,widget:H,compact:X,appStyle:V,flushBody:J,autoHeight:oe,autoMinHeight:ie,autoWidth:ce,widgetMenu:ue,dimensions:fe,windowKey:we,openedFromKey:ye,accentRgb:ge,children:ve}){const[be,xe]=ee(()=>r()),ke=T()&&!be,Ee=A()&&!!H,[Ce,Me]=ee(0),[Ne,Se]=ee(!1),ze=Z(null),Te=Z(0);Q(()=>{Te.current=Ce},[Ce]);const Ae=ne(e=>{ke&&(ze.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},Se(!0),Kt(ye??null))},[ke,ye]),De=te(Ot,Rt);Q(()=>{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,Se(!1),Me(0),void Kt(null);Me(Math.max(0,t))},t=()=>{if(!ze.current)return;const e=.3*window.innerWidth,t=Te.current>e;ze.current=null,Se(!1),t?(Me(window.innerWidth),setTimeout(()=>{l(),Me(0),Kt(null)},180)):(Me(0),Kt(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[Ie,Pe]=ee(c),We=Y(),Re=We.window;Q(()=>{Pe(c)},[c]);const Ke=se(()=>dn(Ie).trim()||void 0,[Ie]),je=le(),[qe,Be]=ee(!1),He=Z(!1),[Ue,Ye]=ee(!1),[Xe,Ve]=ee(null),Ge=G(sn),Je=G(Le),{prefs:_e,save:Ze}=D(),Qe=!!_e.window_accent_stripe,et=_e.favorite_documents||[],tt=!!Ge&&et.some(e=>e.entityType===Ge.entityType&&e.entityId===Ge.entityId),nt=ne(()=>{if(!Ge)return;const e=tt?et.filter(e=>!(e.entityType===Ge.entityType&&e.entityId===Ge.entityId)):[...et,{entityType:Ge.entityType,entityId:Ge.entityId,label:Ge.label}];Ze({favorite_documents:e})},[Ge,tt,et,Ze]),[rt,ot]=ee(null),[at,lt]=ee("top-right"===B?"right":"left"),ct=Z(!1),ut=Z(null);_(()=>{const e=ut.current;e&&(ge?e.style.setProperty("--window-accent-rgb",ge):e.style.removeProperty("--window-accent-rgb"))},[ge]);const dt=Z(!1),ht=Z(null),mt=Z(null),pt=Z(null),[ft,wt]=ee(!1),yt=Z(null),gt=Z(null),vt=Z(null),[bt,xt]=ee(!1);_(()=>{const e=gt.current,t=vt.current;if(!e||!t)return;const n=()=>xt(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!=b&&!1!==b]);const kt=!!O&&!H&&!X&&!V&&(O.editing||"hidden"!==O.state),Et=!!(b||z||I)||ft||kt,Ct=G($e),Mt=""!==G(an),Nt=Z(null);Nt.current=Je?{owner:Je.key,tab:Je.tab,root:!Mt}:null;const St=we||(Je&&!Mt?Je.key:null),Lt=!!Ct&&!Mt&&Ct.enabled&&Ct.hasState&&(P||Ct.declaredEditable)&&!Ct.handMounted&&Et&&!H&&!X&&!V&&!ke,zt=/* @__PURE__ */he(j,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),Tt=u&&re(u)?ae(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??zt,At=()=>/* @__PURE__ */he("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();Ve(e=>e?null:{x:t.left,y:t.bottom+4})},className:"shrink-0 p-0.5 rounded hover:bg-gray-200/50 transition-colors",title:"Window menu",children:Tt}),Dt=40,{minimize:Pt,items:Wt,restoreIfMinimized:$t,openWindows:jt}=st(),Ft=Z(`modal-${Math.random().toString(36).slice(2,8)}`).current,qt=w(Ft);Q(()=>{if(H)return sr.add(Ft),()=>{sr.delete(Ft)}},[H,Ft]),Q(()=>{const e=e=>{const t=e.detail;t?.id===Ft&&Pe(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[Ft]);const[Bt,Ht]=ee(q.window),Ut=function(e){const t=te(N,S);return E.length<=1||t===e}(Ft),Yt=Z(O);Yt.current=O;const Xt=!!O&&!O.editing&&"enabled"===O.state;Q(()=>{if(!t||!Ut||!Xt)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(g(e.target,ut.current)||(e.preventDefault(),e.stopPropagation(),Yt.current?.onEdit()))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Ut,Xt]);const Vt=function(e){return te(N,()=>Kn.has(e))}(Ft);It({panelRef:ut,bodyRef:ht,open:t,widget:!!H,active:Ut,minimized:Vt});const Gt=te(Pr,Wr),_t=te(Fr,qr),Qt=te(Yr,Xr),en=!F&&!H,nn=Gt&&en,[rn,on]=ee(!1),ln=nn&&Qt===Ft,[cn,hn]=ee(!1),mn=cn&&en&&_t===Ft?"picked":null,fn=Z(nn);Q(()=>{if(fn.current&&!nn){hn(!0);const e=setTimeout(()=>{hn(!1),$r===Ft&&Br(null)},700);return fn.current=nn,()=>clearTimeout(e)}fn.current=nn},[nn,Ft]),Q(()=>{nn||on(!1)},[nn]),Q(()=>{const e=mt.current,t=pt.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>wt(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]),Q(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&ut.current){const t=ut.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=mt.current,n=pt.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const wn=Z(!1),yn=ne(e,[]),gn=ne(()=>{const t=e(),n=fe?fe[0]:In[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=Rn[Wn()],l=fe?Math.min(fe[1],i):(()=>{const e=("sm"===h?500:"md"===h?600:"lg"===h?700:"xl"===h?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*(E.length-1),u=Math.max(Dt,(i-l)/2),d=(o-a)/2,m=t.h-Dt-l-u;return"top-right"===B?{x:t.x+t.w-a-Dt,y:t.y+Dt,w:a,h:l}:"top-left"===B?{x:t.x+Dt,y:t.y+Dt,w:a,h:l}:{x:t.x+Math.max(Dt,(o-a)/2+Dt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),vn=Z(!1);t||(vn.current=!1);const bn=we||d||null;Q(()=>{if(!t)return;nr(Ft,bn,Nt.current??void 0),we||ir(Ft),wn.current=!1,Ht(zr(Ft));const e=()=>{Ht(zr(Ft))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===we;if(!e.label)return!1;const t=ut.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(ir(Ft),Dn.current)return;const t=ur(),n=Math.min(Gn.current.w,t.w-40),o=Math.min(Gn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;Mn({x:i,y:a,w:n,h:o}),Vn(!1)},i=e=>{const t=e.detail;r(t)&&(ir(Ft),Ve({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==we)return;ir(Ft);const t=Gn.current,n=function(e,t=ur()){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=ut.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)}Mn(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=E.indexOf(e);-1!==t&&(E.splice(t,1),qn()),Kn.delete(e),$n.delete(e),Un.delete(e);const n=Hn.get(e);n&&(Hn.delete(e),Bn.delete(n))}(Ft),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,Ft,bn,yn]);const xn=!H&&"maximized"===Wn(),[En,Mn]=ee(()=>{if(bn&&kn[bn]){const e={...kn[bn]};return fe&&(e.w=fe[0],oe||(e.h=fe[1])),fr(e)}return C?{x:C.x,y:C.y,w:C.w,h:C.h}:xn?yn():gn()}),[Nn,Sn]=ee(()=>!oe),Ln=Z(be),zn=Z(null);Q(()=>{const e=()=>{const e=r();e!==Ln.current&&zn.current?.(e),Ln.current=e,xe(e),Ht(zr(Ft))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[Ft]);const Tn=be&&!!Je?.tab&&!Mt&&!H&&!ke,An=Tn,Dn=Z(An);Dn.current=An;const On=Xn(),jn=be&&!!Je?.tab&&!H&&!ke&&!Gt&&On!==Je.key,Fn=!!H&&be&&!Gt&&null!==On,[Yn,Vn]=ee(()=>bn&&kn[bn]||C?An:An||xn),Gn=Z(En);Gn.current=En;const Jn=Z(Yn);_(()=>{Jn.current=Yn},[Yn]),_(()=>{if(Nn||Tn)return;const e=ut.current,t=ht.current;if(!e||!t)return;const n=ie??(H?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 p=t.offsetHeight,f=c.offsetHeight;t.style.flex=d,t.style.height=m,t.style.overflowY=h;const w=c.offsetHeight>f+4,y=Math.max(n,window.innerHeight-r-Math.max(0,Gn.current.y)-24),g=w?Math.min(Gn.current.h,y):Math.min(Math.max(n,u+p),y),v=Math.abs(g-o)>1;v&&(o=g,Mn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),H||(g<=n?i&&(clearTimeout(i),i=null):(v||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&Sn(!0)},160)))},l=new ResizeObserver(s);s(),yt.current&&l.observe(yt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[Nn,H,ie,Et,Tn]),_(()=>{if(!oe||!Nn||H||!t)return;const e=yt.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||Yn)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=ie??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,Gn.current.y)-24);Mn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[oe,Nn,H,t,Yn,ie]);const _n=!1!==ce&&!H&&!V&&!ke,[Qn,er]=ee(()=>!_n);_(()=>{if(Qn||!t)return;if(!_n||Yn)return void er(!0);const n=ut.current,r=ht.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let l=Gn.current.w,c=0;const u=()=>er(!0),d=()=>{c=0;const t=Gn.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=[],p=[];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),p.push(t))}if(!m.length)return;const f=Math.min(h,t.w+Math.max(...p)),w=f-t.w,y=n.style.width;n.style.width=`${f}px`;const g=m.map((e,t)=>({over:p[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,Dt);v!==t&&(l=v.w,Mn(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,Pn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Qn,t,_n,Yn]);const tr=Z(null),rr=!(!Je?.tab||Mt||H||ke);zn.current=t=>{if(!rr)return;if(t)return tr.current||(tr.current={box:{...Gn.current},maximized:Jn.current}),void(Jn.current=!0);const r=tr.current;tr.current=null;const o=e();if(r?.maximized)return Jn.current=!0,Vn(!0),void Mn(o);const i=r?.box??(bn?kn[bn]:void 0);if(Jn.current=!1,Vn(!1),i&&!n(i,o,!1)){const e={...i};fe&&(e.w=fe[0],oe||(e.h=fe[1])),Mn(fr(e))}else Mn(gn())},Q(()=>{An&&(Jn.current=!0,Vn(!0),Mn(yn()))},[An,yn]),Q(()=>{if(H)return;const e=()=>{const e=bn?kn[bn]:void 0;if(Jn.current=!1,Vn(!1),e){const t={...e};fe&&(t.w=fe[0],oe||(t.h=fe[1])),Mn(fr(t))}else Mn(gn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[H,gn,bn]),Q(()=>{t&&bn&&!Tn&&(kn[bn]=En,Cn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[En,t,bn,Tn]),Q(()=>{if(!t)return;const e=()=>{Jn.current?Mn(yn()):document.body.classList.contains("rosh-gesturing")||Mn(fr)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Yn&&(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,Yn,yn]),Q(()=>{if(t&&(Be(!1),He.current=!1,ct.current=!1,er(!_n),!Dn.current)){if(bn&&kn[bn]){const e=kn[bn];return void Mn(t=>fr({...e,...oe?{h:t.h}:{},..._n?{x:t.x,w:t.w}:{}}))}C&&(Mn({x:C.x,y:C.y,w:C.w,h:C.h}),Vn(C.maximized))}},[t]),Q(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{ut.current?.contains(t.target)&&!He.current&&(He.current=!0,e=setTimeout(()=>Be(!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,m]);const or="auto"===m?qe:!0===m,dr=Je&&!Mt?Je.key:null,hr=se(()=>Jt(Ie),[Ie]),wr=Z({shortcutSpec:Ge,isOnDesktop:tt,toggleDesktopShortcut:nt,taskbarStrings:We.taskbar});_(()=>{wr.current={shortcutSpec:Ge,isOnDesktop:tt,toggleDesktopShortcut:nt,taskbarStrings:We.taskbar}});const gr=Z(null);gr.current||(gr.current={open:(e,t)=>Ve({x:e,y:t}),items:()=>{const e=wr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of pn[Ft]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),Q(()=>{if(t&&dr)return()=>{return e=dr,void(Zt.delete(e)&&tn());var e}},[t,dr]),it(!(we||!t)&&or);const xr=ne(()=>or||"auto"===m&&He.current,[or,m]),kr=ne(async e=>{if(ct.current)return!1;if(!xr())return!0;ct.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 f({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 ct.current=!1,r},[xr,Ke]),Er=ne(()=>ct.current?Promise.resolve():xr()?kr("close").then(e=>{e&&l()}):(l(),Promise.resolve()),[xr,kr,l]),Mr=ne(async()=>{await kr("discard")&&(He.current=!1,Be(!1),Yt.current?.onDiscard())},[kr]),Ar=ne(async()=>{const e=await kr("switch");return e&&(He.current=!1,Be(!1)),e},[kr]),Dr=Z(()=>!1);_(()=>{Dr.current=xr}),_(()=>{if(!t||!we)return;const e={holdsChanges:()=>Dr.current(),ask:Ar};return Zn.set(we,e),()=>{Zn.get(we)===e&&Zn.delete(we)}},[t,we,Ar]),_(()=>{if(!t||!St)return;const e=e=>{e.detail?.windowKey===St&&Er()};return window.addEventListener(Tr,e),()=>window.removeEventListener(Tr,e)},[t,St,Er]);const Ir=Z(null),Kr=ne(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Ve(null),ir(Ft),Dn.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=ut.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Ir.current){const t=Ir.current;Ir.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:Gn.current.x,c=s?s.top:Gn.current.y,u=s?s.height:Gn.current.h,d=s?s.width:Gn.current.w;Vn(!1),Mn(e=>({...e,x:l,y:c,w:d,h:u}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<Sr&&Math.abs(e.clientY-i)<Sr)return;r=Lr(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)`),Gn.current={...Gn.current,x:s,y:u},!H){const t=function(e,t){const n=ur(),r=e<=n.x+lr,o=e>=n.x+n.w-lr,i=t<=n.y+lr,a=t>=n.y+n.h-lr,s=e<=n.x+cr,l=e>=n.x+n.w-cr,c=t<=n.y+cr,u=t>=n.y+n.h-cr;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?vr(yr(t)):br())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),br();const e=fr({...Gn.current});if(Gn.current=e,!H&&h){Ir.current={x:l,y:c,w:d,h:u};const e=yr(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 Mn(e)}if(H){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=""),Mn(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),Or=ne((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=ut.current,l=s?.getBoundingClientRect(),c=l?l.left:Gn.current.x,u=l?l.top:Gn.current.y,d=l?l.width:Gn.current.w,h=l?l.height:Gn.current.h,m="sw"===t||"nw"===t||"w"===t,p="ne"===t||"nw"===t||"n"===t,f="se"===t||"ne"===t||"e"===t,w="se"===t||"sw"===t||"s"===t;Vn(!1),Mn({x:c,y:u,w:d,h:h}),Gn.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,Gn.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)<Sr&&Math.abs(e.clientY-a)<Sr)return;o=Lr(n,r,Nr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(mr,d+e)),w&&(i=Math.max(pr,h+t)),m){const t=Math.max(mr,d-e);n=c+d-t,o=t}if(p){const e=Math.max(pr,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?.(),Mn({...Gn.current})};window.addEventListener("pointermove",b),window.addEventListener("pointerup",x)},[]),jr=ne(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(),ir(Ft),"Enter"===e.key)return void(Yn?(Vn(!1),Mn(gn())):(Vn(!0),Mn(yn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Ir.current||(Ir.current={...Gn.current})};if(r<0)return e(),Vn(!0),void Mn(yn());if(r>0){if(Yn)return Vn(!1),void Mn(gn());if(Ir.current){const e=fr(Ir.current);return Ir.current=null,Gn.current=e,void Mn(e)}return void ar(Ft)}e(),Vn(!1);const t=yr(n<0?"left":"right");return Gn.current=t,void Mn(t)}if(Yn)return;const o=Gn.current,i=e.shiftKey?{...o,w:Math.max(mr,o.w+24*n),h:Math.max(pr,o.h+24*r)}:fr({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Gn.current=i,Mn(i)},[Ft,Yn,gn,yn]),Hr=ne(e=>{Ir.current||(Ir.current={...Gn.current}),Vn(!1);const t=yr(e);Gn.current=t,Mn(t),ir(Ft)},[Ft]),Ur=An||nn?{}:{tabIndex:0,role:"group","aria-label":Ke?`${Ke} — ${Re.windowSuffix}`:Re.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:jr},Vr=()=>{Vn(!0),Mn(yn())},Gr=ne(()=>{const e=ut.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(un);t&&!t.disabled&&t.click()}},[]);Q(()=>{if(!t)return;if(H)return;const e=e=>{if(E[E.length-1]===Ft&&!g(e.target,ut.current)&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Gr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&ut.current?.contains(t)))return;if(t.closest(L))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Gr,Ft,H]),Q(()=>{if(!t)return;const e=e=>{E[E.length-1]===Ft&&(g(e.target,ut.current)||((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:Ft}})),He.current=!1,Be(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:Ft}})))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),Q(()=>{if(!t)return;if(H)return;const e=e=>{if("Escape"===e.key&&E[E.length-1]===Ft){if(U(e))return e.preventDefault(),void e.stopPropagation();if(Tn&&!P)return;e.preventDefault(),e.stopPropagation(),Er()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Er,Ft,H,Tn,P]);const Jr=t&&(void 0!==p||void 0!==y),[_r]=ee(()=>{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}),Zr=Tn&&!Je?.home&&hr.actions.length>0;Q(()=>{t&&dr&&function(e,t){const n=Zt.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(Zt.set(e,t),tn())}(dr,{title:hr.text||Ke,dirty:or,copy:hr.copy,actions:Zr&&_r?_r:void 0,menu:gr.current??void 0})},[t,dr,Ke,or,hr.text,hr.copy,Zr,_r]);const Qr=ne(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(Q(()=>{if(!t)return;const e=e=>{if(E[E.length-1]!==Ft)return;if(g(e.target,ut.current))return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Jr&&(e.preventDefault(),p?p():Qr("bottom")),"k"===e.key&&Jr&&(e.preventDefault(),y?y():Qr("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,y,Jr,Qr,Ft]),!t||vn.current)return null;const eo=nn?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=ur(),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}}(Ft):null,to=nn&&eo?Math.min(eo.w/En.w,eo.h/En.h):1,no=(()=>{if(nn&&eo){const e=to,t=En.w*e,n=En.h*e,r=eo.x+(eo.w-t)/2-En.x,o=eo.y+(eo.h-n)/2-En.y,i=rn||ln;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:q.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(cn&&en){const e="picked"===mn;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:q.expose+30}:{}}}return null})(),ro=v({modal:!1,titleId:!H&&(Tn?!Je?.home:!ke)?je:void 0,label:hr.text||Ke}),oo=/* @__PURE__ */de("div",{children:[
49
- /* @__PURE__ */de("div",{ref:ut,"data-modal-panel":!0,"data-modal-id":Ft,"data-window-key":we||void 0,...F?{"data-utility":""}:{},...Ue?{"data-pinned-top":""}:{},...H?{"data-widget":""}:{},...Je?{"data-window-owner":Je.key}:{},...Je&&!Mt?{"data-window-root":""}:{},...Tn?{"data-window-tab":""}:{},...ro,className:Tn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(H?Ut?"shadow-xl":"shadow-lg":"border "+(Ut?"shadow-xl border-line":"shadow-lg border-line-strong")),onMouseDownCapture:e=>{if(dt.current=!1,nn){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),Br(Ft),Rr(!1),void ir(Ft)}if(!Ut&&!H&&!Ue&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===ut.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),dt.current=!0,Ve(null),ir(Ft),window.addEventListener("mouseup",()=>{setTimeout(()=>{dt.current=!1},0)},{once:!0}))}},onClickCapture:e=>{dt.current&&(dt.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(nn)return;Ve(null);e.target.closest("[data-modal-panel]")===ut.current&&(e.target.closest("button, input, a, select, textarea")||ir(Ft))},style:ke?{zIndex:Bt+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${Ce}px)`,transition:Ne?"none":"transform 180ms ease-out",...H?{display:"none"}:{},...Bt<0?{display:"none"}:{},...Ut||Ue||De&&we===De?{}:{display:"none"},...qt?{visibility:"hidden",pointerEvents:"none"}:{}}:{zIndex:Ue?q.pinnedWindow:Bt+1,width:En.w,height:En.h,top:En.y,...H&&"right"===at?{right:window.innerWidth-En.x-En.w}:{left:En.x},...Bt<0&&!Ue?{display:"none"}:{},...Ee?{display:"none"}:{},...jn||Fn||qt?{visibility:"hidden",pointerEvents:"none"}:{},...no??{}},children:[ke&&!H&&/* @__PURE__ */he("div",{onPointerDown:Ae,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),H?null:Tn?Je?.home?null:/* @__PURE__ */de(me,{children:[
50
- /* @__PURE__ */he("h2",{id:je,"data-window-title":!0,className:"sr-only",children:hr.text||Ke}),Zr&&_r&&pe(
51
- /* @__PURE__ */he(me,{children:hr.actions}),_r),hr.badges.length>0&&/* @__PURE__ */he("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:hr.badges})]}):ke?null:
52
- /* @__PURE__ */de("div",X?{onPointerDown:Kr,"data-window-chrome":"",...Ur,className:"flex items-center justify-between h-(--row-height-compact-bar) px-3 border-b border-line shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(Ut?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Ut?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
53
- /* @__PURE__ */de("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:Ut?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!nn&&At(),
54
- /* @__PURE__ */he("span",{id:je,className:"truncate",children:nn?dn(Ie):Ie})]}),!nn&&/* @__PURE__ */de("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[F&&/* @__PURE__ */he("button",{onClick:()=>Ye(e=>!e),title:Ue?Re.unpin:Re.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(Ue?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */he(j,{name:"bookmark-square",className:"h-3 w-3",fill:Ue?"currentColor":"none",strokeWidth:1.5})}),
55
- /* @__PURE__ */he("button",{type:"button",onClick:Er,"aria-label":Re.close,className:"rounded p-0.5 text-ink-faintest hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */he(j,{name:"close",className:"h-4 w-4"})})]})]}:V?{onPointerDown:Kr,"data-window-chrome":"",...Ur,className:"flex items-center justify-between h-(--row-height-compact-bar) px-3 border-b border-line shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(Ut?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Ut?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
56
- /* @__PURE__ */de("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:Ut?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!nn&&At(),
57
- /* @__PURE__ */he("span",{id:je,className:"truncate",children:nn?dn(Ie):Ie})]}),!nn&&/* @__PURE__ */de("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[F&&/* @__PURE__ */he("button",{onClick:()=>Ye(e=>!e),title:Ue?Re.unpin:Re.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(Ue?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */he(j,{name:"bookmark-square",className:"h-3 w-3",fill:Ue?"currentColor":"none",strokeWidth:1.5})}),
58
- /* @__PURE__ */he("button",{onClick:()=>ar(Ft),"aria-label":Re.minimize,title:Re.minimize,className:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",children:"─"}),!An&&/* @__PURE__ */he(Cr,{maximized:Yn,onToggleMax:()=>{Yn?(Vn(!1),Mn(gn())):Vr()},onSnap:Hr,buttonClassName:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",strings:Re}),
59
- /* @__PURE__ */he("button",{type:"button",onClick:Er,"aria-label":Re.close,className:"rounded p-0.5 text-ink-faintest hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */he(j,{name:"close",className:"h-4 w-4"})})]})]}:{onPointerDown:Kr,"data-window-chrome":"",...Ur,className:"flex items-center justify-between h-(--row-height-window-bar) px-3 border-b border-gray-200 shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(Ut?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Ut?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
60
- /* @__PURE__ */de("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:Ut?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!nn&&At(),
61
- /* @__PURE__ */he("span",{id:je,className:"truncate",children:nn?dn(Ie):Ie})]}),!nn&&/* @__PURE__ */de("div",{className:"flex items-center gap-3 shrink-0 ml-4",children:[F&&/* @__PURE__ */he("button",{onClick:()=>Ye(e=>!e),title:Ue?Re.unpin:Re.pinOnTop,className:"text-xs px-2 py-1 rounded hover:bg-gray-200 "+(Ue?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */he(j,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:Ue?"currentColor":"none",strokeWidth:1.5})}),
62
- /* @__PURE__ */he("button",{onClick:()=>ar(Ft),"aria-label":Re.minimize,title:Re.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!An&&/* @__PURE__ */he(Cr,{maximized:Yn,onToggleMax:()=>{Yn?(Vn(!1),Mn(gn())):Vr()},onSnap:Hr,buttonClassName:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",strings:Re}),
63
- /* @__PURE__ */he("button",{type:"button",onClick:Er,"aria-label":Re.close,className:"rounded-(--radius-control) text-ink-faintest hover:text-gray-600",children:/* @__PURE__ */he(j,{name:"close",className:"h-5 w-5"})})]})]}),ge&&Qe&&!H&&!ke&&/* @__PURE__ */he("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${Ut?.9:.55})`}}),
64
- /* @__PURE__ */he(an.Provider,{value:Ft,children:/* @__PURE__ */he(M.Provider,{value:{rightRef:mt,leftRef:pt,notify:()=>wt(!0),active:Ut,isDirty:or,footerOpen:Et&&!H&&!X&&!V&&!ke},children:/* @__PURE__ */he("div",{ref:ht,...H?{onPointerDown:Kr,onContextMenu:e=>{e.preventDefault(),ot({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${H?"p-0 cursor-move":V||J?"p-0":X?"p-2":"p-4"} ${H||Tn?"":"backdrop-blur-sm"} ${!1===x||V||J?"overflow-hidden":"overflow-y-auto overscroll-contain"} ${H?"rounded-2xl select-none":""}`,style:{...H?{touchAction:"none"}:{},backgroundColor:H?"transparent":Tn?"rgb(var(--window-content-rgb))":Ut?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */he(Oe,{children:ve})})})}),H&&rt&&/* @__PURE__ */de(W,{minWidth:160,style:{left:rt.x,top:rt.y},onClose:()=>ot(null),children:[
65
- /* @__PURE__ */he(R,{onClick:()=>{ot(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:Ft}))},children:"Settings"}),
66
- /* @__PURE__ */he(K,{}),ue&&/* @__PURE__ */de(me,{children:[ue,
67
- /* @__PURE__ */he(K,{})]}),
68
- /* @__PURE__ */de(R,{onClick:()=>{ot(null),Ye(e=>!e)},children:[
69
- /* @__PURE__ */he("span",{className:"flex-1",children:"Always on Top"}),Ue&&/* @__PURE__ */he(j,{name:"check",className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
70
- /* @__PURE__ */he(K,{}),
71
- /* @__PURE__ */he(R,{onClick:()=>{ot(null),Er()},children:"Close"})]}),
72
- /* @__PURE__ */de("div",{onPointerDown:Kr,ref:yt,"data-modal-footer":"",className:`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${Tn?"":" cursor-move"}${Ut&&!Tn?" backdrop-blur-sm":""}${H||X||V||ke||!Et?" hidden":""}`,style:{touchAction:"none",backgroundColor:Tn?"rgb(var(--window-footer-rgb))":Ut?"rgb(var(--window-footer-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-footer-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
73
- /* @__PURE__ */de("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[Lt&&/* @__PURE__ */he(Fe,{auto:!0}),I,
74
- /* @__PURE__ */he("div",{ref:pt,"data-modal-actions-left":!0,className:"flex items-center gap-2 shrink-0"}),null!=b&&!1!==b&&
75
- /* @__PURE__ */he("div",{ref:gt,"data-modal-footer-facts":"",className:"min-w-0 flex-1 overflow-hidden",children:/* @__PURE__ */he("div",{ref:vt,className:"inline-flex items-center gap-2 whitespace-nowrap"+(bt?" invisible":""),children:b})})]}),
76
- /* @__PURE__ */de("div",{"data-modal-footer-right":"",className:"flex items-center gap-2 ml-auto shrink-0",children:[kt&&O&&(O.editing?/* @__PURE__ */he($,{variant:"secondary",size:"sm","data-modal-discard":"",onClick:()=>{Mr()},children:Re.discard}):"object"==typeof O.state?/* @__PURE__ */he($,{variant:"secondary",size:"sm","data-modal-edit":"","aria-disabled":!0,disabledReason:O.state.disabledReason,children:Re.edit}):/* @__PURE__ */he($,{variant:"secondary",size:"sm","data-modal-edit":"",onClick:()=>O.onEdit(),children:Re.edit})),
77
- /* @__PURE__ */he("div",{ref:mt,"data-modal-actions":!0,className:"flex items-center gap-2"}),z]})]}),!H&&!ke&&!nn&&Ut&&!An&&/* @__PURE__ */de(me,{children:[
78
- /* @__PURE__ */he("div",{onPointerDown:e=>Or(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
79
- /* @__PURE__ */he("div",{onPointerDown:e=>Or(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
80
- /* @__PURE__ */he("div",{onPointerDown:e=>Or(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
81
- /* @__PURE__ */he("div",{onPointerDown:e=>Or(e,"nw"),className:"absolute top-0 left-0 w-3 h-3 cursor-nwse-resize z-10"}),
82
- /* @__PURE__ */he("div",{onPointerDown:e=>Or(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
83
- /* @__PURE__ */he("div",{onPointerDown:e=>Or(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
84
- /* @__PURE__ */he("div",{onPointerDown:e=>Or(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
85
- /* @__PURE__ */he("div",{onPointerDown:e=>Or(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),nn&&/* @__PURE__ */he("div",{className:"absolute inset-0",style:{zIndex:q.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>on(!0),onMouseLeave:()=>on(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),ir(Ft),Rr(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:rn&&/* @__PURE__ */he("button",{type:"button","data-expose-close":!0,"aria-label":We.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/to})`,transformOrigin:"top right",zIndex:q.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),Er()},children:/* @__PURE__ */he(j,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),nn&&eo&&/* @__PURE__ */he("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:eo.x,top:eo.y+eo.h+4,width:eo.w,zIndex:q.expose+(rn?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:dn(Ie)})]}),io=Xe&&/* @__PURE__ */de(W,{style:{left:Xe.x,top:Xe.y},onClose:()=>Ve(null),minWidth:160,children:[!H&&!X&&!Tn&&/* @__PURE__ */de(me,{children:[
86
- /* @__PURE__ */de(R,{onClick:()=>{ar(Ft),Ve(null)},children:[
87
- /* @__PURE__ */he(j,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),Re.minimize]}),!An&&/* @__PURE__ */de(R,Yn?{onClick:()=>{Vn(!1),Mn(gn()),Ve(null)},children:[
88
- /* @__PURE__ */he(j,{name:"collapse",className:"h-4 w-4",strokeWidth:1.5}),Re.windowed]}:{onClick:()=>{Vr(),Ve(null)},children:[
89
- /* @__PURE__ */he(j,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),Re.maximize]})]}),F&&!Tn&&/* @__PURE__ */de(R,{onClick:()=>{Ye(e=>!e),Ve(null)},children:[
90
- /* @__PURE__ */he(j,{name:"bookmark-square",className:"h-4 w-4 "+(Ue?"text-blue-600":""),fill:Ue?"currentColor":"none",strokeWidth:1.5}),Ue?Re.unpin:Re.pinOnTop]}),Ge&&/* @__PURE__ */de(R,{onClick:()=>{Ve(null),nt()},children:[
91
- /* @__PURE__ */he(j,{name:"star",className:"h-4 w-4",fill:tt?"currentColor":"none",strokeWidth:1.5}),tt?We.taskbar.removeFromDesktop:We.taskbar.addToDesktop]}),(pn[Ft]||[]).length>0&&/* @__PURE__ */he(me,{children:(pn[Ft]||[]).map((e,t)=>/* @__PURE__ */de(R,{onClick:()=>{Ve(null),e.onClick()},children:[e.icon,e.label]},t))}),!(Tn&&Je?.home)&&/* @__PURE__ */de(me,{children:[
92
- /* @__PURE__ */he(K,{}),
93
- /* @__PURE__ */de(R,{danger:!0,onClick:()=>{Ve(null),Er()},children:[
94
- /* @__PURE__ */he(j,{name:"close",className:"h-4 w-4"}),Re.close]})]})]}),ao=!!we&&jt.some(e=>e.id===we),so=!Vt||ao||H?null:/* @__PURE__ */de("div",{"data-modal-restore-tab":!0,"data-modal-id":Ft,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:[
95
- /* @__PURE__ */he("button",{type:"button",onClick:()=>ir(Ft),title:Re.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||Re.windowSuffix}),
96
- /* @__PURE__ */he("button",{type:"button",onClick:()=>ir(Ft),title:Re.restore,"aria-label":Re.restore,className:"rounded px-2 py-0.5 text-xs leading-none text-ink-faintest hover:bg-gray-100 hover:text-gray-600",children:"▴"}),
97
- /* @__PURE__ */he("button",{type:"button",onClick:()=>{Er()},title:Re.close,"aria-label":Re.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 pe(
98
- /* @__PURE__ */de(sn.Provider,{value:null,children:[oo,io,so]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{Dr&&"Escape"===e.key&&(Vr(null),Rr(!1))});var Qr=100,eo={past:[],future:[]};function to(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>Qr?r.slice(r.length-Qr):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:eo}}var no=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var ro=500,oo=250;function io({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,i]=ce(to,eo),a=Z(/* @__PURE__ */new Map),[s,l]=ee(0),c=s>0,[u,d]=ee(0),[h,m]=ee(0),p=h>0,{hasAnyPerm:f}=z(),w=t&&0===u&&(!(n&&n.length>0)||f(n)),y=Z(null),g=Z(!1),v=ne(()=>{const e={};for(const[t,n]of a.current)e[t]=n.getLast();return e},[]),b=ne((e,t)=>{a.current.has(e)||l(e=>e+1),a.current.set(e,t)},[]),x=ne(e=>{a.current.delete(e)&&l(e=>e-1)},[]),k=ne(e=>{d(t=>t+(e?1:-1))},[]),E=ne(e=>{m(t=>t+(e?1:-1))},[]),[C,N]=ee(0),S=C>0,L=ne(e=>{N(t=>t+(e?1:-1))},[]),T=G($e),A=T?.claimReadOnly;Q(()=>{if(A&&!w)return A(!0),()=>A(!1)},[A,w]);const D=T?.claimOwnMount;Q(()=>{if(D&&S)return D(!0),()=>D(!1)},[D,S]);const I=Z({last:0,count:0,tripped:!1}),P=Z(!1),W=ne((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>oo&&(r.count=0),r.last=o,++r.count>ro)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${ro} 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]),R=ne(e=>{for(const[t,n]of Object.entries(e)){const e=a.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),K=ne(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};R(e.values),i({type:"undo",redoStep:t})},[o.past,v,R]),O=ne(()=>{const e=o.future[0];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};R(e.values),i({type:"redo",undoStep:t})},[o.future,v,R]),[$,j]=ee(0),F=Z(0),q=Z(0),B=Z(!1),H=ne(()=>{g.current=!0,P.current=!1,y.current=null,F.current+=1,q.current=F.current,j(F.current)},[]),U=Z(void 0),Y=ne(e=>{void 0!==e&&(void 0!==U.current&&e!==U.current&&(B.current=!0),U.current=e),H()},[H]);Q(()=>{g.current&&$===q.current&&(g.current=!1,y.current=null,(P.current||B.current)&&i({type:"clear"}),P.current=!1,B.current=!1)},[$]);const X=ne(()=>{B.current=!0,i({type:"clear"}),H()},[H]),V=w&&o.past.length>0,J=w&&o.future.length>0,_=Ar(r),te=Z({undo:K,redo:O,canUndo:V,canRedo:J});te.current={undo:K,redo:O,canUndo:V,canRedo:J},Q(()=>{if(!_||!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&&no.has(r.tagName.toUpperCase())?null:n}(e);if(!t)return;const n=te.current;("undo"===t?n.canUndo:n.canRedo)&&(e.preventDefault(),"undo"===t?n.undo():n.redo())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[_,w]);const re=se(()=>({register:b,unregister:x,record:W,undo:K,redo:O,clear:X,baseline:Y,canUndo:V,canRedo:J,enabled:w,hasState:c,handMounted:S,claimOwnMount:L,claimReadOnly:k,declaredEditable:p,claimEditable:E,undoLabel:V?o.past[o.past.length-1].label:null,redoLabel:J?o.future[0].label:null}),[b,x,W,K,O,X,Y,V,J,w,c,S,L,k,p,E,o.past,o.future]),oe=""!==gn(),ie=G(M)?.footerOpen??!1,ae=oe&&w&&c&&!S&&ie;/* @__PURE__ */
99
- return de($e.Provider,{value:re,children:[ae&&/* @__PURE__ */he(vn,{position:"left",quiet:!0,children:/* @__PURE__ */he(Fe,{auto:!0})}),e]})}function ao(){const e=G($e),t=ne(()=>{},[]);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 so(e){const t=G($e),n=t?.claimReadOnly,r=t?.claimEditable;Q(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function lo(e,t,n){const r=G($e),o=le(),i=Z(e),a=Z(t);a.current=t,Q(()=>{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=Z(r);c.current=r;const u=Z({label:s,coalesceKey:l});u.current={label:s,coalesceKey:l},Q(()=>{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 co(e,t){const[n,r]=ee(e);return lo(n,e=>r(()=>e),t),[n,r]}export{bn as CancelButton,Ne as DesktopHostProvider,ut as DocFavStar,Ze as EntityWindowFallback,Je as EntityWindowLoading,Qe as EntityWindowState,un as MODAL_SUBMIT_SELECTOR,Zr as Modal,vn as ModalActions,Fe as UndoControls,io as UndoProvider,ke as WINDOW_REGISTRY,Ke as WindowCrashedFallback,Oe as WindowErrorBoundary,At as WindowManagerProvider,wn as WindowTitle,wt as activateWindowById,Ht as beginWindowGesture,tr as cancelWindowFront,Ce as client_default,Gr as commitExposeHighlight,er as confirmWindowDiscard,Ut as drainPerfEvents,Or as exitExposeMode,Dn as forgetMaximizedWindowBoxes,vt as getActiveWindowRoute,Xr as getExposeHighlight,on as getWindowChromeVersion,Tn as getWindowPosition,tt as isDraftEntityId,nt as isDraftEntityWindow,ve as isEntityEntry,ge as isPageEntry,Ee as isShellApiClientConfigured,Ye as isTabWindow,Bt as markMenuOpen,nn as readWindowChrome,_n as requestWindowFront,Vr as setExposeHighlight,qt as setPerfCollecting,De as setShellHomeRoute,Re as setShellTabStrip,xe as setShellWindowRegistry,zn as setWindowDefaultPosition,An as setWindowPosition,Jt as splitTitle,Yr as subscribeExposeHighlight,rn as subscribeWindowChrome,Xe as tabGroupOf,Kr as toggleExposeMode,Xn as useCurrentTabKey,Se as useDesktopHost,gn as useEnclosingModalId,Ar as useIsActiveWindow,ze as usePageSearch,ao as useUndo,so as useUndoCanEdit,lo as useUndoable,co as useUndoableState,mn as useWidgetSettings,it as useWindowDirty,st as useWindowManager,fn as useWindowMenuItem,yn as useWindowTitle,Qn as windowHoldsChanges};