efficient-shell 8.33.0 → 8.35.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 (476) hide show
  1. package/README.md +66 -15
  2. package/THIRD_PARTY_NOTICES.md +11 -2
  3. package/dist/{Browser-V3NK5J6A.js → Browser-ERZNOFN7.js} +14 -14
  4. package/dist/Calculator-NXIOZMML.js +29 -0
  5. package/dist/{CurrencyConverter-S7LG5PMX.js → CurrencyConverter-57WUTV4H.js} +12 -12
  6. package/dist/{Documents-EKGXGENC.js → Documents-POWS4L44.js} +7 -7
  7. package/dist/{Files-5J4CR3CU.js → Files-O44UH6ZF.js} +40 -40
  8. package/dist/{Notepad-GTU3U27L.js → Notepad-66ZCGUHC.js} +9 -9
  9. package/dist/PdfViewer-KSLOYXMD.js +1 -0
  10. package/dist/{PomodoroTimer-2HPCAEI5.js → PomodoroTimer-GLYNCO4H.js} +17 -17
  11. package/dist/{Preview-TMS6JTPA.js → Preview-WZDFVBNJ.js} +15 -15
  12. package/dist/Sidebar-QQFJJWE2.js +43 -0
  13. package/dist/{Spreadsheet-P77Z2TVQ.js → Spreadsheet-OYAVNRCT.js} +14 -14
  14. package/dist/{Stock-VNFYS73L.js → Stock-CIHUZOQS.js} +7 -7
  15. package/dist/{Weather-DS4YZ6SH.js → Weather-UKLNJ3VF.js} +13 -13
  16. package/dist/{WorldClock-7S4TITSF.js → WorldClock-OZ3I7D2M.js} +6 -6
  17. package/dist/ai/index.d.ts +48 -10
  18. package/dist/ai/index.js +38 -33
  19. package/dist/ai.css +1 -1
  20. package/dist/apps/index.js +1 -1
  21. package/dist/bin/media-host-check.js +1 -1
  22. package/dist/bin/ui-check.js +1 -1
  23. package/dist/chunk-243NPEG6.js +2 -0
  24. package/dist/{chunk-L3NYH4QV.js → chunk-2AHHM4SK.js} +39 -39
  25. package/dist/{chunk-7CFH6Y4T.js → chunk-2F7ZOMKK.js} +1 -1
  26. package/dist/chunk-2PWZNFFP.js +19 -0
  27. package/dist/{chunk-KIBL6M3T.js → chunk-2SHYR3RA.js} +4 -3
  28. package/dist/{chunk-G433MKIN.js → chunk-2U2GJCSP.js} +5 -5
  29. package/dist/chunk-2UCDJCGZ.js +4 -0
  30. package/dist/{chunk-ZN3O2KJ7.js → chunk-2WL3Q7VW.js} +12 -12
  31. package/dist/chunk-2ZD67TDP.js +2 -0
  32. package/dist/chunk-3ER2WJNL.js +2 -0
  33. package/dist/chunk-44F7JLNV.js +2 -0
  34. package/dist/chunk-474G67EG.js +6 -0
  35. package/dist/chunk-47OCVZXD.js +2 -0
  36. package/dist/chunk-4CFQXH5N.js +2 -0
  37. package/dist/chunk-4FNGR474.js +2 -0
  38. package/dist/{chunk-XWLWG4HS.js → chunk-4GVH4ZUH.js} +1 -1
  39. package/dist/{chunk-YRWRA7MW.js → chunk-4HCRZHIX.js} +1 -1
  40. package/dist/chunk-4L7GLO5W.js +2 -0
  41. package/dist/{chunk-MXHEREC6.js → chunk-4MO375G3.js} +3 -3
  42. package/dist/chunk-4RDYNULI.js +2 -0
  43. package/dist/{chunk-WFWDABGV.js → chunk-4RNF6MNW.js} +2 -2
  44. package/dist/chunk-5DFKPSJQ.js +1 -0
  45. package/dist/chunk-5FCEBKT2.js +7 -0
  46. package/dist/chunk-5HDMPCZP.js +2 -0
  47. package/dist/chunk-5KZ4WKUI.js +2 -0
  48. package/dist/{chunk-DGLCMYSQ.js → chunk-5N5DBTTF.js} +11 -11
  49. package/dist/{chunk-KNVE7CMS.js → chunk-5OX6KXWY.js} +1 -1
  50. package/dist/{chunk-PNQ4EYYM.js → chunk-5YELPBUT.js} +3 -3
  51. package/dist/chunk-64ZHCEZN.js +5 -0
  52. package/dist/{chunk-Y2D2YMFY.js → chunk-6ANFVX4M.js} +12 -12
  53. package/dist/chunk-6I7EODFJ.js +7 -0
  54. package/dist/chunk-6IUDFVTN.js +2 -0
  55. package/dist/chunk-75IWV4ZF.js +2 -0
  56. package/dist/chunk-77SI7AKG.js +2 -0
  57. package/dist/{chunk-KK5MX7EH.js → chunk-7ACSSYEZ.js} +13 -13
  58. package/dist/chunk-7GB7CVQI.js +2 -0
  59. package/dist/chunk-7KCJ77BP.js +2 -0
  60. package/dist/chunk-7P3DXO3E.js +2 -0
  61. package/dist/{chunk-GI7FOLDX.js → chunk-ACW3J77L.js} +1 -1
  62. package/dist/{chunk-ERMZ75FO.js → chunk-AF7R2MV4.js} +1 -1
  63. package/dist/{chunk-QQK3XS6H.js → chunk-AZU7YOES.js} +8 -8
  64. package/dist/{chunk-NFR4QZL2.js → chunk-BHMUOWAE.js} +4 -4
  65. package/dist/chunk-BWIX3YIH.js +2 -0
  66. package/dist/{chunk-XEKPJGVZ.js → chunk-BX2IOAD5.js} +1 -1
  67. package/dist/chunk-BXQYRG7P.js +2 -0
  68. package/dist/{chunk-UB4BTRSB.js → chunk-BYCOB6WT.js} +1 -1
  69. package/dist/chunk-BZMZTPS6.js +1 -0
  70. package/dist/chunk-BZR43D3G.js +2 -0
  71. package/dist/chunk-CAMLFCGY.js +29 -0
  72. package/dist/chunk-CAUWHLN7.js +4 -0
  73. package/dist/{chunk-3GT6LKCC.js → chunk-CCPNMYCK.js} +1 -1
  74. package/dist/{chunk-RAAUW5OZ.js → chunk-DG2WU3BU.js} +2 -2
  75. package/dist/chunk-DIN3EFOM.js +14 -0
  76. package/dist/chunk-DS6R5R3O.js +2 -0
  77. package/dist/{chunk-WJ3XSJ6B.js → chunk-EBC4XFL2.js} +1 -1
  78. package/dist/{chunk-37JDUDCO.js → chunk-ECCUEG3J.js} +1 -1
  79. package/dist/chunk-EHMDGAWA.js +2 -0
  80. package/dist/{chunk-FJXYKN7R.js → chunk-EM6BEHAD.js} +8 -8
  81. package/dist/chunk-EQPVQY5E.js +2 -0
  82. package/dist/{chunk-KFXVHP37.js → chunk-EVB35JP5.js} +1 -1
  83. package/dist/{chunk-FL2PUQX7.js → chunk-EW6FRPFJ.js} +1 -1
  84. package/dist/{chunk-JCMP5KMS.js → chunk-EZY4CO4A.js} +6 -6
  85. package/dist/chunk-FATXXVV3.js +2 -0
  86. package/dist/chunk-FEVWWOGL.js +2 -0
  87. package/dist/{chunk-PJCVNFWM.js → chunk-FKZEGBLK.js} +10 -10
  88. package/dist/chunk-FMERDO2X.js +2 -0
  89. package/dist/{chunk-DTSCO7VM.js → chunk-FMKTVZAO.js} +1 -1
  90. package/dist/chunk-FOXMWLVS.js +2 -0
  91. package/dist/{chunk-IZCODCSC.js → chunk-FTKKGGOQ.js} +1 -1
  92. package/dist/chunk-FUSCAZEK.js +2 -0
  93. package/dist/{chunk-4S4523B2.js → chunk-G2MJTE6X.js} +12 -12
  94. package/dist/chunk-G4GQOAWS.js +2 -0
  95. package/dist/{chunk-EZGY6CFN.js → chunk-GK3QH63P.js} +1 -1
  96. package/dist/{chunk-QGDZ6RAI.js → chunk-HAIMJAI4.js} +2 -2
  97. package/dist/chunk-HMHL27AU.js +6 -0
  98. package/dist/chunk-I27TFZJH.js +2 -0
  99. package/dist/chunk-IBHBPSQN.js +2 -0
  100. package/dist/{chunk-4AAGZQX7.js → chunk-IHEEJO5S.js} +1 -1
  101. package/dist/chunk-INUXPG27.js +2 -0
  102. package/dist/{chunk-WQNIXV4T.js → chunk-IUCIYWTT.js} +8 -8
  103. package/dist/chunk-IWQSBA3D.js +2 -0
  104. package/dist/chunk-JBQWR4SX.js +8 -0
  105. package/dist/{chunk-AX7KPMDV.js → chunk-JDKRQG7X.js} +2 -2
  106. package/dist/chunk-JMWKD4R5.js +2 -0
  107. package/dist/chunk-JREQY3YN.js +2 -0
  108. package/dist/chunk-JVIOAZHW.js +14 -0
  109. package/dist/chunk-K4RFJ7P2.js +2 -0
  110. package/dist/chunk-KTMEHSTB.js +2 -0
  111. package/dist/{chunk-FOLZVO2Z.js → chunk-L3G3YHVN.js} +13 -13
  112. package/dist/chunk-L65BESIE.js +1 -0
  113. package/dist/chunk-LQD7K7HK.js +2 -0
  114. package/dist/{chunk-ZEKM6HAA.js → chunk-M2AIC7IK.js} +2 -2
  115. package/dist/{chunk-KDZUWQEG.js → chunk-M2KV4WKR.js} +1 -1
  116. package/dist/{chunk-H3BC4KDE.js → chunk-M2LLVSBR.js} +1 -1
  117. package/dist/{chunk-SAKHGHF5.js → chunk-MC43PRTL.js} +1 -1
  118. package/dist/{chunk-VRUDENTZ.js → chunk-MICWRC72.js} +7 -7
  119. package/dist/chunk-MTZUYC4Y.js +5 -0
  120. package/dist/chunk-MVJ34HIV.js +2 -0
  121. package/dist/{chunk-WTY3SXO7.js → chunk-MY755PTJ.js} +1 -1
  122. package/dist/chunk-NEQFHRF3.js +2 -0
  123. package/dist/chunk-NFMDU4EJ.js +4 -0
  124. package/dist/chunk-NK7HBFNQ.js +2 -0
  125. package/dist/chunk-NKZNPYDB.js +3 -0
  126. package/dist/chunk-NTME34BP.js +2 -0
  127. package/dist/chunk-NTWI7EGJ.js +4 -0
  128. package/dist/{chunk-YSFLXPUS.js → chunk-NUSSZJF2.js} +5 -5
  129. package/dist/chunk-NZBQVE3Q.js +2 -0
  130. package/dist/{chunk-RGBX3EVC.js → chunk-O2YAB6WK.js} +8 -8
  131. package/dist/{chunk-TRZPF2CE.js → chunk-OFKWTOXK.js} +3 -3
  132. package/dist/chunk-OIH56GH5.js +2 -0
  133. package/dist/chunk-OKRAYHGW.js +2 -0
  134. package/dist/chunk-OM5K4WCB.js +2 -0
  135. package/dist/chunk-ONC3BFFM.js +2 -0
  136. package/dist/chunk-OSXM35MX.js +2 -0
  137. package/dist/{chunk-ZT5Y5JZB.js → chunk-P42YNSKI.js} +4 -4
  138. package/dist/chunk-PAZU27H5.js +2 -0
  139. package/dist/chunk-PBGMVLOF.js +2 -0
  140. package/dist/{chunk-TFMOGKW2.js → chunk-PCKYNZ5Y.js} +10 -10
  141. package/dist/chunk-PRJJK7VR.js +2 -0
  142. package/dist/chunk-PYW3HX7A.js +2 -0
  143. package/dist/{chunk-YW2DH6YQ.js → chunk-QPWD5CCS.js} +5 -5
  144. package/dist/chunk-QTM26JQP.js +2 -0
  145. package/dist/chunk-QYEMC2OA.js +2 -0
  146. package/dist/chunk-R2IXRW5N.js +2 -0
  147. package/dist/{chunk-RUQEB2ZC.js → chunk-R4C3GGCS.js} +3 -3
  148. package/dist/chunk-RAHDUMQ5.js +2 -0
  149. package/dist/{chunk-3V5Z2BJY.js → chunk-RB2F65YJ.js} +12 -12
  150. package/dist/chunk-RBXMTHOT.js +4 -0
  151. package/dist/chunk-ROUTBYMG.js +5 -0
  152. package/dist/{chunk-BZV4K6GR.js → chunk-RPJ2GC3K.js} +20 -20
  153. package/dist/{chunk-XC55NMXR.js → chunk-S4IW5OL3.js} +1 -1
  154. package/dist/chunk-S4J4B7LY.js +5 -0
  155. package/dist/{chunk-HVX37PKU.js → chunk-SEXLHFMR.js} +1 -1
  156. package/dist/{chunk-SYSDAVZ3.js → chunk-SWHRP52Y.js} +1 -1
  157. package/dist/chunk-T3NJAOJL.js +2 -0
  158. package/dist/{chunk-NWP6IJYK.js → chunk-TANR67XF.js} +2 -2
  159. package/dist/chunk-TI5WUO3V.js +2 -0
  160. package/dist/{chunk-4F3IKYUO.js → chunk-TOVHLONK.js} +6 -6
  161. package/dist/{chunk-JOIWDQRJ.js → chunk-TRD22FC7.js} +6 -6
  162. package/dist/{chunk-YGZMD6TZ.js → chunk-TTY62G5D.js} +16 -16
  163. package/dist/{chunk-YCQVEJOT.js → chunk-TW6WYYBC.js} +2 -2
  164. package/dist/{chunk-B55IXYDR.js → chunk-TZHWF3P5.js} +2 -2
  165. package/dist/chunk-UKC6VJE4.js +2 -0
  166. package/dist/chunk-URWQO4KB.js +2 -0
  167. package/dist/{chunk-IAQC775L.js → chunk-UZ3CZQA4.js} +1 -1
  168. package/dist/chunk-V3GM5NXB.js +2 -0
  169. package/dist/chunk-V6Q2GZAI.js +2 -0
  170. package/dist/chunk-VRODVMV3.js +1 -0
  171. package/dist/chunk-VW4FHT46.js +2 -0
  172. package/dist/chunk-W5DLG5T2.js +2 -0
  173. package/dist/chunk-W5I35GZZ.js +2 -0
  174. package/dist/{chunk-V4KQUOUP.js → chunk-WKRFD4E4.js} +8 -8
  175. package/dist/{chunk-PDXD6DT7.js → chunk-WME5DFB6.js} +1 -1
  176. package/dist/chunk-WYDD26UO.js +2 -0
  177. package/dist/{chunk-3C67XRVJ.js → chunk-XB2YPUKR.js} +8 -8
  178. package/dist/{chunk-DWYNPXSB.js → chunk-XDDTFV32.js} +1 -1
  179. package/dist/chunk-XUYWUGDM.js +2 -0
  180. package/dist/{chunk-UQBPKZUR.js → chunk-XZL3HCWH.js} +1 -1
  181. package/dist/{chunk-IK4Y7WEP.js → chunk-YBB56N6X.js} +1 -1
  182. package/dist/chunk-YHYAGJ6V.js +2 -0
  183. package/dist/chunk-YKKMR5DU.js +8 -0
  184. package/dist/chunk-YVULGIDQ.js +2 -0
  185. package/dist/chunk-Z5XEAC32.js +2 -0
  186. package/dist/chunk-ZBL4CN2E.js +2 -0
  187. package/dist/chunk-ZEN67DFI.js +2 -0
  188. package/dist/{chunk-X5AZHR2J.js → chunk-ZRHQGFO5.js} +2 -2
  189. package/dist/{chunk-O3HRFXNN.js → chunk-ZXSMSVLU.js} +3 -3
  190. package/dist/chunk-ZXU4DEQM.js +2 -0
  191. package/dist/chunk-ZZIVSJ2B.js +2 -0
  192. package/dist/data/ListLoadError.js +1 -1
  193. package/dist/format/index.js +1 -1
  194. package/dist/forms/BorderInput.js +1 -1
  195. package/dist/forms/BrandAssetEditor.js +1 -1
  196. package/dist/forms/Calendar.js +1 -1
  197. package/dist/forms/ColorPicker.js +1 -1
  198. package/dist/forms/ComposerAttachments.js +1 -1
  199. package/dist/forms/CornersInput.js +1 -1
  200. package/dist/forms/DatePicker.js +1 -1
  201. package/dist/forms/DateRangePicker.js +1 -1
  202. package/dist/forms/DisplayChips.js +1 -1
  203. package/dist/forms/FilePicker.js +1 -1
  204. package/dist/forms/IconPicker.js +1 -1
  205. package/dist/forms/InputNumber.js +1 -1
  206. package/dist/forms/LinkPicker.js +1 -1
  207. package/dist/forms/MediaLibrary.js +1 -1
  208. package/dist/forms/MediaUploadField.js +1 -1
  209. package/dist/forms/MediaUploadGrid.js +1 -1
  210. package/dist/forms/MediaUsedInList.js +1 -1
  211. package/dist/forms/PositionInput.js +1 -1
  212. package/dist/forms/Select.d.ts +1 -1
  213. package/dist/forms/Select.js +1 -1
  214. package/dist/forms/SidesInput.js +1 -1
  215. package/dist/forms/Slider.js +1 -1
  216. package/dist/forms/Snippet.js +1 -1
  217. package/dist/forms/SplitButton.js +1 -1
  218. package/dist/forms/Switch.js +1 -1
  219. package/dist/forms/TagInput.js +1 -1
  220. package/dist/forms/TextToolbar.d.ts +4 -1
  221. package/dist/forms/TextToolbar.js +1 -1
  222. package/dist/forms/WidthsBar.js +1 -1
  223. package/dist/forms/mediaLibraryMenu.js +1 -1
  224. package/dist/forms/settingRowContext.d.ts +11 -1
  225. package/dist/forms/settingRowContext.js +1 -1
  226. package/dist/forms/textAlign.d.ts +89 -0
  227. package/dist/forms/textAlign.js +2 -0
  228. package/dist/icons/efficient-glyphs.d.ts +61 -0
  229. package/dist/icons/efficient-glyphs.js +1 -1
  230. package/dist/icons/efficient-looks.d.ts +22 -0
  231. package/dist/icons/efficient-looks.js +1 -1
  232. package/dist/icons/efficient-meanings.d.ts +61 -0
  233. package/dist/icons/efficient-meanings.js +1 -1
  234. package/dist/icons/efficient.d.ts +61 -0
  235. package/dist/icons/efficient.js +1 -1
  236. package/dist/icons/glyphs/BrandAdyenIcon.d.ts +11 -0
  237. package/dist/icons/glyphs/BrandAdyenIcon.js +1 -0
  238. package/dist/icons/glyphs/BrandAfterpayIcon.d.ts +11 -0
  239. package/dist/icons/glyphs/BrandAfterpayIcon.js +1 -0
  240. package/dist/icons/glyphs/BrandAircallIcon.d.ts +11 -0
  241. package/dist/icons/glyphs/BrandAircallIcon.js +1 -0
  242. package/dist/icons/glyphs/BrandAmericanexpressIcon.d.ts +11 -0
  243. package/dist/icons/glyphs/BrandAmericanexpressIcon.js +1 -0
  244. package/dist/icons/glyphs/BrandApplepayIcon.d.ts +11 -0
  245. package/dist/icons/glyphs/BrandApplepayIcon.js +1 -0
  246. package/dist/icons/glyphs/BrandBigcommerceIcon.d.ts +11 -0
  247. package/dist/icons/glyphs/BrandBigcommerceIcon.js +1 -0
  248. package/dist/icons/glyphs/BrandBrevoIcon.d.ts +11 -0
  249. package/dist/icons/glyphs/BrandBrevoIcon.js +1 -0
  250. package/dist/icons/glyphs/BrandCalendlyIcon.d.ts +11 -0
  251. package/dist/icons/glyphs/BrandCalendlyIcon.js +1 -0
  252. package/dist/icons/glyphs/BrandCampaignmonitorIcon.d.ts +11 -0
  253. package/dist/icons/glyphs/BrandCampaignmonitorIcon.js +1 -0
  254. package/dist/icons/glyphs/BrandDhlIcon.d.ts +11 -0
  255. package/dist/icons/glyphs/BrandDhlIcon.js +1 -0
  256. package/dist/icons/glyphs/BrandDropboxIcon.d.ts +11 -0
  257. package/dist/icons/glyphs/BrandDropboxIcon.js +1 -0
  258. package/dist/icons/glyphs/BrandEbayIcon.d.ts +11 -0
  259. package/dist/icons/glyphs/BrandEbayIcon.js +1 -0
  260. package/dist/icons/glyphs/BrandEtsyIcon.d.ts +11 -0
  261. package/dist/icons/glyphs/BrandEtsyIcon.js +1 -0
  262. package/dist/icons/glyphs/BrandFacebookIcon.d.ts +11 -0
  263. package/dist/icons/glyphs/BrandFacebookIcon.js +1 -0
  264. package/dist/icons/glyphs/BrandFedexIcon.d.ts +11 -0
  265. package/dist/icons/glyphs/BrandFedexIcon.js +1 -0
  266. package/dist/icons/glyphs/BrandGmailIcon.d.ts +11 -0
  267. package/dist/icons/glyphs/BrandGmailIcon.js +1 -0
  268. package/dist/icons/glyphs/BrandGoogleadsIcon.d.ts +11 -0
  269. package/dist/icons/glyphs/BrandGoogleadsIcon.js +1 -0
  270. package/dist/icons/glyphs/BrandGoogleanalyticsIcon.d.ts +11 -0
  271. package/dist/icons/glyphs/BrandGoogleanalyticsIcon.js +1 -0
  272. package/dist/icons/glyphs/BrandGooglecalendarIcon.d.ts +11 -0
  273. package/dist/icons/glyphs/BrandGooglecalendarIcon.js +1 -0
  274. package/dist/icons/glyphs/BrandGoogledriveIcon.d.ts +11 -0
  275. package/dist/icons/glyphs/BrandGoogledriveIcon.js +1 -0
  276. package/dist/icons/glyphs/BrandGooglepayIcon.d.ts +11 -0
  277. package/dist/icons/glyphs/BrandGooglepayIcon.js +1 -0
  278. package/dist/icons/glyphs/BrandGooglesheetsIcon.d.ts +11 -0
  279. package/dist/icons/glyphs/BrandGooglesheetsIcon.js +1 -0
  280. package/dist/icons/glyphs/BrandHubspotIcon.d.ts +11 -0
  281. package/dist/icons/glyphs/BrandHubspotIcon.js +1 -0
  282. package/dist/icons/glyphs/BrandInstagramIcon.d.ts +11 -0
  283. package/dist/icons/glyphs/BrandInstagramIcon.js +1 -0
  284. package/dist/icons/glyphs/BrandIntercomIcon.d.ts +11 -0
  285. package/dist/icons/glyphs/BrandIntercomIcon.js +1 -0
  286. package/dist/icons/glyphs/BrandKlarnaIcon.d.ts +11 -0
  287. package/dist/icons/glyphs/BrandKlarnaIcon.js +1 -0
  288. package/dist/icons/glyphs/BrandLineIcon.d.ts +11 -0
  289. package/dist/icons/glyphs/BrandLineIcon.js +1 -0
  290. package/dist/icons/glyphs/BrandLinkedinIcon.d.ts +11 -0
  291. package/dist/icons/glyphs/BrandLinkedinIcon.js +1 -0
  292. package/dist/icons/glyphs/BrandMailchimpIcon.d.ts +11 -0
  293. package/dist/icons/glyphs/BrandMailchimpIcon.js +1 -0
  294. package/dist/icons/glyphs/BrandMailgunIcon.d.ts +11 -0
  295. package/dist/icons/glyphs/BrandMailgunIcon.js +1 -0
  296. package/dist/icons/glyphs/BrandMakeIcon.d.ts +11 -0
  297. package/dist/icons/glyphs/BrandMakeIcon.js +1 -0
  298. package/dist/icons/glyphs/BrandMastercardIcon.d.ts +11 -0
  299. package/dist/icons/glyphs/BrandMastercardIcon.js +1 -0
  300. package/dist/icons/glyphs/BrandMessengerIcon.d.ts +11 -0
  301. package/dist/icons/glyphs/BrandMessengerIcon.js +1 -0
  302. package/dist/icons/glyphs/BrandMetaIcon.d.ts +11 -0
  303. package/dist/icons/glyphs/BrandMetaIcon.js +1 -0
  304. package/dist/icons/glyphs/BrandMyobIcon.d.ts +11 -0
  305. package/dist/icons/glyphs/BrandMyobIcon.js +1 -0
  306. package/dist/icons/glyphs/BrandNotionIcon.d.ts +11 -0
  307. package/dist/icons/glyphs/BrandNotionIcon.js +1 -0
  308. package/dist/icons/glyphs/BrandPaypalIcon.d.ts +11 -0
  309. package/dist/icons/glyphs/BrandPaypalIcon.js +1 -0
  310. package/dist/icons/glyphs/BrandPinterestIcon.d.ts +11 -0
  311. package/dist/icons/glyphs/BrandPinterestIcon.js +1 -0
  312. package/dist/icons/glyphs/BrandQuickbooksIcon.d.ts +11 -0
  313. package/dist/icons/glyphs/BrandQuickbooksIcon.js +1 -0
  314. package/dist/icons/glyphs/BrandSageIcon.d.ts +11 -0
  315. package/dist/icons/glyphs/BrandSageIcon.js +1 -0
  316. package/dist/icons/glyphs/BrandShopifyIcon.d.ts +11 -0
  317. package/dist/icons/glyphs/BrandShopifyIcon.js +1 -0
  318. package/dist/icons/glyphs/BrandSquareIcon.d.ts +11 -0
  319. package/dist/icons/glyphs/BrandSquareIcon.js +1 -0
  320. package/dist/icons/glyphs/BrandSquarespaceIcon.d.ts +11 -0
  321. package/dist/icons/glyphs/BrandSquarespaceIcon.js +1 -0
  322. package/dist/icons/glyphs/BrandStripeIcon.d.ts +11 -0
  323. package/dist/icons/glyphs/BrandStripeIcon.js +1 -0
  324. package/dist/icons/glyphs/BrandTelegramIcon.d.ts +11 -0
  325. package/dist/icons/glyphs/BrandTelegramIcon.js +1 -0
  326. package/dist/icons/glyphs/BrandTiktokIcon.d.ts +11 -0
  327. package/dist/icons/glyphs/BrandTiktokIcon.js +1 -0
  328. package/dist/icons/glyphs/BrandTrelloIcon.d.ts +11 -0
  329. package/dist/icons/glyphs/BrandTrelloIcon.js +1 -0
  330. package/dist/icons/glyphs/BrandUpsIcon.d.ts +11 -0
  331. package/dist/icons/glyphs/BrandUpsIcon.js +1 -0
  332. package/dist/icons/glyphs/BrandVisaIcon.d.ts +11 -0
  333. package/dist/icons/glyphs/BrandVisaIcon.js +1 -0
  334. package/dist/icons/glyphs/BrandVonageIcon.d.ts +11 -0
  335. package/dist/icons/glyphs/BrandVonageIcon.js +1 -0
  336. package/dist/icons/glyphs/BrandWechatIcon.d.ts +11 -0
  337. package/dist/icons/glyphs/BrandWechatIcon.js +1 -0
  338. package/dist/icons/glyphs/BrandWhatsappIcon.d.ts +11 -0
  339. package/dist/icons/glyphs/BrandWhatsappIcon.js +1 -0
  340. package/dist/icons/glyphs/BrandWiseIcon.d.ts +11 -0
  341. package/dist/icons/glyphs/BrandWiseIcon.js +1 -0
  342. package/dist/icons/glyphs/BrandWixIcon.d.ts +11 -0
  343. package/dist/icons/glyphs/BrandWixIcon.js +1 -0
  344. package/dist/icons/glyphs/BrandWoocommerceIcon.d.ts +11 -0
  345. package/dist/icons/glyphs/BrandWoocommerceIcon.js +1 -0
  346. package/dist/icons/glyphs/BrandXIcon.d.ts +11 -0
  347. package/dist/icons/glyphs/BrandXIcon.js +1 -0
  348. package/dist/icons/glyphs/BrandXeroIcon.d.ts +11 -0
  349. package/dist/icons/glyphs/BrandXeroIcon.js +1 -0
  350. package/dist/icons/glyphs/BrandYoutubeIcon.d.ts +11 -0
  351. package/dist/icons/glyphs/BrandYoutubeIcon.js +1 -0
  352. package/dist/icons/glyphs/BrandZapierIcon.d.ts +11 -0
  353. package/dist/icons/glyphs/BrandZapierIcon.js +1 -0
  354. package/dist/icons/glyphs/BrandZendeskIcon.d.ts +11 -0
  355. package/dist/icons/glyphs/BrandZendeskIcon.js +1 -0
  356. package/dist/icons/glyphs/BrandZoomIcon.d.ts +11 -0
  357. package/dist/icons/glyphs/BrandZoomIcon.js +1 -0
  358. package/dist/icons/index.d.ts +6 -4
  359. package/dist/icons/index.js +1 -1
  360. package/dist/icons/looks/BrandFacebookOutlineIcon.d.ts +11 -0
  361. package/dist/icons/looks/BrandFacebookOutlineIcon.js +1 -0
  362. package/dist/icons/looks/BrandFacebookSolidIcon.d.ts +11 -0
  363. package/dist/icons/looks/BrandFacebookSolidIcon.js +1 -0
  364. package/dist/icons/looks/BrandInstagramOutlineIcon.d.ts +11 -0
  365. package/dist/icons/looks/BrandInstagramOutlineIcon.js +1 -0
  366. package/dist/icons/looks/BrandInstagramSolidIcon.d.ts +11 -0
  367. package/dist/icons/looks/BrandInstagramSolidIcon.js +1 -0
  368. package/dist/icons/looks/BrandLineOutlineIcon.d.ts +11 -0
  369. package/dist/icons/looks/BrandLineOutlineIcon.js +1 -0
  370. package/dist/icons/looks/BrandLineSolidIcon.d.ts +11 -0
  371. package/dist/icons/looks/BrandLineSolidIcon.js +1 -0
  372. package/dist/icons/looks/BrandLinkedinOutlineIcon.d.ts +11 -0
  373. package/dist/icons/looks/BrandLinkedinOutlineIcon.js +1 -0
  374. package/dist/icons/looks/BrandLinkedinSolidIcon.d.ts +11 -0
  375. package/dist/icons/looks/BrandLinkedinSolidIcon.js +1 -0
  376. package/dist/icons/looks/BrandPinterestOutlineIcon.d.ts +11 -0
  377. package/dist/icons/looks/BrandPinterestOutlineIcon.js +1 -0
  378. package/dist/icons/looks/BrandPinterestSolidIcon.d.ts +11 -0
  379. package/dist/icons/looks/BrandPinterestSolidIcon.js +1 -0
  380. package/dist/icons/looks/BrandTelegramOutlineIcon.d.ts +11 -0
  381. package/dist/icons/looks/BrandTelegramOutlineIcon.js +1 -0
  382. package/dist/icons/looks/BrandTelegramSolidIcon.d.ts +11 -0
  383. package/dist/icons/looks/BrandTelegramSolidIcon.js +1 -0
  384. package/dist/icons/looks/BrandTiktokOutlineIcon.d.ts +11 -0
  385. package/dist/icons/looks/BrandTiktokOutlineIcon.js +1 -0
  386. package/dist/icons/looks/BrandTiktokSolidIcon.d.ts +11 -0
  387. package/dist/icons/looks/BrandTiktokSolidIcon.js +1 -0
  388. package/dist/icons/looks/BrandWechatOutlineIcon.d.ts +11 -0
  389. package/dist/icons/looks/BrandWechatOutlineIcon.js +1 -0
  390. package/dist/icons/looks/BrandWechatSolidIcon.d.ts +11 -0
  391. package/dist/icons/looks/BrandWechatSolidIcon.js +1 -0
  392. package/dist/icons/looks/BrandWhatsappOutlineIcon.d.ts +11 -0
  393. package/dist/icons/looks/BrandWhatsappOutlineIcon.js +1 -0
  394. package/dist/icons/looks/BrandWhatsappSolidIcon.d.ts +11 -0
  395. package/dist/icons/looks/BrandWhatsappSolidIcon.js +1 -0
  396. package/dist/icons/looks/BrandXOutlineIcon.d.ts +11 -0
  397. package/dist/icons/looks/BrandXOutlineIcon.js +1 -0
  398. package/dist/icons/looks/BrandXSolidIcon.d.ts +11 -0
  399. package/dist/icons/looks/BrandXSolidIcon.js +1 -0
  400. package/dist/icons/looks/BrandYoutubeOutlineIcon.d.ts +11 -0
  401. package/dist/icons/looks/BrandYoutubeOutlineIcon.js +1 -0
  402. package/dist/icons/looks/BrandYoutubeSolidIcon.d.ts +11 -0
  403. package/dist/icons/looks/BrandYoutubeSolidIcon.js +1 -0
  404. package/dist/icons/looks/map.d.ts +1 -1
  405. package/dist/icons/looks/map.js +1 -1
  406. package/dist/icons/sets.js +1 -1
  407. package/dist/index.d.ts +3 -2
  408. package/dist/index.js +174 -174
  409. package/dist/map/index.js +6 -6
  410. package/dist/markdown/index.js +1 -1
  411. package/dist/names-mX74Rrmy.d.ts +23 -0
  412. package/dist/page-tabs/index.js +5 -5
  413. package/dist/pdf/index.js +1 -1
  414. package/dist/shell/Accordion.js +1 -1
  415. package/dist/shell/AppUpdateBanner.js +1 -1
  416. package/dist/shell/Banner.js +1 -1
  417. package/dist/shell/Breadcrumbs.js +1 -1
  418. package/dist/shell/ColoredBadge.js +1 -1
  419. package/dist/shell/ConfirmDialog.js +1 -1
  420. package/dist/shell/ContextMenu.js +1 -1
  421. package/dist/shell/Dialog.js +1 -1
  422. package/dist/shell/Drawer.js +1 -1
  423. package/dist/shell/DropdownMenu.js +1 -1
  424. package/dist/shell/EmptyState.js +1 -1
  425. package/dist/shell/HelpCenter.js +1 -1
  426. package/dist/shell/ImageLightbox.js +1 -1
  427. package/dist/shell/LanguageSelect.js +1 -1
  428. package/dist/shell/Markdown.d.ts +1 -1
  429. package/dist/shell/Markdown.js +1 -1
  430. package/dist/shell/PageHeader.js +1 -1
  431. package/dist/shell/PopupMenu.js +1 -1
  432. package/dist/shell/ProductionTimeline.js +1 -1
  433. package/dist/shell/Result.js +1 -1
  434. package/dist/shell/SearchableSelect.js +1 -1
  435. package/dist/shell/SettingReset.js +1 -1
  436. package/dist/shell/SettingRow.d.ts +9 -1
  437. package/dist/shell/SettingRow.js +1 -1
  438. package/dist/shell/SidebarLayout.js +1 -1
  439. package/dist/shell/SidebarNav.js +1 -1
  440. package/dist/shell/SortableList.js +1 -1
  441. package/dist/shell/StepChain.js +1 -1
  442. package/dist/shell/Stepper.js +1 -1
  443. package/dist/shell/TopNav.js +1 -1
  444. package/dist/shell/Tree.js +1 -1
  445. package/dist/telemetry/index.js +1 -1
  446. package/dist/templates/AuthScreen.js +1 -1
  447. package/dist/templates/ChatTemplate.js +1 -1
  448. package/dist/templates/CheckoutTemplate.js +1 -1
  449. package/dist/templates/DashboardTemplate.js +1 -1
  450. package/dist/templates/DataTablePage.js +1 -1
  451. package/dist/templates/EmailTemplate.js +1 -1
  452. package/dist/templates/FormLayoutPage.js +1 -1
  453. package/dist/ui/index.d.ts +3 -2
  454. package/dist/ui/index.js +1 -1
  455. package/dist/version.js +1 -1
  456. package/package.json +1 -1
  457. package/dist/Calculator-4JDJKSA7.js +0 -29
  458. package/dist/PdfViewer-67VBUIRD.js +0 -1
  459. package/dist/Sidebar-YB4OVUG5.js +0 -43
  460. package/dist/chunk-367OG4UV.js +0 -5
  461. package/dist/chunk-3JJFBUK6.js +0 -3
  462. package/dist/chunk-4AXJIJDC.js +0 -14
  463. package/dist/chunk-AS4CTEZD.js +0 -8
  464. package/dist/chunk-E4Z5OXBI.js +0 -1
  465. package/dist/chunk-GSS4E7X3.js +0 -1
  466. package/dist/chunk-PNGL4ZW2.js +0 -6
  467. package/dist/chunk-QWPFFWUG.js +0 -29
  468. package/dist/chunk-R3XAXBYV.js +0 -1
  469. package/dist/chunk-STA76WXF.js +0 -2
  470. package/dist/chunk-W7S56JZ7.js +0 -7
  471. package/dist/chunk-WZNGOA4Z.js +0 -1
  472. package/dist/chunk-X7XJBK2E.js +0 -14
  473. package/dist/chunk-ZLXLHKE5.js +0 -19
  474. package/dist/names-DYWfNBkN.d.ts +0 -21
  475. /package/dist/{chunk-2HDDCXTW.js → chunk-EHPZIBOL.js} +0 -0
  476. /package/dist/{chunk-WYHRPXEX.js → chunk-KJRYEKQP.js} +0 -0
@@ -1,22 +1,22 @@
1
- import{computeMaximizedBox as e,isSidebarStripReserved as t,boxFillsWorkArea as n,readAlwaysMaximizedFlag as r,WORK_AREA_CHANGED_EVENT as o,useShellAuth as i,scrollerIsFluid as a,growBoxToWidth as s,widthToFit as l,navIcons as c}from"./chunk-CY5N5OA3.js";import{ROW_HEIGHTS as u}from"./chunk-AW7TOB6N.js";import{reportBoundaryError as d}from"./chunk-KNUR2UEG.js";import{isStaleChunkError as h}from"./chunk-JDCM2VHG.js";import{Result as m}from"./chunk-HVX37PKU.js";import{CMD_Z as p,CMD_SHIFT_Z as f}from"./chunk-Y53KNQKL.js";import{CopyButton as w}from"./chunk-FL2PUQX7.js";import{confirm as y}from"./chunk-ZN3O2KJ7.js";import{useShellPrefs as g}from"./chunk-KC3EX26K.js";import{dialogA11y as b}from"./chunk-VWGWZY7A.js";import{useIsMobile as v,useIsPhone as x}from"./chunk-UGTRSRIW.js";import{ColoredBadge as k}from"./chunk-XWLWG4HS.js";import{focusableIn as E}from"./chunk-CDAJKLGL.js";import{StatusBadge as C}from"./chunk-D323R2FT.js";import{PopupMenu as M,PopupMenuItem as N,PopupMenuDivider as S,PopupMenuLabel as L}from"./chunk-PJCVNFWM.js";import{Button_default as T}from"./chunk-4IU5BSVE.js";import{Icon as z}from"./chunk-KIBL6M3T.js";import{LoadingSpinner as A}from"./chunk-Q5MD3VY6.js";import{Z_LAYERS as D}from"./chunk-62LW225J.js";import{runEscapeInterceptors as P}from"./chunk-TWVUQUUD.js";import{useShellStrings as I}from"./chunk-E6UCGCOC.js";import{createContext as W,useContext as K,Component as R,useLayoutEffect as $,useRef as O,useEffect as F,useState as j,useSyncExternalStore as q,useCallback as B,isValidElement as H,Fragment as U,Children as Y,cloneElement as X,useMemo as V,useId as _,useReducer as G,Suspense as J}from"react";import{jsxs as Q,jsx as Z,Fragment as ee}from"react/jsx-runtime";import{createPortal as te}from"react-dom";import{useLocation as ne}from"react-router-dom";import{useQueryClient as re,useQuery as oe}from"@tanstack/react-query";function ie(e){return"component"in e}function ae(e){return"endpoint"in e}var se={};function le(e){se=e}var ce=new Proxy({},{get:(e,t)=>se[t],has:(e,t)=>t in se,ownKeys:()=>Object.keys(se),getOwnPropertyDescriptor(e,t){if(t in se)return{configurable:!0,enumerable:!0,value:se[t]}}}),ue=null;function de(e){ue=e}function he(){return null!==ue}var me=/* @__PURE__ */new Set(["get","post","put","patch","delete","head","options","request"]),pe=new Proxy({},{get:(e,t)=>ue?ue[t]:"string"==typeof t&&me.has(t)?()=>Promise.resolve({data:null,status:0,statusText:"",headers:{},config:{}}):void 0}),fe=W(null);function we(){return K(fe)?.pageSearch??""}var ye=null,ge=/* @__PURE__ */new Set;function be(e){ye!==e&&(ye=e,ge.forEach(e=>e()))}function ve(){return ye}function xe(e){return ge.add(e),()=>{ge.delete(e)}}var ke=null;function Ee(e){ke=e}function Ce({error:e,onReload:t}){const n=h(e);/* @__PURE__ */
1
+ import{computeMaximizedBox as e,isSidebarStripReserved as t,boxFillsWorkArea as n,readAlwaysMaximizedFlag as r,WORK_AREA_CHANGED_EVENT as o,useShellAuth as i,scrollerIsFluid as a,growBoxToWidth as s,widthToFit as l,navIcons as c}from"./chunk-CY5N5OA3.js";import{ROW_HEIGHTS as u}from"./chunk-AW7TOB6N.js";import{reportBoundaryError as d}from"./chunk-KNUR2UEG.js";import{isStaleChunkError as h}from"./chunk-JDCM2VHG.js";import{Result as m}from"./chunk-SEXLHFMR.js";import{CMD_Z as p,CMD_SHIFT_Z as f}from"./chunk-Y53KNQKL.js";import{CopyButton as w}from"./chunk-EW6FRPFJ.js";import{confirm as y}from"./chunk-2WL3Q7VW.js";import{dialogA11y as g}from"./chunk-VWGWZY7A.js";import{ColoredBadge as b}from"./chunk-4GVH4ZUH.js";import{useIsMobile as v,useIsPhone as x}from"./chunk-UGTRSRIW.js";import{focusableIn as k}from"./chunk-CDAJKLGL.js";import{StatusBadge as E}from"./chunk-D323R2FT.js";import{useShellPrefs as C}from"./chunk-KC3EX26K.js";import{PopupMenu as M,PopupMenuItem as N,PopupMenuDivider as S,PopupMenuLabel as L}from"./chunk-FKZEGBLK.js";import{Button_default as T}from"./chunk-4IU5BSVE.js";import{Icon as z}from"./chunk-2SHYR3RA.js";import{LoadingSpinner as A}from"./chunk-Q5MD3VY6.js";import{Z_LAYERS as D}from"./chunk-62LW225J.js";import{runEscapeInterceptors as P}from"./chunk-TWVUQUUD.js";import{useShellStrings as I}from"./chunk-E6UCGCOC.js";import{createContext as W,useContext as R,Component as K,useLayoutEffect as $,useRef as O,useEffect as F,useState as j,useSyncExternalStore as q,useCallback as B,isValidElement as H,Fragment as U,Children as Y,cloneElement as X,useMemo as V,useId as G,useReducer as _,Suspense as J}from"react";import{jsxs as Q,jsx as Z,Fragment as ee}from"react/jsx-runtime";import{createPortal as te}from"react-dom";import{useLocation as ne}from"react-router-dom";import{useQueryClient as re,useQuery as oe}from"@tanstack/react-query";function ie(e){return"component"in e}function ae(e){return"endpoint"in e}var se={};function le(e){se=e}var ce=new Proxy({},{get:(e,t)=>se[t],has:(e,t)=>t in se,ownKeys:()=>Object.keys(se),getOwnPropertyDescriptor(e,t){if(t in se)return{configurable:!0,enumerable:!0,value:se[t]}}}),ue=null;function de(e){ue=e}function he(){return null!==ue}var me=/* @__PURE__ */new Set(["get","post","put","patch","delete","head","options","request"]),pe=new Proxy({},{get:(e,t)=>ue?ue[t]:"string"==typeof t&&me.has(t)?()=>Promise.resolve({data:null,status:0,statusText:"",headers:{},config:{}}):void 0}),fe=W(null);function we(){return R(fe)?.pageSearch??""}var ye=null,ge=/* @__PURE__ */new Set;function be(e){ye!==e&&(ye=e,ge.forEach(e=>e()))}function ve(){return ye}function xe(e){return ge.add(e),()=>{ge.delete(e)}}var ke=null;function Ee(e){ke=e}function Ce({error:e,onReload:t}){const n=h(e);/* @__PURE__ */
2
2
  return Q("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
3
3
  /* @__PURE__ */Z(z,{name:"warning",className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
4
4
  /* @__PURE__ */Q("div",{className:"min-w-0",children:[
5
5
  /* @__PURE__ */Z("p",{className:"text-sm font-medium text-gray-700",children:n?"This window needs the latest version of the app":"This window crashed"}),
6
6
  /* @__PURE__ */Z("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__ */Z("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 Me=class extends R{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),d(e)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */Z(Ce,{error:e,onReload:this.reset}):this.props.children}},Ne=W(null),Se="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function Le({className:e="",auto:t=!1}){const n=K(Ne),r=I().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__ */
7
+ /* @__PURE__ */Z("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 Me=class extends K{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),d(e)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */Z(Ce,{error:e,onReload:this.reset}):this.props.children}},Ne=W(null),Se="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function Le({className:e="",auto:t=!1}){const n=R(Ne),r=I().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
8
  return Q("div",{className:`flex items-center gap-2 ${e}`,"data-undo-controls":t?"shell":"form",children:[
9
9
  /* @__PURE__ */Z("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",p):r.nothingToUndo,className:Se,children:r.undo}),
10
- /* @__PURE__ */Z("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",f):r.nothingToRedo,className:Se,children:r.redo})]})}var Te=/* @__PURE__ */new Set([408,429]);function ze(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function Ae(e){const t=ze(e);return null!=t&&(t>=400&&t<500&&!Te.has(t))}function De(e,t){return!Ae(t)&&e<3}function Pe(e){if("page"!==e.type)return!0;const t=e.route?ce[e.route]:void 0;if(!t||!ie(t))return!0;const n=t;return!n.widget&&!n.utility}function Ie(e){const t=e.route?ce[e.route]:void 0;if(!t||!ie(t))return;const n=t;return n.taskbarGroup?n.taskbarGroup:{key:e.route,label:n.label,icon:e.route}}var We=(e,t)=>!!t&&"page"===e.type&&e.route===t;function Ke(){const e=I().loading;/* @__PURE__ */
11
- return Z(A,{size:"sm",padding:"p-8",label:e.label})}var Re="flex-1 min-h-0";function $e(){const e=I().record;/* @__PURE__ */
12
- return Z(A,{label:e.loading,padding:"",className:Re})}function Oe(e){return e??void 0}function Fe({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:o}){const i=I().record;if(t||e&&n)/* @__PURE__ */return Z($e,{});if(r){const e=ze(r);if(401===e)/* @__PURE__ */
13
- return Z(m,{status:"warning",title:i.signInRequired,subTitle:i.signInBody,className:Re});if(403===e)/* @__PURE__ */
14
- return Z(m,{status:"403",className:Re});if(404===e||410===e)/* @__PURE__ */
15
- return Z(m,{status:"404",title:i.notFound,className:Re});const t=null==e||408===e||429===e||e>=500;/* @__PURE__ */
16
- return Z(m,{status:"500",title:i.loadFailed,subTitle:t?i.checkConnection:i.rejected,extra:t?/* @__PURE__ */Z(T,{variant:"secondary",size:"sm",onClick:o,children:i.retry}):void 0,className:Re})}/* @__PURE__ */
17
- return Z(m,{status:"404",title:i.notFound,className:Re})}function je({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */Z(ee,{children:t(e)}):/* @__PURE__ */Z(Fe,{...n})}var qe=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function Be(e){return"string"==typeof e&&(e.startsWith("new-")||qe.test(e))}function He(e){if(Be(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var Ue=W({openWindows:[],openEntity:()=>{},openPage:()=>{},reorderWindows:()=>{},closeEntity:()=>{},minimize:()=>{},items:[],restore:()=>{},remove:()=>{},restoreIfMinimized:()=>!1,openItems:[]}),Ye=W(null);function Xe(e){const t=K(Ye),n=O(null);null===n.current&&(n.current=/* @__PURE__ */Symbol("window-dirty")),$(()=>{if(t)return t(n.current,e)},[t,e]),F(()=>{if(!t||!e)return;const n=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t,e])}function Ve(){const e=O(/* @__PURE__ */new Map),[t,n]=j(!1);return{dirty:t,registerDirty:B((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 _e(){return K(Ue)}function Ge(e){if("page"!==e.type&&He(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 Je({item:e,onClose:t,accentRgb:n}){const{dirty:r,registerDirty:o}=Ve(),i=ce[e.route];if(!i||!ie(i))return null;const a=i,s=a.component;/* @__PURE__ */
18
- return Z(Xr,{open:!0,onClose:t,icon:c[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__ */Z(Ye.Provider,{value:o,children:/* @__PURE__ */Z(J,{fallback:/* @__PURE__ */Z("div",{className:"flex items-center justify-center py-12",children:/* @__PURE__ */Z(Ke,{})}),children:/* @__PURE__ */Z(s,{})})})})}function Qe({entityType:e,entityId:t,label:n}){const r=I(),o=re(),{data:i}=oe({queryKey:["my-profile-sidebar"],enabled:he(),queryFn:()=>pe.get("/auth/me/").then(e=>e.data)}),a=(i?.preferences||{}).favorite_documents||[],s=a.some(n=>n.entityType===e&&n.entityId===t);/* @__PURE__ */
19
- return Z("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];pe.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__ */Z(z,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var Ze=/* @__PURE__ */new Set,et=()=>"hidden";function tt({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=ce[e.entityType];if(!o||!ae(o))return null;const i=o,[a,s]=j(!1),{dirty:l,registerDirty:u}=Ve(),d=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=Be(e.entityId),p=!i.selfFetching&&!h&&!m&&he(),f=oe({queryKey:[d,e.entityId],queryFn:()=>{return pe.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:Oe(e.entitySnapshot),initialDataUpdatedAt:0,enabled:p,staleTime:0,refetchOnWindowFocus:!0,refetchOnMount:"always",refetchInterval:e=>!Ae(e.state.error)&&6e4,refetchIntervalInBackground:!1,retry:De}),w=f.data,y=f.refetch;F(()=>{var t;if(p)return t=t=>{t!==e.id||Ze.has(t)||y({cancelRefetch:!1})},Jn.add(t),()=>{Jn.delete(t)}},[y,e.id,p]);const g=B(()=>{a&&!l?s(!1):t()},[a,l,t]),b=(i.useEdit??et)(w??null),v=!i.useEdit||m||h?void 0:{state:b,editing:a,onEdit:()=>s(!0),onDiscard:()=>s(!1)},x=i.selfFetching?e.label:w?i.title(w,a,s):e.label,k=i.icon,E=k?c[k]:null,C=x,M=!i.selfFetching&&w&&i.footer&&!h?i.footer(w):void 0;return i.rendersOwnModal?i.selfFetching?/* @__PURE__ */Z(J,{fallback:/* @__PURE__ */Z(Ke,{}),children:i.render(w??e.entitySnapshot,t,e.entityId,a,s)}):null!=w?/* @__PURE__ */Z(J,{fallback:/* @__PURE__ */Z(Xr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */Z($e,{})}),children:i.render(w,t,e.entityId,a,s)}):/* @__PURE__ */Z(Xr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */Z(Fe,{isPending:f.isPending,isFetching:f.isFetching,enabled:p,error:f.error,onRetry:y})}):/* @__PURE__ */Z(Xr,{open:!0,onClose:g,onMinimize:n,initialBox:e.savedBox,icon:E,title:C,footer:M,copyText:e.label,windowKey:e.id,openedFromKey:e.openedFrom,size:i.size||"2xl",dirty:l,editing:a||m||h,edit:v,dimensions:i.dimensions,autoHeight:i.autoHeight,autoMinHeight:i.autoMinHeight,autoWidth:i.autoWidth,appStyle:i.appStyle,flushBody:i.flushBody,accentRgb:r,children:/* @__PURE__ */Z(Ye.Provider,{value:u,children:/* @__PURE__ */Z(J,{fallback:/* @__PURE__ */Z($e,{}),children:i.selfFetching?i.render(null,t,e.entityId,a,s):/* @__PURE__ */Z(je,{entity:w,isPending:f.isPending,isFetching:f.isFetching,enabled:p,error:f.error,onRetry:y,children:n=>i.render(n,t,e.entityId,a,s)})})})})}function nt(e){return document.querySelector(`[data-modal-panel][data-window-key="${e}"]`)}function rt(e){return document.querySelector(`[data-modal-panel][data-window-root][data-window-owner="${e}"]`)}function ot(e){const t=nt(e),n=t??rt(e);if(!n)return;if(t&&!cr(t))return r=e,void window.dispatchEvent(new CustomEvent("modal-reveal",{detail:{windowKey:r}}));var r;const o=n.getAttribute("data-modal-id");o&&Qn(o)}function it(){const e=Er();if(!e)return;const t=document.querySelector(`[data-modal-panel][data-modal-id="${e}"]`);return t?.getAttribute("data-window-key")??void 0}var at=/* @__PURE__ */new Map;function st(){const e=it();if(e)return at.get(e)}function lt(e){const t=document.querySelectorAll("[data-modal-panel]");for(const n of Array.from(t)){const t=n.querySelector("[data-window-title]");if(t?.textContent?.includes(e))return n}return null}var ct="rosh-peek-style",ut=D.peek,dt=D.taskbarPreview;function ht(e){"undefined"!=typeof document&&(!function(){if("undefined"==typeof document||document.getElementById(ct))return;const e=document.createElement("style");e.id=ct,e.textContent=`body.rosh-peeking [data-modal-panel]{transition:opacity .18s ease}body.rosh-peeking [data-modal-panel]:not([data-peek-focus]){opacity:.4}body.rosh-peeking [data-modal-panel][data-peek-focus]{opacity:1}body.rosh-peeking [data-modal-panel][data-peek-focus]:not([data-pinned-top]){z-index:${ut}!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 pt({id:e,label:t,maxW:n,maxH:r,titleAbove:o=!1,onClick:i,onClose:a}){const s=I(),l=O(null),[c,u]=j({w:n,h:Math.round(.75*r)}),[d,h]=j(!1);return $(()=>{const o=l.current;if(!o)return;const i=nt(e)??lt(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__ */Q("div",{style:{width:c.w,height:c.h},className:"relative rounded-md overflow-hidden bg-white/95 border border-gray-300 shadow-(--elevation-panel) cursor-pointer ring-2 ring-transparent group-hover:ring-blue-400 transition shrink-0",onClick:i,children:[
10
+ /* @__PURE__ */Z("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",f):r.nothingToRedo,className:Se,children:r.redo})]})}var Te=/* @__PURE__ */new Set([408,429]);function ze(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function Ae(e){const t=ze(e);return null!=t&&(t>=400&&t<500&&!Te.has(t))}function De(e,t){return!Ae(t)&&e<3}function Pe(e){if("page"!==e.type)return!0;const t=e.route?ce[e.route]:void 0;if(!t||!ie(t))return!0;const n=t;return!n.widget&&!n.utility}function Ie(e){const t=e.route?ce[e.route]:void 0;if(!t||!ie(t))return;const n=t;return n.taskbarGroup?n.taskbarGroup:{key:e.route,label:n.label,icon:e.route}}var We=(e,t)=>!!t&&"page"===e.type&&e.route===t;function Re(){const e=I().loading;/* @__PURE__ */
11
+ return Z(A,{size:"sm",padding:"p-8",label:e.label})}var Ke="flex-1 min-h-0";function $e(){const e=I().record;/* @__PURE__ */
12
+ return Z(A,{label:e.loading,padding:"",className:Ke})}function Oe(e){return e??void 0}function Fe({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:o}){const i=I().record;if(t||e&&n)/* @__PURE__ */return Z($e,{});if(r){const e=ze(r);if(401===e)/* @__PURE__ */
13
+ return Z(m,{status:"warning",title:i.signInRequired,subTitle:i.signInBody,className:Ke});if(403===e)/* @__PURE__ */
14
+ return Z(m,{status:"403",className:Ke});if(404===e||410===e)/* @__PURE__ */
15
+ return Z(m,{status:"404",title:i.notFound,className:Ke});const t=null==e||408===e||429===e||e>=500;/* @__PURE__ */
16
+ return Z(m,{status:"500",title:i.loadFailed,subTitle:t?i.checkConnection:i.rejected,extra:t?/* @__PURE__ */Z(T,{variant:"secondary",size:"sm",onClick:o,children:i.retry}):void 0,className:Ke})}/* @__PURE__ */
17
+ return Z(m,{status:"404",title:i.notFound,className:Ke})}function je({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */Z(ee,{children:t(e)}):/* @__PURE__ */Z(Fe,{...n})}var qe=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function Be(e){return"string"==typeof e&&(e.startsWith("new-")||qe.test(e))}function He(e){if(Be(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var Ue=W({openWindows:[],openEntity:()=>{},openPage:()=>{},reorderWindows:()=>{},closeEntity:()=>{},minimize:()=>{},items:[],restore:()=>{},remove:()=>{},restoreIfMinimized:()=>!1,openItems:[]}),Ye=W(null);function Xe(e){const t=R(Ye),n=O(null);null===n.current&&(n.current=/* @__PURE__ */Symbol("window-dirty")),$(()=>{if(t)return t(n.current,e)},[t,e]),F(()=>{if(!t||!e)return;const n=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t,e])}function Ve(){const e=O(/* @__PURE__ */new Map),[t,n]=j(!1);return{dirty:t,registerDirty:B((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 Ge(){return R(Ue)}function _e(e){if("page"!==e.type&&He(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 Je({item:e,onClose:t,accentRgb:n}){const{dirty:r,registerDirty:o}=Ve(),i=ce[e.route];if(!i||!ie(i))return null;const a=i,s=a.component;/* @__PURE__ */
18
+ return Z(Xr,{open:!0,onClose:t,icon:c[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__ */Z(Ye.Provider,{value:o,children:/* @__PURE__ */Z(J,{fallback:/* @__PURE__ */Z("div",{className:"flex items-center justify-center py-12",children:/* @__PURE__ */Z(Re,{})}),children:/* @__PURE__ */Z(s,{})})})})}function Qe({entityType:e,entityId:t,label:n}){const r=I(),o=re(),{data:i}=oe({queryKey:["my-profile-sidebar"],enabled:he(),queryFn:()=>pe.get("/auth/me/").then(e=>e.data)}),a=(i?.preferences||{}).favorite_documents||[],s=a.some(n=>n.entityType===e&&n.entityId===t);/* @__PURE__ */
19
+ return Z("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];pe.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__ */Z(z,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var Ze=/* @__PURE__ */new Set,et=()=>"hidden";function tt({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=ce[e.entityType];if(!o||!ae(o))return null;const i=o,[a,s]=j(!1),{dirty:l,registerDirty:u}=Ve(),d=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=Be(e.entityId),p=!i.selfFetching&&!h&&!m&&he(),f=oe({queryKey:[d,e.entityId],queryFn:()=>{return pe.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:Oe(e.entitySnapshot),initialDataUpdatedAt:0,enabled:p,staleTime:0,refetchOnWindowFocus:!0,refetchOnMount:"always",refetchInterval:e=>!Ae(e.state.error)&&6e4,refetchIntervalInBackground:!1,retry:De}),w=f.data,y=f.refetch;F(()=>{var t;if(p)return t=t=>{t!==e.id||Ze.has(t)||y({cancelRefetch:!1})},Jn.add(t),()=>{Jn.delete(t)}},[y,e.id,p]);const g=B(()=>{a&&!l?s(!1):t()},[a,l,t]),b=(i.useEdit??et)(w??null),v=!i.useEdit||m||h?void 0:{state:b,editing:a,onEdit:()=>s(!0),onDiscard:()=>s(!1)},x=i.selfFetching?e.label:w?i.title(w,a,s):e.label,k=i.icon,E=k?c[k]:null,C=x,M=!i.selfFetching&&w&&i.footer&&!h?i.footer(w):void 0;return i.rendersOwnModal?i.selfFetching?/* @__PURE__ */Z(J,{fallback:/* @__PURE__ */Z(Re,{}),children:i.render(w??e.entitySnapshot,t,e.entityId,a,s)}):null!=w?/* @__PURE__ */Z(J,{fallback:/* @__PURE__ */Z(Xr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */Z($e,{})}),children:i.render(w,t,e.entityId,a,s)}):/* @__PURE__ */Z(Xr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */Z(Fe,{isPending:f.isPending,isFetching:f.isFetching,enabled:p,error:f.error,onRetry:y})}):/* @__PURE__ */Z(Xr,{open:!0,onClose:g,onMinimize:n,initialBox:e.savedBox,icon:E,title:C,footer:M,copyText:e.label,windowKey:e.id,openedFromKey:e.openedFrom,size:i.size||"2xl",dirty:l,editing:a||m||h,edit:v,dimensions:i.dimensions,autoHeight:i.autoHeight,autoMinHeight:i.autoMinHeight,autoWidth:i.autoWidth,appStyle:i.appStyle,flushBody:i.flushBody,accentRgb:r,children:/* @__PURE__ */Z(Ye.Provider,{value:u,children:/* @__PURE__ */Z(J,{fallback:/* @__PURE__ */Z($e,{}),children:i.selfFetching?i.render(null,t,e.entityId,a,s):/* @__PURE__ */Z(je,{entity:w,isPending:f.isPending,isFetching:f.isFetching,enabled:p,error:f.error,onRetry:y,children:n=>i.render(n,t,e.entityId,a,s)})})})})}function nt(e){return document.querySelector(`[data-modal-panel][data-window-key="${e}"]`)}function rt(e){return document.querySelector(`[data-modal-panel][data-window-root][data-window-owner="${e}"]`)}function ot(e){const t=nt(e),n=t??rt(e);if(!n)return;if(t&&!cr(t))return r=e,void window.dispatchEvent(new CustomEvent("modal-reveal",{detail:{windowKey:r}}));var r;const o=n.getAttribute("data-modal-id");o&&Qn(o)}function it(){const e=Er();if(!e)return;const t=document.querySelector(`[data-modal-panel][data-modal-id="${e}"]`);return t?.getAttribute("data-window-key")??void 0}var at=/* @__PURE__ */new Map;function st(){const e=it();if(e)return at.get(e)}function lt(e){const t=document.querySelectorAll("[data-modal-panel]");for(const n of Array.from(t)){const t=n.querySelector("[data-window-title]");if(t?.textContent?.includes(e))return n}return null}var ct="rosh-peek-style",ut=D.peek,dt=D.taskbarPreview;function ht(e){"undefined"!=typeof document&&(!function(){if("undefined"==typeof document||document.getElementById(ct))return;const e=document.createElement("style");e.id=ct,e.textContent=`body.rosh-peeking [data-modal-panel]{transition:opacity .18s ease}body.rosh-peeking [data-modal-panel]:not([data-peek-focus]){opacity:.4}body.rosh-peeking [data-modal-panel][data-peek-focus]{opacity:1}body.rosh-peeking [data-modal-panel][data-peek-focus]:not([data-pinned-top]){z-index:${ut}!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 pt({id:e,label:t,maxW:n,maxH:r,titleAbove:o=!1,onClick:i,onClose:a}){const s=I(),l=O(null),[c,u]=j({w:n,h:Math.round(.75*r)}),[d,h]=j(!1);return $(()=>{const o=l.current;if(!o)return;const i=nt(e)??lt(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__ */Q("div",{style:{width:c.w,height:c.h},className:"relative rounded-md overflow-hidden bg-white/95 border border-gray-300 shadow-(--elevation-panel) cursor-pointer ring-2 ring-transparent group-hover:ring-blue-400 transition shrink-0",onClick:i,children:[
20
20
  /* @__PURE__ */Z("div",{ref:l,className:"absolute inset-0 z-0 overflow-hidden"}),!d&&/* @__PURE__ */Q("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-gray-400 bg-gray-50",children:[
21
21
  /* @__PURE__ */Z(z,{name:"window",className:"h-6 w-6",strokeWidth:1.5}),
22
22
  /* @__PURE__ */Z("span",{className:"mt-1 text-3xs uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */Z("div",{className:"absolute bottom-0 left-0 right-0 z-10 px-2 py-1 text-2xs font-medium text-white bg-gradient-to-t from-black/80 to-transparent truncate pointer-events-none",children:t}),a&&/* @__PURE__ */Z("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-white flex items-center justify-center",title:s.taskbar.closeWindow,children:/* @__PURE__ */Z(z,{name:"close",className:"h-3 w-3",strokeWidth:3})})]})}function ft({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=I(),s=e.length>1,l=O(null),[c,u]=j({left:-9999,top:-9999,ready:!1}),[d,h]=j(()=>"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]),F(()=>mt,[]);const m="top"===d,p=(m?"mt-1":"mb-1")+" max-w-[240px] truncate text-2xs font-medium text-gray-900 bg-white/80 px-2 py-0.5 rounded shadow-sm ring-2 ring-transparent transition group-hover:ring-blue-400";return te(
@@ -30,7 +30,7 @@ return Q("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.cur
30
30
  /* @__PURE__ */Z("div",{className:"flex-1"}),x.length>=2&&/* @__PURE__ */Q("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-blue-50 transition-colors shrink-0",children:[
31
31
  /* @__PURE__ */Z(z,{name:"grid",className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),y&&/* @__PURE__ */Q(M,{portal:!0,minWidth:200,style:wt(y.x,y.y),onClose:()=>g(null),children:[
32
32
  /* @__PURE__ */Z(L,{children:y.label}),
33
- /* @__PURE__ */Q(N,{onClick:()=>{g(null),y.items.forEach(e=>function(e){const t=Kn.get(e);t&&Zn(t)}(e.id))},children:[
33
+ /* @__PURE__ */Q(N,{onClick:()=>{g(null),y.items.forEach(e=>function(e){const t=Rn.get(e);t&&Zn(t)}(e.id))},children:[
34
34
  /* @__PURE__ */Z(z,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),i.taskbar.minimizeAllWindows]}),
35
35
  /* @__PURE__ */Q(N,{onClick:()=>{g(null),y.items.forEach(e=>o(e.id))},children:[
36
36
  /* @__PURE__ */Z("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Z("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75h6.5v6.5h-6.5zM13.75 8.75h6.5v6.5h-6.5z"})}),i.taskbar.restoreAllWindows]}),
@@ -41,28 +41,28 @@ return Q(Ue.Provider,{value:{openWindows:o,openEntity:f,openPage:w,reorderWindow
41
41
  /* @__PURE__ */Z(yt,{openWindows:o,onRemove:d,onSplitView:Ur,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&&Qn(e)}})},onActivateById:ot}),
42
42
  /* @__PURE__ */Z(Yr,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
43
43
  /* @__PURE__ */
44
- return Z(fe.Provider,{value:c(e),children:/* @__PURE__ */Z(Me,{fallback:(t,n)=>/* @__PURE__ */Z(Xr,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */Z(Ce,{error:t,onReload:n})}),children:/* @__PURE__ */Z(_t,{spec:Ge(e),children:/* @__PURE__ */Z(eo,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */Z(Je,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */Z(tt,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var vt=400;function xt({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=O(null),s=O(!1);n&&!s.current&&(a.current="undefined"==typeof document?null:document.activeElement),s.current=n;const l=O(!1),c=O(void 0),u=O(i),d=u.current&&!i;u.current=i;const h=()=>{l.current=!0,clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},vt)};F(()=>{n&&!r&&h()},[n,r]),F(()=>{d&&n&&!r&&h()},[d]),F(()=>()=>clearTimeout(c.current),[]),F(()=>{if(!n||r||!o||i||!l.current)return;l.current=!1;const a=e.current;if(!a||a.contains(document.activeElement))return;const s=t.current?E(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 kt=null,Et=/* @__PURE__ */new Set;function Ct(){return kt}function Mt(e){if(kt!==e){kt=e;for(const e of Et)e()}}function Nt(e){return Et.add(e),()=>{Et.delete(e)}}var St=!1,Lt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},Tt=()=>{};function zt(e){St=e,Lt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function At(e,t){St&&("submenu"===e?Lt.submenus++:Lt.menus++,Lt.menuKey=t)}function Dt(e){if(!St)return Tt;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!St)return;const r=performance.now()-t;"move"===e?Lt.moveMs+=r:Lt.resizeMs+=r}}function Pt(){const e=Lt;return Lt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var It=/* @__PURE__ */new Set([C,k]),Wt=e=>It.has(e)||"function"==typeof e&&"badge"===e.titleRole,Kt=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),Rt=/* @__PURE__ */new Set(["svg"]);function $t(e){const t=[],n={text:"",accessories:[],badges:[],actions:[]};return Ot(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function Ot(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=>Ot(e,t,n));if(!H(e))return;const r=e;if(r.type===w)return void(void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text));if(r.type===U)return void Y.toArray(r.props.children).forEach(e=>Ot(e,t,n));if("string"==typeof r.type){if(Rt.has(r.type))return;if(!Kt.has(r.type))return n.push(" "),Y.toArray(r.props.children).forEach(e=>Ot(e,t,n)),void n.push(" ")}const o=X(r,{key:`title-part-${t.accessories.length}`});t.accessories.push(o),(Wt(r.type)?t.badges:t.actions).push(o)}var Ft=/* @__PURE__ */new Map,jt=/* @__PURE__ */new Set,qt=0;function Bt(){qt++,jt.forEach(e=>e())}function Ht(e){return Ft.get(e)}function Ut(e){return jt.add(e),()=>{jt.delete(e)}}function Yt(){return qt}var Xt=W(""),Vt=W(null);function _t({spec:e,children:t}){/* @__PURE__ */
45
- return Z(Vt.Provider,{value:e,children:t})}var Gt=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),Jt='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600',Qt='button, a[href], summary, [role="button"], [role="link"], [role="menuitem"], select';function Zt(e){return en(e).replace(/\s+/g," ").trim()}function en(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(en).join("");if(H(e)){const t=e,n="string"==typeof t.type?t.type:"";return Gt.has(n)?"":` ${en(t.props?.children)} `}return""}function tn(e){const t=K(Xt);F(()=>{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 nn={};function rn(e,t,n){const r=K(Xt);F(()=>{if(!r)return;nn[r]||(nn[r]=[]);const o={label:e,icon:n,onClick:t};return nn[r].push(o),()=>{nn[r]=(nn[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function on({title:e}){const t=O(null);return F(()=>{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__ */Z("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function an(e){}var sn=W(null);function ln(){return K(Xt)}function cn(){const e=q(Cr,Er),t=K(sn);return t?.active??(Ln.length<=1||null!=e)}function un({children:e,position:t="right",quiet:n=!1}){const r=K(sn),[o,i]=j(null);return F(()=>{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?te(e,o):null}function dn({onClick:e,children:t,className:n}){const r=K(sn);/* @__PURE__ */
46
- return Z("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 hn="erp_window_positions",mn={};try{const e=localStorage.getItem(hn);e&&(mn=JSON.parse(e))}catch{}var pn=null;function fn(){pn&&clearTimeout(pn),pn=setTimeout(()=>{try{localStorage.setItem(hn,JSON.stringify(mn))}catch{}},500)}var wn="erp_activation_order",yn=[];try{const e=localStorage.getItem(wn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(yn=t)}catch{}var gn=null;function bn(){gn&&clearTimeout(gn),gn=setTimeout(()=>{try{localStorage.setItem(wn,JSON.stringify(yn))}catch{}},500)}function vn(e,t){mn[e]||(mn[e]=t,fn())}function xn(e){return mn[e]?{...mn[e]}:null}function kn(e,t){mn[e]=t,fn()}function En(){const r=e(),o=t();let i=!1;for(const e of Object.keys(mn))n(mn[e],r,o)&&(delete mn[e],i=!0);i&&fn()}var Cn={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},Mn=4e3,Nn=()=>{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"},Sn={small:.8,medium:1,large:1.25,maximized:1.25},Ln=[],Tn=/* @__PURE__ */new Set,zn=/* @__PURE__ */new Set,An=0,Dn=/* @__PURE__ */new Map;var Pn=0;function In(){return Pn}function Wn(){Pn++,Tn.forEach(e=>e())}var Kn=/* @__PURE__ */new Map,Rn=/* @__PURE__ */new Map,$n=/* @__PURE__ */new Map;function On(){for(let e=Ln.length-1;e>=0;e--){const t=$n.get(Ln[e]);if(t?.tab)return t.owner}return null}function Fn(){return q(Cr,On,()=>null)}var jn=/* @__PURE__ */new Set;var qn=null;function Bn(e){qn=null,Qn(e)}function Hn(e){qn=e;const t=Kn.get(e);t&&Bn(t)}var Un=/* @__PURE__ */new Map;function Yn(e){return Un.get(e)?.holdsChanges()??!1}function Xn(e){const t=Un.get(e);return t?t.ask():Promise.resolve(!0)}function Vn(e){qn===e&&(qn=null)}function _n(e,t,n){if(n&&$n.set(e,n),t)if(Kn.set(t,e),Rn.set(e,t),jn.delete(t)){Ln.unshift(e);const n=yn.indexOf(t);-1!==n&&yn.splice(n,1),yn.unshift(t),bn()}else!function(e,t){const n=yn.indexOf(t);if(-1===n)return void Ln.push(e);let r=Ln.length;for(let e=0;e<Ln.length;e++){const t=Rn.get(Ln[e]);if(t&&yn.indexOf(t)>n){r=e;break}}Ln.splice(r,0,e)}(e,t),-1===yn.indexOf(t)&&(yn.push(t),bn());else Ln.push(e);Wn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&qn===t&&Bn(e)}function Gn(e){return e?$n.get(e)?.owner??Rn.get(e)??null:null}var Jn=/* @__PURE__ */new Set;function Qn(e){const t=Gn(Er()),n=Ln.indexOf(e);-1!==n&&Ln.splice(n,1),Ln.push(e);const o=$n.get(e);if(o?.root&&o.tab&&r()){const e=Ln.filter(e=>{const t=$n.get(e);return!!t&&!t.root&&t.owner===o.owner});for(const t of e)Ln.splice(Ln.indexOf(t),1),Ln.push(t)}zn.delete(e);const i=Rn.get(e);if(i){const e=yn.indexOf(i);-1!==e&&yn.splice(e,1),yn.push(i),bn(),qn&&qn!==i&&(qn=null)}Wn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const a=Gn(Er());a&&a!==t&&Jn.forEach(e=>e(a))}function Zn(e){const t=Ln.indexOf(e);-1!==t&&Ln.splice(t,1),zn.add(e),Dn.set(e,++An);const n=Rn.get(e);if(n){const e=yn.indexOf(n);-1!==e&&(yn.splice(e,1),bn())}Wn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var er=/* @__PURE__ */new Set;var tr=8,nr=32;function rr(){return e()}var or=u.windowBar,ir=80,ar=384,sr=400;function lr(e,t=rr()){const n=Math.min(Math.max(e.x,t.x+ir-e.w),t.x+t.w-ir),r=Math.min(Math.max(e.y,t.y),t.y+t.h-or);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function cr(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=rr();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 ur(e){const t=rr(),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 dr=null;function hr(e){const t=(dr||((dr=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none",`z-index: ${D.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(dr)),dr);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 mr(){dr&&(dr.style.opacity="0",dr.style.display="none")}var pr=[{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"}],fr=350,wr=200;function yr({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o}){const[i,a]=j(!1),s=O(void 0),l=O(void 0);F(()=>()=>{clearTimeout(s.current),clearTimeout(l.current)},[]);const c=()=>{clearTimeout(l.current),s.current=setTimeout(()=>a(!0),fr)},u=()=>{clearTimeout(s.current),l.current=setTimeout(()=>a(!1),wr)};/* @__PURE__ */
44
+ return Z(fe.Provider,{value:c(e),children:/* @__PURE__ */Z(Me,{fallback:(t,n)=>/* @__PURE__ */Z(Xr,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */Z(Ce,{error:t,onReload:n})}),children:/* @__PURE__ */Z(Gt,{spec:_e(e),children:/* @__PURE__ */Z(eo,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */Z(Je,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */Z(tt,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var vt=400;function xt({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=O(null),s=O(!1);n&&!s.current&&(a.current="undefined"==typeof document?null:document.activeElement),s.current=n;const l=O(!1),c=O(void 0),u=O(i),d=u.current&&!i;u.current=i;const h=()=>{l.current=!0,clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},vt)};F(()=>{n&&!r&&h()},[n,r]),F(()=>{d&&n&&!r&&h()},[d]),F(()=>()=>clearTimeout(c.current),[]),F(()=>{if(!n||r||!o||i||!l.current)return;l.current=!1;const a=e.current;if(!a||a.contains(document.activeElement))return;const s=t.current?k(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 kt=null,Et=/* @__PURE__ */new Set;function Ct(){return kt}function Mt(e){if(kt!==e){kt=e;for(const e of Et)e()}}function Nt(e){return Et.add(e),()=>{Et.delete(e)}}var St=!1,Lt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},Tt=()=>{};function zt(e){St=e,Lt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function At(e,t){St&&("submenu"===e?Lt.submenus++:Lt.menus++,Lt.menuKey=t)}function Dt(e){if(!St)return Tt;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!St)return;const r=performance.now()-t;"move"===e?Lt.moveMs+=r:Lt.resizeMs+=r}}function Pt(){const e=Lt;return Lt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var It=/* @__PURE__ */new Set([E,b]),Wt=e=>It.has(e)||"function"==typeof e&&"badge"===e.titleRole,Rt=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),Kt=/* @__PURE__ */new Set(["svg"]);function $t(e){const t=[],n={text:"",accessories:[],badges:[],actions:[]};return Ot(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function Ot(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=>Ot(e,t,n));if(!H(e))return;const r=e;if(r.type===w)return void(void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text));if(r.type===U)return void Y.toArray(r.props.children).forEach(e=>Ot(e,t,n));if("string"==typeof r.type){if(Kt.has(r.type))return;if(!Rt.has(r.type))return n.push(" "),Y.toArray(r.props.children).forEach(e=>Ot(e,t,n)),void n.push(" ")}const o=X(r,{key:`title-part-${t.accessories.length}`});t.accessories.push(o),(Wt(r.type)?t.badges:t.actions).push(o)}var Ft=/* @__PURE__ */new Map,jt=/* @__PURE__ */new Set,qt=0;function Bt(){qt++,jt.forEach(e=>e())}function Ht(e){return Ft.get(e)}function Ut(e){return jt.add(e),()=>{jt.delete(e)}}function Yt(){return qt}var Xt=W(""),Vt=W(null);function Gt({spec:e,children:t}){/* @__PURE__ */
45
+ return Z(Vt.Provider,{value:e,children:t})}var _t=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),Jt='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600',Qt='button, a[href], summary, [role="button"], [role="link"], [role="menuitem"], select';function Zt(e){return en(e).replace(/\s+/g," ").trim()}function en(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(en).join("");if(H(e)){const t=e,n="string"==typeof t.type?t.type:"";return _t.has(n)?"":` ${en(t.props?.children)} `}return""}function tn(e){const t=R(Xt);F(()=>{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 nn={};function rn(e,t,n){const r=R(Xt);F(()=>{if(!r)return;nn[r]||(nn[r]=[]);const o={label:e,icon:n,onClick:t};return nn[r].push(o),()=>{nn[r]=(nn[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function on({title:e}){const t=O(null);return F(()=>{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__ */Z("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function an(e){}var sn=W(null);function ln(){return R(Xt)}function cn(){const e=q(Cr,Er),t=R(sn);return t?.active??(Ln.length<=1||null!=e)}function un({children:e,position:t="right",quiet:n=!1}){const r=R(sn),[o,i]=j(null);return F(()=>{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?te(e,o):null}function dn({onClick:e,children:t,className:n}){const r=R(sn);/* @__PURE__ */
46
+ return Z("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 hn="erp_window_positions",mn={};try{const e=localStorage.getItem(hn);e&&(mn=JSON.parse(e))}catch{}var pn=null;function fn(){pn&&clearTimeout(pn),pn=setTimeout(()=>{try{localStorage.setItem(hn,JSON.stringify(mn))}catch{}},500)}var wn="erp_activation_order",yn=[];try{const e=localStorage.getItem(wn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(yn=t)}catch{}var gn=null;function bn(){gn&&clearTimeout(gn),gn=setTimeout(()=>{try{localStorage.setItem(wn,JSON.stringify(yn))}catch{}},500)}function vn(e,t){mn[e]||(mn[e]=t,fn())}function xn(e){return mn[e]?{...mn[e]}:null}function kn(e,t){mn[e]=t,fn()}function En(){const r=e(),o=t();let i=!1;for(const e of Object.keys(mn))n(mn[e],r,o)&&(delete mn[e],i=!0);i&&fn()}var Cn={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},Mn=4e3,Nn=()=>{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"},Sn={small:.8,medium:1,large:1.25,maximized:1.25},Ln=[],Tn=/* @__PURE__ */new Set,zn=/* @__PURE__ */new Set,An=0,Dn=/* @__PURE__ */new Map;var Pn=0;function In(){return Pn}function Wn(){Pn++,Tn.forEach(e=>e())}var Rn=/* @__PURE__ */new Map,Kn=/* @__PURE__ */new Map,$n=/* @__PURE__ */new Map;function On(){for(let e=Ln.length-1;e>=0;e--){const t=$n.get(Ln[e]);if(t?.tab)return t.owner}return null}function Fn(){return q(Cr,On,()=>null)}var jn=/* @__PURE__ */new Set;var qn=null;function Bn(e){qn=null,Qn(e)}function Hn(e){qn=e;const t=Rn.get(e);t&&Bn(t)}var Un=/* @__PURE__ */new Map;function Yn(e){return Un.get(e)?.holdsChanges()??!1}function Xn(e){const t=Un.get(e);return t?t.ask():Promise.resolve(!0)}function Vn(e){qn===e&&(qn=null)}function Gn(e,t,n){if(n&&$n.set(e,n),t)if(Rn.set(t,e),Kn.set(e,t),jn.delete(t)){Ln.unshift(e);const n=yn.indexOf(t);-1!==n&&yn.splice(n,1),yn.unshift(t),bn()}else!function(e,t){const n=yn.indexOf(t);if(-1===n)return void Ln.push(e);let r=Ln.length;for(let e=0;e<Ln.length;e++){const t=Kn.get(Ln[e]);if(t&&yn.indexOf(t)>n){r=e;break}}Ln.splice(r,0,e)}(e,t),-1===yn.indexOf(t)&&(yn.push(t),bn());else Ln.push(e);Wn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&qn===t&&Bn(e)}function _n(e){return e?$n.get(e)?.owner??Kn.get(e)??null:null}var Jn=/* @__PURE__ */new Set;function Qn(e){const t=_n(Er()),n=Ln.indexOf(e);-1!==n&&Ln.splice(n,1),Ln.push(e);const o=$n.get(e);if(o?.root&&o.tab&&r()){const e=Ln.filter(e=>{const t=$n.get(e);return!!t&&!t.root&&t.owner===o.owner});for(const t of e)Ln.splice(Ln.indexOf(t),1),Ln.push(t)}zn.delete(e);const i=Kn.get(e);if(i){const e=yn.indexOf(i);-1!==e&&yn.splice(e,1),yn.push(i),bn(),qn&&qn!==i&&(qn=null)}Wn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const a=_n(Er());a&&a!==t&&Jn.forEach(e=>e(a))}function Zn(e){const t=Ln.indexOf(e);-1!==t&&Ln.splice(t,1),zn.add(e),Dn.set(e,++An);const n=Kn.get(e);if(n){const e=yn.indexOf(n);-1!==e&&(yn.splice(e,1),bn())}Wn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var er=/* @__PURE__ */new Set;var tr=8,nr=32;function rr(){return e()}var or=u.windowBar,ir=80,ar=384,sr=400;function lr(e,t=rr()){const n=Math.min(Math.max(e.x,t.x+ir-e.w),t.x+t.w-ir),r=Math.min(Math.max(e.y,t.y),t.y+t.h-or);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function cr(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=rr();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 ur(e){const t=rr(),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 dr=null;function hr(e){const t=(dr||((dr=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none",`z-index: ${D.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(dr)),dr);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 mr(){dr&&(dr.style.opacity="0",dr.style.display="none")}var pr=[{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"}],fr=350,wr=200;function yr({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o}){const[i,a]=j(!1),s=O(void 0),l=O(void 0);F(()=>()=>{clearTimeout(s.current),clearTimeout(l.current)},[]);const c=()=>{clearTimeout(l.current),s.current=setTimeout(()=>a(!0),fr)},u=()=>{clearTimeout(s.current),l.current=setTimeout(()=>a(!1),wr)};/* @__PURE__ */
47
47
  return Q("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u,children:[
48
- /* @__PURE__ */Z("button",{onClick:t,onFocus:c,onBlur:u,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */Z("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-gray-200 bg-white p-2 shadow-lg",children:pr.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */Z("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__ */Z("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var gr="rosh-gesture-style";var br={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},vr=4;function xr(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(gr))return;const e=document.createElement("style");e.id=gr,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=Dt(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function kr(e){const t=Ln.indexOf(e);if(-1===t)return-1;const n=D.window+t*D.windowStep,o=$n.get(e);if(!o||o.root||!o.tab||!r())return n;let i=-1;for(const[e,t]of $n){if(!t.root||t.owner!==o.owner)continue;const n=Ln.indexOf(e);-1!==n&&(i=Math.max(i,D.window+n*D.windowStep))}return i>=n?i+2+Math.min(t,7):n}function Er(){return Ln[Ln.length-1]||null}function Cr(e){return Tn.add(e),()=>{Tn.delete(e)}}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=Ln.length-1;e>=0;e--)er.has(Ln[e])||Ln.splice(e,1);yn=yn.filter(e=>{const t=Kn.get(e);return null!=t&&er.has(t)}),bn(),Wn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var Mr="modal-close-request";function Nr(e){q(Cr,In);const t=K(sn);if(Ln.length<=1)return!0;if(e){const t=Kn.get(e);if(null!=t)return Er()===t}return t?.active??null!=Er()}var Sr=!1,Lr=/* @__PURE__ */new Set;function Tr(e){return Lr.add(e),()=>Lr.delete(e)}function zr(){return Sr}function Ar(e){Sr!==e&&(Sr=e,Lr.forEach(e=>e()))}function Dr(){Ar(!Sr)}function Pr(){Ar(!1)}var Ir=null,Wr=/* @__PURE__ */new Set;function Kr(e){return Wr.add(e),()=>Wr.delete(e)}function Rr(){return Ir}function $r(e){Ir!==e&&(Ir=e,Wr.forEach(e=>e()))}var Or=null,Fr=/* @__PURE__ */new Set;function jr(e){return Fr.add(e),()=>Fr.delete(e)}function qr(){return Or}function Br(e){Or!==e&&(Or=e,Fr.forEach(e=>e()))}function Hr(){if(!Or)return void Ar(!1);$r(Or),Br(null),Ar(!1)}function Ur(){Ar(!Sr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function Yr(){const e=q(Tr,zr),[t,n]=j(e),[r,o]=j(e);return F(()=>{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?te(
49
- /* @__PURE__ */Z("div",{onMouseDown:e=>{e.stopPropagation(),Ar(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:D.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 Xr({open:t,onClose:i,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:w,bodyScroll:k,onMinimize:E,initialBox:C,actions:L,actionsLeft:A,editing:W=!1,edit:R,allowPinOnTop:U,initialPosition:Y,widget:G,compact:J,appStyle:ne,flushBody:re,autoHeight:oe,autoMinHeight:ie,autoWidth:ae,widgetMenu:se,dimensions:le,windowKey:ce,openedFromKey:ue,accentRgb:de,children:he}){const[me,pe]=j(()=>r()),we=v()&&!me,ye=x()&&!!G,[ge,be]=j(0),[ve,xe]=j(!1),ke=O(null),Ee=O(0);F(()=>{Ee.current=ge},[ge]);const Ce=B(e=>{we&&(ke.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},xe(!0),Mt(ue??null))},[we,ue]),Se=q(Nt,Ct);F(()=>{if(!ve)return;const e=e=>{if(!ke.current)return;const t=e.clientX-ke.current.startX;if(Math.abs(e.clientY-ke.current.startY)>Math.abs(t)+12)return ke.current=null,xe(!1),be(0),void Mt(null);be(Math.max(0,t))},t=()=>{if(!ke.current)return;const e=.3*window.innerWidth,t=Ee.current>e;ke.current=null,xe(!1),t?(be(window.innerWidth),setTimeout(()=>{i(),be(0),Mt(null)},180)):(be(0),Mt(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)}},[ve]);const[Te,ze]=j(c),Ae=I(),De=Ae.window;F(()=>{ze(c)},[c]);const Pe=V(()=>Zt(Te).trim()||void 0,[Te]),Ie=_(),[We,Ke]=j(!1),Re=O(!1),[$e,Oe]=j(!1),[Fe,je]=j(null),qe=K(Vt),Be=K(fe),{prefs:He,save:Ue}=g(),Ye=!!He.window_accent_stripe,Ve=He.favorite_documents||[],Ge=!!qe&&Ve.some(e=>e.entityType===qe.entityType&&e.entityId===qe.entityId),Je=B(()=>{if(!qe)return;const e=Ge?Ve.filter(e=>!(e.entityType===qe.entityType&&e.entityId===qe.entityId)):[...Ve,{entityType:qe.entityType,entityId:qe.entityId,label:qe.label}];Ue({favorite_documents:e})},[qe,Ge,Ve,Ue]),[Qe,Ze]=j(null),[et,tt]=j("top-right"===Y?"right":"left"),nt=O(!1),rt=O(null);$(()=>{const e=rt.current;e&&(de?e.style.setProperty("--window-accent-rgb",de):e.style.removeProperty("--window-accent-rgb"))},[de]);const ot=O(!1),it=O(null),at=O(null),st=O(null),[lt,ct]=j(!1),ut=O(null),dt=O(null),ht=O(null),[mt,pt]=j(!1);$(()=>{const e=dt.current,t=ht.current;if(!e||!t)return;const n=()=>pt(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!=w&&!1!==w]);const ft=!!R&&!G&&!J&&!ne&&(R.editing||"hidden"!==R.state),wt=!!(w||L||A)||lt||ft,yt=K(Ne),gt=""!==K(Xt),bt=O(null);bt.current=Be?{owner:Be.key,tab:Be.tab,root:!gt}:null;const vt=ce||(Be&&!gt?Be.key:null),kt=!!yt&&!gt&&yt.enabled&&yt.hasState&&(W||yt.declaredEditable)&&!yt.handMounted&&wt&&!G&&!J&&!ne&&!we,Et=/* @__PURE__ */Z(z,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),St=u&&H(u)?X(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??Et,Lt=()=>/* @__PURE__ */Z("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();je(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:St}),Tt=40,{minimize:zt,items:At,restoreIfMinimized:Dt,openWindows:Pt}=_e(),It=O(`modal-${Math.random().toString(36).slice(2,8)}`).current;F(()=>{if(G)return er.add(It),()=>{er.delete(It)}},[G,It]),F(()=>{const e=e=>{const t=e.detail;t?.id===It&&ze(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[It]);const[Wt,Kt]=j(D.window),Rt=function(e){const t=q(Cr,Er);return Ln.length<=1||t===e}(It),Ot=O(R);Ot.current=R;const jt=!!R&&!R.editing&&"enabled"===R.state;F(()=>{if(!t||!Rt||!jt)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),Ot.current?.onEdit())};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Rt,jt]);const qt=function(e){return q(Cr,()=>zn.has(e))}(It);xt({panelRef:rt,bodyRef:it,open:t,widget:!!G,active:Rt,minimized:qt});const Ht=q(Tr,zr),Ut=q(Kr,Rr),Yt=q(jr,qr),_t=!U&&!G,Gt=Ht&&_t,[en,tn]=j(!1),rn=Gt&&Yt===It,[on,an]=j(!1),ln=on&&_t&&Ut===It?"picked":null,cn=O(Gt);F(()=>{if(cn.current&&!Gt){an(!0);const e=setTimeout(()=>{an(!1),Ir===It&&$r(null)},700);return cn.current=Gt,()=>clearTimeout(e)}cn.current=Gt},[Gt,It]),F(()=>{Gt||tn(!1)},[Gt]),F(()=>{const e=at.current,t=st.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>ct(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]),F(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&rt.current){const t=rt.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=at.current,n=st.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const un=O(!1),dn=B(e,[]),hn=B(()=>{const t=e(),n=le?le[0]:Cn[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=Sn[Nn()],l=le?Math.min(le[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*(Ln.length-1),u=Math.max(Tt,(i-l)/2),d=(o-a)/2,m=t.h-Tt-l-u;return"top-right"===Y?{x:t.x+t.w-a-Tt,y:t.y+Tt,w:a,h:l}:"top-left"===Y?{x:t.x+Tt,y:t.y+Tt,w:a,h:l}:{x:t.x+Math.max(Tt,(o-a)/2+Tt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),pn=O(!1);t||(pn.current=!1);const wn=ce||d||null;F(()=>{if(!t)return;_n(It,wn,bt.current??void 0),ce||Qn(It),un.current=!1,Kt(kr(It));const e=()=>{Kt(kr(It))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===ce;if(!e.label)return!1;const t=rt.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(Qn(It),Pn.current)return;const t=rr(),n=Math.min(Hn.current.w,t.w-40),o=Math.min(Hn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;bn({x:i,y:a,w:n,h:o}),Bn(!1)},i=e=>{const t=e.detail;r(t)&&(Qn(It),je({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==ce)return;Qn(It);const t=Hn.current,n=function(e,t=rr()){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=rt.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)}bn(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=Ln.indexOf(e);-1!==t&&(Ln.splice(t,1),Wn()),zn.delete(e),Dn.delete(e),$n.delete(e);const n=Rn.get(e);n&&(Rn.delete(e),Kn.delete(n))}(It),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,It,wn,dn]);const yn=!G&&"maximized"===Nn(),[gn,bn]=j(()=>{if(wn&&mn[wn]){const e={...mn[wn]};return le&&(e.w=le[0],oe||(e.h=le[1])),lr(e)}return C?{x:C.x,y:C.y,w:C.w,h:C.h}:yn?dn():hn()}),[vn,xn]=j(()=>!oe),kn=O(me),En=O(null);F(()=>{const e=()=>{const e=r();e!==kn.current&&En.current?.(e),kn.current=e,pe(e),Kt(kr(It))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[It]);const Tn=me&&!!Be?.tab&&!gt&&!G&&!we,An=Tn,Pn=O(An);Pn.current=An;const In=Fn(),On=me&&!!Be?.tab&&!G&&!we&&!Ht&&In!==Be.key,jn=!!G&&me&&!Ht&&null!==In,[qn,Bn]=j(()=>wn&&mn[wn]||C?An:An||yn),Hn=O(gn);Hn.current=gn;const Yn=O(qn);$(()=>{Yn.current=qn},[qn]),$(()=>{if(vn||Tn)return;const e=rt.current,t=it.current;if(!e||!t)return;const n=ie??(G?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,Hn.current.y)-24),g=w?Math.min(Hn.current.h,y):Math.min(Math.max(n,u+p),y),b=Math.abs(g-o)>1;b&&(o=g,bn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),G||(g<=n?i&&(clearTimeout(i),i=null):(b||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&xn(!0)},160)))},l=new ResizeObserver(s);s(),ut.current&&l.observe(ut.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[vn,G,ie,wt,Tn]),$(()=>{if(!oe||!vn||G||!t)return;const e=ut.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||qn)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,Hn.current.y)-24);bn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[oe,vn,G,t,qn,ie]);const Xn=!1!==ae&&!G&&!ne&&!we,[Vn,Gn]=j(()=>!Xn);$(()=>{if(Vn||!t)return;if(!Xn||qn)return void Gn(!0);const n=rt.current,r=it.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let i=Hn.current.w,c=0;const u=()=>Gn(!0),d=()=>{c=0;const t=Hn.current;if(Math.abs(t.w-i)>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)=>{a(e,w)||o.add(m[t])});const b=s(t,l(t.w,w,g),d,Tt);b!==t&&(i=b.w,bn(b))};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,Mn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Vn,t,Xn,qn]);const Jn=O(null),or=!(!Be?.tab||gt||G||we);En.current=t=>{if(!or)return;if(t)return Jn.current||(Jn.current={box:{...Hn.current},maximized:Yn.current}),void(Yn.current=!0);const r=Jn.current;Jn.current=null;const o=e();if(r?.maximized)return Yn.current=!0,Bn(!0),void bn(o);const i=r?.box??(wn?mn[wn]:void 0);if(Yn.current=!1,Bn(!1),i&&!n(i,o,!1)){const e={...i};le&&(e.w=le[0],oe||(e.h=le[1])),bn(lr(e))}else bn(hn())},F(()=>{An&&(Yn.current=!0,Bn(!0),bn(dn()))},[An,dn]),F(()=>{if(G)return;const e=()=>{const e=wn?mn[wn]:void 0;if(Yn.current=!1,Bn(!1),e){const t={...e};le&&(t.w=le[0],oe||(t.h=le[1])),bn(lr(t))}else bn(hn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[G,hn,wn]),F(()=>{t&&wn&&!Tn&&(mn[wn]=gn,fn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[gn,t,wn,Tn]),F(()=>{if(!t)return;const e=()=>{Yn.current?bn(dn()):document.body.classList.contains("rosh-gesturing")||bn(lr)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return qn&&(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,qn,dn]),F(()=>{if(t&&(Ke(!1),Re.current=!1,nt.current=!1,Gn(!Xn),!Pn.current)){if(wn&&mn[wn]){const e=mn[wn];return void bn(t=>lr({...e,...oe?{h:t.h}:{},...Xn?{x:t.x,w:t.w}:{}}))}C&&(bn({x:C.x,y:C.y,w:C.w,h:C.h}),Bn(C.maximized))}},[t]),F(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{rt.current?.contains(t.target)&&!Re.current&&(Re.current=!0,e=setTimeout(()=>Ke(!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 ir="auto"===m?We:!0===m,cr=Be&&!gt?Be.key:null,dr=V(()=>$t(Te),[Te]),pr=O({shortcutSpec:qe,isOnDesktop:Ge,toggleDesktopShortcut:Je,taskbarStrings:Ae.taskbar});$(()=>{pr.current={shortcutSpec:qe,isOnDesktop:Ge,toggleDesktopShortcut:Je,taskbarStrings:Ae.taskbar}});const fr=O(null);fr.current||(fr.current={open:(e,t)=>je({x:e,y:t}),items:()=>{const e=pr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of nn[It]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),F(()=>{if(t&&cr)return()=>{return e=cr,void(Ft.delete(e)&&Bt());var e}},[t,cr]),Xe(!(ce||!t)&&ir);const wr=B(()=>ir||"auto"===m&&Re.current,[ir,m]),gr=B(async e=>{if(nt.current)return!1;if(!wr())return!0;nt.current=!0;const t=Pe,n="close"===e?"Are you sure you want to close?":"discard"===e?"Are you sure you want to stop editing?":"Are you sure you want to continue?",r=await y({title:"Discard changes?",message:t?`“${t}” has unsaved changes. ${n} All changes will be lost.`:`You have unsaved changes. ${n} All changes will be lost.`,confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});return nt.current=!1,r},[wr,Pe]),Nr=B(()=>nt.current?Promise.resolve():wr()?gr("close").then(e=>{e&&i()}):(i(),Promise.resolve()),[wr,gr,i]),Sr=B(async()=>{await gr("discard")&&(Re.current=!1,Ke(!1),Ot.current?.onDiscard())},[gr]),Lr=B(async()=>{const e=await gr("switch");return e&&(Re.current=!1,Ke(!1)),e},[gr]),Dr=O(()=>!1);$(()=>{Dr.current=wr}),$(()=>{if(!t||!ce)return;const e={holdsChanges:()=>Dr.current(),ask:Lr};return Un.set(ce,e),()=>{Un.get(ce)===e&&Un.delete(ce)}},[t,ce,Lr]),$(()=>{if(!t||!vt)return;const e=e=>{e.detail?.windowKey===vt&&Nr()};return window.addEventListener(Mr,e),()=>window.removeEventListener(Mr,e)},[t,vt,Nr]);const Pr=O(null),Wr=B(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(je(null),Qn(It),Pn.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=rt.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Pr.current){const t=Pr.current;Pr.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:Hn.current.x,c=s?s.top:Hn.current.y,u=s?s.height:Hn.current.h,d=s?s.width:Hn.current.w;Bn(!1),bn(e=>({...e,x:l,y:c,w:d,h:u}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<vr&&Math.abs(e.clientY-i)<vr)return;r=xr(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)`),Hn.current={...Hn.current,x:s,y:u},!G){const t=function(e,t){const n=rr(),r=e<=n.x+tr,o=e>=n.x+n.w-tr,i=t<=n.y+tr,a=t>=n.y+n.h-tr,s=e<=n.x+nr,l=e>=n.x+n.w-nr,c=t<=n.y+nr,u=t>=n.y+n.h-nr;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?hr(ur(t)):mr())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),mr();const e=lr({...Hn.current});if(Hn.current=e,!G&&h){Pr.current={x:l,y:c,w:d,h:u};const e=ur(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 bn(e)}if(G){const t=e.x+e.w/2,n=window.innerWidth/2;tt(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),bn(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),Or=B((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=rt.current,l=s?.getBoundingClientRect(),c=l?l.left:Hn.current.x,u=l?l.top:Hn.current.y,d=l?l.width:Hn.current.w,h=l?l.height:Hn.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;Bn(!1),bn({x:c,y:u,w:d,h:h}),Hn.current={x:c,y:u,w:d,h:h};let y=0,g=null;const b=()=>{if(y=0,!g)return;const e=g;g=null,Hn.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`)},v=e=>{if(!o){if(Math.abs(e.clientX-i)<vr&&Math.abs(e.clientY-a)<vr)return;o=xr(n,r,br[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(ar,d+e)),w&&(i=Math.max(sr,h+t)),m){const t=Math.max(ar,d-e);n=c+d-t,o=t}if(p){const e=Math.max(sr,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(b))},x=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),b(),o?.(),bn({...Hn.current})};window.addEventListener("pointermove",v),window.addEventListener("pointerup",x)},[]),Fr=B(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(),Qn(It),"Enter"===e.key)return void(qn?(Bn(!1),bn(hn())):(Bn(!0),bn(dn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Pr.current||(Pr.current={...Hn.current})};if(r<0)return e(),Bn(!0),void bn(dn());if(r>0){if(qn)return Bn(!1),void bn(hn());if(Pr.current){const e=lr(Pr.current);return Pr.current=null,Hn.current=e,void bn(e)}return void Zn(It)}e(),Bn(!1);const t=ur(n<0?"left":"right");return Hn.current=t,void bn(t)}if(qn)return;const o=Hn.current,i=e.shiftKey?{...o,w:Math.max(ar,o.w+24*n),h:Math.max(sr,o.h+24*r)}:lr({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Hn.current=i,bn(i)},[It,qn,hn,dn]),Br=B(e=>{Pr.current||(Pr.current={...Hn.current}),Bn(!1);const t=ur(e);Hn.current=t,bn(t),Qn(It)},[It]),Hr=An||Gt?{}:{tabIndex:0,role:"group","aria-label":Pe?`${Pe} — ${De.windowSuffix}`:De.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:Fr},Ur=()=>{Bn(!0),bn(dn())},Yr=B(()=>{const e=rt.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(Jt);t&&!t.disabled&&t.click()}},[]);F(()=>{if(!t)return;if(G)return;const e=e=>{if(Ln[Ln.length-1]===It&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Yr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&rt.current?.contains(t)))return;if(t.closest(Qt))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Yr,It,G]),F(()=>{if(!t)return;const e=e=>{Ln[Ln.length-1]===It&&((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:It}})),Re.current=!1,Ke(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:It}}))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),F(()=>{if(!t)return;if(G)return;const e=e=>{if("Escape"===e.key&&Ln[Ln.length-1]===It){if(P(e))return e.preventDefault(),void e.stopPropagation();if(Tn&&!W)return;e.preventDefault(),e.stopPropagation(),Nr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Nr,It,G,Tn,W]);const Xr=t&&(void 0!==p||void 0!==f),[Vr]=j(()=>{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}),_r=Tn&&!Be?.home&&dr.actions.length>0;F(()=>{t&&cr&&function(e,t){const n=Ft.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(Ft.set(e,t),Bt())}(cr,{title:dr.text||Pe,dirty:ir,copy:dr.copy,actions:_r&&Vr?Vr:void 0,menu:fr.current??void 0})},[t,cr,Pe,ir,dr.text,dr.copy,_r,Vr]);const Gr=B(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-white 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(F(()=>{if(!t)return;const e=e=>{if(Ln[Ln.length-1]!==It)return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Xr&&(e.preventDefault(),p?p():Gr("bottom")),"k"===e.key&&Xr&&(e.preventDefault(),f?f():Gr("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Xr,Gr,It]),!t||pn.current)return null;const Jr=Gt?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=rr(),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}}(It):null,Qr=Gt&&Jr?Math.min(Jr.w/gn.w,Jr.h/gn.h):1,Zr=(()=>{if(Gt&&Jr){const e=Qr,t=gn.w*e,n=gn.h*e,r=Jr.x+(Jr.w-t)/2-gn.x,o=Jr.y+(Jr.h-n)/2-gn.y,i=en||rn;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:D.expose+(i?20:10),boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(on&&_t){const e="picked"===ln;return{transition:e?"transform 640ms cubic-bezier(0.34, 1.42, 0.64, 1), box-shadow 600ms":"transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms",...e?{zIndex:D.expose+30}:{}}}return null})(),eo=b({modal:!1,titleId:!G&&(Tn?!Be?.home:!we)?Ie:void 0,label:dr.text||Pe}),to=/* @__PURE__ */Q("div",{children:[
50
- /* @__PURE__ */Q("div",{ref:rt,"data-modal-panel":!0,"data-modal-id":It,"data-window-key":ce||void 0,...U?{"data-utility":""}:{},...$e?{"data-pinned-top":""}:{},...G?{"data-widget":""}:{},...Be?{"data-window-owner":Be.key}:{},...Be&&!gt?{"data-window-root":""}:{},...Tn?{"data-window-tab":""}:{},...eo,className:Tn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(G?Rt?"shadow-xl":"shadow-lg":"border "+(Rt?"shadow-xl border-gray-200":"shadow-lg border-gray-300")),onMouseDownCapture:e=>{if(ot.current=!1,Gt){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),$r(It),Ar(!1),void Qn(It)}if(!Rt&&!G&&!$e&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===rt.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),ot.current=!0,je(null),Qn(It),window.addEventListener("mouseup",()=>{setTimeout(()=>{ot.current=!1},0)},{once:!0}))}},onClickCapture:e=>{ot.current&&(ot.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(Gt)return;je(null);e.target.closest("[data-modal-panel]")===rt.current&&(e.target.closest("button, input, a, select, textarea")||Qn(It))},style:we?{zIndex:Wt+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${ge}px)`,transition:ve?"none":"transform 180ms ease-out",...G?{display:"none"}:{},...Wt<0?{display:"none"}:{},...Rt||$e||Se&&ce===Se?{}:{display:"none"}}:{zIndex:$e?D.pinnedWindow:Wt+1,width:gn.w,height:gn.h,top:gn.y,...G&&"right"===et?{right:window.innerWidth-gn.x-gn.w}:{left:gn.x},...Wt<0&&!$e?{display:"none"}:{},...ye?{display:"none"}:{},...On||jn?{visibility:"hidden",pointerEvents:"none"}:{},...Zr??{}},children:[we&&!G&&/* @__PURE__ */Z("div",{onPointerDown:Ce,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),G?null:Tn?Be?.home?null:/* @__PURE__ */Q(ee,{children:[
51
- /* @__PURE__ */Z("h2",{id:Ie,"data-window-title":!0,className:"sr-only",children:dr.text||Pe}),_r&&Vr&&te(
48
+ /* @__PURE__ */Z("button",{onClick:t,onFocus:c,onBlur:u,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */Z("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-gray-200 bg-white p-2 shadow-lg",children:pr.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */Z("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__ */Z("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var gr="rosh-gesture-style";var br={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},vr=4;function xr(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(gr))return;const e=document.createElement("style");e.id=gr,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=Dt(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function kr(e){const t=Ln.indexOf(e);if(-1===t)return-1;const n=D.window+t*D.windowStep,o=$n.get(e);if(!o||o.root||!o.tab||!r())return n;let i=-1;for(const[e,t]of $n){if(!t.root||t.owner!==o.owner)continue;const n=Ln.indexOf(e);-1!==n&&(i=Math.max(i,D.window+n*D.windowStep))}return i>=n?i+2+Math.min(t,7):n}function Er(){return Ln[Ln.length-1]||null}function Cr(e){return Tn.add(e),()=>{Tn.delete(e)}}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=Ln.length-1;e>=0;e--)er.has(Ln[e])||Ln.splice(e,1);yn=yn.filter(e=>{const t=Rn.get(e);return null!=t&&er.has(t)}),bn(),Wn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var Mr="modal-close-request";function Nr(e){q(Cr,In);const t=R(sn);if(Ln.length<=1)return!0;if(e){const t=Rn.get(e);if(null!=t)return Er()===t}return t?.active??null!=Er()}var Sr=!1,Lr=/* @__PURE__ */new Set;function Tr(e){return Lr.add(e),()=>Lr.delete(e)}function zr(){return Sr}function Ar(e){Sr!==e&&(Sr=e,Lr.forEach(e=>e()))}function Dr(){Ar(!Sr)}function Pr(){Ar(!1)}var Ir=null,Wr=/* @__PURE__ */new Set;function Rr(e){return Wr.add(e),()=>Wr.delete(e)}function Kr(){return Ir}function $r(e){Ir!==e&&(Ir=e,Wr.forEach(e=>e()))}var Or=null,Fr=/* @__PURE__ */new Set;function jr(e){return Fr.add(e),()=>Fr.delete(e)}function qr(){return Or}function Br(e){Or!==e&&(Or=e,Fr.forEach(e=>e()))}function Hr(){if(!Or)return void Ar(!1);$r(Or),Br(null),Ar(!1)}function Ur(){Ar(!Sr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function Yr(){const e=q(Tr,zr),[t,n]=j(e),[r,o]=j(e);return F(()=>{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?te(
49
+ /* @__PURE__ */Z("div",{onMouseDown:e=>{e.stopPropagation(),Ar(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:D.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 Xr({open:t,onClose:i,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:w,bodyScroll:b,onMinimize:k,initialBox:E,actions:L,actionsLeft:A,editing:W=!1,edit:K,allowPinOnTop:U,initialPosition:Y,widget:_,compact:J,appStyle:ne,flushBody:re,autoHeight:oe,autoMinHeight:ie,autoWidth:ae,widgetMenu:se,dimensions:le,windowKey:ce,openedFromKey:ue,accentRgb:de,children:he}){const[me,pe]=j(()=>r()),we=v()&&!me,ye=x()&&!!_,[ge,be]=j(0),[ve,xe]=j(!1),ke=O(null),Ee=O(0);F(()=>{Ee.current=ge},[ge]);const Ce=B(e=>{we&&(ke.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},xe(!0),Mt(ue??null))},[we,ue]),Se=q(Nt,Ct);F(()=>{if(!ve)return;const e=e=>{if(!ke.current)return;const t=e.clientX-ke.current.startX;if(Math.abs(e.clientY-ke.current.startY)>Math.abs(t)+12)return ke.current=null,xe(!1),be(0),void Mt(null);be(Math.max(0,t))},t=()=>{if(!ke.current)return;const e=.3*window.innerWidth,t=Ee.current>e;ke.current=null,xe(!1),t?(be(window.innerWidth),setTimeout(()=>{i(),be(0),Mt(null)},180)):(be(0),Mt(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)}},[ve]);const[Te,ze]=j(c),Ae=I(),De=Ae.window;F(()=>{ze(c)},[c]);const Pe=V(()=>Zt(Te).trim()||void 0,[Te]),Ie=G(),[We,Re]=j(!1),Ke=O(!1),[$e,Oe]=j(!1),[Fe,je]=j(null),qe=R(Vt),Be=R(fe),{prefs:He,save:Ue}=C(),Ye=!!He.window_accent_stripe,Ve=He.favorite_documents||[],_e=!!qe&&Ve.some(e=>e.entityType===qe.entityType&&e.entityId===qe.entityId),Je=B(()=>{if(!qe)return;const e=_e?Ve.filter(e=>!(e.entityType===qe.entityType&&e.entityId===qe.entityId)):[...Ve,{entityType:qe.entityType,entityId:qe.entityId,label:qe.label}];Ue({favorite_documents:e})},[qe,_e,Ve,Ue]),[Qe,Ze]=j(null),[et,tt]=j("top-right"===Y?"right":"left"),nt=O(!1),rt=O(null);$(()=>{const e=rt.current;e&&(de?e.style.setProperty("--window-accent-rgb",de):e.style.removeProperty("--window-accent-rgb"))},[de]);const ot=O(!1),it=O(null),at=O(null),st=O(null),[lt,ct]=j(!1),ut=O(null),dt=O(null),ht=O(null),[mt,pt]=j(!1);$(()=>{const e=dt.current,t=ht.current;if(!e||!t)return;const n=()=>pt(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!=w&&!1!==w]);const ft=!!K&&!_&&!J&&!ne&&(K.editing||"hidden"!==K.state),wt=!!(w||L||A)||lt||ft,yt=R(Ne),gt=""!==R(Xt),bt=O(null);bt.current=Be?{owner:Be.key,tab:Be.tab,root:!gt}:null;const vt=ce||(Be&&!gt?Be.key:null),kt=!!yt&&!gt&&yt.enabled&&yt.hasState&&(W||yt.declaredEditable)&&!yt.handMounted&&wt&&!_&&!J&&!ne&&!we,Et=/* @__PURE__ */Z(z,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),St=u&&H(u)?X(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??Et,Lt=()=>/* @__PURE__ */Z("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();je(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:St}),Tt=40,{minimize:zt,items:At,restoreIfMinimized:Dt,openWindows:Pt}=Ge(),It=O(`modal-${Math.random().toString(36).slice(2,8)}`).current;F(()=>{if(_)return er.add(It),()=>{er.delete(It)}},[_,It]),F(()=>{const e=e=>{const t=e.detail;t?.id===It&&ze(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[It]);const[Wt,Rt]=j(D.window),Kt=function(e){const t=q(Cr,Er);return Ln.length<=1||t===e}(It),Ot=O(K);Ot.current=K;const jt=!!K&&!K.editing&&"enabled"===K.state;F(()=>{if(!t||!Kt||!jt)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),Ot.current?.onEdit())};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Kt,jt]);const qt=function(e){return q(Cr,()=>zn.has(e))}(It);xt({panelRef:rt,bodyRef:it,open:t,widget:!!_,active:Kt,minimized:qt});const Ht=q(Tr,zr),Ut=q(Rr,Kr),Yt=q(jr,qr),Gt=!U&&!_,_t=Ht&&Gt,[en,tn]=j(!1),rn=_t&&Yt===It,[on,an]=j(!1),ln=on&&Gt&&Ut===It?"picked":null,cn=O(_t);F(()=>{if(cn.current&&!_t){an(!0);const e=setTimeout(()=>{an(!1),Ir===It&&$r(null)},700);return cn.current=_t,()=>clearTimeout(e)}cn.current=_t},[_t,It]),F(()=>{_t||tn(!1)},[_t]),F(()=>{const e=at.current,t=st.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>ct(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]),F(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&rt.current){const t=rt.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=at.current,n=st.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const un=O(!1),dn=B(e,[]),hn=B(()=>{const t=e(),n=le?le[0]:Cn[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=Sn[Nn()],l=le?Math.min(le[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*(Ln.length-1),u=Math.max(Tt,(i-l)/2),d=(o-a)/2,m=t.h-Tt-l-u;return"top-right"===Y?{x:t.x+t.w-a-Tt,y:t.y+Tt,w:a,h:l}:"top-left"===Y?{x:t.x+Tt,y:t.y+Tt,w:a,h:l}:{x:t.x+Math.max(Tt,(o-a)/2+Tt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),pn=O(!1);t||(pn.current=!1);const wn=ce||d||null;F(()=>{if(!t)return;Gn(It,wn,bt.current??void 0),ce||Qn(It),un.current=!1,Rt(kr(It));const e=()=>{Rt(kr(It))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===ce;if(!e.label)return!1;const t=rt.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(Qn(It),Pn.current)return;const t=rr(),n=Math.min(Hn.current.w,t.w-40),o=Math.min(Hn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;bn({x:i,y:a,w:n,h:o}),Bn(!1)},i=e=>{const t=e.detail;r(t)&&(Qn(It),je({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==ce)return;Qn(It);const t=Hn.current,n=function(e,t=rr()){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=rt.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)}bn(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=Ln.indexOf(e);-1!==t&&(Ln.splice(t,1),Wn()),zn.delete(e),Dn.delete(e),$n.delete(e);const n=Kn.get(e);n&&(Kn.delete(e),Rn.delete(n))}(It),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,It,wn,dn]);const yn=!_&&"maximized"===Nn(),[gn,bn]=j(()=>{if(wn&&mn[wn]){const e={...mn[wn]};return le&&(e.w=le[0],oe||(e.h=le[1])),lr(e)}return E?{x:E.x,y:E.y,w:E.w,h:E.h}:yn?dn():hn()}),[vn,xn]=j(()=>!oe),kn=O(me),En=O(null);F(()=>{const e=()=>{const e=r();e!==kn.current&&En.current?.(e),kn.current=e,pe(e),Rt(kr(It))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[It]);const Tn=me&&!!Be?.tab&&!gt&&!_&&!we,An=Tn,Pn=O(An);Pn.current=An;const In=Fn(),On=me&&!!Be?.tab&&!_&&!we&&!Ht&&In!==Be.key,jn=!!_&&me&&!Ht&&null!==In,[qn,Bn]=j(()=>wn&&mn[wn]||E?An:An||yn),Hn=O(gn);Hn.current=gn;const Yn=O(qn);$(()=>{Yn.current=qn},[qn]),$(()=>{if(vn||Tn)return;const e=rt.current,t=it.current;if(!e||!t)return;const n=ie??(_?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,Hn.current.y)-24),g=w?Math.min(Hn.current.h,y):Math.min(Math.max(n,u+p),y),b=Math.abs(g-o)>1;b&&(o=g,bn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),_||(g<=n?i&&(clearTimeout(i),i=null):(b||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&xn(!0)},160)))},l=new ResizeObserver(s);s(),ut.current&&l.observe(ut.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[vn,_,ie,wt,Tn]),$(()=>{if(!oe||!vn||_||!t)return;const e=ut.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||qn)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,Hn.current.y)-24);bn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[oe,vn,_,t,qn,ie]);const Xn=!1!==ae&&!_&&!ne&&!we,[Vn,_n]=j(()=>!Xn);$(()=>{if(Vn||!t)return;if(!Xn||qn)return void _n(!0);const n=rt.current,r=it.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let i=Hn.current.w,c=0;const u=()=>_n(!0),d=()=>{c=0;const t=Hn.current;if(Math.abs(t.w-i)>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)=>{a(e,w)||o.add(m[t])});const b=s(t,l(t.w,w,g),d,Tt);b!==t&&(i=b.w,bn(b))};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,Mn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Vn,t,Xn,qn]);const Jn=O(null),or=!(!Be?.tab||gt||_||we);En.current=t=>{if(!or)return;if(t)return Jn.current||(Jn.current={box:{...Hn.current},maximized:Yn.current}),void(Yn.current=!0);const r=Jn.current;Jn.current=null;const o=e();if(r?.maximized)return Yn.current=!0,Bn(!0),void bn(o);const i=r?.box??(wn?mn[wn]:void 0);if(Yn.current=!1,Bn(!1),i&&!n(i,o,!1)){const e={...i};le&&(e.w=le[0],oe||(e.h=le[1])),bn(lr(e))}else bn(hn())},F(()=>{An&&(Yn.current=!0,Bn(!0),bn(dn()))},[An,dn]),F(()=>{if(_)return;const e=()=>{const e=wn?mn[wn]:void 0;if(Yn.current=!1,Bn(!1),e){const t={...e};le&&(t.w=le[0],oe||(t.h=le[1])),bn(lr(t))}else bn(hn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[_,hn,wn]),F(()=>{t&&wn&&!Tn&&(mn[wn]=gn,fn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[gn,t,wn,Tn]),F(()=>{if(!t)return;const e=()=>{Yn.current?bn(dn()):document.body.classList.contains("rosh-gesturing")||bn(lr)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return qn&&(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,qn,dn]),F(()=>{if(t&&(Re(!1),Ke.current=!1,nt.current=!1,_n(!Xn),!Pn.current)){if(wn&&mn[wn]){const e=mn[wn];return void bn(t=>lr({...e,...oe?{h:t.h}:{},...Xn?{x:t.x,w:t.w}:{}}))}E&&(bn({x:E.x,y:E.y,w:E.w,h:E.h}),Bn(E.maximized))}},[t]),F(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{rt.current?.contains(t.target)&&!Ke.current&&(Ke.current=!0,e=setTimeout(()=>Re(!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 ir="auto"===m?We:!0===m,cr=Be&&!gt?Be.key:null,dr=V(()=>$t(Te),[Te]),pr=O({shortcutSpec:qe,isOnDesktop:_e,toggleDesktopShortcut:Je,taskbarStrings:Ae.taskbar});$(()=>{pr.current={shortcutSpec:qe,isOnDesktop:_e,toggleDesktopShortcut:Je,taskbarStrings:Ae.taskbar}});const fr=O(null);fr.current||(fr.current={open:(e,t)=>je({x:e,y:t}),items:()=>{const e=pr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of nn[It]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),F(()=>{if(t&&cr)return()=>{return e=cr,void(Ft.delete(e)&&Bt());var e}},[t,cr]),Xe(!(ce||!t)&&ir);const wr=B(()=>ir||"auto"===m&&Ke.current,[ir,m]),gr=B(async e=>{if(nt.current)return!1;if(!wr())return!0;nt.current=!0;const t=Pe,n="close"===e?"Are you sure you want to close?":"discard"===e?"Are you sure you want to stop editing?":"Are you sure you want to continue?",r=await y({title:"Discard changes?",message:t?`“${t}” has unsaved changes. ${n} All changes will be lost.`:`You have unsaved changes. ${n} All changes will be lost.`,confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});return nt.current=!1,r},[wr,Pe]),Nr=B(()=>nt.current?Promise.resolve():wr()?gr("close").then(e=>{e&&i()}):(i(),Promise.resolve()),[wr,gr,i]),Sr=B(async()=>{await gr("discard")&&(Ke.current=!1,Re(!1),Ot.current?.onDiscard())},[gr]),Lr=B(async()=>{const e=await gr("switch");return e&&(Ke.current=!1,Re(!1)),e},[gr]),Dr=O(()=>!1);$(()=>{Dr.current=wr}),$(()=>{if(!t||!ce)return;const e={holdsChanges:()=>Dr.current(),ask:Lr};return Un.set(ce,e),()=>{Un.get(ce)===e&&Un.delete(ce)}},[t,ce,Lr]),$(()=>{if(!t||!vt)return;const e=e=>{e.detail?.windowKey===vt&&Nr()};return window.addEventListener(Mr,e),()=>window.removeEventListener(Mr,e)},[t,vt,Nr]);const Pr=O(null),Wr=B(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(je(null),Qn(It),Pn.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=rt.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Pr.current){const t=Pr.current;Pr.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:Hn.current.x,c=s?s.top:Hn.current.y,u=s?s.height:Hn.current.h,d=s?s.width:Hn.current.w;Bn(!1),bn(e=>({...e,x:l,y:c,w:d,h:u}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<vr&&Math.abs(e.clientY-i)<vr)return;r=xr(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)`),Hn.current={...Hn.current,x:s,y:u},!_){const t=function(e,t){const n=rr(),r=e<=n.x+tr,o=e>=n.x+n.w-tr,i=t<=n.y+tr,a=t>=n.y+n.h-tr,s=e<=n.x+nr,l=e>=n.x+n.w-nr,c=t<=n.y+nr,u=t>=n.y+n.h-nr;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?hr(ur(t)):mr())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),mr();const e=lr({...Hn.current});if(Hn.current=e,!_&&h){Pr.current={x:l,y:c,w:d,h:u};const e=ur(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 bn(e)}if(_){const t=e.x+e.w/2,n=window.innerWidth/2;tt(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),bn(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),Or=B((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=rt.current,l=s?.getBoundingClientRect(),c=l?l.left:Hn.current.x,u=l?l.top:Hn.current.y,d=l?l.width:Hn.current.w,h=l?l.height:Hn.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;Bn(!1),bn({x:c,y:u,w:d,h:h}),Hn.current={x:c,y:u,w:d,h:h};let y=0,g=null;const b=()=>{if(y=0,!g)return;const e=g;g=null,Hn.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`)},v=e=>{if(!o){if(Math.abs(e.clientX-i)<vr&&Math.abs(e.clientY-a)<vr)return;o=xr(n,r,br[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(ar,d+e)),w&&(i=Math.max(sr,h+t)),m){const t=Math.max(ar,d-e);n=c+d-t,o=t}if(p){const e=Math.max(sr,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(b))},x=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),b(),o?.(),bn({...Hn.current})};window.addEventListener("pointermove",v),window.addEventListener("pointerup",x)},[]),Fr=B(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(),Qn(It),"Enter"===e.key)return void(qn?(Bn(!1),bn(hn())):(Bn(!0),bn(dn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Pr.current||(Pr.current={...Hn.current})};if(r<0)return e(),Bn(!0),void bn(dn());if(r>0){if(qn)return Bn(!1),void bn(hn());if(Pr.current){const e=lr(Pr.current);return Pr.current=null,Hn.current=e,void bn(e)}return void Zn(It)}e(),Bn(!1);const t=ur(n<0?"left":"right");return Hn.current=t,void bn(t)}if(qn)return;const o=Hn.current,i=e.shiftKey?{...o,w:Math.max(ar,o.w+24*n),h:Math.max(sr,o.h+24*r)}:lr({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Hn.current=i,bn(i)},[It,qn,hn,dn]),Br=B(e=>{Pr.current||(Pr.current={...Hn.current}),Bn(!1);const t=ur(e);Hn.current=t,bn(t),Qn(It)},[It]),Hr=An||_t?{}:{tabIndex:0,role:"group","aria-label":Pe?`${Pe} — ${De.windowSuffix}`:De.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:Fr},Ur=()=>{Bn(!0),bn(dn())},Yr=B(()=>{const e=rt.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(Jt);t&&!t.disabled&&t.click()}},[]);F(()=>{if(!t)return;if(_)return;const e=e=>{if(Ln[Ln.length-1]===It&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Yr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&rt.current?.contains(t)))return;if(t.closest(Qt))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Yr,It,_]),F(()=>{if(!t)return;const e=e=>{Ln[Ln.length-1]===It&&((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:It}})),Ke.current=!1,Re(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:It}}))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),F(()=>{if(!t)return;if(_)return;const e=e=>{if("Escape"===e.key&&Ln[Ln.length-1]===It){if(P(e))return e.preventDefault(),void e.stopPropagation();if(Tn&&!W)return;e.preventDefault(),e.stopPropagation(),Nr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Nr,It,_,Tn,W]);const Xr=t&&(void 0!==p||void 0!==f),[Vr]=j(()=>{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}),Gr=Tn&&!Be?.home&&dr.actions.length>0;F(()=>{t&&cr&&function(e,t){const n=Ft.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(Ft.set(e,t),Bt())}(cr,{title:dr.text||Pe,dirty:ir,copy:dr.copy,actions:Gr&&Vr?Vr:void 0,menu:fr.current??void 0})},[t,cr,Pe,ir,dr.text,dr.copy,Gr,Vr]);const _r=B(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-white 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(F(()=>{if(!t)return;const e=e=>{if(Ln[Ln.length-1]!==It)return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Xr&&(e.preventDefault(),p?p():_r("bottom")),"k"===e.key&&Xr&&(e.preventDefault(),f?f():_r("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Xr,_r,It]),!t||pn.current)return null;const Jr=_t?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=rr(),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}}(It):null,Qr=_t&&Jr?Math.min(Jr.w/gn.w,Jr.h/gn.h):1,Zr=(()=>{if(_t&&Jr){const e=Qr,t=gn.w*e,n=gn.h*e,r=Jr.x+(Jr.w-t)/2-gn.x,o=Jr.y+(Jr.h-n)/2-gn.y,i=en||rn;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:D.expose+(i?20:10),boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(on&&Gt){const e="picked"===ln;return{transition:e?"transform 640ms cubic-bezier(0.34, 1.42, 0.64, 1), box-shadow 600ms":"transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms",...e?{zIndex:D.expose+30}:{}}}return null})(),eo=g({modal:!1,titleId:!_&&(Tn?!Be?.home:!we)?Ie:void 0,label:dr.text||Pe}),to=/* @__PURE__ */Q("div",{children:[
50
+ /* @__PURE__ */Q("div",{ref:rt,"data-modal-panel":!0,"data-modal-id":It,"data-window-key":ce||void 0,...U?{"data-utility":""}:{},...$e?{"data-pinned-top":""}:{},..._?{"data-widget":""}:{},...Be?{"data-window-owner":Be.key}:{},...Be&&!gt?{"data-window-root":""}:{},...Tn?{"data-window-tab":""}:{},...eo,className:Tn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(_?Kt?"shadow-xl":"shadow-lg":"border "+(Kt?"shadow-xl border-gray-200":"shadow-lg border-gray-300")),onMouseDownCapture:e=>{if(ot.current=!1,_t){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),$r(It),Ar(!1),void Qn(It)}if(!Kt&&!_&&!$e&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===rt.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),ot.current=!0,je(null),Qn(It),window.addEventListener("mouseup",()=>{setTimeout(()=>{ot.current=!1},0)},{once:!0}))}},onClickCapture:e=>{ot.current&&(ot.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(_t)return;je(null);e.target.closest("[data-modal-panel]")===rt.current&&(e.target.closest("button, input, a, select, textarea")||Qn(It))},style:we?{zIndex:Wt+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${ge}px)`,transition:ve?"none":"transform 180ms ease-out",..._?{display:"none"}:{},...Wt<0?{display:"none"}:{},...Kt||$e||Se&&ce===Se?{}:{display:"none"}}:{zIndex:$e?D.pinnedWindow:Wt+1,width:gn.w,height:gn.h,top:gn.y,..._&&"right"===et?{right:window.innerWidth-gn.x-gn.w}:{left:gn.x},...Wt<0&&!$e?{display:"none"}:{},...ye?{display:"none"}:{},...On||jn?{visibility:"hidden",pointerEvents:"none"}:{},...Zr??{}},children:[we&&!_&&/* @__PURE__ */Z("div",{onPointerDown:Ce,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),_?null:Tn?Be?.home?null:/* @__PURE__ */Q(ee,{children:[
51
+ /* @__PURE__ */Z("h2",{id:Ie,"data-window-title":!0,className:"sr-only",children:dr.text||Pe}),Gr&&Vr&&te(
52
52
  /* @__PURE__ */Z(ee,{children:dr.actions}),Vr),dr.badges.length>0&&/* @__PURE__ */Z("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:dr.badges})]}):we?null:
53
- /* @__PURE__ */Q("div",J?{onPointerDown:Wr,"data-window-chrome":"",...Hr,className:"flex items-center justify-between h-(--row-height-compact-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 "+(Rt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Rt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
54
- /* @__PURE__ */Q("div",{"data-window-title":!0,title:Pe,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Rt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Gt&&Lt(),
55
- /* @__PURE__ */Z("span",{id:Ie,className:"truncate",children:Gt?Zt(Te):Te})]}),!Gt&&/* @__PURE__ */Q("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[U&&/* @__PURE__ */Z("button",{onClick:()=>Oe(e=>!e),title:$e?De.unpin:De.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+($e?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */Z(z,{name:"bookmark-square",className:"h-3 w-3",fill:$e?"currentColor":"none",strokeWidth:1.5})}),
56
- /* @__PURE__ */Z("button",{type:"button",onClick:Nr,"aria-label":De.close,className:"rounded p-0.5 text-gray-400 hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4"})})]})]}:ne?{onPointerDown:Wr,"data-window-chrome":"",...Hr,className:"flex items-center justify-between h-(--row-height-compact-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 "+(Rt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Rt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
57
- /* @__PURE__ */Q("div",{"data-window-title":!0,title:Pe,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Rt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Gt&&Lt(),
58
- /* @__PURE__ */Z("span",{id:Ie,className:"truncate",children:Gt?Zt(Te):Te})]}),!Gt&&/* @__PURE__ */Q("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[U&&/* @__PURE__ */Z("button",{onClick:()=>Oe(e=>!e),title:$e?De.unpin:De.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+($e?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */Z(z,{name:"bookmark-square",className:"h-3 w-3",fill:$e?"currentColor":"none",strokeWidth:1.5})}),
53
+ /* @__PURE__ */Q("div",J?{onPointerDown:Wr,"data-window-chrome":"",...Hr,className:"flex items-center justify-between h-(--row-height-compact-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 "+(Kt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Kt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
54
+ /* @__PURE__ */Q("div",{"data-window-title":!0,title:Pe,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Kt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!_t&&Lt(),
55
+ /* @__PURE__ */Z("span",{id:Ie,className:"truncate",children:_t?Zt(Te):Te})]}),!_t&&/* @__PURE__ */Q("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[U&&/* @__PURE__ */Z("button",{onClick:()=>Oe(e=>!e),title:$e?De.unpin:De.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+($e?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */Z(z,{name:"bookmark-square",className:"h-3 w-3",fill:$e?"currentColor":"none",strokeWidth:1.5})}),
56
+ /* @__PURE__ */Z("button",{type:"button",onClick:Nr,"aria-label":De.close,className:"rounded p-0.5 text-gray-400 hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4"})})]})]}:ne?{onPointerDown:Wr,"data-window-chrome":"",...Hr,className:"flex items-center justify-between h-(--row-height-compact-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 "+(Kt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Kt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
57
+ /* @__PURE__ */Q("div",{"data-window-title":!0,title:Pe,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Kt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!_t&&Lt(),
58
+ /* @__PURE__ */Z("span",{id:Ie,className:"truncate",children:_t?Zt(Te):Te})]}),!_t&&/* @__PURE__ */Q("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[U&&/* @__PURE__ */Z("button",{onClick:()=>Oe(e=>!e),title:$e?De.unpin:De.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+($e?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */Z(z,{name:"bookmark-square",className:"h-3 w-3",fill:$e?"currentColor":"none",strokeWidth:1.5})}),
59
59
  /* @__PURE__ */Z("button",{onClick:()=>Zn(It),title:De.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__ */Z(yr,{maximized:qn,onToggleMax:()=>{qn?(Bn(!1),bn(hn())):Ur()},onSnap:Br,buttonClassName:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",strings:De}),
60
- /* @__PURE__ */Z("button",{type:"button",onClick:Nr,"aria-label":De.close,className:"rounded p-0.5 text-gray-400 hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4"})})]})]}:{onPointerDown:Wr,"data-window-chrome":"",...Hr,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 "+(Rt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Rt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
61
- /* @__PURE__ */Q("div",{"data-window-title":!0,title:Pe,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Rt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Gt&&Lt(),
62
- /* @__PURE__ */Z("span",{id:Ie,className:"truncate",children:Gt?Zt(Te):Te})]}),!Gt&&/* @__PURE__ */Q("div",{className:"flex items-center gap-3 shrink-0 ml-4",children:[U&&/* @__PURE__ */Z("button",{onClick:()=>Oe(e=>!e),title:$e?De.unpin:De.pinOnTop,className:"text-xs px-2 py-1 rounded hover:bg-gray-200 "+($e?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */Z(z,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:$e?"currentColor":"none",strokeWidth:1.5})}),
60
+ /* @__PURE__ */Z("button",{type:"button",onClick:Nr,"aria-label":De.close,className:"rounded p-0.5 text-gray-400 hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4"})})]})]}:{onPointerDown:Wr,"data-window-chrome":"",...Hr,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 "+(Kt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Kt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
61
+ /* @__PURE__ */Q("div",{"data-window-title":!0,title:Pe,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Kt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!_t&&Lt(),
62
+ /* @__PURE__ */Z("span",{id:Ie,className:"truncate",children:_t?Zt(Te):Te})]}),!_t&&/* @__PURE__ */Q("div",{className:"flex items-center gap-3 shrink-0 ml-4",children:[U&&/* @__PURE__ */Z("button",{onClick:()=>Oe(e=>!e),title:$e?De.unpin:De.pinOnTop,className:"text-xs px-2 py-1 rounded hover:bg-gray-200 "+($e?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */Z(z,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:$e?"currentColor":"none",strokeWidth:1.5})}),
63
63
  /* @__PURE__ */Z("button",{onClick:()=>Zn(It),title:De.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!An&&/* @__PURE__ */Z(yr,{maximized:qn,onToggleMax:()=>{qn?(Bn(!1),bn(hn())):Ur()},onSnap:Br,buttonClassName:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",strings:De}),
64
- /* @__PURE__ */Z("button",{type:"button",onClick:Nr,"aria-label":De.close,className:"rounded-(--radius-control) text-gray-400 hover:text-gray-600",children:/* @__PURE__ */Z(z,{name:"close",className:"h-5 w-5"})})]})]}),de&&Ye&&!G&&!we&&/* @__PURE__ */Z("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${Rt?.9:.55})`}}),
65
- /* @__PURE__ */Z(Xt.Provider,{value:It,children:/* @__PURE__ */Z(sn.Provider,{value:{rightRef:at,leftRef:st,notify:()=>ct(!0),active:Rt,isDirty:ir,footerOpen:wt&&!G&&!J&&!ne&&!we},children:/* @__PURE__ */Z("div",{ref:it,...G?{onPointerDown:Wr,onContextMenu:e=>{e.preventDefault(),Ze({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${G?"p-0 cursor-move":ne||re?"p-0":J?"p-2":"p-4"} ${G||Tn?"":"backdrop-blur-sm"} ${!1===k||ne||re?"overflow-hidden":"overflow-y-auto overscroll-contain"} ${G?"rounded-2xl select-none":""}`,style:{...G?{touchAction:"none"}:{},backgroundColor:G?"transparent":Tn?"rgb(var(--window-content-rgb))":Rt?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */Z(Me,{children:he})})})}),G&&Qe&&/* @__PURE__ */Q(M,{minWidth:160,style:{left:Qe.x,top:Qe.y},onClose:()=>Ze(null),children:[
64
+ /* @__PURE__ */Z("button",{type:"button",onClick:Nr,"aria-label":De.close,className:"rounded-(--radius-control) text-gray-400 hover:text-gray-600",children:/* @__PURE__ */Z(z,{name:"close",className:"h-5 w-5"})})]})]}),de&&Ye&&!_&&!we&&/* @__PURE__ */Z("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${Kt?.9:.55})`}}),
65
+ /* @__PURE__ */Z(Xt.Provider,{value:It,children:/* @__PURE__ */Z(sn.Provider,{value:{rightRef:at,leftRef:st,notify:()=>ct(!0),active:Kt,isDirty:ir,footerOpen:wt&&!_&&!J&&!ne&&!we},children:/* @__PURE__ */Z("div",{ref:it,..._?{onPointerDown:Wr,onContextMenu:e=>{e.preventDefault(),Ze({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${_?"p-0 cursor-move":ne||re?"p-0":J?"p-2":"p-4"} ${_||Tn?"":"backdrop-blur-sm"} ${!1===b||ne||re?"overflow-hidden":"overflow-y-auto overscroll-contain"} ${_?"rounded-2xl select-none":""}`,style:{..._?{touchAction:"none"}:{},backgroundColor:_?"transparent":Tn?"rgb(var(--window-content-rgb))":Kt?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */Z(Me,{children:he})})})}),_&&Qe&&/* @__PURE__ */Q(M,{minWidth:160,style:{left:Qe.x,top:Qe.y},onClose:()=>Ze(null),children:[
66
66
  /* @__PURE__ */Z(N,{onClick:()=>{Ze(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:It}))},children:"Settings"}),
67
67
  /* @__PURE__ */Z(S,{}),se&&/* @__PURE__ */Q(ee,{children:[se,
68
68
  /* @__PURE__ */Z(S,{})]}),
@@ -70,12 +70,12 @@ return Q("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u,
70
70
  /* @__PURE__ */Z("span",{className:"flex-1",children:"Always on Top"}),$e&&/* @__PURE__ */Z(z,{name:"check",className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
71
71
  /* @__PURE__ */Z(S,{}),
72
72
  /* @__PURE__ */Z(N,{onClick:()=>{Ze(null),Nr()},children:"Close"})]}),
73
- /* @__PURE__ */Q("div",{onPointerDown:Wr,ref:ut,"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"}${Rt&&!Tn?" backdrop-blur-sm":""}${G||J||ne||we||!wt?" hidden":""}`,style:{touchAction:"none",backgroundColor:Tn?"rgb(var(--window-footer-rgb))":Rt?"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__ */Q("div",{onPointerDown:Wr,ref:ut,"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"}${Kt&&!Tn?" backdrop-blur-sm":""}${_||J||ne||we||!wt?" hidden":""}`,style:{touchAction:"none",backgroundColor:Tn?"rgb(var(--window-footer-rgb))":Kt?"rgb(var(--window-footer-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-footer-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
74
74
  /* @__PURE__ */Q("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[kt&&/* @__PURE__ */Z(Le,{auto:!0}),A,
75
75
  /* @__PURE__ */Z("div",{ref:st,"data-modal-actions-left":!0,className:"flex items-center gap-2 shrink-0"}),null!=w&&!1!==w&&
76
76
  /* @__PURE__ */Z("div",{ref:dt,"data-modal-footer-facts":"",className:"min-w-0 flex-1 overflow-hidden",children:/* @__PURE__ */Z("div",{ref:ht,className:"inline-flex items-center gap-2 whitespace-nowrap"+(mt?" invisible":""),children:w})})]}),
77
- /* @__PURE__ */Q("div",{"data-modal-footer-right":"",className:"flex items-center gap-2 ml-auto shrink-0",children:[ft&&R&&(R.editing?/* @__PURE__ */Z(T,{variant:"secondary",size:"sm","data-modal-discard":"",onClick:()=>{Sr()},children:De.discard}):"object"==typeof R.state?/* @__PURE__ */Z(T,{variant:"secondary",size:"sm","data-modal-edit":"","aria-disabled":!0,disabledReason:R.state.disabledReason,children:De.edit}):/* @__PURE__ */Z(T,{variant:"secondary",size:"sm","data-modal-edit":"",onClick:()=>R.onEdit(),children:De.edit})),
78
- /* @__PURE__ */Z("div",{ref:at,"data-modal-actions":!0,className:"flex items-center gap-2"}),L]})]}),!G&&!we&&!Gt&&Rt&&!An&&/* @__PURE__ */Q(ee,{children:[
77
+ /* @__PURE__ */Q("div",{"data-modal-footer-right":"",className:"flex items-center gap-2 ml-auto shrink-0",children:[ft&&K&&(K.editing?/* @__PURE__ */Z(T,{variant:"secondary",size:"sm","data-modal-discard":"",onClick:()=>{Sr()},children:De.discard}):"object"==typeof K.state?/* @__PURE__ */Z(T,{variant:"secondary",size:"sm","data-modal-edit":"","aria-disabled":!0,disabledReason:K.state.disabledReason,children:De.edit}):/* @__PURE__ */Z(T,{variant:"secondary",size:"sm","data-modal-edit":"",onClick:()=>K.onEdit(),children:De.edit})),
78
+ /* @__PURE__ */Z("div",{ref:at,"data-modal-actions":!0,className:"flex items-center gap-2"}),L]})]}),!_&&!we&&!_t&&Kt&&!An&&/* @__PURE__ */Q(ee,{children:[
79
79
  /* @__PURE__ */Z("div",{onPointerDown:e=>Or(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
80
80
  /* @__PURE__ */Z("div",{onPointerDown:e=>Or(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
81
81
  /* @__PURE__ */Z("div",{onPointerDown:e=>Or(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
@@ -83,18 +83,18 @@ return Q("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u,
83
83
  /* @__PURE__ */Z("div",{onPointerDown:e=>Or(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
84
84
  /* @__PURE__ */Z("div",{onPointerDown:e=>Or(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
85
85
  /* @__PURE__ */Z("div",{onPointerDown:e=>Or(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
86
- /* @__PURE__ */Z("div",{onPointerDown:e=>Or(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),Gt&&/* @__PURE__ */Z("div",{className:"absolute inset-0",style:{zIndex:D.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>tn(!0),onMouseLeave:()=>tn(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),Qn(It),Ar(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:en&&/* @__PURE__ */Z("button",{type:"button","data-expose-close":!0,"aria-label":Ae.taskbar.closeWindow,title:"Close",className:"absolute flex items-center justify-center rounded-full bg-black/55 text-white 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/Qr})`,transformOrigin:"top right",zIndex:D.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),Nr()},children:/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),Gt&&Jr&&/* @__PURE__ */Z("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:Jr.x,top:Jr.y+Jr.h+4,width:Jr.w,zIndex:D.expose+(en?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:Zt(Te)})]}),no=Fe&&/* @__PURE__ */Q(M,{style:{left:Fe.x,top:Fe.y},onClose:()=>je(null),minWidth:160,children:[!G&&!J&&!Tn&&/* @__PURE__ */Q(ee,{children:[
86
+ /* @__PURE__ */Z("div",{onPointerDown:e=>Or(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),_t&&/* @__PURE__ */Z("div",{className:"absolute inset-0",style:{zIndex:D.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>tn(!0),onMouseLeave:()=>tn(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),Qn(It),Ar(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:en&&/* @__PURE__ */Z("button",{type:"button","data-expose-close":!0,"aria-label":Ae.taskbar.closeWindow,title:"Close",className:"absolute flex items-center justify-center rounded-full bg-black/55 text-white 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/Qr})`,transformOrigin:"top right",zIndex:D.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),Nr()},children:/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),_t&&Jr&&/* @__PURE__ */Z("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:Jr.x,top:Jr.y+Jr.h+4,width:Jr.w,zIndex:D.expose+(en?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:Zt(Te)})]}),no=Fe&&/* @__PURE__ */Q(M,{style:{left:Fe.x,top:Fe.y},onClose:()=>je(null),minWidth:160,children:[!_&&!J&&!Tn&&/* @__PURE__ */Q(ee,{children:[
87
87
  /* @__PURE__ */Q(N,{onClick:()=>{Zn(It),je(null)},children:[
88
88
  /* @__PURE__ */Z(z,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),De.minimize]}),!An&&/* @__PURE__ */Q(N,qn?{onClick:()=>{Bn(!1),bn(hn()),je(null)},children:[
89
89
  /* @__PURE__ */Z("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Z("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 4.5v15m6-15v15M4.5 9h15M4.5 15h15"})}),De.windowed]}:{onClick:()=>{Ur(),je(null)},children:[
90
90
  /* @__PURE__ */Z(z,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),De.maximize]})]}),U&&!Tn&&/* @__PURE__ */Q(N,{onClick:()=>{Oe(e=>!e),je(null)},children:[
91
91
  /* @__PURE__ */Z(z,{name:"bookmark-square",className:"h-4 w-4 "+($e?"text-blue-600":""),fill:$e?"currentColor":"none",strokeWidth:1.5}),$e?De.unpin:De.pinOnTop]}),qe&&/* @__PURE__ */Q(N,{onClick:()=>{je(null),Je()},children:[
92
- /* @__PURE__ */Z(z,{name:"star",className:"h-4 w-4",fill:Ge?"currentColor":"none",strokeWidth:1.5}),Ge?Ae.taskbar.removeFromDesktop:Ae.taskbar.addToDesktop]}),(nn[It]||[]).length>0&&/* @__PURE__ */Z(ee,{children:(nn[It]||[]).map((e,t)=>/* @__PURE__ */Q(N,{onClick:()=>{je(null),e.onClick()},children:[e.icon,e.label]},t))}),!(Tn&&Be?.home)&&/* @__PURE__ */Q(ee,{children:[
92
+ /* @__PURE__ */Z(z,{name:"star",className:"h-4 w-4",fill:_e?"currentColor":"none",strokeWidth:1.5}),_e?Ae.taskbar.removeFromDesktop:Ae.taskbar.addToDesktop]}),(nn[It]||[]).length>0&&/* @__PURE__ */Z(ee,{children:(nn[It]||[]).map((e,t)=>/* @__PURE__ */Q(N,{onClick:()=>{je(null),e.onClick()},children:[e.icon,e.label]},t))}),!(Tn&&Be?.home)&&/* @__PURE__ */Q(ee,{children:[
93
93
  /* @__PURE__ */Z(S,{}),
94
94
  /* @__PURE__ */Q(N,{danger:!0,onClick:()=>{je(null),Nr()},children:[
95
- /* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4"}),De.close]})]})]}),ro=!!ce&&Pt.some(e=>e.id===ce),oo=!qt||ro||G?null:/* @__PURE__ */Q("div",{"data-modal-restore-tab":!0,"data-modal-id":It,className:"fixed left-1/2 z-(--z-restore-tab) flex -translate-x-1/2 items-center gap-1 rounded-lg border border-gray-300 bg-white px-2 py-1 shadow-lg",style:{bottom:"calc(var(--taskbar-height, 0px) + 12px)"},children:[
95
+ /* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4"}),De.close]})]})]}),ro=!!ce&&Pt.some(e=>e.id===ce),oo=!qt||ro||_?null:/* @__PURE__ */Q("div",{"data-modal-restore-tab":!0,"data-modal-id":It,className:"fixed left-1/2 z-(--z-restore-tab) flex -translate-x-1/2 items-center gap-1 rounded-lg border border-gray-300 bg-white px-2 py-1 shadow-lg",style:{bottom:"calc(var(--taskbar-height, 0px) + 12px)"},children:[
96
96
  /* @__PURE__ */Z("button",{type:"button",onClick:()=>Qn(It),title:De.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:Pe||De.windowSuffix}),
97
97
  /* @__PURE__ */Z("button",{type:"button",onClick:()=>Qn(It),title:De.restore,"aria-label":De.restore,className:"rounded px-2 py-0.5 text-xs leading-none text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:"▴"}),
98
98
  /* @__PURE__ */Z("button",{type:"button",onClick:()=>{Nr()},title:De.close,"aria-label":De.close,className:"rounded px-2 py-0.5 text-xs leading-none text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:"✕"})]});return te(
99
- /* @__PURE__ */Q(Vt.Provider,{value:null,children:[to,no,oo]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{Sr&&"Escape"===e.key&&(Br(null),Ar(!1))});var Vr=100,_r={past:[],future:[]};function Gr(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>Vr?r.slice(r.length-Vr):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:_r}}var Jr=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var Qr=500,Zr=250;function eo({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,a]=G(Gr,_r),s=O(/* @__PURE__ */new Map),[l,c]=j(0),u=l>0,[d,h]=j(0),[m,p]=j(0),f=m>0,{hasAnyPerm:w}=i(),y=t&&0===d&&(!(n&&n.length>0)||w(n)),g=O(null),b=O(!1),v=B(()=>{const e={};for(const[t,n]of s.current)e[t]=n.getLast();return e},[]),x=B((e,t)=>{s.current.has(e)||c(e=>e+1),s.current.set(e,t)},[]),k=B(e=>{s.current.delete(e)&&c(e=>e-1)},[]),E=B(e=>{h(t=>t+(e?1:-1))},[]),C=B(e=>{p(t=>t+(e?1:-1))},[]),[M,N]=j(0),S=M>0,L=B(e=>{N(t=>t+(e?1:-1))},[]),T=K(Ne),z=T?.claimReadOnly;F(()=>{if(z&&!y)return z(!0),()=>z(!1)},[z,y]);const A=T?.claimOwnMount;F(()=>{if(A&&S)return A(!0),()=>A(!1)},[A,S]);const D=O({last:0,count:0,tripped:!1}),P=O(!1),I=B((e,t,n)=>{if(b.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(!y||g.current)return;const r=D.current;if(r.tripped)return;const o=Date.now();if(o-r.last>Zr&&(r.count=0),r.last=o,++r.count>Qr)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${Qr} 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.`);g.current={values:v(),label:e,coalesceKey:t},queueMicrotask(()=>{const e=g.current;g.current=null,e&&a({type:"record",step:e})})},[y,v]),W=B(e=>{for(const[t,n]of Object.entries(e)){const e=s.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),R=B(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};W(e.values),a({type:"undo",redoStep:t})},[o.past,v,W]),$=B(()=>{const e=o.future[0];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};W(e.values),a({type:"redo",undoStep:t})},[o.future,v,W]),[q,H]=j(0),U=O(0),Y=O(0),X=O(!1),_=B(()=>{b.current=!0,P.current=!1,g.current=null,U.current+=1,Y.current=U.current,H(U.current)},[]),J=O(void 0),ee=B(e=>{void 0!==e&&(void 0!==J.current&&e!==J.current&&(X.current=!0),J.current=e),_()},[_]);F(()=>{b.current&&q===Y.current&&(b.current=!1,g.current=null,(P.current||X.current)&&a({type:"clear"}),P.current=!1,X.current=!1)},[q]);const te=B(()=>{X.current=!0,a({type:"clear"}),_()},[_]),ne=y&&o.past.length>0,re=y&&o.future.length>0,oe=Nr(r),ie=O({undo:R,redo:$,canUndo:ne,canRedo:re});ie.current={undo:R,redo:$,canUndo:ne,canRedo:re},F(()=>{if(!oe||!y)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&&Jr.has(r.tagName.toUpperCase())?null:n}(e);if(!t)return;const n=ie.current;("undo"===t?n.canUndo:n.canRedo)&&(e.preventDefault(),"undo"===t?n.undo():n.redo())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[oe,y]);const ae=V(()=>({register:x,unregister:k,record:I,undo:R,redo:$,clear:te,baseline:ee,canUndo:ne,canRedo:re,enabled:y,hasState:u,handMounted:S,claimOwnMount:L,claimReadOnly:E,declaredEditable:f,claimEditable:C,undoLabel:ne?o.past[o.past.length-1].label:null,redoLabel:re?o.future[0].label:null}),[x,k,I,R,$,te,ee,ne,re,y,u,S,L,E,f,C,o.past,o.future]),se=""!==ln(),le=K(sn)?.footerOpen??!1,ce=se&&y&&u&&!S&&le;/* @__PURE__ */
100
- return Q(Ne.Provider,{value:ae,children:[ce&&/* @__PURE__ */Z(un,{position:"left",quiet:!0,children:/* @__PURE__ */Z(Le,{auto:!0})}),e]})}function to(){const e=K(Ne),t=B(()=>{},[]);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 no(e){const t=K(Ne),n=t?.claimReadOnly,r=t?.claimEditable;F(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function ro(e,t,n){const r=K(Ne),o=_(),i=O(e),a=O(t);a.current=t,F(()=>{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=O(r);c.current=r;const u=O({label:s,coalesceKey:l});u.current={label:s,coalesceKey:l},F(()=>{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 oo(e,t){const[n,r]=j(e);return ro(n,e=>r(()=>e),t),[n,r]}export{dn as CancelButton,Qe as DocFavStar,Fe as EntityWindowFallback,$e as EntityWindowLoading,je as EntityWindowState,Qt as KEY_ACTIVATED_SELECTOR,Ke as LoadingSpinner,Jt as MODAL_SUBMIT_SELECTOR,Xr as Modal,un as ModalActions,Le as UndoControls,eo as UndoProvider,ce as WINDOW_REGISTRY,Ce as WindowCrashedFallback,Me as WindowErrorBoundary,bt as WindowManagerProvider,on as WindowTitle,ot as activateWindowById,Dt as beginWindowGesture,Vn as cancelWindowFront,pe as client_default,Hr as commitExposeHighlight,Xn as confirmWindowDiscard,Pt as drainPerfEvents,Pr as exitExposeMode,En as forgetMaximizedWindowBoxes,Er as getActiveModalId,st as getActiveWindowRoute,qr as getExposeHighlight,Yt as getWindowChromeVersion,xn as getWindowPosition,Be as isDraftEntityId,He as isDraftEntityWindow,ae as isEntityEntry,ie as isPageEntry,he as isShellApiClientConfigured,Pe as isTabWindow,At as markMenuOpen,Ht as readWindowChrome,Hn as requestWindowFront,Br as setExposeHighlight,zt as setPerfCollecting,de as setShellApiClient,be as setShellHomeRoute,Ee as setShellTabStrip,le as setShellWindowRegistry,vn as setWindowDefaultPosition,kn as setWindowPosition,$t as splitTitle,jr as subscribeExposeHighlight,Ut as subscribeWindowChrome,Ie as tabGroupOf,Dr as toggleExposeMode,Fn as useCurrentTabKey,ln as useEnclosingModalId,Nr as useIsActiveWindow,cn as useModalActive,we as usePageSearch,to as useUndo,no as useUndoCanEdit,ro as useUndoable,oo as useUndoableState,tn as useWidgetSettings,Xe as useWindowDirty,_e as useWindowManager,rn as useWindowMenuItem,an as useWindowTitle,Yn as windowHoldsChanges};
99
+ /* @__PURE__ */Q(Vt.Provider,{value:null,children:[to,no,oo]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{Sr&&"Escape"===e.key&&(Br(null),Ar(!1))});var Vr=100,Gr={past:[],future:[]};function _r(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>Vr?r.slice(r.length-Vr):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:Gr}}var Jr=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var Qr=500,Zr=250;function eo({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,a]=_(_r,Gr),s=O(/* @__PURE__ */new Map),[l,c]=j(0),u=l>0,[d,h]=j(0),[m,p]=j(0),f=m>0,{hasAnyPerm:w}=i(),y=t&&0===d&&(!(n&&n.length>0)||w(n)),g=O(null),b=O(!1),v=B(()=>{const e={};for(const[t,n]of s.current)e[t]=n.getLast();return e},[]),x=B((e,t)=>{s.current.has(e)||c(e=>e+1),s.current.set(e,t)},[]),k=B(e=>{s.current.delete(e)&&c(e=>e-1)},[]),E=B(e=>{h(t=>t+(e?1:-1))},[]),C=B(e=>{p(t=>t+(e?1:-1))},[]),[M,N]=j(0),S=M>0,L=B(e=>{N(t=>t+(e?1:-1))},[]),T=R(Ne),z=T?.claimReadOnly;F(()=>{if(z&&!y)return z(!0),()=>z(!1)},[z,y]);const A=T?.claimOwnMount;F(()=>{if(A&&S)return A(!0),()=>A(!1)},[A,S]);const D=O({last:0,count:0,tripped:!1}),P=O(!1),I=B((e,t,n)=>{if(b.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(!y||g.current)return;const r=D.current;if(r.tripped)return;const o=Date.now();if(o-r.last>Zr&&(r.count=0),r.last=o,++r.count>Qr)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${Qr} 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.`);g.current={values:v(),label:e,coalesceKey:t},queueMicrotask(()=>{const e=g.current;g.current=null,e&&a({type:"record",step:e})})},[y,v]),W=B(e=>{for(const[t,n]of Object.entries(e)){const e=s.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),K=B(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};W(e.values),a({type:"undo",redoStep:t})},[o.past,v,W]),$=B(()=>{const e=o.future[0];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};W(e.values),a({type:"redo",undoStep:t})},[o.future,v,W]),[q,H]=j(0),U=O(0),Y=O(0),X=O(!1),G=B(()=>{b.current=!0,P.current=!1,g.current=null,U.current+=1,Y.current=U.current,H(U.current)},[]),J=O(void 0),ee=B(e=>{void 0!==e&&(void 0!==J.current&&e!==J.current&&(X.current=!0),J.current=e),G()},[G]);F(()=>{b.current&&q===Y.current&&(b.current=!1,g.current=null,(P.current||X.current)&&a({type:"clear"}),P.current=!1,X.current=!1)},[q]);const te=B(()=>{X.current=!0,a({type:"clear"}),G()},[G]),ne=y&&o.past.length>0,re=y&&o.future.length>0,oe=Nr(r),ie=O({undo:K,redo:$,canUndo:ne,canRedo:re});ie.current={undo:K,redo:$,canUndo:ne,canRedo:re},F(()=>{if(!oe||!y)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&&Jr.has(r.tagName.toUpperCase())?null:n}(e);if(!t)return;const n=ie.current;("undo"===t?n.canUndo:n.canRedo)&&(e.preventDefault(),"undo"===t?n.undo():n.redo())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[oe,y]);const ae=V(()=>({register:x,unregister:k,record:I,undo:K,redo:$,clear:te,baseline:ee,canUndo:ne,canRedo:re,enabled:y,hasState:u,handMounted:S,claimOwnMount:L,claimReadOnly:E,declaredEditable:f,claimEditable:C,undoLabel:ne?o.past[o.past.length-1].label:null,redoLabel:re?o.future[0].label:null}),[x,k,I,K,$,te,ee,ne,re,y,u,S,L,E,f,C,o.past,o.future]),se=""!==ln(),le=R(sn)?.footerOpen??!1,ce=se&&y&&u&&!S&&le;/* @__PURE__ */
100
+ return Q(Ne.Provider,{value:ae,children:[ce&&/* @__PURE__ */Z(un,{position:"left",quiet:!0,children:/* @__PURE__ */Z(Le,{auto:!0})}),e]})}function to(){const e=R(Ne),t=B(()=>{},[]);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 no(e){const t=R(Ne),n=t?.claimReadOnly,r=t?.claimEditable;F(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function ro(e,t,n){const r=R(Ne),o=G(),i=O(e),a=O(t);a.current=t,F(()=>{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=O(r);c.current=r;const u=O({label:s,coalesceKey:l});u.current={label:s,coalesceKey:l},F(()=>{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 oo(e,t){const[n,r]=j(e);return ro(n,e=>r(()=>e),t),[n,r]}export{dn as CancelButton,Qe as DocFavStar,Fe as EntityWindowFallback,$e as EntityWindowLoading,je as EntityWindowState,Qt as KEY_ACTIVATED_SELECTOR,Re as LoadingSpinner,Jt as MODAL_SUBMIT_SELECTOR,Xr as Modal,un as ModalActions,Le as UndoControls,eo as UndoProvider,ce as WINDOW_REGISTRY,Ce as WindowCrashedFallback,Me as WindowErrorBoundary,bt as WindowManagerProvider,on as WindowTitle,ot as activateWindowById,Dt as beginWindowGesture,Vn as cancelWindowFront,pe as client_default,Hr as commitExposeHighlight,Xn as confirmWindowDiscard,Pt as drainPerfEvents,Pr as exitExposeMode,En as forgetMaximizedWindowBoxes,Er as getActiveModalId,st as getActiveWindowRoute,qr as getExposeHighlight,Yt as getWindowChromeVersion,xn as getWindowPosition,Be as isDraftEntityId,He as isDraftEntityWindow,ae as isEntityEntry,ie as isPageEntry,he as isShellApiClientConfigured,Pe as isTabWindow,At as markMenuOpen,Ht as readWindowChrome,Hn as requestWindowFront,Br as setExposeHighlight,zt as setPerfCollecting,de as setShellApiClient,be as setShellHomeRoute,Ee as setShellTabStrip,le as setShellWindowRegistry,vn as setWindowDefaultPosition,kn as setWindowPosition,$t as splitTitle,jr as subscribeExposeHighlight,Ut as subscribeWindowChrome,Ie as tabGroupOf,Dr as toggleExposeMode,Fn as useCurrentTabKey,ln as useEnclosingModalId,Nr as useIsActiveWindow,cn as useModalActive,we as usePageSearch,to as useUndo,no as useUndoCanEdit,ro as useUndoable,oo as useUndoableState,tn as useWidgetSettings,Xe as useWindowDirty,Ge as useWindowManager,rn as useWindowMenuItem,an as useWindowTitle,Yn as windowHoldsChanges};
@@ -1,3 +1,3 @@
1
- import{mediaMoveSubmenu as e}from"./chunk-DFDDRKIJ.js";import{optionNoteClass as n}from"./chunk-QR4RM7PO.js";import{Icon as r}from"./chunk-KIBL6M3T.js";import{jsxs as d,jsx as l}from"react/jsx-runtime";var a={folder:/* @__PURE__ */l(r,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),"folder-plus":/* @__PURE__ */l(r,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */l(r,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */l(r,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */l(r,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */l(r,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */l(r,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */l(r,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},o=e=>a[e];function i(e,r){return r?/* @__PURE__ */d("span",{className:"flex min-w-0 flex-col",children:[
1
+ import{mediaMoveSubmenu as e}from"./chunk-DFDDRKIJ.js";import{optionNoteClass as n}from"./chunk-QR4RM7PO.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{jsxs as d,jsx as l}from"react/jsx-runtime";var a={folder:/* @__PURE__ */l(r,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),"folder-plus":/* @__PURE__ */l(r,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */l(r,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */l(r,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */l(r,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */l(r,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */l(r,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */l(r,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},o=e=>a[e];function i(e,r){return r?/* @__PURE__ */d("span",{className:"flex min-w-0 flex-col",children:[
2
2
  /* @__PURE__ */l("span",{children:e}),
3
3
  /* @__PURE__ */l("span",{className:n(),children:r})]}):e}function t(n,r){const{words:d,denied:l}=r,a=[],t=(e,n,r,d={})=>{if(!r)return;const o=d.deny?l[d.deny]:void 0;a.push({key:e,label:i(n,o),icon:d.icon,danger:d.danger,disabled:!!o||!!d.off,onSelect:r})},c=(n,d,i,t)=>{const c=r.move;c&&a.push(e({count:d,kind:i,head:t,icon:o("folder"),disabled:!!l.move,targets:r.moveTargets(n),onPick:e=>c(n,e.key===s?null:e.key)},r.media))},h=e=>{a.length&&a.push({type:"divider",key:e})};switch(n.kind){case"folder":{const e={kind:"folder",id:n.id};if(t("new",d.newSubfolder,r.newSubfolder&&(()=>r.newSubfolder(n.id)),{icon:o("folder-plus"),deny:"newFolder"}),t("rename",d.rename,r.rename&&(()=>r.rename({kind:"folder",id:n.id})),{icon:o("edit"),deny:"rename"}),c(e,1,"file",!1),r.deleteFolder){h("d-delete");const e=!l.deleteFolder&&!!r.folderNotEmpty?.(n.id);a.push({key:"delete-folder",label:i(d.deleteFolder,l.deleteFolder??(e?d.folderNotEmpty:void 0)),icon:o("trash"),danger:!0,disabled:!!l.deleteFolder||e,onSelect:()=>r.deleteFolder(n.id)})}return a}case"files":{const{ids:e}=n,l=1===e.length,i={kind:"files",ids:e};l||a.push({type:"label",key:"count",label:d.filesSelected(e.length)}),c(i,e.length,r.kindOf(e),!0),t("rename",d.rename,r.rename&&(()=>r.rename({kind:"file",id:e[0]})),{icon:o("edit"),deny:"rename",off:!l}),t("replace",d.replace,r.replace&&(()=>r.replace(e[0])),{icon:o("swap"),deny:"replace",off:!l}),t("copy",d.copyUrl,()=>r.copyUrl(e[0]),{icon:o("copy"),off:!l});const s=l?r.urlOf(e[0]):void 0;return s&&a.push({type:"link",key:"open",label:d.openOriginal,href:s,icon:o("external")}),r.trash&&(h("d-trash"),t("trash",l?d.moveToTrash:d.moveFilesToTrash(e.length),()=>r.trash(i),{icon:o("trash"),danger:!0,deny:"trash"})),a}case"trashed":{const{ids:e}=n;return e.length>1&&a.push({type:"label",key:"count",label:d.filesSelected(e.length)}),t("restore",d.restore,r.restore&&(()=>r.restore(e)),{icon:o("undo"),deny:"restore"}),r.deleteForever&&(h("d-delete"),t("delete",d.deleteForever,()=>r.deleteForever(e),{icon:o("trash"),danger:!0,deny:"deleteForever"})),a}case"product-node":case"render":return a.push({type:"label",key:"read-only",label:d.readOnlyMenu}),t("design",d.openInDesign,r.openInDesign&&(()=>r.openInDesign({kind:n.kind,id:n.id})),{icon:o("external")}),"render"===n.kind&&t("copy",d.copyUrl,()=>r.copyUrl(n.id),{icon:o("copy")}),a;default:return a}}var s="__all-files__";export{s as ROOT_KEY,t as mediaLibraryMenu};