efficient-shell 12.0.0 → 12.1.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/README.md +43 -0
- package/dist/{Browser-CXZAXF55.js → Browser-U3SO6PSV.js} +17 -17
- package/dist/Calculator-6XGTP5OQ.js +29 -0
- package/dist/{CurrencyConverter-WFC3TAL4.js → CurrencyConverter-XNWE5MQW.js} +11 -11
- package/dist/Files-S4AFZX4N.js +121 -0
- package/dist/{Notepad-B7CKQ54M.js → Notepad-YYNH67EN.js} +10 -10
- package/dist/PdfViewer-ZI3QOG4G.js +1 -0
- package/dist/{PomodoroTimer-JMJORKWZ.js → PomodoroTimer-SBV43YX6.js} +68 -68
- package/dist/{Preview-OELV5X55.js → Preview-KV3L22LT.js} +27 -27
- package/dist/Sidebar-XVVZJ7PR.js +44 -0
- package/dist/{Stock-R3436P6X.js → Stock-GODZPUR3.js} +3 -3
- package/dist/{Weather-6N3ZPO2Q.js → Weather-2IIV4CFT.js} +20 -20
- package/dist/{WorldClock-BJKYHGLS.js → WorldClock-JW4MLMCB.js} +7 -7
- package/dist/ai/index.js +57 -57
- package/dist/apps/index.d.ts +125 -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/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.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/Meter.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/RankedBars.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/StatTile.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-YIV7CFBG.js → chunk-27XV4TAU.js} +5 -5
- package/dist/{chunk-YXOFUY4J.js → chunk-2DOMIOYR.js} +1 -1
- package/dist/{chunk-JAQO3TNE.js → chunk-2OMM2AG3.js} +1 -1
- package/dist/chunk-2T7MZ77B.js +3 -0
- package/dist/{chunk-3LGPZAVU.js → chunk-2XQOK3CT.js} +2 -2
- package/dist/{chunk-E47TNYYE.js → chunk-2YBJQUYQ.js} +1 -1
- package/dist/{chunk-RPFONHXQ.js → chunk-32WEY6O5.js} +1 -1
- package/dist/{chunk-X3NYVMXJ.js → chunk-3CMCGOOV.js} +4 -4
- package/dist/{chunk-NK5RRBXY.js → chunk-3WFJ4PYV.js} +6 -6
- package/dist/{chunk-MBY5JIGB.js → chunk-43MCNASD.js} +1 -1
- package/dist/{chunk-CRO56LVN.js → chunk-4H5NTMOF.js} +1 -1
- package/dist/{chunk-MOBJVNLF.js → chunk-4KJ7MLWO.js} +10 -10
- package/dist/{chunk-LPJGF6LK.js → chunk-4RTDZSGH.js} +17 -17
- package/dist/{chunk-PLDMQNKD.js → chunk-4UGFNTZ3.js} +8 -8
- package/dist/{chunk-HCKCQIWA.js → chunk-53EW4M5S.js} +5 -5
- package/dist/{chunk-HNUKXGYP.js → chunk-56ESGDIC.js} +1 -1
- package/dist/{chunk-OXVRXWJL.js → chunk-5F6KJAF3.js} +11 -11
- package/dist/{chunk-VI4NLOVJ.js → chunk-5N6AC3LN.js} +11 -11
- package/dist/{chunk-KSHNA6W2.js → chunk-5NDONLH5.js} +3 -3
- package/dist/chunk-5THF6BJS.js +6 -0
- package/dist/{chunk-DD2ZGHCG.js → chunk-5V6SA77P.js} +6 -6
- package/dist/{chunk-JSUL7UON.js → chunk-63QLZYMN.js} +5 -5
- package/dist/{chunk-GEQC4ABV.js → chunk-6XC3XX7F.js} +6 -6
- package/dist/{chunk-BUHTLO2K.js → chunk-7EK7JNR4.js} +1 -1
- package/dist/{chunk-SCPPW3ZC.js → chunk-7F4U43YN.js} +4 -4
- package/dist/{chunk-4MERJIJJ.js → chunk-7FBAZLBX.js} +1 -1
- package/dist/{chunk-WRRMZAKK.js → chunk-7H7U3HC6.js} +1 -1
- package/dist/{chunk-LBGRLG3Y.js → chunk-7KIDOIPY.js} +1 -1
- package/dist/{chunk-MQXZZBR6.js → chunk-7ZYEDXZX.js} +1 -1
- package/dist/chunk-A2ZEGD2S.js +11 -0
- package/dist/{chunk-U24GFE5L.js → chunk-ACNDPAAT.js} +1 -1
- package/dist/{chunk-ZKYBLZPT.js → chunk-AJ5NU7UH.js} +8 -8
- package/dist/chunk-AJO55X66.js +6 -0
- package/dist/{chunk-RBINX62X.js → chunk-ANSQT5ZS.js} +1 -1
- package/dist/{chunk-OAZX7ZGB.js → chunk-AQULCKKZ.js} +11 -11
- package/dist/{chunk-DV4B26FJ.js → chunk-B5OYS65L.js} +1 -1
- package/dist/chunk-BD4OHYQB.js +13 -0
- package/dist/{chunk-6KGIHI6X.js → chunk-BFA5U5JF.js} +11 -11
- package/dist/{chunk-CFJL6MML.js → chunk-BFO72WQB.js} +1 -1
- package/dist/{chunk-4ALGGYHV.js → chunk-BPECY7I7.js} +9 -9
- package/dist/{chunk-CCA4LQNB.js → chunk-BXZNMSTZ.js} +1 -1
- package/dist/{chunk-UDVUVFRS.js → chunk-BXZSLRNO.js} +12 -12
- package/dist/{chunk-YAZENY3X.js → chunk-C4XV42QP.js} +1 -1
- package/dist/chunk-CC42UKIT.js +1 -0
- package/dist/{chunk-W4UYDSTI.js → chunk-CD7P34VC.js} +7 -7
- package/dist/{chunk-OMCM3SIE.js → chunk-CENTHUBD.js} +7 -7
- package/dist/{chunk-IS7C6OWZ.js → chunk-CF4YOJUQ.js} +10 -10
- package/dist/{chunk-TF6DYDNQ.js → chunk-CNVYM3HP.js} +1 -1
- package/dist/{chunk-46EBZ7YI.js → chunk-COMV3Z2U.js} +1 -1
- package/dist/chunk-CQCMJHDM.js +9 -0
- package/dist/{chunk-HKPVHSZ3.js → chunk-CRB5GM4W.js} +1 -1
- package/dist/{chunk-PB6XGDLJ.js → chunk-CRU2BNEM.js} +8 -8
- package/dist/{chunk-3YQICVUP.js → chunk-CTW2OKYS.js} +2 -2
- package/dist/chunk-CWTY4GTU.js +5 -0
- package/dist/{chunk-33F35NNM.js → chunk-DKUF7BD5.js} +1 -1
- package/dist/{chunk-EFBWQWUS.js → chunk-DSHEOC2O.js} +1 -1
- package/dist/{chunk-KABXUBIH.js → chunk-DU5IBIZQ.js} +1 -1
- package/dist/{chunk-QTNMALBN.js → chunk-DZBGJ6X4.js} +1 -1
- package/dist/{chunk-YESTUDOK.js → chunk-E227NVFX.js} +1 -1
- package/dist/{chunk-P75R4EYJ.js → chunk-EEVKJJ5S.js} +4 -4
- package/dist/{chunk-NPTHHWXZ.js → chunk-EOGXCGQF.js} +5 -5
- package/dist/{chunk-DW5Y57I2.js → chunk-ESDWHHQY.js} +2 -2
- package/dist/{chunk-EM6VZSNJ.js → chunk-FAIHSCOG.js} +1 -1
- package/dist/chunk-FEJFGFPF.js +8 -0
- package/dist/{chunk-EO3IKZCP.js → chunk-FLYOI6EW.js} +1 -1
- package/dist/{chunk-AQ3LCE2U.js → chunk-FOTDGSY5.js} +1 -1
- package/dist/{chunk-NZISMTQE.js → chunk-FUUJJ7OH.js} +5 -5
- package/dist/chunk-FWUXYNWF.js +13 -0
- package/dist/{chunk-ZYJAZ5HH.js → chunk-G2X5YYIQ.js} +2 -2
- package/dist/chunk-GEZ45J4Z.js +2 -0
- package/dist/{chunk-LJN77RG6.js → chunk-GFBQ53WN.js} +1 -1
- package/dist/chunk-GGSPY3Q4.js +23 -0
- package/dist/{chunk-XNFZLSWW.js → chunk-GIUX7WUS.js} +6 -6
- package/dist/{chunk-ZU432XW4.js → chunk-GJ23UZDQ.js} +1 -1
- package/dist/{chunk-YJOJ5MUZ.js → chunk-GJJKWGBX.js} +6 -6
- package/dist/chunk-GMLGR4R6.js +8 -0
- package/dist/chunk-GRB4LKZC.js +9 -0
- package/dist/chunk-GZJ5F7SB.js +12 -0
- package/dist/chunk-HB2XXIQG.js +6 -0
- package/dist/chunk-HGZZXA2N.js +9 -0
- package/dist/chunk-HICNRXYB.js +11 -0
- package/dist/{chunk-46VLN6KC.js → chunk-HNQKXOFU.js} +4 -4
- package/dist/{chunk-AIJ6OR6X.js → chunk-HS4EWT6L.js} +2 -2
- package/dist/{chunk-GWDTGCQB.js → chunk-HTDZ3XAJ.js} +8 -8
- package/dist/{chunk-A34PD3XT.js → chunk-HY3JYAUH.js} +14 -14
- package/dist/{chunk-S262RGL6.js → chunk-I3QFYBOP.js} +1 -1
- package/dist/{chunk-DSKROZST.js → chunk-I7H3OIYX.js} +1 -1
- package/dist/{chunk-T6BGS26U.js → chunk-IRZ6XM5A.js} +1 -1
- package/dist/{chunk-LISPTWW3.js → chunk-IYPRFUTT.js} +1 -1
- package/dist/{chunk-CRILBBSU.js → chunk-J5ISQYVM.js} +1 -1
- package/dist/{chunk-WPCNJ4UL.js → chunk-JCTOQOVO.js} +1 -1
- package/dist/{chunk-ED5D2O6E.js → chunk-JCUG572K.js} +1 -1
- package/dist/chunk-KHVECW4M.js +7 -0
- package/dist/{chunk-KRH7UAD2.js → chunk-L75RBQFH.js} +1 -1
- package/dist/{chunk-T4WDJ7IB.js → chunk-LJJSFJA2.js} +28 -28
- package/dist/{chunk-4DDL6NXB.js → chunk-LLBH6PHE.js} +1 -1
- package/dist/{chunk-FGWHTNC3.js → chunk-LOEOCZCN.js} +1 -1
- package/dist/{chunk-NIBYHQLT.js → chunk-LTESFDTF.js} +1 -1
- package/dist/{chunk-7P2WKDGB.js → chunk-LUSIZ2BK.js} +15 -15
- package/dist/{chunk-AICGATHE.js → chunk-M7DFM2N7.js} +58 -58
- package/dist/{chunk-2UO47XB4.js → chunk-MRFNJZRR.js} +2 -1
- package/dist/{chunk-XZ2WQNOX.js → chunk-NC36LJCA.js} +10 -10
- package/dist/{chunk-UNJWYV6V.js → chunk-NHBDLW52.js} +2 -2
- package/dist/{chunk-TVRKONNH.js → chunk-NHWDB7R6.js} +1 -1
- package/dist/{chunk-63ZLF7LS.js → chunk-NJTFI7AA.js} +1 -1
- package/dist/chunk-NPQBJJLP.js +9 -0
- package/dist/{chunk-CJ4U4C4A.js → chunk-NZYI4XV5.js} +5 -5
- package/dist/{chunk-JQHL4B4C.js → chunk-ONYPN3JY.js} +12 -12
- package/dist/{chunk-4K7BA3PD.js → chunk-ORLQUGIN.js} +6 -6
- package/dist/{chunk-THSKCKAQ.js → chunk-PH3P54QQ.js} +1 -1
- package/dist/chunk-PKNHSZWK.js +8 -0
- package/dist/{chunk-ZU3BD75E.js → chunk-PXIP246B.js} +1 -1
- package/dist/{chunk-5EWKVVUD.js → chunk-QBD7V4TK.js} +1 -1
- package/dist/{chunk-UIOKWFT4.js → chunk-QN56R4V4.js} +1 -1
- package/dist/{chunk-QMTYILTT.js → chunk-QTMRW6DK.js} +1 -1
- package/dist/{chunk-H3IGNWT7.js → chunk-R3JKZXII.js} +4 -4
- package/dist/{chunk-ZHFKBWBU.js → chunk-R3K3LVVS.js} +1 -1
- package/dist/{chunk-IK37Q6LY.js → chunk-RIXX6NRV.js} +1 -1
- package/dist/{chunk-DWYCSJ6O.js → chunk-RM74EAMV.js} +2 -2
- package/dist/{chunk-TOSUM2OI.js → chunk-RXHTIJ64.js} +1 -1
- package/dist/chunk-S3C3XJG7.js +1 -0
- package/dist/{chunk-6MWLOLLP.js → chunk-SCCAMJB4.js} +1 -1
- package/dist/{chunk-6HO7244M.js → chunk-SCGBCBXP.js} +1 -1
- package/dist/chunk-SX5CSXZO.js +8 -0
- package/dist/{chunk-YQEGMCSX.js → chunk-TBBG2AWY.js} +3 -3
- package/dist/{chunk-A3AKJDLI.js → chunk-TRWHVG3A.js} +1 -1
- package/dist/{chunk-O53EQODF.js → chunk-TTSZSLQL.js} +1 -1
- package/dist/{chunk-RDYFZHT3.js → chunk-UDJLRTQB.js} +1 -1
- package/dist/chunk-UDL2A2GT.js +4 -0
- package/dist/chunk-UE54EN4C.js +2 -0
- package/dist/{chunk-VNAOZVSM.js → chunk-VFBBGLRA.js} +12 -12
- package/dist/{chunk-B7WTHCTF.js → chunk-VGWYAYHB.js} +3 -3
- package/dist/chunk-VPYD7UJM.js +22 -0
- package/dist/{chunk-MSAQGUGU.js → chunk-VQPZDZ3R.js} +4 -4
- package/dist/{chunk-RSPCCVN4.js → chunk-VW7W6LCV.js} +1 -1
- package/dist/{chunk-34AHFST2.js → chunk-VZLYB5LX.js} +1 -1
- package/dist/chunk-WD3I7AEZ.js +14 -0
- package/dist/{chunk-RLTTAH46.js → chunk-WMLBMR4E.js} +4 -4
- package/dist/{chunk-GCRPI3AL.js → chunk-XARBHOEZ.js} +1 -1
- package/dist/{chunk-62RAGXWK.js → chunk-XBDHRMQI.js} +7 -7
- package/dist/{chunk-VPGQMNW3.js → chunk-XQUXL75F.js} +1 -1
- package/dist/{chunk-ZYDRBF3H.js → chunk-XZH5PEML.js} +5 -5
- package/dist/{chunk-GHMDLZH4.js → chunk-Y46WPTKY.js} +7 -7
- package/dist/chunk-YAD7TML2.js +28 -0
- package/dist/{chunk-LXHTCLNX.js → chunk-YKHAI5IZ.js} +1 -1
- package/dist/{chunk-C4T4APD6.js → chunk-YRZP7JN4.js} +22 -22
- package/dist/{chunk-BYLGKRIT.js → chunk-Z43XVU2P.js} +1 -1
- package/dist/{chunk-L6OPXIZN.js → chunk-ZACNIKIQ.js} +1 -1
- package/dist/{chunk-H34KI3HV.js → chunk-ZG3RF2VE.js} +9 -9
- package/dist/{chunk-VOXX4LNC.js → chunk-ZUBTNUVE.js} +1 -1
- package/dist/{chunk-HK4QAI2A.js → chunk-ZYFBV4C7.js} +2 -2
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListFooter.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/Pagination.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.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/DateTimePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/FormErrorSummary.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/Input.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/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +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.js +1 -1
- package/dist/forms/TimePicker.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +666 -666
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +3 -3
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/BudgetBar.js +1 -1
- package/dist/shell/Card.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContainerFillChart.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/CountBadge.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/EmptyState.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.js +1 -1
- package/dist/shell/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.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/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.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/Statistic.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.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/shell/language.js +1 -1
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.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.js +1 -1
- package/dist/templates/ErrorPage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-TKQRQGTI.js +0 -29
- package/dist/Files-QM5PW6BX.js +0 -88
- package/dist/PdfViewer-3UEC5TNN.js +0 -1
- package/dist/Sidebar-SZ5OGL6C.js +0 -44
- package/dist/chunk-4LNO444F.js +0 -11
- package/dist/chunk-56YJIKVI.js +0 -11
- package/dist/chunk-5PDHKH2A.js +0 -3
- package/dist/chunk-6E47JSLM.js +0 -22
- package/dist/chunk-AEMAGYIZ.js +0 -8
- package/dist/chunk-ATURDO2C.js +0 -14
- package/dist/chunk-D7DRZKUI.js +0 -1
- package/dist/chunk-EJBR5Y4X.js +0 -9
- package/dist/chunk-EZBE3H2W.js +0 -9
- package/dist/chunk-HTB5AEZU.js +0 -9
- package/dist/chunk-IJXMWWTM.js +0 -9
- package/dist/chunk-JINTE3G4.js +0 -1
- package/dist/chunk-K46DLEIX.js +0 -23
- package/dist/chunk-N7GFQZ2J.js +0 -12
- package/dist/chunk-N7LDQZTL.js +0 -8
- package/dist/chunk-NDP2I5HK.js +0 -8
- package/dist/chunk-OMUC6TZT.js +0 -6
- package/dist/chunk-SOWRW647.js +0 -6
- package/dist/chunk-SZC35EYE.js +0 -28
- package/dist/chunk-TLE6VHMJ.js +0 -8
- package/dist/chunk-UMFEOZ75.js +0 -4
- package/dist/chunk-UYNFTF6L.js +0 -2
- package/dist/chunk-WRJP33DN.js +0 -6
- package/dist/chunk-WVIUU4BZ.js +0 -13
- package/dist/chunk-XZU24YKP.js +0 -13
- package/dist/chunk-Y3SVPBUT.js +0 -7
- package/dist/chunk-YN5K72D6.js +0 -5
- package/dist/chunk-ZITMPMUT.js +0 -2
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
import{computeMaximizedBox as e,isSidebarStripReserved as t,boxFillsWorkArea as n,readAlwaysMaximizedFlag as r,WORK_AREA_CHANGED_EVENT as o,scrollerIsFluid as i,growBoxToWidth as a,widthToFit as s,navIcons as l}from"./chunk-4LXCCZDM.js";import{ROW_HEIGHTS as c}from"./chunk-AW7TOB6N.js";import{reportBoundaryError as u}from"./chunk-KNUR2UEG.js";import{isStaleChunkError as d}from"./chunk-JDCM2VHG.js";import{Result as h}from"./chunk-
|
|
1
|
+
import{computeMaximizedBox as e,isSidebarStripReserved as t,boxFillsWorkArea as n,readAlwaysMaximizedFlag as r,WORK_AREA_CHANGED_EVENT as o,scrollerIsFluid as i,growBoxToWidth as a,widthToFit as s,navIcons as l}from"./chunk-4LXCCZDM.js";import{ROW_HEIGHTS as c}from"./chunk-AW7TOB6N.js";import{reportBoundaryError as u}from"./chunk-KNUR2UEG.js";import{isStaleChunkError as d}from"./chunk-JDCM2VHG.js";import{Result as h}from"./chunk-LOEOCZCN.js";import{CMD_Z as m,CMD_SHIFT_Z as p}from"./chunk-ZDMZM7HD.js";import{CopyButton as f}from"./chunk-SCCAMJB4.js";import{confirm as w}from"./chunk-4RTDZSGH.js";import{ItemCount as y}from"./chunk-RXHTIJ64.js";import{isInOverlayOver as g}from"./chunk-3DVNXNTF.js";import{dialogA11y as b}from"./chunk-VWGWZY7A.js";import{ColoredBadge as v}from"./chunk-L75RBQFH.js";import{LoadingSpinner as x}from"./chunk-SCGBCBXP.js";import{useShellAuth as k}from"./chunk-2QY5BJLA.js";import{useIsMobile as E,useIsPhone as C}from"./chunk-UGTRSRIW.js";import{useShellPrefs as M}from"./chunk-KC3EX26K.js";import{activationOrder as N,activeListeners as S,ModalActionsContext as L,subscribeActive as T,getActiveModalId as z,KEY_ACTIVATED_SELECTOR as A}from"./chunk-F3ZOO23R.js";import{StatusBadge as D}from"./chunk-FZM3ZPW3.js";import{focusableIn as P}from"./chunk-CDAJKLGL.js";import{PopupMenu as I,PopupMenuItem as R,PopupMenuDivider as W,PopupMenuLabel as K}from"./chunk-BFA5U5JF.js";import{Button_default as O}from"./chunk-EOVXFXVV.js";import{Icon as $}from"./chunk-MRFNJZRR.js";import{LoadingSpinner as F}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as j}from"./chunk-62LW225J.js";import{shellHttp as q,isShellHttpConfigured as B}from"./chunk-STKJA4PV.js";import{runEscapeInterceptors as H}from"./chunk-TWVUQUUD.js";import{useShellStrings as U}from"./chunk-43MCNASD.js";import{createContext as X,useContext as Y,Component as V,useLayoutEffect as J,useRef as _,useEffect as G,useState as Z,useSyncExternalStore as Q,useCallback as ee,isValidElement as te,Fragment as ne,Children as re,cloneElement as oe,useMemo as ie,useId as ae,useReducer as se,Suspense as le}from"react";import{jsxs as ce,jsx as ue,Fragment as de}from"react/jsx-runtime";import{createPortal as he}from"react-dom";import{useLocation as me}from"react-router-dom";import{useQueryClient as pe,useQuery as fe}from"@tanstack/react-query";function we(e){return"component"in e}function ye(e){return"endpoint"in e}var ge={};function be(e){ge=e}var ve=new Proxy({},{get:(e,t)=>ge[t],has:(e,t)=>t in ge,ownKeys:()=>Object.keys(ge),getOwnPropertyDescriptor(e,t){if(t in ge)return{configurable:!0,enumerable:!0,value:ge[t]}}});function xe(){return B()}var ke=q,Ee=X(null);function Ce(){return Y(Ee)?.pageSearch??""}var Me=null,Ne=/* @__PURE__ */new Set;function Se(e){Me!==e&&(Me=e,Ne.forEach(e=>e()))}function Le(){return Me}function Te(e){return Ne.add(e),()=>{Ne.delete(e)}}var ze=null;function Ae(e){ze=e}function De({error:e,onReload:t}){const n=d(e);/* @__PURE__ */
|
|
2
2
|
return ce("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
|
|
3
3
|
/* @__PURE__ */ue($,{name:"warning",className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
|
|
4
4
|
/* @__PURE__ */ce("div",{className:"min-w-0",children:[
|
|
5
5
|
/* @__PURE__ */ue("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__ */ue("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__ */ue("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 Pe=class extends V{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),u(e)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */ue(De,{error:e,onReload:this.reset}):this.props.children}},Ie=X(null),
|
|
7
|
+
/* @__PURE__ */ue("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 Pe=class extends V{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),u(e)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */ue(De,{error:e,onReload:this.reset}):this.props.children}},Ie=X(null),Re="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function We({className:e="",auto:t=!1}){const n=Y(Ie),r=U().undo,o=n?.claimOwnMount;if(J(()=>{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 ce("div",{className:`flex items-center gap-2 ${e}`,"data-undo-controls":t?"shell":"form",children:[
|
|
9
|
-
/* @__PURE__ */ue("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",m):r.nothingToUndo,className:
|
|
10
|
-
/* @__PURE__ */ue("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",p):r.nothingToRedo,className:
|
|
11
|
-
return ue(
|
|
9
|
+
/* @__PURE__ */ue("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",m):r.nothingToUndo,className:Re,children:r.undo}),
|
|
10
|
+
/* @__PURE__ */ue("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",p):r.nothingToRedo,className:Re,children:r.redo})]})}var Ke=/* @__PURE__ */new Set([408,429]);function Oe(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function $e(e){const t=Oe(e);return null!=t&&(t>=400&&t<500&&!Ke.has(t))}function Fe(e,t){return!$e(t)&&e<3}function je(e){if("page"!==e.type)return!0;const t=e.route?ve[e.route]:void 0;if(!t||!we(t))return!0;const n=t;return!n.widget&&!n.utility}function qe(e){const t=e.route?ve[e.route]:void 0;if(!t||!we(t))return;const n=t;return n.taskbarGroup?n.taskbarGroup:{key:e.route,label:n.label,icon:e.route}}var Be=(e,t)=>!!t&&"page"===e.type&&e.route===t;var He="flex-1 min-h-0";function Ue(){const e=U().record;/* @__PURE__ */
|
|
11
|
+
return ue(F,{label:e.loading,padding:"",className:He})}function Xe(e){return e??void 0}function Ye({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:o}){const i=U().record;if(t||e&&n)/* @__PURE__ */return ue(Ue,{});if(r){const e=Oe(r);if(401===e)/* @__PURE__ */
|
|
12
12
|
return ue(h,{status:"warning",title:i.signInRequired,subTitle:i.signInBody,className:He});if(403===e)/* @__PURE__ */
|
|
13
13
|
return ue(h,{status:"403",className:He});if(404===e||410===e)/* @__PURE__ */
|
|
14
14
|
return ue(h,{status:"404",title:i.notFound,className:He});const t=null==e||408===e||429===e||e>=500;/* @__PURE__ */
|
|
15
15
|
return ue(h,{status:"500",title:i.loadFailed,subTitle:t?i.checkConnection:i.rejected,extra:t?/* @__PURE__ */ue(O,{variant:"secondary",size:"sm",onClick:o,children:i.retry}):void 0,className:He})}/* @__PURE__ */
|
|
16
|
-
return ue(h,{status:"404",title:i.notFound,className:He})}function Ve({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */ue(de,{children:t(e)}):/* @__PURE__ */ue(Ye,{...n})}var
|
|
16
|
+
return ue(h,{status:"404",title:i.notFound,className:He})}function Ve({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */ue(de,{children:t(e)}):/* @__PURE__ */ue(Ye,{...n})}var Je=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function _e(e){return"string"==typeof e&&(e.startsWith("new-")||Je.test(e))}function Ge(e){if(_e(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var Ze=X({openWindows:[],openEntity:()=>{},openPage:()=>{},reorderWindows:()=>{},closeEntity:()=>{},minimize:()=>{},items:[],restore:()=>{},remove:()=>{},restoreIfMinimized:()=>!1,openItems:[]}),Qe=X(null);function et(e){const t=Y(Qe),n=_(null);null===n.current&&(n.current=/* @__PURE__ */Symbol("window-dirty")),J(()=>{if(t)return t(n.current,e)},[t,e]),G(()=>{if(!t||!e)return;const n=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t,e])}function tt(){const e=_(/* @__PURE__ */new Map),[t,n]=Z(!1);return{dirty:t,registerDirty:ee((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 nt(){return Y(Ze)}function rt(e){if("page"!==e.type&&Ge(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 ot({item:e,onClose:t,accentRgb:n}){const{dirty:r,registerDirty:o}=tt(),i=ve[e.route];if(!i||!we(i))return null;const a=i,s=a.component;/* @__PURE__ */
|
|
17
17
|
return ue(Yr,{open:!0,onClose:t,icon:l[e.route],title:a.label,size:a.size||"2xl",dirty:r,allowPinOnTop:a.allowPinOnTop,initialPosition:a.initialPosition,widget:a.widget,compact:a.compact,appStyle:a.appStyle,flushBody:a.flushBody,autoHeight:a.autoHeight,autoMinHeight:a.autoMinHeight,autoWidth:a.autoWidth,dimensions:a.dimensions,windowKey:e.id,openedFromKey:e.openedFrom,accentRgb:n,children:/* @__PURE__ */ue(Qe.Provider,{value:o,children:/* @__PURE__ */ue(le,{fallback:/* @__PURE__ */ue("div",{className:"flex items-center justify-center py-12",children:/* @__PURE__ */ue(x,{})}),children:/* @__PURE__ */ue(s,{})})})})}function it({entityType:e,entityId:t,label:n}){const r=U(),o=pe(),{data:i}=fe({queryKey:["my-profile-sidebar"],enabled:xe(),queryFn:()=>ke.get("/auth/me/").then(e=>e.data)}),a=(i?.preferences||{}).favorite_documents||[],s=a.some(n=>n.entityType===e&&n.entityId===t);/* @__PURE__ */
|
|
18
|
-
return ue("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];ke.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__ */ue($,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var at=/* @__PURE__ */new Set,st=()=>"hidden";function lt({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=ve[e.entityType];if(!o||!ye(o))return null;const i=o,[a,s]=Z(!1),{dirty:c,registerDirty:u}=tt(),d=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=
|
|
18
|
+
return ue("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];ke.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__ */ue($,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var at=/* @__PURE__ */new Set,st=()=>"hidden";function lt({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=ve[e.entityType];if(!o||!ye(o))return null;const i=o,[a,s]=Z(!1),{dirty:c,registerDirty:u}=tt(),d=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=_e(e.entityId),p=!i.selfFetching&&!h&&!m&&xe(),f=fe({queryKey:[d,e.entityId],queryFn:()=>{return ke.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:Xe(e.entitySnapshot),initialDataUpdatedAt:0,enabled:p,staleTime:0,refetchOnWindowFocus:!0,refetchOnMount:"always",refetchInterval:e=>!$e(e.state.error)&&6e4,refetchIntervalInBackground:!1,retry:Fe}),w=f.data,y=f.refetch;G(()=>{var t;if(p)return t=t=>{t!==e.id||at.has(t)||y({cancelRefetch:!1})},Qn.add(t),()=>{Qn.delete(t)}},[y,e.id,p]);const g=ee(()=>{a&&!c?s(!1):t()},[a,c,t]),b=(i.useEdit??st)(w??null),v=!i.useEdit||m||h?void 0:{state:b,editing:a,onEdit:()=>s(!0),onDiscard:()=>s(!1)},k=i.selfFetching?e.label:w?i.title(w,a,s):e.label,E=i.icon,C=E?l[E]:null,M=k,N=!i.selfFetching&&w&&i.footer&&!h?i.footer(w):void 0;return i.rendersOwnModal?i.selfFetching?/* @__PURE__ */ue(le,{fallback:/* @__PURE__ */ue(x,{}),children:i.render(w??e.entitySnapshot,t,e.entityId,a,s)}):null!=w?/* @__PURE__ */ue(le,{fallback:/* @__PURE__ */ue(Yr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */ue(Ue,{})}),children:i.render(w,t,e.entityId,a,s)}):/* @__PURE__ */ue(Yr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */ue(Ye,{isPending:f.isPending,isFetching:f.isFetching,enabled:p,error:f.error,onRetry:y})}):/* @__PURE__ */ue(Yr,{open:!0,onClose:g,onMinimize:n,initialBox:e.savedBox,icon:C,title:M,footer:N,copyText:e.label,windowKey:e.id,openedFromKey:e.openedFrom,size:i.size||"2xl",dirty:c,editing:a||m||h,edit:v,dimensions:i.dimensions,autoHeight:i.autoHeight,autoMinHeight:i.autoMinHeight,autoWidth:i.autoWidth,appStyle:i.appStyle,flushBody:i.flushBody,accentRgb:r,children:/* @__PURE__ */ue(Qe.Provider,{value:u,children:/* @__PURE__ */ue(le,{fallback:/* @__PURE__ */ue(Ue,{}),children:i.selfFetching?i.render(null,t,e.entityId,a,s):/* @__PURE__ */ue(Ve,{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 ct(e){return document.querySelector(`[data-modal-panel][data-window-key="${e}"]`)}function ut(e){return document.querySelector(`[data-modal-panel][data-window-root][data-window-owner="${e}"]`)}function dt(e){const t=ct(e),n=t??ut(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 ht(){const e=z();if(!e)return;const t=document.querySelector(`[data-modal-panel][data-modal-id="${e}"]`);return t?.getAttribute("data-window-key")??void 0}var mt=/* @__PURE__ */new Map;function pt(){const e=ht();if(e)return mt.get(e)}function ft(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 wt="rosh-peek-style",yt=j.peek,gt=j.taskbarPreview;function bt(e){"undefined"!=typeof document&&(!function(){if("undefined"==typeof document||document.getElementById(wt))return;const e=document.createElement("style");e.id=wt,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:${yt}!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 vt(){"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 xt({id:e,label:t,maxW:n,maxH:r,titleAbove:o=!1,onClick:i,onClose:a}){const s=U(),l=_(null),[c,u]=Z({w:n,h:Math.round(.75*r)}),[d,h]=Z(!1);return J(()=>{const o=l.current;if(!o)return;const i=ct(e)??ft(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__ */ce("div",{style:{width:c.w,height:c.h},className:"relative rounded-md overflow-hidden bg-white/95 border border-line-strong shadow-(--elevation-panel) cursor-pointer ring-2 ring-transparent group-hover:ring-blue-400 transition shrink-0",onClick:i,children:[
|
|
19
19
|
/* @__PURE__ */ue("div",{ref:l,className:"absolute inset-0 z-0 overflow-hidden"}),!d&&/* @__PURE__ */ce("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-gray-400 bg-gray-50",children:[
|
|
20
20
|
/* @__PURE__ */ue($,{name:"window",className:"h-6 w-6",strokeWidth:1.5}),
|
|
21
|
-
/* @__PURE__ */ue("span",{className:"mt-1 text-3xs uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */ue("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__ */ue("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__ */ue($,{name:"close",className:"h-3 w-3",strokeWidth:3})})]})}function kt({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=U(),s=e.length>1,l=
|
|
21
|
+
/* @__PURE__ */ue("span",{className:"mt-1 text-3xs uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */ue("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__ */ue("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__ */ue($,{name:"close",className:"h-3 w-3",strokeWidth:3})})]})}function kt({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=U(),s=e.length>1,l=_(null),[c,u]=Z({left:-9999,top:-9999,ready:!1}),[d,h]=Z(()=>"undefined"!=typeof document&&getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom");J(()=>{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]),G(()=>vt,[]);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 he(
|
|
22
22
|
/* @__PURE__ */ue("div",{ref:l,"data-taskbar-preview":"",style:{position:"fixed",left:c.left,top:c.top,zIndex:gt,maxWidth:"calc(100vw - 16px)",opacity:c.ready?1:0},className:s?"flex gap-2 flex-wrap":"",onMouseEnter:o,onMouseLeave:()=>{vt(),i()},children:e.map(e=>{const t=ct(e.id)??ft(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__ */
|
|
23
23
|
return ce("div",{className:"group flex flex-col items-center",onMouseEnter:()=>bt(t),children:[!m&&/* @__PURE__ */ue("span",{className:p,children:e.label}),
|
|
24
24
|
/* @__PURE__ */ue(xt,{id:e.id,label:e.label,maxW:240,maxH:160,titleAbove:!0,onClick:()=>n(e.id),onClose:()=>r(e.id)}),m&&/* @__PURE__ */ue("span",{className:p,children:e.label}),null!==o&&/* @__PURE__ */ce("span",{title:a.taskbar.offscreenHint,className:"mt-1 inline-flex items-center gap-1 rounded bg-amber-500 px-2 py-0.5 text-2xs font-semibold text-on-accent shadow-sm",children:[
|
|
25
|
-
/* @__PURE__ */ue($,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function Et(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 Ct({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=U(),[a,s]=Z(null);
|
|
25
|
+
/* @__PURE__ */ue($,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function Et(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 Ct({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=U(),[a,s]=Z(null);G(()=>{let e,t;const n=()=>{clearInterval(e),clearTimeout(t),e=void 0},r=()=>{const e=document.getElementById("taskbar-windows");return s(t=>t===e?t:e),!!e},o=()=>{n(),r()||(e=setInterval(()=>{r()&&n()},100),t=setTimeout(n,5e3))};return o(),window.addEventListener("react-os-shell:layout-mode-changed",o),()=>{n(),window.removeEventListener("react-os-shell:layout-mode-changed",o)}},[]);const c=Q(T,z),[,u]=Z(0);G(()=>{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]=Z(0);G(()=>{const e=()=>d(e=>e+1);return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[]);const h=e=>{const t=ft(e),n=t?.querySelector("[data-window-title]");return n?.textContent?.trim()||e},[m,p]=Z(null),[f,w]=Z(null),[g,b]=Z(null),v=_(null),x=()=>{v.current&&(clearTimeout(v.current),v.current=null),v.current=setTimeout(()=>{p(null),w(null)},150)},k=e.filter(e=>!e.route||!ve[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?ve[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 he(
|
|
26
26
|
/* @__PURE__ */ce(de,{children:[E.map(e=>{const n=e.route?l[e.route]:null,r=e.items[e.items.length-1];let a=!1;if(c){const t=document.querySelector(`[data-modal-id="${c}"]`);if(t){const n=t.querySelector("[data-window-title]"),r=n?.textContent??"";a=e.items.some(e=>r.includes(e.label))}}const s=e.items.length>1,u=e.items.some(e=>{const t=ct(e.id)??ft(e.label);return!!t&&!dr(t)});/* @__PURE__ */
|
|
27
27
|
return ce("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.currentTarget,void(g||(v.current&&(clearTimeout(v.current),v.current=null),v.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(),v.current&&(clearTimeout(v.current),v.current=null),p(null),w(null),s?b({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&&te(n)?oe(n,{className:"h-3.5 w-3.5 shrink-0"}):/* @__PURE__ */ue($,{name:"expand",className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),
|
|
28
28
|
/* @__PURE__ */ue("span",{className:"truncate flex-1",children:s?e.label:h(r.label)}),u&&/* @__PURE__ */ue("span",{title:i.taskbar.offscreenDot,className:"shrink-0 h-1.5 w-1.5 rounded-full bg-amber-500"}),s&&/* @__PURE__ */ue(y,{count:e.items.length,label:i.count.windows(e.items.length)}),!s&&/* @__PURE__ */ue("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__ */ue($,{name:"close",className:"h-3 w-3",strokeWidth:2})})]},e.key)}),
|
|
29
29
|
/* @__PURE__ */ue("div",{className:"flex-1"}),k.length>=2&&/* @__PURE__ */ce("button",{onClick:n,title:i.taskbar.expose,className:"flex items-center gap-1 rounded px-2 py-1 text-2xs font-medium text-blue-600 border border-blue-300 hover:bg-accent-tint transition-colors shrink-0",children:[
|
|
30
30
|
/* @__PURE__ */ue($,{name:"grid",className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),g&&/* @__PURE__ */ce(I,{portal:!0,minWidth:200,style:Et(g.x,g.y),onClose:()=>b(null),children:[
|
|
31
|
-
/* @__PURE__ */ue(
|
|
32
|
-
/* @__PURE__ */ce(
|
|
31
|
+
/* @__PURE__ */ue(K,{children:g.label}),
|
|
32
|
+
/* @__PURE__ */ce(R,{onClick:()=>{b(null),g.items.forEach(e=>function(e){const t=On.get(e);t&&tr(t)}(e.id))},children:[
|
|
33
33
|
/* @__PURE__ */ue($,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),i.taskbar.minimizeAllWindows]}),
|
|
34
|
-
/* @__PURE__ */ce(
|
|
34
|
+
/* @__PURE__ */ce(R,{onClick:()=>{b(null),g.items.forEach(e=>o(e.id))},children:[
|
|
35
35
|
/* @__PURE__ */ue("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */ue("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75h6.5v6.5h-6.5zM13.75 8.75h6.5v6.5h-6.5z"})}),i.taskbar.restoreAllWindows]}),
|
|
36
|
-
/* @__PURE__ */ue(
|
|
37
|
-
/* @__PURE__ */ce(
|
|
38
|
-
/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${g.items.length})`]})]}),m&&f&&/* @__PURE__ */ue(kt,{items:m,anchorEl:f,onActivate:e=>{o(e),p(null),w(null)},onClose:e=>{t(e),p(null),w(null)},onMouseEnter:()=>{v.current&&(clearTimeout(v.current),v.current=null)},onMouseLeave:x})]}),a)}var Mt=["/login","/forgot-password","/reset-password","/force-change-password"];function Nt({children:e,windowAccentForRoute:t}){const n=me(),r=Mt.some(e=>n.pathname.startsWith(e)),[o,i]=Z([]),a=
|
|
36
|
+
/* @__PURE__ */ue(W,{}),
|
|
37
|
+
/* @__PURE__ */ce(R,{danger:!0,onClick:()=>{b(null),g.items.forEach(e=>t(e.id))},children:[
|
|
38
|
+
/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${g.items.length})`]})]}),m&&f&&/* @__PURE__ */ue(kt,{items:m,anchorEl:f,onActivate:e=>{o(e),p(null),w(null)},onClose:e=>{t(e),p(null),w(null)},onMouseEnter:()=>{v.current&&(clearTimeout(v.current),v.current=null)},onMouseLeave:x})]}),a)}var Mt=["/login","/forgot-password","/reset-password","/force-change-password"];function Nt({children:e,windowAccentForRoute:t}){const n=me(),r=Mt.some(e=>n.pathname.startsWith(e)),[o,i]=Z([]),a=_(o);J(()=>{a.current=o},[o]);const s=Q(Te,Le,Le),l=_(/* @__PURE__ */new Map),c=e=>{const t=je(e),n=!!s&&"page"===e.type&&e.route===s,r=e.pageSearch||void 0,o=l.current.get(e.id);if(o&&o.tab===t&&o.home===n&&o.pageSearch===r)return o;const i={key:e.id,tab:t,home:n,...r?{pageSearch:r}:{}};return l.current.set(e.id,i),i};G(()=>{mt.clear();for(const e of o)e.route&&mt.set(e.id,e.route)},[o]);const u=ee(e=>{i(t=>t.filter(t=>t.id!==e))},[]),d=ee(e=>{var t;ct(e)||ut(e)?(t=e,window.dispatchEvent(new CustomEvent(Mr,{detail:{windowKey:t}}))):u(e)},[u]),h=(e,t=!1)=>{const n=Pn;t&&at.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&&at.delete(e)},50)},m=(e,t,n)=>{const r=ze;if(n||!r)return[...e,t];const o=function(e,t,n){if(!je(t))return e.length;if(t.shellOwned&&Be(t,n.home))return 0;const r=Be(t,n.home)?void 0:qe(t)?.key;if(r){let t=-1;if(e.forEach((e,o)=>{je(e)&&!Be(e,n.home)&&qe(e)?.key===r&&(t=o)}),t>=0)return t+1}if("page"===t.type&&t.route&&!Be(t,n.home)&&n.favorites.includes(t.route))return e.length>0&&Be(e[0],n.home)?1:0;const o=t.openedFrom?e.findIndex(e=>e.id===t.openedFrom):-1;if(o>=0){const t=/* @__PURE__ */new Set([e[o].id]);let r=o+1;for(;r<e.length&&e[r].openedFrom&&t.has(e[r].openedFrom);)t.add(e[r].id),r++;const i=t=>je(e[t])&&!Be(e[t],n.home)?qe(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:Le(),favorites:r.favorites});return[...e.slice(0,o),t,...e.slice(o)]},p=ee(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=ee((e,t,n,r,o,a={})=>{if(!ve[e]||!ye(ve[e]))return;const s=`${e}:${t}`,l=ht();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:Xe(n),openedFrom:l},!!a.append))})},[]),w=ee((e,t={})=>{if(!ve[e]||!we(ve[e]))return;const n=ve[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=ht();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=ee(()=>{},[]),g=ee(()=>{},[]),b=d,v=d;/* @__PURE__ */
|
|
39
39
|
return ce(Ze.Provider,{value:{openWindows:o,openEntity:f,openPage:w,reorderWindows:p,closeEntity:b,minimize:y,items:[],openItems:o,restore:g,remove:v,restoreIfMinimized:()=>!1},children:[e,
|
|
40
40
|
/* @__PURE__ */ue(Ct,{openWindows:o,onRemove:d,onSplitView:Ur,onActivate:e=>{document.querySelectorAll("[data-modal-panel]").forEach(t=>{const n=t.querySelector("[data-window-title]");if(n?.textContent?.includes(e)){const e=t.getAttribute("data-modal-id");e&&er(e)}})},onActivateById:dt}),
|
|
41
41
|
/* @__PURE__ */ue(Xr,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
|
|
42
42
|
/* @__PURE__ */
|
|
43
|
-
return ue(Ee.Provider,{value:c(e),children:/* @__PURE__ */ue(Pe,{fallback:(t,n)=>/* @__PURE__ */ue(Yr,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */ue(De,{error:t,onReload:n})}),children:/* @__PURE__ */ue(nn,{spec:rt(e),children:/* @__PURE__ */ue(eo,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */ue(ot,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */ue(lt,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var St=400;function Lt({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=
|
|
44
|
-
return ue(tn.Provider,{value:e,children:t})}var rn=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),on='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600';function an(e){return sn(e).replace(/\s+/g," ").trim()}function sn(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(sn).join("");if(te(e)){const t=e,n="string"==typeof t.type?t.type:"";return rn.has(n)?"":` ${sn(t.props?.children)} `}return""}function ln(e){const t=Y(en);
|
|
45
|
-
return ue("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 wn="erp_window_positions",yn={};try{const e=localStorage.getItem(wn);e&&(yn=JSON.parse(e))}catch{}var gn=null;function bn(){gn&&clearTimeout(gn),gn=setTimeout(()=>{try{localStorage.setItem(wn,JSON.stringify(yn))}catch{}},500)}var vn="erp_activation_order",xn=[];try{const e=localStorage.getItem(vn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(xn=t)}catch{}var kn=null;function En(){kn&&clearTimeout(kn),kn=setTimeout(()=>{try{localStorage.setItem(vn,JSON.stringify(xn))}catch{}},500)}function Cn(e,t){yn[e]||(yn[e]=t,bn())}function Mn(e){return yn[e]?{...yn[e]}:null}function Nn(e,t){yn[e]=t,bn()}function Sn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(yn))n(yn[e],r,o)&&(delete yn[e],i=!0);i&&bn()}var Ln={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},Tn=4e3,zn=()=>{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"},An={small:.8,medium:1,large:1.25,maximized:1.25},Dn=/* @__PURE__ */new Set,Pn=0,In=/* @__PURE__ */new Map;var
|
|
43
|
+
return ue(Ee.Provider,{value:c(e),children:/* @__PURE__ */ue(Pe,{fallback:(t,n)=>/* @__PURE__ */ue(Yr,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */ue(De,{error:t,onReload:n})}),children:/* @__PURE__ */ue(nn,{spec:rt(e),children:/* @__PURE__ */ue(eo,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */ue(ot,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */ue(lt,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var St=400;function Lt({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=_(null),s=_(!1);n&&!s.current&&(a.current="undefined"==typeof document?null:document.activeElement),s.current=n;const l=_(!1),c=_(void 0),u=_(i),d=u.current&&!i;u.current=i;const h=()=>{l.current=!0,clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},St)};G(()=>{n&&!r&&h()},[n,r]),G(()=>{d&&n&&!r&&h()},[d]),G(()=>()=>clearTimeout(c.current),[]),G(()=>{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?P(t.current)[0]:void 0;s?s.focus():(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus())},[n,r,o,i,e,t]),J(()=>{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 Tt=null,zt=/* @__PURE__ */new Set;function At(){return Tt}function Dt(e){if(Tt!==e){Tt=e;for(const e of zt)e()}}function Pt(e){return zt.add(e),()=>{zt.delete(e)}}var It=!1,Rt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},Wt=()=>{};function Kt(e){It=e,Rt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function Ot(e,t){It&&("submenu"===e?Rt.submenus++:Rt.menus++,Rt.menuKey=t)}function $t(e){if(!It)return Wt;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!It)return;const r=performance.now()-t;"move"===e?Rt.moveMs+=r:Rt.resizeMs+=r}}function Ft(){const e=Rt;return Rt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var jt=/* @__PURE__ */new Set([D,v]),qt=e=>jt.has(e)||"function"==typeof e&&"badge"===e.titleRole,Bt=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),Ht=/* @__PURE__ */new Set(["svg"]);function Ut(e){const t=[],n={text:"",accessories:[],badges:[],actions:[]};return Xt(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function Xt(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=>Xt(e,t,n));if(!te(e))return;const r=e;if(r.type===f)return void(void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text));if(r.type===ne)return void re.toArray(r.props.children).forEach(e=>Xt(e,t,n));if("string"==typeof r.type){if(Ht.has(r.type))return;if(!Bt.has(r.type))return n.push(" "),re.toArray(r.props.children).forEach(e=>Xt(e,t,n)),void n.push(" ")}const o=oe(r,{key:`title-part-${t.accessories.length}`});t.accessories.push(o),(qt(r.type)?t.badges:t.actions).push(o)}var Yt=/* @__PURE__ */new Map,Vt=/* @__PURE__ */new Set,Jt=0;function _t(){Jt++,Vt.forEach(e=>e())}function Gt(e){return Yt.get(e)}function Zt(e){return Vt.add(e),()=>{Vt.delete(e)}}function Qt(){return Jt}var en=X(""),tn=X(null);function nn({spec:e,children:t}){/* @__PURE__ */
|
|
44
|
+
return ue(tn.Provider,{value:e,children:t})}var rn=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),on='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600';function an(e){return sn(e).replace(/\s+/g," ").trim()}function sn(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(sn).join("");if(te(e)){const t=e,n="string"==typeof t.type?t.type:"";return rn.has(n)?"":` ${sn(t.props?.children)} `}return""}function ln(e){const t=Y(en);G(()=>{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 cn={};function un(e,t,n){const r=Y(en);G(()=>{if(!r)return;cn[r]||(cn[r]=[]);const o={label:e,icon:n,onClick:t};return cn[r].push(o),()=>{cn[r]=(cn[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function dn({title:e}){const t=_(null);return G(()=>{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__ */ue("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function hn(e){}function mn(){return Y(en)}function pn({children:e,position:t="right",quiet:n=!1}){const r=Y(L),[o,i]=Z(null);return G(()=>{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?he(e,o):null}function fn({onClick:e,children:t,className:n}){const r=Y(L);/* @__PURE__ */
|
|
45
|
+
return ue("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 wn="erp_window_positions",yn={};try{const e=localStorage.getItem(wn);e&&(yn=JSON.parse(e))}catch{}var gn=null;function bn(){gn&&clearTimeout(gn),gn=setTimeout(()=>{try{localStorage.setItem(wn,JSON.stringify(yn))}catch{}},500)}var vn="erp_activation_order",xn=[];try{const e=localStorage.getItem(vn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(xn=t)}catch{}var kn=null;function En(){kn&&clearTimeout(kn),kn=setTimeout(()=>{try{localStorage.setItem(vn,JSON.stringify(xn))}catch{}},500)}function Cn(e,t){yn[e]||(yn[e]=t,bn())}function Mn(e){return yn[e]?{...yn[e]}:null}function Nn(e,t){yn[e]=t,bn()}function Sn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(yn))n(yn[e],r,o)&&(delete yn[e],i=!0);i&&bn()}var Ln={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},Tn=4e3,zn=()=>{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"},An={small:.8,medium:1,large:1.25,maximized:1.25},Dn=/* @__PURE__ */new Set,Pn=0,In=/* @__PURE__ */new Map;var Rn=0;function Wn(){return Rn}function Kn(){Rn++,S.forEach(e=>e())}var On=/* @__PURE__ */new Map,$n=/* @__PURE__ */new Map,Fn=/* @__PURE__ */new Map;function jn(){for(let e=N.length-1;e>=0;e--){const t=Fn.get(N[e]);if(t?.tab)return t.owner}return null}function qn(){return Q(T,jn,()=>null)}var Bn=/* @__PURE__ */new Set;var Hn=null;function Un(e){Hn=null,er(e)}function Xn(e){Hn=e;const t=On.get(e);t&&Un(t)}var Yn=/* @__PURE__ */new Map;function Vn(e){return Yn.get(e)?.holdsChanges()??!1}function Jn(e){const t=Yn.get(e);return t?t.ask():Promise.resolve(!0)}function _n(e){Hn===e&&(Hn=null)}function Gn(e,t,n){if(n&&Fn.set(e,n),t)if(On.set(t,e),$n.set(e,t),Bn.delete(t)){N.unshift(e);const n=xn.indexOf(t);-1!==n&&xn.splice(n,1),xn.unshift(t),En()}else!function(e,t){const n=xn.indexOf(t);if(-1===n)return void N.push(e);let r=N.length;for(let e=0;e<N.length;e++){const t=$n.get(N[e]);if(t&&xn.indexOf(t)>n){r=e;break}}N.splice(r,0,e)}(e,t),-1===xn.indexOf(t)&&(xn.push(t),En());else N.push(e);Kn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&Hn===t&&Un(e)}function Zn(e){return e?Fn.get(e)?.owner??$n.get(e)??null:null}var Qn=/* @__PURE__ */new Set;function er(e){const t=Zn(z()),n=N.indexOf(e);-1!==n&&N.splice(n,1),N.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=N.indexOf(e);-1!==n&&N.splice(n,1),N.push(e)}Dn.delete(e);const o=$n.get(e);if(o){const e=xn.indexOf(o);-1!==e&&xn.splice(e,1),xn.push(o),En(),Hn&&Hn!==o&&(Hn=null)}Kn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const i=Zn(z());i&&i!==t&&Qn.forEach(e=>e(i))}function tr(e){const t=N.indexOf(e);-1!==t&&N.splice(t,1),Dn.add(e),In.set(e,++Pn);const n=$n.get(e);if(n){const e=xn.indexOf(n);-1!==e&&(xn.splice(e,1),En())}Kn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var nr=/* @__PURE__ */new Set;var rr=8,or=32;function ir(){return e()}var ar=c.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: ${j.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 br({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o}){const[i,a]=Z(!1),s=_(void 0),l=_(void 0);G(()=>()=>{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__ */
|
|
46
46
|
return ce("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u,children:[
|
|
47
|
-
/* @__PURE__ */ue("button",{onClick:t,onFocus:c,onBlur:u,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */ue("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__ */ue("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__ */ue("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var vr="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(vr))return;const e=document.createElement("style");e.id=vr,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=$t(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=N.indexOf(e);if(-1===t)return-1;const n=
|
|
48
|
-
/* @__PURE__ */ue("div",{onMouseDown:e=>{e.stopPropagation(),Ar(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:F.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 Yr({open:t,onClose:l,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:y,bodyScroll:v,onMinimize:x,initialBox:k,actions:S,actionsLeft:D,editing:P=!1,edit:R,allowPinOnTop:j,initialPosition:q,widget:B,compact:X,appStyle:V,flushBody:ne,autoHeight:re,autoMinHeight:se,autoWidth:le,widgetMenu:me,dimensions:pe,windowKey:fe,openedFromKey:we,accentRgb:ye,children:ge}){const[be,ve]=Z(()=>r()),xe=E()&&!be,ke=C()&&!!B,[Ce,Me]=Z(0),[Ne,Se]=Z(!1),Le=J(null),Te=J(0);_(()=>{Te.current=Ce},[Ce]);const ze=ee(e=>{xe&&(Le.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},Se(!0),Dt(we??null))},[xe,we]),Ae=Q(Pt,At);_(()=>{if(!Ne)return;const e=e=>{if(!Le.current)return;const t=e.clientX-Le.current.startX;if(Math.abs(e.clientY-Le.current.startY)>Math.abs(t)+12)return Le.current=null,Se(!1),Me(0),void Dt(null);Me(Math.max(0,t))},t=()=>{if(!Le.current)return;const e=.3*window.innerWidth,t=Te.current>e;Le.current=null,Se(!1),t?(Me(window.innerWidth),setTimeout(()=>{l(),Me(0),Dt(null)},180)):(Me(0),Dt(null))};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[Ne]);const[De,We]=Z(c),Re=U(),Oe=Re.window;_(()=>{We(c)},[c]);const $e=ie(()=>an(De).trim()||void 0,[De]),je=ae(),[Fe,qe]=Z(!1),Be=J(!1),[He,Ue]=Z(!1),[Xe,Ye]=Z(null),Ve=Y(tn),Ge=Y(Ee),{prefs:Je,save:_e}=M(),Ze=!!Je.window_accent_stripe,Qe=Je.favorite_documents||[],tt=!!Ve&&Qe.some(e=>e.entityType===Ve.entityType&&e.entityId===Ve.entityId),rt=ee(()=>{if(!Ve)return;const e=tt?Qe.filter(e=>!(e.entityType===Ve.entityType&&e.entityId===Ve.entityId)):[...Qe,{entityType:Ve.entityType,entityId:Ve.entityId,label:Ve.label}];_e({favorite_documents:e})},[Ve,tt,Qe,_e]),[ot,it]=Z(null),[at,st]=Z("top-right"===q?"right":"left"),lt=J(!1),ct=J(null);G(()=>{const e=ct.current;e&&(ye?e.style.setProperty("--window-accent-rgb",ye):e.style.removeProperty("--window-accent-rgb"))},[ye]);const ut=J(!1),dt=J(null),ht=J(null),mt=J(null),[pt,ft]=Z(!1),wt=J(null),yt=J(null),gt=J(null),[bt,vt]=Z(!1);G(()=>{const e=yt.current,t=gt.current;if(!e||!t)return;const n=()=>vt(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!=y&&!1!==y]);const xt=!!R&&!B&&!X&&!V&&(R.editing||"hidden"!==R.state),kt=!!(y||S||D)||pt||xt,Et=Y(Ie),Ct=""!==Y(en),Mt=J(null);Mt.current=Ge?{owner:Ge.key,tab:Ge.tab,root:!Ct}:null;const Nt=fe||(Ge&&!Ct?Ge.key:null),St=!!Et&&!Ct&&Et.enabled&&Et.hasState&&(P||Et.declaredEditable)&&!Et.handMounted&&kt&&!B&&!X&&!V&&!xe,Tt=/* @__PURE__ */ue($,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),zt=u&&te(u)?oe(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??Tt,It=()=>/* @__PURE__ */ue("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();Ye(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:zt}),Wt=40,{minimize:Kt,items:Rt,restoreIfMinimized:Ot,openWindows:$t}=nt(),jt=J(`modal-${Math.random().toString(36).slice(2,8)}`).current;_(()=>{if(B)return nr.add(jt),()=>{nr.delete(jt)}},[B,jt]),_(()=>{const e=e=>{const t=e.detail;t?.id===jt&&We(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[jt]);const[Ft,qt]=Z(F.window),Bt=function(e){const t=Q(T,z);return N.length<=1||t===e}(jt),Ht=J(R);Ht.current=R;const Xt=!!R&&!R.editing&&"enabled"===R.state;_(()=>{if(!t||!Bt||!Xt)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(g(e.target,ct.current)||(e.preventDefault(),e.stopPropagation(),Ht.current?.onEdit()))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Bt,Xt]);const Vt=function(e){return Q(T,()=>Dn.has(e))}(jt);Lt({panelRef:ct,bodyRef:dt,open:t,widget:!!B,active:Bt,minimized:Vt});const Gt=Q(Tr,zr),_t=Q(Kr,Rr),Zt=Q(Fr,qr),Qt=!j&&!B,nn=Gt&&Qt,[rn,sn]=Z(!1),ln=nn&&Zt===jt,[un,dn]=Z(!1),hn=un&&Qt&&_t===jt?"picked":null,mn=J(nn);_(()=>{if(mn.current&&!nn){dn(!0);const e=setTimeout(()=>{dn(!1),Ir===jt&&Or(null)},700);return mn.current=nn,()=>clearTimeout(e)}mn.current=nn},[nn,jt]),_(()=>{nn||sn(!1)},[nn]),_(()=>{const e=ht.current,t=mt.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>ft(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]),_(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&ct.current){const t=ct.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=ht.current,n=mt.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const pn=J(!1),fn=ee(e,[]),wn=ee(()=>{const t=e(),n=pe?pe[0]:Ln[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=An[zn()],l=pe?Math.min(pe[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*(N.length-1),u=Math.max(Wt,(i-l)/2),d=(o-a)/2,m=t.h-Wt-l-u;return"top-right"===q?{x:t.x+t.w-a-Wt,y:t.y+Wt,w:a,h:l}:"top-left"===q?{x:t.x+Wt,y:t.y+Wt,w:a,h:l}:{x:t.x+Math.max(Wt,(o-a)/2+Wt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),gn=J(!1);t||(gn.current=!1);const vn=fe||d||null;_(()=>{if(!t)return;_n(jt,vn,Mt.current??void 0),fe||er(jt),pn.current=!1,qt(Cr(jt));const e=()=>{qt(Cr(jt))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===fe;if(!e.label)return!1;const t=ct.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(er(jt),Kn.current)return;const t=ir(),n=Math.min(Vn.current.w,t.w-40),o=Math.min(Vn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;En({x:i,y:a,w:n,h:o}),Xn(!1)},i=e=>{const t=e.detail;r(t)&&(er(jt),Ye({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==fe)return;er(jt);const t=Vn.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=ct.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)}En(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=N.indexOf(e);-1!==t&&(N.splice(t,1),Rn()),Dn.delete(e),In.delete(e),jn.delete(e);const n=$n.get(e);n&&($n.delete(e),On.delete(n))}(jt),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,jt,vn,fn]);const xn=!B&&"maximized"===zn(),[kn,En]=Z(()=>{if(vn&&yn[vn]){const e={...yn[vn]};return pe&&(e.w=pe[0],re||(e.h=pe[1])),ur(e)}return k?{x:k.x,y:k.y,w:k.w,h:k.h}:xn?fn():wn()}),[Cn,Mn]=Z(()=>!re),Nn=J(be),Sn=J(null);_(()=>{const e=()=>{const e=r();e!==Nn.current&&Sn.current?.(e),Nn.current=e,ve(e),qt(Cr(jt))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[jt]);const Pn=be&&!!Ge?.tab&&!Ct&&!B&&!xe,Wn=Pn,Kn=J(Wn);Kn.current=Wn;const Fn=qn(),Bn=be&&!!Ge?.tab&&!B&&!xe&&!Gt&&Fn!==Ge.key,Hn=!!B&&be&&!Gt&&null!==Fn,[Un,Xn]=Z(()=>vn&&yn[vn]||k?Wn:Wn||xn),Vn=J(kn);Vn.current=kn;const Gn=J(Un);G(()=>{Gn.current=Un},[Un]),G(()=>{if(Cn||Pn)return;const e=ct.current,t=dt.current;if(!e||!t)return;const n=se??(B?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,Vn.current.y)-24),g=w?Math.min(Vn.current.h,y):Math.min(Math.max(n,u+p),y),b=Math.abs(g-o)>1;b&&(o=g,En(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),B||(g<=n?i&&(clearTimeout(i),i=null):(b||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&Mn(!0)},160)))},l=new ResizeObserver(s);s(),wt.current&&l.observe(wt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[Cn,B,se,kt,Pn]),G(()=>{if(!re||!Cn||B||!t)return;const e=wt.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||Un)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=se??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,Vn.current.y)-24);En(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[re,Cn,B,t,Un,se]);const Jn=!1!==le&&!B&&!V&&!xe,[Zn,Qn]=Z(()=>!Jn);G(()=>{if(Zn||!t)return;if(!Jn||Un)return void Qn(!0);const n=ct.current,r=dt.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let l=Vn.current.w,c=0;const u=()=>Qn(!0),d=()=>{c=0;const t=Vn.current;if(Math.abs(t.w-l)>1||document.body.classList.contains("rosh-gesturing"))return void u();const d=e(),h=d.w-80;if(t.w>=h)return void u();const m=[],p=[];for(const e of[r,...Array.from(r.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||o.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(m.push(e),p.push(t))}if(!m.length)return;const f=Math.min(h,t.w+Math.max(...p)),w=f-t.w,y=n.style.width;n.style.width=`${f}px`;const g=m.map((e,t)=>({over:p[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{i(e,w)||o.add(m[t])});const b=a(t,s(t.w,w,g),d,Wt);b!==t&&(l=b.w,En(b))};d();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(u,Tn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Zn,t,Jn,Un]);const ar=J(null),sr=!(!Ge?.tab||Ct||B||xe);Sn.current=t=>{if(!sr)return;if(t)return ar.current||(ar.current={box:{...Vn.current},maximized:Gn.current}),void(Gn.current=!0);const r=ar.current;ar.current=null;const o=e();if(r?.maximized)return Gn.current=!0,Xn(!0),void En(o);const i=r?.box??(vn?yn[vn]:void 0);if(Gn.current=!1,Xn(!1),i&&!n(i,o,!1)){const e={...i};pe&&(e.w=pe[0],re||(e.h=pe[1])),En(ur(e))}else En(wn())},_(()=>{Wn&&(Gn.current=!0,Xn(!0),En(fn()))},[Wn,fn]),_(()=>{if(B)return;const e=()=>{const e=vn?yn[vn]:void 0;if(Gn.current=!1,Xn(!1),e){const t={...e};pe&&(t.w=pe[0],re||(t.h=pe[1])),En(ur(t))}else En(wn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[B,wn,vn]),_(()=>{t&&vn&&!Pn&&(yn[vn]=kn,bn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[kn,t,vn,Pn]),_(()=>{if(!t)return;const e=()=>{Gn.current?En(fn()):document.body.classList.contains("rosh-gesturing")||En(ur)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Un&&(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,Un,fn]),_(()=>{if(t&&(qe(!1),Be.current=!1,lt.current=!1,Qn(!Jn),!Kn.current)){if(vn&&yn[vn]){const e=yn[vn];return void En(t=>ur({...e,...re?{h:t.h}:{},...Jn?{x:t.x,w:t.w}:{}}))}k&&(En({x:k.x,y:k.y,w:k.w,h:k.h}),Xn(k.maximized))}},[t]),_(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{ct.current?.contains(t.target)&&!Be.current&&(Be.current=!0,e=setTimeout(()=>qe(!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 dr="auto"===m?Fe:!0===m,mr=Ge&&!Ct?Ge.key:null,wr=ie(()=>Ut(De),[De]),yr=J({shortcutSpec:Ve,isOnDesktop:tt,toggleDesktopShortcut:rt,taskbarStrings:Re.taskbar});G(()=>{yr.current={shortcutSpec:Ve,isOnDesktop:tt,toggleDesktopShortcut:rt,taskbarStrings:Re.taskbar}});const gr=J(null);gr.current||(gr.current={open:(e,t)=>Ye({x:e,y:t}),items:()=>{const e=yr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of cn[jt]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),_(()=>{if(t&&mr)return()=>{return e=mr,void(Yt.delete(e)&&Jt());var e}},[t,mr]),et(!(fe||!t)&&dr);const vr=ee(()=>dr||"auto"===m&&Be.current,[dr,m]),Nr=ee(async e=>{if(lt.current)return!1;if(!vr())return!0;lt.current=!0;const t=$e,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 w({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 lt.current=!1,r},[vr,$e]),Sr=ee(()=>lt.current?Promise.resolve():vr()?Nr("close").then(e=>{e&&l()}):(l(),Promise.resolve()),[vr,Nr,l]),Lr=ee(async()=>{await Nr("discard")&&(Be.current=!1,qe(!1),Ht.current?.onDiscard())},[Nr]),Dr=ee(async()=>{const e=await Nr("switch");return e&&(Be.current=!1,qe(!1)),e},[Nr]),Pr=J(()=>!1);G(()=>{Pr.current=vr}),G(()=>{if(!t||!fe)return;const e={holdsChanges:()=>Pr.current(),ask:Dr};return Yn.set(fe,e),()=>{Yn.get(fe)===e&&Yn.delete(fe)}},[t,fe,Dr]),G(()=>{if(!t||!Nt)return;const e=e=>{e.detail?.windowKey===Nt&&Sr()};return window.addEventListener(Mr,e),()=>window.removeEventListener(Mr,e)},[t,Nt,Sr]);const Wr=J(null),$r=ee(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Ye(null),er(jt),Kn.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=ct.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Wr.current){const t=Wr.current;Wr.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:Vn.current.x,c=s?s.top:Vn.current.y,u=s?s.height:Vn.current.h,d=s?s.width:Vn.current.w;Xn(!1),En(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)`),Vn.current={...Vn.current,x:s,y:u},!B){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({...Vn.current});if(Vn.current=e,!B&&h){Wr.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 En(e)}if(B){const t=e.x+e.w/2,n=window.innerWidth/2;st(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),En(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),jr=ee((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=ct.current,l=s?.getBoundingClientRect(),c=l?l.left:Vn.current.x,u=l?l.top:Vn.current.y,d=l?l.width:Vn.current.w,h=l?l.height:Vn.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;Xn(!1),En({x:c,y:u,w:d,h:h}),Vn.current={x:c,y:u,w:d,h:h};let y=0,g=null;const b=()=>{if(y=0,!g)return;const e=g;g=null,Vn.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},v=e=>{if(!o){if(Math.abs(e.clientX-i)<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(b))},x=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),b(),o?.(),En({...Vn.current})};window.addEventListener("pointermove",v),window.addEventListener("pointerup",x)},[]),Br=ee(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(jt),"Enter"===e.key)return void(Un?(Xn(!1),En(wn())):(Xn(!0),En(fn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Wr.current||(Wr.current={...Vn.current})};if(r<0)return e(),Xn(!0),void En(fn());if(r>0){if(Un)return Xn(!1),void En(wn());if(Wr.current){const e=ur(Wr.current);return Wr.current=null,Vn.current=e,void En(e)}return void tr(jt)}e(),Xn(!1);const t=hr(n<0?"left":"right");return Vn.current=t,void En(t)}if(Un)return;const o=Vn.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)});Vn.current=i,En(i)},[jt,Un,wn,fn]),Hr=ee(e=>{Wr.current||(Wr.current={...Vn.current}),Xn(!1);const t=hr(e);Vn.current=t,En(t),er(jt)},[jt]),Ur=Wn||nn?{}:{tabIndex:0,role:"group","aria-label":$e?`${$e} — ${Oe.windowSuffix}`:Oe.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:Br},Xr=()=>{Xn(!0),En(fn())},Yr=ee(()=>{const e=ct.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(on);t&&!t.disabled&&t.click()}},[]);_(()=>{if(!t)return;if(B)return;const e=e=>{if(N[N.length-1]===jt&&!g(e.target,ct.current)&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Yr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&ct.current?.contains(t)))return;if(t.closest(A))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Yr,jt,B]),_(()=>{if(!t)return;const e=e=>{N[N.length-1]===jt&&(g(e.target,ct.current)||((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:jt}})),Be.current=!1,qe(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:jt}})))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),_(()=>{if(!t)return;if(B)return;const e=e=>{if("Escape"===e.key&&N[N.length-1]===jt){if(H(e))return e.preventDefault(),void e.stopPropagation();if(Pn&&!P)return;e.preventDefault(),e.stopPropagation(),Sr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Sr,jt,B,Pn,P]);const Vr=t&&(void 0!==p||void 0!==f),[Gr]=Z(()=>{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}),Jr=Pn&&!Ge?.home&&wr.actions.length>0;_(()=>{t&&mr&&function(e,t){const n=Yt.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(Yt.set(e,t),Jt())}(mr,{title:wr.text||$e,dirty:dr,copy:wr.copy,actions:Jr&&Gr?Gr:void 0,menu:gr.current??void 0})},[t,mr,$e,dr,wr.text,wr.copy,Jr,Gr]);const _r=ee(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(_(()=>{if(!t)return;const e=e=>{if(N[N.length-1]!==jt)return;if(g(e.target,ct.current))return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Vr&&(e.preventDefault(),p?p():_r("bottom")),"k"===e.key&&Vr&&(e.preventDefault(),f?f():_r("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Vr,_r,jt]),!t||gn.current)return null;const Zr=nn?function(e){if("undefined"==typeof document)return null;const t=Array.from(document.querySelectorAll("[data-modal-panel]")).filter(e=>{const t=e;return!t.hasAttribute("data-utility")&&!t.hasAttribute("data-widget")&&"none"!==t.style.display});t.sort((e,t)=>(e.getAttribute("data-modal-id")||"").localeCompare(t.getAttribute("data-modal-id")||""));const n=t.findIndex(t=>t.getAttribute("data-modal-id")===e),r=t.length;if(n<0||r<1)return null;const o=Math.ceil(Math.sqrt(r)),i=Math.ceil(r/o),a=Math.floor(n/o),s=n%o,l=r-o*(i-1),c=a===i-1&&l<o,u=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}}(jt):null,Qr=nn&&Zr?Math.min(Zr.w/kn.w,Zr.h/kn.h):1,eo=(()=>{if(nn&&Zr){const e=Qr,t=kn.w*e,n=kn.h*e,r=Zr.x+(Zr.w-t)/2-kn.x,o=Zr.y+(Zr.h-n)/2-kn.y,i=rn||ln;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:F.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(un&&Qt){const e="picked"===hn;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:F.expose+30}:{}}}return null})(),to=b({modal:!1,titleId:!B&&(Pn?!Ge?.home:!xe)?je:void 0,label:wr.text||$e}),no=/* @__PURE__ */ce("div",{children:[
|
|
49
|
-
/* @__PURE__ */ce("div",{ref:ct,"data-modal-panel":!0,"data-modal-id":
|
|
50
|
-
/* @__PURE__ */ue("h2",{id:
|
|
51
|
-
/* @__PURE__ */ue(de,{children:wr.actions}),
|
|
47
|
+
/* @__PURE__ */ue("button",{onClick:t,onFocus:c,onBlur:u,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */ue("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__ */ue("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__ */ue("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var vr="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(vr))return;const e=document.createElement("style");e.id=vr,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=$t(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=N.indexOf(e);if(-1===t)return-1;const n=j.window+t*j.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=N.indexOf(e);-1!==n&&(o=Math.max(o,j.window+n*j.windowStep))}return o>=n?o+2+Math.min(t,7):n}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=N.length-1;e>=0;e--)nr.has(N[e])||N.splice(e,1);xn=xn.filter(e=>{const t=On.get(e);return null!=t&&nr.has(t)}),En(),Kn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var Mr="modal-close-request";function Nr(e){Q(T,Wn);const t=Y(L);if(N.length<=1)return!0;if(e){const t=On.get(e);if(null!=t)return z()===t}return t?.active??null!=z()}var Sr=!1,Lr=/* @__PURE__ */new Set;function Tr(e){return Lr.add(e),()=>Lr.delete(e)}function zr(){return Sr}function Ar(e){Sr!==e&&(Sr=e,Lr.forEach(e=>e()))}function Dr(){Ar(!Sr)}function Pr(){Ar(!1)}var Ir=null,Rr=/* @__PURE__ */new Set;function Wr(e){return Rr.add(e),()=>Rr.delete(e)}function Kr(){return Ir}function Or(e){Ir!==e&&(Ir=e,Rr.forEach(e=>e()))}var $r=null,Fr=/* @__PURE__ */new Set;function jr(e){return Fr.add(e),()=>Fr.delete(e)}function qr(){return $r}function Br(e){$r!==e&&($r=e,Fr.forEach(e=>e()))}function Hr(){if(!$r)return void Ar(!1);Or($r),Br(null),Ar(!1)}function Ur(){Ar(!Sr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function Xr(){const e=Q(Tr,zr),[t,n]=Z(e),[r,o]=Z(e);return G(()=>{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?he(
|
|
48
|
+
/* @__PURE__ */ue("div",{onMouseDown:e=>{e.stopPropagation(),Ar(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:j.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 Yr({open:t,onClose:l,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:y,bodyScroll:v,onMinimize:x,initialBox:k,actions:S,actionsLeft:D,editing:P=!1,edit:K,allowPinOnTop:F,initialPosition:q,widget:B,compact:X,appStyle:V,flushBody:ne,autoHeight:re,autoMinHeight:se,autoWidth:le,widgetMenu:me,dimensions:pe,windowKey:fe,openedFromKey:we,accentRgb:ye,children:ge}){const[be,ve]=Z(()=>r()),xe=E()&&!be,ke=C()&&!!B,[Ce,Me]=Z(0),[Ne,Se]=Z(!1),Le=_(null),Te=_(0);G(()=>{Te.current=Ce},[Ce]);const ze=ee(e=>{xe&&(Le.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},Se(!0),Dt(we??null))},[xe,we]),Ae=Q(Pt,At);G(()=>{if(!Ne)return;const e=e=>{if(!Le.current)return;const t=e.clientX-Le.current.startX;if(Math.abs(e.clientY-Le.current.startY)>Math.abs(t)+12)return Le.current=null,Se(!1),Me(0),void Dt(null);Me(Math.max(0,t))},t=()=>{if(!Le.current)return;const e=.3*window.innerWidth,t=Te.current>e;Le.current=null,Se(!1),t?(Me(window.innerWidth),setTimeout(()=>{l(),Me(0),Dt(null)},180)):(Me(0),Dt(null))};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[Ne]);const[De,Re]=Z(c),Ke=U(),Oe=Ke.window;G(()=>{Re(c)},[c]);const $e=ie(()=>an(De).trim()||void 0,[De]),Fe=ae(),[je,qe]=Z(!1),Be=_(!1),[He,Ue]=Z(!1),[Xe,Ye]=Z(null),Ve=Y(tn),Je=Y(Ee),{prefs:_e,save:Ge}=M(),Ze=!!_e.window_accent_stripe,Qe=_e.favorite_documents||[],tt=!!Ve&&Qe.some(e=>e.entityType===Ve.entityType&&e.entityId===Ve.entityId),rt=ee(()=>{if(!Ve)return;const e=tt?Qe.filter(e=>!(e.entityType===Ve.entityType&&e.entityId===Ve.entityId)):[...Qe,{entityType:Ve.entityType,entityId:Ve.entityId,label:Ve.label}];Ge({favorite_documents:e})},[Ve,tt,Qe,Ge]),[ot,it]=Z(null),[at,st]=Z("top-right"===q?"right":"left"),lt=_(!1),ct=_(null);J(()=>{const e=ct.current;e&&(ye?e.style.setProperty("--window-accent-rgb",ye):e.style.removeProperty("--window-accent-rgb"))},[ye]);const ut=_(!1),dt=_(null),ht=_(null),mt=_(null),[pt,ft]=Z(!1),wt=_(null),yt=_(null),gt=_(null),[bt,vt]=Z(!1);J(()=>{const e=yt.current,t=gt.current;if(!e||!t)return;const n=()=>vt(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!=y&&!1!==y]);const xt=!!K&&!B&&!X&&!V&&(K.editing||"hidden"!==K.state),kt=!!(y||S||D)||pt||xt,Et=Y(Ie),Ct=""!==Y(en),Mt=_(null);Mt.current=Je?{owner:Je.key,tab:Je.tab,root:!Ct}:null;const Nt=fe||(Je&&!Ct?Je.key:null),St=!!Et&&!Ct&&Et.enabled&&Et.hasState&&(P||Et.declaredEditable)&&!Et.handMounted&&kt&&!B&&!X&&!V&&!xe,Tt=/* @__PURE__ */ue($,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),zt=u&&te(u)?oe(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??Tt,It=()=>/* @__PURE__ */ue("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();Ye(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:zt}),Rt=40,{minimize:Wt,items:Kt,restoreIfMinimized:Ot,openWindows:$t}=nt(),Ft=_(`modal-${Math.random().toString(36).slice(2,8)}`).current;G(()=>{if(B)return nr.add(Ft),()=>{nr.delete(Ft)}},[B,Ft]),G(()=>{const e=e=>{const t=e.detail;t?.id===Ft&&Re(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[Ft]);const[jt,qt]=Z(j.window),Bt=function(e){const t=Q(T,z);return N.length<=1||t===e}(Ft),Ht=_(K);Ht.current=K;const Xt=!!K&&!K.editing&&"enabled"===K.state;G(()=>{if(!t||!Bt||!Xt)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(g(e.target,ct.current)||(e.preventDefault(),e.stopPropagation(),Ht.current?.onEdit()))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Bt,Xt]);const Vt=function(e){return Q(T,()=>Dn.has(e))}(Ft);Lt({panelRef:ct,bodyRef:dt,open:t,widget:!!B,active:Bt,minimized:Vt});const Jt=Q(Tr,zr),Gt=Q(Wr,Kr),Zt=Q(jr,qr),Qt=!F&&!B,nn=Jt&&Qt,[rn,sn]=Z(!1),ln=nn&&Zt===Ft,[un,dn]=Z(!1),hn=un&&Qt&&Gt===Ft?"picked":null,mn=_(nn);G(()=>{if(mn.current&&!nn){dn(!0);const e=setTimeout(()=>{dn(!1),Ir===Ft&&Or(null)},700);return mn.current=nn,()=>clearTimeout(e)}mn.current=nn},[nn,Ft]),G(()=>{nn||sn(!1)},[nn]),G(()=>{const e=ht.current,t=mt.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>ft(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]),G(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&ct.current){const t=ct.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=ht.current,n=mt.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const pn=_(!1),fn=ee(e,[]),wn=ee(()=>{const t=e(),n=pe?pe[0]:Ln[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=An[zn()],l=pe?Math.min(pe[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*(N.length-1),u=Math.max(Rt,(i-l)/2),d=(o-a)/2,m=t.h-Rt-l-u;return"top-right"===q?{x:t.x+t.w-a-Rt,y:t.y+Rt,w:a,h:l}:"top-left"===q?{x:t.x+Rt,y:t.y+Rt,w:a,h:l}:{x:t.x+Math.max(Rt,(o-a)/2+Rt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),gn=_(!1);t||(gn.current=!1);const vn=fe||d||null;G(()=>{if(!t)return;Gn(Ft,vn,Mt.current??void 0),fe||er(Ft),pn.current=!1,qt(Cr(Ft));const e=()=>{qt(Cr(Ft))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===fe;if(!e.label)return!1;const t=ct.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(er(Ft),Wn.current)return;const t=ir(),n=Math.min(Vn.current.w,t.w-40),o=Math.min(Vn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;En({x:i,y:a,w:n,h:o}),Xn(!1)},i=e=>{const t=e.detail;r(t)&&(er(Ft),Ye({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==fe)return;er(Ft);const t=Vn.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=ct.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)}En(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=N.indexOf(e);-1!==t&&(N.splice(t,1),Kn()),Dn.delete(e),In.delete(e),Fn.delete(e);const n=$n.get(e);n&&($n.delete(e),On.delete(n))}(Ft),window.removeEventListener("modal-reorder",e),window.removeEventListener("modal-split-view",n),window.removeEventListener("modal-center",o),window.removeEventListener("modal-reveal",a),window.removeEventListener("modal-context-menu",i),window.dispatchEvent(new CustomEvent("modal-reorder"))}},[t,Ft,vn,fn]);const xn=!B&&"maximized"===zn(),[kn,En]=Z(()=>{if(vn&&yn[vn]){const e={...yn[vn]};return pe&&(e.w=pe[0],re||(e.h=pe[1])),ur(e)}return k?{x:k.x,y:k.y,w:k.w,h:k.h}:xn?fn():wn()}),[Cn,Mn]=Z(()=>!re),Nn=_(be),Sn=_(null);G(()=>{const e=()=>{const e=r();e!==Nn.current&&Sn.current?.(e),Nn.current=e,ve(e),qt(Cr(Ft))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[Ft]);const Pn=be&&!!Je?.tab&&!Ct&&!B&&!xe,Rn=Pn,Wn=_(Rn);Wn.current=Rn;const jn=qn(),Bn=be&&!!Je?.tab&&!B&&!xe&&!Jt&&jn!==Je.key,Hn=!!B&&be&&!Jt&&null!==jn,[Un,Xn]=Z(()=>vn&&yn[vn]||k?Rn:Rn||xn),Vn=_(kn);Vn.current=kn;const Jn=_(Un);J(()=>{Jn.current=Un},[Un]),J(()=>{if(Cn||Pn)return;const e=ct.current,t=dt.current;if(!e||!t)return;const n=se??(B?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,Vn.current.y)-24),g=w?Math.min(Vn.current.h,y):Math.min(Math.max(n,u+p),y),b=Math.abs(g-o)>1;b&&(o=g,En(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),B||(g<=n?i&&(clearTimeout(i),i=null):(b||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&Mn(!0)},160)))},l=new ResizeObserver(s);s(),wt.current&&l.observe(wt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[Cn,B,se,kt,Pn]),J(()=>{if(!re||!Cn||B||!t)return;const e=wt.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||Un)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=se??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,Vn.current.y)-24);En(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[re,Cn,B,t,Un,se]);const _n=!1!==le&&!B&&!V&&!xe,[Zn,Qn]=Z(()=>!_n);J(()=>{if(Zn||!t)return;if(!_n||Un)return void Qn(!0);const n=ct.current,r=dt.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let l=Vn.current.w,c=0;const u=()=>Qn(!0),d=()=>{c=0;const t=Vn.current;if(Math.abs(t.w-l)>1||document.body.classList.contains("rosh-gesturing"))return void u();const d=e(),h=d.w-80;if(t.w>=h)return void u();const m=[],p=[];for(const e of[r,...Array.from(r.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||o.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(m.push(e),p.push(t))}if(!m.length)return;const f=Math.min(h,t.w+Math.max(...p)),w=f-t.w,y=n.style.width;n.style.width=`${f}px`;const g=m.map((e,t)=>({over:p[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{i(e,w)||o.add(m[t])});const b=a(t,s(t.w,w,g),d,Rt);b!==t&&(l=b.w,En(b))};d();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(u,Tn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Zn,t,_n,Un]);const ar=_(null),sr=!(!Je?.tab||Ct||B||xe);Sn.current=t=>{if(!sr)return;if(t)return ar.current||(ar.current={box:{...Vn.current},maximized:Jn.current}),void(Jn.current=!0);const r=ar.current;ar.current=null;const o=e();if(r?.maximized)return Jn.current=!0,Xn(!0),void En(o);const i=r?.box??(vn?yn[vn]:void 0);if(Jn.current=!1,Xn(!1),i&&!n(i,o,!1)){const e={...i};pe&&(e.w=pe[0],re||(e.h=pe[1])),En(ur(e))}else En(wn())},G(()=>{Rn&&(Jn.current=!0,Xn(!0),En(fn()))},[Rn,fn]),G(()=>{if(B)return;const e=()=>{const e=vn?yn[vn]:void 0;if(Jn.current=!1,Xn(!1),e){const t={...e};pe&&(t.w=pe[0],re||(t.h=pe[1])),En(ur(t))}else En(wn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[B,wn,vn]),G(()=>{t&&vn&&!Pn&&(yn[vn]=kn,bn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[kn,t,vn,Pn]),G(()=>{if(!t)return;const e=()=>{Jn.current?En(fn()):document.body.classList.contains("rosh-gesturing")||En(ur)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Un&&(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,Un,fn]),G(()=>{if(t&&(qe(!1),Be.current=!1,lt.current=!1,Qn(!_n),!Wn.current)){if(vn&&yn[vn]){const e=yn[vn];return void En(t=>ur({...e,...re?{h:t.h}:{},..._n?{x:t.x,w:t.w}:{}}))}k&&(En({x:k.x,y:k.y,w:k.w,h:k.h}),Xn(k.maximized))}},[t]),G(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{ct.current?.contains(t.target)&&!Be.current&&(Be.current=!0,e=setTimeout(()=>qe(!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 dr="auto"===m?je:!0===m,mr=Je&&!Ct?Je.key:null,wr=ie(()=>Ut(De),[De]),yr=_({shortcutSpec:Ve,isOnDesktop:tt,toggleDesktopShortcut:rt,taskbarStrings:Ke.taskbar});J(()=>{yr.current={shortcutSpec:Ve,isOnDesktop:tt,toggleDesktopShortcut:rt,taskbarStrings:Ke.taskbar}});const gr=_(null);gr.current||(gr.current={open:(e,t)=>Ye({x:e,y:t}),items:()=>{const e=yr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of cn[Ft]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),G(()=>{if(t&&mr)return()=>{return e=mr,void(Yt.delete(e)&&_t());var e}},[t,mr]),et(!(fe||!t)&&dr);const vr=ee(()=>dr||"auto"===m&&Be.current,[dr,m]),Nr=ee(async e=>{if(lt.current)return!1;if(!vr())return!0;lt.current=!0;const t=$e,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 w({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 lt.current=!1,r},[vr,$e]),Sr=ee(()=>lt.current?Promise.resolve():vr()?Nr("close").then(e=>{e&&l()}):(l(),Promise.resolve()),[vr,Nr,l]),Lr=ee(async()=>{await Nr("discard")&&(Be.current=!1,qe(!1),Ht.current?.onDiscard())},[Nr]),Dr=ee(async()=>{const e=await Nr("switch");return e&&(Be.current=!1,qe(!1)),e},[Nr]),Pr=_(()=>!1);J(()=>{Pr.current=vr}),J(()=>{if(!t||!fe)return;const e={holdsChanges:()=>Pr.current(),ask:Dr};return Yn.set(fe,e),()=>{Yn.get(fe)===e&&Yn.delete(fe)}},[t,fe,Dr]),J(()=>{if(!t||!Nt)return;const e=e=>{e.detail?.windowKey===Nt&&Sr()};return window.addEventListener(Mr,e),()=>window.removeEventListener(Mr,e)},[t,Nt,Sr]);const Rr=_(null),$r=ee(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Ye(null),er(Ft),Wn.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=ct.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Rr.current){const t=Rr.current;Rr.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:Vn.current.x,c=s?s.top:Vn.current.y,u=s?s.height:Vn.current.h,d=s?s.width:Vn.current.w;Xn(!1),En(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)`),Vn.current={...Vn.current,x:s,y:u},!B){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({...Vn.current});if(Vn.current=e,!B&&h){Rr.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 En(e)}if(B){const t=e.x+e.w/2,n=window.innerWidth/2;st(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),En(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),Fr=ee((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=ct.current,l=s?.getBoundingClientRect(),c=l?l.left:Vn.current.x,u=l?l.top:Vn.current.y,d=l?l.width:Vn.current.w,h=l?l.height:Vn.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;Xn(!1),En({x:c,y:u,w:d,h:h}),Vn.current={x:c,y:u,w:d,h:h};let y=0,g=null;const b=()=>{if(y=0,!g)return;const e=g;g=null,Vn.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},v=e=>{if(!o){if(Math.abs(e.clientX-i)<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(b))},x=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),b(),o?.(),En({...Vn.current})};window.addEventListener("pointermove",v),window.addEventListener("pointerup",x)},[]),Br=ee(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(Ft),"Enter"===e.key)return void(Un?(Xn(!1),En(wn())):(Xn(!0),En(fn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Rr.current||(Rr.current={...Vn.current})};if(r<0)return e(),Xn(!0),void En(fn());if(r>0){if(Un)return Xn(!1),void En(wn());if(Rr.current){const e=ur(Rr.current);return Rr.current=null,Vn.current=e,void En(e)}return void tr(Ft)}e(),Xn(!1);const t=hr(n<0?"left":"right");return Vn.current=t,void En(t)}if(Un)return;const o=Vn.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)});Vn.current=i,En(i)},[Ft,Un,wn,fn]),Hr=ee(e=>{Rr.current||(Rr.current={...Vn.current}),Xn(!1);const t=hr(e);Vn.current=t,En(t),er(Ft)},[Ft]),Ur=Rn||nn?{}:{tabIndex:0,role:"group","aria-label":$e?`${$e} — ${Oe.windowSuffix}`:Oe.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:Br},Xr=()=>{Xn(!0),En(fn())},Yr=ee(()=>{const e=ct.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(on);t&&!t.disabled&&t.click()}},[]);G(()=>{if(!t)return;if(B)return;const e=e=>{if(N[N.length-1]===Ft&&!g(e.target,ct.current)&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Yr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&ct.current?.contains(t)))return;if(t.closest(A))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Yr,Ft,B]),G(()=>{if(!t)return;const e=e=>{N[N.length-1]===Ft&&(g(e.target,ct.current)||((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:Ft}})),Be.current=!1,qe(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:Ft}})))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),G(()=>{if(!t)return;if(B)return;const e=e=>{if("Escape"===e.key&&N[N.length-1]===Ft){if(H(e))return e.preventDefault(),void e.stopPropagation();if(Pn&&!P)return;e.preventDefault(),e.stopPropagation(),Sr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Sr,Ft,B,Pn,P]);const Vr=t&&(void 0!==p||void 0!==f),[Jr]=Z(()=>{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=Pn&&!Je?.home&&wr.actions.length>0;G(()=>{t&&mr&&function(e,t){const n=Yt.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(Yt.set(e,t),_t())}(mr,{title:wr.text||$e,dirty:dr,copy:wr.copy,actions:_r&&Jr?Jr:void 0,menu:gr.current??void 0})},[t,mr,$e,dr,wr.text,wr.copy,_r,Jr]);const Gr=ee(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(G(()=>{if(!t)return;const e=e=>{if(N[N.length-1]!==Ft)return;if(g(e.target,ct.current))return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Vr&&(e.preventDefault(),p?p():Gr("bottom")),"k"===e.key&&Vr&&(e.preventDefault(),f?f():Gr("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Vr,Gr,Ft]),!t||gn.current)return null;const Zr=nn?function(e){if("undefined"==typeof document)return null;const t=Array.from(document.querySelectorAll("[data-modal-panel]")).filter(e=>{const t=e;return!t.hasAttribute("data-utility")&&!t.hasAttribute("data-widget")&&"none"!==t.style.display});t.sort((e,t)=>(e.getAttribute("data-modal-id")||"").localeCompare(t.getAttribute("data-modal-id")||""));const n=t.findIndex(t=>t.getAttribute("data-modal-id")===e),r=t.length;if(n<0||r<1)return null;const o=Math.ceil(Math.sqrt(r)),i=Math.ceil(r/o),a=Math.floor(n/o),s=n%o,l=r-o*(i-1),c=a===i-1&&l<o,u=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}}(Ft):null,Qr=nn&&Zr?Math.min(Zr.w/kn.w,Zr.h/kn.h):1,eo=(()=>{if(nn&&Zr){const e=Qr,t=kn.w*e,n=kn.h*e,r=Zr.x+(Zr.w-t)/2-kn.x,o=Zr.y+(Zr.h-n)/2-kn.y,i=rn||ln;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:j.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(un&&Qt){const e="picked"===hn;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:j.expose+30}:{}}}return null})(),to=b({modal:!1,titleId:!B&&(Pn?!Je?.home:!xe)?Fe:void 0,label:wr.text||$e}),no=/* @__PURE__ */ce("div",{children:[
|
|
49
|
+
/* @__PURE__ */ce("div",{ref:ct,"data-modal-panel":!0,"data-modal-id":Ft,"data-window-key":fe||void 0,...F?{"data-utility":""}:{},...He?{"data-pinned-top":""}:{},...B?{"data-widget":""}:{},...Je?{"data-window-owner":Je.key}:{},...Je&&!Ct?{"data-window-root":""}:{},...Pn?{"data-window-tab":""}:{},...to,className:Pn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(B?Bt?"shadow-xl":"shadow-lg":"border "+(Bt?"shadow-xl border-line":"shadow-lg border-line-strong")),onMouseDownCapture:e=>{if(ut.current=!1,nn){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),Or(Ft),Ar(!1),void er(Ft)}if(!Bt&&!B&&!He&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===ct.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),ut.current=!0,Ye(null),er(Ft),window.addEventListener("mouseup",()=>{setTimeout(()=>{ut.current=!1},0)},{once:!0}))}},onClickCapture:e=>{ut.current&&(ut.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(nn)return;Ye(null);e.target.closest("[data-modal-panel]")===ct.current&&(e.target.closest("button, input, a, select, textarea")||er(Ft))},style:xe?{zIndex:jt+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${Ce}px)`,transition:Ne?"none":"transform 180ms ease-out",...B?{display:"none"}:{},...jt<0?{display:"none"}:{},...Bt||He||Ae&&fe===Ae?{}:{display:"none"}}:{zIndex:He?j.pinnedWindow:jt+1,width:kn.w,height:kn.h,top:kn.y,...B&&"right"===at?{right:window.innerWidth-kn.x-kn.w}:{left:kn.x},...jt<0&&!He?{display:"none"}:{},...ke?{display:"none"}:{},...Bn||Hn?{visibility:"hidden",pointerEvents:"none"}:{},...eo??{}},children:[xe&&!B&&/* @__PURE__ */ue("div",{onPointerDown:ze,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),B?null:Pn?Je?.home?null:/* @__PURE__ */ce(de,{children:[
|
|
50
|
+
/* @__PURE__ */ue("h2",{id:Fe,"data-window-title":!0,className:"sr-only",children:wr.text||$e}),_r&&Jr&&he(
|
|
51
|
+
/* @__PURE__ */ue(de,{children:wr.actions}),Jr),wr.badges.length>0&&/* @__PURE__ */ue("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:wr.badges})]}):xe?null:
|
|
52
52
|
/* @__PURE__ */ce("div",X?{onPointerDown:$r,"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 "+(Bt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Bt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
53
53
|
/* @__PURE__ */ce("div",{"data-window-title":!0,title:$e,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Bt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!nn&&It(),
|
|
54
|
-
/* @__PURE__ */ue("span",{id:
|
|
54
|
+
/* @__PURE__ */ue("span",{id:Fe,className:"truncate",children:nn?an(De):De})]}),!nn&&/* @__PURE__ */ce("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[F&&/* @__PURE__ */ue("button",{onClick:()=>Ue(e=>!e),title:He?Oe.unpin:Oe.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(He?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */ue($,{name:"bookmark-square",className:"h-3 w-3",fill:He?"currentColor":"none",strokeWidth:1.5})}),
|
|
55
55
|
/* @__PURE__ */ue("button",{type:"button",onClick:Sr,"aria-label":Oe.close,className:"rounded p-0.5 text-ink-faintest hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4"})})]})]}:V?{onPointerDown:$r,"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 "+(Bt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Bt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
56
56
|
/* @__PURE__ */ce("div",{"data-window-title":!0,title:$e,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Bt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!nn&&It(),
|
|
57
|
-
/* @__PURE__ */ue("span",{id:
|
|
58
|
-
/* @__PURE__ */ue("button",{onClick:()=>tr(
|
|
57
|
+
/* @__PURE__ */ue("span",{id:Fe,className:"truncate",children:nn?an(De):De})]}),!nn&&/* @__PURE__ */ce("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[F&&/* @__PURE__ */ue("button",{onClick:()=>Ue(e=>!e),title:He?Oe.unpin:Oe.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(He?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */ue($,{name:"bookmark-square",className:"h-3 w-3",fill:He?"currentColor":"none",strokeWidth:1.5})}),
|
|
58
|
+
/* @__PURE__ */ue("button",{onClick:()=>tr(Ft),title:Oe.minimize,className:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",children:"─"}),!Rn&&/* @__PURE__ */ue(br,{maximized:Un,onToggleMax:()=>{Un?(Xn(!1),En(wn())):Xr()},onSnap:Hr,buttonClassName:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",strings:Oe}),
|
|
59
59
|
/* @__PURE__ */ue("button",{type:"button",onClick:Sr,"aria-label":Oe.close,className:"rounded p-0.5 text-ink-faintest hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4"})})]})]}:{onPointerDown:$r,"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 "+(Bt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Bt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
60
60
|
/* @__PURE__ */ce("div",{"data-window-title":!0,title:$e,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Bt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!nn&&It(),
|
|
61
|
-
/* @__PURE__ */ue("span",{id:
|
|
62
|
-
/* @__PURE__ */ue("button",{onClick:()=>tr(
|
|
61
|
+
/* @__PURE__ */ue("span",{id:Fe,className:"truncate",children:nn?an(De):De})]}),!nn&&/* @__PURE__ */ce("div",{className:"flex items-center gap-3 shrink-0 ml-4",children:[F&&/* @__PURE__ */ue("button",{onClick:()=>Ue(e=>!e),title:He?Oe.unpin:Oe.pinOnTop,className:"text-xs px-2 py-1 rounded hover:bg-gray-200 "+(He?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */ue($,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:He?"currentColor":"none",strokeWidth:1.5})}),
|
|
62
|
+
/* @__PURE__ */ue("button",{onClick:()=>tr(Ft),title:Oe.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!Rn&&/* @__PURE__ */ue(br,{maximized:Un,onToggleMax:()=>{Un?(Xn(!1),En(wn())):Xr()},onSnap:Hr,buttonClassName:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",strings:Oe}),
|
|
63
63
|
/* @__PURE__ */ue("button",{type:"button",onClick:Sr,"aria-label":Oe.close,className:"rounded-(--radius-control) text-ink-faintest hover:text-gray-600",children:/* @__PURE__ */ue($,{name:"close",className:"h-5 w-5"})})]})]}),ye&&Ze&&!B&&!xe&&/* @__PURE__ */ue("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${Bt?.9:.55})`}}),
|
|
64
|
-
/* @__PURE__ */ue(en.Provider,{value:
|
|
65
|
-
/* @__PURE__ */ue(
|
|
66
|
-
/* @__PURE__ */ue(
|
|
67
|
-
/* @__PURE__ */ue(
|
|
68
|
-
/* @__PURE__ */ce(
|
|
64
|
+
/* @__PURE__ */ue(en.Provider,{value:Ft,children:/* @__PURE__ */ue(L.Provider,{value:{rightRef:ht,leftRef:mt,notify:()=>ft(!0),active:Bt,isDirty:dr,footerOpen:kt&&!B&&!X&&!V&&!xe},children:/* @__PURE__ */ue("div",{ref:dt,...B?{onPointerDown:$r,onContextMenu:e=>{e.preventDefault(),it({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${B?"p-0 cursor-move":V||ne?"p-0":X?"p-2":"p-4"} ${B||Pn?"":"backdrop-blur-sm"} ${!1===v||V||ne?"overflow-hidden":"overflow-y-auto overscroll-contain"} ${B?"rounded-2xl select-none":""}`,style:{...B?{touchAction:"none"}:{},backgroundColor:B?"transparent":Pn?"rgb(var(--window-content-rgb))":Bt?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */ue(Pe,{children:ge})})})}),B&&ot&&/* @__PURE__ */ce(I,{minWidth:160,style:{left:ot.x,top:ot.y},onClose:()=>it(null),children:[
|
|
65
|
+
/* @__PURE__ */ue(R,{onClick:()=>{it(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:Ft}))},children:"Settings"}),
|
|
66
|
+
/* @__PURE__ */ue(W,{}),me&&/* @__PURE__ */ce(de,{children:[me,
|
|
67
|
+
/* @__PURE__ */ue(W,{})]}),
|
|
68
|
+
/* @__PURE__ */ce(R,{onClick:()=>{it(null),Ue(e=>!e)},children:[
|
|
69
69
|
/* @__PURE__ */ue("span",{className:"flex-1",children:"Always on Top"}),He&&/* @__PURE__ */ue($,{name:"check",className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
|
|
70
|
-
/* @__PURE__ */ue(
|
|
71
|
-
/* @__PURE__ */ue(
|
|
70
|
+
/* @__PURE__ */ue(W,{}),
|
|
71
|
+
/* @__PURE__ */ue(R,{onClick:()=>{it(null),Sr()},children:"Close"})]}),
|
|
72
72
|
/* @__PURE__ */ce("div",{onPointerDown:$r,ref:wt,"data-modal-footer":"",className:`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${Pn?"":" cursor-move"}${Bt&&!Pn?" backdrop-blur-sm":""}${B||X||V||xe||!kt?" hidden":""}`,style:{touchAction:"none",backgroundColor:Pn?"rgb(var(--window-footer-rgb))":Bt?"rgb(var(--window-footer-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-footer-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
73
|
-
/* @__PURE__ */ce("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[St&&/* @__PURE__ */ue(
|
|
73
|
+
/* @__PURE__ */ce("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[St&&/* @__PURE__ */ue(We,{auto:!0}),D,
|
|
74
74
|
/* @__PURE__ */ue("div",{ref:mt,"data-modal-actions-left":!0,className:"flex items-center gap-2 shrink-0"}),null!=y&&!1!==y&&
|
|
75
75
|
/* @__PURE__ */ue("div",{ref:yt,"data-modal-footer-facts":"",className:"min-w-0 flex-1 overflow-hidden",children:/* @__PURE__ */ue("div",{ref:gt,className:"inline-flex items-center gap-2 whitespace-nowrap"+(bt?" invisible":""),children:y})})]}),
|
|
76
|
-
/* @__PURE__ */ce("div",{"data-modal-footer-right":"",className:"flex items-center gap-2 ml-auto shrink-0",children:[xt&&
|
|
77
|
-
/* @__PURE__ */ue("div",{ref:ht,"data-modal-actions":!0,className:"flex items-center gap-2"}),S]})]}),!B&&!xe&&!nn&&Bt&&!
|
|
78
|
-
/* @__PURE__ */ue("div",{onPointerDown:e=>
|
|
79
|
-
/* @__PURE__ */ue("div",{onPointerDown:e=>
|
|
80
|
-
/* @__PURE__ */ue("div",{onPointerDown:e=>
|
|
81
|
-
/* @__PURE__ */ue("div",{onPointerDown:e=>
|
|
82
|
-
/* @__PURE__ */ue("div",{onPointerDown:e=>
|
|
83
|
-
/* @__PURE__ */ue("div",{onPointerDown:e=>
|
|
84
|
-
/* @__PURE__ */ue("div",{onPointerDown:e=>
|
|
85
|
-
/* @__PURE__ */ue("div",{onPointerDown:e=>
|
|
86
|
-
/* @__PURE__ */ce(
|
|
87
|
-
/* @__PURE__ */ue($,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),Oe.minimize]}),!
|
|
76
|
+
/* @__PURE__ */ce("div",{"data-modal-footer-right":"",className:"flex items-center gap-2 ml-auto shrink-0",children:[xt&&K&&(K.editing?/* @__PURE__ */ue(O,{variant:"secondary",size:"sm","data-modal-discard":"",onClick:()=>{Lr()},children:Oe.discard}):"object"==typeof K.state?/* @__PURE__ */ue(O,{variant:"secondary",size:"sm","data-modal-edit":"","aria-disabled":!0,disabledReason:K.state.disabledReason,children:Oe.edit}):/* @__PURE__ */ue(O,{variant:"secondary",size:"sm","data-modal-edit":"",onClick:()=>K.onEdit(),children:Oe.edit})),
|
|
77
|
+
/* @__PURE__ */ue("div",{ref:ht,"data-modal-actions":!0,className:"flex items-center gap-2"}),S]})]}),!B&&!xe&&!nn&&Bt&&!Rn&&/* @__PURE__ */ce(de,{children:[
|
|
78
|
+
/* @__PURE__ */ue("div",{onPointerDown:e=>Fr(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
79
|
+
/* @__PURE__ */ue("div",{onPointerDown:e=>Fr(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
80
|
+
/* @__PURE__ */ue("div",{onPointerDown:e=>Fr(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
81
|
+
/* @__PURE__ */ue("div",{onPointerDown:e=>Fr(e,"nw"),className:"absolute top-0 left-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
82
|
+
/* @__PURE__ */ue("div",{onPointerDown:e=>Fr(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
83
|
+
/* @__PURE__ */ue("div",{onPointerDown:e=>Fr(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
84
|
+
/* @__PURE__ */ue("div",{onPointerDown:e=>Fr(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
|
|
85
|
+
/* @__PURE__ */ue("div",{onPointerDown:e=>Fr(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),nn&&/* @__PURE__ */ue("div",{className:"absolute inset-0",style:{zIndex:j.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>sn(!0),onMouseLeave:()=>sn(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),er(Ft),Ar(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:rn&&/* @__PURE__ */ue("button",{type:"button","data-expose-close":!0,"aria-label":Ke.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:j.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),Sr()},children:/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),nn&&Zr&&/* @__PURE__ */ue("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:j.expose+(rn?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:an(De)})]}),ro=Xe&&/* @__PURE__ */ce(I,{style:{left:Xe.x,top:Xe.y},onClose:()=>Ye(null),minWidth:160,children:[!B&&!X&&!Pn&&/* @__PURE__ */ce(de,{children:[
|
|
86
|
+
/* @__PURE__ */ce(R,{onClick:()=>{tr(Ft),Ye(null)},children:[
|
|
87
|
+
/* @__PURE__ */ue($,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),Oe.minimize]}),!Rn&&/* @__PURE__ */ce(R,Un?{onClick:()=>{Xn(!1),En(wn()),Ye(null)},children:[
|
|
88
88
|
/* @__PURE__ */ue($,{name:"collapse",className:"h-4 w-4",strokeWidth:1.5}),Oe.windowed]}:{onClick:()=>{Xr(),Ye(null)},children:[
|
|
89
|
-
/* @__PURE__ */ue($,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),Oe.maximize]})]}),
|
|
90
|
-
/* @__PURE__ */ue($,{name:"bookmark-square",className:"h-4 w-4 "+(He?"text-blue-600":""),fill:He?"currentColor":"none",strokeWidth:1.5}),He?Oe.unpin:Oe.pinOnTop]}),Ve&&/* @__PURE__ */ce(
|
|
91
|
-
/* @__PURE__ */ue($,{name:"star",className:"h-4 w-4",fill:tt?"currentColor":"none",strokeWidth:1.5}),tt?
|
|
92
|
-
/* @__PURE__ */ue(
|
|
93
|
-
/* @__PURE__ */ce(
|
|
94
|
-
/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4"}),Oe.close]})]})]}),oo=!!fe&&$t.some(e=>e.id===fe),io=!Vt||oo||B?null:/* @__PURE__ */ce("div",{"data-modal-restore-tab":!0,"data-modal-id":
|
|
95
|
-
/* @__PURE__ */ue("button",{type:"button",onClick:()=>er(
|
|
96
|
-
/* @__PURE__ */ue("button",{type:"button",onClick:()=>er(
|
|
89
|
+
/* @__PURE__ */ue($,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),Oe.maximize]})]}),F&&!Pn&&/* @__PURE__ */ce(R,{onClick:()=>{Ue(e=>!e),Ye(null)},children:[
|
|
90
|
+
/* @__PURE__ */ue($,{name:"bookmark-square",className:"h-4 w-4 "+(He?"text-blue-600":""),fill:He?"currentColor":"none",strokeWidth:1.5}),He?Oe.unpin:Oe.pinOnTop]}),Ve&&/* @__PURE__ */ce(R,{onClick:()=>{Ye(null),rt()},children:[
|
|
91
|
+
/* @__PURE__ */ue($,{name:"star",className:"h-4 w-4",fill:tt?"currentColor":"none",strokeWidth:1.5}),tt?Ke.taskbar.removeFromDesktop:Ke.taskbar.addToDesktop]}),(cn[Ft]||[]).length>0&&/* @__PURE__ */ue(de,{children:(cn[Ft]||[]).map((e,t)=>/* @__PURE__ */ce(R,{onClick:()=>{Ye(null),e.onClick()},children:[e.icon,e.label]},t))}),!(Pn&&Je?.home)&&/* @__PURE__ */ce(de,{children:[
|
|
92
|
+
/* @__PURE__ */ue(W,{}),
|
|
93
|
+
/* @__PURE__ */ce(R,{danger:!0,onClick:()=>{Ye(null),Sr()},children:[
|
|
94
|
+
/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4"}),Oe.close]})]})]}),oo=!!fe&&$t.some(e=>e.id===fe),io=!Vt||oo||B?null:/* @__PURE__ */ce("div",{"data-modal-restore-tab":!0,"data-modal-id":Ft,className:"fixed left-1/2 z-(--z-restore-tab) flex -translate-x-1/2 items-center gap-1 rounded-lg border border-line-strong bg-surface px-2 py-1 shadow-lg",style:{bottom:"calc(var(--taskbar-height, 0px) + 12px)"},children:[
|
|
95
|
+
/* @__PURE__ */ue("button",{type:"button",onClick:()=>er(Ft),title:Oe.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:$e||Oe.windowSuffix}),
|
|
96
|
+
/* @__PURE__ */ue("button",{type:"button",onClick:()=>er(Ft),title:Oe.restore,"aria-label":Oe.restore,className:"rounded px-2 py-0.5 text-xs leading-none text-ink-faintest hover:bg-gray-100 hover:text-gray-600",children:"▴"}),
|
|
97
97
|
/* @__PURE__ */ue("button",{type:"button",onClick:()=>{Sr()},title:Oe.close,"aria-label":Oe.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 he(
|
|
98
|
-
/* @__PURE__ */ce(tn.Provider,{value:null,children:[no,ro,io]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{Sr&&"Escape"===e.key&&(Br(null),Ar(!1))});var Vr=100,
|
|
99
|
-
return ce(Ie.Provider,{value:re,children:[le&&/* @__PURE__ */ue(pn,{position:"left",quiet:!0,children:/* @__PURE__ */ue(
|
|
98
|
+
/* @__PURE__ */ce(tn.Provider,{value:null,children:[no,ro,io]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{Sr&&"Escape"===e.key&&(Br(null),Ar(!1))});var Vr=100,Jr={past:[],future:[]};function _r(e,t){switch(t.type){case"record":{const n=e.past[e.past.length-1];if(null!==t.step.coalesceKey&&n?.coalesceKey===t.step.coalesceKey)return 0===e.future.length?e:{...e,future:[]};const r=[...e.past,t.step];return{past:r.length>Vr?r.slice(r.length-Vr):r,future:[]}}case"undo":return 0===e.past.length?e:{past:e.past.slice(0,-1),future:[t.redoStep,...e.future]};case"redo":return 0===e.future.length?e:{past:[...e.past,t.undoStep],future:e.future.slice(1)};case"clear":return 0===e.past.length&&0===e.future.length?e:Jr}}var Gr=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var Zr=500,Qr=250;function eo({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,i]=se(_r,Jr),a=_(/* @__PURE__ */new Map),[s,l]=Z(0),c=s>0,[u,d]=Z(0),[h,m]=Z(0),p=h>0,{hasAnyPerm:f}=k(),w=t&&0===u&&(!(n&&n.length>0)||f(n)),y=_(null),g=_(!1),b=ee(()=>{const e={};for(const[t,n]of a.current)e[t]=n.getLast();return e},[]),v=ee((e,t)=>{a.current.has(e)||l(e=>e+1),a.current.set(e,t)},[]),x=ee(e=>{a.current.delete(e)&&l(e=>e-1)},[]),E=ee(e=>{d(t=>t+(e?1:-1))},[]),C=ee(e=>{m(t=>t+(e?1:-1))},[]),[M,N]=Z(0),S=M>0,T=ee(e=>{N(t=>t+(e?1:-1))},[]),z=Y(Ie),A=z?.claimReadOnly;G(()=>{if(A&&!w)return A(!0),()=>A(!1)},[A,w]);const D=z?.claimOwnMount;G(()=>{if(D&&S)return D(!0),()=>D(!1)},[D,S]);const P=_({last:0,count:0,tripped:!1}),I=_(!1),R=ee((e,t,n)=>{if(g.current)return void(n&&function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}(n.prev,n.next)||(I.current=!0));if(!w||y.current)return;const r=P.current;if(r.tripped)return;const o=Date.now();if(o-r.last>Qr&&(r.count=0),r.last=o,++r.count>Zr)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${Zr} undo steps with no pause between them, which no user action can do. The value passed to useUndoable for this slice is almost certainly rebuilt on every render (a .map/.filter/object literal in the call) rather than held in state, so it reads as changed every time — and since recording a step re-renders the form, that is a loop. Undo recording is now off for this form to keep the tab responsive.`);y.current={values:b(),label:e,coalesceKey:t},queueMicrotask(()=>{const e=y.current;y.current=null,e&&i({type:"record",step:e})})},[w,b]),W=ee(e=>{for(const[t,n]of Object.entries(e)){const e=a.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),K=ee(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:b(),label:e.label,coalesceKey:null};W(e.values),i({type:"undo",redoStep:t})},[o.past,b,W]),O=ee(()=>{const e=o.future[0];if(!e)return;const t={values:b(),label:e.label,coalesceKey:null};W(e.values),i({type:"redo",undoStep:t})},[o.future,b,W]),[$,F]=Z(0),j=_(0),q=_(0),B=_(!1),H=ee(()=>{g.current=!0,I.current=!1,y.current=null,j.current+=1,q.current=j.current,F(j.current)},[]),U=_(void 0),X=ee(e=>{void 0!==e&&(void 0!==U.current&&e!==U.current&&(B.current=!0),U.current=e),H()},[H]);G(()=>{g.current&&$===q.current&&(g.current=!1,y.current=null,(I.current||B.current)&&i({type:"clear"}),I.current=!1,B.current=!1)},[$]);const V=ee(()=>{B.current=!0,i({type:"clear"}),H()},[H]),J=w&&o.past.length>0,Q=w&&o.future.length>0,te=Nr(r),ne=_({undo:K,redo:O,canUndo:J,canRedo:Q});ne.current={undo:K,redo:O,canUndo:J,canRedo:Q},G(()=>{if(!te||!w)return;const e=e=>{const t=function(e){if(!e.metaKey&&!e.ctrlKey||e.altKey)return null;const t=e.key.toLowerCase(),n="z"===t?e.shiftKey?"redo":"undo":"y"!==t||!e.ctrlKey||e.metaKey||e.shiftKey?null:"redo";if(!n)return null;const r=e.target;return r?.isContentEditable||r?.tagName&&Gr.has(r.tagName.toUpperCase())?null:n}(e);if(!t)return;const n=ne.current;("undo"===t?n.canUndo:n.canRedo)&&(e.preventDefault(),"undo"===t?n.undo():n.redo())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[te,w]);const re=ie(()=>({register:v,unregister:x,record:R,undo:K,redo:O,clear:V,baseline:X,canUndo:J,canRedo:Q,enabled:w,hasState:c,handMounted:S,claimOwnMount:T,claimReadOnly:E,declaredEditable:p,claimEditable:C,undoLabel:J?o.past[o.past.length-1].label:null,redoLabel:Q?o.future[0].label:null}),[v,x,R,K,O,V,X,J,Q,w,c,S,T,E,p,C,o.past,o.future]),oe=""!==mn(),ae=Y(L)?.footerOpen??!1,le=oe&&w&&c&&!S&&ae;/* @__PURE__ */
|
|
99
|
+
return ce(Ie.Provider,{value:re,children:[le&&/* @__PURE__ */ue(pn,{position:"left",quiet:!0,children:/* @__PURE__ */ue(We,{auto:!0})}),e]})}function to(){const e=Y(Ie),t=ee(()=>{},[]);return{undo:e?.undo??t,redo:e?.redo??t,clear:e?.clear??t,baseline:e?.baseline??t,canUndo:e?.canUndo??!1,canRedo:e?.canRedo??!1,undoLabel:e?.undoLabel??null,redoLabel:e?.redoLabel??null,enabled:e?.enabled??!1,hasState:e?.hasState??!1}}function no(e){const t=Y(Ie),n=t?.claimReadOnly,r=t?.claimEditable;G(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function ro(e,t,n){const r=Y(Ie),o=ae(),i=_(e),a=_(t);a.current=t,G(()=>{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=_(r);c.current=r;const u=_({label:s,coalesceKey:l});u.current={label:s,coalesceKey:l},G(()=>{const t=c.current;t&&(Object.is(e,i.current)||(t.record(u.current.label,u.current.coalesceKey,{prev:i.current,next:e}),i.current=e))},[e])}function oo(e,t){const[n,r]=Z(e);return ro(n,e=>r(()=>e),t),[n,r]}export{fn as CancelButton,it as DocFavStar,Ye as EntityWindowFallback,Ue as EntityWindowLoading,Ve as EntityWindowState,on as MODAL_SUBMIT_SELECTOR,Yr as Modal,pn as ModalActions,We as UndoControls,eo as UndoProvider,ve as WINDOW_REGISTRY,De as WindowCrashedFallback,Pe as WindowErrorBoundary,Nt as WindowManagerProvider,dn as WindowTitle,dt as activateWindowById,$t as beginWindowGesture,_n as cancelWindowFront,ke as client_default,Hr as commitExposeHighlight,Jn as confirmWindowDiscard,Ft as drainPerfEvents,Pr as exitExposeMode,Sn as forgetMaximizedWindowBoxes,pt as getActiveWindowRoute,qr as getExposeHighlight,Qt as getWindowChromeVersion,Mn as getWindowPosition,_e as isDraftEntityId,Ge as isDraftEntityWindow,ye as isEntityEntry,we as isPageEntry,xe as isShellApiClientConfigured,je as isTabWindow,Ot as markMenuOpen,Gt as readWindowChrome,Xn as requestWindowFront,Br as setExposeHighlight,Kt as setPerfCollecting,Se as setShellHomeRoute,Ae as setShellTabStrip,be as setShellWindowRegistry,Cn as setWindowDefaultPosition,Nn as setWindowPosition,Ut as splitTitle,jr as subscribeExposeHighlight,Zt as subscribeWindowChrome,qe as tabGroupOf,Dr as toggleExposeMode,qn as useCurrentTabKey,mn as useEnclosingModalId,Nr as useIsActiveWindow,Ce as usePageSearch,to as useUndo,no as useUndoCanEdit,ro as useUndoable,oo as useUndoableState,ln as useWidgetSettings,et as useWindowDirty,nt as useWindowManager,un as useWindowMenuItem,hn as useWindowTitle,Vn as windowHoldsChanges};
|