efficient-shell 10.1.0 → 10.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{Browser-2S5V2RRU.js → Browser-YHMFQIN5.js} +14 -14
- package/dist/Calculator-NSYIXONM.js +29 -0
- package/dist/CurrencyConverter-YQ2AZ7ZG.js +21 -0
- package/dist/Documents-CMCZA5PH.js +52 -0
- package/dist/Files-UW65YMFW.js +88 -0
- package/dist/Notepad-RSYZ7HZA.js +24 -0
- package/dist/{PdfViewer-WNKGFJD6.js → PdfViewer-Z4YKDHIH.js} +1 -1
- package/dist/{PomodoroTimer-TGUTV47T.js → PomodoroTimer-5KCWCL62.js} +12 -12
- package/dist/{Preview-76A4GKGI.js → Preview-PK4QI7SK.js} +41 -41
- package/dist/Sidebar-QCUDD4OU.js +44 -0
- package/dist/Spreadsheet-MQR4TQGV.js +37 -0
- package/dist/Stock-DMW2REHR.js +16 -0
- package/dist/{Weather-2EGADOTH.js → Weather-PN7XVCZY.js} +14 -14
- package/dist/{WorldClock-U5DIGLOY.js → WorldClock-JYLOJCUS.js} +9 -9
- package/dist/ai/index.js +59 -59
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.js +1 -1
- package/dist/charts/ChartTooltip.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/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-2JG5JU4M.js +8 -0
- package/dist/{chunk-5VSP3TYU.js → chunk-2K2W6VIR.js} +1 -1
- package/dist/{chunk-QXRRAADR.js → chunk-2SY76NFO.js} +4 -4
- package/dist/{chunk-BMXMSAQE.js → chunk-2VTO64YC.js} +7 -7
- package/dist/{chunk-HL6JSDN3.js → chunk-34URULVW.js} +1 -1
- package/dist/{chunk-RZR3OAKV.js → chunk-35DG7Y4M.js} +1 -1
- package/dist/{chunk-MH6DI6YY.js → chunk-37U326EL.js} +12 -12
- package/dist/{chunk-YL6LLHJA.js → chunk-3CPB3WP2.js} +18 -18
- package/dist/{chunk-CKPVXDKX.js → chunk-3ELLBQPS.js} +3 -3
- package/dist/{chunk-A6RB4PIX.js → chunk-3NW5LD7D.js} +4 -4
- package/dist/{chunk-BNQRPLBW.js → chunk-3RORPK2J.js} +1 -1
- package/dist/{chunk-U5DMF2TX.js → chunk-4BYJQU37.js} +1 -1
- package/dist/chunk-4PAWQEXM.js +1 -0
- package/dist/{chunk-CUA6CREW.js → chunk-5S3YYN7M.js} +7 -7
- package/dist/{chunk-Q5YM65DZ.js → chunk-632N62BY.js} +8 -8
- package/dist/{chunk-LOYCPZUB.js → chunk-63L5ORRZ.js} +1 -1
- package/dist/{chunk-B7HW6XZD.js → chunk-67JCJ2MG.js} +1 -1
- package/dist/chunk-6OMCCEYA.js +1 -0
- package/dist/{chunk-4VDGVF5T.js → chunk-6PFZK6ED.js} +1 -1
- package/dist/{chunk-P6LB3I3D.js → chunk-6RX4PVBU.js} +1 -1
- package/dist/chunk-6XBWM453.js +6 -0
- package/dist/{chunk-ZG2HMC7S.js → chunk-7SMV6G4Z.js} +1 -1
- package/dist/{chunk-X6YT3I5F.js → chunk-7X3XNVES.js} +1 -1
- package/dist/{chunk-WUMHSI4U.js → chunk-7X5FABQS.js} +1 -1
- package/dist/{chunk-JZK3UDOT.js → chunk-7YOQS3C6.js} +1 -1
- package/dist/{chunk-TDLU6GF5.js → chunk-7Z4PTLDL.js} +4 -4
- package/dist/{chunk-2OJ3HGFY.js → chunk-A4HJDSRA.js} +6 -6
- package/dist/chunk-A5BV6NFA.js +7 -0
- package/dist/{chunk-42XMT5JN.js → chunk-AJO72CPB.js} +2 -2
- package/dist/chunk-AKJHVOSD.js +8 -0
- package/dist/{chunk-OQW42DOR.js → chunk-AKM6JBMD.js} +1 -1
- package/dist/chunk-AM2F5ZXH.js +2 -0
- package/dist/{chunk-4WZRNPIG.js → chunk-AUWTGM65.js} +1 -1
- package/dist/chunk-B73AXE6P.js +1 -0
- package/dist/{chunk-V4RYE6KA.js → chunk-C2P2Z6HU.js} +11 -11
- package/dist/{chunk-WKSNTMEJ.js → chunk-CAVADOJK.js} +1 -1
- package/dist/chunk-CBEKJTXU.js +9 -0
- package/dist/{chunk-Q4LBBFLO.js → chunk-CGQAKGPT.js} +6 -6
- package/dist/{chunk-AEQFFD5I.js → chunk-CHBRMAJV.js} +1 -1
- package/dist/{chunk-2OE5VVBE.js → chunk-CPZ42W2B.js} +1 -1
- package/dist/{chunk-BDAKGS7O.js → chunk-D7F442OZ.js} +1 -1
- package/dist/{chunk-BZPPDYEE.js → chunk-DDCMMOB4.js} +1 -1
- package/dist/{chunk-5VTRKWKO.js → chunk-DKGZPVLL.js} +1 -1
- package/dist/{chunk-XABYSSXW.js → chunk-DLNIRZNR.js} +1 -1
- package/dist/{chunk-RBIGSJ2J.js → chunk-DRDYZ633.js} +2 -2
- package/dist/{chunk-FS2KWQJW.js → chunk-E5MVH3SH.js} +10 -10
- package/dist/chunk-EU3JZGV2.js +14 -0
- package/dist/{chunk-GGIFS34Z.js → chunk-EYZZW6SO.js} +5 -5
- package/dist/{chunk-43T5JGFB.js → chunk-EZEYKCI6.js} +1 -1
- package/dist/{chunk-DTJRIWFR.js → chunk-F27JJHNJ.js} +1 -1
- package/dist/{chunk-7ILNRFEV.js → chunk-FFIQPFUR.js} +1 -1
- package/dist/{chunk-TLRCTNUF.js → chunk-G4GVLK44.js} +1 -1
- package/dist/chunk-G5NQOV7L.js +6 -0
- package/dist/{chunk-JB3WKDD7.js → chunk-GGK27H67.js} +1 -1
- package/dist/{chunk-2YLG32JY.js → chunk-GISDIVFK.js} +1 -1
- package/dist/{chunk-FFASZGNZ.js → chunk-GNHLVGG5.js} +3 -3
- package/dist/{chunk-6FPDOEOX.js → chunk-GSKLHUQ6.js} +1 -1
- package/dist/{chunk-GY67Y5SN.js → chunk-H4HB5OET.js} +1 -1
- package/dist/{chunk-6L2UAAGT.js → chunk-HNBGLF4B.js} +1 -1
- package/dist/{chunk-YJSX6JAC.js → chunk-I2XGPTCN.js} +1 -1
- package/dist/{chunk-NHH2MXFU.js → chunk-I4VIEGCX.js} +1 -1
- package/dist/chunk-IKNG7EFQ.js +12 -0
- package/dist/{chunk-RQNZ2PVW.js → chunk-INNIWRVU.js} +4 -4
- package/dist/{chunk-J53OQCKC.js → chunk-IOJNSX4N.js} +7 -7
- package/dist/{chunk-JKZJVQIB.js → chunk-IPFWXM2Y.js} +6 -6
- package/dist/{chunk-K7PCBUDC.js → chunk-JRZ7PPVJ.js} +6 -6
- package/dist/chunk-JSGQWVYH.js +7 -0
- package/dist/{chunk-ZCV377AG.js → chunk-KEPJWZJZ.js} +3 -3
- package/dist/{chunk-JJP54OT4.js → chunk-KJ4CBZEQ.js} +1 -1
- package/dist/{chunk-XHMIJ7S3.js → chunk-KP2THXEI.js} +6 -6
- package/dist/{chunk-GKK7DR2H.js → chunk-LCJRTJXT.js} +9 -9
- package/dist/{chunk-Q3MNSM7W.js → chunk-LDE5IV2M.js} +4 -4
- package/dist/{chunk-MZ26SYFY.js → chunk-LEDUD23S.js} +1 -1
- package/dist/{chunk-7TONF2PM.js → chunk-LOFYSLC7.js} +9 -9
- package/dist/{chunk-AGLBDT7X.js → chunk-LTKXAHS3.js} +8 -8
- package/dist/{chunk-BMQCUHSD.js → chunk-M22B3Y5Y.js} +1 -1
- package/dist/{chunk-CLQFP42I.js → chunk-MBXLROCD.js} +1 -1
- package/dist/{chunk-KCV7BFKJ.js → chunk-MCDM2G4W.js} +1 -1
- package/dist/{chunk-R4Q5653D.js → chunk-MNXRAZJV.js} +20 -20
- package/dist/{chunk-VC42SDAC.js → chunk-MQU3PZUS.js} +1 -1
- package/dist/{chunk-TYK7VN73.js → chunk-MTX5LMJD.js} +17 -17
- package/dist/{chunk-OZAAIE4E.js → chunk-MVZRZTQP.js} +1 -1
- package/dist/{chunk-NNOA7AVG.js → chunk-MXH3UPCH.js} +5 -5
- package/dist/{chunk-ZLHPCPXS.js → chunk-N4DI5F74.js} +18 -18
- package/dist/{chunk-EIUCHQI2.js → chunk-N67QX3WW.js} +2 -2
- package/dist/{chunk-XQQNA246.js → chunk-O42AN43Q.js} +1 -1
- package/dist/{chunk-MLKY5ESV.js → chunk-O45WQK57.js} +1 -1
- package/dist/{chunk-RSIGTZMU.js → chunk-O4V5PEA3.js} +1 -1
- package/dist/{chunk-M554OMPA.js → chunk-O6JJIR4H.js} +1 -1
- package/dist/{chunk-APXQMZSV.js → chunk-O7DW2BKY.js} +26 -26
- package/dist/{chunk-UB5TLWZN.js → chunk-ON67HF5K.js} +8 -8
- package/dist/{chunk-KZQAGXME.js → chunk-ORIGX2H5.js} +4 -4
- package/dist/{chunk-JRBQLRAZ.js → chunk-OZBM2XFQ.js} +1 -1
- package/dist/{chunk-ZRZ5LOW3.js → chunk-PBWUEBJ5.js} +1 -1
- package/dist/chunk-PJQGYKN6.js +11 -0
- package/dist/chunk-PN65IIYN.js +8 -0
- package/dist/chunk-PUF75SMJ.js +1 -0
- package/dist/{chunk-5EX6XXUX.js → chunk-PXDDCD5X.js} +1 -1
- package/dist/{chunk-RKFEJ5CX.js → chunk-PXQG5EIH.js} +1 -1
- package/dist/{chunk-5VDT4762.js → chunk-QEKOEIOQ.js} +2 -2
- package/dist/{chunk-GMRZX2ET.js → chunk-QHOBK35Y.js} +1 -1
- package/dist/{chunk-UDKOJB2B.js → chunk-QL4757YL.js} +2 -2
- package/dist/{chunk-7VCAMNCH.js → chunk-QP4UPCXQ.js} +1 -1
- package/dist/chunk-QQPIQCT7.js +11 -0
- package/dist/{chunk-CL7SBEBQ.js → chunk-QYRMFGES.js} +1 -1
- package/dist/{chunk-3V6ZERBS.js → chunk-RBQWIHYD.js} +1 -1
- package/dist/chunk-RCPFUDPS.js +4 -0
- package/dist/chunk-RP3GUVAI.js +100 -0
- package/dist/chunk-RPYFOQM2.js +6 -0
- package/dist/chunk-SDI2UGAG.js +1 -0
- package/dist/{chunk-53KQSCMG.js → chunk-SDQIXE5M.js} +9 -9
- package/dist/{chunk-NW7Z3G7P.js → chunk-SF654IHN.js} +13 -13
- package/dist/{chunk-LPDI5NL6.js → chunk-SO6X4CII.js} +2 -2
- package/dist/{chunk-VP63OOO4.js → chunk-SOECV4V5.js} +3 -3
- package/dist/chunk-SWN3LSQX.js +12 -0
- package/dist/{chunk-TBPHW42V.js → chunk-TKJBZIHT.js} +1 -1
- package/dist/chunk-TMNAHOJ7.js +9 -0
- package/dist/{chunk-CBGKLHPB.js → chunk-TOVKWNI2.js} +6 -6
- package/dist/{chunk-PF5CKD4C.js → chunk-TVH7IZQ4.js} +2 -2
- package/dist/{chunk-LNARMEEZ.js → chunk-TXDA7TTP.js} +1 -1
- package/dist/{chunk-SKY2NBTQ.js → chunk-UBOP6HFI.js} +5 -5
- package/dist/{chunk-J7CIBRDS.js → chunk-UDRMZ22J.js} +1 -1
- package/dist/{chunk-IWJRSC7M.js → chunk-ULAGXDOL.js} +1 -1
- package/dist/{chunk-O6ABVKHU.js → chunk-ULXCDM7Y.js} +10 -10
- package/dist/{chunk-MVQMAIZM.js → chunk-UPQW4GCT.js} +1 -1
- package/dist/{chunk-E3RHEEA6.js → chunk-URERZUX5.js} +1 -1
- package/dist/{chunk-RPMWF42S.js → chunk-UTWJKSET.js} +5 -5
- package/dist/{chunk-SWO4VPOB.js → chunk-UWIZX3RK.js} +1 -1
- package/dist/{chunk-EQN65XOO.js → chunk-UYRITNQW.js} +4 -4
- package/dist/{chunk-LFVUDFVU.js → chunk-VJJMWJPZ.js} +1 -1
- package/dist/{chunk-QSW3YHPK.js → chunk-VKKK4WLS.js} +4 -4
- package/dist/{chunk-JJYAYMY7.js → chunk-VTFZ6W2D.js} +2 -2
- package/dist/chunk-W35N7SL3.js +8 -0
- package/dist/{chunk-IWEL2ZCV.js → chunk-W5CJD54C.js} +1 -1
- package/dist/{chunk-45XXERGA.js → chunk-W6SC3ZNO.js} +2 -2
- package/dist/{chunk-ZF545DXX.js → chunk-W6URVLQF.js} +14 -14
- package/dist/{chunk-R5EJJ6HC.js → chunk-WINNA7LS.js} +1 -1
- package/dist/chunk-WMEYNKXZ.js +22 -0
- package/dist/{chunk-DKQWFQAV.js → chunk-WN5HHHLO.js} +1 -1
- package/dist/chunk-WTTSB4SV.js +3 -0
- package/dist/{chunk-XZBQ3XXD.js → chunk-XDQGIW4X.js} +1 -1
- package/dist/{chunk-4UX6ET7G.js → chunk-XKDBYJHF.js} +1 -1
- package/dist/chunk-XLYCWGTK.js +4 -0
- package/dist/{chunk-HI6IE5HI.js → chunk-XO7URRTM.js} +1 -1
- package/dist/chunk-Y3R267FV.js +15 -0
- package/dist/chunk-YATWJMLM.js +29 -0
- package/dist/{chunk-Y23TGQFN.js → chunk-YCOYCPAH.js} +3 -3
- package/dist/chunk-YGSU5KCP.js +9 -0
- package/dist/{chunk-VMDBVXDJ.js → chunk-YJLLLO5R.js} +1 -1
- package/dist/chunk-YMYY5G6V.js +1 -0
- package/dist/{chunk-BDFZNLFQ.js → chunk-YWDEFPSW.js} +3 -3
- package/dist/{chunk-FMC2XNSP.js → chunk-ZNAVCHBV.js} +6 -6
- package/dist/{chunk-B7AHMB3U.js → chunk-ZURB2DCM.js} +1 -1
- package/dist/{chunk-NQJKANUP.js → chunk-ZUS7FXKE.js} +13 -13
- package/dist/{chunk-3V74SUZO.js → chunk-ZZOBG6GP.js} +17 -17
- package/dist/chunk-ZZVE64OI.js +2 -0
- package/dist/data/DataTable.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/file-intake/index.js +1 -1
- package/dist/format/index.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.js +1 -1
- package/dist/forms/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/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/Segmented.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/TimePicker.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +152 -152
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +8 -8
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/BudgetBar.js +1 -1
- package/dist/shell/Card.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContainerFillChart.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/CountBadge.js +1 -1
- package/dist/shell/Dialog.d.ts +15 -2
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.d.ts +5 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/FloatingBar.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/Statistic.js +1 -1
- package/dist/shell/StatusBadge.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.d.ts +43 -0
- package/dist/shell/discardGuard.js +2 -0
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +6 -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.d.ts +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/ErrorPage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +5 -0
- package/dist/utils/glass.d.ts +4 -2
- package/dist/utils/glass.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-N2NLSDTW.js +0 -29
- package/dist/CurrencyConverter-HW5HW3RH.js +0 -21
- package/dist/Documents-JTURYN4D.js +0 -52
- package/dist/Files-GP2LAGME.js +0 -88
- package/dist/Notepad-OV66ANUO.js +0 -24
- package/dist/Sidebar-4OI4LP6G.js +0 -44
- package/dist/Spreadsheet-FU5QIZA3.js +0 -37
- package/dist/Stock-FEVMKWMS.js +0 -16
- package/dist/chunk-2SLQD57V.js +0 -6
- package/dist/chunk-44PGFMSX.js +0 -8
- package/dist/chunk-4AJRHTTB.js +0 -1
- package/dist/chunk-5GUBNCTP.js +0 -1
- package/dist/chunk-6B4F5DWV.js +0 -4
- package/dist/chunk-A3VJ4PRU.js +0 -11
- package/dist/chunk-ACVKU6YW.js +0 -7
- package/dist/chunk-AG2OLB3E.js +0 -15
- package/dist/chunk-AKVB5TQD.js +0 -29
- package/dist/chunk-ANTH2FBS.js +0 -100
- package/dist/chunk-AXL7VTNM.js +0 -11
- package/dist/chunk-BCDG4N6L.js +0 -6
- package/dist/chunk-DY2M6BIG.js +0 -12
- package/dist/chunk-F7A6K3D5.js +0 -9
- package/dist/chunk-GZYTCHPX.js +0 -8
- package/dist/chunk-IGEFUHYE.js +0 -12
- package/dist/chunk-K64JRGNE.js +0 -6
- package/dist/chunk-KE5U4KKG.js +0 -4
- package/dist/chunk-N6VP75F5.js +0 -3
- package/dist/chunk-OPB3I4JH.js +0 -8
- package/dist/chunk-PYQ6DD3F.js +0 -1
- package/dist/chunk-QASKQDUR.js +0 -22
- package/dist/chunk-QMUAY24U.js +0 -8
- package/dist/chunk-RUTUVS4H.js +0 -1
- package/dist/chunk-SKETTGCJ.js +0 -2
- package/dist/chunk-UP442DPT.js +0 -9
- package/dist/chunk-VO3ZB7C6.js +0 -14
- package/dist/chunk-W244OMOU.js +0 -7
- package/dist/chunk-X2PZMXDP.js +0 -1
- package/dist/chunk-YVTKTWZX.js +0 -9
- package/dist/chunk-ZN2BFSQR.js +0 -2
package/dist/chunk-ANTH2FBS.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import{computeMaximizedBox as e,isSidebarStripReserved as t,boxFillsWorkArea as n,readAlwaysMaximizedFlag as r,WORK_AREA_CHANGED_EVENT as o,useShellAuth as i,scrollerIsFluid as a,growBoxToWidth as s,widthToFit as l,navIcons as c}from"./chunk-CY5N5OA3.js";import{ROW_HEIGHTS as u}from"./chunk-AW7TOB6N.js";import{reportBoundaryError as d}from"./chunk-KNUR2UEG.js";import{isStaleChunkError as h}from"./chunk-JDCM2VHG.js";import{Result as m}from"./chunk-E3RHEEA6.js";import{CMD_Z as p,CMD_SHIFT_Z as f}from"./chunk-ZDMZM7HD.js";import{CopyButton as w}from"./chunk-3V6ZERBS.js";import{confirm as y}from"./chunk-TYK7VN73.js";import{ItemCount as g}from"./chunk-GMRZX2ET.js";import{dialogA11y as v}from"./chunk-VWGWZY7A.js";import{ColoredBadge as b}from"./chunk-RKFEJ5CX.js";import{useIsMobile as x,useIsPhone as k}from"./chunk-UGTRSRIW.js";import{focusableIn as E}from"./chunk-CDAJKLGL.js";import{useShellPrefs as M}from"./chunk-KC3EX26K.js";import{PopupMenu as C,PopupMenuItem as N,PopupMenuDivider as S,PopupMenuLabel as L}from"./chunk-MH6DI6YY.js";import{StatusBadge as T}from"./chunk-LNARMEEZ.js";import{Button_default as z}from"./chunk-NHH2MXFU.js";import{Icon as A}from"./chunk-KKSVRIMP.js";import{LoadingSpinner as D}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as P}from"./chunk-62LW225J.js";import{runEscapeInterceptors as I}from"./chunk-TWVUQUUD.js";import{useShellStrings as R}from"./chunk-X2PZMXDP.js";import{createContext as K,useContext as W,Component as $,useLayoutEffect as O,useRef as j,useEffect as F,useState as q,useSyncExternalStore as H,useCallback as B,isValidElement as Y,Fragment as U,Children as X,cloneElement as V,useMemo as _,useId as G,useReducer as J,Suspense as Z}from"react";import{jsxs as Q,jsx as ee,Fragment as te}from"react/jsx-runtime";import{createPortal as ne}from"react-dom";import{useLocation as re}from"react-router-dom";import{useQueryClient as oe,useQuery as ie}from"@tanstack/react-query";function ae(e){return"component"in e}function se(e){return"endpoint"in e}var le={};function ce(e){le=e}var ue=new Proxy({},{get:(e,t)=>le[t],has:(e,t)=>t in le,ownKeys:()=>Object.keys(le),getOwnPropertyDescriptor(e,t){if(t in le)return{configurable:!0,enumerable:!0,value:le[t]}}}),de=null;function he(e){de=e}function me(){return null!==de}var pe=/* @__PURE__ */new Set(["get","post","put","patch","delete","head","options","request"]),fe=new Proxy({},{get:(e,t)=>de?de[t]:"string"==typeof t&&pe.has(t)?()=>Promise.resolve({data:null,status:0,statusText:"",headers:{},config:{}}):void 0}),we=K(null);function ye(){return W(we)?.pageSearch??""}var ge=null,ve=/* @__PURE__ */new Set;function be(e){ge!==e&&(ge=e,ve.forEach(e=>e()))}function xe(){return ge}function ke(e){return ve.add(e),()=>{ve.delete(e)}}var Ee=null;function Me(e){Ee=e}function Ce({error:e,onReload:t}){const n=h(e);/* @__PURE__ */
|
|
2
|
-
return Q("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
|
|
3
|
-
/* @__PURE__ */ee(A,{name:"warning",className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
|
|
4
|
-
/* @__PURE__ */Q("div",{className:"min-w-0",children:[
|
|
5
|
-
/* @__PURE__ */ee("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__ */ee("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__ */ee("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 Ne=class extends ${state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){console.error("[efficient-shell] window content crashed:",e,t.componentStack),d(e)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */ee(Ce,{error:e,onReload:this.reset}):this.props.children}},Se=K(null),Le="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function Te({className:e="",auto:t=!1}){const n=W(Se),r=R().undo,o=n?.claimOwnMount;if(O(()=>{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 Q("div",{className:`flex items-center gap-2 ${e}`,"data-undo-controls":t?"shell":"form",children:[
|
|
9
|
-
/* @__PURE__ */ee("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",p):r.nothingToUndo,className:Le,children:r.undo}),
|
|
10
|
-
/* @__PURE__ */ee("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",f):r.nothingToRedo,className:Le,children:r.redo})]})}var ze=/* @__PURE__ */new Set([408,429]);function Ae(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function De(e){const t=Ae(e);return null!=t&&(t>=400&&t<500&&!ze.has(t))}function Pe(e,t){return!De(t)&&e<3}function Ie(e){if("page"!==e.type)return!0;const t=e.route?ue[e.route]:void 0;if(!t||!ae(t))return!0;const n=t;return!n.widget&&!n.utility}function Re(e){const t=e.route?ue[e.route]:void 0;if(!t||!ae(t))return;const n=t;return n.taskbarGroup?n.taskbarGroup:{key:e.route,label:n.label,icon:e.route}}var Ke=(e,t)=>!!t&&"page"===e.type&&e.route===t;function We(){const e=R().loading;/* @__PURE__ */
|
|
11
|
-
return ee(D,{size:"sm",padding:"p-8",label:e.label})}var $e="flex-1 min-h-0";function Oe(){const e=R().record;/* @__PURE__ */
|
|
12
|
-
return ee(D,{label:e.loading,padding:"",className:$e})}function je(e){return e??void 0}function Fe({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:o}){const i=R().record;if(t||e&&n)/* @__PURE__ */return ee(Oe,{});if(r){const e=Ae(r);if(401===e)/* @__PURE__ */
|
|
13
|
-
return ee(m,{status:"warning",title:i.signInRequired,subTitle:i.signInBody,className:$e});if(403===e)/* @__PURE__ */
|
|
14
|
-
return ee(m,{status:"403",className:$e});if(404===e||410===e)/* @__PURE__ */
|
|
15
|
-
return ee(m,{status:"404",title:i.notFound,className:$e});const t=null==e||408===e||429===e||e>=500;/* @__PURE__ */
|
|
16
|
-
return ee(m,{status:"500",title:i.loadFailed,subTitle:t?i.checkConnection:i.rejected,extra:t?/* @__PURE__ */ee(z,{variant:"secondary",size:"sm",onClick:o,children:i.retry}):void 0,className:$e})}/* @__PURE__ */
|
|
17
|
-
return ee(m,{status:"404",title:i.notFound,className:$e})}function qe({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */ee(te,{children:t(e)}):/* @__PURE__ */ee(Fe,{...n})}var He=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function Be(e){return"string"==typeof e&&(e.startsWith("new-")||He.test(e))}function Ye(e){if(Be(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var Ue=K({openWindows:[],openEntity:()=>{},openPage:()=>{},reorderWindows:()=>{},closeEntity:()=>{},minimize:()=>{},items:[],restore:()=>{},remove:()=>{},restoreIfMinimized:()=>!1,openItems:[]}),Xe=K(null);function Ve(e){const t=W(Xe),n=j(null);null===n.current&&(n.current=/* @__PURE__ */Symbol("window-dirty")),O(()=>{if(t)return t(n.current,e)},[t,e]),F(()=>{if(!t||!e)return;const n=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t,e])}function _e(){const e=j(/* @__PURE__ */new Map),[t,n]=q(!1);return{dirty:t,registerDirty:B((t,r)=>{const o=()=>{const t=Array.from(e.current.values()).some(Boolean);n(e=>e===t?e:t)};return e.current.set(t,r),o(),()=>{e.current.delete(t),o()}},[])}}function Ge(){return W(Ue)}function Je(e){if("page"!==e.type&&Ye(e))return null;const t="page"===e.type?"page":e.entityType||"",n="page"===e.type?e.route||"":e.entityId||"";return t&&n?{entityType:t,entityId:n,label:e.label}:null}function Ze({item:e,onClose:t,accentRgb:n}){const{dirty:r,registerDirty:o}=_e(),i=ue[e.route];if(!i||!ae(i))return null;const a=i,s=a.component;/* @__PURE__ */
|
|
18
|
-
return ee(Vr,{open:!0,onClose:t,icon:c[e.route],title:a.label,size:a.size||"2xl",dirty:r,allowPinOnTop:a.allowPinOnTop,initialPosition:a.initialPosition,widget:a.widget,compact:a.compact,appStyle:a.appStyle,flushBody:a.flushBody,autoHeight:a.autoHeight,autoMinHeight:a.autoMinHeight,autoWidth:a.autoWidth,dimensions:a.dimensions,windowKey:e.id,openedFromKey:e.openedFrom,accentRgb:n,children:/* @__PURE__ */ee(Xe.Provider,{value:o,children:/* @__PURE__ */ee(Z,{fallback:/* @__PURE__ */ee("div",{className:"flex items-center justify-center py-12",children:/* @__PURE__ */ee(We,{})}),children:/* @__PURE__ */ee(s,{})})})})}function Qe({entityType:e,entityId:t,label:n}){const r=R(),o=oe(),{data:i}=ie({queryKey:["my-profile-sidebar"],enabled:me(),queryFn:()=>fe.get("/auth/me/").then(e=>e.data)}),a=(i?.preferences||{}).favorite_documents||[],s=a.some(n=>n.entityType===e&&n.entityId===t);/* @__PURE__ */
|
|
19
|
-
return ee("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];fe.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__ */ee(A,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var et=/* @__PURE__ */new Set,tt=()=>"hidden";function nt({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=ue[e.entityType];if(!o||!se(o))return null;const i=o,[a,s]=q(!1),{dirty:l,registerDirty:u}=_e(),d=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=Be(e.entityId),p=!i.selfFetching&&!h&&!m&&me(),f=ie({queryKey:[d,e.entityId],queryFn:()=>{return fe.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:je(e.entitySnapshot),initialDataUpdatedAt:0,enabled:p,staleTime:0,refetchOnWindowFocus:!0,refetchOnMount:"always",refetchInterval:e=>!De(e.state.error)&&6e4,refetchIntervalInBackground:!1,retry:Pe}),w=f.data,y=f.refetch;F(()=>{var t;if(p)return t=t=>{t!==e.id||et.has(t)||y({cancelRefetch:!1})},Zn.add(t),()=>{Zn.delete(t)}},[y,e.id,p]);const g=B(()=>{a&&!l?s(!1):t()},[a,l,t]),v=(i.useEdit??tt)(w??null),b=!i.useEdit||m||h?void 0:{state:v,editing:a,onEdit:()=>s(!0),onDiscard:()=>s(!1)},x=i.selfFetching?e.label:w?i.title(w,a,s):e.label,k=i.icon,E=k?c[k]:null,M=x,C=!i.selfFetching&&w&&i.footer&&!h?i.footer(w):void 0;return i.rendersOwnModal?i.selfFetching?/* @__PURE__ */ee(Z,{fallback:/* @__PURE__ */ee(We,{}),children:i.render(w??e.entitySnapshot,t,e.entityId,a,s)}):null!=w?/* @__PURE__ */ee(Z,{fallback:/* @__PURE__ */ee(Vr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */ee(Oe,{})}),children:i.render(w,t,e.entityId,a,s)}):/* @__PURE__ */ee(Vr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */ee(Fe,{isPending:f.isPending,isFetching:f.isFetching,enabled:p,error:f.error,onRetry:y})}):/* @__PURE__ */ee(Vr,{open:!0,onClose:g,onMinimize:n,initialBox:e.savedBox,icon:E,title:M,footer:C,copyText:e.label,windowKey:e.id,openedFromKey:e.openedFrom,size:i.size||"2xl",dirty:l,editing:a||m||h,edit:b,dimensions:i.dimensions,autoHeight:i.autoHeight,autoMinHeight:i.autoMinHeight,autoWidth:i.autoWidth,appStyle:i.appStyle,flushBody:i.flushBody,accentRgb:r,children:/* @__PURE__ */ee(Xe.Provider,{value:u,children:/* @__PURE__ */ee(Z,{fallback:/* @__PURE__ */ee(Oe,{}),children:i.selfFetching?i.render(null,t,e.entityId,a,s):/* @__PURE__ */ee(qe,{entity:w,isPending:f.isPending,isFetching:f.isFetching,enabled:p,error:f.error,onRetry:y,children:n=>i.render(n,t,e.entityId,a,s)})})})})}function rt(e){return document.querySelector(`[data-modal-panel][data-window-key="${e}"]`)}function ot(e){return document.querySelector(`[data-modal-panel][data-window-root][data-window-owner="${e}"]`)}function it(e){const t=rt(e),n=t??ot(e);if(!n)return;if(t&&!ur(t))return r=e,void window.dispatchEvent(new CustomEvent("modal-reveal",{detail:{windowKey:r}}));var r;const o=n.getAttribute("data-modal-id");o&&Qn(o)}function at(){const e=Mr();if(!e)return;const t=document.querySelector(`[data-modal-panel][data-modal-id="${e}"]`);return t?.getAttribute("data-window-key")??void 0}var st=/* @__PURE__ */new Map;function lt(){const e=at();if(e)return st.get(e)}function ct(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 ut="rosh-peek-style",dt=P.peek,ht=P.taskbarPreview;function mt(e){"undefined"!=typeof document&&(!function(){if("undefined"==typeof document||document.getElementById(ut))return;const e=document.createElement("style");e.id=ut,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:${dt}!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 pt(){"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 ft({id:e,label:t,maxW:n,maxH:r,titleAbove:o=!1,onClick:i,onClose:a}){const s=R(),l=j(null),[c,u]=q({w:n,h:Math.round(.75*r)}),[d,h]=q(!1);return O(()=>{const o=l.current;if(!o)return;const i=rt(e)??ct(t);if(!i)return void h(!1);const a=i.getBoundingClientRect();if(0===a.width||0===a.height)return void h(!1);const s=Math.min(n/a.width,r/a.height),c=Math.max(80,Math.round(a.width*s)),d=Math.max(60,Math.round(a.height*s));u({w:c,h:d}),h(!0);const m=i.cloneNode(!0);return m.style.position="absolute",m.style.top="0",m.style.left="0",m.style.right="auto",m.style.bottom="auto",m.style.width=a.width+"px",m.style.height=a.height+"px",m.style.transform=`scale(${s})`,m.style.transformOrigin="top left",m.style.pointerEvents="none",m.style.animation="none",m.style.zIndex="auto",m.removeAttribute("data-modal-panel"),m.removeAttribute("data-modal-id"),m.removeAttribute("data-window-key"),m.removeAttribute("role"),m.removeAttribute("aria-labelledby"),m.removeAttribute("aria-label"),m.querySelectorAll('[role="dialog"], [data-portal]').forEach(e=>{e.style.display="none"}),o.innerHTML="",o.appendChild(m),()=>{o.innerHTML=""}},[e,t,n,r]),/* @__PURE__ */Q("div",{style:{width:c.w,height:c.h},className:"relative rounded-md overflow-hidden bg-white/95 border border-line-strong shadow-(--elevation-panel) cursor-pointer ring-2 ring-transparent group-hover:ring-blue-400 transition shrink-0",onClick:i,children:[
|
|
20
|
-
/* @__PURE__ */ee("div",{ref:l,className:"absolute inset-0 z-0 overflow-hidden"}),!d&&/* @__PURE__ */Q("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-gray-400 bg-gray-50",children:[
|
|
21
|
-
/* @__PURE__ */ee(A,{name:"window",className:"h-6 w-6",strokeWidth:1.5}),
|
|
22
|
-
/* @__PURE__ */ee("span",{className:"mt-1 text-3xs uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */ee("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__ */ee("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__ */ee(A,{name:"close",className:"h-3 w-3",strokeWidth:3})})]})}function wt({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=R(),s=e.length>1,l=j(null),[c,u]=q({left:-9999,top:-9999,ready:!1}),[d,h]=q(()=>"undefined"!=typeof document&&getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom");O(()=>{const e=l.current;if(!e)return;const n=()=>{const n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";h(o);let i,a=n.left+n.width/2-r.width/2;"top"===o?i=n.bottom+8:"left"===o?(a=n.right+8,i=n.top+n.height/2-r.height/2):"right"===o?(a=n.left-r.width-8,i=n.top+n.height/2-r.height/2):i=n.top-r.height-8,a=Math.max(8,Math.min(a,window.innerWidth-r.width-8)),i=Math.max(8,Math.min(i,window.innerHeight-r.height-8)),u({left:a,top:i,ready:!0})};n();const r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t,e.length]),F(()=>pt,[]);const m="top"===d,p=(m?"mt-1":"mb-1")+" max-w-[240px] truncate text-2xs font-medium text-ink-strongest bg-white/80 px-2 py-0.5 rounded shadow-sm ring-2 ring-transparent transition group-hover:ring-blue-400";return ne(
|
|
23
|
-
/* @__PURE__ */ee("div",{ref:l,"data-taskbar-preview":"",style:{position:"fixed",left:c.left,top:c.top,zIndex:ht,maxWidth:"calc(100vw - 16px)",opacity:c.ready?1:0},className:s?"flex gap-2 flex-wrap":"",onMouseEnter:o,onMouseLeave:()=>{pt(),i()},children:e.map(e=>{const t=rt(e.id)??ct(e.label),o=t?function(e){if(ur(e))return null;const t=e.getBoundingClientRect(),n=or(),r=t.left+t.width/2-(n.x+n.w/2),o=t.top+t.height/2-(n.y+n.h/2);return 180*Math.atan2(o,r)/Math.PI}(t):null;/* @__PURE__ */
|
|
24
|
-
return Q("div",{className:"group flex flex-col items-center",onMouseEnter:()=>mt(t),children:[!m&&/* @__PURE__ */ee("span",{className:p,children:e.label}),
|
|
25
|
-
/* @__PURE__ */ee(ft,{id:e.id,label:e.label,maxW:240,maxH:160,titleAbove:!0,onClick:()=>n(e.id),onClose:()=>r(e.id)}),m&&/* @__PURE__ */ee("span",{className:p,children:e.label}),null!==o&&/* @__PURE__ */Q("span",{title:a.taskbar.offscreenHint,className:"mt-1 inline-flex items-center gap-1 rounded bg-amber-500 px-2 py-0.5 text-2xs font-semibold text-on-accent shadow-sm",children:[
|
|
26
|
-
/* @__PURE__ */ee(A,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function yt(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 gt({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=R(),[a,s]=q(null);F(()=>{let e,t;const n=()=>{clearInterval(e),clearTimeout(t),e=void 0},r=()=>{const e=document.getElementById("taskbar-windows");return s(t=>t===e?t:e),!!e},o=()=>{n(),r()||(e=setInterval(()=>{r()&&n()},100),t=setTimeout(n,5e3))};return o(),window.addEventListener("react-os-shell:layout-mode-changed",o),()=>{n(),window.removeEventListener("react-os-shell:layout-mode-changed",o)}},[]);const l=H(Cr,Mr),[,u]=q(0);F(()=>{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]=q(0);F(()=>{const e=()=>d(e=>e+1);return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[]);const h=e=>{const t=ct(e),n=t?.querySelector("[data-window-title]");return n?.textContent?.trim()||e},[m,p]=q(null),[f,w]=q(null),[y,v]=q(null),b=j(null),x=()=>{b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{p(null),w(null)},150)},k=e.filter(e=>!e.route||!ue[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?ue[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 ne(
|
|
27
|
-
/* @__PURE__ */Q(te,{children:[E.map(e=>{const n=e.route?c[e.route]:null,r=e.items[e.items.length-1];let a=!1;if(l){const t=document.querySelector(`[data-modal-id="${l}"]`);if(t){const n=t.querySelector("[data-window-title]"),r=n?.textContent??"";a=e.items.some(e=>r.includes(e.label))}}const s=e.items.length>1,u=e.items.some(e=>{const t=rt(e.id)??ct(e.label);return!!t&&!ur(t)});/* @__PURE__ */
|
|
28
|
-
return Q("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.currentTarget,void(y||(b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{p(n),w(r)},350)));var n,r},onMouseLeave:x,onDoubleClick:e=>{e.stopPropagation(),window.dispatchEvent(new CustomEvent("modal-center",{detail:{windowKey:r.id,label:r.label}}))},onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),b.current&&(clearTimeout(b.current),b.current=null),p(null),w(null),s?v({x:t.clientX,y:t.clientY,items:e.items,label:e.label}):window.dispatchEvent(new CustomEvent("modal-context-menu",{detail:{windowKey:r.id,label:r.label,x:t.clientX,y:t.clientY}}))},style:{width:"var(--window-tab-width, 200px)",fontSize:"var(--window-tab-font-size, 12px)"},"data-tab-group":e.key,className:"group relative flex items-center gap-2 rounded-lg px-3 py-2 font-medium transition-all min-w-0 shrink "+(a?"bg-blue-100/60 border border-blue-400/60 text-blue-700":"bg-gray-50/40 border border-gray-200/40 text-gray-700 hover:bg-gray-200/40"),children:[n&&Y(n)?V(n,{className:"h-3.5 w-3.5 shrink-0"}):/* @__PURE__ */ee(A,{name:"expand",className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),
|
|
29
|
-
/* @__PURE__ */ee("span",{className:"truncate flex-1",children:s?e.label:h(r.label)}),u&&/* @__PURE__ */ee("span",{title:i.taskbar.offscreenDot,className:"shrink-0 h-1.5 w-1.5 rounded-full bg-amber-500"}),s&&/* @__PURE__ */ee(g,{count:e.items.length,label:i.count.windows(e.items.length)}),!s&&/* @__PURE__ */ee("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__ */ee(A,{name:"close",className:"h-3 w-3",strokeWidth:2})})]},e.key)}),
|
|
30
|
-
/* @__PURE__ */ee("div",{className:"flex-1"}),k.length>=2&&/* @__PURE__ */Q("button",{onClick:n,title:i.taskbar.expose,className:"flex items-center gap-1 rounded px-2 py-1 text-2xs font-medium text-blue-600 border border-blue-300 hover:bg-accent-tint transition-colors shrink-0",children:[
|
|
31
|
-
/* @__PURE__ */ee(A,{name:"grid",className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),y&&/* @__PURE__ */Q(C,{portal:!0,minWidth:200,style:yt(y.x,y.y),onClose:()=>v(null),children:[
|
|
32
|
-
/* @__PURE__ */ee(L,{children:y.label}),
|
|
33
|
-
/* @__PURE__ */Q(N,{onClick:()=>{v(null),y.items.forEach(e=>function(e){const t=Wn.get(e);t&&er(t)}(e.id))},children:[
|
|
34
|
-
/* @__PURE__ */ee(A,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),i.taskbar.minimizeAllWindows]}),
|
|
35
|
-
/* @__PURE__ */Q(N,{onClick:()=>{v(null),y.items.forEach(e=>o(e.id))},children:[
|
|
36
|
-
/* @__PURE__ */ee("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */ee("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75h6.5v6.5h-6.5zM13.75 8.75h6.5v6.5h-6.5z"})}),i.taskbar.restoreAllWindows]}),
|
|
37
|
-
/* @__PURE__ */ee(S,{}),
|
|
38
|
-
/* @__PURE__ */Q(N,{danger:!0,onClick:()=>{v(null),y.items.forEach(e=>t(e.id))},children:[
|
|
39
|
-
/* @__PURE__ */ee(A,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${y.items.length})`]})]}),m&&f&&/* @__PURE__ */ee(wt,{items:m,anchorEl:f,onActivate:e=>{o(e),p(null),w(null)},onClose:e=>{t(e),p(null),w(null)},onMouseEnter:()=>{b.current&&(clearTimeout(b.current),b.current=null)},onMouseLeave:x})]}),a)}var vt=["/login","/forgot-password","/reset-password","/force-change-password"];function bt({children:e,windowAccentForRoute:t}){const n=re(),r=vt.some(e=>n.pathname.startsWith(e)),[o,i]=q([]),a=j(o);O(()=>{a.current=o},[o]);const s=H(ke,xe,xe),l=j(/* @__PURE__ */new Map),c=e=>{const t=Ie(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};F(()=>{st.clear();for(const e of o)e.route&&st.set(e.id,e.route)},[o]);const u=B(e=>{i(t=>t.filter(t=>t.id!==e))},[]),d=B(e=>{var t;rt(e)||ot(e)?(t=e,window.dispatchEvent(new CustomEvent(Nr,{detail:{windowKey:t}}))):u(e)},[u]),h=(e,t=!1)=>{const n=Dn;t&&et.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,(Pn.get(i)??-1)>a)||Qn(o),t&&et.delete(e)},50)},m=(e,t,n)=>{const r=Ee;if(n||!r)return[...e,t];const o=function(e,t,n){if(!Ie(t))return e.length;if(t.shellOwned&&Ke(t,n.home))return 0;const r=Ke(t,n.home)?void 0:Re(t)?.key;if(r){let t=-1;if(e.forEach((e,o)=>{Ie(e)&&!Ke(e,n.home)&&Re(e)?.key===r&&(t=o)}),t>=0)return t+1}if("page"===t.type&&t.route&&!Ke(t,n.home)&&n.favorites.includes(t.route))return e.length>0&&Ke(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=>Ie(e[t])&&!Ke(e[t],n.home)?Re(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:xe(),favorites:r.favorites});return[...e.slice(0,o),t,...e.slice(o)]},p=B(e=>{i(t=>function(e,t){const n=new Set(t),r=new Map(e.map(e=>[e.id,e])),o=t.map(e=>r.get(e)).filter(e=>!!e);if(o.length!==n.size)return e;let i=0;const a=e.map(e=>n.has(e.id)?o[i++]:e);return a.every((t,n)=>t===e[n])?e:a}(t,e))},[]),f=B((e,t,n,r,o,a={})=>{if(!ue[e]||!se(ue[e]))return;const s=`${e}:${t}`,l=at();i(i=>{const c=i.find(n=>n.entityType===e&&String(n.entityId)===String(t));return c?(h(c.id),i):(h(s,!0),m(i,{id:s,type:"modal",label:r||t,route:o||window.location.pathname,entityType:e,entityId:t,entitySnapshot:je(n),openedFrom:l},!!a.append))})},[]),w=B((e,t={})=>{if(!ue[e]||!ae(ue[e]))return;const n=ue[e],{reuse:r=!1,background:o=!1,shellOwned:s,search:l,append:c=!1}=t,u=e=>{var t;o?(t=e,qn.add(t)):h(e)};if(n.widget){const t=a.current.find(t=>"page"===t.type&&t.route===e);if(t)return void d(t.id)}const p=at();i(t=>{if(n.multiInstance){const i=t.filter(t=>"page"===t.type&&t.route===e);if(r&&!l&&i.length>0)return o||h(i[i.length-1].id),t;const a=`page:${e}:${Math.random().toString(36).slice(2,8)}`;return u(a),m(t,{id:a,type:"page",label:n.label,route:e,openedFrom:p,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)}const i=t.find(t=>"page"===t.type&&t.route===e);if(i)return n.widget?t:(o||h(i.id),l&&i.pageSearch!==l?t.map(e=>e===i?{...e,pageSearch:l}:e):t);const a=`page:${e}`;return u(a),m(t,{id:a,type:"page",label:n.label,route:e,openedFrom:p,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)})},[d]),y=B(()=>{},[]),g=B(()=>{},[]),v=d,b=d;/* @__PURE__ */
|
|
40
|
-
return Q(Ue.Provider,{value:{openWindows:o,openEntity:f,openPage:w,reorderWindows:p,closeEntity:v,minimize:y,items:[],openItems:o,restore:g,remove:b,restoreIfMinimized:()=>!1},children:[e,
|
|
41
|
-
/* @__PURE__ */ee(gt,{openWindows:o,onRemove:d,onSplitView:Ur,onActivate:e=>{document.querySelectorAll("[data-modal-panel]").forEach(t=>{const n=t.querySelector("[data-window-title]");if(n?.textContent?.includes(e)){const e=t.getAttribute("data-modal-id");e&&Qn(e)}})},onActivateById:it}),
|
|
42
|
-
/* @__PURE__ */ee(Xr,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
return ee(we.Provider,{value:c(e),children:/* @__PURE__ */ee(Ne,{fallback:(t,n)=>/* @__PURE__ */ee(Vr,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */ee(Ce,{error:t,onReload:n})}),children:/* @__PURE__ */ee(Gt,{spec:Je(e),children:/* @__PURE__ */ee(to,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */ee(Ze,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */ee(nt,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var xt=400;function kt({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=j(null),s=j(!1);n&&!s.current&&(a.current="undefined"==typeof document?null:document.activeElement),s.current=n;const l=j(!1),c=j(void 0),u=j(i),d=u.current&&!i;u.current=i;const h=()=>{l.current=!0,clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},xt)};F(()=>{n&&!r&&h()},[n,r]),F(()=>{d&&n&&!r&&h()},[d]),F(()=>()=>clearTimeout(c.current),[]),F(()=>{if(!n||r||!o||i||!l.current)return;l.current=!1;const a=e.current;if(!a||a.contains(document.activeElement))return;if(document.activeElement?.closest('[aria-modal="true"]'))return;const s=t.current?E(t.current)[0]:void 0;s?s.focus():(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus())},[n,r,o,i,e,t]),O(()=>{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 Et=null,Mt=/* @__PURE__ */new Set;function Ct(){return Et}function Nt(e){if(Et!==e){Et=e;for(const e of Mt)e()}}function St(e){return Mt.add(e),()=>{Mt.delete(e)}}var Lt=!1,Tt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},zt=()=>{};function At(e){Lt=e,Tt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function Dt(e,t){Lt&&("submenu"===e?Tt.submenus++:Tt.menus++,Tt.menuKey=t)}function Pt(e){if(!Lt)return zt;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!Lt)return;const r=performance.now()-t;"move"===e?Tt.moveMs+=r:Tt.resizeMs+=r}}function It(){const e=Tt;return Tt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var Rt=/* @__PURE__ */new Set([T,b]),Kt=e=>Rt.has(e)||"function"==typeof e&&"badge"===e.titleRole,Wt=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),$t=/* @__PURE__ */new Set(["svg"]);function Ot(e){const t=[],n={text:"",accessories:[],badges:[],actions:[]};return jt(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function jt(e,t,n){if(null==e||"boolean"==typeof e)return;if("string"==typeof e||"number"==typeof e)return void n.push(String(e));if(Array.isArray(e))return void e.forEach(e=>jt(e,t,n));if(!Y(e))return;const r=e;if(r.type===w)return void(void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text));if(r.type===U)return void X.toArray(r.props.children).forEach(e=>jt(e,t,n));if("string"==typeof r.type){if($t.has(r.type))return;if(!Wt.has(r.type))return n.push(" "),X.toArray(r.props.children).forEach(e=>jt(e,t,n)),void n.push(" ")}const o=V(r,{key:`title-part-${t.accessories.length}`});t.accessories.push(o),(Kt(r.type)?t.badges:t.actions).push(o)}var Ft=/* @__PURE__ */new Map,qt=/* @__PURE__ */new Set,Ht=0;function Bt(){Ht++,qt.forEach(e=>e())}function Yt(e){return Ft.get(e)}function Ut(e){return qt.add(e),()=>{qt.delete(e)}}function Xt(){return Ht}var Vt=K(""),_t=K(null);function Gt({spec:e,children:t}){/* @__PURE__ */
|
|
45
|
-
return ee(_t.Provider,{value:e,children:t})}var Jt=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),Zt='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600',Qt='button, a[href], summary, [role="button"], [role="link"], [role="menuitem"], select';function en(e){return tn(e).replace(/\s+/g," ").trim()}function tn(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(tn).join("");if(Y(e)){const t=e,n="string"==typeof t.type?t.type:"";return Jt.has(n)?"":` ${tn(t.props?.children)} `}return""}function nn(e){const t=W(Vt);F(()=>{if(!t)return;const n=n=>{n.detail===t&&e()};return window.addEventListener("widget-open-settings",n),()=>window.removeEventListener("widget-open-settings",n)},[e,t])}var rn={};function on(e,t,n){const r=W(Vt);F(()=>{if(!r)return;rn[r]||(rn[r]=[]);const o={label:e,icon:n,onClick:t};return rn[r].push(o),()=>{rn[r]=(rn[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function an({title:e}){const t=j(null);return F(()=>{const n=setTimeout(()=>{const n=t.current?.closest("[data-modal-id]"),r=n?.getAttribute("data-modal-id");r&&window.dispatchEvent(new CustomEvent("window-title-update",{detail:{id:r,title:e}}))},0);return()=>clearTimeout(n)},[e]),/* @__PURE__ */ee("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function sn(e){}var ln=K(null);function cn(){return W(Vt)}function un(){const e=H(Cr,Mr),t=W(ln);return t?.active??(Tn.length<=1||null!=e)}function dn({children:e,position:t="right",quiet:n=!1}){const r=W(ln),[o,i]=q(null);return F(()=>{if(!r)return;const e="left"===t?r.leftRef:r.rightRef,o=()=>!!e.current&&(i(e.current),n||r.notify(),!0);if(o())return;const a=setInterval(()=>{o()&&clearInterval(a)},50),s=setTimeout(()=>clearInterval(a),2e3);return()=>{clearInterval(a),clearTimeout(s)}},[r,t,n]),o?ne(e,o):null}function hn({onClick:e,children:t,className:n}){const r=W(ln);/* @__PURE__ */
|
|
46
|
-
return ee("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 mn="erp_window_positions",pn={};try{const e=localStorage.getItem(mn);e&&(pn=JSON.parse(e))}catch{}var fn=null;function wn(){fn&&clearTimeout(fn),fn=setTimeout(()=>{try{localStorage.setItem(mn,JSON.stringify(pn))}catch{}},500)}var yn="erp_activation_order",gn=[];try{const e=localStorage.getItem(yn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(gn=t)}catch{}var vn=null;function bn(){vn&&clearTimeout(vn),vn=setTimeout(()=>{try{localStorage.setItem(yn,JSON.stringify(gn))}catch{}},500)}function xn(e,t){pn[e]||(pn[e]=t,wn())}function kn(e){return pn[e]?{...pn[e]}:null}function En(e,t){pn[e]=t,wn()}function Mn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(pn))n(pn[e],r,o)&&(delete pn[e],i=!0);i&&wn()}var Cn={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},Nn=4e3,Sn=()=>{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"},Ln={small:.8,medium:1,large:1.25,maximized:1.25},Tn=[],zn=/* @__PURE__ */new Set,An=/* @__PURE__ */new Set,Dn=0,Pn=/* @__PURE__ */new Map;var In=0;function Rn(){return In}function Kn(){In++,zn.forEach(e=>e())}var Wn=/* @__PURE__ */new Map,$n=/* @__PURE__ */new Map,On=/* @__PURE__ */new Map;function jn(){for(let e=Tn.length-1;e>=0;e--){const t=On.get(Tn[e]);if(t?.tab)return t.owner}return null}function Fn(){return H(Cr,jn,()=>null)}var qn=/* @__PURE__ */new Set;var Hn=null;function Bn(e){Hn=null,Qn(e)}function Yn(e){Hn=e;const t=Wn.get(e);t&&Bn(t)}var Un=/* @__PURE__ */new Map;function Xn(e){return Un.get(e)?.holdsChanges()??!1}function Vn(e){const t=Un.get(e);return t?t.ask():Promise.resolve(!0)}function _n(e){Hn===e&&(Hn=null)}function Gn(e,t,n){if(n&&On.set(e,n),t)if(Wn.set(t,e),$n.set(e,t),qn.delete(t)){Tn.unshift(e);const n=gn.indexOf(t);-1!==n&&gn.splice(n,1),gn.unshift(t),bn()}else!function(e,t){const n=gn.indexOf(t);if(-1===n)return void Tn.push(e);let r=Tn.length;for(let e=0;e<Tn.length;e++){const t=$n.get(Tn[e]);if(t&&gn.indexOf(t)>n){r=e;break}}Tn.splice(r,0,e)}(e,t),-1===gn.indexOf(t)&&(gn.push(t),bn());else Tn.push(e);Kn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&Hn===t&&Bn(e)}function Jn(e){return e?On.get(e)?.owner??$n.get(e)??null:null}var Zn=/* @__PURE__ */new Set;function Qn(e){const t=Jn(Mr()),n=Tn.indexOf(e);-1!==n&&Tn.splice(n,1),Tn.push(e);const o=On.get(e);if(o?.root&&o.tab&&r()){const e=Tn.filter(e=>{const t=On.get(e);return!!t&&!t.root&&t.owner===o.owner});for(const t of e)Tn.splice(Tn.indexOf(t),1),Tn.push(t)}An.delete(e);const i=$n.get(e);if(i){const e=gn.indexOf(i);-1!==e&&gn.splice(e,1),gn.push(i),bn(),Hn&&Hn!==i&&(Hn=null)}Kn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const a=Jn(Mr());a&&a!==t&&Zn.forEach(e=>e(a))}function er(e){const t=Tn.indexOf(e);-1!==t&&Tn.splice(t,1),An.add(e),Pn.set(e,++Dn);const n=$n.get(e);if(n){const e=gn.indexOf(n);-1!==e&&(gn.splice(e,1),bn())}Kn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var tr=/* @__PURE__ */new Set;var nr=8,rr=32;function or(){return e()}var ir=u.windowBar,ar=80,sr=384,lr=400;function cr(e,t=or()){const n=Math.min(Math.max(e.x,t.x+ar-e.w),t.x+t.w-ar),r=Math.min(Math.max(e.y,t.y),t.y+t.h-ir);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function ur(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=or();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 dr(e){const t=or(),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 hr=null;function mr(e){const t=(hr||((hr=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none",`z-index: ${P.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(hr)),hr);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 pr(){hr&&(hr.style.opacity="0",hr.style.display="none")}var fr=[{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"}],wr=350,yr=200;function gr({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o}){const[i,a]=q(!1),s=j(void 0),l=j(void 0);F(()=>()=>{clearTimeout(s.current),clearTimeout(l.current)},[]);const c=()=>{clearTimeout(l.current),s.current=setTimeout(()=>a(!0),wr)},u=()=>{clearTimeout(s.current),l.current=setTimeout(()=>a(!1),yr)};/* @__PURE__ */
|
|
47
|
-
return Q("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u,children:[
|
|
48
|
-
/* @__PURE__ */ee("button",{onClick:t,onFocus:c,onBlur:u,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */ee("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(l.current),onMouseLeave:u,className:"absolute right-0 top-full z-30 mt-1 grid w-max grid-cols-2 gap-1 rounded-lg border border-line bg-surface p-2 shadow-lg",children:fr.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */ee("button",{type:"button","aria-label":o[t],title:o[t],onClick:()=>{a(!1),n(e)},onFocus:()=>clearTimeout(l.current),onBlur:u,className:"relative h-7 w-11 rounded border border-gray-300 bg-gray-50 hover:border-blue-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",children:/* @__PURE__ */ee("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var vr="rosh-gesture-style";var br={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},xr=4;function kr(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(vr))return;const e=document.createElement("style");e.id=vr,e.textContent="body.rosh-gesturing [data-modal-panel]{will-change:transform}",document.head.appendChild(e)}();try{e.setPointerCapture(t)}catch{}document.body.classList.add("rosh-gesturing");const o=document.createElement("div");o.setAttribute("data-drag-shield",""),o.style.cssText=`position:fixed;inset:0;z-index:2147483647;cursor:${n};background:transparent;touch-action:none`,document.body.appendChild(o);const i=Pt(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function Er(e){const t=Tn.indexOf(e);if(-1===t)return-1;const n=P.window+t*P.windowStep,o=On.get(e);if(!o||o.root||!o.tab||!r())return n;let i=-1;for(const[e,t]of On){if(!t.root||t.owner!==o.owner)continue;const n=Tn.indexOf(e);-1!==n&&(i=Math.max(i,P.window+n*P.windowStep))}return i>=n?i+2+Math.min(t,7):n}function Mr(){return Tn[Tn.length-1]||null}function Cr(e){return zn.add(e),()=>{zn.delete(e)}}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=Tn.length-1;e>=0;e--)tr.has(Tn[e])||Tn.splice(e,1);gn=gn.filter(e=>{const t=Wn.get(e);return null!=t&&tr.has(t)}),bn(),Kn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var Nr="modal-close-request";function Sr(e){H(Cr,Rn);const t=W(ln);if(Tn.length<=1)return!0;if(e){const t=Wn.get(e);if(null!=t)return Mr()===t}return t?.active??null!=Mr()}var Lr=!1,Tr=/* @__PURE__ */new Set;function zr(e){return Tr.add(e),()=>Tr.delete(e)}function Ar(){return Lr}function Dr(e){Lr!==e&&(Lr=e,Tr.forEach(e=>e()))}function Pr(){Dr(!Lr)}function Ir(){Dr(!1)}var Rr=null,Kr=/* @__PURE__ */new Set;function Wr(e){return Kr.add(e),()=>Kr.delete(e)}function $r(){return Rr}function Or(e){Rr!==e&&(Rr=e,Kr.forEach(e=>e()))}var jr=null,Fr=/* @__PURE__ */new Set;function qr(e){return Fr.add(e),()=>Fr.delete(e)}function Hr(){return jr}function Br(e){jr!==e&&(jr=e,Fr.forEach(e=>e()))}function Yr(){if(!jr)return void Dr(!1);Or(jr),Br(null),Dr(!1)}function Ur(){Dr(!Lr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function Xr(){const e=H(zr,Ar),[t,n]=q(e),[r,o]=q(e);return F(()=>{if(e){n(!0);const e=requestAnimationFrame(()=>o(!0));return()=>cancelAnimationFrame(e)}o(!1);const t=setTimeout(()=>n(!1),280);return()=>clearTimeout(t)},[e]),t&&"undefined"!=typeof document?ne(
|
|
49
|
-
/* @__PURE__ */ee("div",{onMouseDown:e=>{e.stopPropagation(),Dr(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:P.expose,cursor:"pointer",opacity:r?1:0,transition:"opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1)",pointerEvents:r?"auto":"none"}}),document.body):null}function Vr({open:t,onClose:i,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:w,bodyScroll:g,onMinimize:b,initialBox:E,actions:L,actionsLeft:T,editing:D=!1,edit:K,allowPinOnTop:$,initialPosition:U,widget:X,compact:J,appStyle:Z,flushBody:re,autoHeight:oe,autoMinHeight:ie,autoWidth:ae,widgetMenu:se,dimensions:le,windowKey:ce,openedFromKey:ue,accentRgb:de,children:he}){const[me,pe]=q(()=>r()),fe=x()&&!me,ye=k()&&!!X,[ge,ve]=q(0),[be,xe]=q(!1),ke=j(null),Ee=j(0);F(()=>{Ee.current=ge},[ge]);const Me=B(e=>{fe&&(ke.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},xe(!0),Nt(ue??null))},[fe,ue]),Ce=H(St,Ct);F(()=>{if(!be)return;const e=e=>{if(!ke.current)return;const t=e.clientX-ke.current.startX;if(Math.abs(e.clientY-ke.current.startY)>Math.abs(t)+12)return ke.current=null,xe(!1),ve(0),void Nt(null);ve(Math.max(0,t))},t=()=>{if(!ke.current)return;const e=.3*window.innerWidth,t=Ee.current>e;ke.current=null,xe(!1),t?(ve(window.innerWidth),setTimeout(()=>{i(),ve(0),Nt(null)},180)):(ve(0),Nt(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)}},[be]);const[Le,ze]=q(c),Ae=R(),De=Ae.window;F(()=>{ze(c)},[c]);const Pe=_(()=>en(Le).trim()||void 0,[Le]),Ie=G(),[Re,Ke]=q(!1),We=j(!1),[$e,Oe]=q(!1),[je,Fe]=q(null),qe=W(_t),He=W(we),{prefs:Be,save:Ye}=M(),Ue=!!Be.window_accent_stripe,Xe=Be.favorite_documents||[],_e=!!qe&&Xe.some(e=>e.entityType===qe.entityType&&e.entityId===qe.entityId),Je=B(()=>{if(!qe)return;const e=_e?Xe.filter(e=>!(e.entityType===qe.entityType&&e.entityId===qe.entityId)):[...Xe,{entityType:qe.entityType,entityId:qe.entityId,label:qe.label}];Ye({favorite_documents:e})},[qe,_e,Xe,Ye]),[Ze,Qe]=q(null),[et,tt]=q("top-right"===U?"right":"left"),nt=j(!1),rt=j(null);O(()=>{const e=rt.current;e&&(de?e.style.setProperty("--window-accent-rgb",de):e.style.removeProperty("--window-accent-rgb"))},[de]);const ot=j(!1),it=j(null),at=j(null),st=j(null),[lt,ct]=q(!1),ut=j(null),dt=j(null),ht=j(null),[mt,pt]=q(!1);O(()=>{const e=dt.current,t=ht.current;if(!e||!t)return;const n=()=>pt(function(e,t){return e.scrollWidth>t.clientWidth}(t,e));if(n(),"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[null!=w&&!1!==w]);const ft=!!K&&!X&&!J&&!Z&&(K.editing||"hidden"!==K.state),wt=!!(w||L||T)||lt||ft,yt=W(Se),gt=""!==W(Vt),vt=j(null);vt.current=He?{owner:He.key,tab:He.tab,root:!gt}:null;const bt=ce||(He&&!gt?He.key:null),xt=!!yt&&!gt&&yt.enabled&&yt.hasState&&(D||yt.declaredEditable)&&!yt.handMounted&&wt&&!X&&!J&&!Z&&!fe,Et=/* @__PURE__ */ee(A,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),Mt=u&&Y(u)?V(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??Et,Lt=()=>/* @__PURE__ */ee("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();Fe(e=>e?null:{x:t.left,y:t.bottom+4})},className:"shrink-0 p-0.5 rounded hover:bg-gray-200/50 transition-colors",title:"Window menu",children:Mt}),Tt=40,{minimize:zt,items:At,restoreIfMinimized:Dt,openWindows:Pt}=Ge(),It=j(`modal-${Math.random().toString(36).slice(2,8)}`).current;F(()=>{if(X)return tr.add(It),()=>{tr.delete(It)}},[X,It]),F(()=>{const e=e=>{const t=e.detail;t?.id===It&&ze(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[It]);const[Rt,Kt]=q(P.window),Wt=function(e){const t=H(Cr,Mr);return Tn.length<=1||t===e}(It),$t=j(K);$t.current=K;const jt=!!K&&!K.editing&&"enabled"===K.state;F(()=>{if(!t||!Wt||!jt)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),$t.current?.onEdit())};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Wt,jt]);const qt=function(e){return H(Cr,()=>An.has(e))}(It);kt({panelRef:rt,bodyRef:it,open:t,widget:!!X,active:Wt,minimized:qt});const Ht=H(zr,Ar),Yt=H(Wr,$r),Ut=H(qr,Hr),Xt=!$&&!X,Gt=Ht&&Xt,[Jt,tn]=q(!1),nn=Gt&&Ut===It,[on,an]=q(!1),sn=on&&Xt&&Yt===It?"picked":null,cn=j(Gt);F(()=>{if(cn.current&&!Gt){an(!0);const e=setTimeout(()=>{an(!1),Rr===It&&Or(null)},700);return cn.current=Gt,()=>clearTimeout(e)}cn.current=Gt},[Gt,It]),F(()=>{Gt||tn(!1)},[Gt]),F(()=>{const e=at.current,t=st.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>ct(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[t]),F(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&rt.current){const t=rt.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=at.current,n=st.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const un=j(!1),dn=B(e,[]),hn=B(()=>{const t=e(),n=le?le[0]:Cn[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=Ln[Sn()],l=le?Math.min(le[1],i):(()=>{const e=("sm"===h?500:"md"===h?600:"lg"===h?700:"xl"===h?800:920)*s;return Math.max(320,Math.min(e,t.h-80))})(),c="cascade"!==(getComputedStyle(document.documentElement).getPropertyValue("--window-position")?.trim()||"cascade")||r()?0:30*(Tn.length-1),u=Math.max(Tt,(i-l)/2),d=(o-a)/2,m=t.h-Tt-l-u;return"top-right"===U?{x:t.x+t.w-a-Tt,y:t.y+Tt,w:a,h:l}:"top-left"===U?{x:t.x+Tt,y:t.y+Tt,w:a,h:l}:{x:t.x+Math.max(Tt,(o-a)/2+Tt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),mn=j(!1);t||(mn.current=!1);const fn=ce||d||null;F(()=>{if(!t)return;Gn(It,fn,vt.current??void 0),ce||Qn(It),un.current=!1,Kt(Er(It));const e=()=>{Kt(Er(It))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===ce;if(!e.label)return!1;const t=rt.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(Qn(It),Dn.current)return;const t=or(),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;vn({x:i,y:a,w:n,h:o}),Hn(!1)},i=e=>{const t=e.detail;r(t)&&(Qn(It),Fe({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==ce)return;Qn(It);const t=Bn.current,n=function(e,t=or()){const n=Math.min(e.w,t.w),r=Math.min(e.h,t.h);return{w:n,h:r,x:Math.min(Math.max(e.x,t.x),t.x+t.w-n),y:Math.min(Math.max(e.y,t.y),t.y+t.h-r)}}(t);if(n.x===t.x&&n.y===t.y&&n.w===t.w&&n.h===t.h)return;const r=rt.current,o="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(r&&!o){let e=!1;const t=()=>{e||(e=!0,r.style.transition="",window.dispatchEvent(new CustomEvent("modal-geometry")))};r.style.transition="left .28s ease, top .28s ease, width .28s ease, height .28s ease",r.addEventListener("transitionend",t,{once:!0}),window.setTimeout(t,400)}vn(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=Tn.indexOf(e);-1!==t&&(Tn.splice(t,1),Kn()),An.delete(e),Pn.delete(e),On.delete(e);const n=$n.get(e);n&&($n.delete(e),Wn.delete(n))}(It),window.removeEventListener("modal-reorder",e),window.removeEventListener("modal-split-view",n),window.removeEventListener("modal-center",o),window.removeEventListener("modal-reveal",a),window.removeEventListener("modal-context-menu",i),window.dispatchEvent(new CustomEvent("modal-reorder"))}},[t,It,fn,dn]);const yn=!X&&"maximized"===Sn(),[gn,vn]=q(()=>{if(fn&&pn[fn]){const e={...pn[fn]};return le&&(e.w=le[0],oe||(e.h=le[1])),cr(e)}return E?{x:E.x,y:E.y,w:E.w,h:E.h}:yn?dn():hn()}),[bn,xn]=q(()=>!oe),kn=j(me),En=j(null);F(()=>{const e=()=>{const e=r();e!==kn.current&&En.current?.(e),kn.current=e,pe(e),Kt(Er(It))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[It]);const Mn=me&&!!He?.tab&&!gt&&!X&&!fe,zn=Mn,Dn=j(zn);Dn.current=zn;const In=Fn(),Rn=me&&!!He?.tab&&!X&&!fe&&!Ht&&In!==He.key,jn=!!X&&me&&!Ht&&null!==In,[qn,Hn]=q(()=>fn&&pn[fn]||E?zn:zn||yn),Bn=j(gn);Bn.current=gn;const Yn=j(qn);O(()=>{Yn.current=qn},[qn]),O(()=>{if(bn||Mn)return;const e=rt.current,t=it.current;if(!e||!t)return;const n=ie??(X?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const s=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&l.unobserve(a),l.observe(c),a=c);const u=e.offsetHeight-t.offsetHeight,d=t.style.flex,h=t.style.overflowY,m=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const p=t.offsetHeight,f=c.offsetHeight;t.style.flex=d,t.style.height=m,t.style.overflowY=h;const w=c.offsetHeight>f+4,y=Math.max(n,window.innerHeight-r-Math.max(0,Bn.current.y)-24),g=w?Math.min(Bn.current.h,y):Math.min(Math.max(n,u+p),y),v=Math.abs(g-o)>1;v&&(o=g,vn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),X||(g<=n?i&&(clearTimeout(i),i=null):(v||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&xn(!0)},160)))},l=new ResizeObserver(s);s(),ut.current&&l.observe(ut.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[bn,X,ie,wt,Mn]),O(()=>{if(!oe||!bn||X||!t)return;const e=ut.current;if(!e)return;let n=e.offsetHeight;const r=new ResizeObserver(()=>{if(!e.isConnected)return;const t=e.offsetHeight,r=t-n,o=t>0!=n>0;if(n=t,!o||0===r||qn)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=ie??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,Bn.current.y)-24);vn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[oe,bn,X,t,qn,ie]);const Xn=!1!==ae&&!X&&!Z&&!fe,[Vn,_n]=q(()=>!Xn);O(()=>{if(Vn||!t)return;if(!Xn||qn)return void _n(!0);const n=rt.current,r=it.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let i=Bn.current.w,c=0;const u=()=>_n(!0),d=()=>{c=0;const t=Bn.current;if(Math.abs(t.w-i)>1||document.body.classList.contains("rosh-gesturing"))return void u();const d=e(),h=d.w-80;if(t.w>=h)return void u();const m=[],p=[];for(const e of[r,...Array.from(r.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||o.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(m.push(e),p.push(t))}if(!m.length)return;const f=Math.min(h,t.w+Math.max(...p)),w=f-t.w,y=n.style.width;n.style.width=`${f}px`;const g=m.map((e,t)=>({over:p[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{a(e,w)||o.add(m[t])});const v=s(t,l(t.w,w,g),d,Tt);v!==t&&(i=v.w,vn(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,Nn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Vn,t,Xn,qn]);const Jn=j(null),Zn=!(!He?.tab||gt||X||fe);En.current=t=>{if(!Zn)return;if(t)return Jn.current||(Jn.current={box:{...Bn.current},maximized:Yn.current}),void(Yn.current=!0);const r=Jn.current;Jn.current=null;const o=e();if(r?.maximized)return Yn.current=!0,Hn(!0),void vn(o);const i=r?.box??(fn?pn[fn]:void 0);if(Yn.current=!1,Hn(!1),i&&!n(i,o,!1)){const e={...i};le&&(e.w=le[0],oe||(e.h=le[1])),vn(cr(e))}else vn(hn())},F(()=>{zn&&(Yn.current=!0,Hn(!0),vn(dn()))},[zn,dn]),F(()=>{if(X)return;const e=()=>{const e=fn?pn[fn]:void 0;if(Yn.current=!1,Hn(!1),e){const t={...e};le&&(t.w=le[0],oe||(t.h=le[1])),vn(cr(t))}else vn(hn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[X,hn,fn]),F(()=>{t&&fn&&!Mn&&(pn[fn]=gn,wn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[gn,t,fn,Mn]),F(()=>{if(!t)return;const e=()=>{Yn.current?vn(dn()):document.body.classList.contains("rosh-gesturing")||vn(cr)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return qn&&(n=new MutationObserver(e),n.observe(document.body,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["class"]})),()=>{window.removeEventListener("resize",e),window.removeEventListener(o,e),n?.disconnect()}},[t,qn,dn]),F(()=>{if(t&&(Ke(!1),We.current=!1,nt.current=!1,_n(!Xn),!Dn.current)){if(fn&&pn[fn]){const e=pn[fn];return void vn(t=>cr({...e,...oe?{h:t.h}:{},...Xn?{x:t.x,w:t.w}:{}}))}E&&(vn({x:E.x,y:E.y,w:E.w,h:E.h}),Hn(E.maximized))}},[t]),F(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{rt.current?.contains(t.target)&&!We.current&&(We.current=!0,e=setTimeout(()=>Ke(!0),0))};return document.addEventListener("input",n,!0),document.addEventListener("change",n,!0),()=>{clearTimeout(e),document.removeEventListener("input",n,!0),document.removeEventListener("change",n,!0)}},[t,m]);const ir="auto"===m?Re:!0===m,ar=He&&!gt?He.key:null,ur=_(()=>Ot(Le),[Le]),hr=j({shortcutSpec:qe,isOnDesktop:_e,toggleDesktopShortcut:Je,taskbarStrings:Ae.taskbar});O(()=>{hr.current={shortcutSpec:qe,isOnDesktop:_e,toggleDesktopShortcut:Je,taskbarStrings:Ae.taskbar}});const fr=j(null);fr.current||(fr.current={open:(e,t)=>Fe({x:e,y:t}),items:()=>{const e=hr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of rn[It]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),F(()=>{if(t&&ar)return()=>{return e=ar,void(Ft.delete(e)&&Bt());var e}},[t,ar]),Ve(!(ce||!t)&&ir);const wr=B(()=>ir||"auto"===m&&We.current,[ir,m]),yr=B(async e=>{if(nt.current)return!1;if(!wr())return!0;nt.current=!0;const t=Pe,n="close"===e?"Are you sure you want to close?":"discard"===e?"Are you sure you want to stop editing?":"Are you sure you want to continue?",r=await y({title:"Discard changes?",message:t?`“${t}” has unsaved changes. ${n} All changes will be lost.`:`You have unsaved changes. ${n} All changes will be lost.`,confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});return nt.current=!1,r},[wr,Pe]),vr=B(()=>nt.current?Promise.resolve():wr()?yr("close").then(e=>{e&&i()}):(i(),Promise.resolve()),[wr,yr,i]),Sr=B(async()=>{await yr("discard")&&(We.current=!1,Ke(!1),$t.current?.onDiscard())},[yr]),Lr=B(async()=>{const e=await yr("switch");return e&&(We.current=!1,Ke(!1)),e},[yr]),Tr=j(()=>!1);O(()=>{Tr.current=wr}),O(()=>{if(!t||!ce)return;const e={holdsChanges:()=>Tr.current(),ask:Lr};return Un.set(ce,e),()=>{Un.get(ce)===e&&Un.delete(ce)}},[t,ce,Lr]),O(()=>{if(!t||!bt)return;const e=e=>{e.detail?.windowKey===bt&&vr()};return window.addEventListener(Nr,e),()=>window.removeEventListener(Nr,e)},[t,bt,vr]);const Pr=j(null),Ir=B(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Fe(null),Qn(It),Dn.current)return void e.preventDefault();e.preventDefault();const t=e.currentTarget,n=e.pointerId;let r=null;const o=e.clientX,i=e.clientY,a=rt.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Pr.current){const t=Pr.current;Pr.current=null,d=t.w,u=t.h;const n=s?Math.min(Math.max(20,e.clientX-s.left),t.w-20):t.w/2;l=e.clientX-n,c=e.clientY-12,a&&(a.style.width=`${d}px`,a.style.height=`${u}px`,a.style.left=`${l}px`,a.style.top=`${c}px`)}else l=s?s.left:Bn.current.x,c=s?s.top:Bn.current.y,u=s?s.height:Bn.current.h,d=s?s.width:Bn.current.w;Hn(!1),vn(e=>({...e,x:l,y:c,w:d,h:u}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<xr&&Math.abs(e.clientY-i)<xr)return;r=kr(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},!X){const t=function(e,t){const n=or(),r=e<=n.x+nr,o=e>=n.x+n.w-nr,i=t<=n.y+nr,a=t>=n.y+n.h-nr,s=e<=n.x+rr,l=e>=n.x+n.w-rr,c=t<=n.y+rr,u=t>=n.y+n.h-rr;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?mr(dr(t)):pr())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),pr();const e=cr({...Bn.current});if(Bn.current=e,!X&&h){Pr.current={x:l,y:c,w:d,h:u};const e=dr(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 vn(e)}if(X){const t=e.x+e.w/2,n=window.innerWidth/2;tt(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),vn(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),Kr=B((e,t)=>{if(0!==e.button)return;e.preventDefault(),e.stopPropagation();const n=e.currentTarget,r=e.pointerId;let o=null;const i=e.clientX,a=e.clientY,s=rt.current,l=s?.getBoundingClientRect(),c=l?l.left: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,p="ne"===t||"nw"===t||"n"===t,f="se"===t||"ne"===t||"e"===t,w="se"===t||"sw"===t||"s"===t;Hn(!1),vn({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)<xr&&Math.abs(e.clientY-a)<xr)return;o=kr(n,r,br[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(sr,d+e)),w&&(i=Math.max(lr,h+t)),m){const t=Math.max(sr,d-e);n=c+d-t,o=t}if(p){const e=Math.max(lr,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?.(),vn({...Bn.current})};window.addEventListener("pointermove",b),window.addEventListener("pointerup",x)},[]),jr=B(e=>{if(e.target.closest("button, input, a, kbd, select, textarea"))return;const t={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!t&&"Enter"!==e.key)return;if(e.preventDefault(),e.stopPropagation(),Qn(It),"Enter"===e.key)return void(qn?(Hn(!1),vn(hn())):(Hn(!0),vn(dn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Pr.current||(Pr.current={...Bn.current})};if(r<0)return e(),Hn(!0),void vn(dn());if(r>0){if(qn)return Hn(!1),void vn(hn());if(Pr.current){const e=cr(Pr.current);return Pr.current=null,Bn.current=e,void vn(e)}return void er(It)}e(),Hn(!1);const t=dr(n<0?"left":"right");return Bn.current=t,void vn(t)}if(qn)return;const o=Bn.current,i=e.shiftKey?{...o,w:Math.max(sr,o.w+24*n),h:Math.max(lr,o.h+24*r)}:cr({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Bn.current=i,vn(i)},[It,qn,hn,dn]),Fr=B(e=>{Pr.current||(Pr.current={...Bn.current}),Hn(!1);const t=dr(e);Bn.current=t,vn(t),Qn(It)},[It]),Br=zn||Gt?{}:{tabIndex:0,role:"group","aria-label":Pe?`${Pe} — ${De.windowSuffix}`:De.windowSuffix,"aria-keyshortcuts":"ArrowUp ArrowDown ArrowLeft ArrowRight Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+ArrowRight Control+ArrowUp Control+ArrowDown Control+ArrowLeft Control+ArrowRight Enter",onKeyDown:jr},Yr=()=>{Hn(!0),vn(dn())},Ur=B(()=>{const e=rt.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(Zt);t&&!t.disabled&&t.click()}},[]);F(()=>{if(!t)return;if(X)return;const e=e=>{if(Tn[Tn.length-1]===It&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Ur();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&rt.current?.contains(t)))return;if(t.closest(Qt))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Ur,It,X]),F(()=>{if(!t)return;const e=e=>{Tn[Tn.length-1]===It&&((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:It}})),We.current=!1,Ke(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:It}}))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),F(()=>{if(!t)return;if(X)return;const e=e=>{if("Escape"===e.key&&Tn[Tn.length-1]===It){if(I(e))return e.preventDefault(),void e.stopPropagation();if(Mn&&!D)return;e.preventDefault(),e.stopPropagation(),vr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,vr,It,X,Mn,D]);const Xr=t&&(void 0!==p||void 0!==f),[Vr]=q(()=>{if("undefined"==typeof document)return null;const e=document.createElement("span");return e.className="flex shrink-0 items-center gap-2",e.setAttribute("data-tab-actions",""),e}),_r=Mn&&!He?.home&&ur.actions.length>0;F(()=>{t&&ar&&function(e,t){const n=Ft.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(Ft.set(e,t),Bt())}(ar,{title:ur.text||Pe,dirty:ir,copy:ur.copy,actions:_r&&Vr?Vr:void 0,menu:fr.current??void 0})},[t,ar,Pe,ir,ur.text,ur.copy,_r,Vr]);const Gr=B(e=>{const t=document.getElementById("nav-boundary-toast");t&&t.remove();const n="bottom"===e?["That's the last one, chief.","You've hit rock bottom... of the list.","End of the line, buddy.","Nothing left. Go outside.","Congratulations, you scrolled to the void.","There's no more. I checked.","You've reached the edge of the known universe.","Plot twist: there is no next one.","Even scrolling has limits. Unlike your ambition.","Last one. Time to touch grass."]:["Already at the top. Overachiever.","There is no item above this. Trust me.","You're #1. Literally.","Can't go higher. You've peaked.","This is it. The summit. The top.","First item. No VIP lounge above this.","Going up? Nope. Elevator's broken.","You want negative indexes? Bold.","Top of the list. Top of the world.","The only way is down from here."],r=n[Math.floor(Math.random()*n.length)],o=document.createElement("div");o.id="nav-boundary-toast",o.className="fixed bottom-6 left-1/2 -translate-x-1/2 z-(--z-toast) bg-gray-900 text-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(F(()=>{if(!t)return;const e=e=>{if(Tn[Tn.length-1]!==It)return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Xr&&(e.preventDefault(),p?p():Gr("bottom")),"k"===e.key&&Xr&&(e.preventDefault(),f?f():Gr("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Xr,Gr,It]),!t||mn.current)return null;const Jr=Gt?function(e){if("undefined"==typeof document)return null;const t=Array.from(document.querySelectorAll("[data-modal-panel]")).filter(e=>{const t=e;return!t.hasAttribute("data-utility")&&!t.hasAttribute("data-widget")&&"none"!==t.style.display});t.sort((e,t)=>(e.getAttribute("data-modal-id")||"").localeCompare(t.getAttribute("data-modal-id")||""));const n=t.findIndex(t=>t.getAttribute("data-modal-id")===e),r=t.length;if(n<0||r<1)return null;const o=Math.ceil(Math.sqrt(r)),i=Math.ceil(r/o),a=Math.floor(n/o),s=n%o,l=r-o*(i-1),c=a===i-1&&l<o,u=or(),d=(u.w-20*(o+1))/o,h=(u.h-14*(i+1)-22*i)/i,m=c?(o-l)*(d+20)/2:0;return{x:u.x+20+s*(d+20)+m,y:u.y+14+a*(h+14+22),w:d,h:h}}(It):null,Zr=Gt&&Jr?Math.min(Jr.w/gn.w,Jr.h/gn.h):1,Qr=(()=>{if(Gt&&Jr){const e=Zr,t=gn.w*e,n=gn.h*e,r=Jr.x+(Jr.w-t)/2-gn.x,o=Jr.y+(Jr.h-n)/2-gn.y,i=Jt||nn;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:P.expose+(i?20:10),boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(on&&Xt){const e="picked"===sn;return{transition:e?"transform 640ms cubic-bezier(0.34, 1.42, 0.64, 1), box-shadow 600ms":"transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms",...e?{zIndex:P.expose+30}:{}}}return null})(),eo=v({modal:!1,titleId:!X&&(Mn?!He?.home:!fe)?Ie:void 0,label:ur.text||Pe}),to=/* @__PURE__ */Q("div",{children:[
|
|
50
|
-
/* @__PURE__ */Q("div",{ref:rt,"data-modal-panel":!0,"data-modal-id":It,"data-window-key":ce||void 0,...$?{"data-utility":""}:{},...$e?{"data-pinned-top":""}:{},...X?{"data-widget":""}:{},...He?{"data-window-owner":He.key}:{},...He&&!gt?{"data-window-root":""}:{},...Mn?{"data-window-tab":""}:{},...eo,className:Mn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(X?Wt?"shadow-xl":"shadow-lg":"border "+(Wt?"shadow-xl border-line":"shadow-lg border-line-strong")),onMouseDownCapture:e=>{if(ot.current=!1,Gt){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),Or(It),Dr(!1),void Qn(It)}if(!Wt&&!X&&!$e&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===rt.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),ot.current=!0,Fe(null),Qn(It),window.addEventListener("mouseup",()=>{setTimeout(()=>{ot.current=!1},0)},{once:!0}))}},onClickCapture:e=>{ot.current&&(ot.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(Gt)return;Fe(null);e.target.closest("[data-modal-panel]")===rt.current&&(e.target.closest("button, input, a, select, textarea")||Qn(It))},style:fe?{zIndex:Rt+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${ge}px)`,transition:be?"none":"transform 180ms ease-out",...X?{display:"none"}:{},...Rt<0?{display:"none"}:{},...Wt||$e||Ce&&ce===Ce?{}:{display:"none"}}:{zIndex:$e?P.pinnedWindow:Rt+1,width:gn.w,height:gn.h,top:gn.y,...X&&"right"===et?{right:window.innerWidth-gn.x-gn.w}:{left:gn.x},...Rt<0&&!$e?{display:"none"}:{},...ye?{display:"none"}:{},...Rn||jn?{visibility:"hidden",pointerEvents:"none"}:{},...Qr??{}},children:[fe&&!X&&/* @__PURE__ */ee("div",{onPointerDown:Me,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),X?null:Mn?He?.home?null:/* @__PURE__ */Q(te,{children:[
|
|
51
|
-
/* @__PURE__ */ee("h2",{id:Ie,"data-window-title":!0,className:"sr-only",children:ur.text||Pe}),_r&&Vr&&ne(
|
|
52
|
-
/* @__PURE__ */ee(te,{children:ur.actions}),Vr),ur.badges.length>0&&/* @__PURE__ */ee("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:ur.badges})]}):fe?null:
|
|
53
|
-
/* @__PURE__ */Q("div",J?{onPointerDown:Ir,"data-window-chrome":"",...Br,className:"flex items-center justify-between h-(--row-height-compact-bar) px-3 border-b border-line shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(Wt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Wt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
54
|
-
/* @__PURE__ */Q("div",{"data-window-title":!0,title:Pe,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Wt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Gt&&Lt(),
|
|
55
|
-
/* @__PURE__ */ee("span",{id:Ie,className:"truncate",children:Gt?en(Le):Le})]}),!Gt&&/* @__PURE__ */Q("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[$&&/* @__PURE__ */ee("button",{onClick:()=>Oe(e=>!e),title:$e?De.unpin:De.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+($e?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */ee(A,{name:"bookmark-square",className:"h-3 w-3",fill:$e?"currentColor":"none",strokeWidth:1.5})}),
|
|
56
|
-
/* @__PURE__ */ee("button",{type:"button",onClick:vr,"aria-label":De.close,className:"rounded p-0.5 text-ink-faintest hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */ee(A,{name:"close",className:"h-4 w-4"})})]})]}:Z?{onPointerDown:Ir,"data-window-chrome":"",...Br,className:"flex items-center justify-between h-(--row-height-compact-bar) px-3 border-b border-line shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(Wt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Wt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
57
|
-
/* @__PURE__ */Q("div",{"data-window-title":!0,title:Pe,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Wt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Gt&&Lt(),
|
|
58
|
-
/* @__PURE__ */ee("span",{id:Ie,className:"truncate",children:Gt?en(Le):Le})]}),!Gt&&/* @__PURE__ */Q("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[$&&/* @__PURE__ */ee("button",{onClick:()=>Oe(e=>!e),title:$e?De.unpin:De.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+($e?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */ee(A,{name:"bookmark-square",className:"h-3 w-3",fill:$e?"currentColor":"none",strokeWidth:1.5})}),
|
|
59
|
-
/* @__PURE__ */ee("button",{onClick:()=>er(It),title:De.minimize,className:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",children:"─"}),!zn&&/* @__PURE__ */ee(gr,{maximized:qn,onToggleMax:()=>{qn?(Hn(!1),vn(hn())):Yr()},onSnap:Fr,buttonClassName:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",strings:De}),
|
|
60
|
-
/* @__PURE__ */ee("button",{type:"button",onClick:vr,"aria-label":De.close,className:"rounded p-0.5 text-ink-faintest hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */ee(A,{name:"close",className:"h-4 w-4"})})]})]}:{onPointerDown:Ir,"data-window-chrome":"",...Br,className:"flex items-center justify-between h-(--row-height-window-bar) px-3 border-b border-gray-200 shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(Wt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Wt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
61
|
-
/* @__PURE__ */Q("div",{"data-window-title":!0,title:Pe,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Wt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Gt&&Lt(),
|
|
62
|
-
/* @__PURE__ */ee("span",{id:Ie,className:"truncate",children:Gt?en(Le):Le})]}),!Gt&&/* @__PURE__ */Q("div",{className:"flex items-center gap-3 shrink-0 ml-4",children:[$&&/* @__PURE__ */ee("button",{onClick:()=>Oe(e=>!e),title:$e?De.unpin:De.pinOnTop,className:"text-xs px-2 py-1 rounded hover:bg-gray-200 "+($e?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */ee(A,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:$e?"currentColor":"none",strokeWidth:1.5})}),
|
|
63
|
-
/* @__PURE__ */ee("button",{onClick:()=>er(It),title:De.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!zn&&/* @__PURE__ */ee(gr,{maximized:qn,onToggleMax:()=>{qn?(Hn(!1),vn(hn())):Yr()},onSnap:Fr,buttonClassName:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",strings:De}),
|
|
64
|
-
/* @__PURE__ */ee("button",{type:"button",onClick:vr,"aria-label":De.close,className:"rounded-(--radius-control) text-ink-faintest hover:text-gray-600",children:/* @__PURE__ */ee(A,{name:"close",className:"h-5 w-5"})})]})]}),de&&Ue&&!X&&!fe&&/* @__PURE__ */ee("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${Wt?.9:.55})`}}),
|
|
65
|
-
/* @__PURE__ */ee(Vt.Provider,{value:It,children:/* @__PURE__ */ee(ln.Provider,{value:{rightRef:at,leftRef:st,notify:()=>ct(!0),active:Wt,isDirty:ir,footerOpen:wt&&!X&&!J&&!Z&&!fe},children:/* @__PURE__ */ee("div",{ref:it,...X?{onPointerDown:Ir,onContextMenu:e=>{e.preventDefault(),Qe({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${X?"p-0 cursor-move":Z||re?"p-0":J?"p-2":"p-4"} ${X||Mn?"":"backdrop-blur-sm"} ${!1===g||Z||re?"overflow-hidden":"overflow-y-auto overscroll-contain"} ${X?"rounded-2xl select-none":""}`,style:{...X?{touchAction:"none"}:{},backgroundColor:X?"transparent":Mn?"rgb(var(--window-content-rgb))":Wt?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */ee(Ne,{children:he})})})}),X&&Ze&&/* @__PURE__ */Q(C,{minWidth:160,style:{left:Ze.x,top:Ze.y},onClose:()=>Qe(null),children:[
|
|
66
|
-
/* @__PURE__ */ee(N,{onClick:()=>{Qe(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:It}))},children:"Settings"}),
|
|
67
|
-
/* @__PURE__ */ee(S,{}),se&&/* @__PURE__ */Q(te,{children:[se,
|
|
68
|
-
/* @__PURE__ */ee(S,{})]}),
|
|
69
|
-
/* @__PURE__ */Q(N,{onClick:()=>{Qe(null),Oe(e=>!e)},children:[
|
|
70
|
-
/* @__PURE__ */ee("span",{className:"flex-1",children:"Always on Top"}),$e&&/* @__PURE__ */ee(A,{name:"check",className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
|
|
71
|
-
/* @__PURE__ */ee(S,{}),
|
|
72
|
-
/* @__PURE__ */ee(N,{onClick:()=>{Qe(null),vr()},children:"Close"})]}),
|
|
73
|
-
/* @__PURE__ */Q("div",{onPointerDown:Ir,ref:ut,"data-modal-footer":"",className:`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${Mn?"":" cursor-move"}${Wt&&!Mn?" backdrop-blur-sm":""}${X||J||Z||fe||!wt?" hidden":""}`,style:{touchAction:"none",backgroundColor:Mn?"rgb(var(--window-footer-rgb))":Wt?"rgb(var(--window-footer-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-footer-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
74
|
-
/* @__PURE__ */Q("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[xt&&/* @__PURE__ */ee(Te,{auto:!0}),T,
|
|
75
|
-
/* @__PURE__ */ee("div",{ref:st,"data-modal-actions-left":!0,className:"flex items-center gap-2 shrink-0"}),null!=w&&!1!==w&&
|
|
76
|
-
/* @__PURE__ */ee("div",{ref:dt,"data-modal-footer-facts":"",className:"min-w-0 flex-1 overflow-hidden",children:/* @__PURE__ */ee("div",{ref:ht,className:"inline-flex items-center gap-2 whitespace-nowrap"+(mt?" invisible":""),children:w})})]}),
|
|
77
|
-
/* @__PURE__ */Q("div",{"data-modal-footer-right":"",className:"flex items-center gap-2 ml-auto shrink-0",children:[ft&&K&&(K.editing?/* @__PURE__ */ee(z,{variant:"secondary",size:"sm","data-modal-discard":"",onClick:()=>{Sr()},children:De.discard}):"object"==typeof K.state?/* @__PURE__ */ee(z,{variant:"secondary",size:"sm","data-modal-edit":"","aria-disabled":!0,disabledReason:K.state.disabledReason,children:De.edit}):/* @__PURE__ */ee(z,{variant:"secondary",size:"sm","data-modal-edit":"",onClick:()=>K.onEdit(),children:De.edit})),
|
|
78
|
-
/* @__PURE__ */ee("div",{ref:at,"data-modal-actions":!0,className:"flex items-center gap-2"}),L]})]}),!X&&!fe&&!Gt&&Wt&&!zn&&/* @__PURE__ */Q(te,{children:[
|
|
79
|
-
/* @__PURE__ */ee("div",{onPointerDown:e=>Kr(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
80
|
-
/* @__PURE__ */ee("div",{onPointerDown:e=>Kr(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
81
|
-
/* @__PURE__ */ee("div",{onPointerDown:e=>Kr(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
82
|
-
/* @__PURE__ */ee("div",{onPointerDown:e=>Kr(e,"nw"),className:"absolute top-0 left-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
83
|
-
/* @__PURE__ */ee("div",{onPointerDown:e=>Kr(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
84
|
-
/* @__PURE__ */ee("div",{onPointerDown:e=>Kr(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
85
|
-
/* @__PURE__ */ee("div",{onPointerDown:e=>Kr(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
|
|
86
|
-
/* @__PURE__ */ee("div",{onPointerDown:e=>Kr(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),Gt&&/* @__PURE__ */ee("div",{className:"absolute inset-0",style:{zIndex:P.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>tn(!0),onMouseLeave:()=>tn(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),Qn(It),Dr(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:Jt&&/* @__PURE__ */ee("button",{type:"button","data-expose-close":!0,"aria-label":Ae.taskbar.closeWindow,title:"Close",className:"absolute flex items-center justify-center rounded-full bg-black/55 text-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/Zr})`,transformOrigin:"top right",zIndex:P.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),vr()},children:/* @__PURE__ */ee(A,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),Gt&&Jr&&/* @__PURE__ */ee("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:Jr.x,top:Jr.y+Jr.h+4,width:Jr.w,zIndex:P.expose+(Jt?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:en(Le)})]}),no=je&&/* @__PURE__ */Q(C,{style:{left:je.x,top:je.y},onClose:()=>Fe(null),minWidth:160,children:[!X&&!J&&!Mn&&/* @__PURE__ */Q(te,{children:[
|
|
87
|
-
/* @__PURE__ */Q(N,{onClick:()=>{er(It),Fe(null)},children:[
|
|
88
|
-
/* @__PURE__ */ee(A,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),De.minimize]}),!zn&&/* @__PURE__ */Q(N,qn?{onClick:()=>{Hn(!1),vn(hn()),Fe(null)},children:[
|
|
89
|
-
/* @__PURE__ */ee("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */ee("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 4.5v15m6-15v15M4.5 9h15M4.5 15h15"})}),De.windowed]}:{onClick:()=>{Yr(),Fe(null)},children:[
|
|
90
|
-
/* @__PURE__ */ee(A,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),De.maximize]})]}),$&&!Mn&&/* @__PURE__ */Q(N,{onClick:()=>{Oe(e=>!e),Fe(null)},children:[
|
|
91
|
-
/* @__PURE__ */ee(A,{name:"bookmark-square",className:"h-4 w-4 "+($e?"text-blue-600":""),fill:$e?"currentColor":"none",strokeWidth:1.5}),$e?De.unpin:De.pinOnTop]}),qe&&/* @__PURE__ */Q(N,{onClick:()=>{Fe(null),Je()},children:[
|
|
92
|
-
/* @__PURE__ */ee(A,{name:"star",className:"h-4 w-4",fill:_e?"currentColor":"none",strokeWidth:1.5}),_e?Ae.taskbar.removeFromDesktop:Ae.taskbar.addToDesktop]}),(rn[It]||[]).length>0&&/* @__PURE__ */ee(te,{children:(rn[It]||[]).map((e,t)=>/* @__PURE__ */Q(N,{onClick:()=>{Fe(null),e.onClick()},children:[e.icon,e.label]},t))}),!(Mn&&He?.home)&&/* @__PURE__ */Q(te,{children:[
|
|
93
|
-
/* @__PURE__ */ee(S,{}),
|
|
94
|
-
/* @__PURE__ */Q(N,{danger:!0,onClick:()=>{Fe(null),vr()},children:[
|
|
95
|
-
/* @__PURE__ */ee(A,{name:"close",className:"h-4 w-4"}),De.close]})]})]}),ro=!!ce&&Pt.some(e=>e.id===ce),oo=!qt||ro||X?null:/* @__PURE__ */Q("div",{"data-modal-restore-tab":!0,"data-modal-id":It,className:"fixed left-1/2 z-(--z-restore-tab) flex -translate-x-1/2 items-center gap-1 rounded-lg border border-line-strong bg-surface px-2 py-1 shadow-lg",style:{bottom:"calc(var(--taskbar-height, 0px) + 12px)"},children:[
|
|
96
|
-
/* @__PURE__ */ee("button",{type:"button",onClick:()=>Qn(It),title:De.restore,className:"max-w-[16rem] truncate rounded px-2 py-0.5 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900",children:Pe||De.windowSuffix}),
|
|
97
|
-
/* @__PURE__ */ee("button",{type:"button",onClick:()=>Qn(It),title:De.restore,"aria-label":De.restore,className:"rounded px-2 py-0.5 text-xs leading-none text-ink-faintest hover:bg-gray-100 hover:text-gray-600",children:"▴"}),
|
|
98
|
-
/* @__PURE__ */ee("button",{type:"button",onClick:()=>{vr()},title:De.close,"aria-label":De.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 ne(
|
|
99
|
-
/* @__PURE__ */Q(_t.Provider,{value:null,children:[to,no,oo]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{Lr&&"Escape"===e.key&&(Br(null),Dr(!1))});var _r=100,Gr={past:[],future:[]};function Jr(e,t){switch(t.type){case"record":{const n=e.past[e.past.length-1];if(null!==t.step.coalesceKey&&n?.coalesceKey===t.step.coalesceKey)return 0===e.future.length?e:{...e,future:[]};const r=[...e.past,t.step];return{past:r.length>_r?r.slice(r.length-_r):r,future:[]}}case"undo":return 0===e.past.length?e:{past:e.past.slice(0,-1),future:[t.redoStep,...e.future]};case"redo":return 0===e.future.length?e:{past:[...e.past,t.undoStep],future:e.future.slice(1)};case"clear":return 0===e.past.length&&0===e.future.length?e:Gr}}var Zr=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var Qr=500,eo=250;function to({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,a]=J(Jr,Gr),s=j(/* @__PURE__ */new Map),[l,c]=q(0),u=l>0,[d,h]=q(0),[m,p]=q(0),f=m>0,{hasAnyPerm:w}=i(),y=t&&0===d&&(!(n&&n.length>0)||w(n)),g=j(null),v=j(!1),b=B(()=>{const e={};for(const[t,n]of s.current)e[t]=n.getLast();return e},[]),x=B((e,t)=>{s.current.has(e)||c(e=>e+1),s.current.set(e,t)},[]),k=B(e=>{s.current.delete(e)&&c(e=>e-1)},[]),E=B(e=>{h(t=>t+(e?1:-1))},[]),M=B(e=>{p(t=>t+(e?1:-1))},[]),[C,N]=q(0),S=C>0,L=B(e=>{N(t=>t+(e?1:-1))},[]),T=W(Se),z=T?.claimReadOnly;F(()=>{if(z&&!y)return z(!0),()=>z(!1)},[z,y]);const A=T?.claimOwnMount;F(()=>{if(A&&S)return A(!0),()=>A(!1)},[A,S]);const D=j({last:0,count:0,tripped:!1}),P=j(!1),I=B((e,t,n)=>{if(v.current)return void(n&&function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}(n.prev,n.next)||(P.current=!0));if(!y||g.current)return;const r=D.current;if(r.tripped)return;const o=Date.now();if(o-r.last>eo&&(r.count=0),r.last=o,++r.count>Qr)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${Qr} undo steps with no pause between them, which no user action can do. The value passed to useUndoable for this slice is almost certainly rebuilt on every render (a .map/.filter/object literal in the call) rather than held in state, so it reads as changed every time — and since recording a step re-renders the form, that is a loop. Undo recording is now off for this form to keep the tab responsive.`);g.current={values:b(),label:e,coalesceKey:t},queueMicrotask(()=>{const e=g.current;g.current=null,e&&a({type:"record",step:e})})},[y,b]),R=B(e=>{for(const[t,n]of Object.entries(e)){const e=s.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),K=B(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:b(),label:e.label,coalesceKey:null};R(e.values),a({type:"undo",redoStep:t})},[o.past,b,R]),$=B(()=>{const e=o.future[0];if(!e)return;const t={values:b(),label:e.label,coalesceKey:null};R(e.values),a({type:"redo",undoStep:t})},[o.future,b,R]),[O,H]=q(0),Y=j(0),U=j(0),X=j(!1),V=B(()=>{v.current=!0,P.current=!1,g.current=null,Y.current+=1,U.current=Y.current,H(Y.current)},[]),G=j(void 0),Z=B(e=>{void 0!==e&&(void 0!==G.current&&e!==G.current&&(X.current=!0),G.current=e),V()},[V]);F(()=>{v.current&&O===U.current&&(v.current=!1,g.current=null,(P.current||X.current)&&a({type:"clear"}),P.current=!1,X.current=!1)},[O]);const te=B(()=>{X.current=!0,a({type:"clear"}),V()},[V]),ne=y&&o.past.length>0,re=y&&o.future.length>0,oe=Sr(r),ie=j({undo:K,redo:$,canUndo:ne,canRedo:re});ie.current={undo:K,redo:$,canUndo:ne,canRedo:re},F(()=>{if(!oe||!y)return;const e=e=>{const t=function(e){if(!e.metaKey&&!e.ctrlKey||e.altKey)return null;const t=e.key.toLowerCase(),n="z"===t?e.shiftKey?"redo":"undo":"y"!==t||!e.ctrlKey||e.metaKey||e.shiftKey?null:"redo";if(!n)return null;const r=e.target;return r?.isContentEditable||r?.tagName&&Zr.has(r.tagName.toUpperCase())?null:n}(e);if(!t)return;const n=ie.current;("undo"===t?n.canUndo:n.canRedo)&&(e.preventDefault(),"undo"===t?n.undo():n.redo())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[oe,y]);const ae=_(()=>({register:x,unregister:k,record:I,undo:K,redo:$,clear:te,baseline:Z,canUndo:ne,canRedo:re,enabled:y,hasState:u,handMounted:S,claimOwnMount:L,claimReadOnly:E,declaredEditable:f,claimEditable:M,undoLabel:ne?o.past[o.past.length-1].label:null,redoLabel:re?o.future[0].label:null}),[x,k,I,K,$,te,Z,ne,re,y,u,S,L,E,f,M,o.past,o.future]),se=""!==cn(),le=W(ln)?.footerOpen??!1,ce=se&&y&&u&&!S&≤/* @__PURE__ */
|
|
100
|
-
return Q(Se.Provider,{value:ae,children:[ce&&/* @__PURE__ */ee(dn,{position:"left",quiet:!0,children:/* @__PURE__ */ee(Te,{auto:!0})}),e]})}function no(){const e=W(Se),t=B(()=>{},[]);return{undo:e?.undo??t,redo:e?.redo??t,clear:e?.clear??t,baseline:e?.baseline??t,canUndo:e?.canUndo??!1,canRedo:e?.canRedo??!1,undoLabel:e?.undoLabel??null,redoLabel:e?.redoLabel??null,enabled:e?.enabled??!1,hasState:e?.hasState??!1}}function ro(e){const t=W(Se),n=t?.claimReadOnly,r=t?.claimEditable;F(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function oo(e,t,n){const r=W(Se),o=G(),i=j(e),a=j(t);a.current=t,F(()=>{if(r)return r.register(o,{getLast:()=>i.current,setLast:e=>{i.current=e},apply:e=>a.current(e)}),()=>r.unregister(o)},[r,o]);const{label:s,coalesceKey:l=null}=n,c=j(r);c.current=r;const u=j({label:s,coalesceKey:l});u.current={label:s,coalesceKey:l},F(()=>{const t=c.current;t&&(Object.is(e,i.current)||(t.record(u.current.label,u.current.coalesceKey,{prev:i.current,next:e}),i.current=e))},[e])}function io(e,t){const[n,r]=q(e);return oo(n,e=>r(()=>e),t),[n,r]}export{hn as CancelButton,Qe as DocFavStar,Fe as EntityWindowFallback,Oe as EntityWindowLoading,qe as EntityWindowState,Qt as KEY_ACTIVATED_SELECTOR,We as LoadingSpinner,Zt as MODAL_SUBMIT_SELECTOR,Vr as Modal,dn as ModalActions,Te as UndoControls,to as UndoProvider,ue as WINDOW_REGISTRY,Ce as WindowCrashedFallback,Ne as WindowErrorBoundary,bt as WindowManagerProvider,an as WindowTitle,it as activateWindowById,Pt as beginWindowGesture,_n as cancelWindowFront,fe as client_default,Yr as commitExposeHighlight,Vn as confirmWindowDiscard,It as drainPerfEvents,Ir as exitExposeMode,Mn as forgetMaximizedWindowBoxes,Mr as getActiveModalId,lt as getActiveWindowRoute,Hr as getExposeHighlight,Xt as getWindowChromeVersion,kn as getWindowPosition,Be as isDraftEntityId,Ye as isDraftEntityWindow,se as isEntityEntry,ae as isPageEntry,me as isShellApiClientConfigured,Ie as isTabWindow,Dt as markMenuOpen,Yt as readWindowChrome,Yn as requestWindowFront,Br as setExposeHighlight,At as setPerfCollecting,he as setShellApiClient,be as setShellHomeRoute,Me as setShellTabStrip,ce as setShellWindowRegistry,xn as setWindowDefaultPosition,En as setWindowPosition,Ot as splitTitle,qr as subscribeExposeHighlight,Ut as subscribeWindowChrome,Re as tabGroupOf,Pr as toggleExposeMode,Fn as useCurrentTabKey,cn as useEnclosingModalId,Sr as useIsActiveWindow,un as useModalActive,ye as usePageSearch,no as useUndo,ro as useUndoCanEdit,oo as useUndoable,io as useUndoableState,nn as useWidgetSettings,Ve as useWindowDirty,Ge as useWindowManager,on as useWindowMenuItem,sn as useWindowTitle,Xn as windowHoldsChanges};
|
package/dist/chunk-AXL7VTNM.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-B7HW6XZD.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as a}from"./chunk-PKXQDCNR.js";import{useFocusTrap as l,useScrollLock as i}from"./chunk-CDAJKLGL.js";import{Button_default as c}from"./chunk-NHH2MXFU.js";import{buttonClasses as s}from"./chunk-UQYNPYF4.js";import{Icon as m}from"./chunk-KKSVRIMP.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{useHydrated as d}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useShellStrings as h}from"./chunk-X2PZMXDP.js";import{useRef as p,useState as x,useCallback as b,useEffect as k}from"react";import{createPortal as g}from"react-dom";import{jsx as v,jsxs as w,Fragment as N}from"react/jsx-runtime";var y=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function j(e){return e.kind?e.kind:r(e.url)?"video":y.test(e.url)?"file":"image"}var C="flex items-center justify-center rounded-full bg-black/60 text-on-accent hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",D=e=>e.stopPropagation();function U({images:r,startIndex:y=0,onClose:U,onIndexChange:L,onOpenFile:P}){const $=h().lightbox,z=d(),A=p(null),F=p(null),[I,M]=x(y),W=r.length,X=z&&W>0,H=b(e=>{if(W<2)return;const t=((I+e)%W+W)%W;M(t),L?.(t)},[I,W,L]);if(a(X),l(A,X,F),i(X),k(()=>{if(X)return f(()=>(U(),!0),()=>A.current)},[X,U]),k(()=>{if(!X)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),H("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[X,H]),!X)return null;const J=r[Math.min(I,W-1)],K=j(J),R=J.caption||n(J.url);let Z;return Z="video"===K?/* @__PURE__ */v("video",{src:J.url,controls:!0,playsInline:!0,"aria-label":R,onClick:D,className:`${e} rounded-lg bg-black`}):"file"===K?/* @__PURE__ */w("div",{onClick:D,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-surface px-10 py-8 text-center text-ink-faint",children:[
|
|
2
|
-
/* @__PURE__ */v(m,{name:"document","aria-hidden":"true",className:"h-10 w-10"}),
|
|
3
|
-
/* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:R}),P?/* @__PURE__ */v(c,{size:"sm",onClick:()=>P(J),children:$.openFile}):/* @__PURE__ */v("a",{href:J.url,target:"_blank",rel:"noopener noreferrer",className:s({size:"sm"}),children:$.openFile})]}):/* @__PURE__ */v(t,{src:J.url,alt:R,className:`${e} object-contain`,frameClassName:"rounded-lg"}),g(
|
|
4
|
-
/* @__PURE__ */w("div",{ref:A,...o({role:"dialog",modal:!0,label:$.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:u.overlay},onClick:U,children:[Z,
|
|
5
|
-
/* @__PURE__ */w("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:D,children:[
|
|
6
|
-
/* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:$.counter(I+1,W)}),
|
|
7
|
-
/* @__PURE__ */v("button",{ref:F,type:"button",onClick:U,"aria-label":$.close,className:`${C} h-8 w-8`,children:/* @__PURE__ */v(m,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),W>1&&/* @__PURE__ */w(N,{children:[
|
|
8
|
-
/* @__PURE__ */v("button",{type:"button",onClick:e=>{D(e),H(-1)},"aria-label":$.previous,className:`${C} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(m,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
|
|
9
|
-
/* @__PURE__ */v("button",{type:"button",onClick:e=>{D(e),H(1)},"aria-label":$.next,className:`${C} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(m,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
|
|
10
|
-
/* @__PURE__ */w("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:D,children:[
|
|
11
|
-
/* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:R}),"file"!==K&&/* @__PURE__ */v("a",{href:J.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-on-accent/70 underline decoration-on-accent/30 underline-offset-2 hover:text-on-accent",children:$.openOriginal})]})]}),document.body)}export{U as ImageLightbox,j as lightboxKind};
|
package/dist/chunk-BCDG4N6L.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{onOverlayOpen as t}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as e}from"./chunk-62LW225J.js";import{followAnchor as r,popupBounds as o,VIEWPORT_MARGIN as n,showingBox as i,placeBeside as a,placeArrow as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{solidSurfaceStyle as s}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as d,escapeSurfaceAbove as h}from"./chunk-TWVUQUUD.js";import{createContext as m,useContext as u,useState as p,useRef as f,useId as x,useEffect as w,isValidElement as g,cloneElement as b}from"react";import{createPortal as v}from"react-dom";import{jsxs as y,jsx as k}from"react/jsx-runtime";var W=m(!1),j=()=>u(W),H={top:"bottom-full left-1/2 -translate-x-1/2 mb-3",bottom:"top-full left-1/2 -translate-x-1/2 mt-3",left:"right-full top-1/2 -translate-y-1/2 mr-3",right:"left-full top-1/2 -translate-y-1/2 ml-3"};function T({content:m,side:u="top",delay:j=200,children:T,className:B="relative inline-flex",describe:N=!0,open:M}){const[D,J]=p(!1),R=(M??D)&&!(null==m||!1===m||""===m),[U,z]=p(null),C=f(void 0),E=f(null),L=f(null),P=x(),$=f(!1),F=()=>{window.clearTimeout(C.current),$.current||(C.current=window.setTimeout(()=>J(!0),j))},G=()=>{window.clearTimeout(C.current),J(!1)},I=()=>{$.current=!0,G()},Q=()=>{$.current=!1,G()};w(()=>()=>window.clearTimeout(C.current),[]),c(()=>{if(!R)return void z(null);const t=()=>{const t=E.current,e=L.current;if(!t||!e)return;const r=o(t),c=Math.max(0,r.right-r.left-2*n),s=Math.max(0,r.bottom-r.top-2*n);e.style.maxWidth=`${c}px`,e.style.maxHeight=`${s}px`;const d=e.getBoundingClientRect();if(d.width<=0||d.height<=0)return;const h=t.getBoundingClientRect();if(!i(t))return void G();const m=a(h,d,u,r,12),p=l(h,m,d,16,6),f={anchor:{left:h.left,top:h.top,width:h.width,height:h.height},left:m.left-h.left,top:m.top-h.top,maxWidth:c,maxHeight:s,side:m.side,arrow:p&&{left:p.x-h.left,top:p.y-h.top}};z(t=>{return t&&(r=f,(e=t).anchor.left===r.anchor.left&&e.anchor.top===r.anchor.top&&e.anchor.width===r.anchor.width&&e.anchor.height===r.anchor.height&&e.left===r.left&&e.top===r.top&&e.maxWidth===r.maxWidth&&e.maxHeight===r.maxHeight&&e.side===r.side&&e.arrow?.left===r.arrow?.left&&e.arrow?.top===r.arrow?.top)?t:f;var e,r})};return t(),r(()=>E.current,t)},[R,u,m]),w(()=>{if(!R)return;const e=d(t=>"Escape"===t.key&&(G(),!h(E.current))),r=t(G);return()=>{e(),r()}},[R]);const S=R&&N?P:void 0,V=g(T)?b(T,{"aria-describedby":[T.props["aria-describedby"],S].filter(Boolean).join(" ")||void 0}):T,q=R?s():void 0;/* @__PURE__ */
|
|
2
|
-
return y("span",{ref:E,className:B,"aria-describedby":g(T)?void 0:S,onMouseEnter:F,onMouseLeave:Q,onFocus:t=>{let e=!0;try{e=t.target.matches(":focus-visible")}catch{}e&&F()},onBlur:Q,onPointerDown:I,onClick:I,children:[
|
|
3
|
-
/* @__PURE__ */k(W.Provider,{value:!0,children:V}),R&&v(
|
|
4
|
-
/* @__PURE__ */y("span",{className:"pointer-events-none fixed left-0 top-0",style:{zIndex:e.hint,...U?.anchor},children:[
|
|
5
|
-
/* @__PURE__ */k("span",{ref:L,id:P,role:"tooltip",className:`pointer-events-none absolute z-(--z-hint) box-border w-max overflow-hidden whitespace-normal break-words text-start rounded-md px-2 py-1 text-xs text-ink-strong ${U?"":H[u]}`,style:{...q,...U&&{left:U.left,top:U.top,maxWidth:U.maxWidth,maxHeight:U.maxHeight}},children:m}),(!U||U.arrow)&&
|
|
6
|
-
/* @__PURE__ */k("span",{"aria-hidden":"true",className:"rosh-tooltip-arrow","data-side":U?.side??u,style:{background:q?.background,"--rosh-tooltip-edge":q?.border,...U?.arrow&&{left:U.arrow.left,top:U.arrow.top}}})]}),document.body)]})}export{T as Tooltip,j as useInsideTooltip};
|
package/dist/chunk-DY2M6BIG.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as i}from"./chunk-QODTON7V.js";import{INPUT_BASE_ON as a,INPUT_BASE as s}from"./chunk-AYZY3YNC.js";import{Button_default as u}from"./chunk-NHH2MXFU.js";import{LoadingSpinner as c}from"./chunk-R2VKEMZH.js";import{Tooltip as d}from"./chunk-BCDG4N6L.js";import{onOverlayOpen as h}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as p}from"./chunk-62LW225J.js";import{useDropdownPosition as m,MENU_MAX_HEIGHT as f}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as b}from"./chunk-D65T4H6J.js";import{GLASS_DIVIDER as g,glassStyle as v}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as w}from"./chunk-X2PZMXDP.js";import{useState as x,useId as k,useRef as $,useMemo as N,useEffect as j}from"react";import{createPortal as D}from"react-dom";import{jsxs as C,jsx as S}from"react/jsx-runtime";function W(e,t){const n=e.length;if(0===n||t(e.join(", ")))return{shown:n,cut:!1};if(1===n)return{shown:1,cut:!0};let r=0;for(let l=1;l<n&&t(`${e.slice(0,l).join(", ")} +${n-l}`);l+=1)r=l;return{shown:r,cut:!1}}function R({onClear:e,ariaLabel:t}){/* @__PURE__ */
|
|
2
|
-
return S("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function L(L){const{options:M,placeholder:F,emptyOptionLabel:T,className:E="",disabled:z,id:O,filter:A=!1,allowFreeText:H=!1,freeTextOption:U,onSearchChange:B,loading:I=!1,error:J,onRetry:P,rightAdornment:X,renderOption:G,clearable:V=!0,"aria-label":Y,"aria-labelledby":Z,"aria-describedby":K}=L,Q=!0===L.multiple,q=L.multiple?L.value:L.value?[L.value]:[],_=L.multiple?"":L.value,ee=e=>{L.multiple?L.onChange(e):L.onChange(e[0]??"")},te=q.length>0,ne=A&&te&&!z,re=Q||A,le=null!=U,oe=H||le,[ie,ae]=x(!1),[se,ue]=x(-1),ce=k(),de=O??`${ce}-input`,he=`${ce}-listbox`,pe=e=>`${ce}-opt-${e}`,[me,fe]=x(""),be=w(),ge=T??be.select.none,ve=e=>{fe(e),ue(-1),B?.(e)},ye=$(null),we=$(null),xe=$(null),ke=$(null),$e=$(ie);$e.current=ie;const Ne=$(!1),je=e=>{$e.current&&($e.current=!1,e&&H&&!le&&Ve&&(Q?q.includes(Ve)||ee([...q,Ve]):Ve!==_&&ee([Ve])),ae(!1),ve(""))},De=(e,t)=>{if(!e.disabled){if(Q)return ee(q.includes(e.value)?q.filter(t=>t!==e.value):[...q,e.value]),void(e===Ye?ve(""):ue(t));ee([e.value]),je(!1)}},[Ce,Se]=x(null);b(()=>{if(!X||ie)return void Se(null);const e=ke.current?.offsetWidth??0;Se(e?e+(Te?32:8)+6:null)});const We=m(we,ie,re?{popupRef:xe}:{matchTriggerWidth:!0}),Re=N(()=>t(M),[M]),Le=q.join("\0"),Me=N(()=>{const e=[],t=/* @__PURE__ */new Set;for(const n of Re)q.includes(n.value)&&!t.has(n.value)&&(t.add(n.value),e.push(n.label));if(oe)for(const n of q)t.has(n)||e.push(n);return e},[Re,Le,oe]),Fe=Me.join(", "),Te=V&&te&&!z,[Ee,ze]=x(null),Oe=$(null),Ae=$(""),He=$(()=>{});He.current=()=>{const e=we.current,t=Oe.current;if(!Q||!e||!t)return;const n=getComputedStyle(e),r=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),l=[n.fontStyle,n.fontWeight,n.fontSize,n.fontFamily,n.letterSpacing].join("|"),o=`${r}|${l}|${Me.join("\0")}`;if(o===Ae.current)return;Ae.current=o;let i=null;r>0&&Me.length>0&&(t.style.fontStyle=n.fontStyle,t.style.fontWeight=n.fontWeight,t.style.fontSize=n.fontSize,t.style.fontFamily=n.fontFamily,t.style.letterSpacing=n.letterSpacing,i=W(Me,e=>(t.textContent=e,t.getBoundingClientRect().width<=r)),t.textContent=""),ze(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},b(()=>{He.current()}),j(()=>{const e=we.current;if(!Q||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>He.current());return t.observe(e),()=>t.disconnect()},[Q]);const Ue=Me.length,Be=!Q||!Ee||Ee.shown>=Ue?Fe:0===Ee.shown?be.select.selectedCount(Ue):`${Me.slice(0,Ee.shown).join(", ")} +${Ue-Ee.shown}`,Ie=Q&&null!==Ee&&(Ee.shown<Ue||Ee.cut),Je=ie&&te&&re;j(()=>{if(!ie)return;const e=e=>{const t=e.target;ye.current?.contains(t)||xe.current?.contains(t)||je(!0)};document.addEventListener("mousedown",e);const t=h(()=>je(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[ie,H,me,Le,L.onChange]),j(()=>{if(ie)return y(e=>!("Escape"!==e.key||!$e.current)&&(je(!1),we.current?.blur(),!0),()=>xe.current)},[ie]);const Pe=N(()=>{const e=/* @__PURE__ */new Set;return n(M,t=>!e.has(t.value)&&(e.add(t.value),!0))},[M]),Xe=N(()=>{if(B)return Pe;const e=me.trim().toLowerCase();return e?n(Pe,t=>r(t,e)):Pe},[Pe,me,B]),Ge=N(()=>t(Xe),[Xe]),Ve=me.trim(),Ye=N(()=>le&&Ve?Re.some(e=>e.label===Ve)||q.includes(Ve)?null:{value:Ve,label:Ve}:null,[le,Ve,Re,Le]),Ze=N(()=>Ye?[...Ge,Ye]:Ge,[Ge,Ye]);/* @__PURE__ */
|
|
3
|
-
return C("div",{ref:ye,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(ye.current?.contains(t)||xe.current?.contains(t))||Ne.current||document.activeElement!==we.current&&je(!0)},children:[(Ke=/* @__PURE__ */S("input",{id:de,ref:we,type:"text",autoComplete:"off",role:"combobox","aria-expanded":ie,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":ie?he:void 0,"aria-activedescendant":ie&&se>=0&&se<Ze.length?pe(se):void 0,"aria-label":Z?void 0:Y,"aria-labelledby":Z,"aria-describedby":K,value:ie?me:Be,onChange:e=>{ve(e.target.value),ae(!0)},onFocus:()=>{z||(ve(""),ae(!0))},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){if(z)return;if(t.preventDefault(),!ie)return void ae(!0);if(0===Ze.length)return;const n="ArrowDown"===t.key?1:-1;return void ue(t=>e(Ze,t,n))}"Enter"===t.key?(t.preventDefault(),ie&&se>=0&&se<Ze.length?De(Ze[se],se):1!==Ge.length||Ge[0].disabled?H&&!le&&Ve&&(Q?(q.includes(Ve)||ee([...q,Ve]),ve("")):(ee([Ve]),je(!1),we.current?.blur())):De(Ge[0],0)):"Escape"===t.key?(je(!1),we.current?.blur()):"Tab"===t.key&&je(!0)},placeholder:Je?Be:F||ge,className:`${ne?a:s} ${E} ${Te?"pr-8":""} ${z?"bg-surface-sunken text-ink-faintest cursor-not-allowed":""} truncate${Je?" rosh-field-shows-choice":""}`,style:Ce?{paddingRight:Ce}:void 0,disabled:z}),Q?/* @__PURE__ */S(d,{content:!ie&&Ie?Fe:null,className:"block",children:Ke}):Ke),Q&&
|
|
4
|
-
/* @__PURE__ */S("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */S("span",{ref:Oe,className:"whitespace-pre"})}),Te&&/* @__PURE__ */S(R,{ariaLabel:be.select.clear,onClear:()=>{ee([]),je(!1)}}),X&&!ie&&/* @__PURE__ */S("div",{ref:ke,className:`absolute top-1/2 -translate-y-1/2 ${Te?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:X}),ie&&D(
|
|
5
|
-
/* @__PURE__ */C("div",{ref:xe,onMouseDownCapture:()=>{Ne.current=!0,setTimeout(()=>{Ne.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:p.popup,left:We?.left,right:We?.right,top:We?.top,bottom:We?.bottom,minWidth:We?.minWidth,width:We?.width,...re&&{maxWidth:We?.maxWidth},visibility:We?void 0:"hidden",...v()},children:[Q&&te&&V&&!z&&
|
|
6
|
-
/* @__PURE__ */S("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),ee([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-row-hover border-b ${g}`,children:be.select.clearAll}),I?
|
|
7
|
-
/* @__PURE__ */S(c,{size:"sm",padding:"py-2",label:be.search.searching}):J?/* @__PURE__ */C("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
|
|
8
|
-
/* @__PURE__ */S("span",{className:"min-w-0 flex-1",children:J}),P&&/* @__PURE__ */S(u,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:P,className:"shrink-0",children:be.list.retry})]}):null,
|
|
9
|
-
/* @__PURE__ */C("div",{id:he,role:Ze.length?"listbox":void 0,"aria-labelledby":Ze.length?Z??(Y?void 0:de):void 0,"aria-label":Ze.length&&!Z?Y:void 0,"aria-multiselectable":!(!Ze.length||!Q)||void 0,className:"overflow-y-auto",style:{maxHeight:We?.maxHeight??f},children:[0===Ze.length?I||J?null:/* @__PURE__ */S("p",{className:"px-3 py-3 text-sm text-ink-faintest text-center",children:be.select.noMatches}):0===Ge.length?null:l(Xe,(e,t)=>{const n=q.includes(e.value);/* @__PURE__ */
|
|
10
|
-
return C("button",{id:pe(t),type:"button",role:"option","aria-selected":n,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:n=>{(e.disabled||Q)&&n.preventDefault(),De(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${n?"text-blue-600 font-medium":"text-gray-700"} ${t===se?"bg-gray-100":n?"bg-blue-50/50":""}`),children:[Q&&/* @__PURE__ */S(o,{selected:n}),
|
|
11
|
-
/* @__PURE__ */S("span",{className:`min-w-0 ${re?"flex-auto":"flex-1"} truncate`,children:G?G(e,{selected:n,active:t===se}):e.label}),e.sublabel&&/* @__PURE__ */S(i,{grows:re,children:e.sublabel})]},e.value)},ce),Ye&&U&&
|
|
12
|
-
/* @__PURE__ */S("button",{id:pe(Ge.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{Q&&e.preventDefault(),De(Ye,Ge.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-ink hover:bg-row-hover ${Ge.length?`border-t ${g}`:""} ${se===Ge.length?"bg-gray-100":""}`,children:/* @__PURE__ */S("span",{className:"min-w-0 flex-1 truncate",children:U(Ye.value)})},`${ce}-typed`)]})]}),document.body)]});var Ke}export{L as SearchableSelect,W as fitChoice};
|
package/dist/chunk-F7A6K3D5.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{ChartDefs as t,MOTION as e,stagger as a,glowId as i}from"./chunk-465RRWBY.js";import{ChartSkeleton as n}from"./chunk-BMQCUHSD.js";import{useHighlight as o,autoHighlightIndex as l,highlightOpacity as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as s}from"./chunk-TLRCTNUF.js";import{CartesianPlot as m}from"./chunk-OPB3I4JH.js";import{useDragZoom as u,ChartZoomSummary as c}from"./chunk-7VCAMNCH.js";import{CHART_INK as d,resolveSeriesColor as h,STATUS_VARS as f}from"./chunk-TZFACUMR.js";import{useShellStrings as p,useShellLocale as b}from"./chunk-X2PZMXDP.js";import{formatPercent as x,formatPlain as y}from"./chunk-C3QOHMR6.js";import{useId as v}from"react";import{jsx as M,jsxs as g,Fragment as k}from"react/jsx-runtime";function N({stacked:N=!1,stackMode:w="value",height:C=220,width:$,max:j,formatValue:F,yAxisLabel:L,className:A,emptyLabel:T,radius:z=3,loading:S=!1,animate:V=!0,glow:H=!1,emphasise:R=!1,activeKey:B,highlight:O="none",valueLabels:E=!1,onSelect:P,min:U,formatTooltipValue:Y,tooltipLabels:D,barGap:Q=4,seriesLabels:W=!1,zoomable:X=!0,series:Z,labels:G}){const I=v(),J=u(G.length,X),K=J.view?.[0]??0,q=J.slice(G),_=D?J.slice(D):void 0,tt=Z.map(t=>({...t,data:J.slice(t.data),pointTones:t.pointTones?J.slice(t.pointTones):void 0,pointColors:t.pointColors?J.slice(t.pointColors):void 0})),{highlighted:et}=o(),at=p().charts,it=b(),nt=F??(t=>y(t,it)),ot=Y??nt;if(S)/* @__PURE__ */return M(n,{height:C,width:$,variant:"bars",className:A});const lt=(t,e)=>{const a=t.pointColors?.[e];if(a)return a;const i=t.pointTones?.[e];return i?f[i]:h(t.slot,t.color,t.tone)},rt=tt.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(t=>Number.isFinite(t))),st=(t,e)=>{const a=t.data[e];return"number"==typeof a&&Number.isFinite(a)?a:0},mt=q.map((t,e)=>rt.reduce((t,a)=>t+st(a,e),0)),ut=q.map((t,e)=>rt.reduce((t,a)=>t+Math.max(0,st(a,e)),0)),ct=q.map((t,e)=>rt.reduce((t,a)=>t+Math.min(0,st(a,e)),0)),dt=N&&"percent"===w,ht=(t,e)=>mt[e]>0?t/mt[e]:null,ft=dt?[1]:N?[...ut,...ct]:rt.flatMap(t=>t.data.filter(Number.isFinite)),pt=(t,e)=>{const a=t.bandwidth/Math.max(1,rt.length),i=rt.length>1?Math.min(Q,.25*a):0;return{offset:e*a+i/2,width:Math.max(1,a-i)}},bt=W&&!N?({x:t,y:e})=>{const a=Math.min(e.domain[1],Math.max(e.domain[0],0));return q.map((i,n)=>rt.map((i,o)=>{const l=i.data[n];if(!Number.isFinite(l))return null;const r=Math.min(e.domain[1],Math.max(e.domain[0],l)),{offset:s,width:m}=pt(t,o),u=t(n)+s+m/2,c=Math.min(e(r),e(a)),h=Math.max(e(r),e(a));if(m<13)return null;const f=Math.floor((h-c-12)/6.6),p=f>=Math.min(4,i.label.length),b=p&&i.label.length>f?`${i.label.slice(0,f-1).trimEnd()}…`:i.label,x=p?h-6:c-4;/* @__PURE__ */
|
|
2
|
-
return M("text",{"data-series-label":"true",x:u,y:x,transform:`rotate(-90 ${u} ${x})`,textAnchor:"start",dominantBaseline:"central",fontSize:11,fill:p?d.surface:d.label,children:b},`n${i.key}-${n}`)}))}:null;/* @__PURE__ */
|
|
3
|
-
return g(k,{children:[
|
|
4
|
-
/* @__PURE__ */M(m,{labels:q,values:ft,height:C,width:$,max:dt?1:j,min:dt?void 0:U,formatValue:dt?t=>x(Math.round(100*t),0,it):nt,yAxisLabel:L,className:A,emptyLabel:T,onSelect:P?t=>P(K+t):void 0,zoom:X?J:void 0,ariaLabel:at.acrossCategories(rt.map(t=>t.label),q.length),tooltip:t=>/* @__PURE__ */M(s,{title:_?.[t]??q[t],rows:rt.map(e=>({key:e.key,label:e.label,color:lt(e,t),value:Number.isFinite(e.data[t])?dt?`${x(100*(ht(e.data[t],t)??0),1,it)} · ${ot(e.data[t])}`:ot(e.data[t]):void 0})),footnote:dt?at.inCategory(ot(mt[t])):void 0}),overlay:E&&!dt||bt?({x:t,y:e})=>/* @__PURE__ */g("g",{pointerEvents:"none",children:[bt?.({x:t,y:e}),E&&!dt&&q.map((a,i)=>{if(N){if(!rt.some(t=>Number.isFinite(t.data[i])))return null;const a=rt.reduce((t,e)=>t+st(e,i),0),n=a>=0?ut[i]:ct[i];/* @__PURE__ */
|
|
5
|
-
return M("text",{"data-value-label":"true",x:t.center(i),y:a>=0?e(n)-4:e(n)+12,textAnchor:"middle",fontSize:11,fill:d.label,style:{fontVariantNumeric:"tabular-nums"},children:nt(a)},`v${i}`)}return rt.map((a,n)=>{const o=a.data[i];if(!Number.isFinite(o))return null;const l=o,{offset:r,width:s}=pt(t,n);/* @__PURE__ */
|
|
6
|
-
return M("text",{"data-value-label":"true",x:t(i)+r+s/2,y:l>=0?e(l)-4:e(l)+12,textAnchor:"middle",fontSize:11,fill:d.label,style:{fontVariantNumeric:"tabular-nums"},children:nt(l)},`v${a.key}-${i}`)})})]}):void 0,children:({x:n,y:o,bottom:s,active:m})=>{const u=B?q.indexOf(B):-1,c=l(N?mt:rt[0]?.data??[],O),h=m??(u>=0?u:c);/* @__PURE__ */
|
|
7
|
-
return g("g",{children:[
|
|
8
|
-
/* @__PURE__ */M(t,{id:I,glow:H}),q.map((t,l)=>{let s=0,m=0;const u=o(Math.min(o.domain[1],Math.max(o.domain[0],0)));return rt.map((t,c)=>{const f=t.data[l];if(!Number.isFinite(f))return null;const p=dt?ht(f,l):f;if(null===p)return null;const b=lt(t,l),x=pt(n,c),y=N?n(l):n(l)+x.offset,v=N?Math.max(1,n.bandwidth):x.width;let g,k,w=!0;if(N){const t=p>=0?s:m,e=t+p;p>=0?s=e:m=e,g=o(Math.max(t,e)),k=o(Math.min(t,e)),w=0===t}else g=Math.min(o(p),u),k=Math.max(o(p),u);const C=Math.max(0,k-g-(N&&!w?2:0)),$=null===h||h===l,j=$?b:R?d.muted:b,F=r(t.key,et);/* @__PURE__ */
|
|
9
|
-
return M("rect",{x:y,y:g,width:v,height:C,rx:z,fill:j,fillOpacity:F??($?1:R?.32:.45),filter:H&&h===l?`url(#${i(I)})`:void 0,className:"rosh-viz-mark"+(V?` ${e.rise}`:""),style:V?a(l*(N?1:rt.length)+c,26):void 0},`${t.key}-${l}`)})}),null!==m&&!R&&/* @__PURE__ */M("line",{x1:n.center(m),y1:o(o.domain[1]),x2:n.center(m),y2:s,stroke:d.axis,strokeWidth:1})]})}}),J.view&&/* @__PURE__ */M(c,{from:_?.[0]??q[0],to:_?.at(-1)??q[q.length-1],count:q.length,total:N?ot(mt.reduce((t,e)=>t+e,0)):void 0,rows:rt.map(t=>({s:t,sum:t.data.reduce((e,a,i)=>e+st(t,i),0)})).sort((t,e)=>e.sum-t.sum).map(({s:t,sum:e})=>({key:t.key,label:t.label,color:h(t.slot,t.color,t.tone),value:ot(e)})),onClear:J.clear})]})}export{N as ColumnChart};
|
package/dist/chunk-GZYTCHPX.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-TLRCTNUF.js";import{axisGutter as t,radiusScale as i,niceMax as l,logScale as r,linearScale as o}from"./chunk-2JWPNR2U.js";import{usePlotWidth as n}from"./chunk-MAFUXCPZ.js";import{CHART_INK as a,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as c}from"./chunk-TWVUQUUD.js";import{useShellStrings as m,useShellLocale as h}from"./chunk-X2PZMXDP.js";import{formatPlain as f}from"./chunk-C3QOHMR6.js";import{useRef as u,useId as p,useState as d,useEffect as x}from"react";import{jsx as y,jsxs as g}from"react/jsx-runtime";var b=3;function k({series:b,height:k=260,width:v,xLabel:M,yLabel:A,formatX:z,formatY:N,xDomain:$,yDomain:j,xScale:w="linear",yScale:R="linear",radiusRange:U=[4,22],className:D,emptyLabel:L}){const P=m().charts,S=h(),C=z??(e=>f(e,S)),T=N??(e=>f(e,S)),W=L??P.noObservations,X=u(null),E=n(X),F=v??E,O=p(),[V,Z]=d(null);x(()=>{if(null!==V)return c(e=>"Escape"===e.key&&(Z(null),!0))},[V]);const B=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),I=b.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),Q=$||j?I.map(e=>({...e,points:e.points.filter(e=>B(e.x,$)&&B(e.y,j))})).filter(e=>e.points.length>0):I,H=I.reduce((e,t)=>e+t.points.length,0)-Q.reduce((e,t)=>e+t.points.length,0);if(0===Q.length)/* @__PURE__ */
|
|
2
|
-
return y("div",{className:D,ref:X,children:/* @__PURE__ */y("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:W})});const J=Q.flatMap(e=>e.points),K=J.some(e=>null!=e.size),Y=14,q=20,G=34,_=52,ee=(e,t,i,n)=>{const a=e.filter(e=>e>0),s="log"===i?a.length>0?Math.min(...a):0:Math.min(0,...e),c=t??[s,l(Math.max(...e))];return"log"===i?r(c,n):o(c,n)},te=ee(J.map(e=>e.y),j,R,{from:k-G,to:Y}),ie=t(te.ticks(5).map(T),_),le=Math.max(ie+1,F-q),re=ee(J.map(e=>e.x),$,w,{from:ie,to:le}),oe=i([0,Math.max(...J.map(e=>e.size??1))],{from:U[0],to:U[1]}),ne=V?Q[V.s]:void 0,ae=V&&ne?ne.points[V.i]:void 0,se=Q.flatMap((e,t)=>e.points.map((e,i)=>({s:t,i:i})));/* @__PURE__ */
|
|
3
|
-
return g("div",{className:`relative ${D??""}`,ref:X,children:[
|
|
4
|
-
/* @__PURE__ */g("svg",{width:"100%",height:k,viewBox:`0 0 ${F} ${k}`,role:"img","aria-label":P.scatter(Q.map(e=>e.label),A??P.yAxis,M??P.xAxis)+(H>0?`. ${P.outsideRange(H)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Z(null),onBlur:()=>Z(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,i=V?se.findIndex(e=>e.s===V.s&&e.i===V.i):0;Z(se[Math.min(se.length-1,Math.max(0,i+t))])},children:[
|
|
5
|
-
/* @__PURE__ */y("defs",{children:/* @__PURE__ */y("clipPath",{id:O,children:/* @__PURE__ */y("rect",{x:ie-U[1],y:Y-U[1],width:le-ie+2*U[1],height:k-G-Y+2*U[1]})})}),te.ticks(5).map(e=>/* @__PURE__ */g("g",{children:[
|
|
6
|
-
/* @__PURE__ */y("line",{x1:ie,y1:te(e),x2:le,y2:te(e),stroke:a.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
7
|
-
/* @__PURE__ */y("text",{x:ie-8,y:te(e)+4,textAnchor:"end",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:T(e)})]},`y${e}`)),re.ticks(5).map(e=>/* @__PURE__ */y("text",{x:re(e),y:k-12,textAnchor:"middle",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:C(e)},`x${e}`)),M&&/* @__PURE__ */y("text",{x:(ie+le)/2,y:k-.5,textAnchor:"middle",fontSize:11,fill:a.label,children:M}),A&&/* @__PURE__ */y("text",{x:12,y:k/2,transform:`rotate(-90 12 ${k/2})`,textAnchor:"middle",fontSize:11,fill:a.label,children:A}),
|
|
8
|
-
/* @__PURE__ */y("g",{clipPath:`url(#${O})`,children:Q.map((e,t)=>{const i=s(e.slot,3,e.color,e.tone);return e.points.map((l,r)=>/* @__PURE__ */y("circle",{cx:re(l.x),cy:te(l.y),r:K?oe(l.size??0):U[0]+1,fill:i,fillOpacity:V&&V.s!==t?.25:.62,stroke:a.surface,strokeWidth:2,onMouseEnter:()=>Z({s:t,i:r})},`${e.key}-${r}`))})})]}),V&&ne&&ae&&/* @__PURE__ */y("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */y(e,{title:ae.label??ne.label,rows:[{key:"x",label:M??P.xAxis,color:s(ne.slot,3,ne.color,ne.tone),value:C(ae.x)},{key:"y",label:A??P.yAxis,color:s(ne.slot,3,ne.color,ne.tone),value:T(ae.y)},...null!=ae.size?[{key:"size",label:P.size,color:a.muted,value:f(ae.size,S)}]:[]],footnote:ae.label?ne.label:void 0})})]})}export{b as SCATTER_SERIES_CAP,k as ScatterChart};
|
package/dist/chunk-IGEFUHYE.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as a}from"./chunk-465RRWBY.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-TLRCTNUF.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as o,CHART_INK as i}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-X2PZMXDP.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{useId as h,useState as u}from"react";import{jsx as p,jsxs as d}from"react/jsx-runtime";var f=300*Math.PI/180;function g({rows:g,variant:k="track",size:v=300,max:x,formatValue:y,animate:M=!0,className:N,emptyLabel:b,trackGap:j=6}){const C=s().charts,w=c(),P=y??(e=>m(e,w)),R=b??C.nothingToPlot,T=h(),[E,U]=u(null),{highlighted:$}=l();if(0===g.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${N??""}`,children:R});const F=v/2,L=v/2,Y=v/2-10,z=x??Math.max(...g.map(e=>e.value),1),A="track"===k?Math.max(6,(Y-.16*v)/g.length):0,B=Math.max(1,Math.floor((Y-.16*v)/A||1)),H="track"===k?g.slice(0,B):g,I=Math.min(j,Math.max(1,A-2)),Q=n(H.length,.03),V=null!==E?H[E]:void 0;/* @__PURE__ */
|
|
2
|
-
return d("div",{className:`relative ${N??""}`,children:[
|
|
3
|
-
/* @__PURE__ */d("svg",{width:"100%",height:v,viewBox:`0 0 ${v} ${v}`,role:"img","aria-labelledby":T,onMouseLeave:()=>U(null),children:[
|
|
4
|
-
/* @__PURE__ */p("title",{id:T,children:"track"===k?C.radialTrack(H.length):C.radialCycle(H.length)}),H.map((l,r)=>{const n=o(r,l.color,l.tone),s=Math.max(0,Math.min(1,l.value/z)),c=((e,t)=>null!==E?E!==e:null!==$&&$!==t)(r,l.key);if("track"===k){const o=Y-r*A,m=o-A+I,h=-Math.PI/2;/* @__PURE__ */
|
|
5
|
-
return d("g",{opacity:c?.4:1,onMouseEnter:()=>U(r),className:M?t.sweep:void 0,style:M?a(r,70):void 0,children:[
|
|
6
|
-
/* @__PURE__ */p("path",{d:e(F,L,m,o,h,h+f),fill:i.grid}),
|
|
7
|
-
/* @__PURE__ */p("path",{d:e(F,L,m,o,h,h+f*s),fill:n})]},l.key)}const m=.14*v;/* @__PURE__ */
|
|
8
|
-
return p("g",{opacity:c?.4:1,onMouseEnter:()=>U(r),children:/* @__PURE__ */p("path",{d:e(F,L,m,m+(Y-m)*s,Q(r),Q(r)+Q.step),fill:n})},l.key)})]}),V&&null!==E&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(r,{title:V.label,rows:[{key:"value",label:C.value,color:o(E,V.color,V.tone),value:P(V.value)}]})}),
|
|
9
|
-
/* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(150px,1fr))"},children:g.map((e,t)=>/* @__PURE__ */d("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
10
|
-
/* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:o(t,e.color,e.tone)}}),
|
|
11
|
-
/* @__PURE__ */p("span",{className:"flex-1 truncate",children:e.label}),
|
|
12
|
-
/* @__PURE__ */p("span",{className:"tabular-nums text-gray-800",children:P(e.value)})]},e.key))})]})}export{g as RadialBarChart};
|
package/dist/chunk-K64JRGNE.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-5VDT4762.js";import{Tooltip as i}from"./chunk-BCDG4N6L.js";import{useShellStrings as l}from"./chunk-X2PZMXDP.js";import{useId as a,useRef as s,useState as c,useEffect as u,Fragment as d}from"react";import{jsxs as h,jsx as f}from"react/jsx-runtime";var m=(e,t,r)=>Math.min(r,Math.max(t,e)),p=e=>e.reduce((e,t)=>e+t,0),v=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var g,b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:M=!1,className:j=""}){const D=l().widths,R=a(),z=m(Math.round(x)||1,1,n),B=e($,z),A=B??[...t[z]??[]],S=[...A,100-p(A)],T=P||M,K=s(null),O=s({onChange:k,shown:A,locked:T,n:z,stored:B});O.current={onChange:k,shown:A,locked:T,n:z,stored:B};const E=t=>{const{onChange:r,shown:n,locked:o,n:i}=O.current;if(o)return!1;const l=e(t,i);return!(!l||v(l,n))&&(r(l),!0)},L=(e,t,n)=>{const o=e[t]+e[t+1],i=[...e];i[t]=m(Math.round(n),r,o-r),i[t+1]=o-i[t],E(i.slice(0,-1))&&(ne.current=null)},X=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const n=t.shiftKey?10:1,o=S[e]+S[e+1],i="ArrowRight"===t.key?S[e]+n:"ArrowLeft"===t.key?S[e]-n:"PageUp"===t.key?S[e]+10:"PageDown"===t.key?S[e]-10:"Home"===t.key?r:"End"===t.key?o-r:null;null!==i&&(t.preventDefault(),L(S,e,i))},G=s(null),[H,I]=c(null),F=()=>{G.current=null,I(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};u(()=>F,[]);const U=e=>t=>{if(0!==t.button||T)return;t.preventDefault();const r=K.current?.getBoundingClientRect().width??0;r<=0||(G.current={i:e,x:t.clientX,width:r,from:S,moved:!1,pointer:t.pointerId},I(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},V=e=>{const t=G.current;if(!t)return;if(0===e.buttons)return void F();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}L(t.from,t.i,t.from[t.i]+r/t.width*100)},W=e=>{const t=G.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),F())},q=(e,t)=>{const{shown:n}=O.current,o=function(e,t,n){const o=e.length,i=[...e];if(o<2)return i;const l=m(Math.round(n),r,100-(o-1)*r);let a=l-i[t];i[t]=l;const s=[...Array.from({length:o-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(a<0)return i[s[0]]-=a,i;for(const e of s){if(a<=0)break;const t=Math.min(a,i[e]-r);i[e]-=t,a-=t}return i}([...n,100-p(n)],e,t);return E(o.slice(0,-1))?o:null},[J,Z]=c(0);u(()=>{const e=K.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Z(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const Q=s(null),[Y,_]=c(null),[ee,te]=c([]),re=(e,t)=>_(r=>t?e:r===e?null:r),ne=s(null),oe=(e,t)=>{const r=ne.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:o,stored:i}=O.current;var l,a;return o||(l=i,a=r.stored,void 0===l||void 0===a?l===a:v(l,a))||n(r.stored),!0},ie=S.join(",");u(()=>{const e=null===Y?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===g&&(g=document.createElement("canvas").getContext("2d")),!g)return[];const o=g;return r.flatMap((e,r)=>{if(r===t)return[];const i=e.getBoundingClientRect(),l=getComputedStyle(e);o.font=`${l.fontWeight} ${l.fontSize} ${l.fontFamily}`;const a=o.measureText(e.value).width/2,s=(i.left+i.right)/2;return s+a>n.left&&s-a<n.right?[r]:[]})}(Q.current,Y);te(t=>v(t,e)?t:e)},[Y,ie,J]);const le=D.hint(z,r),ae=S.slice(0,-1).map((e,t)=>p(S.slice(0,t+1)));/* @__PURE__ */
|
|
2
|
-
return h("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":z>1?R:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${M?"opacity-60":""} ${j}`.trim(),children:[
|
|
3
|
-
/* @__PURE__ */h("div",{ref:Q,"data-widths-bar":"",className:"relative h-8",children:[
|
|
4
|
-
/* @__PURE__ */f("div",{ref:K,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:S.map((e,t)=>/* @__PURE__ */f("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[t%2]} ${t%2==0?"bg-accent-tint":""}`,children:1===z&&/* @__PURE__ */f("span",{"data-widths-label":"",children:`${e}%`})},t))}),
|
|
5
|
-
/* @__PURE__ */f("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),z>1&&S.map((e,t)=>/* @__PURE__ */h(d,{children:[(()=>{const n=Y===t,l=p(S.slice(0,t)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
|
|
6
|
-
return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>J>0&&J*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:r,max:100-(z-1)*r,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:M,"aria-label":D.column(t+1),"aria-describedby":R,"data-widths-label":"",onChange:e=>{null===e||oe(t,e)||q(t,e)},onRevert:e=>((e,t)=>{O.current.locked||null===t||oe(e,t)||q(e,t)})(t,e),onFocus:()=>{ne.current={column:t,share:e,stored:O.current.stored},re(t,!0)},onBlur:()=>re(t,!1),className:`absolute inset-0 text-xs font-medium ${w[t%2]} ${ee.includes(t)&&!n?"opacity-0":""}`})})})})(),t<z-1&&/* @__PURE__ */f("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[t]}%`},children:/* @__PURE__ */f(i,{content:D.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */f("div",{role:"separator",tabIndex:M?-1:0,"aria-orientation":"vertical","aria-label":D.divider(t+1,t+2),"aria-valuenow":S[t],"aria-valuemin":r,"aria-valuemax":S[t]+S[t+1]-r,"aria-valuetext":D.dividerValue(t+1,S[t],t+2,S[t+1]),"aria-disabled":T||void 0,onKeyDown:T?void 0:X(t),onPointerDown:U(t),onPointerMove:V,onPointerUp:W,onPointerCancel:W,onLostPointerCapture:()=>{G.current&&F()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(T?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */f("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(T?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${H===t?"w-1":y}`)})})})})]},t))]}),z>1&&/* @__PURE__ */f("span",{id:R,className:"sr-only",children:le})]})}export{x as WidthsBar};
|
package/dist/chunk-KE5U4KKG.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{AccessibleTable as e}from"./chunk-TBPHW42V.js";import{arcPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as l}from"./chunk-TLRCTNUF.js";import{CHART_INK as a,resolveSeriesColor as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as o}from"./chunk-X2PZMXDP.js";import{formatPlain as h,formatPercent as c}from"./chunk-C3QOHMR6.js";import{useState as u}from"react";import{jsx as s,jsxs as d}from"react/jsx-runtime";function m(e,t,r,l,a,n,i,o){if(l>=8)return;const h=e.reduce((e,t)=>e+p(t,8-l),0);if(h<=0)return;let c=t;e.forEach((e,t)=>{const u=p(e,8-l),s=u/h*r,d=`${i}/${e.key}`,f=0===l?t:a,b=0===l?e.key:n;o.push({id:d,label:e.label,value:u,depth:l,start:c,end:c+s,branch:f,branchKey:b}),e.children?.length&&m(e.children,c,s,l+1,f,b,d,o),c+=s})}function p(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+p(r,t-1),0):Math.max(0,e.value??0)}function f({nodes:p,size:f=320,innerRadius:b=44,ringGap:v=2,formatValue:k,centerLabel:x,className:g,emptyLabel:y}){const M=i().charts,$=o(),j=k??(e=>h(e,$)),N=y??M.nothingToBreakDown,[w,C]=u(null),{highlighted:L}=r(),P=[];if(m(p,-Math.PI/2,2*Math.PI,0,0,"","",P),0===P.length)/* @__PURE__ */return s("p",{className:`text-sm text-gray-500 ${g??""}`,children:N});const T=Math.max(...P.map(e=>e.depth))+1,E=f/2,F=f/2,R=(f/2-8-b)/T,z=P.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),A=e=>`color-mix(in oklab, ${n(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${a.surface})`,B=e=>null!==w?e.id===w:null===L||e.branchKey===L,H=w?P.find(e=>e.id===w):void 0,I=e=>c(e.value/z*100,1,$);/* @__PURE__ */
|
|
2
|
-
return d("div",{className:`relative ${g??""}`,children:[
|
|
3
|
-
/* @__PURE__ */d("svg",{width:"100%",height:f,viewBox:`0 0 ${f} ${f}`,role:"img","aria-label":M.sunburst(j(z),T),onMouseLeave:()=>C(null),children:[P.map(e=>/* @__PURE__ */s("path",{d:t(E,F,b+e.depth*R+v/2,b+(e.depth+1)*R-v/2,e.start,e.end),fill:A(e),fillOpacity:B(e)?1:.45,stroke:a.surface,strokeWidth:1,onMouseEnter:()=>C(e.id)},e.id)),x&&/* @__PURE__ */s("text",{x:E,y:F+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:a.label,children:x})]}),H&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(l,{title:H.label,rows:[{key:"value",label:M.value,color:A(H),value:j(H.value)},{key:"share",label:M.share,color:a.muted,value:I(H)}]})}),
|
|
4
|
-
/* @__PURE__ */s(e,{caption:M.sunburst(j(z),T),head:[M.tableLevel,M.tableItem,M.value,M.share],rows:P.map(e=>[e.depth+1,e.label,j(e.value),I(e)])})]})}export{f as SunburstChart};
|
package/dist/chunk-N6VP75F5.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{DropdownMenu as e}from"./chunk-ACVKU6YW.js";import{Button_default as i}from"./chunk-NHH2MXFU.js";import{iconButtonClasses as n}from"./chunk-UQYNPYF4.js";import{Icon as r}from"./chunk-KKSVRIMP.js";import{Tooltip as a}from"./chunk-BCDG4N6L.js";import{forwardRef as l,useId as o}from"react";import{jsxs as s,jsx as t}from"react/jsx-runtime";var d="relative focus-visible:z-10",m={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},c=l(function({children:l,onClick:c,type:b="button",items:h,menuLabel:u,variant:f="primary",size:p="md",loading:v=!1,leftIcon:k,disabled:N=!1,disabledReason:g,tooltip:w,menuDisabled:x=!1,menuDisabledReason:j,onMenuOpenChange:y,menuFooter:C,menuFooterLabel:W,align:z="end",side:F="bottom",menuMinWidth:L,linkAs:M,block:R=!1,className:A=""},D){const I=N&&(null!=g&&""!==g&&!1!==g)&&!v,K=x&&null!=j&&""!==j&&!1!==j,U=o(),Y=/* @__PURE__ */t(i,{ref:D,type:b,variant:f,size:p,loading:v,leftIcon:k,block:R,disabled:N&&!I,"aria-disabled":!!I||void 0,disabledReason:I?g:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),$=R?"relative flex min-w-0 flex-1":"relative inline-flex",B=p.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
|
|
2
|
-
return s("div",{className:[R?"flex w-full":"inline-flex","items-stretch",A].filter(Boolean).join(" "),children:[null==w||""===w||I?Y:/* @__PURE__ */t(a,{content:w,className:$,children:Y}),
|
|
3
|
-
/* @__PURE__ */t(a,{content:K?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":K?U:void 0,items:h,align:z,side:F,minWidth:L,linkAs:M,disabled:x&&!K,"aria-disabled":K,onOpenChange:y,footer:C,footerLabel:W,triggerClassName:n({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(r,{name:"chevron-down",className:B,strokeWidth:2,"aria-hidden":"true"})})}),K&&/* @__PURE__ */t("span",{id:U,className:"sr-only",children:j})]})});export{c as SplitButton_default};
|
package/dist/chunk-OPB3I4JH.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{DragBand as e,tooltipBesideBand as t}from"./chunk-7VCAMNCH.js";import{niceAxis as r,niceMax as i,linearScale as n,axisGutter as o,bandScale as l}from"./chunk-2JWPNR2U.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{CHART_INK as h}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-X2PZMXDP.js";import{formatPlain as d}from"./chunk-C3QOHMR6.js";import{useRef as u,useState as f,useId as g,useEffect as p}from"react";import{jsx as x,jsxs as y}from"react/jsx-runtime";function v({labels:v,values:b,height:M=220,width:k,bandPadding:w=.24,min:N,max:A,yTickCount:P=4,formatValue:$,yAxisLabel:j,xTickAnchor:C="center",children:D,overlay:E,tooltip:R,onSelect:U,zoom:z,ariaLabel:L,className:S,emptyLabel:V}){const F=c().charts,I=m(),T=$??(e=>d(e,I)),W=V??F.noData,X=u(null),Z=a(X),B=k??Z,[H,Q]=f(null),J=g();if(p(()=>{if(null!==H)return s(e=>"Escape"===e.key&&(Q(null),!0))},[H]),0===v.length||!b.some(Number.isFinite))/* @__PURE__ */
|
|
2
|
-
return x("div",{className:S,ref:X,children:/* @__PURE__ */x("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:M},children:W})});const K=b.filter(Number.isFinite),O=K.every(Number.isInteger),q=void 0===N&&void 0===A?r(Math.min(0,...K),Math.max(0,...K),{intervals:P+1,integer:O}):null,G=void 0!==N&&void 0===A?r(N,Math.max(N,...K),{intervals:P+1,integer:O,zero:!1}):null,Y=q?q.lo:N??Math.min(0,...K),_=q?q.hi:G?G.hi:A??i(Math.max(...K,0)),ee=q?q.ticks:G?[Y,...G.ticks.filter(e=>e>Y)]:n([Y,_],{from:0,to:1}).ticks(P+1),te={top:12,right:16,bottom:26,left:o(ee.map(T),48)+(j?10:0)},re=te.left,ie=Math.max(re+1,B-te.right),ne=te.top,oe=M-te.bottom,le=n([Y,_],{from:oe,to:ne}),ae=l(v.length,{from:re,to:ie},w),he=(ie-re)/Math.max(1,v.length),se=he>=48,ce=se?1:Math.max(1,Math.ceil(v.length/Math.max(1,Math.floor(B/84)))),me=Math.max(2,Math.floor((he-6)/6.6)),de=e=>se&&e.length>me?`${e.slice(0,me-1).trimEnd()}…`:e;/* @__PURE__ */
|
|
3
|
-
return y("div",{className:`relative ${S??""}`,ref:X,children:[
|
|
4
|
-
/* @__PURE__ */y("svg",{width:"100%",height:M,viewBox:`0 0 ${B} ${M}`,role:"img","aria-label":L,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Q(null),onBlur:()=>Q(null),onKeyDown:e=>{if(U&&null!==H&&("Enter"===e.key||" "===e.key))return e.preventDefault(),void U(H);if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1;Q(e=>Math.min(v.length-1,Math.max(0,(e??0)+t)))},style:z?{userSelect:"none",touchAction:"pan-y"}:void 0,children:[
|
|
5
|
-
/* @__PURE__ */x("defs",{children:/* @__PURE__ */x("clipPath",{id:J,children:/* @__PURE__ */x("rect",{x:re,y:ne,width:ie-re,height:oe-ne})})}),ee.map(e=>/* @__PURE__ */x("line",{x1:re,y1:le(e),x2:ie,y2:le(e),stroke:h.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
|
|
6
|
-
/* @__PURE__ */x("line",{x1:re,y1:le(Math.max(Y,0)),x2:ie,y2:le(Math.max(Y,0)),stroke:h.axis,strokeWidth:1,shapeRendering:"crispEdges"}),ee.map(e=>/* @__PURE__ */x("text",{x:re-8,y:le(e)+4,textAnchor:"end",fontSize:11,fill:h.label,style:{fontVariantNumeric:"tabular-nums"},children:T(e)},`t${e}`)),j&&/* @__PURE__ */x("text",{x:14,y:(ne+oe)/2,transform:`rotate(-90 14 ${(ne+oe)/2})`,textAnchor:"middle",fontSize:11,fill:h.label,children:j}),
|
|
7
|
-
/* @__PURE__ */x("g",{clipPath:`url(#${J})`,children:D({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:B,height:M,clipId:J,active:H})}),E?.({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:B,height:M,clipId:J,active:H}),v.map((e,t)=>t%ce===0?/* @__PURE__ */x("text",{x:"start"===C?ae(t):ae.center(t),y:M-8,textAnchor:"middle",fontSize:11,fill:h.label,style:{fontVariantNumeric:"tabular-nums"},children:de(e)},`x${t}`):null),z?.drag&&/* @__PURE__ */x(e,{x0:ae.center(z.drag[0])-(ie-re)/v.length/2,x1:ae.center(z.drag[1])+(ie-re)/v.length/2,top:ne,bottom:oe}),v.map((e,t)=>/* @__PURE__ */x("rect",{x:ae.center(t)-(ie-re)/v.length/2,y:ne,width:(ie-re)/v.length,height:oe-ne,fill:"transparent",onMouseEnter:()=>Q(t),onPointerDown:z?()=>z.press(t):void 0,onPointerEnter:z?()=>z.over(t):void 0,onPointerUp:z?.release,onClick:U?()=>U(t):void 0,style:U?{cursor:"pointer"}:void 0},`h${t}`))]}),R&&null!==H&&
|
|
8
|
-
/* @__PURE__ */x("div",{className:"pointer-events-none absolute top-2 z-10",style:t(ae.center(H),ae.bandwidth,B),children:R(H)})]})}export{v as CartesianPlot};
|
package/dist/chunk-PYQ6DD3F.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r="10.1.0",a=r;export{a as APP_VERSION,r as VERSION};
|
package/dist/chunk-QASKQDUR.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import{ChartBrush as t}from"./chunk-RQNZ2PVW.js";import{ChartDot as e}from"./chunk-CK2YOGUS.js";import{stepPath as a,curvePath as r,areaBetween as o,areaFrom as l}from"./chunk-VFC6QUEN.js";import{ChartDefs as n,MOTION as i,stagger as s,fillFor as c,dashFor as d,maskId as m}from"./chunk-465RRWBY.js";import{ChartSkeleton as h}from"./chunk-BMQCUHSD.js";import{useHighlight as u,highlightOpacity as f}from"./chunk-CNYAHYE6.js";import{ChartTooltip as p}from"./chunk-TLRCTNUF.js";import{useDragZoom as g,DragBand as y,ChartZoomSummary as k,tooltipBesideBand as x}from"./chunk-7VCAMNCH.js";import{pairedAxes as v,niceAxis as b,niceMax as M,linearScale as N,axisGutter as w,bandScale as j,ladderScale as $}from"./chunk-2JWPNR2U.js";import{usePlotWidth as V}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as C,CHART_INK as z,STATUS_VARS as A}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as R}from"./chunk-TWVUQUUD.js";import{useShellStrings as L,useShellLocale as S}from"./chunk-X2PZMXDP.js";import{formatPercent as W,formatPlain as D}from"./chunk-C3QOHMR6.js";import{useRef as E,useState as T,useId as U,useEffect as P}from"react";import{jsx as I,jsxs as F}from"react/jsx-runtime";var B=12,O=16,Q=26,H=52,Y=t=>"number"==typeof t&&Number.isFinite(t);function Z({series:Z,labels:X,height:K=200,stacked:G=!1,stackMode:J="value",levels:q,curve:_="linear",tension:tt=0,max:et,yTickCount:at=4,formatValue:rt,formatTooltipValue:ot,tooltipLabels:lt,yAxisLabel:nt,referenceLines:it,labelEndpoints:st=!1,dots:ct,dotVariant:dt="border",pulse:mt=!1,brush:ht=!1,range:ut,onRangeChange:ft,zoomable:pt=!0,columnStrip:gt,onSelect:yt,loading:kt=!1,animate:xt=!0,reveal:vt="left-to-right",fillVariant:bt="gradient",gridStyle:Mt="solid",width:Nt,className:wt,emptyLabel:jt}){const $t=L().charts,Vt=S(),Ct=rt??(t=>D(t,Vt)),zt=ot??Ct,At=jt??$t.noData,Rt=E(null),Lt=V(Rt),St=Nt??Lt,[Wt,Dt]=T(null),[Et,Tt]=T(null),{highlighted:Ut}=u(),Pt=U(),It=ut??Et,Ft=g(ht&&It?It[1]-It[0]+1:X.length,pt);if(P(()=>{if(null!==Wt)return R(t=>"Escape"===t.key&&(Dt(null),!0))},[Wt]),kt)/* @__PURE__ */
|
|
2
|
-
return I("div",{className:wt,ref:Rt,children:/* @__PURE__ */I(h,{height:K,width:Nt??Lt})});const Bt=X,Ot=ut??Et??[0,Math.max(0,Bt.length-1)],[Qt,Ht]=Ot,Yt=t=>Ft.slice(ht?t.slice(Qt,Ht+1):t),Zt=lt?Yt(lt):void 0,Xt=Z.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(Y)).map(t=>({...t,data:Yt(t.data),pointTones:t.pointTones?Yt(t.pointTones):void 0})),Kt=t=>(ht?Qt:0)+(Ft.view?.[0]??0)+t;if(X=Yt(Bt),0===Xt.length||0===X.length)/* @__PURE__ */
|
|
3
|
-
return I("div",{className:wt,ref:Rt,children:/* @__PURE__ */I("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:K},children:At})});const Gt=X.map((t,e)=>Xt.reduce((t,a)=>t+(Y(a.data[e])?a.data[e]:0),0)),Jt=(t,e)=>Gt[e]>0?t/Gt[e]:null,qt=[];if(G){let t=X.map(()=>0);for(const e of Xt)t=t.map((t,a)=>t+(Y(e.data[a])?e.data[a]:0)),qt.push("percent"===J?t.map((t,e)=>Jt(t,e)):[...t])}const _t=!!q&&q.length>0,te=t=>"right"===t.axis,ee=!G&&!_t&&void 0===et&&Xt.some(te)&&Xt.some(t=>!te(t)),ae=gt&&!G?gt:null,re=t=>!!ae&&"column"===t.mode,oe=(ee?Xt.filter(t=>!te(t)):Xt).filter(t=>!re(t)),le=ee?Xt.filter(te).flatMap(t=>t.data.filter(Y)):[],ne=G?(qt.at(-1)??[]).filter(Y):oe.flatMap(t=>t.data.filter(Y)),ie=ee?v([Math.min(0,...ne),Math.max(0,...ne)],[Math.min(0,...le),Math.max(0,...le)],{intervals:at+1,integerLeft:ne.every(Number.isInteger),integerRight:le.every(Number.isInteger)}):null,se=ie?ie.left:G&&"percent"===J||_t||void 0!==et?null:b(G?0:Math.min(0,...ne),Math.max(0,...ne),{intervals:at+1,integer:ne.every(Number.isInteger)}),ce=se?se.lo:0,de=G&&"percent"===J?1:se?se.hi:et??M(Math.max(...ne,0)),me=G&&"percent"===J?t=>W(Math.round(100*t),0,Vt):Ct,he=_t?q:se?se.ticks:N([ce,de],{from:0,to:1}).ticks(at+1),ue=w(he.map(me),H),fe=ie?w(ie.right.ticks.map(Ct),O):O,pe={left:ue,right:Math.max(ue+1,St-fe),top:B,bottom:K-Q},ge=j(X.length,{from:pe.left,to:pe.right}),ye=_t?$(q,{from:pe.bottom,to:pe.top}):null,ke=N([ce,de],{from:pe.bottom,to:pe.top}),xe=ke(Math.max(ce,0)),ve=t=>ye?ye(t):ke(t),be=Xt.filter(re),Me=Math.max(0,...X.map((t,e)=>be.reduce((t,a)=>t+Math.max(0,Y(a.data[e])?a.data[e]:0),0))),Ne=t=>xe-(Me>0?t/Me:0)*(pe.bottom-pe.top)*(ae??0),we=ie?N([ie.right.lo,ie.right.hi],{from:pe.bottom,to:pe.top}):null,je=t=>we&&te(t)?we:ve,$e=ye?ye.levels.map(t=>({value:t,y:ye(t)})):he.map(t=>({value:t,y:ke(t)})),Ve=t=>e=>{e.preventDefault(),Dt(e=>{const a=(e??0)+t;return Math.min(X.length-1,Math.max(0,a))})},Ce=Math.max(1,Math.ceil(X.length/Math.max(1,Math.floor(St/96))));/* @__PURE__ */
|
|
4
|
-
return F("div",{className:`relative ${wt??""}`,ref:Rt,children:[
|
|
5
|
-
/* @__PURE__ */F("svg",{width:"100%",height:K,viewBox:`0 0 ${St} ${K}`,role:"img","aria-label":$t.overIntervals(Xt.map(t=>t.label),X.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Dt(null),onBlur:()=>Dt(null),style:pt?{userSelect:"none",touchAction:"pan-y"}:void 0,onKeyDown:t=>{if(yt&&null!==Wt&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void yt(Kt(Wt));"ArrowRight"===t.key&&Ve(1)(t),"ArrowLeft"===t.key&&Ve(-1)(t)},children:[
|
|
6
|
-
/* @__PURE__ */I("defs",{children:/* @__PURE__ */I("clipPath",{id:Pt,children:/* @__PURE__ */I("rect",{x:pe.left,y:pe.top,width:pe.right-pe.left,height:pe.bottom-pe.top})})}),
|
|
7
|
-
/* @__PURE__ */I(n,{id:Pt,fills:Xt.map((t,e)=>({color:C(t.slot,t.color,t.tone),variant:t.fillVariant??bt})),fadeFrom:G?.42:.3,reveal:!!xt&&vt}),$e.map(t=>/* @__PURE__ */I("line",{x1:pe.left,y1:t.y,x2:pe.right,y2:t.y,stroke:z.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===Mt?"3 3":void 0},`grid-${t.value}`)),
|
|
8
|
-
/* @__PURE__ */I("line",{x1:pe.left,y1:xe,x2:pe.right,y2:xe,stroke:z.axis,strokeWidth:1,shapeRendering:"crispEdges"}),$e.map(t=>/* @__PURE__ */I("text",{x:pe.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:me(t.value)},`ytick-${t.value}`)),ie&&$e.map((t,e)=>/* @__PURE__ */I("text",{x:pe.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:Ct(ie.right.ticks[e])},`ytick-r-${t.value}`)),nt&&/* @__PURE__ */I("text",{x:12,y:(pe.top+pe.bottom)/2,transform:`rotate(-90 12 ${(pe.top+pe.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:z.label,children:nt}),
|
|
9
|
-
/* @__PURE__ */I("g",{clipPath:`url(#${Pt})`,mask:xt&&vt?`url(#${m(Pt)})`:void 0,children:Xt.map((t,e)=>{const n=C(t.slot,t.color,t.tone),m=t.mode??(G?"area":"line"),h=f(t.key,Ut);if("step"===m){const e=X.map((e,a)=>({start:ge(a),end:ge.end(a),value:t.data[a]})).filter(t=>Y(t.value)).map(e=>({start:e.start,end:e.end,y:je(t)(e.value)}));/* @__PURE__ */
|
|
10
|
-
return I("path",{d:a(e),fill:"none",stroke:n,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:h??void 0,className:"rosh-viz-mark"},t.key)}const u=X.map((a,r)=>{const o=G?qt[e]?.[r]:t.data[r];return Y(o)?[ge.center(r),je(t)(o)]:null}).filter(t=>null!==t);if(0===u.length)return null;if("column"===m){const a=Math.max(1,.62*ge.bandwidth),r="solid"===t.fillVariant,o=je(t);return re(t)?/* @__PURE__ */I("g",{opacity:h??void 0,className:"rosh-viz-mark",children:X.map((o,l)=>{const i=t.data[l];if(!Y(i)||i<=0)return null;const s=((t,e)=>be.slice(0,be.findIndex(e=>e.key===Xt[t]?.key)).reduce((t,a)=>t+Math.max(0,Y(a.data[e])?a.data[e]:0),0))(e,l),c=Ne(s+i),d=Ne(s)-(s>0?1:0);/* @__PURE__ */
|
|
11
|
-
return I("rect",{x:ge.center(l)-a/2,y:c,width:a,height:Math.max(0,d-c),rx:2,fill:t.pointTones?.[l]?A[t.pointTones[l]]:n,fillOpacity:r?1:.55},l)})},t.key):/* @__PURE__ */I("g",{opacity:h??void 0,className:"rosh-viz-mark",children:X.map((l,c)=>{const d=G?qt[e]?.[c]:t.data[c];if(!Y(d))return null;const m=o(d);/* @__PURE__ */
|
|
12
|
-
return I("rect",{x:ge.center(c)-a/2,y:Math.min(m,xe),width:a,height:Math.abs(xe-m),rx:2,fill:n,fillOpacity:r?1:.35,className:xt?i.rise:void 0,style:xt?s(c,26):void 0},c)})},t.key)}const p=r(u,_,tt),g=G&&e>0?X.map((t,a)=>[ge.center(a),ve(qt[e-1]?.[a]??0)-2]):null,y=g?o(p,g):l(p,u,xe);/* @__PURE__ */
|
|
13
|
-
return F("g",{opacity:h??void 0,className:"rosh-viz-mark",children:[("area"===m||G)&&
|
|
14
|
-
/* @__PURE__ */I("path",{d:y,fill:c(Pt,e,t.fillVariant??bt,n),stroke:"none"}),
|
|
15
|
-
/* @__PURE__ */I("path",{d:p,fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:d(t.stroke??(t.forecast?"animated-dashed":"solid")),className:xt&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?i.march:void 0})]},t.key)})}),it?.map((t,e)=>{const a=t.color??A[t.tone??"critical"],r=ve(t.value);/* @__PURE__ */
|
|
16
|
-
return F("g",{children:[
|
|
17
|
-
/* @__PURE__ */I("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */I("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Xt.map((t,a)=>{if("column"===t.mode)return null;const r=ct??(st?"last":"none"),o=C(t.slot,t.color,t.tone),l=[...t.data].map(Y).lastIndexOf(!0),n="all"===r?X.map((t,e)=>e).filter(e=>Y(G?qt[a]?.[e]:t.data[e])):l>=0?[l]:[];/* @__PURE__ */
|
|
18
|
-
return F("g",{children:[n.map(r=>{const n=G?qt[a]?.[r]:t.data[r];return Y(n)?/* @__PURE__ */I(e,{cx:ge.center(r),cy:je(t)(n),color:o,variant:dt,pulse:mt&&r===l,title:`${X[r]}: ${t.label} ${Ct(n)}`},r):null}),st&&l>=0&&Y(G?qt[a]?.[l]:t.data[l])&&/* @__PURE__ */I("text",{x:ge.center(l)-10,y:je(t)(G?qt[a]?.[l]:t.data[l])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:Ct(G?qt[a]?.[l]:t.data[l])})]},`dots-${t.key}`)}),X.map((t,e)=>e%Ce===0?/* @__PURE__ */I("text",{x:ge.center(e),y:K-8,textAnchor:"middle",fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Wt&&/* @__PURE__ */I("line",{x1:ge.center(Wt),y1:pe.top,x2:ge.center(Wt),y2:pe.bottom,stroke:z.axis,strokeWidth:1}),ae&&Me>0&&
|
|
19
|
-
/* @__PURE__ */F("g",{pointerEvents:"none","data-column-strip":"true",children:[
|
|
20
|
-
/* @__PURE__ */I("line",{x1:pe.left,y1:Ne(Me),x2:pe.right,y2:Ne(Me),stroke:z.grid,strokeWidth:1,strokeDasharray:"2 3",shapeRendering:"crispEdges"}),
|
|
21
|
-
/* @__PURE__ */I("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:Ct(Me)})]}),Ft.drag&&/* @__PURE__ */I(y,{x0:ge(Ft.drag[0]),x1:ge(Ft.drag[1])+ge.bandwidth,top:pe.top,bottom:pe.bottom}),X.map((t,e)=>/* @__PURE__ */I("rect",{x:ge(e),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>Dt(e),onPointerDown:()=>Ft.press(e),onPointerEnter:()=>Ft.over(e),onPointerUp:Ft.release,onClick:yt?()=>yt(Kt(e)):void 0,style:yt?{cursor:"pointer"}:void 0},`hit-${e}`))]}),Ft.view&&/* @__PURE__ */I(k,{from:Zt?.[0]??X[0],to:Zt?.at(-1)??X[X.length-1],count:X.length,total:G&&"percent"!==J?zt(Gt.reduce((t,e)=>t+e,0)):ae?zt(be.reduce((t,e)=>t+e.data.filter(Y).reduce((t,e)=>t+e,0),0)):void 0,rows:(ae?be:Xt).filter(t=>t.data.some(Y)).map(t=>{const e=t.data.filter(Y),a=C(t.slot,t.color,t.tone);if(0===e.length)return{key:t.key,label:t.label,color:a,value:"—"};const r=e.reduce((t,e)=>t+e,0),o=G||"column"===t.mode?zt(r):$t.zoomLevel(zt(r/e.length),zt(Math.max(...e)));return{key:t.key,label:t.label,color:a,value:o}}),onClear:Ft.clear}),ht&&Bt.length>2&&/* @__PURE__ */I(t,{className:"mt-1",labels:Bt,width:St,data:Z[0]?.data??[],range:Ot,onRangeChange:t=>{ft?ft(t):Tt(t)}}),null!==Wt&&
|
|
22
|
-
/* @__PURE__ */I("div",{className:"pointer-events-none absolute top-2 z-10",style:x(ge.center(Wt),ge.bandwidth,St),children:/* @__PURE__ */I(p,{title:Zt?.[Wt]??X[Wt],rows:Xt.map((t,e)=>({key:t.key,label:t.label,color:C(t.slot,t.color,t.tone),value:Y(t.data[Wt])?G&&"percent"===J?`${W(100*(Jt(t.data[Wt],Wt)??0),1,Vt)} · ${zt(t.data[Wt])}`:zt(t.data[Wt]):void 0})),footnote:G&&"percent"===J?$t.inBucket(zt(Gt[Wt])):void 0})})]})}export{Z as TimeSeriesChart};
|