efficient-shell 10.17.1 → 10.20.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.
- package/dist/{Browser-4B76MFTG.js → Browser-3BZPV4OH.js} +14 -14
- package/dist/Calculator-6NJNSIRN.js +29 -0
- package/dist/{CurrencyConverter-36BFSFRS.js → CurrencyConverter-42IHLJVV.js} +8 -8
- package/dist/{Documents-VKAMBKSP.js → Documents-N2OS46II.js} +24 -24
- package/dist/Files-6MMOX77N.js +88 -0
- package/dist/{Notepad-AQXGH6VP.js → Notepad-QSF2MA3I.js} +9 -9
- package/dist/{PomodoroTimer-RHDLKJBY.js → PomodoroTimer-PD7POYX5.js} +20 -20
- package/dist/{Preview-DEBTZQP5.js → Preview-YJPVKRQU.js} +51 -51
- package/dist/Sidebar-2HHICMZZ.js +44 -0
- package/dist/{Spreadsheet-FSHLWXYP.js → Spreadsheet-3P3BL6CS.js} +9 -9
- package/dist/{Stock-CV53A432.js → Stock-IABQRSXZ.js} +3 -3
- package/dist/{Weather-R4MCLH7F.js → Weather-4QPYOENN.js} +22 -22
- package/dist/{WorldClock-CSFPCZHU.js → WorldClock-3ZVRBLEW.js} +6 -6
- package/dist/ai/index.d.ts +20 -4
- package/dist/ai/index.js +91 -81
- package/dist/ai.css +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/ChartTooltip.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/chunk-22RQC4EW.js +20 -0
- package/dist/chunk-2H6YNMBE.js +14 -0
- package/dist/chunk-2UVMNA5W.js +4 -0
- package/dist/{chunk-XTV3CAV7.js → chunk-2VGQS6CW.js} +1 -1
- package/dist/{chunk-5VAIVRK6.js → chunk-2YSGXZOL.js} +48 -48
- package/dist/{chunk-SQCUN2DX.js → chunk-34URULVW.js} +1 -1
- package/dist/{chunk-5LCDCO46.js → chunk-3ELLBQPS.js} +1 -1
- package/dist/chunk-3FGPFDDK.js +2 -0
- package/dist/{chunk-NZQCDFDG.js → chunk-3NW5LD7D.js} +3 -3
- package/dist/{chunk-IX7QXMNJ.js → chunk-3PR5YMWZ.js} +1 -1
- package/dist/{chunk-ILP7QVW5.js → chunk-3UXXA2CS.js} +8 -8
- package/dist/{chunk-5IPFQV34.js → chunk-43L5K2IX.js} +2 -2
- package/dist/{chunk-NRI26RYC.js → chunk-4HBSQGRI.js} +2 -2
- package/dist/{chunk-BZUA5F33.js → chunk-4UKGVLFP.js} +1 -1
- package/dist/{chunk-3VLG6LR3.js → chunk-4WEFGKJL.js} +4 -4
- package/dist/{chunk-UABVKJK7.js → chunk-54NMFQMW.js} +1 -1
- package/dist/{chunk-IDV32UV7.js → chunk-5HO53ZE7.js} +26 -26
- package/dist/chunk-5LBPBT7U.js +4 -0
- package/dist/{chunk-U32J7D4Q.js → chunk-5QGBVTGS.js} +2 -2
- package/dist/{chunk-BE777IO7.js → chunk-5SIOCKCK.js} +2 -2
- package/dist/{chunk-D6OYQM4V.js → chunk-5TDQPZDB.js} +5 -5
- package/dist/chunk-5TQLUPZD.js +6 -0
- package/dist/{chunk-AEJYSUVQ.js → chunk-5WYRAJ5F.js} +1 -1
- package/dist/chunk-67MQ5S32.js +8 -0
- package/dist/chunk-6CBF7UQ2.js +2 -0
- package/dist/chunk-6JSXIEH2.js +4 -0
- package/dist/chunk-6LNNBA3T.js +2 -0
- package/dist/{chunk-Q3IR5SKD.js → chunk-6XBWM453.js} +1 -1
- package/dist/{chunk-L2RS2UQM.js → chunk-77AQNJE2.js} +1 -1
- package/dist/chunk-77MOYIQW.js +15 -0
- package/dist/chunk-7INZ7O3A.js +5 -0
- package/dist/{chunk-G4JTO5PB.js → chunk-7JGR7WPD.js} +1 -1
- package/dist/{chunk-3PR7FLTZ.js → chunk-7VBXIIEC.js} +2 -2
- package/dist/{chunk-MAFSELZK.js → chunk-A42MKJA3.js} +1 -1
- package/dist/{chunk-SOJEQHZ2.js → chunk-AYDW63LV.js} +1 -1
- package/dist/chunk-BTFBXZS2.js +1 -0
- package/dist/{chunk-XCAO2F3H.js → chunk-C6Y7B73Q.js} +1 -1
- package/dist/{chunk-EC527NE3.js → chunk-DCRLJMQ6.js} +1 -1
- package/dist/chunk-DESWIPOZ.js +3 -0
- package/dist/{chunk-WWLKVGV7.js → chunk-DGZAQXTW.js} +4 -4
- package/dist/{chunk-TLWGOQI3.js → chunk-DHIQ46C5.js} +3 -3
- package/dist/chunk-DHKRXHJN.js +1 -0
- package/dist/chunk-DYNJ2H6R.js +8 -0
- package/dist/chunk-E5G2RURY.js +2 -0
- package/dist/chunk-EJUNGVK2.js +22 -0
- package/dist/{chunk-CNUHLJYD.js → chunk-EPY34L26.js} +1 -1
- package/dist/chunk-ESDSE6HY.js +2 -0
- package/dist/{chunk-XKJ7GEVA.js → chunk-FACWYKL6.js} +6 -6
- package/dist/{chunk-ZI3DGOW6.js → chunk-FKRPQDFX.js} +16 -16
- package/dist/chunk-FMHHOXML.js +2 -0
- package/dist/{chunk-HS2E7DVI.js → chunk-FOFZI62F.js} +1 -1
- package/dist/{chunk-Q5QS5MFX.js → chunk-FS6EOU4G.js} +1 -1
- package/dist/{chunk-RBEI4CKX.js → chunk-FTF6JKD5.js} +5 -5
- package/dist/{chunk-WZ5QSSUM.js → chunk-G4GVLK44.js} +6 -6
- package/dist/{chunk-K7L3ZCPB.js → chunk-GEP4FROW.js} +3 -3
- package/dist/chunk-GFYIVFX2.js +2 -0
- package/dist/{chunk-5N5AAYQV.js → chunk-GISDIVFK.js} +1 -1
- package/dist/{chunk-NZGNOMWX.js → chunk-GMOEYB4X.js} +11 -11
- package/dist/chunk-GZ7XQBCG.js +2 -0
- package/dist/chunk-H5FRVS4Y.js +4 -0
- package/dist/chunk-H62WUDPO.js +2 -0
- package/dist/chunk-HFAOJ4OJ.js +2 -0
- package/dist/chunk-HUA3TGMM.js +1 -0
- package/dist/{chunk-VHPT7ZS5.js → chunk-HV47GP2C.js} +5 -5
- package/dist/{chunk-TIGTIT3L.js → chunk-I33SVQ7P.js} +6 -6
- package/dist/chunk-I4VIEGCX.js +2 -0
- package/dist/chunk-I6DN2I6O.js +4 -0
- package/dist/chunk-IS6FC32P.js +2 -0
- package/dist/chunk-JIGFR7Z3.js +11 -0
- package/dist/{chunk-YG6Y5X7S.js → chunk-JNQKBN5M.js} +5 -5
- package/dist/chunk-JNSMBHNH.js +2 -0
- package/dist/{chunk-QEB2UTHO.js → chunk-JYIH2EBG.js} +7 -7
- package/dist/{chunk-2EVTN26H.js → chunk-K4JQ3FQI.js} +2 -2
- package/dist/chunk-K5VNHEVL.js +2 -0
- package/dist/chunk-LAO5ZHQ6.js +14 -0
- package/dist/chunk-LE2UGKUT.js +4 -0
- package/dist/{chunk-QJLBBDX2.js → chunk-LYHJHUQH.js} +1 -1
- package/dist/chunk-MJGK6QTO.js +7 -0
- package/dist/{chunk-LAMRQE2P.js → chunk-MNNZGO2E.js} +1 -1
- package/dist/{chunk-S5SRXI4V.js → chunk-MVZRZTQP.js} +1 -1
- package/dist/{chunk-MMQ6ETRD.js → chunk-N67QX3WW.js} +2 -2
- package/dist/{chunk-3TKMH5VR.js → chunk-N6CS2FO2.js} +1 -1
- package/dist/{chunk-FEATDGFD.js → chunk-NFB7PARJ.js} +1 -1
- package/dist/chunk-NLUSV66Z.js +2 -0
- package/dist/chunk-NO6DG2IV.js +2 -0
- package/dist/chunk-NQJL6B67.js +2 -0
- package/dist/chunk-NR6V243X.js +4 -0
- package/dist/{chunk-WON5GBJY.js → chunk-NU5HN3FZ.js} +7 -7
- package/dist/{chunk-AFINCNY3.js → chunk-NVD4AI5Y.js} +1 -1
- package/dist/chunk-O3UL2XW5.js +2 -0
- package/dist/{chunk-QLVJ5W4G.js → chunk-O47HKK6E.js} +1 -1
- package/dist/{chunk-M5LR7ZZX.js → chunk-O6JJIR4H.js} +1 -1
- package/dist/{chunk-EZUQ5NXE.js → chunk-OORL6BIG.js} +1 -1
- package/dist/{chunk-SDATPJM2.js → chunk-OP5DOO3K.js} +4 -4
- package/dist/{chunk-XQMPLXGG.js → chunk-PLK2WHZG.js} +16 -16
- package/dist/chunk-PN5FQVMB.js +7 -0
- package/dist/chunk-PUF75SMJ.js +1 -0
- package/dist/{chunk-NYEMGKAE.js → chunk-PW52RXPI.js} +1 -1
- package/dist/chunk-QDKAA3HR.js +2 -0
- package/dist/{chunk-CCIGAU5Y.js → chunk-QHPVAXHR.js} +3 -3
- package/dist/chunk-QRTRKWCZ.js +2 -0
- package/dist/{chunk-NVFYLTJ6.js → chunk-QRYSL6QU.js} +2 -2
- package/dist/{chunk-HLQVB7FG.js → chunk-RBBIAIPH.js} +8 -8
- package/dist/chunk-RH2BAZKY.js +4 -0
- package/dist/chunk-RIT7ZXEY.js +4 -0
- package/dist/chunk-RJ4GWBBG.js +4 -0
- package/dist/chunk-RMUSRDWV.js +1 -0
- package/dist/{chunk-G4PGEQOX.js → chunk-RUGQO7YF.js} +9 -9
- package/dist/{chunk-ENDCV7B3.js → chunk-RVRDDTEG.js} +9 -9
- package/dist/{chunk-WS7XIJS6.js → chunk-RXCGE2AY.js} +1 -1
- package/dist/chunk-S5IAQ7ZS.js +2 -0
- package/dist/{chunk-SOBGCIPF.js → chunk-S74LKSUB.js} +1 -1
- package/dist/{chunk-CF7BMDU3.js → chunk-SDDV3UCN.js} +3 -3
- package/dist/{chunk-CUKDQPEN.js → chunk-SLU45G5J.js} +3 -3
- package/dist/chunk-T23TIJ4P.js +1 -0
- package/dist/chunk-T2FITGKQ.js +2 -0
- package/dist/chunk-T7CXUYI4.js +4 -0
- package/dist/{chunk-ZMRGHVKS.js → chunk-TKJBZIHT.js} +1 -1
- package/dist/chunk-TLMFVEMC.js +9 -0
- package/dist/chunk-TQ2M7V4E.js +2 -0
- package/dist/chunk-TSP7UFQB.js +2 -0
- package/dist/{chunk-EQZZ4V5X.js → chunk-TXDA7TTP.js} +1 -1
- package/dist/{chunk-B4HSNEBK.js → chunk-UDKTAG57.js} +1 -1
- package/dist/chunk-UO6GQPT3.js +2 -0
- package/dist/{chunk-4D66DUU5.js → chunk-UYRMW5MO.js} +5 -5
- package/dist/{chunk-5W2OEDUD.js → chunk-V6Y4OC6K.js} +8 -8
- package/dist/{chunk-H7BKSATJ.js → chunk-VDUXPMOQ.js} +1 -1
- package/dist/{chunk-4V73LGZG.js → chunk-VIQ6OME2.js} +8 -8
- package/dist/{chunk-ZF2MNQXY.js → chunk-VN4KSRZ5.js} +1 -1
- package/dist/{chunk-HLVOHOBC.js → chunk-VQCSHJEF.js} +5 -5
- package/dist/{chunk-7AZAMDGG.js → chunk-VWIYC2NB.js} +7 -7
- package/dist/chunk-W33HIHEP.js +2 -0
- package/dist/{chunk-GD7ILVPF.js → chunk-W3OWPBQL.js} +2 -2
- package/dist/{chunk-N4ZEB4UD.js → chunk-WYFMSL4Q.js} +9 -9
- package/dist/{chunk-OUIE2N2Z.js → chunk-XCHAU2UN.js} +5 -5
- package/dist/{chunk-HJ2BDUO6.js → chunk-XK42AQOJ.js} +4 -4
- package/dist/{chunk-BVIOCAEU.js → chunk-XLCZHPCQ.js} +1 -1
- package/dist/{chunk-7X4QNWA7.js → chunk-XLWMM53L.js} +2 -2
- package/dist/chunk-XNSBAJ7T.js +4 -0
- package/dist/chunk-XYBI57KO.js +12 -0
- package/dist/{chunk-X2KMUHBB.js → chunk-Y62TTKSY.js} +3 -3
- package/dist/{chunk-TXDBOSSB.js → chunk-YILGAEW3.js} +1 -1
- package/dist/{chunk-4MJA2SPJ.js → chunk-YJXS7BR5.js} +13 -13
- package/dist/{chunk-EQCFPRKJ.js → chunk-YSDPFDAG.js} +1 -1
- package/dist/{chunk-UG6RI525.js → chunk-Z5A4EY2R.js} +1 -1
- package/dist/{chunk-JFH5HW2G.js → chunk-ZQKA2XKH.js} +7 -7
- package/dist/chunk-ZTYBH5FO.js +4 -0
- package/dist/{chunk-HYDVHGVT.js → chunk-ZWMODDVE.js} +2 -2
- package/dist/data/DataTable.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/format/index.d.ts +1 -0
- package/dist/format/index.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/Segmented.js +1 -1
- package/dist/forms/Select.d.ts +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.d.ts +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/textAlign.d.ts +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/icons/efficient-glyphs.d.ts +12 -0
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.d.ts +24 -0
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient-meanings.d.ts +12 -0
- package/dist/icons/efficient-meanings.js +1 -1
- package/dist/icons/efficient.d.ts +12 -0
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/glyphs/BoxItemAlignmentIcon.d.ts +8 -0
- package/dist/icons/glyphs/BoxItemAlignmentIcon.js +1 -0
- package/dist/icons/glyphs/BoxJustifyIcon.d.ts +8 -0
- package/dist/icons/glyphs/BoxJustifyIcon.js +1 -0
- package/dist/icons/glyphs/BoxXBetweenIcon.d.ts +8 -0
- package/dist/icons/glyphs/BoxXBetweenIcon.js +1 -0
- package/dist/icons/glyphs/BoxXCenterIcon.d.ts +8 -0
- package/dist/icons/glyphs/BoxXCenterIcon.js +1 -0
- package/dist/icons/glyphs/BoxXEndIcon.d.ts +8 -0
- package/dist/icons/glyphs/BoxXEndIcon.js +1 -0
- package/dist/icons/glyphs/BoxXStartIcon.d.ts +8 -0
- package/dist/icons/glyphs/BoxXStartIcon.js +1 -0
- package/dist/icons/glyphs/BoxXStretchIcon.d.ts +8 -0
- package/dist/icons/glyphs/BoxXStretchIcon.js +1 -0
- package/dist/icons/glyphs/BoxYBetweenIcon.d.ts +8 -0
- package/dist/icons/glyphs/BoxYBetweenIcon.js +1 -0
- package/dist/icons/glyphs/BoxYCenterIcon.d.ts +8 -0
- package/dist/icons/glyphs/BoxYCenterIcon.js +1 -0
- package/dist/icons/glyphs/BoxYEndIcon.d.ts +8 -0
- package/dist/icons/glyphs/BoxYEndIcon.js +1 -0
- package/dist/icons/glyphs/BoxYStartIcon.d.ts +8 -0
- package/dist/icons/glyphs/BoxYStartIcon.js +1 -0
- package/dist/icons/glyphs/BoxYStretchIcon.d.ts +8 -0
- package/dist/icons/glyphs/BoxYStretchIcon.js +1 -0
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/BoxItemAlignmentMiniIcon.d.ts +8 -0
- package/dist/icons/looks/BoxItemAlignmentMiniIcon.js +1 -0
- package/dist/icons/looks/BoxItemAlignmentSolidIcon.d.ts +8 -0
- package/dist/icons/looks/BoxItemAlignmentSolidIcon.js +1 -0
- package/dist/icons/looks/BoxJustifyMiniIcon.d.ts +8 -0
- package/dist/icons/looks/BoxJustifyMiniIcon.js +1 -0
- package/dist/icons/looks/BoxJustifySolidIcon.d.ts +8 -0
- package/dist/icons/looks/BoxJustifySolidIcon.js +1 -0
- package/dist/icons/looks/BoxXBetweenMiniIcon.d.ts +8 -0
- package/dist/icons/looks/BoxXBetweenMiniIcon.js +1 -0
- package/dist/icons/looks/BoxXBetweenSolidIcon.d.ts +8 -0
- package/dist/icons/looks/BoxXBetweenSolidIcon.js +1 -0
- package/dist/icons/looks/BoxXCenterMiniIcon.d.ts +8 -0
- package/dist/icons/looks/BoxXCenterMiniIcon.js +1 -0
- package/dist/icons/looks/BoxXCenterSolidIcon.d.ts +8 -0
- package/dist/icons/looks/BoxXCenterSolidIcon.js +1 -0
- package/dist/icons/looks/BoxXEndMiniIcon.d.ts +8 -0
- package/dist/icons/looks/BoxXEndMiniIcon.js +1 -0
- package/dist/icons/looks/BoxXEndSolidIcon.d.ts +8 -0
- package/dist/icons/looks/BoxXEndSolidIcon.js +1 -0
- package/dist/icons/looks/BoxXStartMiniIcon.d.ts +8 -0
- package/dist/icons/looks/BoxXStartMiniIcon.js +1 -0
- package/dist/icons/looks/BoxXStartSolidIcon.d.ts +8 -0
- package/dist/icons/looks/BoxXStartSolidIcon.js +1 -0
- package/dist/icons/looks/BoxXStretchMiniIcon.d.ts +8 -0
- package/dist/icons/looks/BoxXStretchMiniIcon.js +1 -0
- package/dist/icons/looks/BoxXStretchSolidIcon.d.ts +8 -0
- package/dist/icons/looks/BoxXStretchSolidIcon.js +1 -0
- package/dist/icons/looks/BoxYBetweenMiniIcon.d.ts +8 -0
- package/dist/icons/looks/BoxYBetweenMiniIcon.js +1 -0
- package/dist/icons/looks/BoxYBetweenSolidIcon.d.ts +8 -0
- package/dist/icons/looks/BoxYBetweenSolidIcon.js +1 -0
- package/dist/icons/looks/BoxYCenterMiniIcon.d.ts +8 -0
- package/dist/icons/looks/BoxYCenterMiniIcon.js +1 -0
- package/dist/icons/looks/BoxYCenterSolidIcon.d.ts +8 -0
- package/dist/icons/looks/BoxYCenterSolidIcon.js +1 -0
- package/dist/icons/looks/BoxYEndMiniIcon.d.ts +8 -0
- package/dist/icons/looks/BoxYEndMiniIcon.js +1 -0
- package/dist/icons/looks/BoxYEndSolidIcon.d.ts +8 -0
- package/dist/icons/looks/BoxYEndSolidIcon.js +1 -0
- package/dist/icons/looks/BoxYStartMiniIcon.d.ts +8 -0
- package/dist/icons/looks/BoxYStartMiniIcon.js +1 -0
- package/dist/icons/looks/BoxYStartSolidIcon.d.ts +8 -0
- package/dist/icons/looks/BoxYStartSolidIcon.js +1 -0
- package/dist/icons/looks/BoxYStretchMiniIcon.d.ts +8 -0
- package/dist/icons/looks/BoxYStretchMiniIcon.js +1 -0
- package/dist/icons/looks/BoxYStretchSolidIcon.d.ts +8 -0
- package/dist/icons/looks/BoxYStretchSolidIcon.js +1 -0
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/payment.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +244 -244
- package/dist/map/index.js +7 -7
- package/dist/names-bEzx4RQ8.d.ts +23 -0
- package/dist/page-tabs/index.js +5 -5
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/FloatingBar.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.d.ts +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/Popover.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StatusBadge.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.d.ts +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/tokens/type.d.ts +32 -1
- package/dist/tokens/type.js +1 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-AXFKAC7G.js +0 -29
- package/dist/Files-NRYZG4KY.js +0 -88
- package/dist/Sidebar-CB6KRPW2.js +0 -44
- package/dist/chunk-4Q25UHWB.js +0 -22
- package/dist/chunk-6ACS4S4P.js +0 -15
- package/dist/chunk-7RPYVQEV.js +0 -2
- package/dist/chunk-DOC52JBV.js +0 -20
- package/dist/chunk-EDMDKQNO.js +0 -4
- package/dist/chunk-F7Z47OIF.js +0 -12
- package/dist/chunk-FX6DBXXD.js +0 -1
- package/dist/chunk-GLBLKHYA.js +0 -5
- package/dist/chunk-HJCUDXLV.js +0 -1
- package/dist/chunk-HXNMRJQ4.js +0 -2
- package/dist/chunk-HXZ5XPBS.js +0 -3
- package/dist/chunk-IHFZ7OXO.js +0 -14
- package/dist/chunk-KLBJ646Z.js +0 -8
- package/dist/chunk-LH7IKIGE.js +0 -1
- package/dist/chunk-NXVFY22L.js +0 -9
- package/dist/chunk-RAAH4TQU.js +0 -1
- package/dist/chunk-SRWZE3WA.js +0 -6
- package/dist/chunk-TNDRHHKN.js +0 -14
- package/dist/chunk-UXPBVRSE.js +0 -7
- package/dist/chunk-XPTOKPUM.js +0 -11
- package/dist/chunk-XSJHN2GD.js +0 -1
- package/dist/chunk-YG2TWBDH.js +0 -1
- package/dist/chunk-YUECA3XB.js +0 -8
- package/dist/chunk-YYZ73H64.js +0 -7
- package/dist/names-CkQuQ47O.d.ts +0 -23
- /package/dist/{chunk-Y2AGVGOP.js → chunk-BDUWYLPI.js} +0 -0
- /package/dist/{chunk-3J2PO3KW.js → chunk-ECJKIPWU.js} +0 -0
|
@@ -1,29 +1,29 @@
|
|
|
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-QYL26AB4.js";import{CMD_Z as p,CMD_SHIFT_Z as f}from"./chunk-ZDMZM7HD.js";import{CopyButton as w}from"./chunk-2E2SUEEE.js";import{confirm as y}from"./chunk-
|
|
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-QYL26AB4.js";import{CMD_Z as p,CMD_SHIFT_Z as f}from"./chunk-ZDMZM7HD.js";import{CopyButton as w}from"./chunk-2E2SUEEE.js";import{confirm as y}from"./chunk-PLK2WHZG.js";import{useShellPrefs as g}from"./chunk-KC3EX26K.js";import{ItemCount as v}from"./chunk-FOFZI62F.js";import{isInOverlayOver as b}from"./chunk-3DVNXNTF.js";import{dialogA11y as x}from"./chunk-VWGWZY7A.js";import{useIsMobile as k,useIsPhone as E}from"./chunk-UGTRSRIW.js";import{ColoredBadge as C}from"./chunk-EPY34L26.js";import{focusableIn as M}from"./chunk-CDAJKLGL.js";import{PopupMenu as N,PopupMenuItem as S,PopupMenuDivider as L,PopupMenuLabel as T}from"./chunk-4WEFGKJL.js";import{StatusBadge as z}from"./chunk-TXDA7TTP.js";import{Button_default as A}from"./chunk-I4VIEGCX.js";import{Icon as D}from"./chunk-2UO47XB4.js";import{LoadingSpinner as P}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as I}from"./chunk-62LW225J.js";import{runEscapeInterceptors as W}from"./chunk-TWVUQUUD.js";import{useShellStrings as K}from"./chunk-GDQJBQ5B.js";import{createContext as R,useContext as $,Component as O,useLayoutEffect as F,useRef as j,useEffect as q,useState as B,useSyncExternalStore as H,useCallback as U,isValidElement as Y,Fragment as X,Children as V,cloneElement as G,useMemo as _,useId as J,useReducer as Z,Suspense as Q}from"react";import{jsxs as ee,jsx as te,Fragment as ne}from"react/jsx-runtime";import{createPortal as re}from"react-dom";import{useLocation as oe}from"react-router-dom";import{useQueryClient as ie,useQuery as ae}from"@tanstack/react-query";function se(e){return"component"in e}function le(e){return"endpoint"in e}var ce={};function ue(e){ce=e}var de=new Proxy({},{get:(e,t)=>ce[t],has:(e,t)=>t in ce,ownKeys:()=>Object.keys(ce),getOwnPropertyDescriptor(e,t){if(t in ce)return{configurable:!0,enumerable:!0,value:ce[t]}}}),he=null;function me(e){he=e}function pe(){return null!==he}var fe=/* @__PURE__ */new Set(["get","post","put","patch","delete","head","options","request"]),we=new Proxy({},{get:(e,t)=>he?he[t]:"string"==typeof t&&fe.has(t)?()=>Promise.resolve({data:null,status:0,statusText:"",headers:{},config:{}}):void 0}),ye=R(null);function ge(){return $(ye)?.pageSearch??""}var ve=null,be=/* @__PURE__ */new Set;function xe(e){ve!==e&&(ve=e,be.forEach(e=>e()))}function ke(){return ve}function Ee(e){return be.add(e),()=>{be.delete(e)}}var Ce=null;function Me(e){Ce=e}function Ne({error:e,onReload:t}){const n=h(e);/* @__PURE__ */
|
|
2
2
|
return ee("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
|
|
3
3
|
/* @__PURE__ */te(D,{name:"warning",className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
|
|
4
4
|
/* @__PURE__ */ee("div",{className:"min-w-0",children:[
|
|
5
5
|
/* @__PURE__ */te("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__ */te("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__ */te("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 Se=class extends O{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__ */te(Ne,{error:e,onReload:this.reset}):this.props.children}},Le=
|
|
7
|
+
/* @__PURE__ */te("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 Se=class extends O{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__ */te(Ne,{error:e,onReload:this.reset}):this.props.children}},Le=R(null),Te="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function ze({className:e="",auto:t=!1}){const n=$(Le),r=K().undo,o=n?.claimOwnMount;if(F(()=>{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 ee("div",{className:`flex items-center gap-2 ${e}`,"data-undo-controls":t?"shell":"form",children:[
|
|
9
9
|
/* @__PURE__ */te("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",p):r.nothingToUndo,className:Te,children:r.undo}),
|
|
10
|
-
/* @__PURE__ */te("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",f):r.nothingToRedo,className:Te,children:r.redo})]})}var Ae=/* @__PURE__ */new Set([408,429]);function De(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function Pe(e){const t=De(e);return null!=t&&(t>=400&&t<500&&!Ae.has(t))}function Ie(e,t){return!Pe(t)&&e<3}function
|
|
11
|
-
return te(
|
|
12
|
-
return te(
|
|
10
|
+
/* @__PURE__ */te("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",f):r.nothingToRedo,className:Te,children:r.redo})]})}var Ae=/* @__PURE__ */new Set([408,429]);function De(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function Pe(e){const t=De(e);return null!=t&&(t>=400&&t<500&&!Ae.has(t))}function Ie(e,t){return!Pe(t)&&e<3}function We(e){if("page"!==e.type)return!0;const t=e.route?de[e.route]:void 0;if(!t||!se(t))return!0;const n=t;return!n.widget&&!n.utility}function Ke(e){const t=e.route?de[e.route]:void 0;if(!t||!se(t))return;const n=t;return n.taskbarGroup?n.taskbarGroup:{key:e.route,label:n.label,icon:e.route}}var Re=(e,t)=>!!t&&"page"===e.type&&e.route===t;function $e(){const e=K().loading;/* @__PURE__ */
|
|
11
|
+
return te(P,{size:"sm",padding:"p-8",label:e.label})}var Oe="flex-1 min-h-0";function Fe(){const e=K().record;/* @__PURE__ */
|
|
12
|
+
return te(P,{label:e.loading,padding:"",className:Oe})}function je(e){return e??void 0}function qe({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:o}){const i=K().record;if(t||e&&n)/* @__PURE__ */return te(Fe,{});if(r){const e=De(r);if(401===e)/* @__PURE__ */
|
|
13
13
|
return te(m,{status:"warning",title:i.signInRequired,subTitle:i.signInBody,className:Oe});if(403===e)/* @__PURE__ */
|
|
14
14
|
return te(m,{status:"403",className:Oe});if(404===e||410===e)/* @__PURE__ */
|
|
15
15
|
return te(m,{status:"404",title:i.notFound,className:Oe});const t=null==e||408===e||429===e||e>=500;/* @__PURE__ */
|
|
16
16
|
return te(m,{status:"500",title:i.loadFailed,subTitle:t?i.checkConnection:i.rejected,extra:t?/* @__PURE__ */te(A,{variant:"secondary",size:"sm",onClick:o,children:i.retry}):void 0,className:Oe})}/* @__PURE__ */
|
|
17
|
-
return te(m,{status:"404",title:i.notFound,className:Oe})}function Be({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */te(ne,{children:t(e)}):/* @__PURE__ */te(qe,{...n})}var He=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function Ue(e){return"string"==typeof e&&(e.startsWith("new-")||He.test(e))}function Ye(e){if(Ue(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var Xe=
|
|
18
|
-
return te(Gr,{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__ */te(Ve.Provider,{value:o,children:/* @__PURE__ */te(
|
|
19
|
-
return te("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];we.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__ */te(D,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var tt=/* @__PURE__ */new Set,nt=()=>"hidden";function rt({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=de[e.entityType];if(!o||!le(o))return null;const i=o,[a,s]=B(!1),{dirty:l,registerDirty:u}=_e(),d=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=Ue(e.entityId),p=!i.selfFetching&&!h&&!m&&pe(),f=ae({queryKey:[d,e.entityId],queryFn:()=>{return we.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:
|
|
17
|
+
return te(m,{status:"404",title:i.notFound,className:Oe})}function Be({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */te(ne,{children:t(e)}):/* @__PURE__ */te(qe,{...n})}var He=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function Ue(e){return"string"==typeof e&&(e.startsWith("new-")||He.test(e))}function Ye(e){if(Ue(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var Xe=R({openWindows:[],openEntity:()=>{},openPage:()=>{},reorderWindows:()=>{},closeEntity:()=>{},minimize:()=>{},items:[],restore:()=>{},remove:()=>{},restoreIfMinimized:()=>!1,openItems:[]}),Ve=R(null);function Ge(e){const t=$(Ve),n=j(null);null===n.current&&(n.current=/* @__PURE__ */Symbol("window-dirty")),F(()=>{if(t)return t(n.current,e)},[t,e]),q(()=>{if(!t||!e)return;const n=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t,e])}function _e(){const e=j(/* @__PURE__ */new Map),[t,n]=B(!1);return{dirty:t,registerDirty:U((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 Je(){return $(Xe)}function Ze(e){if("page"!==e.type&&Ye(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 Qe({item:e,onClose:t,accentRgb:n}){const{dirty:r,registerDirty:o}=_e(),i=de[e.route];if(!i||!se(i))return null;const a=i,s=a.component;/* @__PURE__ */
|
|
18
|
+
return te(Gr,{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__ */te(Ve.Provider,{value:o,children:/* @__PURE__ */te(Q,{fallback:/* @__PURE__ */te("div",{className:"flex items-center justify-center py-12",children:/* @__PURE__ */te($e,{})}),children:/* @__PURE__ */te(s,{})})})})}function et({entityType:e,entityId:t,label:n}){const r=K(),o=ie(),{data:i}=ae({queryKey:["my-profile-sidebar"],enabled:pe(),queryFn:()=>we.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 te("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];we.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__ */te(D,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var tt=/* @__PURE__ */new Set,nt=()=>"hidden";function rt({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=de[e.entityType];if(!o||!le(o))return null;const i=o,[a,s]=B(!1),{dirty:l,registerDirty:u}=_e(),d=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=Ue(e.entityId),p=!i.selfFetching&&!h&&!m&&pe(),f=ae({queryKey:[d,e.entityId],queryFn:()=>{return we.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:je(e.entitySnapshot),initialDataUpdatedAt:0,enabled:p,staleTime:0,refetchOnWindowFocus:!0,refetchOnMount:"always",refetchInterval:e=>!Pe(e.state.error)&&6e4,refetchIntervalInBackground:!1,retry:Ie}),w=f.data,y=f.refetch;q(()=>{var t;if(p)return t=t=>{t!==e.id||tt.has(t)||y({cancelRefetch:!1})},Qn.add(t),()=>{Qn.delete(t)}},[y,e.id,p]);const g=U(()=>{a&&!l?s(!1):t()},[a,l,t]),v=(i.useEdit??nt)(w??null),b=!i.useEdit||m||h?void 0:{state:v,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__ */te(Q,{fallback:/* @__PURE__ */te($e,{}),children:i.render(w??e.entitySnapshot,t,e.entityId,a,s)}):null!=w?/* @__PURE__ */te(Q,{fallback:/* @__PURE__ */te(Gr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */te(Fe,{})}),children:i.render(w,t,e.entityId,a,s)}):/* @__PURE__ */te(Gr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */te(qe,{isPending:f.isPending,isFetching:f.isFetching,enabled:p,error:f.error,onRetry:y})}):/* @__PURE__ */te(Gr,{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:b,dimensions:i.dimensions,autoHeight:i.autoHeight,autoMinHeight:i.autoMinHeight,autoWidth:i.autoWidth,appStyle:i.appStyle,flushBody:i.flushBody,accentRgb:r,children:/* @__PURE__ */te(Ve.Provider,{value:u,children:/* @__PURE__ */te(Q,{fallback:/* @__PURE__ */te(Fe,{}),children:i.selfFetching?i.render(null,t,e.entityId,a,s):/* @__PURE__ */te(Be,{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 ot(e){return document.querySelector(`[data-modal-panel][data-window-key="${e}"]`)}function it(e){return document.querySelector(`[data-modal-panel][data-window-root][data-window-owner="${e}"]`)}function at(e){const t=ot(e),n=t??it(e);if(!n)return;if(t&&!dr(t))return r=e,void window.dispatchEvent(new CustomEvent("modal-reveal",{detail:{windowKey:r}}));var r;const o=n.getAttribute("data-modal-id");o&&er(o)}function st(){const e=Mr();if(!e)return;const t=document.querySelector(`[data-modal-panel][data-modal-id="${e}"]`);return t?.getAttribute("data-window-key")??void 0}var lt=/* @__PURE__ */new Map;function ct(){const e=st();if(e)return lt.get(e)}function ut(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 dt="rosh-peek-style",ht=I.peek,mt=I.taskbarPreview;function pt(e){"undefined"!=typeof document&&(!function(){if("undefined"==typeof document||document.getElementById(dt))return;const e=document.createElement("style");e.id=dt,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:${ht}!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 ft(){"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 wt({id:e,label:t,maxW:n,maxH:r,titleAbove:o=!1,onClick:i,onClose:a}){const s=K(),l=j(null),[c,u]=B({w:n,h:Math.round(.75*r)}),[d,h]=B(!1);return F(()=>{const o=l.current;if(!o)return;const i=ot(e)??ut(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__ */ee("div",{style:{width:c.w,height:c.h},className:"relative rounded-md overflow-hidden bg-white/95 border border-line-strong shadow-(--elevation-panel) cursor-pointer ring-2 ring-transparent group-hover:ring-blue-400 transition shrink-0",onClick:i,children:[
|
|
20
20
|
/* @__PURE__ */te("div",{ref:l,className:"absolute inset-0 z-0 overflow-hidden"}),!d&&/* @__PURE__ */ee("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-gray-400 bg-gray-50",children:[
|
|
21
21
|
/* @__PURE__ */te(D,{name:"window",className:"h-6 w-6",strokeWidth:1.5}),
|
|
22
|
-
/* @__PURE__ */te("span",{className:"mt-1 text-3xs uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */te("div",{className:"absolute bottom-0 left-0 right-0 z-10 px-2 py-1 text-2xs font-medium text-on-accent bg-gradient-to-t from-black/80 to-transparent truncate pointer-events-none",children:t}),a&&/* @__PURE__ */te("button",{onClick:e=>{e.stopPropagation(),a()},className:"absolute top-1 right-1 z-20 h-5 w-5 rounded-full bg-gray-900/90 ring-1 ring-white/80 shadow-sm hover:bg-red-500 text-on-accent flex items-center justify-center",title:s.taskbar.closeWindow,children:/* @__PURE__ */te(D,{name:"close",className:"h-3 w-3",strokeWidth:3})})]})}function yt({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=
|
|
22
|
+
/* @__PURE__ */te("span",{className:"mt-1 text-3xs uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */te("div",{className:"absolute bottom-0 left-0 right-0 z-10 px-2 py-1 text-2xs font-medium text-on-accent bg-gradient-to-t from-black/80 to-transparent truncate pointer-events-none",children:t}),a&&/* @__PURE__ */te("button",{onClick:e=>{e.stopPropagation(),a()},className:"absolute top-1 right-1 z-20 h-5 w-5 rounded-full bg-gray-900/90 ring-1 ring-white/80 shadow-sm hover:bg-red-500 text-on-accent flex items-center justify-center",title:s.taskbar.closeWindow,children:/* @__PURE__ */te(D,{name:"close",className:"h-3 w-3",strokeWidth:3})})]})}function yt({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=K(),s=e.length>1,l=j(null),[c,u]=B({left:-9999,top:-9999,ready:!1}),[d,h]=B(()=>"undefined"!=typeof document&&getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom");F(()=>{const e=l.current;if(!e)return;const n=()=>{const n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";h(o);let i,a=n.left+n.width/2-r.width/2;"top"===o?i=n.bottom+8:"left"===o?(a=n.right+8,i=n.top+n.height/2-r.height/2):"right"===o?(a=n.left-r.width-8,i=n.top+n.height/2-r.height/2):i=n.top-r.height-8,a=Math.max(8,Math.min(a,window.innerWidth-r.width-8)),i=Math.max(8,Math.min(i,window.innerHeight-r.height-8)),u({left:a,top:i,ready:!0})};n();const r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t,e.length]),q(()=>ft,[]);const m="top"===d,p=(m?"mt-1":"mb-1")+" max-w-[240px] truncate text-2xs font-medium text-ink-strongest bg-white/80 px-2 py-0.5 rounded shadow-sm ring-2 ring-transparent transition group-hover:ring-blue-400";return re(
|
|
23
23
|
/* @__PURE__ */te("div",{ref:l,"data-taskbar-preview":"",style:{position:"fixed",left:c.left,top:c.top,zIndex:mt,maxWidth:"calc(100vw - 16px)",opacity:c.ready?1:0},className:s?"flex gap-2 flex-wrap":"",onMouseEnter:o,onMouseLeave:()=>{ft(),i()},children:e.map(e=>{const t=ot(e.id)??ut(e.label),o=t?function(e){if(dr(e))return null;const t=e.getBoundingClientRect(),n=ir(),r=t.left+t.width/2-(n.x+n.w/2),o=t.top+t.height/2-(n.y+n.h/2);return 180*Math.atan2(o,r)/Math.PI}(t):null;/* @__PURE__ */
|
|
24
24
|
return ee("div",{className:"group flex flex-col items-center",onMouseEnter:()=>pt(t),children:[!m&&/* @__PURE__ */te("span",{className:p,children:e.label}),
|
|
25
25
|
/* @__PURE__ */te(wt,{id:e.id,label:e.label,maxW:240,maxH:160,titleAbove:!0,onClick:()=>n(e.id),onClose:()=>r(e.id)}),m&&/* @__PURE__ */te("span",{className:p,children:e.label}),null!==o&&/* @__PURE__ */ee("span",{title:a.taskbar.offscreenHint,className:"mt-1 inline-flex items-center gap-1 rounded bg-amber-500 px-2 py-0.5 text-2xs font-semibold text-on-accent shadow-sm",children:[
|
|
26
|
-
/* @__PURE__ */te(D,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function gt(e,t){const n=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";return"top"===n?{left:Math.min(e,window.innerWidth-220),top:t+4}:"left"===n?{left:e+4,top:Math.min(t,window.innerHeight-160)}:"right"===n?{right:window.innerWidth-e+4,top:Math.min(t,window.innerHeight-160)}:{left:Math.min(e,window.innerWidth-220),bottom:window.innerHeight-t+4}}function vt({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=
|
|
26
|
+
/* @__PURE__ */te(D,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function gt(e,t){const n=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";return"top"===n?{left:Math.min(e,window.innerWidth-220),top:t+4}:"left"===n?{left:e+4,top:Math.min(t,window.innerHeight-160)}:"right"===n?{right:window.innerWidth-e+4,top:Math.min(t,window.innerHeight-160)}:{left:Math.min(e,window.innerWidth-220),bottom:window.innerHeight-t+4}}function vt({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=K(),[a,s]=B(null);q(()=>{let e,t;const n=()=>{clearInterval(e),clearTimeout(t),e=void 0},r=()=>{const e=document.getElementById("taskbar-windows");return s(t=>t===e?t:e),!!e},o=()=>{n(),r()||(e=setInterval(()=>{r()&&n()},100),t=setTimeout(n,5e3))};return o(),window.addEventListener("react-os-shell:layout-mode-changed",o),()=>{n(),window.removeEventListener("react-os-shell:layout-mode-changed",o)}},[]);const l=H(Nr,Mr),[,u]=B(0);q(()=>{const e=()=>u(e=>e+1);return window.addEventListener("modal-geometry",e),window.addEventListener("resize",e),()=>{window.removeEventListener("modal-geometry",e),window.removeEventListener("resize",e)}},[]);const[,d]=B(0);q(()=>{const e=()=>d(e=>e+1);return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[]);const h=e=>{const t=ut(e),n=t?.querySelector("[data-window-title]");return n?.textContent?.trim()||e},[m,p]=B(null),[f,w]=B(null),[y,g]=B(null),b=j(null),x=()=>{b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{p(null),w(null)},150)},k=e.filter(e=>!e.route||!de[e.route]?.utility);if(!a||!a.isConnected||0===k.length)return null;const E=[],C=/* @__PURE__ */new Map;for(const e of k){const t=e.route?de[e.route]:void 0,n=t?.taskbarGroup,r=n?.key??e.route??`entity:${e.id}`,o=C.get(r);if(void 0!==o)E[o].items.push(e);else{C.set(r,E.length);const o=n?.label??t?.label??e.label;E.push({key:r,route:n?.icon??e.route,label:o,items:[e]})}}return re(
|
|
27
27
|
/* @__PURE__ */ee(ne,{children:[E.map(e=>{const n=e.route?c[e.route]:null,r=e.items[e.items.length-1];let a=!1;if(l){const t=document.querySelector(`[data-modal-id="${l}"]`);if(t){const n=t.querySelector("[data-window-title]"),r=n?.textContent??"";a=e.items.some(e=>r.includes(e.label))}}const s=e.items.length>1,u=e.items.some(e=>{const t=ot(e.id)??ut(e.label);return!!t&&!dr(t)});/* @__PURE__ */
|
|
28
28
|
return ee("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.currentTarget,void(y||(b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{p(n),w(r)},350)));var n,r},onMouseLeave:x,onDoubleClick:e=>{e.stopPropagation(),window.dispatchEvent(new CustomEvent("modal-center",{detail:{windowKey:r.id,label:r.label}}))},onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),b.current&&(clearTimeout(b.current),b.current=null),p(null),w(null),s?g({x:t.clientX,y:t.clientY,items:e.items,label:e.label}):window.dispatchEvent(new CustomEvent("modal-context-menu",{detail:{windowKey:r.id,label:r.label,x:t.clientX,y:t.clientY}}))},style:{width:"var(--window-tab-width, 200px)",fontSize:"var(--window-tab-font-size, 12px)"},"data-tab-group":e.key,className:"group relative flex items-center gap-2 rounded-lg px-3 py-2 font-medium transition-all min-w-0 shrink "+(a?"bg-blue-100/60 border border-blue-400/60 text-blue-700":"bg-gray-50/40 border border-gray-200/40 text-gray-700 hover:bg-gray-200/40"),children:[n&&Y(n)?G(n,{className:"h-3.5 w-3.5 shrink-0"}):/* @__PURE__ */te(D,{name:"expand",className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),
|
|
29
29
|
/* @__PURE__ */te("span",{className:"truncate flex-1",children:s?e.label:h(r.label)}),u&&/* @__PURE__ */te("span",{title:i.taskbar.offscreenDot,className:"shrink-0 h-1.5 w-1.5 rounded-full bg-amber-500"}),s&&/* @__PURE__ */te(v,{count:e.items.length,label:i.count.windows(e.items.length)}),!s&&/* @__PURE__ */te("span",{role:"button",onClick:e=>{e.stopPropagation(),t(r.id)},className:"ml-auto text-gray-400 hover:text-red-500 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:/* @__PURE__ */te(D,{name:"close",className:"h-3 w-3",strokeWidth:2})})]},e.key)}),
|
|
@@ -36,65 +36,65 @@ return ee("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.cu
|
|
|
36
36
|
/* @__PURE__ */te("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */te("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75h6.5v6.5h-6.5zM13.75 8.75h6.5v6.5h-6.5z"})}),i.taskbar.restoreAllWindows]}),
|
|
37
37
|
/* @__PURE__ */te(L,{}),
|
|
38
38
|
/* @__PURE__ */ee(S,{danger:!0,onClick:()=>{g(null),y.items.forEach(e=>t(e.id))},children:[
|
|
39
|
-
/* @__PURE__ */te(D,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${y.items.length})`]})]}),m&&f&&/* @__PURE__ */te(yt,{items:m,anchorEl:f,onActivate:e=>{o(e),p(null),w(null)},onClose:e=>{t(e),p(null),w(null)},onMouseEnter:()=>{b.current&&(clearTimeout(b.current),b.current=null)},onMouseLeave:x})]}),a)}var bt=["/login","/forgot-password","/reset-password","/force-change-password"];function xt({children:e,windowAccentForRoute:t}){const n=oe(),r=bt.some(e=>n.pathname.startsWith(e)),[o,i]=B([]),a=
|
|
39
|
+
/* @__PURE__ */te(D,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${y.items.length})`]})]}),m&&f&&/* @__PURE__ */te(yt,{items:m,anchorEl:f,onActivate:e=>{o(e),p(null),w(null)},onClose:e=>{t(e),p(null),w(null)},onMouseEnter:()=>{b.current&&(clearTimeout(b.current),b.current=null)},onMouseLeave:x})]}),a)}var bt=["/login","/forgot-password","/reset-password","/force-change-password"];function xt({children:e,windowAccentForRoute:t}){const n=oe(),r=bt.some(e=>n.pathname.startsWith(e)),[o,i]=B([]),a=j(o);F(()=>{a.current=o},[o]);const s=H(Ee,ke,ke),l=j(/* @__PURE__ */new Map),c=e=>{const t=We(e),n=!!s&&"page"===e.type&&e.route===s,r=e.pageSearch||void 0,o=l.current.get(e.id);if(o&&o.tab===t&&o.home===n&&o.pageSearch===r)return o;const i={key:e.id,tab:t,home:n,...r?{pageSearch:r}:{}};return l.current.set(e.id,i),i};q(()=>{lt.clear();for(const e of o)e.route&<.set(e.id,e.route)},[o]);const u=U(e=>{i(t=>t.filter(t=>t.id!==e))},[]),d=U(e=>{var t;ot(e)||it(e)?(t=e,window.dispatchEvent(new CustomEvent(Sr,{detail:{windowKey:t}}))):u(e)},[u]),h=(e,t=!1)=>{const n=Pn;t&&tt.add(e),setTimeout(()=>{const r=document.querySelector(`[data-modal-panel][data-window-key="${e}"]`),o=r?.getAttribute("data-modal-id");var i,a;!o||(i=o,a=n,(In.get(i)??-1)>a)||er(o),t&&tt.delete(e)},50)},m=(e,t,n)=>{const r=Ce;if(n||!r)return[...e,t];const o=function(e,t,n){if(!We(t))return e.length;if(t.shellOwned&&Re(t,n.home))return 0;const r=Re(t,n.home)?void 0:Ke(t)?.key;if(r){let t=-1;if(e.forEach((e,o)=>{We(e)&&!Re(e,n.home)&&Ke(e)?.key===r&&(t=o)}),t>=0)return t+1}if("page"===t.type&&t.route&&!Re(t,n.home)&&n.favorites.includes(t.route))return e.length>0&&Re(e[0],n.home)?1:0;const o=t.openedFrom?e.findIndex(e=>e.id===t.openedFrom):-1;if(o>=0){const t=/* @__PURE__ */new Set([e[o].id]);let r=o+1;for(;r<e.length&&e[r].openedFrom&&t.has(e[r].openedFrom);)t.add(e[r].id),r++;const i=t=>We(e[t])&&!Re(e[t],n.home)?Ke(e[t])?.key:void 0;for(;r>0&&r<e.length&&void 0!==i(r)&&i(r)===i(r-1);)r++;return r}return e.length}(e,t,{home:ke(),favorites:r.favorites});return[...e.slice(0,o),t,...e.slice(o)]},p=U(e=>{i(t=>function(e,t){const n=new Set(t),r=new Map(e.map(e=>[e.id,e])),o=t.map(e=>r.get(e)).filter(e=>!!e);if(o.length!==n.size)return e;let i=0;const a=e.map(e=>n.has(e.id)?o[i++]:e);return a.every((t,n)=>t===e[n])?e:a}(t,e))},[]),f=U((e,t,n,r,o,a={})=>{if(!de[e]||!le(de[e]))return;const s=`${e}:${t}`,l=st();i(i=>{const c=i.find(n=>n.entityType===e&&String(n.entityId)===String(t));return c?(h(c.id),i):(h(s,!0),m(i,{id:s,type:"modal",label:r||t,route:o||window.location.pathname,entityType:e,entityId:t,entitySnapshot:je(n),openedFrom:l},!!a.append))})},[]),w=U((e,t={})=>{if(!de[e]||!se(de[e]))return;const n=de[e],{reuse:r=!1,background:o=!1,shellOwned:s,search:l,append:c=!1}=t,u=e=>{var t;o?(t=e,Bn.add(t)):h(e)};if(n.widget){const t=a.current.find(t=>"page"===t.type&&t.route===e);if(t)return void d(t.id)}const p=st();i(t=>{if(n.multiInstance){const i=t.filter(t=>"page"===t.type&&t.route===e);if(r&&!l&&i.length>0)return o||h(i[i.length-1].id),t;const a=`page:${e}:${Math.random().toString(36).slice(2,8)}`;return u(a),m(t,{id:a,type:"page",label:n.label,route:e,openedFrom:p,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)}const i=t.find(t=>"page"===t.type&&t.route===e);if(i)return n.widget?t:(o||h(i.id),l&&i.pageSearch!==l?t.map(e=>e===i?{...e,pageSearch:l}:e):t);const a=`page:${e}`;return u(a),m(t,{id:a,type:"page",label:n.label,route:e,openedFrom:p,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)})},[d]),y=U(()=>{},[]),g=U(()=>{},[]),v=d,b=d;/* @__PURE__ */
|
|
40
40
|
return ee(Xe.Provider,{value:{openWindows:o,openEntity:f,openPage:w,reorderWindows:p,closeEntity:v,minimize:y,items:[],openItems:o,restore:g,remove:b,restoreIfMinimized:()=>!1},children:[e,
|
|
41
41
|
/* @__PURE__ */te(vt,{openWindows:o,onRemove:d,onSplitView:Xr,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&&er(e)}})},onActivateById:at}),
|
|
42
42
|
/* @__PURE__ */te(Vr,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
|
|
43
43
|
/* @__PURE__ */
|
|
44
|
-
return te(ye.Provider,{value:c(e),children:/* @__PURE__ */te(Se,{fallback:(t,n)=>/* @__PURE__ */te(Gr,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */te(Ne,{error:t,onReload:n})}),children:/* @__PURE__ */te(Jt,{spec:
|
|
45
|
-
return te(_t.Provider,{value:e,children:t})}var
|
|
46
|
-
return te("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 pn="erp_window_positions",fn={};try{const e=localStorage.getItem(pn);e&&(fn=JSON.parse(e))}catch{}var wn=null;function yn(){wn&&clearTimeout(wn),wn=setTimeout(()=>{try{localStorage.setItem(pn,JSON.stringify(fn))}catch{}},500)}var gn="erp_activation_order",vn=[];try{const e=localStorage.getItem(gn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(vn=t)}catch{}var bn=null;function xn(){bn&&clearTimeout(bn),bn=setTimeout(()=>{try{localStorage.setItem(gn,JSON.stringify(vn))}catch{}},500)}function kn(e,t){fn[e]||(fn[e]=t,yn())}function En(e){return fn[e]?{...fn[e]}:null}function Cn(e,t){fn[e]=t,yn()}function Mn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(fn))n(fn[e],r,o)&&(delete fn[e],i=!0);i&&yn()}var Nn={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},Sn=4e3,Ln=()=>{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"},Tn={small:.8,medium:1,large:1.25,maximized:1.25},zn=[],An=/* @__PURE__ */new Set,Dn=/* @__PURE__ */new Set,Pn=0,In=/* @__PURE__ */new Map;var
|
|
44
|
+
return te(ye.Provider,{value:c(e),children:/* @__PURE__ */te(Se,{fallback:(t,n)=>/* @__PURE__ */te(Gr,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */te(Ne,{error:t,onReload:n})}),children:/* @__PURE__ */te(Jt,{spec:Ze(e),children:/* @__PURE__ */te(no,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */te(Qe,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */te(rt,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var kt=400;function Et({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=j(null),s=j(!1);n&&!s.current&&(a.current="undefined"==typeof document?null:document.activeElement),s.current=n;const l=j(!1),c=j(void 0),u=j(i),d=u.current&&!i;u.current=i;const h=()=>{l.current=!0,clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},kt)};q(()=>{n&&!r&&h()},[n,r]),q(()=>{d&&n&&!r&&h()},[d]),q(()=>()=>clearTimeout(c.current),[]),q(()=>{if(!n||r||!o||i||!l.current)return;l.current=!1;const a=e.current;if(!a||a.contains(document.activeElement))return;if(document.activeElement?.closest('[aria-modal="true"]'))return;const s=t.current?M(t.current)[0]:void 0;s?s.focus():(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus())},[n,r,o,i,e,t]),F(()=>{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 Ct=null,Mt=/* @__PURE__ */new Set;function Nt(){return Ct}function St(e){if(Ct!==e){Ct=e;for(const e of Mt)e()}}function Lt(e){return Mt.add(e),()=>{Mt.delete(e)}}var Tt=!1,zt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},At=()=>{};function Dt(e){Tt=e,zt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function Pt(e,t){Tt&&("submenu"===e?zt.submenus++:zt.menus++,zt.menuKey=t)}function It(e){if(!Tt)return At;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!Tt)return;const r=performance.now()-t;"move"===e?zt.moveMs+=r:zt.resizeMs+=r}}function Wt(){const e=zt;return zt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var Kt=/* @__PURE__ */new Set([z,C]),Rt=e=>Kt.has(e)||"function"==typeof e&&"badge"===e.titleRole,$t=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),Ot=/* @__PURE__ */new Set(["svg"]);function Ft(e){const t=[],n={text:"",accessories:[],badges:[],actions:[]};return jt(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function jt(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=>jt(e,t,n));if(!Y(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===X)return void V.toArray(r.props.children).forEach(e=>jt(e,t,n));if("string"==typeof r.type){if(Ot.has(r.type))return;if(!$t.has(r.type))return n.push(" "),V.toArray(r.props.children).forEach(e=>jt(e,t,n)),void n.push(" ")}const o=G(r,{key:`title-part-${t.accessories.length}`});t.accessories.push(o),(Rt(r.type)?t.badges:t.actions).push(o)}var qt=/* @__PURE__ */new Map,Bt=/* @__PURE__ */new Set,Ht=0;function Ut(){Ht++,Bt.forEach(e=>e())}function Yt(e){return qt.get(e)}function Xt(e){return Bt.add(e),()=>{Bt.delete(e)}}function Vt(){return Ht}var Gt=R(""),_t=R(null);function Jt({spec:e,children:t}){/* @__PURE__ */
|
|
45
|
+
return te(_t.Provider,{value:e,children:t})}var Zt=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),Qt='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600',en='button, a[href], summary, [role="button"], [role="link"], [role="menuitem"], select';function tn(e){return nn(e).replace(/\s+/g," ").trim()}function nn(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(nn).join("");if(Y(e)){const t=e,n="string"==typeof t.type?t.type:"";return Zt.has(n)?"":` ${nn(t.props?.children)} `}return""}function rn(e){const t=$(Gt);q(()=>{if(!t)return;const n=n=>{n.detail===t&&e()};return window.addEventListener("widget-open-settings",n),()=>window.removeEventListener("widget-open-settings",n)},[e,t])}var on={};function an(e,t,n){const r=$(Gt);q(()=>{if(!r)return;on[r]||(on[r]=[]);const o={label:e,icon:n,onClick:t};return on[r].push(o),()=>{on[r]=(on[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function sn({title:e}){const t=j(null);return q(()=>{const n=setTimeout(()=>{const n=t.current?.closest("[data-modal-id]"),r=n?.getAttribute("data-modal-id");r&&window.dispatchEvent(new CustomEvent("window-title-update",{detail:{id:r,title:e}}))},0);return()=>clearTimeout(n)},[e]),/* @__PURE__ */te("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function ln(e){}var cn=R(null);function un(){return $(Gt)}function dn(){const e=H(Nr,Mr),t=$(cn);return t?.active??(zn.length<=1||null!=e)}function hn({children:e,position:t="right",quiet:n=!1}){const r=$(cn),[o,i]=B(null);return q(()=>{if(!r)return;const e="left"===t?r.leftRef:r.rightRef,o=()=>!!e.current&&(i(e.current),n||r.notify(),!0);if(o())return;const a=setInterval(()=>{o()&&clearInterval(a)},50),s=setTimeout(()=>clearInterval(a),2e3);return()=>{clearInterval(a),clearTimeout(s)}},[r,t,n]),o?re(e,o):null}function mn({onClick:e,children:t,className:n}){const r=$(cn);/* @__PURE__ */
|
|
46
|
+
return te("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 pn="erp_window_positions",fn={};try{const e=localStorage.getItem(pn);e&&(fn=JSON.parse(e))}catch{}var wn=null;function yn(){wn&&clearTimeout(wn),wn=setTimeout(()=>{try{localStorage.setItem(pn,JSON.stringify(fn))}catch{}},500)}var gn="erp_activation_order",vn=[];try{const e=localStorage.getItem(gn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(vn=t)}catch{}var bn=null;function xn(){bn&&clearTimeout(bn),bn=setTimeout(()=>{try{localStorage.setItem(gn,JSON.stringify(vn))}catch{}},500)}function kn(e,t){fn[e]||(fn[e]=t,yn())}function En(e){return fn[e]?{...fn[e]}:null}function Cn(e,t){fn[e]=t,yn()}function Mn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(fn))n(fn[e],r,o)&&(delete fn[e],i=!0);i&&yn()}var Nn={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},Sn=4e3,Ln=()=>{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"},Tn={small:.8,medium:1,large:1.25,maximized:1.25},zn=[],An=/* @__PURE__ */new Set,Dn=/* @__PURE__ */new Set,Pn=0,In=/* @__PURE__ */new Map;var Wn=0;function Kn(){return Wn}function Rn(){Wn++,An.forEach(e=>e())}var $n=/* @__PURE__ */new Map,On=/* @__PURE__ */new Map,Fn=/* @__PURE__ */new Map;function jn(){for(let e=zn.length-1;e>=0;e--){const t=Fn.get(zn[e]);if(t?.tab)return t.owner}return null}function qn(){return H(Nr,jn,()=>null)}var Bn=/* @__PURE__ */new Set;var Hn=null;function Un(e){Hn=null,er(e)}function Yn(e){Hn=e;const t=$n.get(e);t&&Un(t)}var Xn=/* @__PURE__ */new Map;function Vn(e){return Xn.get(e)?.holdsChanges()??!1}function Gn(e){const t=Xn.get(e);return t?t.ask():Promise.resolve(!0)}function _n(e){Hn===e&&(Hn=null)}function Jn(e,t,n){if(n&&Fn.set(e,n),t)if($n.set(t,e),On.set(e,t),Bn.delete(t)){zn.unshift(e);const n=vn.indexOf(t);-1!==n&&vn.splice(n,1),vn.unshift(t),xn()}else!function(e,t){const n=vn.indexOf(t);if(-1===n)return void zn.push(e);let r=zn.length;for(let e=0;e<zn.length;e++){const t=On.get(zn[e]);if(t&&vn.indexOf(t)>n){r=e;break}}zn.splice(r,0,e)}(e,t),-1===vn.indexOf(t)&&(vn.push(t),xn());else zn.push(e);Rn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&Hn===t&&Un(e)}function Zn(e){return e?Fn.get(e)?.owner??On.get(e)??null:null}var Qn=/* @__PURE__ */new Set;function er(e){const t=Zn(Mr()),n=zn.indexOf(e);-1!==n&&zn.splice(n,1),zn.push(e);const r=Fn.get(e);if(r?.root)for(const[e,t]of Fn){if(t.root||t.owner!==r.owner||Dn.has(e))continue;const n=zn.indexOf(e);-1!==n&&zn.splice(n,1),zn.push(e)}Dn.delete(e);const o=On.get(e);if(o){const e=vn.indexOf(o);-1!==e&&vn.splice(e,1),vn.push(o),xn(),Hn&&Hn!==o&&(Hn=null)}Rn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const i=Zn(Mr());i&&i!==t&&Qn.forEach(e=>e(i))}function tr(e){const t=zn.indexOf(e);-1!==t&&zn.splice(t,1),Dn.add(e),In.set(e,++Pn);const n=On.get(e);if(n){const e=vn.indexOf(n);-1!==e&&(vn.splice(e,1),xn())}Rn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var nr=/* @__PURE__ */new Set;var rr=8,or=32;function ir(){return e()}var ar=u.windowBar,sr=80,lr=384,cr=400;function ur(e,t=ir()){const n=Math.min(Math.max(e.x,t.x+sr-e.w),t.x+t.w-sr),r=Math.min(Math.max(e.y,t.y),t.y+t.h-ar);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function dr(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=ir();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 hr(e){const t=ir(),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 mr=null;function pr(e){const t=(mr||((mr=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none",`z-index: ${I.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(mr)),mr);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 fr(){mr&&(mr.style.opacity="0",mr.style.display="none")}var wr=[{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"}],yr=350,gr=200;function vr({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o}){const[i,a]=B(!1),s=j(void 0),l=j(void 0);q(()=>()=>{clearTimeout(s.current),clearTimeout(l.current)},[]);const c=()=>{clearTimeout(l.current),s.current=setTimeout(()=>a(!0),yr)},u=()=>{clearTimeout(s.current),l.current=setTimeout(()=>a(!1),gr)};/* @__PURE__ */
|
|
47
47
|
return ee("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u,children:[
|
|
48
|
-
/* @__PURE__ */te("button",{onClick:t,onFocus:c,onBlur:u,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */te("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(l.current),onMouseLeave:u,className:"absolute right-0 top-full z-30 mt-1 grid w-max grid-cols-2 gap-1 rounded-lg border border-line bg-surface p-2 shadow-lg",children:wr.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */te("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__ */te("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var br="rosh-gesture-style";var xr={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},kr=4;function Er(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(br))return;const e=document.createElement("style");e.id=br,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=It(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function Cr(e){const t=zn.indexOf(e);if(-1===t)return-1;const n=
|
|
49
|
-
/* @__PURE__ */te("div",{onMouseDown:e=>{e.stopPropagation(),Pr(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:P.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 Gr({open:t,onClose:i,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:w,bodyScroll:v,onMinimize:C,initialBox:M,actions:T,actionsLeft:z,editing:R=!1,edit:K,allowPinOnTop:O,initialPosition:X,widget:V,compact:Q,appStyle:Z,flushBody:oe,autoHeight:ie,autoMinHeight:ae,autoWidth:se,widgetMenu:le,dimensions:ce,windowKey:ue,openedFromKey:de,accentRgb:he,children:me}){const[pe,fe]=B(()=>r()),we=k()&&!pe,ge=E()&&!!V,[ve,be]=B(0),[xe,ke]=B(!1),Ee=F(null),Ce=F(0);q(()=>{Ce.current=ve},[ve]);const Me=U(e=>{we&&(Ee.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},ke(!0),St(de??null))},[we,de]),Ne=H(Lt,Nt);q(()=>{if(!xe)return;const e=e=>{if(!Ee.current)return;const t=e.clientX-Ee.current.startX;if(Math.abs(e.clientY-Ee.current.startY)>Math.abs(t)+12)return Ee.current=null,ke(!1),be(0),void St(null);be(Math.max(0,t))},t=()=>{if(!Ee.current)return;const e=.3*window.innerWidth,t=Ce.current>e;Ee.current=null,ke(!1),t?(be(window.innerWidth),setTimeout(()=>{i(),be(0),St(null)},180)):(be(0),St(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)}},[xe]);const[Te,Ae]=B(c),De=W(),Pe=De.window;q(()=>{Ae(c)},[c]);const Ie=_(()=>tn(Te).trim()||void 0,[Te]),Re=J(),[We,Ke]=B(!1),$e=F(!1),[Oe,je]=B(!1),[Fe,qe]=B(null),Be=$(_t),He=$(ye),{prefs:Ue,save:Ye}=g(),Xe=!!Ue.window_accent_stripe,Ve=Ue.favorite_documents||[],_e=!!Be&&Ve.some(e=>e.entityType===Be.entityType&&e.entityId===Be.entityId),Qe=U(()=>{if(!Be)return;const e=_e?Ve.filter(e=>!(e.entityType===Be.entityType&&e.entityId===Be.entityId)):[...Ve,{entityType:Be.entityType,entityId:Be.entityId,label:Be.label}];Ye({favorite_documents:e})},[Be,_e,Ve,Ye]),[Ze,et]=B(null),[tt,nt]=B("top-right"===X?"right":"left"),rt=F(!1),ot=F(null);j(()=>{const e=ot.current;e&&(he?e.style.setProperty("--window-accent-rgb",he):e.style.removeProperty("--window-accent-rgb"))},[he]);const it=F(!1),at=F(null),st=F(null),lt=F(null),[ct,ut]=B(!1),dt=F(null),ht=F(null),mt=F(null),[pt,ft]=B(!1);j(()=>{const e=ht.current,t=mt.current;if(!e||!t)return;const n=()=>ft(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 wt=!!K&&!V&&!Q&&!Z&&(K.editing||"hidden"!==K.state),yt=!!(w||T||z)||ct||wt,gt=$(Le),vt=""!==$(Gt),bt=F(null);bt.current=He?{owner:He.key,tab:He.tab,root:!vt}:null;const xt=ue||(He&&!vt?He.key:null),kt=!!gt&&!vt&>.enabled&>.hasState&&(R||gt.declaredEditable)&&!gt.handMounted&&yt&&!V&&!Q&&!Z&&!we,Ct=/* @__PURE__ */te(D,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),Mt=u&&Y(u)?G(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??Ct,Tt=()=>/* @__PURE__ */te("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();qe(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:Mt}),zt=40,{minimize:At,items:Dt,restoreIfMinimized:Pt,openWindows:It}=Je(),Rt=F(`modal-${Math.random().toString(36).slice(2,8)}`).current;q(()=>{if(V)return nr.add(Rt),()=>{nr.delete(Rt)}},[V,Rt]),q(()=>{const e=e=>{const t=e.detail;t?.id===Rt&&Ae(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[Rt]);const[Wt,Kt]=B(P.window),$t=function(e){const t=H(Nr,Mr);return zn.length<=1||t===e}(Rt),Ot=F(K);Ot.current=K;const Ft=!!K&&!K.editing&&"enabled"===K.state;q(()=>{if(!t||!$t||!Ft)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(b(e.target,ot.current)||(e.preventDefault(),e.stopPropagation(),Ot.current?.onEdit()))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,$t,Ft]);const Bt=function(e){return H(Nr,()=>Dn.has(e))}(Rt);Et({panelRef:ot,bodyRef:at,open:t,widget:!!V,active:$t,minimized:Bt});const Ht=H(Ar,Dr),Yt=H($r,Or),Xt=H(Br,Hr),Vt=!O&&!V,Jt=Ht&&Vt,[Qt,nn]=B(!1),rn=Jt&&Xt===Rt,[an,sn]=B(!1),ln=an&&Vt&&Yt===Rt?"picked":null,un=F(Jt);q(()=>{if(un.current&&!Jt){sn(!0);const e=setTimeout(()=>{sn(!1),Wr===Rt&&jr(null)},700);return un.current=Jt,()=>clearTimeout(e)}un.current=Jt},[Jt,Rt]),q(()=>{Jt||nn(!1)},[Jt]),q(()=>{const e=st.current,t=lt.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>ut(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[t]),q(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&ot.current){const t=ot.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=st.current,n=lt.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const dn=F(!1),hn=U(e,[]),mn=U(()=>{const t=e(),n=ce?ce[0]:Nn[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=Tn[Ln()],l=ce?Math.min(ce[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*(zn.length-1),u=Math.max(zt,(i-l)/2),d=(o-a)/2,m=t.h-zt-l-u;return"top-right"===X?{x:t.x+t.w-a-zt,y:t.y+zt,w:a,h:l}:"top-left"===X?{x:t.x+zt,y:t.y+zt,w:a,h:l}:{x:t.x+Math.max(zt,(o-a)/2+zt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),pn=F(!1);t||(pn.current=!1);const wn=ue||d||null;q(()=>{if(!t)return;Jn(Rt,wn,bt.current??void 0),ue||er(Rt),dn.current=!1,Kt(Cr(Rt));const e=()=>{Kt(Cr(Rt))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===ue;if(!e.label)return!1;const t=ot.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(er(Rt),Pn.current)return;const t=ir(),n=Math.min(Un.current.w,t.w-40),o=Math.min(Un.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}),Hn(!1)},i=e=>{const t=e.detail;r(t)&&(er(Rt),qe({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==ue)return;er(Rt);const t=Un.current,n=function(e,t=ir()){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=ot.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=zn.indexOf(e);-1!==t&&(zn.splice(t,1),Kn()),Dn.delete(e),In.delete(e),jn.delete(e);const n=On.get(e);n&&(On.delete(e),$n.delete(n))}(Rt),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,Rt,wn,hn]);const gn=!V&&"maximized"===Ln(),[vn,bn]=B(()=>{if(wn&&fn[wn]){const e={...fn[wn]};return ce&&(e.w=ce[0],ie||(e.h=ce[1])),ur(e)}return M?{x:M.x,y:M.y,w:M.w,h:M.h}:gn?hn():mn()}),[xn,kn]=B(()=>!ie),En=F(pe),Cn=F(null);q(()=>{const e=()=>{const e=r();e!==En.current&&Cn.current?.(e),En.current=e,fe(e),Kt(Cr(Rt))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[Rt]);const Mn=pe&&!!He?.tab&&!vt&&!V&&!we,An=Mn,Pn=F(An);Pn.current=An;const Rn=qn(),Wn=pe&&!!He?.tab&&!V&&!we&&!Ht&&Rn!==He.key,Fn=!!V&&pe&&!Ht&&null!==Rn,[Bn,Hn]=B(()=>wn&&fn[wn]||M?An:An||gn),Un=F(vn);Un.current=vn;const Yn=F(Bn);j(()=>{Yn.current=Bn},[Bn]),j(()=>{if(xn||Mn)return;const e=ot.current,t=at.current;if(!e||!t)return;const n=ae??(V?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const s=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&l.unobserve(a),l.observe(c),a=c);const u=e.offsetHeight-t.offsetHeight,d=t.style.flex,h=t.style.overflowY,m=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const 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,Un.current.y)-24),g=w?Math.min(Un.current.h,y):Math.min(Math.max(n,u+p),y),v=Math.abs(g-o)>1;v&&(o=g,bn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),V||(g<=n?i&&(clearTimeout(i),i=null):(v||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&kn(!0)},160)))},l=new ResizeObserver(s);s(),dt.current&&l.observe(dt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[xn,V,ae,yt,Mn]),j(()=>{if(!ie||!xn||V||!t)return;const e=dt.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||Bn)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=ae??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,Un.current.y)-24);bn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[ie,xn,V,t,Bn,ae]);const Vn=!1!==se&&!V&&!Z&&!we,[Gn,_n]=B(()=>!Vn);j(()=>{if(Gn||!t)return;if(!Vn||Bn)return void _n(!0);const n=ot.current,r=at.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let i=Un.current.w,c=0;const u=()=>_n(!0),d=()=>{c=0;const t=Un.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 v=s(t,l(t.w,w,g),d,zt);v!==t&&(i=v.w,bn(v))};d();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(u,Sn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Gn,t,Vn,Bn]);const Qn=F(null),Zn=!(!He?.tab||vt||V||we);Cn.current=t=>{if(!Zn)return;if(t)return Qn.current||(Qn.current={box:{...Un.current},maximized:Yn.current}),void(Yn.current=!0);const r=Qn.current;Qn.current=null;const o=e();if(r?.maximized)return Yn.current=!0,Hn(!0),void bn(o);const i=r?.box??(wn?fn[wn]:void 0);if(Yn.current=!1,Hn(!1),i&&!n(i,o,!1)){const e={...i};ce&&(e.w=ce[0],ie||(e.h=ce[1])),bn(ur(e))}else bn(mn())},q(()=>{An&&(Yn.current=!0,Hn(!0),bn(hn()))},[An,hn]),q(()=>{if(V)return;const e=()=>{const e=wn?fn[wn]:void 0;if(Yn.current=!1,Hn(!1),e){const t={...e};ce&&(t.w=ce[0],ie||(t.h=ce[1])),bn(ur(t))}else bn(mn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[V,mn,wn]),q(()=>{t&&wn&&!Mn&&(fn[wn]=vn,yn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[vn,t,wn,Mn]),q(()=>{if(!t)return;const e=()=>{Yn.current?bn(hn()):document.body.classList.contains("rosh-gesturing")||bn(ur)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Bn&&(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,Bn,hn]),q(()=>{if(t&&(Ke(!1),$e.current=!1,rt.current=!1,_n(!Vn),!Pn.current)){if(wn&&fn[wn]){const e=fn[wn];return void bn(t=>ur({...e,...ie?{h:t.h}:{},...Vn?{x:t.x,w:t.w}:{}}))}M&&(bn({x:M.x,y:M.y,w:M.w,h:M.h}),Hn(M.maximized))}},[t]),q(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{ot.current?.contains(t.target)&&!$e.current&&($e.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 ar="auto"===m?We:!0===m,sr=He&&!vt?He.key:null,dr=_(()=>jt(Te),[Te]),mr=F({shortcutSpec:Be,isOnDesktop:_e,toggleDesktopShortcut:Qe,taskbarStrings:De.taskbar});j(()=>{mr.current={shortcutSpec:Be,isOnDesktop:_e,toggleDesktopShortcut:Qe,taskbarStrings:De.taskbar}});const wr=F(null);wr.current||(wr.current={open:(e,t)=>qe({x:e,y:t}),items:()=>{const e=mr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of on[Rt]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),q(()=>{if(t&&sr)return()=>{return e=sr,void(qt.delete(e)&&Ut());var e}},[t,sr]),Ge(!(ue||!t)&&ar);const yr=U(()=>ar||"auto"===m&&$e.current,[ar,m]),gr=U(async e=>{if(rt.current)return!1;if(!yr())return!0;rt.current=!0;const t=Ie,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 rt.current=!1,r},[yr,Ie]),br=U(()=>rt.current?Promise.resolve():yr()?gr("close").then(e=>{e&&i()}):(i(),Promise.resolve()),[yr,gr,i]),Lr=U(async()=>{await gr("discard")&&($e.current=!1,Ke(!1),Ot.current?.onDiscard())},[gr]),Tr=U(async()=>{const e=await gr("switch");return e&&($e.current=!1,Ke(!1)),e},[gr]),zr=F(()=>!1);j(()=>{zr.current=yr}),j(()=>{if(!t||!ue)return;const e={holdsChanges:()=>zr.current(),ask:Tr};return Xn.set(ue,e),()=>{Xn.get(ue)===e&&Xn.delete(ue)}},[t,ue,Tr]),j(()=>{if(!t||!xt)return;const e=e=>{e.detail?.windowKey===xt&&br()};return window.addEventListener(Sr,e),()=>window.removeEventListener(Sr,e)},[t,xt,br]);const Ir=F(null),Rr=U(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(qe(null),er(Rt),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=ot.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Ir.current){const t=Ir.current;Ir.current=null,d=t.w,u=t.h;const n=s?Math.min(Math.max(20,e.clientX-s.left),t.w-20):t.w/2;l=e.clientX-n,c=e.clientY-12,a&&(a.style.width=`${d}px`,a.style.height=`${u}px`,a.style.left=`${l}px`,a.style.top=`${c}px`)}else l=s?s.left:Un.current.x,c=s?s.top:Un.current.y,u=s?s.height:Un.current.h,d=s?s.width:Un.current.w;Hn(!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)<kr&&Math.abs(e.clientY-i)<kr)return;r=Er(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)`),Un.current={...Un.current,x:s,y:u},!V){const t=function(e,t){const n=ir(),r=e<=n.x+rr,o=e>=n.x+n.w-rr,i=t<=n.y+rr,a=t>=n.y+n.h-rr,s=e<=n.x+or,l=e>=n.x+n.w-or,c=t<=n.y+or,u=t>=n.y+n.h-or;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?pr(hr(t)):fr())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),fr();const e=ur({...Un.current});if(Un.current=e,!V&&h){Ir.current={x:l,y:c,w:d,h:u};const e=hr(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(V){const t=e.x+e.w/2,n=window.innerWidth/2;nt(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)},[]),Kr=U((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=ot.current,l=s?.getBoundingClientRect(),c=l?l.left:Un.current.x,u=l?l.top:Un.current.y,d=l?l.width:Un.current.w,h=l?l.height:Un.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;Hn(!1),bn({x:c,y:u,w:d,h:h}),Un.current={x:c,y:u,w:d,h:h};let y=0,g=null;const v=()=>{if(y=0,!g)return;const e=g;g=null,Un.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},b=e=>{if(!o){if(Math.abs(e.clientX-i)<kr&&Math.abs(e.clientY-a)<kr)return;o=Er(n,r,xr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(lr,d+e)),w&&(i=Math.max(cr,h+t)),m){const t=Math.max(lr,d-e);n=c+d-t,o=t}if(p){const e=Math.max(cr,h-t);r=u+h-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(v))},x=()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),v(),o?.(),bn({...Un.current})};window.addEventListener("pointermove",b),window.addEventListener("pointerup",x)},[]),Fr=U(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(),er(Rt),"Enter"===e.key)return void(Bn?(Hn(!1),bn(mn())):(Hn(!0),bn(hn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Ir.current||(Ir.current={...Un.current})};if(r<0)return e(),Hn(!0),void bn(hn());if(r>0){if(Bn)return Hn(!1),void bn(mn());if(Ir.current){const e=ur(Ir.current);return Ir.current=null,Un.current=e,void bn(e)}return void tr(Rt)}e(),Hn(!1);const t=hr(n<0?"left":"right");return Un.current=t,void bn(t)}if(Bn)return;const o=Un.current,i=e.shiftKey?{...o,w:Math.max(lr,o.w+24*n),h:Math.max(cr,o.h+24*r)}:ur({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Un.current=i,bn(i)},[Rt,Bn,mn,hn]),qr=U(e=>{Ir.current||(Ir.current={...Un.current}),Hn(!1);const t=hr(e);Un.current=t,bn(t),er(Rt)},[Rt]),Ur=An||Jt?{}:{tabIndex:0,role:"group","aria-label":Ie?`${Ie} — ${Pe.windowSuffix}`:Pe.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},Yr=()=>{Hn(!0),bn(hn())},Xr=U(()=>{const e=ot.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(Zt);t&&!t.disabled&&t.click()}},[]);q(()=>{if(!t)return;if(V)return;const e=e=>{if(zn[zn.length-1]===Rt&&!b(e.target,ot.current)&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Xr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&ot.current?.contains(t)))return;if(t.closest(en))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Xr,Rt,V]),q(()=>{if(!t)return;const e=e=>{zn[zn.length-1]===Rt&&(b(e.target,ot.current)||((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:Rt}})),$e.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:Rt}})))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),q(()=>{if(!t)return;if(V)return;const e=e=>{if("Escape"===e.key&&zn[zn.length-1]===Rt){if(I(e))return e.preventDefault(),void e.stopPropagation();if(Mn&&!R)return;e.preventDefault(),e.stopPropagation(),br()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,br,Rt,V,Mn,R]);const Vr=t&&(void 0!==p||void 0!==f),[Gr]=B(()=>{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=Mn&&!He?.home&&dr.actions.length>0;q(()=>{t&&sr&&function(e,t){const n=qt.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(qt.set(e,t),Ut())}(sr,{title:dr.text||Ie,dirty:ar,copy:dr.copy,actions:_r&&Gr?Gr:void 0,menu:wr.current??void 0})},[t,sr,Ie,ar,dr.text,dr.copy,_r,Gr]);const Jr=U(e=>{const t=document.getElementById("nav-boundary-toast");t&&t.remove();const n="bottom"===e?["That's the last one, chief.","You've hit rock bottom... of the list.","End of the line, buddy.","Nothing left. Go outside.","Congratulations, you scrolled to the void.","There's no more. I checked.","You've reached the edge of the known universe.","Plot twist: there is no next one.","Even scrolling has limits. Unlike your ambition.","Last one. Time to touch grass."]:["Already at the top. Overachiever.","There is no item above this. Trust me.","You're #1. Literally.","Can't go higher. You've peaked.","This is it. The summit. The top.","First item. No VIP lounge above this.","Going up? Nope. Elevator's broken.","You want negative indexes? Bold.","Top of the list. Top of the world.","The only way is down from here."],r=n[Math.floor(Math.random()*n.length)],o=document.createElement("div");o.id="nav-boundary-toast",o.className="fixed bottom-6 left-1/2 -translate-x-1/2 z-(--z-toast) bg-gray-900 text-on-accent flex min-h-10 items-center px-5 py-3 rounded-lg shadow-lg text-sm font-medium transition-opacity duration-300",o.textContent=r,document.body.appendChild(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),300)},2e3)},[]);if(q(()=>{if(!t)return;const e=e=>{if(zn[zn.length-1]!==Rt)return;if(b(e.target,ot.current))return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Vr&&(e.preventDefault(),p?p():Jr("bottom")),"k"===e.key&&Vr&&(e.preventDefault(),f?f():Jr("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Vr,Jr,Rt]),!t||pn.current)return null;const Qr=Jt?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=ir(),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}}(Rt):null,Zr=Jt&&Qr?Math.min(Qr.w/vn.w,Qr.h/vn.h):1,eo=(()=>{if(Jt&&Qr){const e=Zr,t=vn.w*e,n=vn.h*e,r=Qr.x+(Qr.w-t)/2-vn.x,o=Qr.y+(Qr.h-n)/2-vn.y,i=Qt||rn;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:P.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(an&&Vt){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:P.expose+30}:{}}}return null})(),to=x({modal:!1,titleId:!V&&(Mn?!He?.home:!we)?Re:void 0,label:dr.text||Ie}),no=/* @__PURE__ */ee("div",{children:[
|
|
50
|
-
/* @__PURE__ */ee("div",{ref:ot,"data-modal-panel":!0,"data-modal-id":
|
|
51
|
-
/* @__PURE__ */te("h2",{id:
|
|
48
|
+
/* @__PURE__ */te("button",{onClick:t,onFocus:c,onBlur:u,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */te("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(l.current),onMouseLeave:u,className:"absolute right-0 top-full z-30 mt-1 grid w-max grid-cols-2 gap-1 rounded-lg border border-line bg-surface p-2 shadow-lg",children:wr.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */te("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__ */te("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var br="rosh-gesture-style";var xr={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},kr=4;function Er(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(br))return;const e=document.createElement("style");e.id=br,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=It(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function Cr(e){const t=zn.indexOf(e);if(-1===t)return-1;const n=I.window+t*I.windowStep,r=Fn.get(e);if(!r||r.root)return n;let o=-1;for(const[e,t]of Fn){if(!t.root||t.owner!==r.owner)continue;const n=zn.indexOf(e);-1!==n&&(o=Math.max(o,I.window+n*I.windowStep))}return o>=n?o+2+Math.min(t,7):n}function Mr(){return zn[zn.length-1]||null}function Nr(e){return An.add(e),()=>{An.delete(e)}}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=zn.length-1;e>=0;e--)nr.has(zn[e])||zn.splice(e,1);vn=vn.filter(e=>{const t=$n.get(e);return null!=t&&nr.has(t)}),xn(),Rn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var Sr="modal-close-request";function Lr(e){H(Nr,Kn);const t=$(cn);if(zn.length<=1)return!0;if(e){const t=$n.get(e);if(null!=t)return Mr()===t}return t?.active??null!=Mr()}var Tr=!1,zr=/* @__PURE__ */new Set;function Ar(e){return zr.add(e),()=>zr.delete(e)}function Dr(){return Tr}function Pr(e){Tr!==e&&(Tr=e,zr.forEach(e=>e()))}function Ir(){Pr(!Tr)}function Wr(){Pr(!1)}var Kr=null,Rr=/* @__PURE__ */new Set;function $r(e){return Rr.add(e),()=>Rr.delete(e)}function Or(){return Kr}function Fr(e){Kr!==e&&(Kr=e,Rr.forEach(e=>e()))}var jr=null,qr=/* @__PURE__ */new Set;function Br(e){return qr.add(e),()=>qr.delete(e)}function Hr(){return jr}function Ur(e){jr!==e&&(jr=e,qr.forEach(e=>e()))}function Yr(){if(!jr)return void Pr(!1);Fr(jr),Ur(null),Pr(!1)}function Xr(){Pr(!Tr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function Vr(){const e=H(Ar,Dr),[t,n]=B(e),[r,o]=B(e);return q(()=>{if(e){n(!0);const e=requestAnimationFrame(()=>o(!0));return()=>cancelAnimationFrame(e)}o(!1);const t=setTimeout(()=>n(!1),280);return()=>clearTimeout(t)},[e]),t&&"undefined"!=typeof document?re(
|
|
49
|
+
/* @__PURE__ */te("div",{onMouseDown:e=>{e.stopPropagation(),Pr(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:I.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 Gr({open:t,onClose:i,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:w,bodyScroll:v,onMinimize:C,initialBox:M,actions:T,actionsLeft:z,editing:P=!1,edit:R,allowPinOnTop:O,initialPosition:X,widget:V,compact:Z,appStyle:Q,flushBody:oe,autoHeight:ie,autoMinHeight:ae,autoWidth:se,widgetMenu:le,dimensions:ce,windowKey:ue,openedFromKey:de,accentRgb:he,children:me}){const[pe,fe]=B(()=>r()),we=k()&&!pe,ge=E()&&!!V,[ve,be]=B(0),[xe,ke]=B(!1),Ee=j(null),Ce=j(0);q(()=>{Ce.current=ve},[ve]);const Me=U(e=>{we&&(Ee.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},ke(!0),St(de??null))},[we,de]),Ne=H(Lt,Nt);q(()=>{if(!xe)return;const e=e=>{if(!Ee.current)return;const t=e.clientX-Ee.current.startX;if(Math.abs(e.clientY-Ee.current.startY)>Math.abs(t)+12)return Ee.current=null,ke(!1),be(0),void St(null);be(Math.max(0,t))},t=()=>{if(!Ee.current)return;const e=.3*window.innerWidth,t=Ce.current>e;Ee.current=null,ke(!1),t?(be(window.innerWidth),setTimeout(()=>{i(),be(0),St(null)},180)):(be(0),St(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)}},[xe]);const[Te,Ae]=B(c),De=K(),Pe=De.window;q(()=>{Ae(c)},[c]);const Ie=_(()=>tn(Te).trim()||void 0,[Te]),We=J(),[Ke,Re]=B(!1),$e=j(!1),[Oe,Fe]=B(!1),[je,qe]=B(null),Be=$(_t),He=$(ye),{prefs:Ue,save:Ye}=g(),Xe=!!Ue.window_accent_stripe,Ve=Ue.favorite_documents||[],_e=!!Be&&Ve.some(e=>e.entityType===Be.entityType&&e.entityId===Be.entityId),Ze=U(()=>{if(!Be)return;const e=_e?Ve.filter(e=>!(e.entityType===Be.entityType&&e.entityId===Be.entityId)):[...Ve,{entityType:Be.entityType,entityId:Be.entityId,label:Be.label}];Ye({favorite_documents:e})},[Be,_e,Ve,Ye]),[Qe,et]=B(null),[tt,nt]=B("top-right"===X?"right":"left"),rt=j(!1),ot=j(null);F(()=>{const e=ot.current;e&&(he?e.style.setProperty("--window-accent-rgb",he):e.style.removeProperty("--window-accent-rgb"))},[he]);const it=j(!1),at=j(null),st=j(null),lt=j(null),[ct,ut]=B(!1),dt=j(null),ht=j(null),mt=j(null),[pt,ft]=B(!1);F(()=>{const e=ht.current,t=mt.current;if(!e||!t)return;const n=()=>ft(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 wt=!!R&&!V&&!Z&&!Q&&(R.editing||"hidden"!==R.state),yt=!!(w||T||z)||ct||wt,gt=$(Le),vt=""!==$(Gt),bt=j(null);bt.current=He?{owner:He.key,tab:He.tab,root:!vt}:null;const xt=ue||(He&&!vt?He.key:null),kt=!!gt&&!vt&>.enabled&>.hasState&&(P||gt.declaredEditable)&&!gt.handMounted&&yt&&!V&&!Z&&!Q&&!we,Ct=/* @__PURE__ */te(D,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),Mt=u&&Y(u)?G(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??Ct,Tt=()=>/* @__PURE__ */te("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();qe(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:Mt}),zt=40,{minimize:At,items:Dt,restoreIfMinimized:Pt,openWindows:It}=Je(),Wt=j(`modal-${Math.random().toString(36).slice(2,8)}`).current;q(()=>{if(V)return nr.add(Wt),()=>{nr.delete(Wt)}},[V,Wt]),q(()=>{const e=e=>{const t=e.detail;t?.id===Wt&&Ae(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[Wt]);const[Kt,Rt]=B(I.window),$t=function(e){const t=H(Nr,Mr);return zn.length<=1||t===e}(Wt),Ot=j(R);Ot.current=R;const jt=!!R&&!R.editing&&"enabled"===R.state;q(()=>{if(!t||!$t||!jt)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(b(e.target,ot.current)||(e.preventDefault(),e.stopPropagation(),Ot.current?.onEdit()))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,$t,jt]);const Bt=function(e){return H(Nr,()=>Dn.has(e))}(Wt);Et({panelRef:ot,bodyRef:at,open:t,widget:!!V,active:$t,minimized:Bt});const Ht=H(Ar,Dr),Yt=H($r,Or),Xt=H(Br,Hr),Vt=!O&&!V,Jt=Ht&&Vt,[Zt,nn]=B(!1),rn=Jt&&Xt===Wt,[an,sn]=B(!1),ln=an&&Vt&&Yt===Wt?"picked":null,un=j(Jt);q(()=>{if(un.current&&!Jt){sn(!0);const e=setTimeout(()=>{sn(!1),Kr===Wt&&Fr(null)},700);return un.current=Jt,()=>clearTimeout(e)}un.current=Jt},[Jt,Wt]),q(()=>{Jt||nn(!1)},[Jt]),q(()=>{const e=st.current,t=lt.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>ut(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[t]),q(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&ot.current){const t=ot.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=st.current,n=lt.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const dn=j(!1),hn=U(e,[]),mn=U(()=>{const t=e(),n=ce?ce[0]:Nn[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=Tn[Ln()],l=ce?Math.min(ce[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*(zn.length-1),u=Math.max(zt,(i-l)/2),d=(o-a)/2,m=t.h-zt-l-u;return"top-right"===X?{x:t.x+t.w-a-zt,y:t.y+zt,w:a,h:l}:"top-left"===X?{x:t.x+zt,y:t.y+zt,w:a,h:l}:{x:t.x+Math.max(zt,(o-a)/2+zt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),pn=j(!1);t||(pn.current=!1);const wn=ue||d||null;q(()=>{if(!t)return;Jn(Wt,wn,bt.current??void 0),ue||er(Wt),dn.current=!1,Rt(Cr(Wt));const e=()=>{Rt(Cr(Wt))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===ue;if(!e.label)return!1;const t=ot.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(er(Wt),Pn.current)return;const t=ir(),n=Math.min(Un.current.w,t.w-40),o=Math.min(Un.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}),Hn(!1)},i=e=>{const t=e.detail;r(t)&&(er(Wt),qe({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==ue)return;er(Wt);const t=Un.current,n=function(e,t=ir()){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=ot.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=zn.indexOf(e);-1!==t&&(zn.splice(t,1),Rn()),Dn.delete(e),In.delete(e),Fn.delete(e);const n=On.get(e);n&&(On.delete(e),$n.delete(n))}(Wt),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,Wt,wn,hn]);const gn=!V&&"maximized"===Ln(),[vn,bn]=B(()=>{if(wn&&fn[wn]){const e={...fn[wn]};return ce&&(e.w=ce[0],ie||(e.h=ce[1])),ur(e)}return M?{x:M.x,y:M.y,w:M.w,h:M.h}:gn?hn():mn()}),[xn,kn]=B(()=>!ie),En=j(pe),Cn=j(null);q(()=>{const e=()=>{const e=r();e!==En.current&&Cn.current?.(e),En.current=e,fe(e),Rt(Cr(Wt))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[Wt]);const Mn=pe&&!!He?.tab&&!vt&&!V&&!we,An=Mn,Pn=j(An);Pn.current=An;const Wn=qn(),Kn=pe&&!!He?.tab&&!V&&!we&&!Ht&&Wn!==He.key,jn=!!V&&pe&&!Ht&&null!==Wn,[Bn,Hn]=B(()=>wn&&fn[wn]||M?An:An||gn),Un=j(vn);Un.current=vn;const Yn=j(Bn);F(()=>{Yn.current=Bn},[Bn]),F(()=>{if(xn||Mn)return;const e=ot.current,t=at.current;if(!e||!t)return;const n=ae??(V?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const s=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&l.unobserve(a),l.observe(c),a=c);const u=e.offsetHeight-t.offsetHeight,d=t.style.flex,h=t.style.overflowY,m=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const 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,Un.current.y)-24),g=w?Math.min(Un.current.h,y):Math.min(Math.max(n,u+p),y),v=Math.abs(g-o)>1;v&&(o=g,bn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),V||(g<=n?i&&(clearTimeout(i),i=null):(v||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&kn(!0)},160)))},l=new ResizeObserver(s);s(),dt.current&&l.observe(dt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[xn,V,ae,yt,Mn]),F(()=>{if(!ie||!xn||V||!t)return;const e=dt.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||Bn)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=ae??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,Un.current.y)-24);bn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[ie,xn,V,t,Bn,ae]);const Vn=!1!==se&&!V&&!Q&&!we,[Gn,_n]=B(()=>!Vn);F(()=>{if(Gn||!t)return;if(!Vn||Bn)return void _n(!0);const n=ot.current,r=at.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let i=Un.current.w,c=0;const u=()=>_n(!0),d=()=>{c=0;const t=Un.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 v=s(t,l(t.w,w,g),d,zt);v!==t&&(i=v.w,bn(v))};d();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(u,Sn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Gn,t,Vn,Bn]);const Zn=j(null),Qn=!(!He?.tab||vt||V||we);Cn.current=t=>{if(!Qn)return;if(t)return Zn.current||(Zn.current={box:{...Un.current},maximized:Yn.current}),void(Yn.current=!0);const r=Zn.current;Zn.current=null;const o=e();if(r?.maximized)return Yn.current=!0,Hn(!0),void bn(o);const i=r?.box??(wn?fn[wn]:void 0);if(Yn.current=!1,Hn(!1),i&&!n(i,o,!1)){const e={...i};ce&&(e.w=ce[0],ie||(e.h=ce[1])),bn(ur(e))}else bn(mn())},q(()=>{An&&(Yn.current=!0,Hn(!0),bn(hn()))},[An,hn]),q(()=>{if(V)return;const e=()=>{const e=wn?fn[wn]:void 0;if(Yn.current=!1,Hn(!1),e){const t={...e};ce&&(t.w=ce[0],ie||(t.h=ce[1])),bn(ur(t))}else bn(mn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[V,mn,wn]),q(()=>{t&&wn&&!Mn&&(fn[wn]=vn,yn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[vn,t,wn,Mn]),q(()=>{if(!t)return;const e=()=>{Yn.current?bn(hn()):document.body.classList.contains("rosh-gesturing")||bn(ur)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Bn&&(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,Bn,hn]),q(()=>{if(t&&(Re(!1),$e.current=!1,rt.current=!1,_n(!Vn),!Pn.current)){if(wn&&fn[wn]){const e=fn[wn];return void bn(t=>ur({...e,...ie?{h:t.h}:{},...Vn?{x:t.x,w:t.w}:{}}))}M&&(bn({x:M.x,y:M.y,w:M.w,h:M.h}),Hn(M.maximized))}},[t]),q(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{ot.current?.contains(t.target)&&!$e.current&&($e.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 ar="auto"===m?Ke:!0===m,sr=He&&!vt?He.key:null,dr=_(()=>Ft(Te),[Te]),mr=j({shortcutSpec:Be,isOnDesktop:_e,toggleDesktopShortcut:Ze,taskbarStrings:De.taskbar});F(()=>{mr.current={shortcutSpec:Be,isOnDesktop:_e,toggleDesktopShortcut:Ze,taskbarStrings:De.taskbar}});const wr=j(null);wr.current||(wr.current={open:(e,t)=>qe({x:e,y:t}),items:()=>{const e=mr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of on[Wt]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),q(()=>{if(t&&sr)return()=>{return e=sr,void(qt.delete(e)&&Ut());var e}},[t,sr]),Ge(!(ue||!t)&&ar);const yr=U(()=>ar||"auto"===m&&$e.current,[ar,m]),gr=U(async e=>{if(rt.current)return!1;if(!yr())return!0;rt.current=!0;const t=Ie,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 rt.current=!1,r},[yr,Ie]),br=U(()=>rt.current?Promise.resolve():yr()?gr("close").then(e=>{e&&i()}):(i(),Promise.resolve()),[yr,gr,i]),Lr=U(async()=>{await gr("discard")&&($e.current=!1,Re(!1),Ot.current?.onDiscard())},[gr]),Tr=U(async()=>{const e=await gr("switch");return e&&($e.current=!1,Re(!1)),e},[gr]),zr=j(()=>!1);F(()=>{zr.current=yr}),F(()=>{if(!t||!ue)return;const e={holdsChanges:()=>zr.current(),ask:Tr};return Xn.set(ue,e),()=>{Xn.get(ue)===e&&Xn.delete(ue)}},[t,ue,Tr]),F(()=>{if(!t||!xt)return;const e=e=>{e.detail?.windowKey===xt&&br()};return window.addEventListener(Sr,e),()=>window.removeEventListener(Sr,e)},[t,xt,br]);const Ir=j(null),Wr=U(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(qe(null),er(Wt),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=ot.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Ir.current){const t=Ir.current;Ir.current=null,d=t.w,u=t.h;const n=s?Math.min(Math.max(20,e.clientX-s.left),t.w-20):t.w/2;l=e.clientX-n,c=e.clientY-12,a&&(a.style.width=`${d}px`,a.style.height=`${u}px`,a.style.left=`${l}px`,a.style.top=`${c}px`)}else l=s?s.left:Un.current.x,c=s?s.top:Un.current.y,u=s?s.height:Un.current.h,d=s?s.width:Un.current.w;Hn(!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)<kr&&Math.abs(e.clientY-i)<kr)return;r=Er(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)`),Un.current={...Un.current,x:s,y:u},!V){const t=function(e,t){const n=ir(),r=e<=n.x+rr,o=e>=n.x+n.w-rr,i=t<=n.y+rr,a=t>=n.y+n.h-rr,s=e<=n.x+or,l=e>=n.x+n.w-or,c=t<=n.y+or,u=t>=n.y+n.h-or;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?pr(hr(t)):fr())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),fr();const e=ur({...Un.current});if(Un.current=e,!V&&h){Ir.current={x:l,y:c,w:d,h:u};const e=hr(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(V){const t=e.x+e.w/2,n=window.innerWidth/2;nt(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)},[]),Rr=U((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=ot.current,l=s?.getBoundingClientRect(),c=l?l.left:Un.current.x,u=l?l.top:Un.current.y,d=l?l.width:Un.current.w,h=l?l.height:Un.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;Hn(!1),bn({x:c,y:u,w:d,h:h}),Un.current={x:c,y:u,w:d,h:h};let y=0,g=null;const v=()=>{if(y=0,!g)return;const e=g;g=null,Un.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},b=e=>{if(!o){if(Math.abs(e.clientX-i)<kr&&Math.abs(e.clientY-a)<kr)return;o=Er(n,r,xr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(lr,d+e)),w&&(i=Math.max(cr,h+t)),m){const t=Math.max(lr,d-e);n=c+d-t,o=t}if(p){const e=Math.max(cr,h-t);r=u+h-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(v))},x=()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),v(),o?.(),bn({...Un.current})};window.addEventListener("pointermove",b),window.addEventListener("pointerup",x)},[]),jr=U(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(),er(Wt),"Enter"===e.key)return void(Bn?(Hn(!1),bn(mn())):(Hn(!0),bn(hn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Ir.current||(Ir.current={...Un.current})};if(r<0)return e(),Hn(!0),void bn(hn());if(r>0){if(Bn)return Hn(!1),void bn(mn());if(Ir.current){const e=ur(Ir.current);return Ir.current=null,Un.current=e,void bn(e)}return void tr(Wt)}e(),Hn(!1);const t=hr(n<0?"left":"right");return Un.current=t,void bn(t)}if(Bn)return;const o=Un.current,i=e.shiftKey?{...o,w:Math.max(lr,o.w+24*n),h:Math.max(cr,o.h+24*r)}:ur({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Un.current=i,bn(i)},[Wt,Bn,mn,hn]),qr=U(e=>{Ir.current||(Ir.current={...Un.current}),Hn(!1);const t=hr(e);Un.current=t,bn(t),er(Wt)},[Wt]),Ur=An||Jt?{}:{tabIndex:0,role:"group","aria-label":Ie?`${Ie} — ${Pe.windowSuffix}`:Pe.windowSuffix,"aria-keyshortcuts":"ArrowUp ArrowDown ArrowLeft ArrowRight Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+ArrowRight Control+ArrowUp Control+ArrowDown Control+ArrowLeft Control+ArrowRight Enter",onKeyDown:jr},Yr=()=>{Hn(!0),bn(hn())},Xr=U(()=>{const e=ot.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(Qt);t&&!t.disabled&&t.click()}},[]);q(()=>{if(!t)return;if(V)return;const e=e=>{if(zn[zn.length-1]===Wt&&!b(e.target,ot.current)&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Xr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&ot.current?.contains(t)))return;if(t.closest(en))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Xr,Wt,V]),q(()=>{if(!t)return;const e=e=>{zn[zn.length-1]===Wt&&(b(e.target,ot.current)||((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:Wt}})),$e.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:Wt}})))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),q(()=>{if(!t)return;if(V)return;const e=e=>{if("Escape"===e.key&&zn[zn.length-1]===Wt){if(W(e))return e.preventDefault(),void e.stopPropagation();if(Mn&&!P)return;e.preventDefault(),e.stopPropagation(),br()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,br,Wt,V,Mn,P]);const Vr=t&&(void 0!==p||void 0!==f),[Gr]=B(()=>{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=Mn&&!He?.home&&dr.actions.length>0;q(()=>{t&&sr&&function(e,t){const n=qt.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(qt.set(e,t),Ut())}(sr,{title:dr.text||Ie,dirty:ar,copy:dr.copy,actions:_r&&Gr?Gr:void 0,menu:wr.current??void 0})},[t,sr,Ie,ar,dr.text,dr.copy,_r,Gr]);const Jr=U(e=>{const t=document.getElementById("nav-boundary-toast");t&&t.remove();const n="bottom"===e?["That's the last one, chief.","You've hit rock bottom... of the list.","End of the line, buddy.","Nothing left. Go outside.","Congratulations, you scrolled to the void.","There's no more. I checked.","You've reached the edge of the known universe.","Plot twist: there is no next one.","Even scrolling has limits. Unlike your ambition.","Last one. Time to touch grass."]:["Already at the top. Overachiever.","There is no item above this. Trust me.","You're #1. Literally.","Can't go higher. You've peaked.","This is it. The summit. The top.","First item. No VIP lounge above this.","Going up? Nope. Elevator's broken.","You want negative indexes? Bold.","Top of the list. Top of the world.","The only way is down from here."],r=n[Math.floor(Math.random()*n.length)],o=document.createElement("div");o.id="nav-boundary-toast",o.className="fixed bottom-6 left-1/2 -translate-x-1/2 z-(--z-toast) bg-gray-900 text-on-accent flex min-h-10 items-center px-5 py-3 rounded-lg shadow-lg text-sm font-medium transition-opacity duration-300",o.textContent=r,document.body.appendChild(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),300)},2e3)},[]);if(q(()=>{if(!t)return;const e=e=>{if(zn[zn.length-1]!==Wt)return;if(b(e.target,ot.current))return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Vr&&(e.preventDefault(),p?p():Jr("bottom")),"k"===e.key&&Vr&&(e.preventDefault(),f?f():Jr("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Vr,Jr,Wt]),!t||pn.current)return null;const Zr=Jt?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=ir(),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}}(Wt):null,Qr=Jt&&Zr?Math.min(Zr.w/vn.w,Zr.h/vn.h):1,eo=(()=>{if(Jt&&Zr){const e=Qr,t=vn.w*e,n=vn.h*e,r=Zr.x+(Zr.w-t)/2-vn.x,o=Zr.y+(Zr.h-n)/2-vn.y,i=Zt||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:I.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(an&&Vt){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:I.expose+30}:{}}}return null})(),to=x({modal:!1,titleId:!V&&(Mn?!He?.home:!we)?We:void 0,label:dr.text||Ie}),no=/* @__PURE__ */ee("div",{children:[
|
|
50
|
+
/* @__PURE__ */ee("div",{ref:ot,"data-modal-panel":!0,"data-modal-id":Wt,"data-window-key":ue||void 0,...O?{"data-utility":""}:{},...Oe?{"data-pinned-top":""}:{},...V?{"data-widget":""}:{},...He?{"data-window-owner":He.key}:{},...He&&!vt?{"data-window-root":""}:{},...Mn?{"data-window-tab":""}:{},...to,className:Mn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(V?$t?"shadow-xl":"shadow-lg":"border "+($t?"shadow-xl border-line":"shadow-lg border-line-strong")),onMouseDownCapture:e=>{if(it.current=!1,Jt){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),Fr(Wt),Pr(!1),void er(Wt)}if(!$t&&!V&&!Oe&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===ot.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),it.current=!0,qe(null),er(Wt),window.addEventListener("mouseup",()=>{setTimeout(()=>{it.current=!1},0)},{once:!0}))}},onClickCapture:e=>{it.current&&(it.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(Jt)return;qe(null);e.target.closest("[data-modal-panel]")===ot.current&&(e.target.closest("button, input, a, select, textarea")||er(Wt))},style:we?{zIndex:Kt+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${ve}px)`,transition:xe?"none":"transform 180ms ease-out",...V?{display:"none"}:{},...Kt<0?{display:"none"}:{},...$t||Oe||Ne&&ue===Ne?{}:{display:"none"}}:{zIndex:Oe?I.pinnedWindow:Kt+1,width:vn.w,height:vn.h,top:vn.y,...V&&"right"===tt?{right:window.innerWidth-vn.x-vn.w}:{left:vn.x},...Kt<0&&!Oe?{display:"none"}:{},...ge?{display:"none"}:{},...Kn||jn?{visibility:"hidden",pointerEvents:"none"}:{},...eo??{}},children:[we&&!V&&/* @__PURE__ */te("div",{onPointerDown:Me,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),V?null:Mn?He?.home?null:/* @__PURE__ */ee(ne,{children:[
|
|
51
|
+
/* @__PURE__ */te("h2",{id:We,"data-window-title":!0,className:"sr-only",children:dr.text||Ie}),_r&&Gr&&re(
|
|
52
52
|
/* @__PURE__ */te(ne,{children:dr.actions}),Gr),dr.badges.length>0&&/* @__PURE__ */te("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__ */ee("div",
|
|
53
|
+
/* @__PURE__ */ee("div",Z?{onPointerDown:Wr,"data-window-chrome":"",...Ur,className:"flex items-center justify-between h-(--row-height-compact-bar) px-3 border-b border-line shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+($t?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:$t?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
54
54
|
/* @__PURE__ */ee("div",{"data-window-title":!0,title:Ie,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:$t?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Jt&&Tt(),
|
|
55
|
-
/* @__PURE__ */te("span",{id:
|
|
56
|
-
/* @__PURE__ */te("button",{type:"button",onClick:br,"aria-label":Pe.close,className:"rounded p-0.5 text-ink-faintest hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */te(D,{name:"close",className:"h-4 w-4"})})]})]}:
|
|
55
|
+
/* @__PURE__ */te("span",{id:We,className:"truncate",children:Jt?tn(Te):Te})]}),!Jt&&/* @__PURE__ */ee("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[O&&/* @__PURE__ */te("button",{onClick:()=>Fe(e=>!e),title:Oe?Pe.unpin:Pe.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(Oe?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */te(D,{name:"bookmark-square",className:"h-3 w-3",fill:Oe?"currentColor":"none",strokeWidth:1.5})}),
|
|
56
|
+
/* @__PURE__ */te("button",{type:"button",onClick:br,"aria-label":Pe.close,className:"rounded p-0.5 text-ink-faintest hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */te(D,{name:"close",className:"h-4 w-4"})})]})]}:Q?{onPointerDown:Wr,"data-window-chrome":"",...Ur,className:"flex items-center justify-between h-(--row-height-compact-bar) px-3 border-b border-line shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+($t?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:$t?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
57
57
|
/* @__PURE__ */ee("div",{"data-window-title":!0,title:Ie,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:$t?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Jt&&Tt(),
|
|
58
|
-
/* @__PURE__ */te("span",{id:
|
|
59
|
-
/* @__PURE__ */te("button",{onClick:()=>tr(
|
|
60
|
-
/* @__PURE__ */te("button",{type:"button",onClick:br,"aria-label":Pe.close,className:"rounded p-0.5 text-ink-faintest hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */te(D,{name:"close",className:"h-4 w-4"})})]})]}:{onPointerDown:
|
|
58
|
+
/* @__PURE__ */te("span",{id:We,className:"truncate",children:Jt?tn(Te):Te})]}),!Jt&&/* @__PURE__ */ee("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[O&&/* @__PURE__ */te("button",{onClick:()=>Fe(e=>!e),title:Oe?Pe.unpin:Pe.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(Oe?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */te(D,{name:"bookmark-square",className:"h-3 w-3",fill:Oe?"currentColor":"none",strokeWidth:1.5})}),
|
|
59
|
+
/* @__PURE__ */te("button",{onClick:()=>tr(Wt),title:Pe.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__ */te(vr,{maximized:Bn,onToggleMax:()=>{Bn?(Hn(!1),bn(mn())):Yr()},onSnap:qr,buttonClassName:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",strings:Pe}),
|
|
60
|
+
/* @__PURE__ */te("button",{type:"button",onClick:br,"aria-label":Pe.close,className:"rounded p-0.5 text-ink-faintest hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */te(D,{name:"close",className:"h-4 w-4"})})]})]}:{onPointerDown:Wr,"data-window-chrome":"",...Ur,className:"flex items-center justify-between h-(--row-height-window-bar) px-3 border-b border-gray-200 shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+($t?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:$t?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
61
61
|
/* @__PURE__ */ee("div",{"data-window-title":!0,title:Ie,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:$t?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Jt&&Tt(),
|
|
62
|
-
/* @__PURE__ */te("span",{id:
|
|
63
|
-
/* @__PURE__ */te("button",{onClick:()=>tr(
|
|
62
|
+
/* @__PURE__ */te("span",{id:We,className:"truncate",children:Jt?tn(Te):Te})]}),!Jt&&/* @__PURE__ */ee("div",{className:"flex items-center gap-3 shrink-0 ml-4",children:[O&&/* @__PURE__ */te("button",{onClick:()=>Fe(e=>!e),title:Oe?Pe.unpin:Pe.pinOnTop,className:"text-xs px-2 py-1 rounded hover:bg-gray-200 "+(Oe?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */te(D,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:Oe?"currentColor":"none",strokeWidth:1.5})}),
|
|
63
|
+
/* @__PURE__ */te("button",{onClick:()=>tr(Wt),title:Pe.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!An&&/* @__PURE__ */te(vr,{maximized:Bn,onToggleMax:()=>{Bn?(Hn(!1),bn(mn())):Yr()},onSnap:qr,buttonClassName:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",strings:Pe}),
|
|
64
64
|
/* @__PURE__ */te("button",{type:"button",onClick:br,"aria-label":Pe.close,className:"rounded-(--radius-control) text-ink-faintest hover:text-gray-600",children:/* @__PURE__ */te(D,{name:"close",className:"h-5 w-5"})})]})]}),he&&Xe&&!V&&!we&&/* @__PURE__ */te("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${$t?.9:.55})`}}),
|
|
65
|
-
/* @__PURE__ */te(Gt.Provider,{value:
|
|
66
|
-
/* @__PURE__ */te(S,{onClick:()=>{et(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:
|
|
65
|
+
/* @__PURE__ */te(Gt.Provider,{value:Wt,children:/* @__PURE__ */te(cn.Provider,{value:{rightRef:st,leftRef:lt,notify:()=>ut(!0),active:$t,isDirty:ar,footerOpen:yt&&!V&&!Z&&!Q&&!we},children:/* @__PURE__ */te("div",{ref:at,...V?{onPointerDown:Wr,onContextMenu:e=>{e.preventDefault(),et({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${V?"p-0 cursor-move":Q||oe?"p-0":Z?"p-2":"p-4"} ${V||Mn?"":"backdrop-blur-sm"} ${!1===v||Q||oe?"overflow-hidden":"overflow-y-auto overscroll-contain"} ${V?"rounded-2xl select-none":""}`,style:{...V?{touchAction:"none"}:{},backgroundColor:V?"transparent":Mn?"rgb(var(--window-content-rgb))":$t?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */te(Se,{children:me})})})}),V&&Qe&&/* @__PURE__ */ee(N,{minWidth:160,style:{left:Qe.x,top:Qe.y},onClose:()=>et(null),children:[
|
|
66
|
+
/* @__PURE__ */te(S,{onClick:()=>{et(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:Wt}))},children:"Settings"}),
|
|
67
67
|
/* @__PURE__ */te(L,{}),le&&/* @__PURE__ */ee(ne,{children:[le,
|
|
68
68
|
/* @__PURE__ */te(L,{})]}),
|
|
69
|
-
/* @__PURE__ */ee(S,{onClick:()=>{et(null),
|
|
69
|
+
/* @__PURE__ */ee(S,{onClick:()=>{et(null),Fe(e=>!e)},children:[
|
|
70
70
|
/* @__PURE__ */te("span",{className:"flex-1",children:"Always on Top"}),Oe&&/* @__PURE__ */te(D,{name:"check",className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
|
|
71
71
|
/* @__PURE__ */te(L,{}),
|
|
72
72
|
/* @__PURE__ */te(S,{onClick:()=>{et(null),br()},children:"Close"})]}),
|
|
73
|
-
/* @__PURE__ */ee("div",{onPointerDown:
|
|
73
|
+
/* @__PURE__ */ee("div",{onPointerDown:Wr,ref:dt,"data-modal-footer":"",className:`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${Mn?"":" cursor-move"}${$t&&!Mn?" backdrop-blur-sm":""}${V||Z||Q||we||!yt?" hidden":""}`,style:{touchAction:"none",backgroundColor:Mn?"rgb(var(--window-footer-rgb))":$t?"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__ */ee("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[kt&&/* @__PURE__ */te(ze,{auto:!0}),z,
|
|
75
75
|
/* @__PURE__ */te("div",{ref:lt,"data-modal-actions-left":!0,className:"flex items-center gap-2 shrink-0"}),null!=w&&!1!==w&&
|
|
76
76
|
/* @__PURE__ */te("div",{ref:ht,"data-modal-footer-facts":"",className:"min-w-0 flex-1 overflow-hidden",children:/* @__PURE__ */te("div",{ref:mt,className:"inline-flex items-center gap-2 whitespace-nowrap"+(pt?" invisible":""),children:w})})]}),
|
|
77
|
-
/* @__PURE__ */ee("div",{"data-modal-footer-right":"",className:"flex items-center gap-2 ml-auto shrink-0",children:[wt&&
|
|
77
|
+
/* @__PURE__ */ee("div",{"data-modal-footer-right":"",className:"flex items-center gap-2 ml-auto shrink-0",children:[wt&&R&&(R.editing?/* @__PURE__ */te(A,{variant:"secondary",size:"sm","data-modal-discard":"",onClick:()=>{Lr()},children:Pe.discard}):"object"==typeof R.state?/* @__PURE__ */te(A,{variant:"secondary",size:"sm","data-modal-edit":"","aria-disabled":!0,disabledReason:R.state.disabledReason,children:Pe.edit}):/* @__PURE__ */te(A,{variant:"secondary",size:"sm","data-modal-edit":"",onClick:()=>R.onEdit(),children:Pe.edit})),
|
|
78
78
|
/* @__PURE__ */te("div",{ref:st,"data-modal-actions":!0,className:"flex items-center gap-2"}),T]})]}),!V&&!we&&!Jt&&$t&&!An&&/* @__PURE__ */ee(ne,{children:[
|
|
79
|
-
/* @__PURE__ */te("div",{onPointerDown:e=>
|
|
80
|
-
/* @__PURE__ */te("div",{onPointerDown:e=>
|
|
81
|
-
/* @__PURE__ */te("div",{onPointerDown:e=>
|
|
82
|
-
/* @__PURE__ */te("div",{onPointerDown:e=>
|
|
83
|
-
/* @__PURE__ */te("div",{onPointerDown:e=>
|
|
84
|
-
/* @__PURE__ */te("div",{onPointerDown:e=>
|
|
85
|
-
/* @__PURE__ */te("div",{onPointerDown:e=>
|
|
86
|
-
/* @__PURE__ */te("div",{onPointerDown:e=>
|
|
87
|
-
/* @__PURE__ */ee(S,{onClick:()=>{tr(
|
|
79
|
+
/* @__PURE__ */te("div",{onPointerDown:e=>Rr(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
80
|
+
/* @__PURE__ */te("div",{onPointerDown:e=>Rr(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
81
|
+
/* @__PURE__ */te("div",{onPointerDown:e=>Rr(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
82
|
+
/* @__PURE__ */te("div",{onPointerDown:e=>Rr(e,"nw"),className:"absolute top-0 left-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
83
|
+
/* @__PURE__ */te("div",{onPointerDown:e=>Rr(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
84
|
+
/* @__PURE__ */te("div",{onPointerDown:e=>Rr(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
85
|
+
/* @__PURE__ */te("div",{onPointerDown:e=>Rr(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
|
|
86
|
+
/* @__PURE__ */te("div",{onPointerDown:e=>Rr(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),Jt&&/* @__PURE__ */te("div",{className:"absolute inset-0",style:{zIndex:I.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>nn(!0),onMouseLeave:()=>nn(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),er(Wt),Pr(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:Zt&&/* @__PURE__ */te("button",{type:"button","data-expose-close":!0,"aria-label":De.taskbar.closeWindow,title:"Close",className:"absolute flex items-center justify-center rounded-full bg-black/55 text-on-accent shadow-lg ring-1 ring-white/40 transition-colors hover:bg-red-500",style:{top:8,right:8,width:30,height:30,transform:`scale(${1/Qr})`,transformOrigin:"top right",zIndex:I.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),br()},children:/* @__PURE__ */te(D,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),Jt&&Zr&&/* @__PURE__ */te("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:Zr.x,top:Zr.y+Zr.h+4,width:Zr.w,zIndex:I.expose+(Zt?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:tn(Te)})]}),ro=je&&/* @__PURE__ */ee(N,{style:{left:je.x,top:je.y},onClose:()=>qe(null),minWidth:160,children:[!V&&!Z&&!Mn&&/* @__PURE__ */ee(ne,{children:[
|
|
87
|
+
/* @__PURE__ */ee(S,{onClick:()=>{tr(Wt),qe(null)},children:[
|
|
88
88
|
/* @__PURE__ */te(D,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),Pe.minimize]}),!An&&/* @__PURE__ */ee(S,Bn?{onClick:()=>{Hn(!1),bn(mn()),qe(null)},children:[
|
|
89
89
|
/* @__PURE__ */te("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */te("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 4.5v15m6-15v15M4.5 9h15M4.5 15h15"})}),Pe.windowed]}:{onClick:()=>{Yr(),qe(null)},children:[
|
|
90
|
-
/* @__PURE__ */te(D,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),Pe.maximize]})]}),O&&!Mn&&/* @__PURE__ */ee(S,{onClick:()=>{
|
|
91
|
-
/* @__PURE__ */te(D,{name:"bookmark-square",className:"h-4 w-4 "+(Oe?"text-blue-600":""),fill:Oe?"currentColor":"none",strokeWidth:1.5}),Oe?Pe.unpin:Pe.pinOnTop]}),Be&&/* @__PURE__ */ee(S,{onClick:()=>{qe(null),
|
|
92
|
-
/* @__PURE__ */te(D,{name:"star",className:"h-4 w-4",fill:_e?"currentColor":"none",strokeWidth:1.5}),_e?De.taskbar.removeFromDesktop:De.taskbar.addToDesktop]}),(on[
|
|
90
|
+
/* @__PURE__ */te(D,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),Pe.maximize]})]}),O&&!Mn&&/* @__PURE__ */ee(S,{onClick:()=>{Fe(e=>!e),qe(null)},children:[
|
|
91
|
+
/* @__PURE__ */te(D,{name:"bookmark-square",className:"h-4 w-4 "+(Oe?"text-blue-600":""),fill:Oe?"currentColor":"none",strokeWidth:1.5}),Oe?Pe.unpin:Pe.pinOnTop]}),Be&&/* @__PURE__ */ee(S,{onClick:()=>{qe(null),Ze()},children:[
|
|
92
|
+
/* @__PURE__ */te(D,{name:"star",className:"h-4 w-4",fill:_e?"currentColor":"none",strokeWidth:1.5}),_e?De.taskbar.removeFromDesktop:De.taskbar.addToDesktop]}),(on[Wt]||[]).length>0&&/* @__PURE__ */te(ne,{children:(on[Wt]||[]).map((e,t)=>/* @__PURE__ */ee(S,{onClick:()=>{qe(null),e.onClick()},children:[e.icon,e.label]},t))}),!(Mn&&He?.home)&&/* @__PURE__ */ee(ne,{children:[
|
|
93
93
|
/* @__PURE__ */te(L,{}),
|
|
94
94
|
/* @__PURE__ */ee(S,{danger:!0,onClick:()=>{qe(null),br()},children:[
|
|
95
|
-
/* @__PURE__ */te(D,{name:"close",className:"h-4 w-4"}),Pe.close]})]})]}),oo=!!ue&&It.some(e=>e.id===ue),io=!Bt||oo||V?null:/* @__PURE__ */ee("div",{"data-modal-restore-tab":!0,"data-modal-id":
|
|
96
|
-
/* @__PURE__ */te("button",{type:"button",onClick:()=>er(
|
|
97
|
-
/* @__PURE__ */te("button",{type:"button",onClick:()=>er(
|
|
95
|
+
/* @__PURE__ */te(D,{name:"close",className:"h-4 w-4"}),Pe.close]})]})]}),oo=!!ue&&It.some(e=>e.id===ue),io=!Bt||oo||V?null:/* @__PURE__ */ee("div",{"data-modal-restore-tab":!0,"data-modal-id":Wt,className:"fixed left-1/2 z-(--z-restore-tab) flex -translate-x-1/2 items-center gap-1 rounded-lg border border-line-strong bg-surface px-2 py-1 shadow-lg",style:{bottom:"calc(var(--taskbar-height, 0px) + 12px)"},children:[
|
|
96
|
+
/* @__PURE__ */te("button",{type:"button",onClick:()=>er(Wt),title:Pe.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:Ie||Pe.windowSuffix}),
|
|
97
|
+
/* @__PURE__ */te("button",{type:"button",onClick:()=>er(Wt),title:Pe.restore,"aria-label":Pe.restore,className:"rounded px-2 py-0.5 text-xs leading-none text-ink-faintest hover:bg-gray-100 hover:text-gray-600",children:"▴"}),
|
|
98
98
|
/* @__PURE__ */te("button",{type:"button",onClick:()=>{br()},title:Pe.close,"aria-label":Pe.close,className:"rounded px-2 py-0.5 text-xs leading-none text-ink-faintest hover:bg-gray-100 hover:text-gray-600",children:"✕"})]});return re(
|
|
99
|
-
/* @__PURE__ */ee(_t.Provider,{value:null,children:[no,ro,io]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{Tr&&"Escape"===e.key&&(Ur(null),Pr(!1))});var _r=100,Jr={past:[],future:[]};function
|
|
100
|
-
return ee(Le.Provider,{value:ae,children:[ce&&/* @__PURE__ */te(hn,{position:"left",quiet:!0,children:/* @__PURE__ */te(ze,{auto:!0})}),e]})}function ro(){const e=$(Le),t=U(()=>{},[]);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 oo(e){const t=$(Le),n=t?.claimReadOnly,r=t?.claimEditable;q(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function io(e,t,n){const r=$(Le),o=J(),i=
|
|
99
|
+
/* @__PURE__ */ee(_t.Provider,{value:null,children:[no,ro,io]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{Tr&&"Escape"===e.key&&(Ur(null),Pr(!1))});var _r=100,Jr={past:[],future:[]};function Zr(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>_r?r.slice(r.length-_r):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:Jr}}var Qr=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var eo=500,to=250;function no({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,a]=Z(Zr,Jr),s=j(/* @__PURE__ */new Map),[l,c]=B(0),u=l>0,[d,h]=B(0),[m,p]=B(0),f=m>0,{hasAnyPerm:w}=i(),y=t&&0===d&&(!(n&&n.length>0)||w(n)),g=j(null),v=j(!1),b=U(()=>{const e={};for(const[t,n]of s.current)e[t]=n.getLast();return e},[]),x=U((e,t)=>{s.current.has(e)||c(e=>e+1),s.current.set(e,t)},[]),k=U(e=>{s.current.delete(e)&&c(e=>e-1)},[]),E=U(e=>{h(t=>t+(e?1:-1))},[]),C=U(e=>{p(t=>t+(e?1:-1))},[]),[M,N]=B(0),S=M>0,L=U(e=>{N(t=>t+(e?1:-1))},[]),T=$(Le),z=T?.claimReadOnly;q(()=>{if(z&&!y)return z(!0),()=>z(!1)},[z,y]);const A=T?.claimOwnMount;q(()=>{if(A&&S)return A(!0),()=>A(!1)},[A,S]);const D=j({last:0,count:0,tripped:!1}),P=j(!1),I=U((e,t,n)=>{if(v.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>to&&(r.count=0),r.last=o,++r.count>eo)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${eo} 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:b(),label:e,coalesceKey:t},queueMicrotask(()=>{const e=g.current;g.current=null,e&&a({type:"record",step:e})})},[y,b]),W=U(e=>{for(const[t,n]of Object.entries(e)){const e=s.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),K=U(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:b(),label:e.label,coalesceKey:null};W(e.values),a({type:"undo",redoStep:t})},[o.past,b,W]),R=U(()=>{const e=o.future[0];if(!e)return;const t={values:b(),label:e.label,coalesceKey:null};W(e.values),a({type:"redo",undoStep:t})},[o.future,b,W]),[O,F]=B(0),H=j(0),Y=j(0),X=j(!1),V=U(()=>{v.current=!0,P.current=!1,g.current=null,H.current+=1,Y.current=H.current,F(H.current)},[]),G=j(void 0),J=U(e=>{void 0!==e&&(void 0!==G.current&&e!==G.current&&(X.current=!0),G.current=e),V()},[V]);q(()=>{v.current&&O===Y.current&&(v.current=!1,g.current=null,(P.current||X.current)&&a({type:"clear"}),P.current=!1,X.current=!1)},[O]);const Q=U(()=>{X.current=!0,a({type:"clear"}),V()},[V]),ne=y&&o.past.length>0,re=y&&o.future.length>0,oe=Lr(r),ie=j({undo:K,redo:R,canUndo:ne,canRedo:re});ie.current={undo:K,redo:R,canUndo:ne,canRedo:re},q(()=>{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&&Qr.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=_(()=>({register:x,unregister:k,record:I,undo:K,redo:R,clear:Q,baseline:J,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,R,Q,J,ne,re,y,u,S,L,E,f,C,o.past,o.future]),se=""!==un(),le=$(cn)?.footerOpen??!1,ce=se&&y&&u&&!S&≤/* @__PURE__ */
|
|
100
|
+
return ee(Le.Provider,{value:ae,children:[ce&&/* @__PURE__ */te(hn,{position:"left",quiet:!0,children:/* @__PURE__ */te(ze,{auto:!0})}),e]})}function ro(){const e=$(Le),t=U(()=>{},[]);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 oo(e){const t=$(Le),n=t?.claimReadOnly,r=t?.claimEditable;q(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function io(e,t,n){const r=$(Le),o=J(),i=j(e),a=j(t);a.current=t,q(()=>{if(r)return r.register(o,{getLast:()=>i.current,setLast:e=>{i.current=e},apply:e=>a.current(e)}),()=>r.unregister(o)},[r,o]);const{label:s,coalesceKey:l=null}=n,c=j(r);c.current=r;const u=j({label:s,coalesceKey:l});u.current={label:s,coalesceKey:l},q(()=>{const t=c.current;t&&(Object.is(e,i.current)||(t.record(u.current.label,u.current.coalesceKey,{prev:i.current,next:e}),i.current=e))},[e])}function ao(e,t){const[n,r]=B(e);return io(n,e=>r(()=>e),t),[n,r]}export{mn as CancelButton,et as DocFavStar,qe as EntityWindowFallback,Fe as EntityWindowLoading,Be as EntityWindowState,en as KEY_ACTIVATED_SELECTOR,$e as LoadingSpinner,Qt as MODAL_SUBMIT_SELECTOR,Gr as Modal,hn as ModalActions,ze as UndoControls,no as UndoProvider,de as WINDOW_REGISTRY,Ne as WindowCrashedFallback,Se as WindowErrorBoundary,xt as WindowManagerProvider,sn as WindowTitle,at as activateWindowById,It as beginWindowGesture,_n as cancelWindowFront,we as client_default,Yr as commitExposeHighlight,Gn as confirmWindowDiscard,Wt as drainPerfEvents,Wr as exitExposeMode,Mn as forgetMaximizedWindowBoxes,Mr as getActiveModalId,ct as getActiveWindowRoute,Hr as getExposeHighlight,Vt as getWindowChromeVersion,En as getWindowPosition,Ue as isDraftEntityId,Ye as isDraftEntityWindow,le as isEntityEntry,se as isPageEntry,pe as isShellApiClientConfigured,We as isTabWindow,Pt as markMenuOpen,Yt as readWindowChrome,Yn as requestWindowFront,Ur as setExposeHighlight,Dt as setPerfCollecting,me as setShellApiClient,xe as setShellHomeRoute,Me as setShellTabStrip,ue as setShellWindowRegistry,kn as setWindowDefaultPosition,Cn as setWindowPosition,Ft as splitTitle,Br as subscribeExposeHighlight,Xt as subscribeWindowChrome,Ke as tabGroupOf,Ir as toggleExposeMode,qn as useCurrentTabKey,un as useEnclosingModalId,Lr as useIsActiveWindow,dn as useModalActive,ge as usePageSearch,ro as useUndo,oo as useUndoCanEdit,io as useUndoable,ao as useUndoableState,rn as useWidgetSettings,Ge as useWindowDirty,Je as useWindowManager,an as useWindowMenuItem,ln as useWindowTitle,Vn as windowHoldsChanges};
|