efficient-shell 13.20.0 → 13.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -10
- package/dist/{Browser-XFEOOL5J.js → Browser-342OHRA2.js} +14 -14
- package/dist/Calculator-HJK5JN54.js +29 -0
- package/dist/CurrencyConverter-MPAZ6QJ3.js +21 -0
- package/dist/{Files-LRSNSZ5Y.js → Files-IPM7TRMJ.js} +74 -74
- package/dist/Notepad-R7MUSPRC.js +24 -0
- package/dist/{PdfViewer-EELX35ZI.js → PdfViewer-FWGHFO4N.js} +1 -1
- package/dist/{PomodoroTimer-XLPBKMWS.js → PomodoroTimer-VREYC3ML.js} +49 -49
- package/dist/{Preview-CWGCGKR5.js → Preview-X64AVAUP.js} +27 -27
- package/dist/Sidebar-MY66ILZY.js +44 -0
- package/dist/{Stock-PRUMXULJ.js → Stock-GQSNYWV2.js} +3 -3
- package/dist/{Weather-FO5DVYQ4.js → Weather-XNMLNV7N.js} +22 -22
- package/dist/{WorldClock-BYZ5BNLZ.js → WorldClock-AZLGM2T5.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-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-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-IUQJGFEO.js → chunk-5CHJA4RL.js} +8 -8
- 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-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-BT636U6W.js +92 -0
- 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-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-JGKUENPD.js → chunk-IM23VMBR.js} +1 -1
- package/dist/{chunk-5EC62E65.js → chunk-IM2PF6VQ.js} +2 -2
- package/dist/{chunk-BVX7LUAW.js → chunk-IMH5H47S.js} +3 -3
- 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-UC5IC3AM.js → chunk-JVENCUUG.js} +9 -9
- 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-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-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-ODOWFVUE.js +28 -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-ZVDYRXNP.js → chunk-P4VOUPRF.js} +6 -6
- package/dist/{chunk-J4CVYOY3.js → chunk-P6H2B635.js} +10 -10
- package/dist/{chunk-ENDYHUUR.js → chunk-P73ZJ6QR.js} +1 -1
- package/dist/{chunk-5HFKVEWW.js → chunk-PFOTEDSQ.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-XOCRRCCP.js → chunk-QNQNOTTS.js} +1 -1
- 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-SM3N5UJ2.js → chunk-TDUOBP55.js} +9 -9
- package/dist/{chunk-BG3C4ALM.js → chunk-TJ5YMXVB.js} +1 -1
- package/dist/{chunk-SHHRC5XK.js → chunk-TJG76Y7I.js} +9 -9
- 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-UUY66GLZ.js +1 -0
- package/dist/{chunk-WRV6QKJN.js → chunk-UVPDEGIA.js} +1 -1
- package/dist/{chunk-YE2YU526.js → chunk-VB3UHY2J.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/hooks/index.d.ts +2 -2
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/index.d.ts +24 -2
- package/dist/index.js +504 -504
- 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/tokens/colour.d.ts +2 -2
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-V5SACDGQ.js +0 -29
- package/dist/CurrencyConverter-B3NWE6LM.js +0 -21
- package/dist/Notepad-GGBFJNRE.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-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-IXJIHTUI.js +0 -91
- package/dist/chunk-JPE4TYRQ.js +0 -14
- package/dist/chunk-KGAYYSFE.js +0 -6
- package/dist/chunk-LQCNIQ3I.js +0 -8
- 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-VGUYAVDG.js +0 -1
- package/dist/chunk-XXTAMF3O.js +0 -28
package/dist/chunk-IXJIHTUI.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import{computeMaximizedBox as e,isSidebarStripReserved as t,boxFillsWorkArea as n,readAlwaysMaximizedFlag as r,WORK_AREA_CHANGED_EVENT as o,scrollerIsFluid as i,growBoxToWidth as a,widthToFit as s,navIcons as l}from"./chunk-4LXCCZDM.js";import{reportBoundaryError as c}from"./chunk-KNUR2UEG.js";import{isStaleChunkError as u}from"./chunk-JDCM2VHG.js";import{WindowInsetContext as d,NO_WINDOW_DRAG as h}from"./chunk-YI4T5I5D.js";import{Result as m}from"./chunk-M2TQOJ3G.js";import{CMD_Z as f,CMD_SHIFT_Z as p}from"./chunk-FBZUEZK7.js";import{CopyButton as w}from"./chunk-BG3C4ALM.js";import{confirm as y}from"./chunk-GMLOMLCS.js";import{useModalDragAside as g}from"./chunk-EIFNESXS.js";import{ItemCount as v}from"./chunk-SXHV5OLA.js";import{isInOverlayOver as b}from"./chunk-SF4IIV5Z.js";import{dialogA11y as x}from"./chunk-VWGWZY7A.js";import{ColoredBadge as k}from"./chunk-WRV6QKJN.js";import{ROW_HEIGHTS as E}from"./chunk-AW7TOB6N.js";import{LoadingSpinner as M}from"./chunk-4U5M37SF.js";import{activationOrder as C,activeListeners as S,ModalActionsContext as L,subscribeActive as N,getActiveModalId as z,KEY_ACTIVATED_SELECTOR as T}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{focusableIn as R}from"./chunk-DWGYC7OD.js";import{StatusBadge as O}from"./chunk-YDJ5IZOU.js";import{PopupMenu as $,PopupMenuItem as W,PopupMenuDivider as K,PopupMenuLabel as j}from"./chunk-THAPVKEJ.js";import{Button_default as F}from"./chunk-UTISUEO4.js";import{Icon as B}from"./chunk-ISVODSRP.js";import{LoadingSpinner as q}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as H}from"./chunk-62LW225J.js";import{shellHttp as U,isShellHttpConfigured as Y}from"./chunk-STKJA4PV.js";import{fitBoxScale as X,fitFrameStyle as V}from"./chunk-M6UKCZHT.js";import{runEscapeInterceptors as G}from"./chunk-TWVUQUUD.js";import{useShellStrings as J}from"./chunk-IUVGHHR3.js";import{createContext as _,createElement as Z,useContext as Q,Component as ee,useLayoutEffect as te,useRef as ne,useEffect as re,useState as oe,useSyncExternalStore as ie,useCallback as ae,isValidElement as se,Fragment as le,Children as ce,cloneElement as ue,useMemo as de,useId as he,useReducer as me,Suspense as fe}from"react";import{jsxs as pe,jsx as we,Fragment as ye}from"react/jsx-runtime";import{createPortal as ge}from"react-dom";import{useLocation as ve}from"react-router-dom";import{useQueryClient as be,useQuery as xe}from"@tanstack/react-query";function ke(e){return"component"in e}function Ee(e){return"endpoint"in e}var Me={};function Ce(e){Me=e}var Se=new Proxy({},{get:(e,t)=>Me[t],has:(e,t)=>t in Me,ownKeys:()=>Object.keys(Me),getOwnPropertyDescriptor(e,t){if(t in Me)return{configurable:!0,enumerable:!0,value:Me[t]}}});function Le(){return Y()}var Ne=U,ze=_({});function Te({value:e,children:t}){return Z(ze.Provider,{value:e},t)}function Ae(){return Q(ze)}var De=_(null);function Ie(){return Q(De)?.pageSearch??""}var Pe=null,Re=/* @__PURE__ */new Set;function Oe(e){Pe!==e&&(Pe=e,Re.forEach(e=>e()))}function $e(){return Pe}function We(e){return Re.add(e),()=>{Re.delete(e)}}var Ke=null;function je(e){Ke=e}function Fe({error:e,onReload:t}){const n=u(e);/* @__PURE__ */
|
|
2
|
-
return pe("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
|
|
3
|
-
/* @__PURE__ */we(B,{name:"warning",className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
|
|
4
|
-
/* @__PURE__ */pe("div",{className:"min-w-0",children:[
|
|
5
|
-
/* @__PURE__ */we("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__ */we("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__ */we("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 Be=class extends ee{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__ */we(Fe,{error:e,onReload:this.reset}):this.props.children}},qe=_(null),He="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function Ue({className:e="",auto:t=!1}){const n=Q(qe),r=J().undo,o=n?.claimOwnMount;if(te(()=>{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 pe("div",{className:`flex items-center gap-2 ${e}`,"data-undo-controls":t?"shell":"form",children:[
|
|
9
|
-
/* @__PURE__ */we("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",f):r.nothingToUndo,className:He,children:r.undo}),
|
|
10
|
-
/* @__PURE__ */we("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",p):r.nothingToRedo,className:He,children:r.redo})]})}var Ye=/* @__PURE__ */new Set([408,429]);function Xe(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function Ve(e){const t=Xe(e);return null!=t&&(t>=400&&t<500&&!Ye.has(t))}function Ge(e,t){return!Ve(t)&&e<3}function Je(e){if("page"!==e.type)return!0;const t=e.route?Se[e.route]:void 0;if(!t||!ke(t))return!0;const n=t;return!n.widget&&!n.utility}function _e(e){const t=e.route?Se[e.route]:void 0;if(!t||!ke(t))return;const n=t;return n.taskbarGroup?n.taskbarGroup:{key:e.route,label:n.label,icon:e.route}}var Ze=(e,t)=>!!t&&"page"===e.type&&e.route===t;var Qe="flex-1 min-h-0";function et(){const e=J().record;/* @__PURE__ */
|
|
11
|
-
return we(q,{label:e.loading,padding:"",className:Qe})}function tt(e){return e??void 0}function nt({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:o}){const i=J().record;if(t||e&&n)/* @__PURE__ */return we(et,{});if(r){const e=Xe(r);if(401===e)/* @__PURE__ */
|
|
12
|
-
return we(m,{status:"warning",title:i.signInRequired,subTitle:i.signInBody,className:Qe});if(403===e)/* @__PURE__ */
|
|
13
|
-
return we(m,{status:"403",className:Qe});if(404===e||410===e)/* @__PURE__ */
|
|
14
|
-
return we(m,{status:"404",title:i.notFound,className:Qe});const t=null==e||408===e||429===e||e>=500;/* @__PURE__ */
|
|
15
|
-
return we(m,{status:"500",title:i.loadFailed,subTitle:t?i.checkConnection:i.rejected,extra:t?/* @__PURE__ */we(F,{variant:"secondary",size:"sm",onClick:o,children:i.retry}):void 0,className:Qe})}/* @__PURE__ */
|
|
16
|
-
return we(m,{status:"404",title:i.notFound,className:Qe})}function rt({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */we(ye,{children:t(e)}):/* @__PURE__ */we(nt,{...n})}var ot=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function it(e){return"string"==typeof e&&(e.startsWith("new-")||ot.test(e))}function at(e){if(it(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var st=_({openWindows:[],openEntity:()=>{},openPage:()=>{},reorderWindows:()=>{},closeEntity:()=>{},minimize:()=>{},items:[],restore:()=>{},remove:()=>{},restoreIfMinimized:()=>!1,openItems:[]}),lt=_(null);function ct(e){const t=Q(lt),n=ne(null);null===n.current&&(n.current=/* @__PURE__ */Symbol("window-dirty")),te(()=>{if(t)return t(n.current,e)},[t,e]),re(()=>{if(!t||!e)return;const n=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t,e])}function ut(){const e=ne(/* @__PURE__ */new Map),[t,n]=oe(!1);return{dirty:t,registerDirty:ae((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 dt(){return Q(st)}function ht(e){if("page"!==e.type&&at(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 mt({item:e,onClose:t,accentRgb:n}){const{dirty:r,registerDirty:o}=ut(),i=Se[e.route];if(!i||!ke(i))return null;const a=i,s=a.component;/* @__PURE__ */
|
|
17
|
-
return we(io,{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__ */we(lt.Provider,{value:o,children:/* @__PURE__ */we(fe,{fallback:/* @__PURE__ */we("div",{className:"flex items-center justify-center py-12",children:/* @__PURE__ */we(M,{})}),children:/* @__PURE__ */we(s,{})})})})}function ft({entityType:e,entityId:t,label:n}){const r=J(),o=be(),{data:i}=xe({queryKey:["my-profile-sidebar"],enabled:Le(),queryFn:()=>Ne.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 we("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];Ne.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__ */we(B,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var pt=/* @__PURE__ */new Set,wt=()=>"hidden";function yt({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=Se[e.entityType];if(!o||!Ee(o))return null;const i=o,[a,s]=oe(!1),{dirty:c,registerDirty:u}=ut(),d=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=it(e.entityId),f=Ae(),p=(w=e.id,ie(N,()=>{const e=Xn.get(w);return null!=e&&Fn.has(e)}));var w;const y=!i.selfFetching&&!h&&!m&&Le(),g=xe({queryKey:[d,e.entityId],queryFn:()=>{return Ne.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:tt(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(Ve(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:Ge}),v=g.data,b=g.refetch;re(()=>{var t;if(y)return t=t=>{t!==e.id||pt.has(t)||b({cancelRefetch:!1})},lr.add(t),()=>{lr.delete(t)}},[b,e.id,y]);const x=ae(()=>{a&&!c?s(!1):t()},[a,c,t]),k=(i.useEdit??wt)(v??null),E=!i.useEdit||m||h?void 0:{state:k,editing:a,onEdit:()=>s(!0),onDiscard:()=>s(!1)},C=i.selfFetching?e.label:v?i.title(v,a,s):e.label,S=i.icon,L=S?l[S]:null,z=C,T=!i.selfFetching&&v&&i.footer&&!h?i.footer(v):void 0;return i.rendersOwnModal?i.selfFetching?/* @__PURE__ */we(fe,{fallback:/* @__PURE__ */we(M,{}),children:i.render(v??e.entitySnapshot,t,e.entityId,a,s)}):null!=v?/* @__PURE__ */we(fe,{fallback:/* @__PURE__ */we(io,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */we(et,{})}),children:i.render(v,t,e.entityId,a,s)}):/* @__PURE__ */we(io,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */we(nt,{isPending:g.isPending,isFetching:g.isFetching,enabled:y,error:g.error,onRetry:b})}):/* @__PURE__ */we(io,{open:!0,onClose:x,onMinimize:n,initialBox:e.savedBox,icon:L,title:z,footer:T,copyText:e.label,windowKey:e.id,openedFromKey:e.openedFrom,size:i.size||"2xl",dirty:c,editing:a||m||h,edit:E,dimensions:i.dimensions,autoHeight:i.autoHeight,autoMinHeight:i.autoMinHeight,autoWidth:i.autoWidth,appStyle:i.appStyle,flushBody:i.flushBody,accentRgb:r,children:/* @__PURE__ */we(lt.Provider,{value:u,children:/* @__PURE__ */we(fe,{fallback:/* @__PURE__ */we(et,{}),children:i.selfFetching?i.render(null,t,e.entityId,a,s):/* @__PURE__ */we(rt,{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 gt(e){return document.querySelector(`[data-modal-panel][data-window-key="${e}"]`)}function vt(e){return document.querySelector(`[data-modal-panel][data-window-root][data-window-owner="${e}"]`)}function bt(e){const t=gt(e),n=t??vt(e);if(!n)return;if(t&&!Er(t))return r=e,void window.dispatchEvent(new CustomEvent("modal-reveal",{detail:{windowKey:r}}));var r;const o=n.getAttribute("data-modal-id");o&&cr(o)}function xt(){const e=z();if(!e)return;const t=document.querySelector(`[data-modal-panel][data-modal-id="${e}"]`);return t?.getAttribute("data-window-key")??void 0}var kt=/* @__PURE__ */new Map;function Et(){const e=xt();if(e)return kt.get(e)}function Mt(e){const t=document.querySelectorAll("[data-modal-panel]");for(const n of Array.from(t)){const t=n.querySelector("[data-window-title]");if(t?.textContent?.includes(e))return n}return null}var Ct="rosh-peek-style",St=H.peek,Lt=H.taskbarPreview;function Nt(e){"undefined"!=typeof document&&(!function(){if("undefined"==typeof document||document.getElementById(Ct))return;const e=document.createElement("style");e.id=Ct,e.textContent=`body.rosh-peeking [data-modal-panel]{transition:opacity .18s ease}body.rosh-peeking [data-modal-panel]:not([data-peek-focus]){opacity:.4}body.rosh-peeking [data-modal-panel][data-peek-focus]{opacity:1}body.rosh-peeking [data-modal-panel][data-peek-focus]:not([data-pinned-top]){z-index:${St}!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 zt(){"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 Tt({id:e,label:t,maxW:n,maxH:r,titleAbove:o=!1,onClick:i,onClose:a}){const s=J(),l=ne(null),[c,u]=oe({w:n,h:Math.round(.75*r)}),[d,h]=oe(!1);return te(()=>{const o=l.current;if(!o)return;const i=gt(e)??Mt(t);if(!i)return void h(!1);const a=i.getBoundingClientRect();if(0===a.width||0===a.height)return void h(!1);const s=X({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}),h(!0);const m=i.cloneNode(!0);m.style.position="absolute",m.style.top="0",m.style.left="0",m.style.right="auto",m.style.bottom="auto",m.style.width=a.width+"px",m.style.height=a.height+"px";const f=V(a.width,s);return Object.assign(m.style,{transform:f.transform??"",transformOrigin:f.transformOrigin}),m.style.pointerEvents="none",m.style.animation="none",m.style.zIndex="auto",m.removeAttribute("data-modal-panel"),m.removeAttribute("data-modal-id"),m.removeAttribute("data-window-key"),m.removeAttribute("role"),m.removeAttribute("aria-labelledby"),m.removeAttribute("aria-label"),m.querySelectorAll('[role="dialog"], [data-portal]').forEach(e=>{e.style.display="none"}),o.innerHTML="",o.appendChild(m),()=>{o.innerHTML=""}},[e,t,n,r]),/* @__PURE__ */pe("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__ */we("div",{ref:l,className:"absolute inset-0 z-0 overflow-hidden"}),!d&&/* @__PURE__ */pe("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-gray-400 bg-gray-50",children:[
|
|
20
|
-
/* @__PURE__ */we(B,{name:"window",className:"h-6 w-6",strokeWidth:1.5}),
|
|
21
|
-
/* @__PURE__ */we("span",{className:"mt-1 text-3xs uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */we("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__ */we("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__ */we(B,{name:"close",className:"h-3 w-3",strokeWidth:3})})]})}function At({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=J(),s=e.length>1,l=ne(null),[c,u]=oe({left:-9999,top:-9999,ready:!1}),[d,h]=oe(()=>"undefined"!=typeof document&&getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom");te(()=>{const e=l.current;if(!e)return;const n=()=>{const n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";h(o);let i,a=n.left+n.width/2-r.width/2;"top"===o?i=n.bottom+8:"left"===o?(a=n.right+8,i=n.top+n.height/2-r.height/2):"right"===o?(a=n.left-r.width-8,i=n.top+n.height/2-r.height/2):i=n.top-r.height-8,a=Math.max(8,Math.min(a,window.innerWidth-r.width-8)),i=Math.max(8,Math.min(i,window.innerHeight-r.height-8)),u({left:a,top:i,ready:!0})};n();const r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t,e.length]),re(()=>zt,[]);const m="top"===d,f=(m?"mt-1":"mb-1")+" max-w-[240px] truncate text-2xs font-medium text-ink-strongest bg-white/80 px-2 py-0.5 rounded shadow-sm ring-2 ring-transparent transition group-hover:ring-blue-400";return ge(
|
|
22
|
-
/* @__PURE__ */we("div",{ref:l,"data-taskbar-preview":"",style:{position:"fixed",left:c.left,top:c.top,zIndex:Lt,maxWidth:"calc(100vw - 16px)",opacity:c.ready?1:0},className:s?"flex gap-2 flex-wrap":"",onMouseEnter:o,onMouseLeave:()=>{zt(),i()},children:e.map(e=>{const t=gt(e.id)??Mt(e.label),o=t?function(e){if(Er(e))return null;const t=e.getBoundingClientRect(),n=fr(),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 pe("div",{className:"group flex flex-col items-center",onMouseEnter:()=>Nt(t),children:[!m&&/* @__PURE__ */we("span",{className:f,children:e.label}),
|
|
24
|
-
/* @__PURE__ */we(Tt,{id:e.id,label:e.label,maxW:240,maxH:160,titleAbove:!0,onClick:()=>n(e.id),onClose:()=>r(e.id)}),m&&/* @__PURE__ */we("span",{className:f,children:e.label}),null!==o&&/* @__PURE__ */pe("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__ */we(B,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function Dt(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 It({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=J(),[a,s]=oe(null);re(()=>{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=ie(N,z),[,u]=oe(0);re(()=>{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]=oe(0);re(()=>{const e=()=>d(e=>e+1);return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[]);const h=e=>{const t=Mt(e),n=t?.querySelector("[data-window-title]");return n?.textContent?.trim()||e},[m,f]=oe(null),[p,w]=oe(null),[y,g]=oe(null),b=ne(null),x=()=>{b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{f(null),w(null)},150)},k=e.filter(e=>!e.route||!Se[e.route]?.utility);if(!a||!a.isConnected||0===k.length)return null;const E=[],M=/* @__PURE__ */new Map;for(const e of k){const t=e.route?Se[e.route]:void 0,n=t?.taskbarGroup,r=n?.key??e.route??`entity:${e.id}`,o=M.get(r);if(void 0!==o)E[o].items.push(e);else{M.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 ge(
|
|
26
|
-
/* @__PURE__ */pe(ye,{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=gt(e.id)??Mt(e.label);return!!t&&!Er(t)});/* @__PURE__ */
|
|
27
|
-
return pe("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&&se(n)?ue(n,{className:"h-3.5 w-3.5 shrink-0"}):/* @__PURE__ */we(B,{name:"expand",className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),
|
|
28
|
-
/* @__PURE__ */we("span",{className:"truncate flex-1",children:s?e.label:h(r.label)}),u&&/* @__PURE__ */we("span",{title:i.taskbar.offscreenDot,className:"shrink-0 h-1.5 w-1.5 rounded-full bg-amber-500"}),s&&/* @__PURE__ */we(v,{count:e.items.length,label:i.count.windows(e.items.length)}),!s&&/* @__PURE__ */we("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__ */we(B,{name:"close",className:"h-3 w-3",strokeWidth:2})})]},e.key)}),
|
|
29
|
-
/* @__PURE__ */we("div",{className:"flex-1"}),k.length>=2&&/* @__PURE__ */pe("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__ */we(B,{name:"grid",className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),y&&/* @__PURE__ */pe($,{portal:!0,minWidth:200,style:Dt(y.x,y.y),onClose:()=>g(null),children:[
|
|
31
|
-
/* @__PURE__ */we(j,{children:y.label}),
|
|
32
|
-
/* @__PURE__ */pe(W,{onClick:()=>{g(null),y.items.forEach(e=>function(e){const t=Xn.get(e);t&&ur(t)}(e.id))},children:[
|
|
33
|
-
/* @__PURE__ */we(B,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),i.taskbar.minimizeAllWindows]}),
|
|
34
|
-
/* @__PURE__ */pe(W,{onClick:()=>{g(null),y.items.forEach(e=>o(e.id))},children:[
|
|
35
|
-
/* @__PURE__ */we("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */we("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__ */we(K,{}),
|
|
37
|
-
/* @__PURE__ */pe(W,{danger:!0,onClick:()=>{g(null),y.items.forEach(e=>t(e.id))},children:[
|
|
38
|
-
/* @__PURE__ */we(B,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${y.items.length})`]})]}),m&&p&&/* @__PURE__ */we(At,{items:m,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 Pt=["/login","/forgot-password","/reset-password","/force-change-password"];function Rt({children:e,windowAccentForRoute:t}){const n=ve(),r=Pt.some(e=>n.pathname.startsWith(e)),[o,i]=oe([]),a=ne(o);te(()=>{a.current=o},[o]);const s=ie(We,$e,$e),l=ne(/* @__PURE__ */new Map),c=e=>{const t=Je(e),n=!!s&&"page"===e.type&&e.route===s,r=e.pageSearch||void 0,o=l.current.get(e.id);if(o&&o.tab===t&&o.home===n&&o.pageSearch===r)return o;const i={key:e.id,tab:t,home:n,...r?{pageSearch:r}:{}};return l.current.set(e.id,i),i};re(()=>{kt.clear();for(const e of o)e.route&&kt.set(e.id,e.route)},[o]);const u=ae(e=>{i(t=>t.filter(t=>t.id!==e))},[]),d=ae(e=>{var t;gt(e)||vt(e)?(t=e,window.dispatchEvent(new CustomEvent($r,{detail:{windowKey:t}}))):u(e)},[u]),h=(e,t=!1)=>{const n=Bn;t&&pt.add(e),setTimeout(()=>{const r=document.querySelector(`[data-modal-panel][data-window-key="${e}"]`),o=r?.getAttribute("data-modal-id");var i,a;!o||(i=o,a=n,(qn.get(i)??-1)>a)||cr(o),t&&pt.delete(e)},50)},m=(e,t,n)=>{const r=Ke;if(n||!r)return[...e,t];const o=function(e,t,n){if(!Je(t))return e.length;if(t.shellOwned&&Ze(t,n.home))return 0;const r=Ze(t,n.home)?void 0:_e(t)?.key;if(r){let t=-1;if(e.forEach((e,o)=>{Je(e)&&!Ze(e,n.home)&&_e(e)?.key===r&&(t=o)}),t>=0)return t+1}if("page"===t.type&&t.route&&!Ze(t,n.home)&&n.favorites.includes(t.route))return e.length>0&&Ze(e[0],n.home)?1:0;const o=t.openedFrom?e.findIndex(e=>e.id===t.openedFrom):-1;if(o>=0){const t=/* @__PURE__ */new Set([e[o].id]);let r=o+1;for(;r<e.length&&e[r].openedFrom&&t.has(e[r].openedFrom);)t.add(e[r].id),r++;const i=t=>Je(e[t])&&!Ze(e[t],n.home)?_e(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:$e(),favorites:r.favorites});return[...e.slice(0,o),t,...e.slice(o)]},f=ae(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=ae((e,t,n,r,o,a={})=>{if(!Se[e]||!Ee(Se[e]))return;const s=`${e}:${t}`,l=xt();i(i=>{const c=i.find(n=>n.entityType===e&&String(n.entityId)===String(t));return c?(h(c.id),i):(h(s,!0),m(i,{id:s,type:"modal",label:r||t,route:o||window.location.pathname,entityType:e,entityId:t,entitySnapshot:tt(n),openedFrom:l},!!a.append))})},[]),w=ae((e,t={})=>{if(!Se[e]||!ke(Se[e]))return;const n=Se[e],{reuse:r=!1,background:o=!1,shellOwned:s,search:l,append:c=!1}=t,u=e=>{var t;o?(t=e,Zn.add(t)):h(e)};if(n.widget){const t=a.current.find(t=>"page"===t.type&&t.route===e);if(t)return void d(t.id)}const f=xt();i(t=>{if(n.multiInstance){const i=t.filter(t=>"page"===t.type&&t.route===e);if(s&&i.length>0)return t;if(r&&!l&&i.length>0)return o||h(i[i.length-1].id),t;const a=`page:${e}:${Math.random().toString(36).slice(2,8)}`;return u(a),m(t,{id:a,type:"page",label:n.label,route:e,openedFrom: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||h(i.id),l&&i.pageSearch!==l?t.map(e=>e===i?{...e,pageSearch:l}:e):t);const a=`page:${e}`;return u(a),m(t,{id:a,type:"page",label:n.label,route:e,openedFrom:f,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)})},[d]),y=ae(()=>{},[]),g=ae(()=>{},[]),v=d,b=d;/* @__PURE__ */
|
|
39
|
-
return pe(st.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__ */we(It,{openWindows:o,onRemove:d,onSplitView:ro,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&&cr(e)}})},onActivateById:bt}),
|
|
41
|
-
/* @__PURE__ */we(oo,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
return we(De.Provider,{value:c(e),children:/* @__PURE__ */we(Be,{fallback:(t,n)=>/* @__PURE__ */we(io,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */we(Fe,{error:t,onReload:n})}),children:/* @__PURE__ */we(hn,{spec:ht(e),children:/* @__PURE__ */we(mo,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */we(mt,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */we(yt,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var Ot=400;function $t({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=ne(null),s=ne(!1);n&&!s.current&&(a.current="undefined"==typeof document?null:document.activeElement),s.current=n;const l=ne(!1),c=ne(void 0),u=ne(i),d=u.current&&!i;u.current=i;const h=()=>{l.current=!0,clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},Ot)};re(()=>{n&&!r&&h()},[n,r]),re(()=>{d&&n&&!r&&h()},[d]),re(()=>()=>clearTimeout(c.current),[]),re(()=>{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?R(t.current)[0]:void 0;s?s.focus():(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus())},[n,r,o,i,e,t]),te(()=>{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 Wt=null,Kt=/* @__PURE__ */new Set;function jt(){return Wt}function Ft(e){if(Wt!==e){Wt=e;for(const e of Kt)e()}}function Bt(e){return Kt.add(e),()=>{Kt.delete(e)}}var qt=!1,Ht={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},Ut=()=>{};function Yt(e){qt=e,Ht={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function Xt(e,t){qt&&("submenu"===e?Ht.submenus++:Ht.menus++,Ht.menuKey=t)}function Vt(e){if(!qt)return Ut;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!qt)return;const r=performance.now()-t;"move"===e?Ht.moveMs+=r:Ht.resizeMs+=r}}function Gt(){const e=Ht;return Ht={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var Jt=/* @__PURE__ */new Set([O,k]),_t=e=>Jt.has(e)||"function"==typeof e&&"badge"===e.titleRole,Zt=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),Qt=/* @__PURE__ */new Set(["svg"]);function en(e){const t=[],n={text:"",accessories:[],badges:[],actions:[]};return tn(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function tn(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=>tn(e,t,n));if(!se(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===le)return void ce.toArray(r.props.children).forEach(e=>tn(e,t,n));if("string"==typeof r.type){if(Qt.has(r.type))return;if(!Zt.has(r.type))return n.push(" "),ce.toArray(r.props.children).forEach(e=>tn(e,t,n)),void n.push(" ")}const o=ue(r,{key:`title-part-${t.accessories.length}`});t.accessories.push(o),(_t(r.type)?t.badges:t.actions).push(o)}var nn=/* @__PURE__ */new Map,rn=/* @__PURE__ */new Set,on=0;function an(){on++,rn.forEach(e=>e())}function sn(e){return nn.get(e)}function ln(e){return rn.add(e),()=>{rn.delete(e)}}function cn(){return on}var un=_(""),dn=_(null);function hn({spec:e,children:t}){/* @__PURE__ */
|
|
44
|
-
return we(dn.Provider,{value:e,children:t})}var mn=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),fn='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600';function pn(e){return wn(e).replace(/\s+/g," ").trim()}function wn(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(wn).join("");if(se(e)){const t=e,n="string"==typeof t.type?t.type:"";return mn.has(n)?"":` ${wn(t.props?.children)} `}return""}function yn(e){const t=Q(un);re(()=>{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 gn={};function vn(e,t,n){const r=Q(un);re(()=>{if(!r)return;gn[r]||(gn[r]=[]);const o={label:e,icon:n,onClick:t};return gn[r].push(o),()=>{gn[r]=(gn[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function bn({title:e}){const t=ne(null);return re(()=>{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__ */we("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function xn(e){}function kn(){return Q(un)}function En({children:e,position:t="right",quiet:n=!1}){const r=Q(L),[o,i]=oe(null);return re(()=>{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?ge(e,o):null}function Mn({onClick:e,children:t,className:n}){const r=Q(L);/* @__PURE__ */
|
|
45
|
-
return we("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 Cn="erp_window_positions",Sn={};try{const e=localStorage.getItem(Cn);e&&(Sn=JSON.parse(e))}catch{}var Ln=null;function Nn(){Ln&&clearTimeout(Ln),Ln=setTimeout(()=>{try{localStorage.setItem(Cn,JSON.stringify(Sn))}catch{}},500)}var zn="erp_activation_order",Tn=[];try{const e=localStorage.getItem(zn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(Tn=t)}catch{}var An=null;function Dn(){An&&clearTimeout(An),An=setTimeout(()=>{try{localStorage.setItem(zn,JSON.stringify(Tn))}catch{}},500)}function In(e,t){Sn[e]||(Sn[e]=t,Nn())}function Pn(e){return Sn[e]?{...Sn[e]}:null}function Rn(e,t){Sn[e]=t,Nn()}function On(){const r=e(),o=t();let i=!1;for(const e of Object.keys(Sn))n(Sn[e],r,o)&&(delete Sn[e],i=!0);i&&Nn()}var $n={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},Wn=4e3,Kn=()=>{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"},jn={small:.8,medium:1,large:1.25,maximized:1.25},Fn=/* @__PURE__ */new Set,Bn=0,qn=/* @__PURE__ */new Map;var Hn=0;function Un(){return Hn}function Yn(){Hn++,S.forEach(e=>e())}var Xn=/* @__PURE__ */new Map,Vn=/* @__PURE__ */new Map,Gn=/* @__PURE__ */new Map;function Jn(){for(let e=C.length-1;e>=0;e--){const t=Gn.get(C[e]);if(t?.tab)return t.owner}return null}function _n(){return ie(N,Jn,()=>null)}var Zn=/* @__PURE__ */new Set;var Qn=null;function er(e){Qn=null,cr(e)}function tr(e){Qn=e;const t=Xn.get(e);t&&er(t)}var nr=/* @__PURE__ */new Map;function rr(e){return nr.get(e)?.holdsChanges()??!1}function or(e){const t=nr.get(e);return t?t.ask():Promise.resolve(!0)}function ir(e){Qn===e&&(Qn=null)}function ar(e,t,n){if(n&&Gn.set(e,n),t)if(Xn.set(t,e),Vn.set(e,t),Zn.delete(t)){C.unshift(e);const n=Tn.indexOf(t);-1!==n&&Tn.splice(n,1),Tn.unshift(t),Dn()}else!function(e,t){const n=Tn.indexOf(t);if(-1===n)return void C.push(e);let r=C.length;for(let e=0;e<C.length;e++){const t=Vn.get(C[e]);if(t&&Tn.indexOf(t)>n){r=e;break}}C.splice(r,0,e)}(e,t),-1===Tn.indexOf(t)&&(Tn.push(t),Dn());else C.push(e);Yn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&Qn===t&&er(e)}function sr(e){return e?Gn.get(e)?.owner??Vn.get(e)??null:null}var lr=/* @__PURE__ */new Set;function cr(e){const t=sr(z()),n=C.indexOf(e);-1!==n&&C.splice(n,1),C.push(e);const r=Gn.get(e);if(r?.root)for(const[e,t]of Gn){if(t.root||t.owner!==r.owner||Fn.has(e))continue;const n=C.indexOf(e);-1!==n&&C.splice(n,1),C.push(e)}Fn.delete(e);const o=Vn.get(e);if(o){const e=Tn.indexOf(o);-1!==e&&Tn.splice(e,1),Tn.push(o),Dn(),Qn&&Qn!==o&&(Qn=null)}Yn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const i=sr(z());i&&i!==t&&lr.forEach(e=>e(i))}function ur(e){const t=C.indexOf(e);-1!==t&&C.splice(t,1),Fn.add(e),qn.set(e,++Bn);const n=Vn.get(e);if(n){const e=Tn.indexOf(n);-1!==e&&(Tn.splice(e,1),Dn())}Yn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var dr=/* @__PURE__ */new Set;var hr=8,mr=32;function fr(){return e()}var pr="flex size-6 shrink-0 items-center justify-center rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",wr="flex size-3 items-center justify-center rounded-full text-gray-900/70",yr="size-2 opacity-0 group-hover/controls:opacity-100 group-focus-within/controls:opacity-100",gr=E.windowBar,vr=80,br=384,xr=400;function kr(e,t=fr()){const n=Math.min(Math.max(e.x,t.x+vr-e.w),t.x+t.w-vr),r=Math.min(Math.max(e.y,t.y),t.y+t.h-gr);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function Er(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=fr();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 Mr(e){const t=fr(),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 Cr=null;function Sr(e){const t=(Cr||((Cr=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none",`z-index: ${H.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(Cr)),Cr);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 Lr(){Cr&&(Cr.style.opacity="0",Cr.style.display="none")}var Nr=[{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"}],zr=350,Tr=200;function Ar({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o,children:i}){const[a,s]=oe(!1),l=ne(void 0),c=ne(void 0);re(()=>()=>{clearTimeout(l.current),clearTimeout(c.current)},[]);const u=()=>{clearTimeout(c.current),l.current=setTimeout(()=>s(!0),zr)},d=()=>{clearTimeout(l.current),c.current=setTimeout(()=>s(!1),Tr)};/* @__PURE__ */
|
|
46
|
-
return pe("span",{className:"relative inline-flex",onMouseEnter:u,onMouseLeave:d,children:[
|
|
47
|
-
/* @__PURE__ */we("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__ */we("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:Nr.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */we("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__ */we("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var Dr="rosh-gesture-style";var Ir={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},Pr=4;function Rr(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(Dr))return;const e=document.createElement("style");e.id=Dr,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=Vt(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function Or(e){const t=C.indexOf(e);if(-1===t)return-1;const n=H.window+t*H.windowStep,r=Gn.get(e);if(!r||r.root)return n;let o=-1;for(const[e,t]of Gn){if(!t.root||t.owner!==r.owner)continue;const n=C.indexOf(e);-1!==n&&(o=Math.max(o,H.window+n*H.windowStep))}return o>=n?o+2+Math.min(t,7):n}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=C.length-1;e>=0;e--)dr.has(C[e])||C.splice(e,1);Tn=Tn.filter(e=>{const t=Xn.get(e);return null!=t&&dr.has(t)}),Dn(),Yn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var $r="modal-close-request";function Wr(e){ie(N,Un);const t=Q(L);if(C.length<=1)return!0;if(e){const t=Xn.get(e);if(null!=t)return z()===t}return t?.active??null!=z()}var Kr=!1,jr=/* @__PURE__ */new Set;function Fr(e){return jr.add(e),()=>jr.delete(e)}function Br(){return Kr}function qr(e){Kr!==e&&(Kr=e,jr.forEach(e=>e()))}function Hr(){qr(!Kr)}function Ur(){qr(!1)}var Yr=null,Xr=/* @__PURE__ */new Set;function Vr(e){return Xr.add(e),()=>Xr.delete(e)}function Gr(){return Yr}function Jr(e){Yr!==e&&(Yr=e,Xr.forEach(e=>e()))}var _r=null,Zr=/* @__PURE__ */new Set;function Qr(e){return Zr.add(e),()=>Zr.delete(e)}function eo(){return _r}function to(e){_r!==e&&(_r=e,Zr.forEach(e=>e()))}function no(){if(!_r)return void qr(!1);Jr(_r),to(null),qr(!1)}function ro(){qr(!Kr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function oo(){const e=ie(Fr,Br),[t,n]=oe(e),[r,o]=oe(e);return re(()=>{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?ge(
|
|
48
|
-
/* @__PURE__ */we("div",{onMouseDown:e=>{e.stopPropagation(),qr(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:H.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 io({open:t,onClose:l,title:c,icon:u,copyText:m,size:f="lg",dirty:p=!1,onNext:w,onPrev:v,footer:k,bodyScroll:M,onMinimize:S,initialBox:A,actions:R,actionsLeft:O,editing:j=!1,edit:q,allowPinOnTop:U,initialPosition:Y,widget:V,compact:_,appStyle:Z,flushBody:ee,autoHeight:se,autoMinHeight:le,autoWidth:ce,widgetMenu:ue,dimensions:me,windowKey:fe,openedFromKey:ve,accentRgb:be,children:xe}){const[ke,Ee]=oe(()=>r()),Me=D()&&!ke,Ce=I()&&!!V,[Se,Le]=oe(0),[Ne,ze]=oe(!1),Te=ne(null),Ae=ne(0);re(()=>{Ae.current=Se},[Se]);const Ie=ae(e=>{Me&&(Te.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},ze(!0),Ft(ve??null))},[Me,ve]),Pe=ie(Bt,jt);re(()=>{if(!Ne)return;const e=e=>{if(!Te.current)return;const t=e.clientX-Te.current.startX;if(Math.abs(e.clientY-Te.current.startY)>Math.abs(t)+12)return Te.current=null,ze(!1),Le(0),void Ft(null);Le(Math.max(0,t))},t=()=>{if(!Te.current)return;const e=.3*window.innerWidth,t=Ae.current>e;Te.current=null,ze(!1),t?(Le(window.innerWidth),setTimeout(()=>{l(),Le(0),Ft(null)},180)):(Le(0),Ft(null))};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[Ne]);const[Re,Oe]=oe(c),$e=J(),We=$e.window;re(()=>{Oe(c)},[c]);const Ke=de(()=>pn(Re).trim()||void 0,[Re]),je=he(),[Fe,He]=oe(!1),Ye=ne(!1),[Xe,Ve]=oe(!1),[Ge,Je]=oe(null),_e=Q(dn),Ze=Q(De),{prefs:Qe,save:et}=P(),tt=!!Qe.window_accent_stripe,nt=Qe.favorite_documents||[],rt=!!_e&&nt.some(e=>e.entityType===_e.entityType&&e.entityId===_e.entityId),ot=ae(()=>{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]=oe(null),[st,lt]=oe("top-right"===Y?"right":"left"),ut=ne(!1),ht=ne(null);te(()=>{const e=ht.current;e&&(be?e.style.setProperty("--window-accent-rgb",be):e.style.removeProperty("--window-accent-rgb"))},[be]);const mt=ne(!1),ft=ne(null),pt=ne(null),wt=ne(null),[yt,gt]=oe(!1),vt=ne(null),bt=ne(null),xt=ne(null),[kt,Et]=oe(!1);te(()=>{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 Mt=!!q&&!V&&!_&&!Z&&(q.editing||"hidden"!==q.state),Ct=!!(k||R||O)||yt||Mt,St=Q(qe),Lt=""!==Q(un),Nt=ne(null);Nt.current=Ze?{owner:Ze.key,tab:Ze.tab,root:!Lt}:null;const zt=fe||(Ze&&!Lt?Ze.key:null),Tt=!!St&&!Lt&&St.enabled&&St.hasState&&(j||St.declaredEditable)&&!St.handMounted&&Ct&&!V&&!_&&!Z&&!Me,At=40,{minimize:Dt,items:It,restoreIfMinimized:Pt,openWindows:Rt}=dt(),Ot=ne(`modal-${Math.random().toString(36).slice(2,8)}`).current,Wt=g(Ot);re(()=>{if(V)return dr.add(Ot),()=>{dr.delete(Ot)}},[V,Ot]),re(()=>{const e=e=>{const t=e.detail;t?.id===Ot&&Oe(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[Ot]);const[Kt,qt]=oe(H.window),Ht=function(e){const t=ie(N,z);return C.length<=1||t===e}(Ot),Ut=ne(q);Ut.current=q;const Yt=!!q&&!q.editing&&"enabled"===q.state;re(()=>{if(!t||!Ht||!Yt)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(b(e.target,ht.current)||(e.preventDefault(),e.stopPropagation(),Ut.current?.onEdit()))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Ht,Yt]);const Xt=function(e){return ie(N,()=>Fn.has(e))}(Ot);$t({panelRef:ht,bodyRef:ft,open:t,widget:!!V,active:Ht,minimized:Xt});const Vt=ie(Fr,Br),Gt=ie(Vr,Gr),Jt=ie(Qr,eo),_t=!U&&!V,Zt=Vt&&_t,[Qt,tn]=oe(!1),rn=Zt&&Jt===Ot,[on,sn]=oe(!1),ln=on&&_t&&Gt===Ot?"picked":null,cn=ne(Zt);re(()=>{if(cn.current&&!Zt){sn(!0);const e=setTimeout(()=>{sn(!1),Yr===Ot&&Jr(null)},700);return cn.current=Zt,()=>clearTimeout(e)}cn.current=Zt},[Zt,Ot]),re(()=>{Zt||tn(!1)},[Zt]),re(()=>{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]),re(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&ht.current){const t=ht.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 hn=ne(!1),mn=ae(e,[]),wn=ae(()=>{const t=e(),n=me?me[0]:$n[f]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=jn[Kn()],l=me?Math.min(me[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*(C.length-1),u=Math.max(At,(i-l)/2),d=(o-a)/2,h=t.h-At-l-u;return"top-right"===Y?{x:t.x+t.w-a-At,y:t.y+At,w:a,h:l}:"top-left"===Y?{x:t.x+At,y:t.y+At,w:a,h:l}:{x:t.x+Math.max(At,(o-a)/2+At)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,h)),w:a,h:l}},[f]),yn=ne(!1);t||(yn.current=!1);const vn=fe||m||null;re(()=>{if(!t)return;ar(Ot,vn,Nt.current??void 0),fe||cr(Ot),hn.current=!1,qt(Or(Ot));const e=()=>{qt(Or(Ot))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===fe;if(!e.label)return!1;const t=ht.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(cr(Ot),An.current)return;const t=fr(),n=Math.min(Bn.current.w,t.w-40),o=Math.min(Bn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;kn({x:i,y:a,w:n,h:o}),On(!1)},i=e=>{const t=e.detail;r(t)&&(cr(Ot),Je({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==fe)return;cr(Ot);const t=Bn.current,n=function(e,t=fr()){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=ht.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)}kn(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=C.indexOf(e);-1!==t&&(C.splice(t,1),Yn()),Fn.delete(e),qn.delete(e),Gn.delete(e);const n=Vn.get(e);n&&(Vn.delete(e),Xn.delete(n))}(Ot),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,Ot,vn,mn]);const bn=!V&&"maximized"===Kn(),[xn,kn]=oe(()=>{if(vn&&Sn[vn]){const e={...Sn[vn]};return me&&(e.w=me[0],se||(e.h=me[1])),kr(e)}return A?{x:A.x,y:A.y,w:A.w,h:A.h}:bn?mn():wn()}),[En,Mn]=oe(()=>!se),Cn=ne(ke),Ln=ne(null);re(()=>{const e=()=>{const e=r();e!==Cn.current&&Ln.current?.(e),Cn.current=e,Ee(e),qt(Or(Ot))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[Ot]);const zn=ke&&!!Ze?.tab&&!Lt&&!V&&!Me,Tn=zn,An=ne(Tn);An.current=Tn;const Dn=_n(),In=ke&&!!Ze?.tab&&!V&&!Me&&!Vt&&Dn!==Ze.key,Pn=!!V&&ke&&!Vt&&null!==Dn,[Rn,On]=oe(()=>vn&&Sn[vn]||A?Tn:Tn||bn),Bn=ne(xn);Bn.current=xn;const Hn=ne(Rn);te(()=>{Hn.current=Rn},[Rn]),te(()=>{if(En||zn)return;const e=ht.current,t=ft.current;if(!e||!t)return;const n=le??(V?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const s=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&l.unobserve(a),l.observe(c),a=c);const u=e.offsetHeight-t.offsetHeight,d=t.style.flex,h=t.style.overflowY,m=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const f=t.offsetHeight,p=c.offsetHeight;t.style.flex=d,t.style.height=m,t.style.overflowY=h;const w=c.offsetHeight>p+4,y=Math.max(n,window.innerHeight-r-Math.max(0,Bn.current.y)-24),g=w?Math.min(Bn.current.h,y):Math.min(Math.max(n,u+f),y),v=Math.abs(g-o)>1;v&&(o=g,kn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),V||(g<=n?i&&(clearTimeout(i),i=null):(v||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&Mn(!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)}},[En,V,le,Ct,zn]),te(()=>{if(!se||!En||V||!t)return;const e=vt.current;if(!e)return;let n=e.offsetHeight;const r=new ResizeObserver(()=>{if(!e.isConnected)return;const t=so.current?0:e.offsetHeight,r=t-n,o=t>0!=n>0;if(n=t,!o||0===r||Rn)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=le??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,Bn.current.y)-24);kn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[se,En,V,t,Rn,le]);const Un=!1!==ce&&!V&&!Z&&!Me,[Jn,Zn]=oe(()=>!Un);te(()=>{if(Jn||!t)return;if(!Un||Rn)return void Zn(!0);const n=ht.current,r=ft.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let l=Bn.current.w,c=0;const u=()=>Zn(!0),d=()=>{c=0;const t=Bn.current;if(Math.abs(t.w-l)>1||document.body.classList.contains("rosh-gesturing"))return void u();const d=e(),h=d.w-80;if(t.w>=h)return void u();const m=[],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||(m.push(e),f.push(t))}if(!m.length)return;const p=Math.min(h,t.w+Math.max(...f)),w=p-t.w,y=n.style.width;n.style.width=`${p}px`;const g=m.map((e,t)=>({over:f[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{i(e,w)||o.add(m[t])});const v=a(t,s(t.w,w,g),d,At);v!==t&&(l=v.w,kn(v))};d();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(u,Wn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Jn,t,Un,Rn]);const Qn=ne(null),er=!(!Ze?.tab||Lt||V||Me);Ln.current=t=>{if(!er)return;if(t)return Qn.current||(Qn.current={box:{...Bn.current},maximized:Hn.current}),void(Hn.current=!0);const r=Qn.current;Qn.current=null;const o=e();if(r?.maximized)return Hn.current=!0,On(!0),void kn(o);const i=r?.box??(vn?Sn[vn]:void 0);if(Hn.current=!1,On(!1),i&&!n(i,o,!1)){const e={...i};me&&(e.w=me[0],se||(e.h=me[1])),kn(kr(e))}else kn(wn())},re(()=>{Tn&&(Hn.current=!0,On(!0),kn(mn()))},[Tn,mn]),re(()=>{if(V)return;const e=()=>{const e=vn?Sn[vn]:void 0;if(Hn.current=!1,On(!1),e){const t={...e};me&&(t.w=me[0],se||(t.h=me[1])),kn(kr(t))}else kn(wn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[V,wn,vn]),re(()=>{t&&vn&&!zn&&(Sn[vn]=xn,Nn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[xn,t,vn,zn]),re(()=>{if(!t)return;const e=()=>{Hn.current?kn(mn()):document.body.classList.contains("rosh-gesturing")||kn(kr)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Rn&&(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,Rn,mn]),re(()=>{if(t&&(He(!1),Ye.current=!1,ut.current=!1,Zn(!Un),!An.current)){if(vn&&Sn[vn]){const e=Sn[vn];return void kn(t=>kr({...e,...se?{h:t.h}:{},...Un?{x:t.x,w:t.w}:{}}))}A&&(kn({x:A.x,y:A.y,w:A.w,h:A.h}),On(A.maximized))}},[t]),re(()=>{if(!t||"auto"!==p)return;let e;const n=t=>{ht.current?.contains(t.target)&&!Ye.current&&(Ye.current=!0,e=setTimeout(()=>He(!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 tr="auto"===p?Fe:!0===p,rr=Ze&&!Lt?Ze.key:null,or=de(()=>en(Re),[Re]),ir=ne({shortcutSpec:_e,isOnDesktop:rt,toggleDesktopShortcut:ot,taskbarStrings:$e.taskbar});te(()=>{ir.current={shortcutSpec:_e,isOnDesktop:rt,toggleDesktopShortcut:ot,taskbarStrings:$e.taskbar}});const sr=ne(null);sr.current||(sr.current={open:(e,t)=>Je({x:e,y:t}),items:()=>{const e=ir.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of gn[Ot]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),re(()=>{if(t&&rr)return()=>{return e=rr,void(nn.delete(e)&&an());var e}},[t,rr]),ct(!(fe||!t)&&tr);const lr=ae(()=>tr||"auto"===p&&Ye.current,[tr,p]),gr=ae(async e=>{if(ut.current)return!1;if(!lr())return!0;ut.current=!0;const t=Ke,n="close"===e?"Are you sure you want to close?":"discard"===e?"Are you sure you want to stop editing?":"Are you sure you want to continue?",r=await 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 ut.current=!1,r},[lr,Ke]),vr=ae(()=>ut.current?Promise.resolve():lr()?gr("close").then(e=>{e&&l()}):(l(),Promise.resolve()),[lr,gr,l]),Er=ae(async()=>{await gr("discard")&&(Ye.current=!1,He(!1),Ut.current?.onDiscard())},[gr]),Cr=ae(async()=>{const e=await gr("switch");return e&&(Ye.current=!1,He(!1)),e},[gr]),Nr=ne(()=>!1);te(()=>{Nr.current=lr}),te(()=>{if(!t||!fe)return;const e={holdsChanges:()=>Nr.current(),ask:Cr};return nr.set(fe,e),()=>{nr.get(fe)===e&&nr.delete(fe)}},[t,fe,Cr]),te(()=>{if(!t||!zt)return;const e=e=>{e.detail?.windowKey===zt&&vr()};return window.addEventListener($r,e),()=>window.removeEventListener($r,e)},[t,zt,vr]);const zr=ne(null),Tr=ae(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Je(null),cr(Ot),An.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=ht.current,s=a?.getBoundingClientRect();let l,c,u,d;if(zr.current){const t=zr.current;zr.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:Bn.current.x,c=s?s.top:Bn.current.y,u=s?s.height:Bn.current.h,d=s?s.width:Bn.current.w;On(!1),kn(e=>({...e,x:l,y:c,w:d,h:u}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<Pr&&Math.abs(e.clientY-i)<Pr)return;r=Rr(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)`),Bn.current={...Bn.current,x:s,y:u},!V){const t=function(e,t){const n=fr(),r=e<=n.x+hr,o=e>=n.x+n.w-hr,i=t<=n.y+hr,a=t>=n.y+n.h-hr,s=e<=n.x+mr,l=e>=n.x+n.w-mr,c=t<=n.y+mr,u=t>=n.y+n.h-mr;return i&&s?"tl":i&&l?"tr":a&&s?"bl":a&&l?"br":c&&r?"tl":c&&o?"tr":u&&r?"bl":u&&o?"br":i?"top":r?"left":o?"right":null}(e.clientX,e.clientY);t!==h&&(h=t,t?Sr(Mr(t)):Lr())}},f=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",f),r?.(),Lr();const e=kr({...Bn.current});if(Bn.current=e,!V&&h){zr.current={x:l,y:c,w:d,h:u};const e=Mr(h);return a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.width=`${e.w}px`,a.style.height=`${e.h}px`,a.style.transform="",a.style.transition=""),void kn(e)}if(V){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=""),kn(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",f)},[]),Dr=ae((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=ht.current,l=s?.getBoundingClientRect(),c=l?l.left:Bn.current.x,u=l?l.top:Bn.current.y,d=l?l.width:Bn.current.w,h=l?l.height:Bn.current.h,m="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),kn({x:c,y:u,w:d,h:h}),Bn.current={x:c,y:u,w:d,h:h};let y=0,g=null;const v=()=>{if(y=0,!g)return;const e=g;g=null,Bn.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)<Pr&&Math.abs(e.clientY-a)<Pr)return;o=Rr(n,r,Ir[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(p&&(o=Math.max(br,d+e)),w&&(i=Math.max(xr,h+t)),m){const t=Math.max(br,d-e);n=c+d-t,o=t}if(f){const e=Math.max(xr,h-t);r=u+h-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(v))},x=()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),v(),o?.(),kn({...Bn.current})};window.addEventListener("pointermove",b),window.addEventListener("pointerup",x)},[]),Wr=ae(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(),cr(Ot),"Enter"===e.key)return void(Rn?(On(!1),kn(wn())):(On(!0),kn(mn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{zr.current||(zr.current={...Bn.current})};if(r<0)return e(),On(!0),void kn(mn());if(r>0){if(Rn)return On(!1),void kn(wn());if(zr.current){const e=kr(zr.current);return zr.current=null,Bn.current=e,void kn(e)}return void ur(Ot)}e(),On(!1);const t=Mr(n<0?"left":"right");return Bn.current=t,void kn(t)}if(Rn)return;const o=Bn.current,i=e.shiftKey?{...o,w:Math.max(br,o.w+24*n),h:Math.max(xr,o.h+24*r)}:kr({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Bn.current=i,kn(i)},[Ot,Rn,wn,mn]),Kr=ae(e=>{zr.current||(zr.current={...Bn.current}),On(!1);const t=Mr(e);Bn.current=t,kn(t),cr(Ot)},[Ot]),jr=!V&&!zn&&!Me,[Hr,Ur]=oe(0),Xr=jr&&!_&&!Z&&(!!R||!!O||yt||Mt||Tt),_r=jr&&Hr>0&&!Xr,Zr=ne(_r);Zr.current=_r;const to=!!_||!!Z,no=to?"h-(--row-height-compact-bar)":"h-(--row-height-window-bar)",ro=ae(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:(Ur(e=>e+1),()=>Ur(e=>Math.max(0,e-1)))},[]),oo=de(()=>jr?{compact:to,over:_r,claim:ro}:null,[jr,to,_r,ro]),[io,ao]=oe(0),so=ne(jr);so.current=jr,te(()=>{const e=vt.current;if(!e||!Xr)return void ao(0);const t=()=>ao(Math.ceil(e.offsetWidth));if(t(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[Xr]);const lo=ae(e=>{if(Zt)return;e.preventDefault(),e.stopPropagation();const t=0===e.clientX&&0===e.clientY,n=e.currentTarget.getBoundingClientRect();Je(t?{x:n.left,y:n.bottom+4}:{x:e.clientX,y:e.clientY})},[Zt]),co=!!be&&tt&&!V&&!Me,uo=Tn||Zt?{}:{tabIndex:0,role:"group","aria-label":Ke?`${Ke} — ${We.windowSuffix}`:We.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:Wr},ho=()=>{On(!0),kn(mn())},mo=ae(()=>{const e=ht.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(fn);t&&!t.disabled&&t.click()}},[]);re(()=>{if(!t)return;if(V)return;const e=e=>{if(C[C.length-1]===Ot&&!b(e.target,ht.current)&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),mo();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&ht.current?.contains(t)))return;if(t.closest(T))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,mo,Ot,V]),re(()=>{if(!t)return;const e=e=>{C[C.length-1]===Ot&&(b(e.target,ht.current)||((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:Ot}})),Ye.current=!1,He(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:Ot}})))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),re(()=>{if(!t)return;if(V)return;const e=e=>{if("Escape"===e.key&&C[C.length-1]===Ot){if(G(e))return e.preventDefault(),void e.stopPropagation();if(zn&&!j)return;e.preventDefault(),e.stopPropagation(),vr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,vr,Ot,V,zn,j]);const fo=t&&(void 0!==w||void 0!==v),[po]=oe(()=>{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=zn&&!Ze?.home&&or.actions.length>0;re(()=>{t&&rr&&function(e,t){const n=nn.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(nn.set(e,t),an())}(rr,{title:or.text||Ke,dirty:tr,copy:or.copy,actions:wo&&po?po:void 0,menu:sr.current??void 0})},[t,rr,Ke,tr,or.text,or.copy,wo,po]);const yo=ae(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(re(()=>{if(!t)return;const e=e=>{if(C[C.length-1]!==Ot)return;if(b(e.target,ht.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,Ot]),!t||yn.current)return null;const go=Zt?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=fr(),d=(u.w-20*(o+1))/o,h=(u.h-14*(i+1)-22*i)/i,m=c?(o-l)*(d+20)/2:0;return{x:u.x+20+s*(d+20)+m,y:u.y+14+a*(h+14+22),w:d,h:h}}(Ot):null,vo=Zt&&go?X({width:go.w,height:go.h},{width:xn.w,height:xn.h}):1,bo=(()=>{if(Zt&&go){const e=vo,t=xn.w*e,n=xn.h*e,r=go.x+(go.w-t)/2-xn.x,o=go.y+(go.h-n)/2-xn.y,i=Qt||rn;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:H.expose+(i?20:10),boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(on&&_t){const e="picked"===ln;return{transition:e?"transform 640ms cubic-bezier(0.34, 1.42, 0.64, 1), box-shadow 600ms":"transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms",...e?{zIndex:H.expose+30}:{}}}return null})(),xo=x({modal:!1,titleId:!V&&(zn?!Ze?.home:!Me)?je:void 0,label:or.text||Ke}),ko=/* @__PURE__ */pe("div",{children:[
|
|
49
|
-
/* @__PURE__ */pe("div",{ref:ht,"data-modal-panel":!0,"data-modal-id":Ot,"data-window-key":fe||void 0,...U?{"data-utility":""}:{},...Xe?{"data-pinned-top":""}:{},...V?{"data-widget":""}:{},...Ze?{"data-window-owner":Ze.key}:{},...Ze&&!Lt?{"data-window-root":""}:{},...zn?{"data-window-tab":""}:{},...xo,className:zn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(V?Ht?"shadow-xl":"shadow-lg":"border "+(Ht?"shadow-xl border-line":"shadow-lg border-line-strong")),onPointerDown:e=>{if(!Zr.current||Zt||0!==e.button)return;const t=e.target;if(t.closest("[data-modal-panel]")!==ht.current)return;if(t.closest("[data-window-chrome]"))return;const n=e.currentTarget.getBoundingClientRect(),r=n.height/(e.currentTarget.offsetHeight||n.height),o=(to?E.compactBar:E.windowBar)*r;e.clientY-n.top>o||t.closest(h)||Tr(e)},onContextMenu:e=>{const t=e.target;t.closest("[data-window-strip]")&&t.closest("[data-modal-panel]")===ht.current&&lo(e)},onMouseDownCapture:e=>{if(mt.current=!1,Zt){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),Jr(Ot),qr(!1),void cr(Ot)}if(!Ht&&!V&&!Xe&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===ht.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),mt.current=!0,Je(null),cr(Ot),window.addEventListener("mouseup",()=>{setTimeout(()=>{mt.current=!1},0)},{once:!0}))}},onClickCapture:e=>{mt.current&&(mt.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(Zt)return;Je(null);e.target.closest("[data-modal-panel]")===ht.current&&(e.target.closest("button, input, a, select, textarea")||cr(Ot))},style:Me?{zIndex:Kt+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${Se}px)`,transition:Ne?"none":"transform 180ms ease-out",...V?{display:"none"}:{},...Kt<0?{display:"none"}:{},...Ht||Xe||Pe&&fe===Pe?{}:{display:"none"},...Wt?{visibility:"hidden",pointerEvents:"none"}:{}}:{zIndex:Xe?H.pinnedWindow:Kt+1,width:xn.w,height:xn.h,top:xn.y,...V&&"right"===st?{right:window.innerWidth-xn.x-xn.w}:{left:xn.x},...Kt<0&&!Xe?{display:"none"}:{},...Ce?{display:"none"}:{},...In||Pn||Wt?{visibility:"hidden",pointerEvents:"none"}:{},...bo??{}},children:[Me&&!V&&/* @__PURE__ */we("div",{onPointerDown:Ie,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),
|
|
50
|
-
/* @__PURE__ */pe("div",{"data-window-surface":"",className:"flex min-h-0 flex-1 flex-col "+(jr?"backdrop-blur-sm":""),style:jr?{backgroundColor:Ht?"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:[V?null:zn?Ze?.home?null:/* @__PURE__ */pe(ye,{children:[
|
|
51
|
-
/* @__PURE__ */we("h2",{id:je,"data-window-title":!0,className:"sr-only",children:or.text||Ke}),wo&&po&&ge(
|
|
52
|
-
/* @__PURE__ */we(ye,{children:or.actions}),po),or.badges.length>0&&/* @__PURE__ */we("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:or.badges})]}):Me?null:
|
|
53
|
-
/* @__PURE__ */pe("div",{onPointerDown:Tr,onContextMenu:lo,"data-window-chrome":"",..._r?{"data-window-controls-over":""}:{},...uo,className:_r?`absolute left-0 z-10 flex ${no} 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 ${no} 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}:{paddingRight:Xr?io:void 0}},children:[!Zt&&/* @__PURE__ */pe("div",{"data-window-controls":"",className:"group/controls flex shrink-0 items-center",children:[
|
|
54
|
-
/* @__PURE__ */we("button",{type:"button",onClick:vr,"aria-label":We.close,title:We.close,className:pr,children:/* @__PURE__ */we("span",{"aria-hidden":"true",className:`${wr} ${Ht?"bg-red-500":"bg-gray-300 group-hover/controls:bg-red-500"}`,children:/* @__PURE__ */we(B,{name:"close",className:yr,strokeWidth:3})})}),!_&&/* @__PURE__ */we("button",{type:"button",onClick:()=>ur(Ot),"aria-label":We.minimize,title:We.minimize,className:pr,children:/* @__PURE__ */we("span",{"aria-hidden":"true",className:`${wr} ${Ht?"bg-amber-400":"bg-gray-300 group-hover/controls:bg-amber-400"}`,children:/* @__PURE__ */we("span",{className:"h-0.5 w-2 rounded-full bg-current opacity-0 group-hover/controls:opacity-100 group-focus-within/controls:opacity-100"})})}),!_&&/* @__PURE__ */we(Ar,{maximized:Rn,onToggleMax:()=>{Rn?(On(!1),kn(wn())):ho()},onSnap:Kr,buttonClassName:pr,strings:We,children:/* @__PURE__ */we("span",{"aria-hidden":"true",className:`${wr} ${Ht?"bg-green-500":"bg-gray-300 group-hover/controls:bg-green-500"}`,children:/* @__PURE__ */we(B,{name:Rn?"collapse":"expand",className:yr,strokeWidth:3})})}),U&&/* @__PURE__ */we("button",{type:"button",onClick:()=>Ve(e=>!e),"aria-label":Xe?We.unpin:We.pinOnTop,title:Xe?We.unpin:We.pinOnTop,className:"ml-1 p-0.5 rounded hover:bg-gray-200 "+(Xe?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */we(B,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:Xe?"currentColor":"none",strokeWidth:1.5})})]}),_r?
|
|
55
|
-
/* @__PURE__ */we("h2",{id:je,"data-window-title":!0,className:"sr-only",children:or.text||Ke}):/* @__PURE__ */we("div",{"data-window-title":!0,title:Ke,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Ht?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:/* @__PURE__ */we("span",{id:je,className:"truncate",children:Zt?pn(Re):Re})})]}),co&&/* @__PURE__ */we("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${Ht?.9:.55})`}}),
|
|
56
|
-
/* @__PURE__ */we(un.Provider,{value:Ot,children:/* @__PURE__ */we(d.Provider,{value:oo,children:/* @__PURE__ */we(L.Provider,{value:{rightRef:pt,leftRef:wt,notify:()=>gt(!0),active:Ht,isDirty:tr,footerOpen:Ct&&!V&&!_&&!Z&&!Me},children:/* @__PURE__ */we("div",{ref:ft,"data-window-body":"",...V?{onPointerDown:Tr,onContextMenu:e=>{e.preventDefault(),at({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${V?"p-0 cursor-move":Z||ee?"p-0":_?"p-2":"p-4"} ${V||zn||jr?"":"backdrop-blur-sm"} ${!1===M||Z||ee?"overflow-hidden":"overflow-y-auto overscroll-contain"+(jr?" mb-2 mr-1":"")} ${V?"rounded-2xl select-none":""}`,style:{...V?{touchAction:"none"}:{},backgroundColor:V||jr?"transparent":zn?"rgb(var(--window-content-rgb))":Ht?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */we(Be,{children:xe})})})})})]}),V&&it&&/* @__PURE__ */pe($,{minWidth:160,style:{left:it.x,top:it.y},onClose:()=>at(null),children:[
|
|
57
|
-
/* @__PURE__ */we(W,{onClick:()=>{at(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:Ot}))},children:"Settings"}),
|
|
58
|
-
/* @__PURE__ */we(K,{}),ue&&/* @__PURE__ */pe(ye,{children:[ue,
|
|
59
|
-
/* @__PURE__ */we(K,{})]}),
|
|
60
|
-
/* @__PURE__ */pe(W,{onClick:()=>{at(null),Ve(e=>!e)},children:[
|
|
61
|
-
/* @__PURE__ */we("span",{className:"flex-1",children:"Always on Top"}),Xe&&/* @__PURE__ */we(B,{name:"check",className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
|
|
62
|
-
/* @__PURE__ */we(K,{}),
|
|
63
|
-
/* @__PURE__ */we(W,{onClick:()=>{at(null),vr()},children:"Close"})]}),
|
|
64
|
-
/* @__PURE__ */pe("div",{onPointerDown:Tr,ref:vt,"data-modal-footer":"",...jr?{"data-modal-footer-top":""}:{},className:jr?`absolute right-0 z-10 flex ${no} items-center gap-2 px-3 text-xs select-none cursor-move${Xr?"":" hidden"}`:`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${zn?"":" cursor-move"}${Ht&&!zn?" backdrop-blur-sm":""}${V||_||Z||Me||!Ct?" hidden":""}`,style:jr?{touchAction:"none",top:co?3:0}:{touchAction:"none",backgroundColor:zn?"rgb(var(--window-footer-rgb))":Ht?"rgb(var(--window-footer-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-footer-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
65
|
-
/* @__PURE__ */pe("div",{className:jr?"flex shrink-0 items-center gap-2":"flex items-center gap-2 min-w-0 flex-1",children:[Tt&&/* @__PURE__ */we(Ue,{auto:!0}),O,
|
|
66
|
-
/* @__PURE__ */we("div",{ref:wt,"data-modal-actions-left":!0,className:"flex items-center gap-2 shrink-0"}),null!=k&&!1!==k&&!jr&&
|
|
67
|
-
/* @__PURE__ */we("div",{ref:bt,"data-modal-footer-facts":"",className:"min-w-0 flex-1 overflow-hidden",children:/* @__PURE__ */we("div",{ref:xt,className:"inline-flex items-center gap-2 whitespace-nowrap"+(kt?" invisible":""),children:k})})]}),
|
|
68
|
-
/* @__PURE__ */pe("div",{"data-modal-footer-right":"",className:"flex items-center gap-2 shrink-0"+(jr?"":" ml-auto"),children:[Mt&&q&&(q.editing?/* @__PURE__ */we(F,{variant:"secondary",size:"sm","data-modal-discard":"",onClick:()=>{Er()},children:We.discard}):"object"==typeof q.state?/* @__PURE__ */we(F,{variant:"secondary",size:"sm","data-modal-edit":"","aria-disabled":!0,disabledReason:q.state.disabledReason,children:We.edit}):/* @__PURE__ */we(F,{variant:"secondary",size:"sm","data-modal-edit":"",onClick:()=>q.onEdit(),children:We.edit})),
|
|
69
|
-
/* @__PURE__ */we("div",{ref:pt,"data-modal-actions":!0,className:"flex items-center gap-2"}),R]})]}),!V&&!Me&&!Zt&&Ht&&!Tn&&/* @__PURE__ */pe(ye,{children:[
|
|
70
|
-
/* @__PURE__ */we("div",{onPointerDown:e=>Dr(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
71
|
-
/* @__PURE__ */we("div",{onPointerDown:e=>Dr(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
72
|
-
/* @__PURE__ */we("div",{onPointerDown:e=>Dr(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
73
|
-
/* @__PURE__ */we("div",{onPointerDown:e=>Dr(e,"nw"),className:"absolute top-0 left-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
74
|
-
/* @__PURE__ */we("div",{onPointerDown:e=>Dr(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
75
|
-
/* @__PURE__ */we("div",{onPointerDown:e=>Dr(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
76
|
-
/* @__PURE__ */we("div",{onPointerDown:e=>Dr(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
|
|
77
|
-
/* @__PURE__ */we("div",{onPointerDown:e=>Dr(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),Zt&&/* @__PURE__ */we("div",{className:"absolute inset-0",style:{zIndex:H.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>tn(!0),onMouseLeave:()=>tn(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),cr(Ot),qr(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:Qt&&/* @__PURE__ */we("button",{type:"button","data-expose-close":!0,"aria-label":$e.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:H.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),vr()},children:/* @__PURE__ */we(B,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),Zt&&go&&/* @__PURE__ */we("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:H.expose+(Qt?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:pn(Re)})]}),Eo=Ge&&/* @__PURE__ */pe($,{style:{left:Ge.x,top:Ge.y},onClose:()=>Je(null),minWidth:160,children:[!V&&!_&&!zn&&/* @__PURE__ */pe(ye,{children:[
|
|
78
|
-
/* @__PURE__ */pe(W,{onClick:()=>{ur(Ot),Je(null)},children:[
|
|
79
|
-
/* @__PURE__ */we(B,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),We.minimize]}),!Tn&&/* @__PURE__ */pe(W,Rn?{onClick:()=>{On(!1),kn(wn()),Je(null)},children:[
|
|
80
|
-
/* @__PURE__ */we(B,{name:"collapse",className:"h-4 w-4",strokeWidth:1.5}),We.windowed]}:{onClick:()=>{ho(),Je(null)},children:[
|
|
81
|
-
/* @__PURE__ */we(B,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),We.maximize]})]}),U&&!zn&&/* @__PURE__ */pe(W,{onClick:()=>{Ve(e=>!e),Je(null)},children:[
|
|
82
|
-
/* @__PURE__ */we(B,{name:"bookmark-square",className:"h-4 w-4 "+(Xe?"text-blue-600":""),fill:Xe?"currentColor":"none",strokeWidth:1.5}),Xe?We.unpin:We.pinOnTop]}),_e&&/* @__PURE__ */pe(W,{onClick:()=>{Je(null),ot()},children:[
|
|
83
|
-
/* @__PURE__ */we(B,{name:"star",className:"h-4 w-4",fill:rt?"currentColor":"none",strokeWidth:1.5}),rt?$e.taskbar.removeFromDesktop:$e.taskbar.addToDesktop]}),(gn[Ot]||[]).length>0&&/* @__PURE__ */we(ye,{children:(gn[Ot]||[]).map((e,t)=>/* @__PURE__ */pe(W,{onClick:()=>{Je(null),e.onClick()},children:[e.icon,e.label]},t))}),!(zn&&Ze?.home)&&/* @__PURE__ */pe(ye,{children:[
|
|
84
|
-
/* @__PURE__ */we(K,{}),
|
|
85
|
-
/* @__PURE__ */pe(W,{danger:!0,onClick:()=>{Je(null),vr()},children:[
|
|
86
|
-
/* @__PURE__ */we(B,{name:"close",className:"h-4 w-4"}),We.close]})]})]}),Mo=!!fe&&Rt.some(e=>e.id===fe),Co=!Xt||Mo||V?null:/* @__PURE__ */pe("div",{"data-modal-restore-tab":!0,"data-modal-id":Ot,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:[
|
|
87
|
-
/* @__PURE__ */we("button",{type:"button",onClick:()=>cr(Ot),title:We.restore,className:"max-w-[16rem] truncate rounded px-2 py-0.5 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900",children:Ke||We.windowSuffix}),
|
|
88
|
-
/* @__PURE__ */we("button",{type:"button",onClick:()=>cr(Ot),title:We.restore,"aria-label":We.restore,className:"rounded px-2 py-0.5 text-xs leading-none text-ink-faintest hover:bg-gray-100 hover:text-gray-600",children:"▴"}),
|
|
89
|
-
/* @__PURE__ */we("button",{type:"button",onClick:()=>{vr()},title:We.close,"aria-label":We.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 ge(
|
|
90
|
-
/* @__PURE__ */pe(dn.Provider,{value:null,children:[ko,Eo,Co]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{Kr&&"Escape"===e.key&&(to(null),qr(!1))});var ao=100,so={past:[],future:[]};function lo(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>ao?r.slice(r.length-ao):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:so}}var co=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var uo=500,ho=250;function mo({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,i]=me(lo,so),a=ne(/* @__PURE__ */new Map),[s,l]=oe(0),c=s>0,[u,d]=oe(0),[h,m]=oe(0),f=h>0,{hasAnyPerm:p}=A(),w=t&&0===u&&(!(n&&n.length>0)||p(n)),y=ne(null),g=ne(!1),v=ae(()=>{const e={};for(const[t,n]of a.current)e[t]=n.getLast();return e},[]),b=ae((e,t)=>{a.current.has(e)||l(e=>e+1),a.current.set(e,t)},[]),x=ae(e=>{a.current.delete(e)&&l(e=>e-1)},[]),k=ae(e=>{d(t=>t+(e?1:-1))},[]),E=ae(e=>{m(t=>t+(e?1:-1))},[]),[M,C]=oe(0),S=M>0,N=ae(e=>{C(t=>t+(e?1:-1))},[]),z=Q(qe),T=z?.claimReadOnly;re(()=>{if(T&&!w)return T(!0),()=>T(!1)},[T,w]);const D=z?.claimOwnMount;re(()=>{if(D&&S)return D(!0),()=>D(!1)},[D,S]);const I=ne({last:0,count:0,tripped:!1}),P=ne(!1),R=ae((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>ho&&(r.count=0),r.last=o,++r.count>uo)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${uo} 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]),O=ae(e=>{for(const[t,n]of Object.entries(e)){const e=a.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),$=ae(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};O(e.values),i({type:"undo",redoStep:t})},[o.past,v,O]),W=ae(()=>{const e=o.future[0];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};O(e.values),i({type:"redo",undoStep:t})},[o.future,v,O]),[K,j]=oe(0),F=ne(0),B=ne(0),q=ne(!1),H=ae(()=>{g.current=!0,P.current=!1,y.current=null,F.current+=1,B.current=F.current,j(F.current)},[]),U=ne(void 0),Y=ae(e=>{void 0!==e&&(void 0!==U.current&&e!==U.current&&(q.current=!0),U.current=e),H()},[H]);re(()=>{g.current&&K===B.current&&(g.current=!1,y.current=null,(P.current||q.current)&&i({type:"clear"}),P.current=!1,q.current=!1)},[K]);const X=ae(()=>{q.current=!0,i({type:"clear"}),H()},[H]),V=w&&o.past.length>0,G=w&&o.future.length>0,J=Wr(r),_=ne({undo:$,redo:W,canUndo:V,canRedo:G});_.current={undo:$,redo:W,canUndo:V,canRedo:G},re(()=>{if(!J||!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&&co.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)},[J,w]);const Z=de(()=>({register:b,unregister:x,record:R,undo:$,redo:W,clear:X,baseline:Y,canUndo:V,canRedo:G,enabled:w,hasState:c,handMounted:S,claimOwnMount:N,claimReadOnly:k,declaredEditable:f,claimEditable:E,undoLabel:V?o.past[o.past.length-1].label:null,redoLabel:G?o.future[0].label:null}),[b,x,R,$,W,X,Y,V,G,w,c,S,N,k,f,E,o.past,o.future]),ee=""!==kn(),te=Q(L)?.footerOpen??!1,ie=ee&&w&&c&&!S&&te;/* @__PURE__ */
|
|
91
|
-
return pe(qe.Provider,{value:Z,children:[ie&&/* @__PURE__ */we(En,{position:"left",quiet:!0,children:/* @__PURE__ */we(Ue,{auto:!0})}),e]})}function fo(){const e=Q(qe),t=ae(()=>{},[]);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 po(e){const t=Q(qe),n=t?.claimReadOnly,r=t?.claimEditable;re(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function wo(e,t,n){const r=Q(qe),o=he(),i=ne(e),a=ne(t);a.current=t,re(()=>{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=ne(r);c.current=r;const u=ne({label:s,coalesceKey:l});u.current={label:s,coalesceKey:l},re(()=>{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 yo(e,t){const[n,r]=oe(e);return wo(n,e=>r(()=>e),t),[n,r]}export{Mn as CancelButton,Te as DesktopHostProvider,ft as DocFavStar,nt as EntityWindowFallback,et as EntityWindowLoading,rt as EntityWindowState,fn as MODAL_SUBMIT_SELECTOR,io as Modal,En as ModalActions,Ue as UndoControls,mo as UndoProvider,Se as WINDOW_REGISTRY,Fe as WindowCrashedFallback,Be as WindowErrorBoundary,Rt as WindowManagerProvider,bn as WindowTitle,bt as activateWindowById,Vt as beginWindowGesture,ir as cancelWindowFront,Ne as client_default,no as commitExposeHighlight,or as confirmWindowDiscard,Gt as drainPerfEvents,Ur as exitExposeMode,On as forgetMaximizedWindowBoxes,Et as getActiveWindowRoute,eo as getExposeHighlight,cn as getWindowChromeVersion,Pn as getWindowPosition,it as isDraftEntityId,at as isDraftEntityWindow,Ee as isEntityEntry,ke as isPageEntry,Le as isShellApiClientConfigured,Je as isTabWindow,Xt as markMenuOpen,sn as readWindowChrome,tr as requestWindowFront,to as setExposeHighlight,Yt as setPerfCollecting,Oe as setShellHomeRoute,je as setShellTabStrip,Ce as setShellWindowRegistry,In as setWindowDefaultPosition,Rn as setWindowPosition,en as splitTitle,Qr as subscribeExposeHighlight,ln as subscribeWindowChrome,_e as tabGroupOf,Hr as toggleExposeMode,_n as useCurrentTabKey,Ae as useDesktopHost,kn as useEnclosingModalId,Wr as useIsActiveWindow,Ie as usePageSearch,fo as useUndo,po as useUndoCanEdit,wo as useUndoable,yo as useUndoableState,yn as useWidgetSettings,ct as useWindowDirty,dt as useWindowManager,vn as useWindowMenuItem,xn as useWindowTitle,rr as windowHoldsChanges};
|
package/dist/chunk-JPE4TYRQ.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{SearchableSelect as e}from"./chunk-G2JPTPRS.js";import{labelClasses as a}from"./chunk-EQKUFYX6.js";import{Select_default as l}from"./chunk-GEITUFYK.js";import{isSafeLinkHref as t}from"./chunk-Z5TE3MEG.js";import{Input_default as r}from"./chunk-3SIRRK3F.js";import{INPUT_SIZES as n}from"./chunk-AYZY3YNC.js";import{Button_default as i}from"./chunk-UTISUEO4.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-IUVGHHR3.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},k=e=>t(e.trim());function y(t){const{value:n,kinds:o,rules:y=x,filtersFor:w,label:N,readOnly:C,placeholder:F,className:O="",tidyAddress:j,addressAddon:E}=t,T=void 0!==t.onApply,U=u().link,$=y.isSafe??k,R=d(),S=c(null),z=c(null),[A,P]=p({url:n}),D=T?A.url:n,[I,K]=p(!1),[Y,G]=p(null),[H,M]=p(null),[V,W]=p(!1),B=c(null),L=c(()=>{});L.current=T?t.onCancel:()=>{},m(()=>{if(T)return s(e=>{const a=S.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(L.current(),!0)},()=>S.current)},[T]),m(()=>{if(!T)return;const e=z.current;e?(e.focus(),e.select()):S.current?.querySelector("button, input")?.focus()},[]);const Q=o??[{value:b,label:U.address,target:{type:"text"}}],Z=Y&&Y.against===D?Y.kind:y.kindOf(D),q=Q.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===Z),J=q.find(e=>"text"===e.target.type),X=q.find(e=>e.value===Z)??J??q[0];if(!X)return null;const _="text"!==X.target.type,ee=_?y.targetOf(D):D,ae=h(X.target),le=ae.find(e=>e.value===ee),te=e=>({value:e,label:U.unavailable(e)}),re="select"===X.target.type&&ee&&w?w(ee):null,ne=re?y.readFilter(D):null,ie=ne?re?.find(e=>e.param===ne.param):void 0,oe=H&&H.against===D?H.text:D,se=_?D:j?j(oe.trim()).trim():oe.trim(),ue=T&&j?se:oe,de=!_&&""!==ue.trim()&&!$(ue),ce=de&&(!T||I);_&&V&&W(!1);const pe=(e,a)=>{T?P({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},me=(e,a)=>{G(a=>a?{...a,against:e}:a),pe(e,a)},fe=e=>{if(!e)return me("");const a=ae.find(a=>a.value===e);me(e,a?.label)},ve=e=>{K(!1);const a=e.trim();a?$(e)?(M({text:e,against:a}),me(a)):M({text:e,against:D}):(M({text:e,against:""}),me(""))},ge=e=>{const a=e.relatedTarget;if(a&&(a===z.current||B.current?.contains(a)))return;if(W(!1),T||!j||C)return;const l=j(oe.trim());l.trim()!==oe.trim()&&ve(l)},he=()=>{if(!T||!se)return;if(!_&&de)return void K(!0);const e=_&&A.url===se?A.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},be=(e,a)=>a&&!e.some(e=>e.value===a)?[te(a),...e]:[...e],xe=(a,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const l=r.some(e=>""===e.value);/* @__PURE__ */
|
|
2
|
-
return f(e,{"aria-label":a,value:t,options:o,disabled:C,clearable:l,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
|
|
3
|
-
return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:C,onChange:n})};let ke;if("text"===X.target.type)ke=/* @__PURE__ */f(r,{ref:z,id:`${R}-address`,size:"sm",type:"text",invalid:ce,"aria-label":U.address,"aria-describedby":ce?`${R}-why`:void 0,placeholder:F??U.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:oe,readOnly:C,onChange:e=>ve(e.target.value),onFocus:()=>W(!0),onBlur:ge,onKeyDown:j&&!T?e=>{"Enter"===e.key&&e.currentTarget.blur()}:void 0});else{const e="groups"===X.target.type?X.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):X.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:X.target.placeholder},...be(e,ee)];ke=xe(X.label,ee,a,fe,e.length>10)}const ye=/* @__PURE__ */v(g,{children:[o&&xe(U.linkType,X.value,q.map(e=>({value:e.value,label:e.label})),e=>{M(null),K(!1);const a=q.find(a=>a.value===e);if(!a||"text"===a.target.type)return void G({kind:e,against:D});const l=h(a.target)[0];G({kind:e,against:l?l.value:""}),l?pe(l.value,l.label):pe("")},!1),ke,E&&V&&!C&&"text"===X.target.type&&/* @__PURE__ */f("div",{ref:B,onBlur:ge,children:E({url:oe,onChange:ve})}),re&&xe(U.filter,ne?.param??"",[{value:"",label:U.noFilter},...ne&&!ie?[te(ne.param)]:[],...re.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return me(ee,le?.label);const a=re?.find(a=>a.param===e),l=a?.values[0];l&&me(y.withFilter(ee,{param:e,value:l.value}),l.label)},!1),re&&ne&&xe(U.value,ne.value,be((ie?.values??[]).map(e=>({value:e.value,label:e.label})),ne.value),e=>{if(!ne)return;const a=ie?.values.find(a=>a.value===e);me(y.withFilter(ee,{param:ne.param,value:e}),a?.label)},(ie?.values.length??0)>10),ce&&/* @__PURE__ */f("p",{id:`${R}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:U.unsafe}),X.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:X.hint}),re&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:U.filterHint})]});if(!T)/* @__PURE__ */
|
|
4
|
-
return f("div",{ref:S,className:`flex min-w-0 flex-auto flex-col gap-2 ${O}`.trim(),role:N?"group":void 0,"aria-label":N,children:ye});const we=t.onRemove;/* @__PURE__ */
|
|
5
|
-
return v("div",{ref:S,role:"dialog","aria-label":N??U.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-line bg-surface p-3 shadow-lg ${O}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),he())},children:[_?/* @__PURE__ */f("span",{className:a({inline:!0}),children:U.title}):/* @__PURE__ */f("label",{htmlFor:`${R}-address`,className:a({inline:!0}),children:U.title}),ye,
|
|
6
|
-
/* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[we?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:we,children:U.remove}):null,
|
|
7
|
-
/* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
|
|
8
|
-
/* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>L.current(),children:U.cancel}),
|
|
9
|
-
/* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:he,disabled:C||""===se,children:U.apply})]})]})]})}function w({label:e,text:a,onTextChange:l,link:t,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const k=u().link,[w,N]=p(!1),C=c(null),F=d(),O=()=>{N(!1),C.current?.focus()};/* @__PURE__ */
|
|
10
|
-
return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
|
|
11
|
-
/* @__PURE__ */f(r,{size:"md",type:"text",className:"rounded-b-none","aria-label":k.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>l(e.target.value)}),
|
|
12
|
-
/* @__PURE__ */v("button",{ref:C,type:"button","aria-label":k.linkOf(e,t),"aria-expanded":w,"aria-controls":w?F:void 0,disabled:b,onClick:()=>N(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-line-strong bg-surface-sunken ${n.md} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
|
|
13
|
-
/* @__PURE__ */f(o,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(t?"text-blue-600":"text-ink-faintest")}),
|
|
14
|
-
/* @__PURE__ */f("span",{className:"min-w-0 truncate "+(t?"text-blue-600":"text-ink-faintest"),children:t||k.addLink})]}),w&&/* @__PURE__ */f("div",{id:F,className:"mt-2",children:/* @__PURE__ */f(y,{value:t,label:k.linkOf(e,t),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),O()},onRemove:t?()=>{i(""),O()}:void 0,onCancel:O})})]})}export{y as LinkPicker,w as TextLinkField};
|
package/dist/chunk-KGAYYSFE.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-F4VILY3O.js";import{IconButton_default as a}from"./chunk-NWS5G7FE.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{Tooltip as n}from"./chunk-F2RAIGCG.js";import{useShellStrings as s}from"./chunk-IUVGHHR3.js";import{jsx as i,jsxs as t,Fragment as d}from"react/jsx-runtime";var c=e=>e.preventDefault(),u=e=>null!=e&&!1!==e,h=["bold","italic","underline","strike","link","sup","sub","code"];function p(e,l,r){const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===a||0===l.length)return;const o=[...e.currentTarget.querySelectorAll('[role="radio"]')],n=o.findIndex(l=>l===e.target||l.contains(e.target));if(n<0)return;e.preventDefault();const s=o.length,i="first"===a?0:"last"===a?s-1:(n+a+s)%s;o[i].disabled||(r(l[i]),o[i].focus())}function b(e,l){const r=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:r,link:r+(l?1:0)}}function m(e,l,r,a){const o=h.filter(l=>"link"!==l&&e.has(l)).length+(l?1:0);return r&&0!==o?a>0?"paragraph":"words":null}function w({offered:l,color:r,last:a,alignment:o,list:n,letterCase:s,clear:i}){let t=h.filter(e=>l.has(e)).length+(r?1:0)+(u(a)?1:0),d=(o?e.filter(e=>o.allow.includes(e)).length:0)+(n&&l.has("bullet")?1:0)+(n&&l.has("number")?1:0)+(l.has("quote")?1:0)+(s?3:0);const c=m(l,r,i,d);return"paragraph"===c&&(d+=1),"words"===c&&(t+=1),{words:t>0,paragraph:d>0,oneRow:t>0&&d>0&&t+1+d<=9,flow:t>0&&d>0&&t+1+d>9&&t<=7,cells:{words:t,paragraph:d}}}function g(e,l){/* @__PURE__ */
|
|
2
|
-
return i(n,{content:e,children:l},l.key??void 0)}function f({offered:n,pressed:h,onMark:f,color:k,linkOpen:v=!1,last:N,alignment:C,list:D,letterCase:M,clear:x,disabled:y=!1,"aria-label":I,windows:R,className:S="",layout:j="grid"}){const A=s().textToolbar,q=w({offered:n,color:k,last:N,alignment:C,list:D,letterCase:M,clear:x});if(!q.words&&!q.paragraph)return null;const L=m(n,k,x,q.cells.paragraph),$=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,B=(e,l,r,o)=>n.has(e)?g(l,/* @__PURE__ */i(a,"link"===e?{pressed:v,className:$(v),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":v,"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r}:{className:$(Boolean(h[e])),"aria-label":l,"aria-pressed":Boolean(h[e]),"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r},e)):null,G=l(A),U=e.map(e=>[e,G[e],r(e)]),F=C?e.filter(e=>C.allow.includes(e)):[],H=C&&F.includes(C.value)?C.value:F[0],K=[["none",A.caseNone,/* @__PURE__ */i(o,{name:"case-normal"})],["upper",A.caseUpper,/* @__PURE__ */i(o,{name:"case-upper"})],["lower",A.caseLower,/* @__PURE__ */i(o,{name:"case-lower"})]],O=x&&L?g(A.clear,/* @__PURE__ */i(a,{className:$(!1),"aria-label":A.clear,disabled:y,onMouseDown:c,onClick:x.onClear,children:/* @__PURE__ */i(o,{name:"revert"})},"clear")):null,T=/* @__PURE__ */t(d,{children:[B("bold",A.bold,/* @__PURE__ */i(o,{name:"bold"}),"Meta+B"),B("italic",A.italic,/* @__PURE__ */i(o,{name:"italic"}),"Meta+I"),B("underline",A.underline,/* @__PURE__ */i(o,{name:"underline"}),"Meta+U"),B("strike",A.strike,/* @__PURE__ */i(o,{name:"strike"})),k?g(A.color,/* @__PURE__ */i(a,{pressed:k.open,className:$(k.open,"rosh-tb-color"),"aria-label":A.color,"aria-haspopup":"dialog","aria-expanded":k.open,disabled:y,style:k.run?{"--rosh-tb-run":k.run}:void 0,onMouseDown:c,onClick:k.onToggle,children:/* @__PURE__ */i(o,{name:"text-color"})},"color")):null,B("link",A.link,/* @__PURE__ */i(o,{name:"link"}),"Meta+K"),B("sup",A.sup,/* @__PURE__ */i(o,{name:"superscript"})),B("sub",A.sub,/* @__PURE__ */i(o,{name:"subscript"})),B("code",A.code,/* @__PURE__ */i(o,{name:"code"})),u(N)?N:null,"words"===L?O:null]}),V=/* @__PURE__ */t(d,{children:[C&&F.length>0?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":A.alignment,onKeyDown:e=>p(e,F,e=>C.onChange(e)),children:U.map(([e,l,r])=>C.allow.includes(e)?g(l,/* @__PURE__ */i(a,{role:"radio",pressed:C.value===e,className:$(C.value===e),"aria-checked":C.value===e,"aria-label":l,tabIndex:e===H?0:-1,disabled:y||C.disabled,onMouseDown:c,onClick:()=>C.onChange(e),children:r},e)):null)}):null,D&&n.has("bullet")?g(A.bullet,/* @__PURE__ */i(a,{className:$("bullet"===D.pressed),"aria-label":A.bullet,"aria-pressed":"bullet"===D.pressed,disabled:y,onMouseDown:c,onClick:()=>D.onList("bullet"),children:/* @__PURE__ */i(o,{name:"list"})},"bullet")):null,D&&n.has("number")?g(A.number,/* @__PURE__ */i(a,{className:$("number"===D.pressed),"aria-label":A.number,"aria-pressed":"number"===D.pressed,disabled:y,onMouseDown:c,onClick:()=>D.onList("number"),children:/* @__PURE__ */i(o,{name:"numbered-list"})},"number")):null,B("quote",A.quote,/* @__PURE__ */i(o,{name:"quote"})),M?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":A.letterCase,onKeyDown:e=>p(e,K.map(([e])=>e),e=>M.onChange(e)),children:K.map(([e,l,r])=>g(l,/* @__PURE__ */i(a,{role:"radio",pressed:M.value===e,className:$(M.value===e),"aria-checked":M.value===e,"aria-label":l,tabIndex:e===(M.value||"none")?0:-1,disabled:y||M.disabled,onMouseDown:c,onClick:()=>M.onChange(M.value===e?"":e),children:r},e)))}):null,"paragraph"===L?O:null]}),E="row"===j,P=E?" is-row":q.flow?" is-flow":q.oneRow?" is-one-row":q.words&&void 0===N&&"words"!==L?" is-eight":"",W=b(n,Boolean(k)),Y={"--rosh-tb-color-col":String(W.color),"--rosh-tb-link-col":String(W.link),...E?{"--rosh-tb-cells":String(q.cells.words+q.cells.paragraph),"--rosh-tb-groupgap":q.words&&q.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let z;return z=E?/* @__PURE__ */t("div",{className:"rosh-tb-row is-row",children:[q.words?/* @__PURE__ */i("div",{className:"rosh-tb-words",children:T}):null,q.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-para",children:V}):null]}):q.flow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-flow",children:[T,
|
|
3
|
-
/* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),V]}):q.oneRow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-one-row",children:[
|
|
4
|
-
/* @__PURE__ */i("div",{className:"rosh-tb-words",children:T}),
|
|
5
|
-
/* @__PURE__ */i("div",{className:"rosh-tb-para",children:V})]}):/* @__PURE__ */t(d,{children:[q.words?/* @__PURE__ */i("div",{className:"rosh-tb-row"+(void 0===N&&"words"!==L?" is-eight":""),children:T}):null,q.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-row",children:V}):null]}),/* @__PURE__ */t("div",{className:`rosh-tb-wrap${P} ${S}`.trim(),style:Y,children:[
|
|
6
|
-
/* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":I??A.formatting,children:z}),R]})}export{f as TextToolbar,w as textToolbarRows,b as textToolbarWindowColumns};
|
package/dist/chunk-LQCNIQ3I.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{useOverlayTarget as e,usePopupAnchor as i,usePopupLevel as t,usePopupLevelBindings as r,windowScrimStyle as o,OverlayLayerProvider as l,scrimHasCorners as n,CloseButton as d,popupLayerStyle as a}from"./chunk-SF4IIV5Z.js";import{useDiscardGuard as s}from"./chunk-FRCTA5FS.js";import{dialogA11y as m}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as c}from"./chunk-UVHXVSB2.js";import{useFocusTrap as p,useScrollLock as h}from"./chunk-DWGYC7OD.js";import{HEADING_TEXT as u,DESCRIPTION_TEXT as f,PANEL_SURFACE as b}from"./chunk-BWJZTHZ6.js";import{useHydrated as y}from"./chunk-WCCS4VFE.js";import{registerModalEscapeInterceptor as v}from"./chunk-TWVUQUUD.js";import{useRef as x,useId as w,useState as g,useEffect as k}from"react";import{createPortal as j}from"react-dom";import{jsxs as N,Fragment as C,jsx as W}from"react/jsx-runtime";var V={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},F={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function $(e,i){const t=window.innerHeight-(i.top+i.height);if("bottom"===e)return{left:i.left,width:i.width,bottom:t};const r={top:i.top,height:i.height};return"left"===e?{...r,left:i.left}:{...r,right:window.innerWidth-(i.left+i.width)}}function B({open:B,onClose:H,side:S="right",size:U="md",title:Z,description:D,footer:I,children:T,blocking:z=!1,dirty:A=!1,initialFocus:E,"aria-label":G,"aria-labelledby":Y,"aria-describedby":J,className:O=""}){const Q=x(null),R=w(),X=w(),q=w(),K=e(y()),[L,M]=g(null),P=s({open:B,dirty:A,onClose:H,title:Z,layer:L}),_=x(null),ee=i(B&&null!==K,_),ie=t(B&&null!==K,_),te=r(ie,L),re=o(ie),oe=null!==ie.host;if(c(B),p(Q,B&&null!==K,E,te),h(B),k(()=>{if(B)return v(()=>!te.current?.(document.activeElement)&&(z||P(),!0),()=>Q.current)},[B,z,P,te]),!B||!K)return null;const le="bottom"===S,ne={...le?{maxHeight:"85vh"}:{},...ee?$(S,ee):{}};/* @__PURE__ */
|
|
2
|
-
return N(C,{children:[/* @__PURE__ */W("span",{ref:_,hidden:!0,"data-popup-anchor":""}),j(
|
|
3
|
-
/* @__PURE__ */W(l,{value:L,children:/* @__PURE__ */N("div",{ref:M,className:oe?"fixed inset-0 pointer-events-none":"fixed inset-0",style:a(ie),role:"presentation","data-overlay-layer":"",children:[
|
|
4
|
-
/* @__PURE__ */W("div",{className:"fixed bg-black/30 backdrop-blur-sm "+(oe?"pointer-events-auto"+(n(ie)?" rounded-(--radius-window)":""):"inset-0"),style:re??void 0,hidden:oe&&!re,onClick:z?void 0:P,"aria-hidden":"true","data-popup-scrim":oe?"window":"system"}),
|
|
5
|
-
/* @__PURE__ */N("div",{ref:Q,...m({modal:!0,titleId:Z?q:void 0,labelledBy:Y,label:G}),"aria-describedby":J??(D?X:T?R:void 0),"data-drawer-side":S,"data-popup-panel":"",style:ne,className:[`fixed flex flex-col ${b}`,oe?"pointer-events-auto":"",le?"":`w-full max-w-full ${V[U]}`,ee?"":F[S],le?"rounded-t-xl":"",O].filter(Boolean).join(" "),children:[Z?/* @__PURE__ */N("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
6
|
-
/* @__PURE__ */N("div",{className:"min-w-0",children:[
|
|
7
|
-
/* @__PURE__ */W("h2",{id:q,className:u,children:Z}),D&&/* @__PURE__ */W("p",{id:X,className:`mt-0.5 ${f}`,children:D})]}),!z&&/* @__PURE__ */W(d,{onClose:P})]}):!z&&/* @__PURE__ */W("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */W(d,{onClose:P})}),
|
|
8
|
-
/* @__PURE__ */N("div",{id:R,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[D&&!Z&&/* @__PURE__ */W("p",{id:X,className:`mb-3 ${f} ${z?"":"pr-8"}`.trim(),children:D}),T]}),I&&/* @__PURE__ */W("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:I})]})]})}),K)]})}export{B as Drawer};
|
package/dist/chunk-OXWBSZL2.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import{Calendar as e}from"./chunk-FZYUTZEV.js";import{gridColumnCount as t}from"./chunk-VNNVG4NR.js";import{END_ACTIONS_PAD as r,InputEndActionSlot as n,InputEndActionButton as a}from"./chunk-3SIRRK3F.js";import{FILTER_ON as o,FILTER_ON_INK as i,FILTER_OFF as l}from"./chunk-AYZY3YNC.js";import{userToday as s,calendarNames as c}from"./chunk-NHKT5IH6.js";import{toDateKey as d,fromDateKey as m,toMonthKey as u}from"./chunk-JRQMX4PK.js";import{pad2 as h}from"./chunk-LF27WIN2.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{onOverlayOpen as f}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as g}from"./chunk-62LW225J.js";import{useDropdownPosition as b}from"./chunk-VY3UA6AR.js";import{useBrowserLayoutEffect as x}from"./chunk-ZDXRSY2Y.js";import{buttonClasses as v}from"./chunk-UQYNPYF4.js";import{glassStyle as y}from"./chunk-5FYDNH4Y.js";import{useShellStrings as w,useShellLocale as N}from"./chunk-IUVGHHR3.js";import{useState as k,useRef as C,useId as j,useEffect as M}from"react";import{createPortal as D}from"react-dom";import{jsxs as W,Fragment as Y,jsx as $}from"react/jsx-runtime";var F=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],R=d;function S(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:d(new Date(r,n,t.getDate()-14)),to:d(a)};case"lastMonth":return{from:d(i(1)),to:d(o)};case"last3Months":return{from:d(i(3)),to:d(o)};case"last6Months":return{from:d(i(6)),to:d(o)};case"last12Months":return{from:d(i(12)),to:d(o)}}}function H(e,t,r){const n=u(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function O(e){const t=m(e);return t?`${h(t.getDate())}/${h(t.getMonth()+1)}/${t.getFullYear()}`:e}var I=/* @__PURE__ */new Map;function V({from:d,to:u,onChange:h,formatDisplay:R,clearable:V,required:T=!1,name:U,id:A,"aria-labelledby":E,"aria-label":L,weekStartsOn:Z,placeholder:G,fullWidth:P=!1,min:q,max:B,disabled:K=!1,allowOpenEnd:J=!1}){const Q=w().dateRange,X=N(),z=R??(X?function(e){let t=I.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),I.set(e,t));const r=t;return e=>{const t=m(e);return t?r.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(X):O),_=G??Q.placeholder,ee=V??!T,[te,re]=k(!1),[ne,ae]=k(d),[oe,ie]=k(u),[le,se]=k(null),[ce,de]=k("from"),me=C(null),ue=C(null),he=C(null),pe=j(),fe=j(),ge=j(),[be,xe]=k(!1),ve=b(me,te,{preferredMaxWidth:520,preferredMaxHeight:be?720:560,popupRef:he}),ye=C(null),we=C(null),[Ne,ke]=k(!0);x(()=>{const e=we.current;if(!te||!be||!e)return;const r=t(getComputedStyle(e).gridTemplateColumns)||1,n=parseFloat(getComputedStyle(e).columnGap)||0,a=(e.clientWidth-n*(r-1))/r,o=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=a+.5;o!==Ne&&ke(o)});const Ce=C(null);x(()=>{const e=he.current;if(!te||!ve||!e)return;const t=getComputedStyle(e),r=ve.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(be)null!==Ce.current&&Ce.current<=r&&xe(!1);else{const e=ye.current?.offsetWidth??0;if(0===e)return;Ce.current=e,e>r+.5&&xe(!0)}});const[je,Me]=k(!1);x(()=>{const e=!!A&&(ue.current?.labels?.length??0)>0;e!==je&&Me(e)});const De=!!L||!!E||je,We=m(s())??/* @__PURE__ */new Date(0),[Ye,$e]=k(()=>d?d.slice(0,7):H(We,q,B)),Fe=F.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(S(e,We),q,B)),Re=e=>e?z(e):"";M(()=>{if(!te)return;const e=e=>{const t=e.target;me.current?.contains(t)||he.current?.contains(t)||re(!1)};document.addEventListener("mousedown",e);const t=f(()=>re(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[te]),M(()=>{K&&re(!1)},[K]);const Se=()=>{h("",""),re(!1)},He=ee&&!K&&Boolean(d||u),Oe=d&&u?`${Re(d)} — ${Re(u)}`:d?Q.fromOnly(Re(d)):u?Q.toOnly(Re(u)):"",Ie=c(X),Ve=e=>{const t=m(e);return t?Ie.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Te=d&&u?Q.range(Ve(d),Ve(u)):d?Q.fromOnly(Ve(d)):u?Q.toOnly(Ve(u)):_,Ue=e=>be?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(le===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(le===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Ae=/* @__PURE__ */W(Y,{children:[Fe.map(e=>/* @__PURE__ */$("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=S(e,We);ae(t.from),ie(t.to),se(e),$e(t.from.slice(0,7))})(e),className:Ue(e),"aria-label":be?Q[e]:void 0,children:be?Ne?Q[e]:Q[`${e}Short`]:Q[e]},e)),
|
|
2
|
-
/* @__PURE__ */$("button",{type:"button",onClick:()=>se("Custom"),className:Ue("Custom"),children:Q.custom})]}),Ee=(e,t)=>J?/* @__PURE__ */$("button",{type:"button","data-range-end":e,"aria-pressed":ce===e,onClick:()=>de(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */$("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Le=e=>J&&ce===e?" ring-1 ring-blue-400":"",Ze=
|
|
3
|
-
/* @__PURE__ */$(e,{mode:"range",min:q,max:B,value:ne||null,endValue:oe||null,month:Ye,onMonthChange:$e,onSelect:e=>{se("Custom"),J?"from"===ce?(oe&&e>oe?(ae(oe),ie(e)):ae(e),de("to")):ne&&e<ne?(ie(ne),ae(e)):ie(e):!ne||ne&&oe?(ae(e),ie("")):e<ne?(ie(ne),ae(e)):ie(e)},weekStartsOn:Z,"aria-label":Q.dialog});/* @__PURE__ */
|
|
4
|
-
return W("div",{className:"relative"+(P?" w-full":""),ref:me,children:[
|
|
5
|
-
/* @__PURE__ */W("div",{className:`relative ${P?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${He?r[1]:""} text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${d||u?`${o} ${i}`:l}${K?" cursor-not-allowed opacity-60":""}`,children:[
|
|
6
|
-
/* @__PURE__ */W("button",{ref:ue,type:"button",onClick:()=>{K||(ae(d),ie(u),se(null),de(d&&!u?"to":"from"),$e(d?d.slice(0,7):H(We,q,B)),re(!0))},"aria-haspopup":"dialog","aria-expanded":te,id:A,disabled:K||void 0,"aria-label":L,"aria-labelledby":E,"aria-describedby":[De?fe:void 0,T?ge:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":te?pe:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(P?" min-w-0 flex-1 justify-start":""),children:[
|
|
7
|
-
/* @__PURE__ */$(p,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
8
|
-
/* @__PURE__ */$("span",{className:"truncate",children:Oe||_})]}),He&&/* @__PURE__ */$(n,{children:/* @__PURE__ */$(a,{action:{label:Q.clearRange,icon:/* @__PURE__ */$(p,{name:"close"}),onClick:Se}})})]}),De&&/* @__PURE__ */$("span",{id:fe,className:"sr-only",children:Te}),T&&/* @__PURE__ */$("span",{id:ge,className:"sr-only",children:Q.required}),U&&/* @__PURE__ */W(Y,{children:[
|
|
9
|
-
/* @__PURE__ */$("input",{type:"hidden",name:U.from,value:d,disabled:K||void 0}),
|
|
10
|
-
/* @__PURE__ */$("input",{type:"hidden",name:U.to,value:u,disabled:K||void 0})]}),te&&D(
|
|
11
|
-
/* @__PURE__ */W("div",{ref:he,id:pe,role:"dialog","aria-label":Q.dialog,"data-layout":be?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:g.popup,left:ve?.left,right:ve?.right,top:ve?.top,bottom:ve?.bottom,width:be&&ve?ve.maxWidth:"max-content",maxWidth:ve?.maxWidth,maxHeight:ve?.maxHeight,overflowY:"auto",visibility:ve?void 0:"hidden",...y()},children:[
|
|
12
|
-
/* @__PURE__ */W("div",{className:be?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Ee("from",/* @__PURE__ */W(Y,{children:[
|
|
13
|
-
/* @__PURE__ */$("span",{className:"text-xs font-medium text-gray-500",children:Q.from}),
|
|
14
|
-
/* @__PURE__ */$("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Le("from")}`,children:ne?Re(ne):Q.start})]})),!be&&/* @__PURE__ */$("span",{className:"text-gray-300",children:"—"}),Ee("to",/* @__PURE__ */W(Y,{children:[
|
|
15
|
-
/* @__PURE__ */$("span",{className:"text-xs font-medium text-gray-500",children:Q.to}),
|
|
16
|
-
/* @__PURE__ */$("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${oe?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Le("to")}`,children:oe?Re(oe):Q.end})]}))]}),be?/* @__PURE__ */W(Y,{children:[Fe.length>0&&/* @__PURE__ */W("div",{className:"mb-3 @container",children:[!Ne&&/* @__PURE__ */$("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:Q.lastHeading}),
|
|
17
|
-
/* @__PURE__ */W("div",{ref:we,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Ae,Fe.map(e=>/* @__PURE__ */$("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:Q[e]},e))]})]}),
|
|
18
|
-
/* @__PURE__ */$("div",{className:"w-full",children:Ze})]}):
|
|
19
|
-
/* @__PURE__ */W("div",{ref:ye,className:"flex w-max gap-4",children:[
|
|
20
|
-
/* @__PURE__ */$("div",{className:"w-64",children:Ze}),Fe.length>0&&/* @__PURE__ */$("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Ae})]}),
|
|
21
|
-
/* @__PURE__ */W("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[ee&&/* @__PURE__ */$("button",{type:"button",onClick:Se,className:v({variant:"ghost"}),children:Q.clear}),
|
|
22
|
-
/* @__PURE__ */$("button",{type:"button",onClick:()=>re(!1),className:v({variant:"secondary"}),children:Q.cancel}),
|
|
23
|
-
/* @__PURE__ */$("button",{type:"button",onClick:()=>{h(ne,oe),re(!1)},disabled:J?!ne&&!oe:!ne||!oe,className:v({variant:"primary"}),children:Q.apply})]})]}),document.body)]})}export{V as DateRangePicker,S as presetRange,R as toISODate};
|
package/dist/chunk-PBSCF2ML.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import{AccessibleTable as e}from"./chunk-ZDFMYAQB.js";import{polygonPoints as t}from"./chunk-VFC6QUEN.js";import{ChartDefs as r,maskId as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{angleScale as o}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-IUVGHHR3.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:v="polygon",rings:M=4,formatValue:N,animate:j=!0,className:$,emptyLabel:F}){const W=m().charts,C=c(),R=N??(e=>h(e,C)),w=F??W.nothingToCompare,A=p(),[H,L]=u(null),{highlighted:Q}=a(),U=x;if(k.length<3||0===U.length)/* @__PURE__ */
|
|
2
|
-
return d("p",{className:`text-sm text-gray-500 ${$??""}`,children:w});const V=y/2,Y=y/2,z=y/2-46,B=o(k.length),E=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...U.map(e=>e.values[t]??0).filter(Number.isFinite))),T=(e,t)=>{const r=Math.max(0,Math.min(1,t/E[e])),l=B.center(e)-B.step/2;return[V+z*r*Math.cos(l),Y+z*r*Math.sin(l)]},Z=(e,t)=>null!==H?H!==e:null!==Q&&Q!==t,D=null!==H?U[H]:void 0;/* @__PURE__ */
|
|
3
|
-
return f("div",{className:`relative ${$??""}`,children:[
|
|
4
|
-
/* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":A,onMouseLeave:()=>L(null),children:[
|
|
5
|
-
/* @__PURE__ */d("title",{id:A,children:W.acrossMeasures(U.map(e=>e.label),k.length)}),Array.from({length:M},(e,r)=>{const l=z*(r+1)/M;return"circle"===v?/* @__PURE__ */d("circle",{cx:V,cy:Y,r:l,fill:"none",stroke:i.grid,strokeWidth:1},r):/* @__PURE__ */d("path",{d:g(t(V,Y,l,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},r)}),k.map((e,t)=>{const[r,l]=T(t,E[t]);/* @__PURE__ */
|
|
6
|
-
return f("g",{children:[
|
|
7
|
-
/* @__PURE__ */d("line",{x1:V,y1:Y,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
|
|
8
|
-
/* @__PURE__ */d("text",{x:V+(z+18)*Math.cos(B.center(t)-B.step/2),y:Y+(z+18)*Math.sin(B.center(t)-B.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
|
|
9
|
-
/* @__PURE__ */d(r,{id:A,reveal:!!j&&"center-out"}),U.map((e,t)=>{const r=s(t,3,e.color,e.tone),a=k.map((t,r)=>T(r,e.values[r]??0));/* @__PURE__ */
|
|
10
|
-
return f("g",{opacity:Z(t,e.key)?.3:1,onMouseEnter:()=>L(t),mask:j?`url(#${l(A)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:r,fillOpacity:.18,stroke:"none"}),
|
|
11
|
-
/* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),D&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:D.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(H,3,D.color,D.tone),value:R(D.values[t]??0)}))})}),
|
|
12
|
-
/* @__PURE__ */d("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:U.map((e,t)=>/* @__PURE__ */f("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
13
|
-
/* @__PURE__ */d("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:s(t,3,e.color,e.tone)}}),
|
|
14
|
-
/* @__PURE__ */d("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
|
|
15
|
-
/* @__PURE__ */d(e,{caption:W.acrossMeasures(U.map(e=>e.label),k.length),head:[W.tableSeries,...k.map(e=>e.label)],rows:U.map(e=>[e.label,...k.map((t,r)=>R(e.values[r]??0))])})]})}export{k as RADAR_SERIES_CAP,x as RadarChart};
|
package/dist/chunk-QNXTVDIC.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as t,CHART_INK as l}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as r}from"./chunk-TWVUQUUD.js";import{usePlotWidth as n}from"./chunk-MAFUXCPZ.js";import{useShellStrings as i,useShellLocale as a}from"./chunk-IUVGHHR3.js";import{formatPlain as o}from"./chunk-C3QOHMR6.js";import{useRef as h,useId as c,useState as s,useEffect as m}from"react";import{jsx as f,jsxs as u}from"react/jsx-runtime";function x({rows:x,columns:d,cells:p,height:M,width:g,color:y,max:v,formatValue:$,label:b,className:k,emptyLabel:w,cellGap:A=2,cellRadius:N=2}){const j=i().charts,U=a(),z=$??(e=>o(e,U)),C=b??j.intensity,D=w??j.noActivity,F=h(null),R=n(F),V=g??R,S=c(),[G,H]=s(null);if(m(()=>{if(null!==G)return r(e=>"Escape"===e.key&&(H(null),!0))},[G]),0===x.length||0===d.length)/* @__PURE__ */
|
|
2
|
-
return f("div",{className:k,ref:F,children:/* @__PURE__ */f("p",{className:"py-8 text-center text-sm text-gray-500",children:D})});const I=y??t(0),L=v??Math.max(1,...p.flat().filter(Number.isFinite)),Q=96,B=26*x.length,E=M??B+26+26,T=Math.max(2,(Math.max(97,V)-Q)/d.length),W=e=>{const t=L>0?Math.max(0,Math.min(1,e/L)):0;return`color-mix(in oklab, ${I} ${(8+92*t).toFixed(1)}%, ${l.surface})`};/* @__PURE__ */
|
|
3
|
-
return u("div",{className:`relative ${k??""}`,ref:F,children:[
|
|
4
|
-
/* @__PURE__ */u("svg",{width:"100%",height:E,viewBox:`0 0 ${V} ${E}`,role:"img","aria-label":j.heatmap(C,x.length,d.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>H(null),onBlur:()=>H(null),onKeyDown:e=>{const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:0,l="ArrowRight"===e.key?1:"ArrowLeft"===e.key?-1:0;0===t&&0===l||(e.preventDefault(),H(e=>({r:Math.min(x.length-1,Math.max(0,(e?.r??0)+t)),c:Math.min(d.length-1,Math.max(0,(e?.c??0)+l))})))},children:[
|
|
5
|
-
/* @__PURE__ */f("defs",{children:/* @__PURE__ */u("linearGradient",{id:S,x1:"0",x2:"1",children:[
|
|
6
|
-
/* @__PURE__ */f("stop",{offset:"0",stopColor:W(0)}),
|
|
7
|
-
/* @__PURE__ */f("stop",{offset:"1",stopColor:W(L)})]})}),x.map((e,t)=>/* @__PURE__ */f("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:l.label,children:e},`r${t}`)),x.map((e,t)=>d.map((l,r)=>{const n=p[t]?.[r]??0,i=G&&(G.r!==t||G.c!==r);/* @__PURE__ */
|
|
8
|
-
return f("rect",{x:Q+r*T+A/2,y:26*t+A/2,width:Math.max(1,T-A),height:26-A,rx:N,fill:W(n),opacity:i?.55:1,onMouseEnter:()=>H({r:t,c:r}),children:/* @__PURE__ */f("title",{children:`${e} · ${l}: ${z(n)}`})},`${t}-${r}`)})),d.map((e,t)=>t%Math.max(1,Math.ceil(d.length/Math.max(1,Math.floor((V-Q)/56))))===0?/* @__PURE__ */f("text",{x:Q+t*T+T/2,y:B+15,textAnchor:"middle",fontSize:11,fill:l.label,children:e},`c${t}`):null),
|
|
9
|
-
/* @__PURE__ */f("rect",{x:Q,y:B+26,width:Math.min(180,Math.max(40,V-Q)),height:8,rx:4,fill:`url(#${S})`}),
|
|
10
|
-
/* @__PURE__ */f("text",{x:Q,y:B+48,fontSize:11,fill:l.label,children:"0"}),
|
|
11
|
-
/* @__PURE__ */f("text",{x:Q+Math.min(180,Math.max(40,V-Q)),y:B+48,textAnchor:"end",fontSize:11,fill:l.label,style:{fontVariantNumeric:"tabular-nums"},children:z(L)})]}),G&&/* @__PURE__ */f("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */f(e,{title:`${x[G.r]} · ${d[G.c]}`,rows:[{key:"v",label:C,color:I,value:null==p[G.r]?.[G.c]?void 0:z(p[G.r][G.c])}]})})]})}export{x as HeatmapChart};
|
package/dist/chunk-UTQN5AIO.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{useOverlayTarget as e,usePopupAnchor as r,usePanelPosition as l,usePopupLevel as t,usePopupLevelBindings as i,windowScrimStyle as a,OverlayLayerProvider as o,scrimHasCorners as n,CloseButton as s,popupLayerStyle as d,POPUP_GUTTER as c}from"./chunk-SF4IIV5Z.js";import{useDiscardGuard as m}from"./chunk-FRCTA5FS.js";import{dialogA11y as p}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as u}from"./chunk-UVHXVSB2.js";import{useFocusTrap as f,useScrollLock as h}from"./chunk-DWGYC7OD.js";import{HEADING_TEXT as x,DESCRIPTION_TEXT as v,PANEL_SURFACE as b}from"./chunk-BWJZTHZ6.js";import{useHydrated as w}from"./chunk-WCCS4VFE.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as $}from"./chunk-IUVGHHR3.js";import{useRef as g,useId as N,useState as j,useEffect as k}from"react";import{createPortal as C}from"react-dom";import{jsxs as V,Fragment as W,jsx as F}from"react/jsx-runtime";var H=`calc(100% - ${2*c}px)`,U="grid grid-cols-[minmax(0,1fr)_auto]",B="bg-black/30 backdrop-blur-sm",I={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl","2xl":"max-w-6xl",full:"max-w-none"};function S({open:c,onClose:S,title:T,description:Z,role:A="dialog",children:D,footer:E,headerActions:G,blocking:_=!1,size:R="md",aside:Y=!1,dirty:z=!1,initialFocus:J,"aria-label":O,"aria-labelledby":Q,"aria-describedby":X,className:q=""}){const K=g(null),L=N(),M=N(),P=!_,ee="full"===R,re=ee||null!=G,le=Boolean(T||Z),te=N();$().dialog;const ie=e(w()),[ae,oe]=j(null),ne=m({open:c,dirty:z,onClose:S,title:T,layer:ae}),se=g(null),de=r(c&&null!==ie,se),ce=l(de,K),me=t(c&&null!==ie,se),pe=i(me,ae),ue=a(me),fe=null!==me.host;if(u(c),f(K,c&&null!==ie,J,pe),h(c),k(()=>{if(c)return y(()=>!pe.current?.(document.activeElement)&&(_||ne(),!0),()=>K.current)},[c,_,ne,pe]),!c||!ie)return null;/* @__PURE__ */
|
|
2
|
-
return V(W,{children:[/* @__PURE__ */F("span",{ref:se,hidden:!0,"data-popup-anchor":""}),C(
|
|
3
|
-
/* @__PURE__ */F(o,{value:ae,children:/* @__PURE__ */V("div",{ref:oe,className:"fixed inset-0"+(Y?" pointer-events-none opacity-0":fe?" pointer-events-none":""),style:d(me),role:"presentation","data-overlay-layer":"","data-aside":Y?"":void 0,children:[!fe&&/* @__PURE__ */F("div",{className:`fixed inset-0 ${B}`,"aria-hidden":"true","data-popup-scrim":"system"}),ue&&/* @__PURE__ */F("div",{className:`fixed ${B}${Y?"":" pointer-events-auto"}${n(me)?" rounded-(--radius-window)":""}`,style:ue,onClick:_?void 0:ne,"aria-hidden":"true","data-popup-scrim":"window"}),
|
|
4
|
-
/* @__PURE__ */F("div",{className:de?"fixed inset-0":"fixed inset-0 flex items-center justify-center p-4",onClick:_||fe?void 0:e=>{e.target===e.currentTarget&&ne()},children:/* @__PURE__ */V("div",{ref:K,"data-popup-panel":"",style:de?{left:ce?.left??0,top:ce?.top??0,visibility:ce?void 0:"hidden",width:H,[ee?"height":"maxHeight"]:H}:void 0,...p({role:A,modal:!0,titleId:T?te:void 0,labelledBy:Q,label:O}),"aria-describedby":X??(Z?M:D?L:void 0),className:(ee?`${de?"absolute":"relative h-full w-full max-h-full"} ${I[R]} ${U} grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden rounded-(--radius-popup) ${b}`:`${de?"absolute":"relative max-h-full w-full"} ${I[R]}${re?` ${U} content-start gap-x-2`:""} overflow-y-auto overscroll-contain rounded-(--radius-card) ${b} p-6`)+`${fe&&!Y?" pointer-events-auto":""} ${q}`.trimEnd(),children:[ee?le&&
|
|
5
|
-
/* @__PURE__ */V("div",{className:"col-start-1 row-start-1 flex min-h-(--row-height-window-bar) flex-col justify-center border-b border-line py-2 pl-6 pr-4",children:[T&&/* @__PURE__ */F("h2",{id:te,className:x,children:T}),Z&&/* @__PURE__ */F("p",{id:M,className:`${T?"mt-1 ":""}${v}`,children:Z})]}):T&&/* @__PURE__ */F("h2",{id:te,className:`${re?"col-start-1 row-start-1 ":P?"pr-8 ":""}${x}`,children:T}),!ee&&Z&&/* @__PURE__ */F("p",{id:M,className:`${re?"col-start-1 ":""}${T?"mt-1":P&&!re?"pr-8":""} ${v}`.trim(),children:Z}),D&&/* @__PURE__ */F("div",{id:L,className:ee?"col-span-2 row-start-2 min-h-0 overflow-auto":(re?"col-span-2 ":"")+"mt-2 text-sm text-gray-600",children:D}),E&&/* @__PURE__ */F("div",{className:ee?"col-span-2 row-start-3 flex flex-wrap justify-end gap-3 border-t border-line px-6 py-4":(re?"col-span-2 ":"")+"mt-6 flex flex-wrap justify-end gap-3",children:E}),re?
|
|
6
|
-
/* @__PURE__ */V("div",{className:"col-start-2 row-start-1 flex items-center gap-1 "+(ee?(le?"border-b border-line ":"")+"pr-3":"-mr-3 -mt-3 self-start"),children:[G,P&&/* @__PURE__ */F(s,{onClose:ne})]}):P&&/* @__PURE__ */F(s,{onClose:ne,className:"absolute right-3 top-3"})]})})]})}),ie)]})}export{S as Dialog};
|
package/dist/chunk-VGUYAVDG.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r="13.20.0",a=r;export{a as APP_VERSION,r as VERSION};
|