efficient-shell 13.21.0 → 13.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/dist/{Browser-AE7OYSTS.js → Browser-ZNJ3OZSE.js} +13 -13
- package/dist/Calculator-BPQPQUZN.js +29 -0
- package/dist/CurrencyConverter-M4UJI6VQ.js +21 -0
- package/dist/{Files-Y5UGT3RX.js → Files-4HACSJ7C.js} +77 -77
- package/dist/Notepad-SK2E5VOK.js +24 -0
- package/dist/{PdfViewer-EELX35ZI.js → PdfViewer-FWGHFO4N.js} +1 -1
- package/dist/{PomodoroTimer-6XHLOAJD.js → PomodoroTimer-BR5NOA24.js} +48 -48
- package/dist/{Preview-XQXSRAGY.js → Preview-CLV2ZAU5.js} +26 -26
- package/dist/Sidebar-MY66ILZY.js +44 -0
- package/dist/{Stock-36O4LW46.js → Stock-LZ2QHPU4.js} +3 -3
- package/dist/{Weather-BN6AJJ4S.js → Weather-Q22ZW7ZQ.js} +20 -20
- package/dist/{WorldClock-TUVIRPTM.js → WorldClock-4MSSRLC7.js} +6 -6
- package/dist/ai/index.js +118 -118
- package/dist/apps/ImageAnnotator.js +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.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-23YQNCZ4.js +23 -0
- package/dist/chunk-2AEYVQ2R.js +2 -0
- package/dist/{chunk-MVOYVN3S.js → chunk-2YHS5E27.js} +1 -1
- package/dist/{chunk-X4E4RPFE.js → chunk-2YUAR2EH.js} +5 -5
- package/dist/{chunk-MUNP5Z24.js → chunk-3AMCLA5Q.js} +1 -1
- package/dist/{chunk-PPLPDP6D.js → chunk-3AUN7JSM.js} +1 -1
- package/dist/{chunk-FDDM7VMQ.js → chunk-3BQMICGG.js} +1 -1
- package/dist/{chunk-NILGK2KJ.js → chunk-3EYJ4G7L.js} +1 -1
- package/dist/{chunk-FXSGIT53.js → chunk-3GJVTK4H.js} +8 -8
- package/dist/chunk-3SIHJWR2.js +28 -0
- package/dist/chunk-3SKXWFGG.js +15 -0
- package/dist/{chunk-XD3M5ZXM.js → chunk-3TD3GH53.js} +6 -6
- package/dist/{chunk-4U5M37SF.js → chunk-4PJFL26P.js} +1 -1
- package/dist/{chunk-NA4XPE7S.js → chunk-53HHYEN4.js} +3 -3
- package/dist/{chunk-OF5X4HKC.js → chunk-5JUXMNUC.js} +1 -1
- package/dist/{chunk-TB2ARUE2.js → chunk-5OHFBS2B.js} +1 -1
- package/dist/chunk-5ZOYYL46.js +4 -0
- package/dist/{chunk-TPKNHQIE.js → chunk-66NJCU4W.js} +8 -8
- package/dist/{chunk-BCQSNK2Z.js → chunk-6CFI4YGI.js} +4 -4
- package/dist/{chunk-LKAGXURQ.js → chunk-6MFKKTCE.js} +17 -17
- package/dist/{chunk-QNWC3RWK.js → chunk-6NXPOZ6X.js} +1 -1
- package/dist/{chunk-F4VILY3O.js → chunk-72UHB4JU.js} +1 -1
- package/dist/{chunk-7I5RJPY7.js → chunk-7AVPMO4F.js} +1 -1
- package/dist/{chunk-KYQKMBSY.js → chunk-7B6JPNOD.js} +5 -5
- package/dist/{chunk-JB4WXBJB.js → chunk-7G5HKAGV.js} +5 -5
- package/dist/{chunk-SUSJFGXN.js → chunk-7N42VDGT.js} +9 -9
- package/dist/{chunk-J4CVYOY3.js → chunk-7N6CVTWO.js} +10 -10
- package/dist/{chunk-YCXQDUTW.js → chunk-7PAZO65L.js} +6 -6
- package/dist/{chunk-4G7PJ325.js → chunk-A5FC4LR7.js} +1 -1
- package/dist/{chunk-G5UGCAWN.js → chunk-A6TOHNJY.js} +1 -1
- package/dist/{chunk-HPZLV3KD.js → chunk-AFYLMXOJ.js} +5 -5
- package/dist/{chunk-XAT2MKNU.js → chunk-AH2NEKEN.js} +4 -4
- package/dist/{chunk-G7SILKUY.js → chunk-AQVPWUJ3.js} +5 -5
- package/dist/{chunk-63E4ZZYI.js → chunk-BEXFMSNK.js} +2 -2
- package/dist/{chunk-HOROMBJB.js → chunk-BL347U3N.js} +6 -6
- package/dist/{chunk-SOXZRLSD.js → chunk-BUMY4LIP.js} +3 -3
- package/dist/{chunk-OUYGLDQN.js → chunk-BUUAALHH.js} +7 -7
- package/dist/{chunk-7CBWSLCW.js → chunk-C7Z3ZMJH.js} +12 -12
- package/dist/{chunk-SF4IIV5Z.js → chunk-CJQPC2P3.js} +2 -2
- package/dist/{chunk-5POQCJL6.js → chunk-CUJ537IY.js} +4 -4
- package/dist/{chunk-E7BQZL7X.js → chunk-D4432YRW.js} +1 -1
- package/dist/{chunk-RDVC32EV.js → chunk-D5HFWOW7.js} +16 -16
- package/dist/{chunk-GEITUFYK.js → chunk-D5PXRJHA.js} +19 -19
- package/dist/{chunk-VRJKV44O.js → chunk-DAUE6ULT.js} +1 -1
- package/dist/chunk-DEE6FKE7.js +92 -0
- package/dist/{chunk-YWMCW5BN.js → chunk-DTRJLQWO.js} +1 -1
- package/dist/{chunk-WJMPTW3G.js → chunk-DV6TUXCZ.js} +1 -1
- package/dist/{chunk-23LK4PLJ.js → chunk-E4GF7M4S.js} +8 -8
- package/dist/chunk-EJJTDUN3.js +22 -0
- package/dist/{chunk-RA2UNNJC.js → chunk-F3EBYHIE.js} +10 -10
- package/dist/chunk-FBI3XJWH.js +11 -0
- package/dist/{chunk-WJTNQ7YD.js → chunk-FE7H6RXE.js} +2 -2
- package/dist/{chunk-YQ5JHHLE.js → chunk-FMBUR4EU.js} +1 -1
- package/dist/{chunk-IOLUF3UL.js → chunk-GKYGPCGL.js} +1 -1
- package/dist/{chunk-Q4MOT7TY.js → chunk-GPU7LLTJ.js} +1 -1
- package/dist/{chunk-ZCGT5YNR.js → chunk-GRAFJD3L.js} +1 -1
- package/dist/{chunk-L4ZQY4ZG.js → chunk-GZRNOIEE.js} +3 -3
- package/dist/{chunk-VQ35LXDC.js → chunk-I2NVBDKH.js} +1 -1
- package/dist/{chunk-EZYXY67W.js → chunk-IJG4UEKF.js} +8 -8
- package/dist/{chunk-3SIRRK3F.js → chunk-J5OAQAAD.js} +4 -4
- package/dist/{chunk-SZFULV7I.js → chunk-J5W63XNR.js} +6 -6
- package/dist/{chunk-GNRH43N3.js → chunk-JJYTN72U.js} +2 -2
- package/dist/{chunk-HMOKKMIV.js → chunk-JLSXDYS4.js} +2 -2
- package/dist/{chunk-EFVQQF6F.js → chunk-JXJNQHPY.js} +19 -19
- package/dist/{chunk-HPHDLN6E.js → chunk-JYR4V4AG.js} +2 -2
- package/dist/{chunk-EG5MU7XL.js → chunk-JZ43635V.js} +1 -1
- package/dist/{chunk-KQCJWK55.js → chunk-KC2EQCBE.js} +6 -6
- package/dist/chunk-KUPN5WRE.js +1 -0
- package/dist/{chunk-P52LXNUU.js → chunk-L744YF4X.js} +1 -1
- package/dist/{chunk-SXHV5OLA.js → chunk-LC2UF3AA.js} +1 -1
- package/dist/{chunk-GUSENWAH.js → chunk-LLDGRPLF.js} +1 -1
- package/dist/{chunk-KNZ7YTFH.js → chunk-LLSGIMLG.js} +1 -1
- package/dist/{chunk-JPSWWIBW.js → chunk-LQIHBIXG.js} +6 -6
- package/dist/{chunk-UC5IC3AM.js → chunk-LRMDLZMM.js} +9 -9
- package/dist/{chunk-SHHRC5XK.js → chunk-LUARJHUK.js} +9 -9
- package/dist/chunk-M36B3M2H.js +8 -0
- package/dist/{chunk-2J3C2RR4.js → chunk-M3HTP2N6.js} +6 -6
- package/dist/{chunk-BZRFD4DK.js → chunk-M4REKOGO.js} +1 -1
- package/dist/{chunk-ZNV75GAG.js → chunk-MEFB2KGF.js} +1 -1
- package/dist/{chunk-U2ZTHOQL.js → chunk-MMA3WTF2.js} +4 -4
- package/dist/chunk-MRZLFZNJ.js +6 -0
- package/dist/chunk-N64YAF5N.js +2 -0
- package/dist/chunk-N6PMH6DU.js +6 -0
- package/dist/chunk-NRHG4R2Q.js +1 -0
- package/dist/{chunk-G2JPTPRS.js → chunk-OFMZ6JM6.js} +13 -13
- package/dist/chunk-ONWFKCMB.js +14 -0
- package/dist/{chunk-XWJT6TFU.js → chunk-OSMRYND3.js} +1 -1
- package/dist/{chunk-6OCA7RKQ.js → chunk-P234FPKJ.js} +1 -1
- package/dist/{chunk-IUQJGFEO.js → chunk-P3JPSO3E.js} +8 -8
- package/dist/{chunk-ZVDYRXNP.js → chunk-P4VOUPRF.js} +6 -6
- package/dist/{chunk-ENDYHUUR.js → chunk-P73ZJ6QR.js} +1 -1
- package/dist/{chunk-5HFKVEWW.js → chunk-PFOTEDSQ.js} +1 -1
- package/dist/{chunk-H75CQD46.js → chunk-PHYHKDSW.js} +1 -1
- package/dist/{chunk-FBS55WOX.js → chunk-PLESHI3E.js} +7 -7
- package/dist/{chunk-42DF7CDB.js → chunk-PPI4WJ3V.js} +7 -7
- package/dist/{chunk-M2TQOJ3G.js → chunk-PSVGB7KT.js} +1 -1
- package/dist/{chunk-223XYIIH.js → chunk-Q2RNFBYS.js} +1 -1
- package/dist/{chunk-6OGX7V7L.js → chunk-Q36KB5RQ.js} +7 -7
- package/dist/{chunk-WPGSU4QG.js → chunk-Q7CM4UDG.js} +2 -2
- package/dist/{chunk-BVX7LUAW.js → chunk-QJUMBOL2.js} +6 -6
- package/dist/{chunk-25T4YQO7.js → chunk-QPVYBN4J.js} +2 -2
- package/dist/{chunk-FUPU7Z2G.js → chunk-QRPPWLKU.js} +7 -7
- package/dist/{chunk-7SVSHJOO.js → chunk-QZ2XRFDP.js} +6 -6
- package/dist/{chunk-IE6TRMIW.js → chunk-R3BSWWGB.js} +1 -1
- package/dist/{chunk-CCLK2RPQ.js → chunk-R7CYBBJY.js} +13 -13
- package/dist/{chunk-FFRJ6QZK.js → chunk-RB3BMRNA.js} +1 -1
- package/dist/{chunk-FZYUTZEV.js → chunk-RFWBNKKB.js} +10 -10
- package/dist/{chunk-S25KELFW.js → chunk-RKSCB5BJ.js} +5 -5
- package/dist/{chunk-F3E3CEZM.js → chunk-RM2I6DIF.js} +1 -1
- package/dist/{chunk-QBMMORYP.js → chunk-ROYHU3E5.js} +1 -1
- package/dist/chunk-S4RD6UJU.js +8 -0
- package/dist/{chunk-RDETBXMP.js → chunk-SAHRIE35.js} +1 -1
- package/dist/{chunk-MOKABQCY.js → chunk-SAMPXZF3.js} +3 -3
- package/dist/{chunk-W2TPXKCV.js → chunk-SCNQK5NF.js} +1 -1
- package/dist/{chunk-ABTVRB23.js → chunk-SKVLTYGN.js} +1 -1
- package/dist/{chunk-SM3N5UJ2.js → chunk-TDUOBP55.js} +9 -9
- package/dist/{chunk-BG3C4ALM.js → chunk-TJ5YMXVB.js} +1 -1
- package/dist/{chunk-VFSAJMNX.js → chunk-TNGIXSTM.js} +1 -1
- package/dist/{chunk-BNPWUCZX.js → chunk-TSCJG6UM.js} +1 -1
- package/dist/{chunk-ETQ45TBW.js → chunk-TTYTOLVV.js} +1 -1
- package/dist/{chunk-DO3DSSAW.js → chunk-U73K3ICC.js} +1 -1
- package/dist/{chunk-FRCTA5FS.js → chunk-UAXL44HH.js} +1 -1
- package/dist/{chunk-CWVQH2SP.js → chunk-UDJPSHVI.js} +1 -1
- package/dist/{chunk-L2WBCXG7.js → chunk-UFJR63AO.js} +1 -1
- package/dist/{chunk-YT5HMLC7.js → chunk-UJY5RUZ5.js} +1 -1
- package/dist/{chunk-R6GXVLY7.js → chunk-UMIRPFQJ.js} +1 -1
- package/dist/{chunk-WRV6QKJN.js → chunk-UVPDEGIA.js} +1 -1
- package/dist/{chunk-KEVJBI5Q.js → chunk-VTCMO3K7.js} +1 -1
- package/dist/{chunk-2TXQCA4C.js → chunk-W24THMLI.js} +8 -8
- package/dist/{chunk-VXSYHTBP.js → chunk-W3454ZES.js} +1 -1
- package/dist/{chunk-EFO72DEI.js → chunk-WCAABJEV.js} +1 -1
- package/dist/{chunk-OZ4R6U2M.js → chunk-WREUA43Q.js} +1 -1
- package/dist/{chunk-ELPW25CA.js → chunk-XX34ZFYB.js} +4 -4
- package/dist/chunk-XYQFTFI7.js +24 -0
- package/dist/{chunk-UFX7F3KG.js → chunk-XYVFJLAU.js} +1 -1
- package/dist/{chunk-A7VNKVZO.js → chunk-XYXCZIJY.js} +4 -4
- package/dist/{chunk-ZCN5BU4U.js → chunk-YBE66FBR.js} +1 -1
- package/dist/{chunk-6QH7I2V5.js → chunk-Z6J4KXY3.js} +2 -2
- package/dist/{chunk-NY6MLFBX.js → chunk-ZBGPAUOH.js} +5 -5
- package/dist/{chunk-LADP6AJY.js → chunk-ZFWCTHR4.js} +7 -7
- package/dist/{chunk-ORV2AVIJ.js → chunk-ZRWZHWKI.js} +2 -2
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Gantt.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/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.d.ts +24 -2
- package/dist/index.js +506 -506
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +3 -3
- package/dist/model-viewer/index.js +3 -3
- 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/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.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/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/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.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.d.ts +3 -0
- 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-QEQU3W2L.js +0 -29
- package/dist/CurrencyConverter-L22FF4ST.js +0 -21
- package/dist/Notepad-YZOEXYE3.js +0 -24
- package/dist/Sidebar-UCCVJFSY.js +0 -44
- package/dist/chunk-ABPVCVCT.js +0 -22
- package/dist/chunk-BWQHABH7.js +0 -4
- package/dist/chunk-CILE3ZCC.js +0 -2
- package/dist/chunk-D4WO73XD.js +0 -91
- package/dist/chunk-FMLUQCFB.js +0 -2
- package/dist/chunk-GMLOMLCS.js +0 -24
- package/dist/chunk-HC5KQZFG.js +0 -8
- package/dist/chunk-IUVGHHR3.js +0 -1
- package/dist/chunk-JPE4TYRQ.js +0 -14
- package/dist/chunk-KGAYYSFE.js +0 -6
- package/dist/chunk-LQCNIQ3I.js +0 -8
- package/dist/chunk-LZOKBMAF.js +0 -1
- package/dist/chunk-OXWBSZL2.js +0 -23
- package/dist/chunk-PBSCF2ML.js +0 -15
- package/dist/chunk-QNXTVDIC.js +0 -11
- package/dist/chunk-UTQN5AIO.js +0 -6
- package/dist/chunk-XXTAMF3O.js +0 -28
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import{Segmented as e}from"./chunk-TNALBYLY.js";import{calendarNames as t,formatDate as n}from"./chunk-NHKT5IH6.js";import{toDateKey as r,fromDateKey as a,DAY_MS as o}from"./chunk-JRQMX4PK.js";import{LoadingSpinner as i}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as s}from"./chunk-ZDXRSY2Y.js";import{useShellStrings as l,useShellLocale as d}from"./chunk-
|
|
2
|
-
return b("div",{className:`flex min-h-0 flex-col ${
|
|
1
|
+
import{Segmented as e}from"./chunk-TNALBYLY.js";import{calendarNames as t,formatDate as n}from"./chunk-NHKT5IH6.js";import{toDateKey as r,fromDateKey as a,DAY_MS as o}from"./chunk-JRQMX4PK.js";import{LoadingSpinner as i}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as s}from"./chunk-ZDXRSY2Y.js";import{useShellStrings as l,useShellLocale as d}from"./chunk-NRHG4R2Q.js";import{useState as c,useRef as u,useId as h,useMemo as m}from"react";import{jsx as f,Fragment as p,jsxs as b}from"react/jsx-runtime";var g={day:32,week:16,month:4},y=44;function w(e){const t="string"==typeof e?a(e.slice(0,10)):null;return t?Math.round(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())/o):null}function x(e){return new Date(e*o).toISOString().slice(0,10)}function v(e){return new Date(e*o)}function k(e){return((e+3)%7+7)%7}function N(e){return e-k(e)}function D(e){const t=v(e);return Math.round(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),1)/o)}function M(e){const t=v(e);return Math.round(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,1)/o)}function C(e){return Math.round(Date.UTC(v(e).getUTCFullYear(),0,1)/o)}function $(e){return Math.round(Date.UTC(v(e).getUTCFullYear()+1,0,1)/o)}var T={day:3,week:7,month:14},j={day:28,week:84,month:182};function U(e,t,n){return(e-t.startDay)*g[n]}function P(e,t,n){return U(e,t,n)+g[n]/2}function R(e,t,n,r){const a=[];let o=e.startDay;if(n(o)!==o){const n=Math.min(r(o),e.endDay);a.push({startDay:o,endDay:n,x:U(o,e,t),width:(n-o)*g[t]}),o=n}for(;o<e.endDay;){const n=Math.min(r(o),e.endDay);a.push({startDay:o,endDay:n,x:U(o,e,t),width:(n-o)*g[t]}),o=n}return a}function S(e,t,n,r){if(null===e&&null===t)return{kind:"none"};if(null===e)return{kind:"milestone",day:t,cx:U(t,n,r)+g[r]/2};const a=null===t?e:Math.min(e,t),o=null===t?e:Math.max(e,t);return{kind:"bar",startDay:a,endDay:o,x:U(a,n,r),width:(o-a+1)*g[r]}}function X(e){return"bar"===e.kind?{inX:e.x,outX:e.x+e.width}:"milestone"===e.kind?{inX:e.cx-9,outX:e.cx+9}:null}function Y(e,t,n,r,a=44,o=10){let i;if(n-e>=2*o){const a=e+o;i=[[e,t],[a,t],[a,r],[n,r]]}else{const s=t+(r>=t?1:-1)*a/2,l=e+o,d=n-o;i=[[e,t],[l,t],[l,s],[d,s],[d,r],[n,r]]}return i.filter((e,t)=>0===t||e[0]!==i[t-1][0]||e[1]!==i[t-1][1])}function I(e){return e.map(([e,t],n)=>`${0===n?"M":"L"}${e} ${t}`).join(" ")}function z(e,t,n=5){return`${e},${t} ${e-n},${t-n} ${e-n},${t+n}`}function F(e,t,n,r){if("move"===e)return{start:null===t?null:t+r,end:null===n?null:n+r};if("start"===e){if(null===t)return{start:t,end:n};const e=t+r;return{start:null===n?e:Math.min(e,n),end:n}}if(null===n)return{start:t,end:n};const a=n+r;return{start:t,end:null===t?a:Math.max(a,t)}}var H=24;function L({rows:a,groups:o=[],dependencies:U=[],scale:L,onScaleChange:A,onRowClick:K,onRowChange:Q,readOnly:W=!1,today:E,isLoading:O=!1,emptyState:Z,labelHeader:B,labelWidth:G=240,className:J=""}){const V=l().gantt,q=d(),_=t(q),ee=!!Q&&!W,[te,ne]=c(null),re=u(!1),ae=u(null),oe=h(),ie=w(E)??w(r(/* @__PURE__ */new Date)),se=m(()=>{const e=/* @__PURE__ */new Map;for(const t of a){const n=w(t.start),r=w(t.end);e.set(t.id,te&&te.id===t.id?F(te.mode,te.start,te.end,te.delta):{start:n,end:r})}return e},[a,te]),le=m(()=>{const e=[ie];for(const t of a){const n=w(t.start),r=w(t.end);null!==n&&e.push(n),null!==r&&e.push(r)}return function(e,t){const n=e.filter(e=>Number.isFinite(e)),r=n.length?Math.min(...n):0,a=n.length?Math.max(...n):0;let o=r-T[t],i=a+1+T[t];const s=j[t]-(i-o);return s>0&&(o-=Math.floor(s/2),i+=Math.ceil(s/2)),"week"===t?(o=N(o),i=N(i-1)+7):"month"===t&&(o=D(o),i=M(i-1)),{startDay:o,endDay:i}}(e,L)},[a,L,ie]),de=m(()=>function(e,t){return"day"===t?{major:R(e,t,D,M),minor:R(e,t,e=>e,e=>e+1)}:"week"===t?{major:R(e,t,D,M),minor:R(e,t,N,e=>N(e)+7)}:{major:R(e,t,C,$),minor:R(e,t,D,M)}}(le,L),[le,L]),ce=function(e,t){return(e.endDay-e.startDay)*g[t]}(le,L),ue=m(()=>function(e,t){const n=new Set(t.map(e=>e.id)),r=/* @__PURE__ */new Map,a=[];for(const t of e)if(null!=t.groupId&&n.has(t.groupId)){const e=r.get(t.groupId)??[];e.push(t),r.set(t.groupId,e)}else a.push(t);const o=a.map(e=>({kind:"row",row:e}));for(const e of t){o.push({kind:"group",group:e});for(const t of r.get(e.id)??[])o.push({kind:"row",row:t})}return o}(a,o),[a,o]),he=m(()=>{const e=/* @__PURE__ */new Map;return ue.forEach((t,n)=>{if("row"!==t.kind)return;const r=se.get(t.row.id);e.set(t.row.id,{shape:S(r.start,r.end,le,L),line:n})}),e},[ue,se,le,L]),me=m(()=>{const e=[];for(const t of U){const n=he.get(t.from),r=he.get(t.to);if(!n||!r)continue;const a=X(n.shape),o=X(r.shape);if(!a||!o)continue;const i=n.line*y+22,s=r.line*y+22,l=Y(a.outX,i,o.inX,s);e.push({key:`${t.from}>${t.to}`,d:I(l),head:z(o.inX,s)})}return e},[U,he]),fe=!O&&(a.length>0||o.length>0);s(()=>{const e=ae.current;if(!e)return;const t=e.clientWidth-G;e.scrollLeft=Math.max(0,P(ie,le,L)-t/4)},[L,fe]);if(O)/* @__PURE__ */return f(i,{size:"sm",padding:"p-4",label:V.loading});if(!fe)/* @__PURE__ */return f(p,{children:Z??/* @__PURE__ */f("div",{className:"text-sm text-ink-faint p-4",children:V.empty})});const pe=(e,t,n)=>{Q?.(e.id,{start:null===t?null:x(t),end:null===n?null:x(n)})},be=(e,t,n)=>{if(re.current=!1,ee&&0===e.button){e.stopPropagation();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}ne({id:t.id,mode:n,originX:e.clientX,start:w(t.start),end:w(t.end),delta:0})}},ge=e=>{if(!te)return;const t=function(e,t){const n=Math.round(e/g[t]);return 0===n?0:n}(e.clientX-te.originX,L);t!==te.delta&&ne({...te,delta:t})},ye=e=>{if(te){if(0!==te.delta){const t=F(te.mode,te.start,te.end,te.delta);re.current=!0,pe(e,t.start,t.end)}ne(null)}},we=(e,t)=>{if("Enter"===e.key||" "===e.key)return e.preventDefault(),void K?.(t);if(!ee||"ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();const n="ArrowRight"===e.key?1:-1,r=F(e.shiftKey?"end":"move",w(t.start),w(t.end),n);pe(t,r.start,r.end)},xe=e=>{re.current?re.current=!1:K?.(e)},ve=e=>n(x(e),{locale:q}),ke=(e,t)=>{const n=v(e.startDay),r=n.getUTCFullYear(),a=n.getUTCMonth();return"major"===t?"month"===L?String(r):"week"===L?_.shortMonthYear(r,a):_.monthYear(r,a):"month"===L?_.monthsShort[a]:String(n.getUTCDate())},Ne=ue.length*y,De=P(ie,le,L),Me=De>=0&&De<=ce,Ce=de.minor.find(e=>e.startDay<=ie&&ie<e.endDay),$e=Ce?De-Ce.x:0,Te=!!Ce&&$e<=Ce.width/2;/* @__PURE__ */
|
|
2
|
+
return b("div",{className:`flex min-h-0 flex-col ${J}`,children:[
|
|
3
3
|
/* @__PURE__ */b("div",{className:"flex items-center justify-end gap-2 pb-2",children:[
|
|
4
|
-
/* @__PURE__ */f("button",{type:"button",onClick:()=>{const e=ae.current;if(!e)return;const t=e.clientWidth-
|
|
5
|
-
/* @__PURE__ */f("div",{ref:ae,"data-gantt-scroller":"",className:"relative min-h-0 flex-1 overflow-auto grid-scroll rounded-(--radius-card) border border-line bg-surface",children:/* @__PURE__ */b("div",{className:"relative",style:{width:
|
|
4
|
+
/* @__PURE__ */f("button",{type:"button",onClick:()=>{const e=ae.current;if(!e)return;const t=e.clientWidth-G;e.scrollTo?.({left:Math.max(0,P(ie,le,L)-t/4),behavior:"smooth"})},className:"min-h-8 rounded-(--radius-control) border border-line bg-surface px-3 text-xs font-medium text-ink hover:bg-row-hover",children:V.today}),A&&/* @__PURE__ */f(e,{size:"sm",label:V.scale,value:L,onChange:A,options:[{value:"day",label:V.day},{value:"week",label:V.week},{value:"month",label:V.month}]})]}),
|
|
5
|
+
/* @__PURE__ */f("div",{ref:ae,"data-gantt-scroller":"",className:"relative min-h-0 flex-1 overflow-auto grid-scroll rounded-(--radius-card) border border-line bg-surface",children:/* @__PURE__ */b("div",{className:"relative",style:{width:G+ce,minHeight:48+Ne},children:[
|
|
6
6
|
/* @__PURE__ */b("div",{className:"sticky top-0 z-20 flex border-b border-line bg-surface",style:{height:48},children:[
|
|
7
|
-
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-end border-r border-line bg-surface px-3 pb-1 text-xs font-medium text-ink-muted",style:{width:
|
|
8
|
-
/* @__PURE__ */b("div",{className:"relative shrink-0",style:{width:ce},"aria-hidden":!0,children:[de.major.map(e=>/* @__PURE__ */f("div",{className:"absolute top-0 border-l border-line-subtle text-xs font-medium leading-6 text-ink",style:{left:e.x,width:e.width,height:
|
|
9
|
-
/* @__PURE__ */b("div",{className:"pointer-events-none absolute flex items-center text-2xs "+(Te?"":"flex-row-reverse"),style:{left:Te?Ce.x:De-(Ce.width-$e),width:2*(Te?$e:Ce.width-$e),top:
|
|
7
|
+
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-end border-r border-line bg-surface px-3 pb-1 text-xs font-medium text-ink-muted",style:{width:G},children:B??V.task}),
|
|
8
|
+
/* @__PURE__ */b("div",{className:"relative shrink-0",style:{width:ce},"aria-hidden":!0,children:[de.major.map(e=>/* @__PURE__ */f("div",{className:"absolute top-0 border-l border-line-subtle text-xs font-medium leading-6 text-ink",style:{left:e.x,width:e.width,height:H},children:/* @__PURE__ */f("span",{className:"sticky inline-block whitespace-nowrap px-2",style:{left:G},children:ke(e,"major")})},`M${e.startDay}`)),de.minor.map(e=>/* @__PURE__ */f("div",{"data-gantt-tick":"minor",className:`absolute truncate border-l border-line-subtle text-2xs leading-6 text-ink-faint ${"day"===L?"text-center":"px-1"} ${e.startDay===ie&&"day"===L?"font-semibold text-danger":""}`,style:{left:e.x,width:e.width,top:H,height:H},children:ke(e,"minor")},`m${e.startDay}`)),Me&&Ce&&"day"!==L&&
|
|
9
|
+
/* @__PURE__ */b("div",{className:"pointer-events-none absolute flex items-center text-2xs "+(Te?"":"flex-row-reverse"),style:{left:Te?Ce.x:De-(Ce.width-$e),width:2*(Te?$e:Ce.width-$e),top:H,height:H},children:[Te&&/* @__PURE__ */f("span",{className:"invisible shrink-0 whitespace-nowrap px-1",children:ke(Ce,"minor")}),
|
|
10
10
|
/* @__PURE__ */f("span",{className:"min-w-0 flex-1"}),
|
|
11
|
-
/* @__PURE__ */f("span",{"data-gantt-today-label":"",className:"shrink-0 whitespace-nowrap rounded-(--radius-control) bg-danger px-1 font-medium leading-4 text-on-accent",children:
|
|
11
|
+
/* @__PURE__ */f("span",{"data-gantt-today-label":"",className:"shrink-0 whitespace-nowrap rounded-(--radius-control) bg-danger px-1 font-medium leading-4 text-on-accent",children:V.today}),
|
|
12
12
|
/* @__PURE__ */f("span",{className:"min-w-0 flex-1"}),Te&&/* @__PURE__ */f("span",{className:"invisible min-w-0 shrink overflow-hidden",children:/* @__PURE__ */f("span",{className:"inline-block whitespace-nowrap px-1",children:ke(Ce,"minor")})})]})]})]}),
|
|
13
|
-
/* @__PURE__ */b("div",{className:"pointer-events-none absolute",style:{left:
|
|
13
|
+
/* @__PURE__ */b("div",{className:"pointer-events-none absolute",style:{left:G,top:48,width:ce,height:Ne},"aria-hidden":!0,children:["day"===L&&de.minor.filter(e=>k(e.startDay)>=5).map(e=>/* @__PURE__ */f("div",{className:"absolute inset-y-0 bg-surface-sunken",style:{left:e.x,width:e.width}},`w${e.startDay}`)),de.minor.map(e=>/* @__PURE__ */f("div",{className:"absolute inset-y-0 w-px bg-line-subtle",style:{left:e.x}},`g${e.startDay}`))]}),
|
|
14
14
|
/* @__PURE__ */f("div",{role:"list",children:ue.map(e=>{if("group"===e.kind)/* @__PURE__ */
|
|
15
15
|
return b("div",{role:"listitem",className:"flex",style:{height:y},children:[
|
|
16
|
-
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-center border-r border-b border-line bg-surface-sunken px-3 text-sm font-semibold text-ink",style:{width:
|
|
17
|
-
/* @__PURE__ */f("div",{className:"shrink-0 border-b border-line-subtle",style:{width:ce}})]},`g:${e.group.id}`);const t=e.row,n=he.get(t.id).shape,r=function(e,t){return e.done?{className:"border text-ink-muted",style:{background:"var(--status-neutral-soft)",borderColor:"var(--status-neutral-line)"}}:e.tone?{className:"text-on-accent",style:{background:`var(--status-${e.tone}-solid)`}}:{className:t?"bg-identity-3":"bg-accent-fill text-on-accent"}}(t,"milestone"===n.kind),a=te?.id===t.id,o=t.done?`, ${
|
|
16
|
+
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-center border-r border-b border-line bg-surface-sunken px-3 text-sm font-semibold text-ink",style:{width:G},children:/* @__PURE__ */f("span",{className:"truncate",children:e.group.label})}),
|
|
17
|
+
/* @__PURE__ */f("div",{className:"shrink-0 border-b border-line-subtle",style:{width:ce}})]},`g:${e.group.id}`);const t=e.row,n=he.get(t.id).shape,r=function(e,t){return e.done?{className:"border text-ink-muted",style:{background:"var(--status-neutral-soft)",borderColor:"var(--status-neutral-line)"}}:e.tone?{className:"text-on-accent",style:{background:`var(--status-${e.tone}-solid)`}}:{className:t?"bg-identity-3":"bg-accent-fill text-on-accent"}}(t,"milestone"===n.kind),a=te?.id===t.id,o=t.done?`, ${V.done}`:"";/* @__PURE__ */
|
|
18
18
|
return b("div",{role:"listitem",className:"flex",style:{height:y},"data-gantt-row":t.id,children:[
|
|
19
|
-
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 border-r border-b border-line-subtle bg-surface",style:{width:
|
|
19
|
+
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 border-r border-b border-line-subtle bg-surface",style:{width:G},children:/* @__PURE__ */f("button",{type:"button",tabIndex:"none"===n.kind&&K?0:-1,onClick:()=>K?.(t),className:`flex w-full min-w-0 items-center px-3 text-left text-sm hover:bg-row-hover ${t.done?"text-ink-faint line-through":"text-ink"} ${K?"cursor-pointer":"cursor-default"}`,children:/* @__PURE__ */f("span",{className:"truncate",children:t.label})})}),
|
|
20
20
|
/* @__PURE__ */b("div",{className:"relative shrink-0 border-b border-line-subtle",style:{width:ce},children:["bar"===n.kind&&/* @__PURE__ */b(p,{children:[
|
|
21
|
-
/* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"aria-label":
|
|
21
|
+
/* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"aria-label":V.barName(t.label,ve(n.startDay),ve(n.endDay))+o,"aria-describedby":ee?oe:void 0,onKeyDown:e=>we(e,t),onClick:()=>xe(t),onPointerDown:e=>be(e,t,"move"),onPointerMove:ge,onPointerUp:()=>ye(t),onPointerCancel:()=>ne(null),className:`group/bar absolute rounded-(--radius-control) shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${ee?a?"cursor-grabbing":"cursor-grab":K?"cursor-pointer":""} ${a?"opacity-80":""}`,style:{...r.style,left:n.x,width:n.width,top:10,height:24,touchAction:ee?"none":void 0},children:ee&&/* @__PURE__ */b(p,{children:[
|
|
22
22
|
/* @__PURE__ */f("span",{"aria-hidden":!0,"data-gantt-handle":"start",className:"absolute inset-y-0 left-0 w-2 cursor-ew-resize rounded-l-(--radius-control) group-hover/bar:bg-scrim-soft",onPointerDown:e=>be(e,t,"start")}),
|
|
23
23
|
/* @__PURE__ */f("span",{"aria-hidden":!0,"data-gantt-handle":"end",className:"absolute inset-y-0 right-0 w-2 cursor-ew-resize rounded-r-(--radius-control) group-hover/bar:bg-scrim-soft",onPointerDown:e=>be(e,t,"end")})]})}),
|
|
24
24
|
/* @__PURE__ */f("span",{"aria-hidden":!0,className:"pointer-events-none absolute whitespace-nowrap text-xs leading-none text-ink-muted",style:{left:n.x+n.width+16,top:16},children:t.label})]}),"milestone"===n.kind&&/* @__PURE__ */b(p,{children:[
|
|
25
|
-
/* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"data-gantt-milestone":"","aria-label":
|
|
25
|
+
/* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"data-gantt-milestone":"","aria-label":V.milestoneName(t.label,ve(n.day))+o,"aria-describedby":ee?oe:void 0,onKeyDown:e=>we(e,t),onClick:()=>xe(t),onPointerDown:e=>be(e,t,"move"),onPointerMove:ge,onPointerUp:()=>ye(t),onPointerCancel:()=>ne(null),className:`absolute rotate-45 rounded-sm shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${ee?a?"cursor-grabbing":"cursor-grab":K?"cursor-pointer":""}`,style:{...r.style,left:n.cx-9/Math.SQRT2,top:22-9/Math.SQRT2,width:18/Math.SQRT2,height:18/Math.SQRT2,touchAction:ee?"none":void 0}}),
|
|
26
26
|
/* @__PURE__ */f("span",{"aria-hidden":!0,className:"pointer-events-none absolute whitespace-nowrap text-xs leading-none text-ink-muted",style:{left:n.cx+9+16,top:16},children:t.label})]})]})]},t.id)})}),
|
|
27
|
-
/* @__PURE__ */f("svg",{className:"pointer-events-none absolute overflow-visible text-ink-faint",style:{left:
|
|
27
|
+
/* @__PURE__ */f("svg",{className:"pointer-events-none absolute overflow-visible text-ink-faint",style:{left:G,top:48,width:ce,height:Ne},width:ce,height:Ne,"aria-hidden":!0,children:me.map(e=>/* @__PURE__ */b("g",{"data-gantt-arrow":e.key,children:[
|
|
28
28
|
/* @__PURE__ */f("path",{d:e.d,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round"}),
|
|
29
|
-
/* @__PURE__ */f("polygon",{points:e.head,fill:"currentColor"})]},e.key))}),Me&&/* @__PURE__ */f("div",{"data-gantt-today":"",className:"pointer-events-none absolute z-0 w-0.5 -translate-x-1/2 bg-danger",style:{left:
|
|
29
|
+
/* @__PURE__ */f("polygon",{points:e.head,fill:"currentColor"})]},e.key))}),Me&&/* @__PURE__ */f("div",{"data-gantt-today":"",className:"pointer-events-none absolute z-0 w-0.5 -translate-x-1/2 bg-danger",style:{left:G+De,top:48,height:Ne},"aria-hidden":!0}),ee&&/* @__PURE__ */f("span",{id:oe,hidden:!0,children:V.moveHint})]})})]})}export{L as Gantt};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-K5YT5PMJ.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-ISVODSRP.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-VY3UA6AR.js";import{useBrowserLayoutEffect as g}from"./chunk-ZDXRSY2Y.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{solidSurfaceStyle as x}from"./chunk-5FYDNH4Y.js";import{useShellStrings as k}from"./chunk-
|
|
2
|
-
/* @__PURE__ */
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
return
|
|
5
|
-
return
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */I
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
return
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
1
|
+
import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-K5YT5PMJ.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-ISVODSRP.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-VY3UA6AR.js";import{useBrowserLayoutEffect as g}from"./chunk-ZDXRSY2Y.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{solidSurfaceStyle as x}from"./chunk-5FYDNH4Y.js";import{useShellStrings as k}from"./chunk-NRHG4R2Q.js";import{forwardRef as N,useId as w,useState as $,useRef as D,useMemo as j,useCallback as S,useEffect as H}from"react";import{createPortal as T}from"react-dom";import{jsxs as C,jsx as E,Fragment as I}from"react/jsx-runtime";var O=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,R=N(function({value:e,onChange:t,options:r,placeholder:i,invalid:n,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},x){const N=t,$=k(),D=d(),j=f??D,S=w(),H=/* @__PURE__ */C("select",{ref:x,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":n||void 0,"aria-describedby":[g,j?S:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:n,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==i&&!b&&/* @__PURE__ */E("option",{value:"",disabled:!0,children:i}),
|
|
2
|
+
/* @__PURE__ */E(z,{items:r})]});return j?/* @__PURE__ */C(I,{children:[H,
|
|
3
|
+
/* @__PURE__ */E("span",{id:S,hidden:!0,children:$.settingView.auto})]}):H});function z({items:e}){const t=e=>/* @__PURE__ */E("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
4
|
+
return E(I,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */E("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var A=N(function({value:l,onChange:u,options:N,placeholder:R,invalid:A,className:Y="",id:V,disabled:K,size:P,touchSize:U,title:B,multiple:M,renderOption:W,renderValue:F,valueText:G,readOnly:L=!1,footer:X,changed:q=!1,auto:J,"aria-describedby":Q,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ie]=$(!1),[ne,ae]=$(-1),le=D(null),oe=D(null),de=D(null),se=D(null),ce=D([]),ue=()=>se.current??de.current,pe=!!X?.length,me="sm"===P,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=$(null),ge=k(),ye=D(re);ye.current=re;const xe=D({buffer:"",timer:null}),ke=w(),Ne=`${ke}-listbox`,we=V??`${ke}-trigger`,$e=e=>`${ke}-opt-${e}`,De=`${ke}-changed`,je=d(),Se=J??je,He=`${ke}-auto`,Te=[Q,q?De:void 0,Se?He:void 0].filter(Boolean).join(" ")||void 0,Ce=j(()=>n(N),[N]),Ee=M?l:[],Ie=u,Oe=f(oe,re,{matchTriggerWidth:!0,...X?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),Re=`${re}|${Oe?.top}|${Oe?.bottom}|${Oe?.maxHeight}|${N.length}`;g(()=>{be(null)},[Re]),g(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const i=e.getBoundingClientRect().top;let n=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-i+e.scrollTop;if(!(r<=e.clientHeight+.5))break;n=r}n>r&&be(Math.floor(n))},[re,fe,Re]);const ze=M?Ce.findIndex(e=>Ee.includes(e.value)):Ce.findIndex(e=>e.value===l),Ae=M?Ce.filter(e=>Ee.includes(e.value)).map(e=>e.label).join(", ")||void 0:ze>=0?Ce[ze].label:void 0,Ye=!M&&ze>=0?Ce[ze].lang:void 0,Ve=M?Ce.filter(e=>Ee.includes(e.value)):ze>=0?[Ce[ze]]:[],Ke=F&&Ve.length?F(Ve):void 0,Pe=void 0!==Ke&&G?G(Ve):void 0,Ue=S((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),Be=S(()=>{K||L||(ae(ze>=0?ze:e(Ce)),ie(!0))},[K,L,Ce,ze]),Me=S(e=>{const t=Ce[e];if(t&&!t.disabled){if(M){const r=l;return Ie(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Ie(t.value),Ue()}},[Ce,M,l,Ie,Ue]);H(()=>{if(!re)return;return y(e=>!("Escape"!==e.key||!ye.current)&&(Ue(),!0),ue)},[re,Ue]),H(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Ue(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Ue(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Ue]),H(()=>{!re||ne<0||de.current?.querySelector(`#${CSS.escape($e(ne))}`)?.scrollIntoView({block:"nearest"})},[re,ne]);const We=S(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const i=re?ne:ze,n=t(Ce,r.buffer,i);n<0||(re?ae(n):M?(ae(n),ie(!0)):Me(n))},[re,ne,ze,Ce,Me,M]),Fe=re?a(N,(e,t)=>{const r=(i=e.value,M?Ee.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
|
|
5
|
+
return C("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||W?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>Me(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${M?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":n?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[M&&/* @__PURE__ */E(o,{selected:r}),W?/* @__PURE__ */E("span",{className:"block min-w-0 flex-1 truncate",children:W(e,{selected:r,active:n})}):M?/* @__PURE__ */C("span",{className:"block min-w-0 flex-1",children:[
|
|
6
|
+
/* @__PURE__ */E("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */E("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
|
|
7
|
+
/* @__PURE__ */C(I,{children:[
|
|
8
|
+
/* @__PURE__ */E("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */E("span",{className:he,children:e.description})]}):e.label]},e.value)},ke,"mx-1"):null,Ge=void 0!==Ke?
|
|
9
|
+
/* @__PURE__ */C("span",{className:"relative block min-w-0 truncate",children:[
|
|
10
|
+
/* @__PURE__ */E("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Ke}),
|
|
11
|
+
/* @__PURE__ */E("span",{lang:void 0===Pe?Ye:void 0,className:"sr-only",children:Pe??Ae})]}):/* @__PURE__ */E("span",{lang:Ye,className:`block truncate ${void 0===Ae?c:""}`,children:Ae??R??" "}),Le={zIndex:h.popup,left:Oe?.left,top:Oe?.top,bottom:Oe?.bottom,width:Oe?.width,maxHeight:Oe?.maxHeight??b,visibility:Oe?void 0:"hidden",...x()},Xe=/* @__PURE__ */E("div",{ref:de,id:Ne,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":M||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Le,maxHeight:fe}:Le,children:Fe}),qe=pe?/* @__PURE__ */C("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Le,children:[Xe,
|
|
12
|
+
/* @__PURE__ */E("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:X.map((e,t)=>/* @__PURE__ */C("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Ue(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(X?.length??0)-1,i=t=>{e.preventDefault(),ce.current[t]?.focus()},n=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void i(Math.min(t+1,r));case"ArrowUp":return void(0===t?n():i(t-1));case"Home":return void i(0);case"End":return void i(r);case"Tab":return e.shiftKey?void(0===t?n():i(t-1)):t<r?void i(t+1):(e.preventDefault(),void Ue());case"Escape":return e.preventDefault(),e.stopPropagation(),void Ue()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-ink-faintest":"cursor-pointer text-ink hover:bg-accent-tint hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */E(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
13
|
+
/* @__PURE__ */E("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Xe;/* @__PURE__ */
|
|
14
|
+
return C("div",{ref:le,className:"relative",children:[
|
|
15
|
+
/* @__PURE__ */E("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?Ne:void 0,"aria-activedescendant":re&&ne>=0?$e(ne):void 0,"aria-invalid":A||void 0,"aria-describedby":Te,"aria-label":Z,"aria-labelledby":_,title:B,disabled:K,"aria-readonly":L||void 0,onClick:()=>re?Ue():Be(),onKeyDown:t=>{if(!K&&!L)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>i(Ce,e,1)):Be());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>i(Ce,e,-1)):Be());case"Home":return void(re&&(t.preventDefault(),ae(e(Ce))));case"End":return void(re&&(t.preventDefault(),ae(r(Ce))));case"Enter":return void(re&&(t.preventDefault(),Me(ne)));case" ":return t.preventDefault(),void(re?Me(ne):Be());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Ue()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Ue(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),We(t.key))}},className:s({invalid:A,size:P,readOnly:L,auto:Se,className:`${L?"":"pr-8 "}text-left ${Y}`.trim()}),children:q?
|
|
16
|
+
/* @__PURE__ */C("span",{className:"flex min-w-0 items-center gap-1",children:[Ge,
|
|
17
|
+
/* @__PURE__ */E("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Ge}),q&&/* @__PURE__ */E("span",{id:De,hidden:!0,children:ge.select.changed}),Se&&/* @__PURE__ */E("span",{id:He,hidden:!0,children:ge.settingView.auto}),!L&&/* @__PURE__ */E(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
|
|
18
|
+
/* @__PURE__ */C("select",{ref:te,value:l,multiple:M||void 0,onChange:e=>Ie(M?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:K,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==R&&!M&&/* @__PURE__ */E("option",{value:"",disabled:!0,children:R}),
|
|
19
|
+
/* @__PURE__ */E(z,{items:N})]}),re&&T(qe,document.body)]})}),Y=N(function({touchSize:e,...t},r){const i=u(),n=e??"touch";return!i||void 0===t.footer&&void 0===t.changed||t.readOnly?i&&!t.readOnly?/* @__PURE__ */E(R,{ref:r,...t,size:n}):/* @__PURE__ */E(A,{ref:r,...t}):/* @__PURE__ */E(A,{ref:r,...t,size:n})});export{R as NativeSelect,Y as Select_default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-W24THMLI.js";import{Avatar as t}from"./chunk-SCNQK5NF.js";import{ItemCount as r}from"./chunk-LC2UF3AA.js";import{Button_default as a}from"./chunk-UTISUEO4.js";import{useState as i}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],d=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function c(){const[c,o]=i(1),m=d.find(e=>e.id===c)??d[0];/* @__PURE__ */
|
|
2
2
|
return l("div",{className:"h-full",children:/* @__PURE__ */l(e,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */n("div",{className:"flex h-full flex-col p-2",children:[
|
|
3
3
|
/* @__PURE__ */l(a,{block:!0,className:"mb-2",children:"Compose"}),s.map((e,t)=>/* @__PURE__ */n("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
4
4
|
/* @__PURE__ */l("span",{children:e.label}),null!=e.count&&/* @__PURE__ */l(r,{count:e.count,active:0===t})]},e.id))]}),children:/* @__PURE__ */n("div",{className:"flex h-full",children:[
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import{computeMaximizedBox as e,isSidebarStripReserved as t,boxFillsWorkArea as n,readAlwaysMaximizedFlag as r,WORK_AREA_CHANGED_EVENT as o,scrollerIsFluid as i,growBoxToWidth as a,widthToFit as s,navIcons as l}from"./chunk-4LXCCZDM.js";import{reportBoundaryError as c}from"./chunk-KNUR2UEG.js";import{isStaleChunkError as u}from"./chunk-JDCM2VHG.js";import{WindowInsetContext as d,NO_WINDOW_DRAG as m}from"./chunk-YI4T5I5D.js";import{Result as h}from"./chunk-PSVGB7KT.js";import{CMD_Z as f,CMD_SHIFT_Z as p}from"./chunk-FBZUEZK7.js";import{CopyButton as w}from"./chunk-TJ5YMXVB.js";import{confirm as y}from"./chunk-XYQFTFI7.js";import{useModalDragAside as g}from"./chunk-EIFNESXS.js";import{ItemCount as v}from"./chunk-LC2UF3AA.js";import{isInOverlayOver as b}from"./chunk-CJQPC2P3.js";import{dialogA11y as x}from"./chunk-VWGWZY7A.js";import{ColoredBadge as k}from"./chunk-UVPDEGIA.js";import{ROW_HEIGHTS as E}from"./chunk-AW7TOB6N.js";import{LoadingSpinner as C}from"./chunk-4PJFL26P.js";import{activationOrder as M,activeListeners as S,ModalActionsContext as N,subscribeActive as L,getActiveModalId as T,KEY_ACTIVATED_SELECTOR as z}from"./chunk-F3ZOO23R.js";import{useShellAuth as A}from"./chunk-2QY5BJLA.js";import{useIsMobile as D,useIsPhone as I}from"./chunk-UGTRSRIW.js";import{useShellPrefs as P}from"./chunk-DPFEQQQU.js";import{DropdownMenu as R}from"./chunk-EX3DARI3.js";import{focusableIn as $}from"./chunk-DWGYC7OD.js";import{StatusBadge as W}from"./chunk-YDJ5IZOU.js";import{PopupMenu as K,PopupMenuItem as O,PopupMenuDivider as j,PopupMenuLabel as F}from"./chunk-THAPVKEJ.js";import{Button_default as B}from"./chunk-UTISUEO4.js";import{Icon as q}from"./chunk-ISVODSRP.js";import{LoadingSpinner as H}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as U}from"./chunk-62LW225J.js";import{shellHttp as Y,isShellHttpConfigured as X}from"./chunk-STKJA4PV.js";import{fitBoxScale as V,fitFrameStyle as J}from"./chunk-M6UKCZHT.js";import{buttonClasses as G}from"./chunk-UQYNPYF4.js";import{runEscapeInterceptors as _}from"./chunk-TWVUQUUD.js";import{useShellStrings as Q}from"./chunk-NRHG4R2Q.js";import{createContext as Z,createElement as ee,useContext as te,Component as ne,useLayoutEffect as re,useRef as oe,useEffect as ie,useState as ae,useSyncExternalStore as se,useCallback as le,isValidElement as ce,Fragment as ue,Children as de,cloneElement as me,useMemo as he,useId as fe,useReducer as pe,Suspense as we}from"react";import{jsxs as ye,jsx as ge,Fragment as ve}from"react/jsx-runtime";import{createPortal as be}from"react-dom";import{useLocation as xe}from"react-router-dom";import{useQueryClient as ke,useQuery as Ee}from"@tanstack/react-query";function Ce(e){return"component"in e}function Me(e){return"endpoint"in e}var Se={};function Ne(e){Se=e}var Le=new Proxy({},{get:(e,t)=>Se[t],has:(e,t)=>t in Se,ownKeys:()=>Object.keys(Se),getOwnPropertyDescriptor(e,t){if(t in Se)return{configurable:!0,enumerable:!0,value:Se[t]}}});function Te(){return X()}var ze=Y,Ae=Z({});function De({value:e,children:t}){return ee(Ae.Provider,{value:e},t)}function Ie(){return te(Ae)}var Pe=Z(null);function Re(){return te(Pe)?.pageSearch??""}var $e=null,We=/* @__PURE__ */new Set;function Ke(e){$e!==e&&($e=e,We.forEach(e=>e()))}function Oe(){return $e}function je(e){return We.add(e),()=>{We.delete(e)}}var Fe=null;function Be(e){Fe=e}function qe({error:e,onReload:t}){const n=u(e);/* @__PURE__ */
|
|
2
|
+
return ye("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
|
|
3
|
+
/* @__PURE__ */ge(q,{name:"warning",className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
|
|
4
|
+
/* @__PURE__ */ye("div",{className:"min-w-0",children:[
|
|
5
|
+
/* @__PURE__ */ge("p",{className:"text-sm font-medium text-gray-700",children:n?"This window needs the latest version of the app":"This window crashed"}),
|
|
6
|
+
/* @__PURE__ */ge("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__ */ge("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 He=class extends ne{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){console.error("[efficient-shell] window content crashed:",e,t.componentStack),c(e)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */ge(qe,{error:e,onReload:this.reset}):this.props.children}},Ue=Z(null),Ye="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function Xe({className:e="",auto:t=!1}){const n=te(Ue),r=Q().undo,o=n?.claimOwnMount;if(re(()=>{if(!t&&o)return o(!0),()=>o(!1)},[t,o]),!n||!n.enabled)return null;const{undo:i,redo:a,canUndo:s,canRedo:l,undoLabel:c,redoLabel:u}=n;/* @__PURE__ */
|
|
8
|
+
return ye("div",{className:`flex items-center gap-2 ${e}`,"data-undo-controls":t?"shell":"form",children:[
|
|
9
|
+
/* @__PURE__ */ge("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",f):r.nothingToUndo,className:Ye,children:r.undo}),
|
|
10
|
+
/* @__PURE__ */ge("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",p):r.nothingToRedo,className:Ye,children:r.redo})]})}var Ve=/* @__PURE__ */new Set([408,429]);function Je(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function Ge(e){const t=Je(e);return null!=t&&(t>=400&&t<500&&!Ve.has(t))}function _e(e,t){return!Ge(t)&&e<3}function Qe(e){if("page"!==e.type)return!0;const t=e.route?Le[e.route]:void 0;if(!t||!Ce(t))return!0;const n=t;return!n.widget&&!n.utility}function Ze(e){const t=e.route?Le[e.route]:void 0;if(!t||!Ce(t))return;const n=t;return n.taskbarGroup?n.taskbarGroup:{key:e.route,label:n.label,icon:e.route}}var et=(e,t)=>!!t&&"page"===e.type&&e.route===t;var tt="flex-1 min-h-0";function nt(){const e=Q().record;/* @__PURE__ */
|
|
11
|
+
return ge(H,{label:e.loading,padding:"",className:tt})}function rt(e){return e??void 0}function ot({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:o}){const i=Q().record;if(t||e&&n)/* @__PURE__ */return ge(nt,{});if(r){const e=Je(r);if(401===e)/* @__PURE__ */
|
|
12
|
+
return ge(h,{status:"warning",title:i.signInRequired,subTitle:i.signInBody,className:tt});if(403===e)/* @__PURE__ */
|
|
13
|
+
return ge(h,{status:"403",className:tt});if(404===e||410===e)/* @__PURE__ */
|
|
14
|
+
return ge(h,{status:"404",title:i.notFound,className:tt});const t=null==e||408===e||429===e||e>=500;/* @__PURE__ */
|
|
15
|
+
return ge(h,{status:"500",title:i.loadFailed,subTitle:t?i.checkConnection:i.rejected,extra:t?/* @__PURE__ */ge(B,{variant:"secondary",size:"sm",onClick:o,children:i.retry}):void 0,className:tt})}/* @__PURE__ */
|
|
16
|
+
return ge(h,{status:"404",title:i.notFound,className:tt})}function it({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */ge(ve,{children:t(e)}):/* @__PURE__ */ge(ot,{...n})}var at=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function st(e){return"string"==typeof e&&(e.startsWith("new-")||at.test(e))}function lt(e){if(st(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var ct=Z({openWindows:[],openEntity:()=>{},openPage:()=>{},reorderWindows:()=>{},closeEntity:()=>{},minimize:()=>{},items:[],restore:()=>{},remove:()=>{},restoreIfMinimized:()=>!1,openItems:[]}),ut=Z(null);function dt(e){const t=te(ut),n=oe(null);null===n.current&&(n.current=/* @__PURE__ */Symbol("window-dirty")),re(()=>{if(t)return t(n.current,e)},[t,e]),ie(()=>{if(!t||!e)return;const n=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t,e])}function mt(){const e=oe(/* @__PURE__ */new Map),[t,n]=ae(!1);return{dirty:t,registerDirty:le((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 ht(){return te(ct)}function ft(e){if("page"!==e.type&<(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 pt({item:e,onClose:t,accentRgb:n}){const{dirty:r,registerDirty:o}=mt(),i=Le[e.route];if(!i||!Ce(i))return null;const a=i,s=a.component;/* @__PURE__ */
|
|
17
|
+
return ge(co,{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__ */ge(ut.Provider,{value:o,children:/* @__PURE__ */ge(we,{fallback:/* @__PURE__ */ge("div",{className:"flex items-center justify-center py-12",children:/* @__PURE__ */ge(C,{})}),children:/* @__PURE__ */ge(s,{})})})})}function wt({entityType:e,entityId:t,label:n}){const r=Q(),o=ke(),{data:i}=Ee({queryKey:["my-profile-sidebar"],enabled:Te(),queryFn:()=>ze.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 ge("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];ze.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__ */ge(q,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var yt=/* @__PURE__ */new Set,gt=()=>"hidden";function vt({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=Le[e.entityType];if(!o||!Me(o))return null;const i=o,[a,s]=ae(!1),{dirty:c,registerDirty:u}=mt(),d=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,m=e.entitySnapshot?._duplicate,h=st(e.entityId),f=Ie(),p=(w=e.id,se(L,()=>{const e=_n.get(w);return null!=e&&Un.has(e)}));var w;const y=!i.selfFetching&&!m&&!h&&Te(),g=Ee({queryKey:[d,e.entityId],queryFn:()=>{return ze.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:rt(e.entitySnapshot),initialDataUpdatedAt:0,enabled:y,staleTime:0,refetchOnWindowFocus:()=>{return void 0===(e=f.entityRefetchOnWindowFocus)||("function"==typeof e?e():e);var e},refetchOnMount:"always",refetchInterval:e=>function(e,t={}){if(Ge(e))return!1;if(t.minimized)return!1;const n=t.hostInterval;if(void 0===n)return 6e4;const r="function"==typeof n?n():n;return"number"==typeof r&&r>0&&r}(e.state.error,{minimized:p,hostInterval:f.entityRefetchInterval}),refetchIntervalInBackground:!1,retry:_e}),v=g.data,b=g.refetch;ie(()=>{var t;if(y)return t=t=>{t!==e.id||yt.has(t)||b({cancelRefetch:!1})},mr.add(t),()=>{mr.delete(t)}},[b,e.id,y]);const x=le(()=>{a&&!c?s(!1):t()},[a,c,t]),k=(i.useEdit??gt)(v??null),E=!i.useEdit||h||m?void 0:{state:k,editing:a,onEdit:()=>s(!0),onDiscard:()=>s(!1)},M=i.selfFetching?e.label:v?i.title(v,a,s):e.label,S=i.icon,N=S?l[S]:null,T=M,z=!i.selfFetching&&v&&i.footer&&!m?i.footer(v):void 0;return i.rendersOwnModal?i.selfFetching?/* @__PURE__ */ge(we,{fallback:/* @__PURE__ */ge(C,{}),children:i.render(v??e.entitySnapshot,t,e.entityId,a,s)}):null!=v?/* @__PURE__ */ge(we,{fallback:/* @__PURE__ */ge(co,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */ge(nt,{})}),children:i.render(v,t,e.entityId,a,s)}):/* @__PURE__ */ge(co,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */ge(ot,{isPending:g.isPending,isFetching:g.isFetching,enabled:y,error:g.error,onRetry:b})}):/* @__PURE__ */ge(co,{open:!0,onClose:x,onMinimize:n,initialBox:e.savedBox,icon:N,title:T,footer:z,copyText:e.label,windowKey:e.id,openedFromKey:e.openedFrom,size:i.size||"2xl",dirty:c,editing:a||h||m,edit:E,dimensions:i.dimensions,autoHeight:i.autoHeight,autoMinHeight:i.autoMinHeight,autoWidth:i.autoWidth,appStyle:i.appStyle,flushBody:i.flushBody,accentRgb:r,children:/* @__PURE__ */ge(ut.Provider,{value:u,children:/* @__PURE__ */ge(we,{fallback:/* @__PURE__ */ge(nt,{}),children:i.selfFetching?i.render(null,t,e.entityId,a,s):/* @__PURE__ */ge(it,{entity:v,isPending:g.isPending,isFetching:g.isFetching,enabled:y,error:g.error,onRetry:b,children:n=>i.render(n,t,e.entityId,a,s)})})})})}function bt(e){return document.querySelector(`[data-modal-panel][data-window-key="${e}"]`)}function xt(e){return document.querySelector(`[data-modal-panel][data-window-root][data-window-owner="${e}"]`)}function kt(e){const t=bt(e),n=t??xt(e);if(!n)return;if(t&&!Nr(t))return r=e,void window.dispatchEvent(new CustomEvent("modal-reveal",{detail:{windowKey:r}}));var r;const o=n.getAttribute("data-modal-id");o&&hr(o)}function Et(){const e=T();if(!e)return;const t=document.querySelector(`[data-modal-panel][data-modal-id="${e}"]`);return t?.getAttribute("data-window-key")??void 0}var Ct=/* @__PURE__ */new Map;function Mt(){const e=Et();if(e)return Ct.get(e)}function St(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 Nt="rosh-peek-style",Lt=U.peek,Tt=U.taskbarPreview;function zt(e){"undefined"!=typeof document&&(!function(){if("undefined"==typeof document||document.getElementById(Nt))return;const e=document.createElement("style");e.id=Nt,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:${Lt}!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 At(){"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 Dt({id:e,label:t,maxW:n,maxH:r,titleAbove:o=!1,onClick:i,onClose:a}){const s=Q(),l=oe(null),[c,u]=ae({w:n,h:Math.round(.75*r)}),[d,m]=ae(!1);return re(()=>{const o=l.current;if(!o)return;const i=bt(e)??St(t);if(!i)return void m(!1);const a=i.getBoundingClientRect();if(0===a.width||0===a.height)return void m(!1);const s=V({width:n,height:r},a),c=Math.max(80,Math.round(a.width*s)),d=Math.max(60,Math.round(a.height*s));u({w:c,h:d}),m(!0);const h=i.cloneNode(!0);h.style.position="absolute",h.style.top="0",h.style.left="0",h.style.right="auto",h.style.bottom="auto",h.style.width=a.width+"px",h.style.height=a.height+"px";const f=J(a.width,s);return Object.assign(h.style,{transform:f.transform??"",transformOrigin:f.transformOrigin}),h.style.pointerEvents="none",h.style.animation="none",h.style.zIndex="auto",h.removeAttribute("data-modal-panel"),h.removeAttribute("data-modal-id"),h.removeAttribute("data-window-key"),h.removeAttribute("role"),h.removeAttribute("aria-labelledby"),h.removeAttribute("aria-label"),h.querySelectorAll('[role="dialog"], [data-portal]').forEach(e=>{e.style.display="none"}),o.innerHTML="",o.appendChild(h),()=>{o.innerHTML=""}},[e,t,n,r]),/* @__PURE__ */ye("div",{style:{width:c.w,height:c.h},className:"relative rounded-md overflow-hidden bg-white/95 border border-line-strong shadow-(--elevation-panel) cursor-pointer ring-2 ring-transparent group-hover:ring-blue-400 transition shrink-0",onClick:i,children:[
|
|
19
|
+
/* @__PURE__ */ge("div",{ref:l,className:"absolute inset-0 z-0 overflow-hidden"}),!d&&/* @__PURE__ */ye("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-gray-400 bg-gray-50",children:[
|
|
20
|
+
/* @__PURE__ */ge(q,{name:"window",className:"h-6 w-6",strokeWidth:1.5}),
|
|
21
|
+
/* @__PURE__ */ge("span",{className:"mt-1 text-3xs uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */ge("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__ */ge("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__ */ge(q,{name:"close",className:"h-3 w-3",strokeWidth:3})})]})}function It({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=Q(),s=e.length>1,l=oe(null),[c,u]=ae({left:-9999,top:-9999,ready:!1}),[d,m]=ae(()=>"undefined"!=typeof document&&getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom");re(()=>{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";m(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]),ie(()=>At,[]);const h="top"===d,f=(h?"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 be(
|
|
22
|
+
/* @__PURE__ */ge("div",{ref:l,"data-taskbar-preview":"",style:{position:"fixed",left:c.left,top:c.top,zIndex:Tt,maxWidth:"calc(100vw - 16px)",opacity:c.ready?1:0},className:s?"flex gap-2 flex-wrap":"",onMouseEnter:o,onMouseLeave:()=>{At(),i()},children:e.map(e=>{const t=bt(e.id)??St(e.label),o=t?function(e){if(Nr(e))return null;const t=e.getBoundingClientRect(),n=gr(),r=t.left+t.width/2-(n.x+n.w/2),o=t.top+t.height/2-(n.y+n.h/2);return 180*Math.atan2(o,r)/Math.PI}(t):null;/* @__PURE__ */
|
|
23
|
+
return ye("div",{className:"group flex flex-col items-center",onMouseEnter:()=>zt(t),children:[!h&&/* @__PURE__ */ge("span",{className:f,children:e.label}),
|
|
24
|
+
/* @__PURE__ */ge(Dt,{id:e.id,label:e.label,maxW:240,maxH:160,titleAbove:!0,onClick:()=>n(e.id),onClose:()=>r(e.id)}),h&&/* @__PURE__ */ge("span",{className:f,children:e.label}),null!==o&&/* @__PURE__ */ye("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__ */ge(q,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function Pt(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 Rt({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=Q(),[a,s]=ae(null);ie(()=>{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=se(L,T),[,u]=ae(0);ie(()=>{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]=ae(0);ie(()=>{const e=()=>d(e=>e+1);return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[]);const m=e=>{const t=St(e),n=t?.querySelector("[data-window-title]");return n?.textContent?.trim()||e},[h,f]=ae(null),[p,w]=ae(null),[y,g]=ae(null),b=oe(null),x=()=>{b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{f(null),w(null)},150)},k=e.filter(e=>!e.route||!Le[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?Le[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 be(
|
|
26
|
+
/* @__PURE__ */ye(ve,{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=bt(e.id)??St(e.label);return!!t&&!Nr(t)});/* @__PURE__ */
|
|
27
|
+
return ye("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.currentTarget,void(y||(b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{f(n),w(r)},350)));var n,r},onMouseLeave:x,onDoubleClick:e=>{e.stopPropagation(),window.dispatchEvent(new CustomEvent("modal-center",{detail:{windowKey:r.id,label:r.label}}))},onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),b.current&&(clearTimeout(b.current),b.current=null),f(null),w(null),s?g({x:t.clientX,y:t.clientY,items:e.items,label:e.label}):window.dispatchEvent(new CustomEvent("modal-context-menu",{detail:{windowKey:r.id,label:r.label,x:t.clientX,y:t.clientY}}))},style:{width:"var(--window-tab-width, 200px)",fontSize:"var(--window-tab-font-size, 12px)"},"data-tab-group":e.key,className:"group relative flex items-center gap-2 rounded-lg px-3 py-2 font-medium transition-all min-w-0 shrink "+(a?"bg-blue-100/60 border border-blue-400/60 text-blue-700":"bg-gray-50/40 border border-gray-200/40 text-gray-700 hover:bg-gray-200/40"),children:[n&&ce(n)?me(n,{className:"h-3.5 w-3.5 shrink-0"}):/* @__PURE__ */ge(q,{name:"expand",className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),
|
|
28
|
+
/* @__PURE__ */ge("span",{className:"truncate flex-1",children:s?e.label:m(r.label)}),u&&/* @__PURE__ */ge("span",{title:i.taskbar.offscreenDot,className:"shrink-0 h-1.5 w-1.5 rounded-full bg-amber-500"}),s&&/* @__PURE__ */ge(v,{count:e.items.length,label:i.count.windows(e.items.length)}),!s&&/* @__PURE__ */ge("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__ */ge(q,{name:"close",className:"h-3 w-3",strokeWidth:2})})]},e.key)}),
|
|
29
|
+
/* @__PURE__ */ge("div",{className:"flex-1"}),k.length>=2&&/* @__PURE__ */ye("button",{onClick:n,title:i.taskbar.expose,className:"flex items-center gap-1 rounded px-2 py-1 text-2xs font-medium text-blue-600 border border-blue-300 hover:bg-accent-tint transition-colors shrink-0",children:[
|
|
30
|
+
/* @__PURE__ */ge(q,{name:"grid",className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),y&&/* @__PURE__ */ye(K,{portal:!0,minWidth:200,style:Pt(y.x,y.y),onClose:()=>g(null),children:[
|
|
31
|
+
/* @__PURE__ */ge(F,{children:y.label}),
|
|
32
|
+
/* @__PURE__ */ye(O,{onClick:()=>{g(null),y.items.forEach(e=>function(e){const t=_n.get(e);t&&fr(t)}(e.id))},children:[
|
|
33
|
+
/* @__PURE__ */ge(q,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),i.taskbar.minimizeAllWindows]}),
|
|
34
|
+
/* @__PURE__ */ye(O,{onClick:()=>{g(null),y.items.forEach(e=>o(e.id))},children:[
|
|
35
|
+
/* @__PURE__ */ge("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */ge("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__ */ge(j,{}),
|
|
37
|
+
/* @__PURE__ */ye(O,{danger:!0,onClick:()=>{g(null),y.items.forEach(e=>t(e.id))},children:[
|
|
38
|
+
/* @__PURE__ */ge(q,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${y.items.length})`]})]}),h&&p&&/* @__PURE__ */ge(It,{items:h,anchorEl:p,onActivate:e=>{o(e),f(null),w(null)},onClose:e=>{t(e),f(null),w(null)},onMouseEnter:()=>{b.current&&(clearTimeout(b.current),b.current=null)},onMouseLeave:x})]}),a)}var $t=["/login","/forgot-password","/reset-password","/force-change-password"];function Wt({children:e,windowAccentForRoute:t}){const n=xe(),r=$t.some(e=>n.pathname.startsWith(e)),[o,i]=ae([]),a=oe(o);re(()=>{a.current=o},[o]);const s=se(je,Oe,Oe),l=oe(/* @__PURE__ */new Map),c=e=>{const t=Qe(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};ie(()=>{Ct.clear();for(const e of o)e.route&&Ct.set(e.id,e.route)},[o]);const u=le(e=>{i(t=>t.filter(t=>t.id!==e))},[]),d=le(e=>{var t;bt(e)||xt(e)?(t=e,window.dispatchEvent(new CustomEvent(Fr,{detail:{windowKey:t}}))):u(e)},[u]),m=(e,t=!1)=>{const n=Yn;t&&yt.add(e),setTimeout(()=>{const r=bt(e)??xt(e),o=r?.getAttribute("data-modal-id");var i,a;!o||(i=o,a=n,(Xn.get(i)??-1)>a)||hr(o),t&&yt.delete(e)},50)},h=(e,t,n)=>{const r=Fe;if(n||!r)return[...e,t];const o=function(e,t,n){if(!Qe(t))return e.length;if(t.shellOwned&&et(t,n.home))return 0;const r=et(t,n.home)?void 0:Ze(t)?.key;if(r){let t=-1;if(e.forEach((e,o)=>{Qe(e)&&!et(e,n.home)&&Ze(e)?.key===r&&(t=o)}),t>=0)return t+1}if("page"===t.type&&t.route&&!et(t,n.home)&&n.favorites.includes(t.route))return e.length>0&&et(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=>Qe(e[t])&&!et(e[t],n.home)?Ze(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:Oe(),favorites:r.favorites});return[...e.slice(0,o),t,...e.slice(o)]},f=le(e=>{i(t=>function(e,t){const n=new Set(t),r=new Map(e.map(e=>[e.id,e])),o=t.map(e=>r.get(e)).filter(e=>!!e);if(o.length!==n.size)return e;let i=0;const a=e.map(e=>n.has(e.id)?o[i++]:e);return a.every((t,n)=>t===e[n])?e:a}(t,e))},[]),p=le((e,t,n,r,o,a={})=>{if(!Le[e]||!Me(Le[e]))return;const s=`${e}:${t}`,l=Et();i(i=>{const c=i.find(n=>n.entityType===e&&String(n.entityId)===String(t));return c?(m(c.id),i):(m(s,!0),h(i,{id:s,type:"modal",label:r||t,route:o||window.location.pathname,entityType:e,entityId:t,entitySnapshot:rt(n),openedFrom:l},!!a.append))})},[]),w=le((e,t={})=>{if(!Le[e]||!Ce(Le[e]))return;const n=Le[e],{reuse:r=!1,background:o=!1,shellOwned:s,search:l,append:c=!1}=t,u=e=>{var t;o?(t=e,nr.add(t)):m(e)};if(n.widget){const t=a.current.find(t=>"page"===t.type&&t.route===e);if(t)return void d(t.id)}const f=Et();i(t=>{if(n.multiInstance){const i=t.filter(t=>"page"===t.type&&t.route===e);if(s&&i.length>0)return t;if(r&&!l&&i.length>0)return o||m(i[i.length-1].id),t;const a=`page:${e}:${Math.random().toString(36).slice(2,8)}`;return u(a),h(t,{id:a,type:"page",label:n.label,route:e,openedFrom:f,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)}const i=t.find(t=>"page"===t.type&&t.route===e);if(i)return n.widget?t:(o||m(i.id),l&&i.pageSearch!==l?t.map(e=>e===i?{...e,pageSearch:l}:e):t);const a=`page:${e}`;return u(a),h(t,{id:a,type:"page",label:n.label,route:e,openedFrom:f,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)})},[d]),y=le(()=>{},[]),g=le(()=>{},[]),v=d,b=d;/* @__PURE__ */
|
|
39
|
+
return ye(ct.Provider,{value:{openWindows:o,openEntity:p,openPage:w,reorderWindows:f,closeEntity:v,minimize:y,items:[],openItems:o,restore:g,remove:b,restoreIfMinimized:()=>!1},children:[e,
|
|
40
|
+
/* @__PURE__ */ge(Rt,{openWindows:o,onRemove:d,onSplitView:so,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&&hr(e)}})},onActivateById:kt}),
|
|
41
|
+
/* @__PURE__ */ge(lo,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
|
|
42
|
+
/* @__PURE__ */
|
|
43
|
+
return ge(Pe.Provider,{value:c(e),children:/* @__PURE__ */ge(He,{fallback:(t,n)=>/* @__PURE__ */ge(co,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */ge(qe,{error:t,onReload:n})}),children:/* @__PURE__ */ge(fn,{spec:ft(e),children:/* @__PURE__ */ge(yo,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */ge(pt,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */ge(vt,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var Kt=400;function Ot({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=oe(null),s=oe(!1);n&&!s.current&&(a.current="undefined"==typeof document?null:document.activeElement),s.current=n;const l=oe(!1),c=oe(void 0),u=oe(i),d=u.current&&!i;u.current=i;const m=()=>{l.current=!0,clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},Kt)};ie(()=>{n&&!r&&m()},[n,r]),ie(()=>{d&&n&&!r&&m()},[d]),ie(()=>()=>clearTimeout(c.current),[]),ie(()=>{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?$(t.current)[0]:void 0;s?s.focus():(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus())},[n,r,o,i,e,t]),re(()=>{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 jt=null,Ft=/* @__PURE__ */new Set;function Bt(){return jt}function qt(e){if(jt!==e){jt=e;for(const e of Ft)e()}}function Ht(e){return Ft.add(e),()=>{Ft.delete(e)}}var Ut=!1,Yt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},Xt=()=>{};function Vt(e){Ut=e,Yt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function Jt(e,t){Ut&&("submenu"===e?Yt.submenus++:Yt.menus++,Yt.menuKey=t)}function Gt(e){if(!Ut)return Xt;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!Ut)return;const r=performance.now()-t;"move"===e?Yt.moveMs+=r:Yt.resizeMs+=r}}function _t(){const e=Yt;return Yt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var Qt=/* @__PURE__ */new Set([W,k]),Zt=e=>Qt.has(e)||"function"==typeof e&&"badge"===e.titleRole,en=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),tn=/* @__PURE__ */new Set(["svg"]);function nn(e){const t=[],n={text:"",accessories:[],badges:[],actions:[]};return rn(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function rn(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=>rn(e,t,n));if(!ce(e))return;const r=e;if(r.type===w)return void(void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text));if(r.type===ue)return void de.toArray(r.props.children).forEach(e=>rn(e,t,n));if("string"==typeof r.type){if(tn.has(r.type))return;if(!en.has(r.type))return n.push(" "),de.toArray(r.props.children).forEach(e=>rn(e,t,n)),void n.push(" ")}const o=me(r,{key:`title-part-${t.accessories.length}`});t.accessories.push(o),(Zt(r.type)?t.badges:t.actions).push(o)}var on=/* @__PURE__ */new Map,an=/* @__PURE__ */new Set,sn=0;function ln(){sn++,an.forEach(e=>e())}function cn(e){return on.get(e)}function un(e){return an.add(e),()=>{an.delete(e)}}function dn(){return sn}var mn=Z(""),hn=Z(null);function fn({spec:e,children:t}){/* @__PURE__ */
|
|
44
|
+
return ge(hn.Provider,{value:e,children:t})}var pn=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),wn='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600';function yn(e){return gn(e).replace(/\s+/g," ").trim()}function gn(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(gn).join("");if(ce(e)){const t=e,n="string"==typeof t.type?t.type:"";return pn.has(n)?"":` ${gn(t.props?.children)} `}return""}function vn(e){const t=te(mn);ie(()=>{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 bn={};function xn(e,t,n){const r=te(mn);ie(()=>{if(!r)return;bn[r]||(bn[r]=[]);const o={label:e,icon:n,onClick:t};return bn[r].push(o),()=>{bn[r]=(bn[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function kn({title:e}){const t=oe(null);return ie(()=>{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__ */ge("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function En(e){}function Cn(){return te(mn)}function Mn({className:e=""}){const t=te(N)?.setEditSlot,n=le(e=>{t?.(e)},[t]);return t?/* @__PURE__ */ge("span",{ref:n,"data-window-edit-slot":"",className:`inline-flex items-center empty:hidden ${e}`.trim()}):null}function Sn({items:e,label:t}){const n=Q().window.more;return 0===e.length?null:/* @__PURE__ */ge(R,{side:"top",items:e,triggerClassName:G({variant:"secondary",size:"sm"}),trigger:/* @__PURE__ */ye(ve,{children:[t??n,
|
|
45
|
+
/* @__PURE__ */ge(q,{name:"chevron-down",className:"size-3.5",strokeWidth:2,"aria-hidden":"true"})]})})}function Nn({children:e,position:t="right",quiet:n=!1}){const r=te(N),[o,i]=ae(null);return ie(()=>{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?be(e,o):null}function Ln({onClick:e,children:t,className:n}){const r=te(N);/* @__PURE__ */
|
|
46
|
+
return ge("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 Tn="erp_window_positions",zn={};try{const e=localStorage.getItem(Tn);e&&(zn=JSON.parse(e))}catch{}var An=null;function Dn(){An&&clearTimeout(An),An=setTimeout(()=>{try{localStorage.setItem(Tn,JSON.stringify(zn))}catch{}},500)}var In="erp_activation_order",Pn=[];try{const e=localStorage.getItem(In),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(Pn=t)}catch{}var Rn=null;function $n(){Rn&&clearTimeout(Rn),Rn=setTimeout(()=>{try{localStorage.setItem(In,JSON.stringify(Pn))}catch{}},500)}function Wn(e,t){zn[e]||(zn[e]=t,Dn())}function Kn(e){return zn[e]?{...zn[e]}:null}function On(e,t){zn[e]=t,Dn()}function jn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(zn))n(zn[e],r,o)&&(delete zn[e],i=!0);i&&Dn()}var Fn={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},Bn=4e3,qn=()=>{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"},Hn={small:.8,medium:1,large:1.25,maximized:1.25},Un=/* @__PURE__ */new Set,Yn=0,Xn=/* @__PURE__ */new Map;var Vn=0;function Jn(){return Vn}function Gn(){Vn++,S.forEach(e=>e())}var _n=/* @__PURE__ */new Map,Qn=/* @__PURE__ */new Map,Zn=/* @__PURE__ */new Map;function er(){for(let e=M.length-1;e>=0;e--){const t=Zn.get(M[e]);if(t?.tab)return t.owner}return null}function tr(){return se(L,er,()=>null)}var nr=/* @__PURE__ */new Set;var rr=null;function or(e){rr=null,hr(e)}function ir(e){rr=e;const t=_n.get(e);t&&or(t)}var ar=/* @__PURE__ */new Map;function sr(e){return ar.get(e)?.holdsChanges()??!1}function lr(e){const t=ar.get(e);return t?t.ask():Promise.resolve(!0)}function cr(e){rr===e&&(rr=null)}function ur(e,t,n){if(n&&Zn.set(e,n),t)if(_n.set(t,e),Qn.set(e,t),nr.delete(t)){M.unshift(e);const n=Pn.indexOf(t);-1!==n&&Pn.splice(n,1),Pn.unshift(t),$n()}else!function(e,t){const n=Pn.indexOf(t);if(-1===n)return void M.push(e);let r=M.length;for(let e=0;e<M.length;e++){const t=Qn.get(M[e]);if(t&&Pn.indexOf(t)>n){r=e;break}}M.splice(r,0,e)}(e,t),-1===Pn.indexOf(t)&&(Pn.push(t),$n());else M.push(e);Gn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&rr===t&&or(e)}function dr(e){return e?Zn.get(e)?.owner??Qn.get(e)??null:null}var mr=/* @__PURE__ */new Set;function hr(e){const t=dr(T()),n=M.indexOf(e);-1!==n&&M.splice(n,1),M.push(e);const r=Zn.get(e);if(r?.root)for(const[e,t]of Zn){if(t.root||t.owner!==r.owner||Un.has(e))continue;const n=M.indexOf(e);-1!==n&&M.splice(n,1),M.push(e)}Un.delete(e);const o=Qn.get(e);if(o){const e=Pn.indexOf(o);-1!==e&&Pn.splice(e,1),Pn.push(o),$n(),rr&&rr!==o&&(rr=null)}Gn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const i=dr(T());i&&i!==t&&mr.forEach(e=>e(i))}function fr(e){const t=M.indexOf(e);-1!==t&&M.splice(t,1),Un.add(e),Xn.set(e,++Yn);const n=Qn.get(e);if(n){const e=Pn.indexOf(n);-1!==e&&(Pn.splice(e,1),$n())}Gn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var pr=/* @__PURE__ */new Set;var wr=8,yr=32;function gr(){return e()}var vr="flex size-6 shrink-0 items-center justify-center rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",br="flex size-3 items-center justify-center rounded-full text-gray-900/70",xr="size-2 opacity-0 group-hover/controls:opacity-100 group-focus-within/controls:opacity-100",kr=E.windowBar,Er=80,Cr=384,Mr=400;function Sr(e,t=gr()){const n=Math.min(Math.max(e.x,t.x+Er-e.w),t.x+t.w-Er),r=Math.min(Math.max(e.y,t.y),t.y+t.h-kr);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function Nr(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=gr();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 Lr(e){const t=gr(),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 Tr=null;function zr(e){const t=(Tr||((Tr=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none",`z-index: ${U.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(Tr)),Tr);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 Ar(){Tr&&(Tr.style.opacity="0",Tr.style.display="none")}var Dr=[{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"}],Ir=350,Pr=200;function Rr({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o,children:i}){const[a,s]=ae(!1),l=oe(void 0),c=oe(void 0);ie(()=>()=>{clearTimeout(l.current),clearTimeout(c.current)},[]);const u=()=>{clearTimeout(c.current),l.current=setTimeout(()=>s(!0),Ir)},d=()=>{clearTimeout(l.current),c.current=setTimeout(()=>s(!1),Pr)};/* @__PURE__ */
|
|
47
|
+
return ye("span",{className:"relative inline-flex",onMouseEnter:u,onMouseLeave:d,children:[
|
|
48
|
+
/* @__PURE__ */ge("button",{onClick:t,onFocus:u,onBlur:d,"aria-label":e?o.windowed:o.maximize,title:e?o.windowed:o.maximize,className:r,children:i}),a&&/* @__PURE__ */ge("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(c.current),onMouseLeave:d,className:"absolute left-0 top-full z-30 mt-1 grid w-max grid-cols-2 gap-1 rounded-lg border border-line bg-surface p-2 shadow-lg",children:Dr.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */ge("button",{type:"button","aria-label":o[t],title:o[t],onClick:()=>{s(!1),n(e)},onFocus:()=>clearTimeout(c.current),onBlur:d,className:"relative h-7 w-11 rounded border border-gray-300 bg-gray-50 hover:border-blue-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",children:/* @__PURE__ */ge("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var $r="rosh-gesture-style";var Wr={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 Or(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById($r))return;const e=document.createElement("style");e.id=$r,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=Gt(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function jr(e){const t=M.indexOf(e);if(-1===t)return-1;const n=U.window+t*U.windowStep,r=Zn.get(e);if(!r||r.root)return n;let o=-1;for(const[e,t]of Zn){if(!t.root||t.owner!==r.owner)continue;const n=M.indexOf(e);-1!==n&&(o=Math.max(o,U.window+n*U.windowStep))}return o>=n?o+2+Math.min(t,7):n}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=M.length-1;e>=0;e--)pr.has(M[e])||M.splice(e,1);Pn=Pn.filter(e=>{const t=_n.get(e);return null!=t&&pr.has(t)}),$n(),Gn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var Fr="modal-close-request";function Br(e){se(L,Jn);const t=te(N);if(M.length<=1)return!0;if(e){const t=_n.get(e);if(null!=t)return T()===t}return t?.active??null!=T()}var qr=!1,Hr=/* @__PURE__ */new Set;function Ur(e){return Hr.add(e),()=>Hr.delete(e)}function Yr(){return qr}function Xr(e){qr!==e&&(qr=e,Hr.forEach(e=>e()))}function Vr(){Xr(!qr)}function Jr(){Xr(!1)}var Gr=null,_r=/* @__PURE__ */new Set;function Qr(e){return _r.add(e),()=>_r.delete(e)}function Zr(){return Gr}function eo(e){Gr!==e&&(Gr=e,_r.forEach(e=>e()))}var to=null,no=/* @__PURE__ */new Set;function ro(e){return no.add(e),()=>no.delete(e)}function oo(){return to}function io(e){to!==e&&(to=e,no.forEach(e=>e()))}function ao(){if(!to)return void Xr(!1);eo(to),io(null),Xr(!1)}function so(){Xr(!qr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function lo(){const e=se(Ur,Yr),[t,n]=ae(e),[r,o]=ae(e);return ie(()=>{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?be(
|
|
49
|
+
/* @__PURE__ */ge("div",{onMouseDown:e=>{e.stopPropagation(),Xr(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:U.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 co({open:t,onClose:l,title:c,icon:u,copyText:h,size:f="lg",dirty:p=!1,onNext:w,onPrev:v,footer:k,bodyScroll:C,onMinimize:S,initialBox:A,actions:R,actionsLeft:$,editing:W=!1,edit:F,allowPinOnTop:H,initialPosition:Y,widget:X,compact:J,appStyle:G,flushBody:Z,autoHeight:ee,autoMinHeight:ne,autoWidth:ce,widgetMenu:ue,dimensions:de,windowKey:me,openedFromKey:pe,accentRgb:we,children:xe}){const[ke,Ee]=ae(()=>r()),Ce=D()&&!ke,Me=I()&&!!X,[Se,Ne]=ae(0),[Le,Te]=ae(!1),ze=oe(null),Ae=oe(0);ie(()=>{Ae.current=Se},[Se]);const De=le(e=>{Ce&&(ze.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},Te(!0),qt(pe??null))},[Ce,pe]),Ie=se(Ht,Bt);ie(()=>{if(!Le)return;const e=e=>{if(!ze.current)return;const t=e.clientX-ze.current.startX;if(Math.abs(e.clientY-ze.current.startY)>Math.abs(t)+12)return ze.current=null,Te(!1),Ne(0),void qt(null);Ne(Math.max(0,t))},t=()=>{if(!ze.current)return;const e=.3*window.innerWidth,t=Ae.current>e;ze.current=null,Te(!1),t?(Ne(window.innerWidth),setTimeout(()=>{l(),Ne(0),qt(null)},180)):(Ne(0),qt(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)}},[Le]);const[Re,$e]=ae(c),We=Q(),Ke=We.window;ie(()=>{$e(c)},[c]);const Oe=he(()=>yn(Re).trim()||void 0,[Re]),je=fe(),[Fe,Be]=ae(!1),qe=oe(!1),[Ye,Ve]=ae(!1),[Je,Ge]=ae(null),_e=te(hn),Qe=te(Pe),{prefs:Ze,save:et}=P(),tt=!!Ze.window_accent_stripe,nt=Ze.favorite_documents||[],rt=!!_e&&nt.some(e=>e.entityType===_e.entityType&&e.entityId===_e.entityId),ot=le(()=>{if(!_e)return;const e=rt?nt.filter(e=>!(e.entityType===_e.entityType&&e.entityId===_e.entityId)):[...nt,{entityType:_e.entityType,entityId:_e.entityId,label:_e.label}];et({favorite_documents:e})},[_e,rt,nt,et]),[it,at]=ae(null),[st,lt]=ae("top-right"===Y?"right":"left"),ct=oe(!1),ut=oe(null);re(()=>{const e=ut.current;e&&(we?e.style.setProperty("--window-accent-rgb",we):e.style.removeProperty("--window-accent-rgb"))},[we]);const mt=oe(!1),ft=oe(null),pt=oe(null),wt=oe(null),[yt,gt]=ae(!1),vt=oe(null),bt=oe(null),xt=oe(null),[kt,Et]=ae(!1);re(()=>{const e=bt.current,t=xt.current;if(!e||!t)return;const n=()=>Et(function(e,t){return e.scrollWidth>t.clientWidth}(t,e));if(n(),"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[null!=k&&!1!==k]);const Ct=!!F&&!X&&!J&&!G&&(F.editing||"hidden"!==F.state),[Mt,St]=ae(null),Nt=Ct&&(!!F?.editing||!Mt),Lt=!!(k||R||$)||yt||Nt,Tt=te(Ue),zt=""!==te(mn),At=oe(null);At.current=Qe?{owner:Qe.key,tab:Qe.tab,root:!zt}:null;const Dt=me||(Qe&&!zt?Qe.key:null),It=!!Tt&&!zt&&Tt.enabled&&Tt.hasState&&(W||Tt.declaredEditable)&&!Tt.handMounted&&Lt&&!X&&!J&&!G&&!Ce,Pt=40,{minimize:Rt,items:$t,restoreIfMinimized:Wt,openWindows:Kt}=ht(),jt=oe(`modal-${Math.random().toString(36).slice(2,8)}`).current,Ft=g(jt);ie(()=>{if(X)return pr.add(jt),()=>{pr.delete(jt)}},[X,jt]),ie(()=>{const e=e=>{const t=e.detail;t?.id===jt&&$e(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[jt]);const[Ut,Yt]=ae(U.window),Xt=function(e){const t=se(L,T);return M.length<=1||t===e}(jt),Vt=oe(F);Vt.current=F;const Jt=!!F&&!F.editing&&"enabled"===F.state;ie(()=>{if(!t||!Xt||!Jt)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(b(e.target,ut.current)||(e.preventDefault(),e.stopPropagation(),Vt.current?.onEdit()))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Xt,Jt]);const Gt=function(e){return se(L,()=>Un.has(e))}(jt);Ot({panelRef:ut,bodyRef:ft,open:t,widget:!!X,active:Xt,minimized:Gt});const _t=se(Ur,Yr),Qt=se(Qr,Zr),Zt=se(ro,oo),en=!H&&!X,tn=_t&&en,[rn,an]=ae(!1),sn=tn&&Zt===jt,[cn,un]=ae(!1),dn=cn&&en&&Qt===jt?"picked":null,fn=oe(tn);ie(()=>{if(fn.current&&!tn){un(!0);const e=setTimeout(()=>{un(!1),Gr===jt&&eo(null)},700);return fn.current=tn,()=>clearTimeout(e)}fn.current=tn},[tn,jt]),ie(()=>{tn||an(!1)},[tn]),ie(()=>{const e=pt.current,t=wt.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>gt(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[t]),ie(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&ut.current){const t=ut.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=pt.current,n=wt.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const pn=oe(!1),gn=le(e,[]),vn=le(()=>{const t=e(),n=de?de[0]:Fn[f]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=Hn[qn()],l=de?Math.min(de[1],i):(()=>{const e=("sm"===f?500:"md"===f?600:"lg"===f?700:"xl"===f?800:920)*s;return Math.max(320,Math.min(e,t.h-80))})(),c="cascade"!==(getComputedStyle(document.documentElement).getPropertyValue("--window-position")?.trim()||"cascade")||r()?0:30*(M.length-1),u=Math.max(Pt,(i-l)/2),d=(o-a)/2,m=t.h-Pt-l-u;return"top-right"===Y?{x:t.x+t.w-a-Pt,y:t.y+Pt,w:a,h:l}:"top-left"===Y?{x:t.x+Pt,y:t.y+Pt,w:a,h:l}:{x:t.x+Math.max(Pt,(o-a)/2+Pt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[f]),xn=oe(!1);t||(xn.current=!1);const kn=me||h||null;ie(()=>{if(!t)return;ur(jt,kn,At.current??void 0),me||hr(jt),pn.current=!1,Yt(jr(jt));const e=()=>{Yt(jr(jt))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===me;if(!e.label)return!1;const t=ut.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(hr(jt),Pn.current)return;const t=gr(),n=Math.min(jn.current.w,t.w-40),o=Math.min(jn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;Mn({x:i,y:a,w:n,h:o}),On(!1)},i=e=>{const t=e.detail;r(t)&&(hr(jt),Ge({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==me)return;hr(jt);const t=jn.current,n=function(e,t=gr()){const n=Math.min(e.w,t.w),r=Math.min(e.h,t.h);return{w:n,h:r,x:Math.min(Math.max(e.x,t.x),t.x+t.w-n),y:Math.min(Math.max(e.y,t.y),t.y+t.h-r)}}(t);if(n.x===t.x&&n.y===t.y&&n.w===t.w&&n.h===t.h)return;const r=ut.current,o="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(r&&!o){let e=!1;const t=()=>{e||(e=!0,r.style.transition="",window.dispatchEvent(new CustomEvent("modal-geometry")))};r.style.transition="left .28s ease, top .28s ease, width .28s ease, height .28s ease",r.addEventListener("transitionend",t,{once:!0}),window.setTimeout(t,400)}Mn(n)};return window.addEventListener("modal-reorder",e),window.addEventListener("modal-split-view",n),window.addEventListener("modal-center",o),window.addEventListener("modal-reveal",a),window.addEventListener("modal-context-menu",i),()=>{!function(e){const t=M.indexOf(e);-1!==t&&(M.splice(t,1),Gn()),Un.delete(e),Xn.delete(e),Zn.delete(e);const n=Qn.get(e);n&&(Qn.delete(e),_n.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,kn,gn]);const En=!X&&"maximized"===qn(),[Cn,Mn]=ae(()=>{if(kn&&zn[kn]){const e={...zn[kn]};return de&&(e.w=de[0],ee||(e.h=de[1])),Sr(e)}return A?{x:A.x,y:A.y,w:A.w,h:A.h}:En?gn():vn()}),[Sn,Nn]=ae(()=>!ee),Ln=oe(ke),Tn=oe(null);ie(()=>{const e=()=>{const e=r();e!==Ln.current&&Tn.current?.(e),Ln.current=e,Ee(e),Yt(jr(jt))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[jt]);const An=ke&&!!Qe?.tab&&!zt&&!X&&!Ce,In=An,Pn=oe(In);Pn.current=In;const Rn=tr(),$n=ke&&!!Qe?.tab&&!X&&!Ce&&!_t&&Rn!==Qe.key,Wn=!!X&&ke&&!_t&&null!==Rn,[Kn,On]=ae(()=>kn&&zn[kn]||A?In:In||En),jn=oe(Cn);jn.current=Cn;const Yn=oe(Kn);re(()=>{Yn.current=Kn},[Kn]),re(()=>{if(Sn||An)return;const e=ut.current,t=ft.current;if(!e||!t)return;const n=ne??(X?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,m=t.style.overflowY,h=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const f=t.offsetHeight,p=c.offsetHeight;t.style.flex=d,t.style.height=h,t.style.overflowY=m;const w=c.offsetHeight>p+4,y=Math.max(n,window.innerHeight-r-Math.max(0,jn.current.y)-24),g=w?Math.min(jn.current.h,y):Math.min(Math.max(n,u+f),y),v=Math.abs(g-o)>1;v&&(o=g,Mn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),X||(g<=n?i&&(clearTimeout(i),i=null):(v||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&Nn(!0)},160)))},l=new ResizeObserver(s);s(),vt.current&&l.observe(vt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[Sn,X,ne,Lt,An]),re(()=>{if(!ee||!Sn||X||!t)return;const e=vt.current;if(!e)return;let n=e.offsetHeight;const r=new ResizeObserver(()=>{if(!e.isConnected)return;const t=e.offsetHeight,r=t-n,o=t>0!=n>0;if(n=t,!o||0===r||Kn)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=ne??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,jn.current.y)-24);Mn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[ee,Sn,X,t,Kn,ne]);const Vn=!1!==ce&&!X&&!G&&!Ce,[Jn,er]=ae(()=>!Vn);re(()=>{if(Jn||!t)return;if(!Vn||Kn)return void er(!0);const n=ut.current,r=ft.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let l=jn.current.w,c=0;const u=()=>er(!0),d=()=>{c=0;const t=jn.current;if(Math.abs(t.w-l)>1||document.body.classList.contains("rosh-gesturing"))return void u();const d=e(),m=d.w-80;if(t.w>=m)return void u();const h=[],f=[];for(const e of[r,...Array.from(r.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||o.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(h.push(e),f.push(t))}if(!h.length)return;const p=Math.min(m,t.w+Math.max(...f)),w=p-t.w,y=n.style.width;n.style.width=`${p}px`;const g=h.map((e,t)=>({over:f[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{i(e,w)||o.add(h[t])});const v=a(t,s(t.w,w,g),d,Pt);v!==t&&(l=v.w,Mn(v))};d();const m=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});m.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const h=setTimeout(u,Bn);return()=>{m.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(h)}},[Jn,t,Vn,Kn]);const nr=oe(null),rr=!(!Qe?.tab||zt||X||Ce);Tn.current=t=>{if(!rr)return;if(t)return nr.current||(nr.current={box:{...jn.current},maximized:Yn.current}),void(Yn.current=!0);const r=nr.current;nr.current=null;const o=e();if(r?.maximized)return Yn.current=!0,On(!0),void Mn(o);const i=r?.box??(kn?zn[kn]:void 0);if(Yn.current=!1,On(!1),i&&!n(i,o,!1)){const e={...i};de&&(e.w=de[0],ee||(e.h=de[1])),Mn(Sr(e))}else Mn(vn())},ie(()=>{In&&(Yn.current=!0,On(!0),Mn(gn()))},[In,gn]),ie(()=>{if(X)return;const e=()=>{const e=kn?zn[kn]:void 0;if(Yn.current=!1,On(!1),e){const t={...e};de&&(t.w=de[0],ee||(t.h=de[1])),Mn(Sr(t))}else Mn(vn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[X,vn,kn]),ie(()=>{t&&kn&&!An&&(zn[kn]=Cn,Dn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[Cn,t,kn,An]),ie(()=>{if(!t)return;const e=()=>{Yn.current?Mn(gn()):document.body.classList.contains("rosh-gesturing")||Mn(Sr)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Kn&&(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,Kn,gn]),ie(()=>{if(t&&(Be(!1),qe.current=!1,ct.current=!1,er(!Vn),!Pn.current)){if(kn&&zn[kn]){const e=zn[kn];return void Mn(t=>Sr({...e,...ee?{h:t.h}:{},...Vn?{x:t.x,w:t.w}:{}}))}A&&(Mn({x:A.x,y:A.y,w:A.w,h:A.h}),On(A.maximized))}},[t]),ie(()=>{if(!t||"auto"!==p)return;let e;const n=t=>{ut.current?.contains(t.target)&&!qe.current&&(qe.current=!0,e=setTimeout(()=>Be(!0),0))};return document.addEventListener("input",n,!0),document.addEventListener("change",n,!0),()=>{clearTimeout(e),document.removeEventListener("input",n,!0),document.removeEventListener("change",n,!0)}},[t,p]);const or="auto"===p?Fe:!0===p,ir=Qe&&!zt?Qe.key:null,sr=he(()=>nn(Re),[Re]),lr=oe({shortcutSpec:_e,isOnDesktop:rt,toggleDesktopShortcut:ot,taskbarStrings:We.taskbar});re(()=>{lr.current={shortcutSpec:_e,isOnDesktop:rt,toggleDesktopShortcut:ot,taskbarStrings:We.taskbar}});const cr=oe(null);cr.current||(cr.current={open:(e,t)=>Ge({x:e,y:t}),items:()=>{const e=lr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of bn[jt]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),ie(()=>{if(t&&ir)return()=>{return e=ir,void(on.delete(e)&&ln());var e}},[t,ir]),dt(!(me||!t)&&or);const dr=le(()=>or||"auto"===p&&qe.current,[or,p]),mr=le(async e=>{if(ct.current)return!1;if(!dr())return!0;ct.current=!0;const t=Oe,n="close"===e?"Are you sure you want to close?":"discard"===e?"Are you sure you want to stop editing?":"Are you sure you want to continue?",r=await y({title:"Discard changes?",message:t?`“${t}” has unsaved changes. ${n} All changes will be lost.`:`You have unsaved changes. ${n} All changes will be lost.`,confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});return ct.current=!1,r},[dr,Oe]),kr=le(()=>ct.current?Promise.resolve():dr()?mr("close").then(e=>{e&&l()}):(l(),Promise.resolve()),[dr,mr,l]),Er=le(async()=>{await mr("discard")&&(qe.current=!1,Be(!1),Vt.current?.onDiscard())},[mr]),Nr=le(async()=>{const e=await mr("switch");return e&&(qe.current=!1,Be(!1)),e},[mr]),Tr=oe(()=>!1);re(()=>{Tr.current=dr}),re(()=>{if(!t||!me)return;const e={holdsChanges:()=>Tr.current(),ask:Nr};return ar.set(me,e),()=>{ar.get(me)===e&&ar.delete(me)}},[t,me,Nr]),re(()=>{if(!t||!Dt)return;const e=e=>{e.detail?.windowKey===Dt&&kr()};return window.addEventListener(Fr,e),()=>window.removeEventListener(Fr,e)},[t,Dt,kr]);const Dr=oe(null),Ir=le(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Ge(null),hr(jt),Pn.current)return void e.preventDefault();e.preventDefault();const t=e.currentTarget,n=e.pointerId;let r=null;const o=e.clientX,i=e.clientY,a=ut.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Dr.current){const t=Dr.current;Dr.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:jn.current.x,c=s?s.top:jn.current.y,u=s?s.height:jn.current.h,d=s?s.width:jn.current.w;On(!1),Mn(e=>({...e,x:l,y:c,w:d,h:u}));let m=null;const h=e=>{if(!r){if(Math.abs(e.clientX-o)<Kr&&Math.abs(e.clientY-i)<Kr)return;r=Or(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)`),jn.current={...jn.current,x:s,y:u},!X){const t=function(e,t){const n=gr(),r=e<=n.x+wr,o=e>=n.x+n.w-wr,i=t<=n.y+wr,a=t>=n.y+n.h-wr,s=e<=n.x+yr,l=e>=n.x+n.w-yr,c=t<=n.y+yr,u=t>=n.y+n.h-yr;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!==m&&(m=t,t?zr(Lr(t)):Ar())}},f=()=>{window.removeEventListener("pointermove",h),window.removeEventListener("pointerup",f),r?.(),Ar();const e=Sr({...jn.current});if(jn.current=e,!X&&m){Dr.current={x:l,y:c,w:d,h:u};const e=Lr(m);return a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.width=`${e.w}px`,a.style.height=`${e.h}px`,a.style.transform="",a.style.transition=""),void Mn(e)}if(X){const t=e.x+e.w/2,n=window.innerWidth/2;lt(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),Mn(e)};window.addEventListener("pointermove",h),window.addEventListener("pointerup",f)},[]),Pr=le((e,t)=>{if(0!==e.button)return;e.preventDefault(),e.stopPropagation();const n=e.currentTarget,r=e.pointerId;let o=null;const i=e.clientX,a=e.clientY,s=ut.current,l=s?.getBoundingClientRect(),c=l?l.left:jn.current.x,u=l?l.top:jn.current.y,d=l?l.width:jn.current.w,m=l?l.height:jn.current.h,h="sw"===t||"nw"===t||"w"===t,f="ne"===t||"nw"===t||"n"===t,p="se"===t||"ne"===t||"e"===t,w="se"===t||"sw"===t||"s"===t;On(!1),Mn({x:c,y:u,w:d,h:m}),jn.current={x:c,y:u,w:d,h:m};let y=0,g=null;const v=()=>{if(y=0,!g)return;const e=g;g=null,jn.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},b=e=>{if(!o){if(Math.abs(e.clientX-i)<Kr&&Math.abs(e.clientY-a)<Kr)return;o=Or(n,r,Wr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=m;if(p&&(o=Math.max(Cr,d+e)),w&&(i=Math.max(Mr,m+t)),h){const t=Math.max(Cr,d-e);n=c+d-t,o=t}if(f){const e=Math.max(Mr,m-t);r=u+m-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(v))},x=()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),v(),o?.(),Mn({...jn.current})};window.addEventListener("pointermove",b),window.addEventListener("pointerup",x)},[]),$r=le(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(),hr(jt),"Enter"===e.key)return void(Kn?(On(!1),Mn(vn())):(On(!0),Mn(gn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Dr.current||(Dr.current={...jn.current})};if(r<0)return e(),On(!0),void Mn(gn());if(r>0){if(Kn)return On(!1),void Mn(vn());if(Dr.current){const e=Sr(Dr.current);return Dr.current=null,jn.current=e,void Mn(e)}return void fr(jt)}e(),On(!1);const t=Lr(n<0?"left":"right");return jn.current=t,void Mn(t)}if(Kn)return;const o=jn.current,i=e.shiftKey?{...o,w:Math.max(Cr,o.w+24*n),h:Math.max(Mr,o.h+24*r)}:Sr({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});jn.current=i,Mn(i)},[jt,Kn,vn,gn]),Br=le(e=>{Dr.current||(Dr.current={...jn.current}),On(!1);const t=Lr(e);jn.current=t,Mn(t),hr(jt)},[jt]),qr=!X&&!An&&!Ce,[Hr,Vr]=ae(0),Jr=qr&&!J&&!G&&(!!R||!!$||yt||Nt||It),_r=qr&&Hr>0,to=oe(_r);to.current=_r;const no=!!J||!!G,io=no?"h-(--row-height-compact-bar)":"h-(--row-height-window-bar)",ao=le(e=>{const t=e.closest("[data-window-body]");if(!t)return null;const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return Math.abs(n.left-r.left)>2||Math.abs(n.top-r.top)>2?null:(Vr(e=>e+1),()=>Vr(e=>Math.max(0,e-1)))},[]),so=he(()=>qr?{compact:no,over:_r,claim:ao}:null,[qr,no,_r,ao]),lo=le(e=>{if(tn)return;e.preventDefault(),e.stopPropagation();const t=0===e.clientX&&0===e.clientY,n=e.currentTarget.getBoundingClientRect();Ge(t?{x:n.left,y:n.bottom+4}:{x:e.clientX,y:e.clientY})},[tn]),co=!!we&&tt&&!X&&!Ce,uo=In||tn?{}:{tabIndex:0,role:"group","aria-label":Oe?`${Oe} — ${Ke.windowSuffix}`:Ke.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:$r},mo=()=>{On(!0),Mn(gn())},ho=le(()=>{const e=ut.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(wn);t&&!t.disabled&&t.click()}},[]);ie(()=>{if(!t)return;if(X)return;const e=e=>{if(M[M.length-1]===jt&&!b(e.target,ut.current)&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),ho();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&ut.current?.contains(t)))return;if(t.closest(z))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,ho,jt,X]),ie(()=>{if(!t)return;const e=e=>{M[M.length-1]===jt&&(b(e.target,ut.current)||((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:jt}})),qe.current=!1,Be(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:jt}})))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),ie(()=>{if(!t)return;if(X)return;const e=e=>{if("Escape"===e.key&&M[M.length-1]===jt){if(_(e))return e.preventDefault(),void e.stopPropagation();if(An&&!W)return;e.preventDefault(),e.stopPropagation(),kr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,kr,jt,X,An,W]);const fo=t&&(void 0!==w||void 0!==v),[po]=ae(()=>{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}),wo=An&&!Qe?.home&&sr.actions.length>0;ie(()=>{t&&ir&&function(e,t){const n=on.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(on.set(e,t),ln())}(ir,{title:sr.text||Oe,dirty:or,copy:sr.copy,actions:wo&&po?po:void 0,menu:cr.current??void 0})},[t,ir,Oe,or,sr.text,sr.copy,wo,po]);const yo=le(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(ie(()=>{if(!t)return;const e=e=>{if(M[M.length-1]!==jt)return;if(b(e.target,ut.current))return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&fo&&(e.preventDefault(),w?w():yo("bottom")),"k"===e.key&&fo&&(e.preventDefault(),v?v():yo("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,w,v,fo,yo,jt]),!t||xn.current)return null;const go=tn?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=gr(),d=(u.w-20*(o+1))/o,m=(u.h-14*(i+1)-22*i)/i,h=c?(o-l)*(d+20)/2:0;return{x:u.x+20+s*(d+20)+h,y:u.y+14+a*(m+14+22),w:d,h:m}}(jt):null,vo=tn&&go?V({width:go.w,height:go.h},{width:Cn.w,height:Cn.h}):1,bo=(()=>{if(tn&&go){const e=vo,t=Cn.w*e,n=Cn.h*e,r=go.x+(go.w-t)/2-Cn.x,o=go.y+(go.h-n)/2-Cn.y,i=rn||sn;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:U.expose+(i?20:10),boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(cn&&en){const e="picked"===dn;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:U.expose+30}:{}}}return null})(),xo=x({modal:!1,titleId:!X&&(An?!Qe?.home:!Ce)?je:void 0,label:sr.text||Oe}),ko=Ct&&F&&!F.editing?"object"==typeof F.state?/* @__PURE__ */ge(B,{variant:"secondary",size:"sm","data-modal-edit":"","aria-disabled":!0,disabledReason:F.state.disabledReason,children:Ke.edit}):/* @__PURE__ */ge(B,{variant:"secondary",size:"sm","data-modal-edit":"",onClick:()=>F.onEdit(),children:Ke.edit}):null,Eo=/* @__PURE__ */ye("div",{children:[
|
|
50
|
+
/* @__PURE__ */ye("div",{ref:ut,"data-modal-panel":!0,"data-modal-id":jt,"data-window-key":me||void 0,...H?{"data-utility":""}:{},...Ye?{"data-pinned-top":""}:{},...X?{"data-widget":""}:{},...Qe?{"data-window-owner":Qe.key}:{},...Qe&&!zt?{"data-window-root":""}:{},...An?{"data-window-tab":""}:{},...xo,className:An?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(X?Xt?"shadow-xl":"shadow-lg":"border "+(Xt?"shadow-xl border-line":"shadow-lg border-line-strong")),onPointerDown:e=>{if(!to.current||tn||0!==e.button)return;const t=e.target;if(t.closest("[data-modal-panel]")!==ut.current)return;if(t.closest("[data-window-chrome]"))return;const n=e.currentTarget.getBoundingClientRect(),r=n.height/(e.currentTarget.offsetHeight||n.height),o=(no?E.compactBar:E.windowBar)*r;e.clientY-n.top>o||t.closest(m)||Ir(e)},onContextMenu:e=>{const t=e.target;t.closest("[data-window-strip]")&&t.closest("[data-modal-panel]")===ut.current&&lo(e)},onMouseDownCapture:e=>{if(mt.current=!1,tn){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),eo(jt),Xr(!1),void hr(jt)}if(!Xt&&!X&&!Ye&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===ut.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),mt.current=!0,Ge(null),hr(jt),window.addEventListener("mouseup",()=>{setTimeout(()=>{mt.current=!1},0)},{once:!0}))}},onClickCapture:e=>{mt.current&&(mt.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(tn)return;Ge(null);e.target.closest("[data-modal-panel]")===ut.current&&(e.target.closest("button, input, a, select, textarea")||hr(jt))},style:Ce?{zIndex:Ut+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${Se}px)`,transition:Le?"none":"transform 180ms ease-out",...X?{display:"none"}:{},...Ut<0?{display:"none"}:{},...Xt||Ye||Ie&&me===Ie?{}:{display:"none"},...Ft?{visibility:"hidden",pointerEvents:"none"}:{}}:{zIndex:Ye?U.pinnedWindow:Ut+1,width:Cn.w,height:Cn.h,top:Cn.y,...X&&"right"===st?{right:window.innerWidth-Cn.x-Cn.w}:{left:Cn.x},...Ut<0&&!Ye?{display:"none"}:{},...Me?{display:"none"}:{},...$n||Wn||Ft?{visibility:"hidden",pointerEvents:"none"}:{},...bo??{}},children:[Ce&&!X&&/* @__PURE__ */ge("div",{onPointerDown:De,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),
|
|
51
|
+
/* @__PURE__ */ye("div",{"data-window-surface":"",className:"flex min-h-0 flex-1 flex-col "+(qr?"backdrop-blur-sm":""),style:qr?{backgroundColor:Xt?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"}:void 0,children:[X?null:An?Qe?.home?null:/* @__PURE__ */ye(ve,{children:[
|
|
52
|
+
/* @__PURE__ */ge("h2",{id:je,"data-window-title":!0,className:"sr-only",children:sr.text||Oe}),wo&&po&&be(
|
|
53
|
+
/* @__PURE__ */ge(ve,{children:sr.actions}),po),sr.badges.length>0&&/* @__PURE__ */ge("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:sr.badges})]}):Ce?null:
|
|
54
|
+
/* @__PURE__ */ye("div",{onPointerDown:Ir,onContextMenu:lo,"data-window-chrome":"",..._r?{"data-window-controls-over":""}:{},...uo,className:_r?`absolute left-0 z-10 flex ${io} items-center px-3 select-none focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400`:`flex items-center gap-3 ${io} px-3 shrink-0 cursor-move select-none focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400`,style:{touchAction:"none",..._r?{top:co?3:0}:{}},children:[!tn&&/* @__PURE__ */ye("div",{"data-window-controls":"",className:"group/controls flex shrink-0 items-center",children:[
|
|
55
|
+
/* @__PURE__ */ge("button",{type:"button",onClick:kr,"aria-label":Ke.close,title:Ke.close,className:vr,children:/* @__PURE__ */ge("span",{"aria-hidden":"true",className:`${br} ${Xt?"bg-red-500":"bg-gray-300 group-hover/controls:bg-red-500"}`,children:/* @__PURE__ */ge(q,{name:"close",className:xr,strokeWidth:3})})}),!J&&/* @__PURE__ */ge("button",{type:"button",onClick:()=>fr(jt),"aria-label":Ke.minimize,title:Ke.minimize,className:vr,children:/* @__PURE__ */ge("span",{"aria-hidden":"true",className:`${br} ${Xt?"bg-amber-400":"bg-gray-300 group-hover/controls:bg-amber-400"}`,children:/* @__PURE__ */ge("span",{className:"h-0.5 w-2 rounded-full bg-current opacity-0 group-hover/controls:opacity-100 group-focus-within/controls:opacity-100"})})}),!J&&/* @__PURE__ */ge(Rr,{maximized:Kn,onToggleMax:()=>{Kn?(On(!1),Mn(vn())):mo()},onSnap:Br,buttonClassName:vr,strings:Ke,children:/* @__PURE__ */ge("span",{"aria-hidden":"true",className:`${br} ${Xt?"bg-green-500":"bg-gray-300 group-hover/controls:bg-green-500"}`,children:/* @__PURE__ */ge(q,{name:Kn?"collapse":"expand",className:xr,strokeWidth:3})})}),H&&/* @__PURE__ */ge("button",{type:"button",onClick:()=>Ve(e=>!e),"aria-label":Ye?Ke.unpin:Ke.pinOnTop,title:Ye?Ke.unpin:Ke.pinOnTop,className:"ml-1 p-0.5 rounded hover:bg-gray-200 "+(Ye?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */ge(q,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:Ye?"currentColor":"none",strokeWidth:1.5})})]}),_r?
|
|
56
|
+
/* @__PURE__ */ge("h2",{id:je,"data-window-title":!0,className:"sr-only",children:sr.text||Oe}):/* @__PURE__ */ge("div",{"data-window-title":!0,title:Oe,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Xt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:/* @__PURE__ */ge("span",{id:je,className:"truncate",children:tn?yn(Re):Re})})]}),co&&/* @__PURE__ */ge("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${Xt?.9:.55})`}}),
|
|
57
|
+
/* @__PURE__ */ge(mn.Provider,{value:jt,children:/* @__PURE__ */ge(d.Provider,{value:so,children:/* @__PURE__ */ge(N.Provider,{value:{rightRef:pt,leftRef:wt,notify:()=>gt(!0),setEditSlot:St,active:Xt,isDirty:or,footerOpen:Lt&&!X&&!J&&!G&&!Ce},children:/* @__PURE__ */ge("div",{ref:ft,"data-window-body":"",...X?{onPointerDown:Ir,onContextMenu:e=>{e.preventDefault(),at({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${X?"p-0 cursor-move":G||Z?"p-0":J?"p-2":"p-4"} ${X||An||qr?"":"backdrop-blur-sm"} ${!1===C||G||Z?"overflow-hidden":"overflow-y-auto overscroll-contain"+(qr?Jr?" mr-1":" mb-2 mr-1":"")} ${X?"rounded-2xl select-none":""}`,style:{...X?{touchAction:"none"}:{},backgroundColor:X||qr?"transparent":An?"rgb(var(--window-content-rgb))":Xt?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */ge(He,{children:xe})})})})}),X&&it&&/* @__PURE__ */ye(K,{minWidth:160,style:{left:it.x,top:it.y},onClose:()=>at(null),children:[
|
|
58
|
+
/* @__PURE__ */ge(O,{onClick:()=>{at(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:jt}))},children:"Settings"}),
|
|
59
|
+
/* @__PURE__ */ge(j,{}),ue&&/* @__PURE__ */ye(ve,{children:[ue,
|
|
60
|
+
/* @__PURE__ */ge(j,{})]}),
|
|
61
|
+
/* @__PURE__ */ye(O,{onClick:()=>{at(null),Ve(e=>!e)},children:[
|
|
62
|
+
/* @__PURE__ */ge("span",{className:"flex-1",children:"Always on Top"}),Ye&&/* @__PURE__ */ge(q,{name:"check",className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
|
|
63
|
+
/* @__PURE__ */ge(j,{}),
|
|
64
|
+
/* @__PURE__ */ge(O,{onClick:()=>{at(null),kr()},children:"Close"})]}),
|
|
65
|
+
/* @__PURE__ */ye("div",{onPointerDown:Ir,ref:vt,"data-modal-footer":"",...qr?{"data-modal-footer-bare":""}:{},className:qr?"px-4 py-2 shrink-0 flex items-center justify-between text-xs select-none cursor-move"+(Jr?"":" hidden"):`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${An?"":" cursor-move"}${Xt&&!An?" backdrop-blur-sm":""}${X||J||G||Ce||!Lt?" hidden":""}`,style:qr?{touchAction:"none"}:{touchAction:"none",backgroundColor:An?"rgb(var(--window-footer-rgb))":Xt?"rgb(var(--window-footer-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-footer-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
66
|
+
/* @__PURE__ */ye("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[It&&/* @__PURE__ */ge(Xe,{auto:!0}),$,
|
|
67
|
+
/* @__PURE__ */ge("div",{ref:wt,"data-modal-actions-left":!0,className:"flex items-center gap-2 shrink-0"}),null!=k&&!1!==k&&!qr&&
|
|
68
|
+
/* @__PURE__ */ge("div",{ref:bt,"data-modal-footer-facts":"",className:"min-w-0 flex-1 overflow-hidden",children:/* @__PURE__ */ge("div",{ref:xt,className:"inline-flex items-center gap-2 whitespace-nowrap"+(kt?" invisible":""),children:k})})]}),
|
|
69
|
+
/* @__PURE__ */ye("div",{"data-modal-footer-right":"",className:"flex items-center gap-2 ml-auto shrink-0",children:[Ct&&F&&(F.editing?/* @__PURE__ */ge(B,{variant:"secondary",size:"sm","data-modal-discard":"",onClick:()=>{Er()},children:Ke.discard}):Mt?be(ko,Mt):ko),
|
|
70
|
+
/* @__PURE__ */ge("div",{ref:pt,"data-modal-actions":!0,className:"flex items-center gap-2"}),R]})]})]}),!X&&!Ce&&!tn&&Xt&&!In&&/* @__PURE__ */ye(ve,{children:[
|
|
71
|
+
/* @__PURE__ */ge("div",{onPointerDown:e=>Pr(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
72
|
+
/* @__PURE__ */ge("div",{onPointerDown:e=>Pr(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
73
|
+
/* @__PURE__ */ge("div",{onPointerDown:e=>Pr(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
74
|
+
/* @__PURE__ */ge("div",{onPointerDown:e=>Pr(e,"nw"),className:"absolute top-0 left-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
75
|
+
/* @__PURE__ */ge("div",{onPointerDown:e=>Pr(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
76
|
+
/* @__PURE__ */ge("div",{onPointerDown:e=>Pr(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
77
|
+
/* @__PURE__ */ge("div",{onPointerDown:e=>Pr(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
|
|
78
|
+
/* @__PURE__ */ge("div",{onPointerDown:e=>Pr(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),tn&&/* @__PURE__ */ge("div",{className:"absolute inset-0",style:{zIndex:U.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>an(!0),onMouseLeave:()=>an(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),hr(jt),Xr(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:rn&&/* @__PURE__ */ge("button",{type:"button","data-expose-close":!0,"aria-label":We.taskbar.closeWindow,title:"Close",className:"absolute flex items-center justify-center rounded-full bg-black/55 text-on-accent shadow-lg ring-1 ring-white/40 transition-colors hover:bg-red-500",style:{top:8,right:8,width:30,height:30,transform:`scale(${1/vo})`,transformOrigin:"top right",zIndex:U.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),kr()},children:/* @__PURE__ */ge(q,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),tn&&go&&/* @__PURE__ */ge("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:go.x,top:go.y+go.h+4,width:go.w,zIndex:U.expose+(rn?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:yn(Re)})]}),Co=Je&&/* @__PURE__ */ye(K,{style:{left:Je.x,top:Je.y},onClose:()=>Ge(null),minWidth:160,children:[!X&&!J&&!An&&/* @__PURE__ */ye(ve,{children:[
|
|
79
|
+
/* @__PURE__ */ye(O,{onClick:()=>{fr(jt),Ge(null)},children:[
|
|
80
|
+
/* @__PURE__ */ge(q,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),Ke.minimize]}),!In&&/* @__PURE__ */ye(O,Kn?{onClick:()=>{On(!1),Mn(vn()),Ge(null)},children:[
|
|
81
|
+
/* @__PURE__ */ge(q,{name:"collapse",className:"h-4 w-4",strokeWidth:1.5}),Ke.windowed]}:{onClick:()=>{mo(),Ge(null)},children:[
|
|
82
|
+
/* @__PURE__ */ge(q,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),Ke.maximize]})]}),H&&!An&&/* @__PURE__ */ye(O,{onClick:()=>{Ve(e=>!e),Ge(null)},children:[
|
|
83
|
+
/* @__PURE__ */ge(q,{name:"bookmark-square",className:"h-4 w-4 "+(Ye?"text-blue-600":""),fill:Ye?"currentColor":"none",strokeWidth:1.5}),Ye?Ke.unpin:Ke.pinOnTop]}),_e&&/* @__PURE__ */ye(O,{onClick:()=>{Ge(null),ot()},children:[
|
|
84
|
+
/* @__PURE__ */ge(q,{name:"star",className:"h-4 w-4",fill:rt?"currentColor":"none",strokeWidth:1.5}),rt?We.taskbar.removeFromDesktop:We.taskbar.addToDesktop]}),(bn[jt]||[]).length>0&&/* @__PURE__ */ge(ve,{children:(bn[jt]||[]).map((e,t)=>/* @__PURE__ */ye(O,{onClick:()=>{Ge(null),e.onClick()},children:[e.icon,e.label]},t))}),!(An&&Qe?.home)&&/* @__PURE__ */ye(ve,{children:[
|
|
85
|
+
/* @__PURE__ */ge(j,{}),
|
|
86
|
+
/* @__PURE__ */ye(O,{danger:!0,onClick:()=>{Ge(null),kr()},children:[
|
|
87
|
+
/* @__PURE__ */ge(q,{name:"close",className:"h-4 w-4"}),Ke.close]})]})]}),Mo=!!me&&Kt.some(e=>e.id===me),So=!Gt||Mo||X?null:/* @__PURE__ */ye("div",{"data-modal-restore-tab":!0,"data-modal-id":jt,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:[
|
|
88
|
+
/* @__PURE__ */ge("button",{type:"button",onClick:()=>hr(jt),title:Ke.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:Oe||Ke.windowSuffix}),
|
|
89
|
+
/* @__PURE__ */ge("button",{type:"button",onClick:()=>hr(jt),title:Ke.restore,"aria-label":Ke.restore,className:"rounded px-2 py-0.5 text-xs leading-none text-ink-faintest hover:bg-gray-100 hover:text-gray-600",children:"▴"}),
|
|
90
|
+
/* @__PURE__ */ge("button",{type:"button",onClick:()=>{kr()},title:Ke.close,"aria-label":Ke.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 be(
|
|
91
|
+
/* @__PURE__ */ye(hn.Provider,{value:null,children:[Eo,Co,So]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{qr&&"Escape"===e.key&&(io(null),Xr(!1))});var uo=100,mo={past:[],future:[]};function ho(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>uo?r.slice(r.length-uo):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:mo}}var fo=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var po=500,wo=250;function yo({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,i]=pe(ho,mo),a=oe(/* @__PURE__ */new Map),[s,l]=ae(0),c=s>0,[u,d]=ae(0),[m,h]=ae(0),f=m>0,{hasAnyPerm:p}=A(),w=t&&0===u&&(!(n&&n.length>0)||p(n)),y=oe(null),g=oe(!1),v=le(()=>{const e={};for(const[t,n]of a.current)e[t]=n.getLast();return e},[]),b=le((e,t)=>{a.current.has(e)||l(e=>e+1),a.current.set(e,t)},[]),x=le(e=>{a.current.delete(e)&&l(e=>e-1)},[]),k=le(e=>{d(t=>t+(e?1:-1))},[]),E=le(e=>{h(t=>t+(e?1:-1))},[]),[C,M]=ae(0),S=C>0,L=le(e=>{M(t=>t+(e?1:-1))},[]),T=te(Ue),z=T?.claimReadOnly;ie(()=>{if(z&&!w)return z(!0),()=>z(!1)},[z,w]);const D=T?.claimOwnMount;ie(()=>{if(D&&S)return D(!0),()=>D(!1)},[D,S]);const I=oe({last:0,count:0,tripped:!1}),P=oe(!1),R=le((e,t,n)=>{if(g.current)return void(n&&function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}(n.prev,n.next)||(P.current=!0));if(!w||y.current)return;const r=I.current;if(r.tripped)return;const o=Date.now();if(o-r.last>wo&&(r.count=0),r.last=o,++r.count>po)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${po} undo steps with no pause between them, which no user action can do. The value passed to useUndoable for this slice is almost certainly rebuilt on every render (a .map/.filter/object literal in the call) rather than held in state, so it reads as changed every time — and since recording a step re-renders the form, that is a loop. Undo recording is now off for this form to keep the tab responsive.`);y.current={values:v(),label:e,coalesceKey:t},queueMicrotask(()=>{const e=y.current;y.current=null,e&&i({type:"record",step:e})})},[w,v]),$=le(e=>{for(const[t,n]of Object.entries(e)){const e=a.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),W=le(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};$(e.values),i({type:"undo",redoStep:t})},[o.past,v,$]),K=le(()=>{const e=o.future[0];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};$(e.values),i({type:"redo",undoStep:t})},[o.future,v,$]),[O,j]=ae(0),F=oe(0),B=oe(0),q=oe(!1),H=le(()=>{g.current=!0,P.current=!1,y.current=null,F.current+=1,B.current=F.current,j(F.current)},[]),U=oe(void 0),Y=le(e=>{void 0!==e&&(void 0!==U.current&&e!==U.current&&(q.current=!0),U.current=e),H()},[H]);ie(()=>{g.current&&O===B.current&&(g.current=!1,y.current=null,(P.current||q.current)&&i({type:"clear"}),P.current=!1,q.current=!1)},[O]);const X=le(()=>{q.current=!0,i({type:"clear"}),H()},[H]),V=w&&o.past.length>0,J=w&&o.future.length>0,G=Br(r),_=oe({undo:W,redo:K,canUndo:V,canRedo:J});_.current={undo:W,redo:K,canUndo:V,canRedo:J},ie(()=>{if(!G||!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&&fo.has(r.tagName.toUpperCase())?null:n}(e);if(!t)return;const n=_.current;("undo"===t?n.canUndo:n.canRedo)&&(e.preventDefault(),"undo"===t?n.undo():n.redo())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[G,w]);const Q=he(()=>({register:b,unregister:x,record:R,undo:W,redo:K,clear:X,baseline:Y,canUndo:V,canRedo:J,enabled:w,hasState:c,handMounted:S,claimOwnMount:L,claimReadOnly:k,declaredEditable:f,claimEditable:E,undoLabel:V?o.past[o.past.length-1].label:null,redoLabel:J?o.future[0].label:null}),[b,x,R,W,K,X,Y,V,J,w,c,S,L,k,f,E,o.past,o.future]),Z=""!==Cn(),ee=te(N)?.footerOpen??!1,ne=Z&&w&&c&&!S&ⅇ/* @__PURE__ */
|
|
92
|
+
return ye(Ue.Provider,{value:Q,children:[ne&&/* @__PURE__ */ge(Nn,{position:"left",quiet:!0,children:/* @__PURE__ */ge(Xe,{auto:!0})}),e]})}function go(){const e=te(Ue),t=le(()=>{},[]);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 vo(e){const t=te(Ue),n=t?.claimReadOnly,r=t?.claimEditable;ie(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function bo(e,t,n){const r=te(Ue),o=fe(),i=oe(e),a=oe(t);a.current=t,ie(()=>{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=oe(r);c.current=r;const u=oe({label:s,coalesceKey:l});u.current={label:s,coalesceKey:l},ie(()=>{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 xo(e,t){const[n,r]=ae(e);return bo(n,e=>r(()=>e),t),[n,r]}export{Ln as CancelButton,De as DesktopHostProvider,wt as DocFavStar,ot as EntityWindowFallback,nt as EntityWindowLoading,it as EntityWindowState,wn as MODAL_SUBMIT_SELECTOR,co as Modal,Nn as ModalActions,Sn as ModalMoreActions,Xe as UndoControls,yo as UndoProvider,Le as WINDOW_REGISTRY,qe as WindowCrashedFallback,Mn as WindowEditSlot,He as WindowErrorBoundary,Wt as WindowManagerProvider,kn as WindowTitle,kt as activateWindowById,Gt as beginWindowGesture,cr as cancelWindowFront,ze as client_default,ao as commitExposeHighlight,lr as confirmWindowDiscard,_t as drainPerfEvents,Jr as exitExposeMode,jn as forgetMaximizedWindowBoxes,Mt as getActiveWindowRoute,oo as getExposeHighlight,dn as getWindowChromeVersion,Kn as getWindowPosition,st as isDraftEntityId,lt as isDraftEntityWindow,Me as isEntityEntry,Ce as isPageEntry,Te as isShellApiClientConfigured,Qe as isTabWindow,Jt as markMenuOpen,cn as readWindowChrome,ir as requestWindowFront,io as setExposeHighlight,Vt as setPerfCollecting,Ke as setShellHomeRoute,Be as setShellTabStrip,Ne as setShellWindowRegistry,Wn as setWindowDefaultPosition,On as setWindowPosition,nn as splitTitle,ro as subscribeExposeHighlight,un as subscribeWindowChrome,Ze as tabGroupOf,Vr as toggleExposeMode,tr as useCurrentTabKey,Ie as useDesktopHost,Cn as useEnclosingModalId,Br as useIsActiveWindow,Re as usePageSearch,go as useUndo,vo as useUndoCanEdit,bo as useUndoable,xo as useUndoableState,vn as useWidgetSettings,dt as useWindowDirty,ht as useWindowManager,xn as useWindowMenuItem,En as useWindowTitle,sr as windowHoldsChanges};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{TransferProgress as e}from"./chunk-
|
|
1
|
+
import{TransferProgress as e}from"./chunk-LLDGRPLF.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-NRHG4R2Q.js";import{jsx as o}from"react/jsx-runtime";var n=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function i(e){if(/^data:/i.test(e||""))return function(e){const r=n.exec(e);if(!r)return"media";const[,t,o]=r,i=o.split("+")[0].split(".").pop().replace(/^x-/i,"");return i?`${t.toLowerCase()}.${i.toLowerCase()}`:"media"}(e);const r=(e||"").split("?")[0].split("#")[0],t=r.substring(r.lastIndexOf("/")+1);try{return decodeURIComponent(t.replace(/^[0-9a-f]{32}_/i,""))||t||"media"}catch{return t||"media"}}var s=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function a(e,r=t.media){const o=function(e){const r=e.includes("video"),t=e.includes("image")||"*"===e||""===e;return r&&!t?"video":t&&!r?"image":"file"}(e);return"image"===o?r.uploadImage:"video"===o?r.uploadVideo:r.uploadFile}function c(e,r,t="",o="p-4"){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",o,r?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",t].filter(Boolean).join(" ")}function u(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function d({label:r,progress:t,rounded:n="rounded-lg"}){/* @__PURE__ */
|
|
2
2
|
return o("div",{className:`absolute inset-0 flex items-center justify-center bg-white/60 ${n}`,children:/* @__PURE__ */o(e,{state:"busy",verb:r,pct:t})})}function l({children:e}){/* @__PURE__ */
|
|
3
3
|
return o("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-2 py-0.5 text-xs text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e})}function m(e,r=""){if(!e)return!1;const t=n.exec(e);if(t)return"video"===t[1].toLowerCase();const o=r.includes("video"),i=r.includes("image")||"*"===r||""===r;return s.test(e)||o&&!i}function f({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
4
4
|
return o(r,{name:"close",className:e,strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})}function p({className:e="h-6 w-6"}){/* @__PURE__ */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{EmptyValue as r}from"./chunk-HNQPF5QZ.js";import{toInstant as e,timeAgo as t}from"./chunk-OJI4ROSD.js";import{formatDateTime as o}from"./chunk-NHKT5IH6.js";import{useShellLocale as c}from"./chunk-
|
|
1
|
+
import{EmptyValue as r}from"./chunk-HNQPF5QZ.js";import{toInstant as e,timeAgo as t}from"./chunk-OJI4ROSD.js";import{formatDateTime as o}from"./chunk-NHKT5IH6.js";import{useShellLocale as c}from"./chunk-NRHG4R2Q.js";import{jsx as i}from"react/jsx-runtime";function m({value:m,precise:n,locale:s,className:l}){const a=c(),p=e(m);if(!p)/* @__PURE__ */return i(r,{});const u="string"==typeof m?m:p.toISOString();/* @__PURE__ */
|
|
2
2
|
return i("time",{dateTime:u,title:o(u,{locale:s??a}),className:l,children:t(p,{precise:n,locale:s??a})})}export{m as TimeAgo};
|