efficient-shell 7.54.0 → 7.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/README.md +17 -9
  2. package/dist/{Browser-ZSP7T7AA.js → Browser-6SOGC27E.js} +14 -14
  3. package/dist/{Calculator-5MVTWQWV.js → Calculator-Z6JA6D6Q.js} +12 -12
  4. package/dist/ConfirmDialog-ZWVAYCJQ.js +1 -0
  5. package/dist/{CurrencyConverter-VYC463F4.js → CurrencyConverter-XFICWUGP.js} +7 -7
  6. package/dist/{Documents-URKLA3VN.js → Documents-C7DJOE4M.js} +10 -10
  7. package/dist/Files-Q5HVPRVK.js +87 -0
  8. package/dist/{Notepad-HWM57JW5.js → Notepad-3XPZIKLE.js} +11 -11
  9. package/dist/PdfViewer-NW6NQ6NP.js +1 -0
  10. package/dist/{PomodoroTimer-MXKIOXM7.js → PomodoroTimer-ZEPPQYCU.js} +64 -64
  11. package/dist/{Preview-AP3AOSFW.js → Preview-HV2KJRRI.js} +46 -46
  12. package/dist/{Sidebar-CWUGH47O.js → Sidebar-LKER76LS.js} +36 -36
  13. package/dist/Spreadsheet-URLX55NC.js +37 -0
  14. package/dist/{Stock-S5HULMS7.js → Stock-M6GGO7XF.js} +3 -3
  15. package/dist/{Weather-5GWQJ4VD.js → Weather-VU7VGUDO.js} +20 -20
  16. package/dist/{WorldClock-3UZK5M7S.js → WorldClock-QAMG23XA.js} +6 -6
  17. package/dist/ai/index.js +18 -18
  18. package/dist/apps/index.js +1 -1
  19. package/dist/bin/ui-check.js +1 -1
  20. package/dist/brand.css +1 -1
  21. package/dist/chunk-2H3XIWVB.js +14 -0
  22. package/dist/{chunk-K73JEGD5.js → chunk-4AHFABYE.js} +9 -9
  23. package/dist/{chunk-SGIM64RL.js → chunk-54LUMK66.js} +1 -1
  24. package/dist/{chunk-EQZ7DF3J.js → chunk-56DUNIS6.js} +19 -19
  25. package/dist/{chunk-FDZP4YPX.js → chunk-5H3MONF5.js} +1 -1
  26. package/dist/{chunk-BMKGFJR7.js → chunk-63RTIL66.js} +1 -1
  27. package/dist/{chunk-TXLJEUYC.js → chunk-6ST5FSQF.js} +4 -4
  28. package/dist/{chunk-UB2IV2II.js → chunk-7ZYZDQ5V.js} +7 -7
  29. package/dist/chunk-BLMDTJOK.js +1 -0
  30. package/dist/{chunk-HXU6LDQB.js → chunk-DCMTTLLV.js} +4 -4
  31. package/dist/{chunk-7SNZKUCI.js → chunk-DRQF3Z2O.js} +1 -1
  32. package/dist/{chunk-3ZZ2UPNR.js → chunk-EVSRRTEN.js} +1 -1
  33. package/dist/{chunk-6HJPHOUV.js → chunk-FP4N53XC.js} +1 -1
  34. package/dist/{chunk-YDDG7MXB.js → chunk-GEHGFIQ6.js} +1 -1
  35. package/dist/{chunk-LBZF6GCK.js → chunk-H4SBJXBL.js} +1 -1
  36. package/dist/{chunk-O5R4V3KH.js → chunk-HCC7EJUD.js} +1 -1
  37. package/dist/{chunk-ANYZYIEY.js → chunk-J4NEE4AO.js} +27 -27
  38. package/dist/{chunk-VOUSFISE.js → chunk-J5USRYOM.js} +17 -17
  39. package/dist/{chunk-S5XQ5DBA.js → chunk-KNOKDBRY.js} +9 -9
  40. package/dist/{chunk-SFO2M76G.js → chunk-L37CPWIB.js} +13 -13
  41. package/dist/chunk-MRQLTNG6.js +1017 -0
  42. package/dist/{chunk-R42GJPQL.js → chunk-NKOABAWD.js} +1 -1
  43. package/dist/{chunk-2ZSSYQFK.js → chunk-OWXCXFL6.js} +2 -2
  44. package/dist/chunk-QGMHTEJ2.js +21 -0
  45. package/dist/{chunk-4FQTMGCA.js → chunk-T3YRSGP6.js} +2 -2
  46. package/dist/chunk-T6D5LTQR.js +1 -0
  47. package/dist/{chunk-YT4B3NSV.js → chunk-TAUIAKU3.js} +4 -3
  48. package/dist/chunk-WFQIEKM3.js +106 -0
  49. package/dist/{chunk-OUURHOIS.js → chunk-YIIFH7CK.js} +1 -1
  50. package/dist/file-intake/index.js +1 -1
  51. package/dist/i18n/index.d.ts +1 -1
  52. package/dist/icons/efficient-looks.js +19 -17
  53. package/dist/icons/efficient.d.ts +4 -2
  54. package/dist/icons/efficient.js +95 -94
  55. package/dist/icons/iconoir.js +4 -1
  56. package/dist/icons/index.d.ts +1 -1
  57. package/dist/icons/index.js +1 -1
  58. package/dist/icons/lucide.js +6 -1
  59. package/dist/icons/phosphor.js +2 -1
  60. package/dist/icons/tabler.js +8 -1
  61. package/dist/{index-EuZDrQc_.d.ts → index-pjuTiAkS.d.ts} +5 -3
  62. package/dist/index.d.ts +21 -9
  63. package/dist/index.js +297 -297
  64. package/dist/locales/zh-Hans.d.ts +1 -1
  65. package/dist/locales/zh-Hans.js +1 -1
  66. package/dist/map/index.js +8 -8
  67. package/dist/markdown/index.js +1 -1
  68. package/dist/page-tabs/index.js +5 -5
  69. package/dist/pdf/index.js +1 -1
  70. package/dist/{strings-IB8gUtul.d.ts → strings-C7ZZ22PO.d.ts} +4 -0
  71. package/dist/telemetry/index.js +1 -1
  72. package/dist/ui/index.d.ts +2 -2
  73. package/dist/ui/index.js +1 -1
  74. package/package.json +1 -1
  75. package/dist/ConfirmDialog-5LHOXDQS.js +0 -1
  76. package/dist/Files-HTROHCLI.js +0 -87
  77. package/dist/PdfViewer-EUW7YVAH.js +0 -1
  78. package/dist/Spreadsheet-2XAXIZ36.js +0 -37
  79. package/dist/chunk-2ZRV46PX.js +0 -108
  80. package/dist/chunk-3RSAW3BM.js +0 -21
  81. package/dist/chunk-FNR5SPQM.js +0 -10
  82. package/dist/chunk-HQLDTFAF.js +0 -1
  83. package/dist/chunk-NZBX24NL.js +0 -1
  84. package/dist/chunk-RC27X4SF.js +0 -1
  85. package/dist/chunk-VA4OTNJP.js +0 -1021
package/dist/ui/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{APP_UPDATE_POLL_MS,Accordion,AlignmentGrid,AppUpdateBanner,AttachButton,AttachmentDropZone,AttachmentList,AuthScreen,Avatar,AvatarGroup,BORDER_LINE_STYLES,BORDER_WIDTHS,BorderInput,BoxPlotChart,BrandAssetEditor,BudgetBar,CHART_INK,COLUMN_COUNT_MAX,COLUMN_COUNT_WIDTHS,COLUMN_SHARES_EQUAL,COLUMN_SHARE_MIN,CONTROL_HEIGHTS,CORNERS,CORNERS_FOR_THEME,Calendar,CandlestickChart,Card,CartesianPlot,ChartBrush,ChartDefs,ChartDot,ChartFrame,ChartHighlightProvider,ChartSkeleton,ChartTooltip,ChatTemplate,Checkbox_default as Checkbox,CheckoutTemplate,ChordChart,ColorPicker,ColorPickerPanel,ColorSwatch,ColoredBadge,ColumnChart,ComposerAttachments,ContainerFillChart,ContextMenu,CornersInput,CountBadge,DAY_MS,DashboardTemplate,DataTable,DataTablePage,DatePicker_default as DatePicker,DateRangePicker,DateTimePicker_default as DateTimePicker,DescriptionList,DisplayChips,Divider,Drawer,DropdownMenu,ELEVATION_LEVELS,EmailTemplate,EmptyState,EmptyValue,ErrorBoundary,ErrorPage,FONT_WEIGHTS,FilePicker_default as FilePicker,FloatingBar,FormErrorSummary,FormField,FormLayoutPage,FunnelChart,GROUP_COLORS,GROUP_COLORS_SOLID,GalleryTemplate,Grid,HeatmapChart,HelpCenter,HexInput,HistogramChart,IconPicker,IconRail,IconRailButton,ImageFocusPoint,Inline,Input_default as Input,InputNumber_default as InputNumber,Kanban,Label,LanguagePanel,LanguageSelect,LinkPicker,ListFooter,ListLoadError,ListRow,MAX_FRACTION_DIGITS,MOTION,MOTION_DURATIONS,MediaUploadField,MediaUploadGrid,Meter,MetricBar,MilestoneTimeline,NativeSelect,NumericKeypad,POST_PRODUCTION_STATUSES,PageHeader,Pagination,PaperclipGlyph,Paragraph,PictureTiles,PieChart,Popover,PortalBrandingProvider,ProductionTimeline,RADAR_SERIES_CAP,RADIUS_ROLES,ROW_HEIGHTS,RadarChart,RadialBarChart,Radio_default as Radio,RadioGroup,RangeChart,RankedBars,SCATTER_SERIES_CAP,SERIES_SLOT_COUNT,SERIES_VARS,SPACING_ROLES,SPACING_SCALE,STAGES,STATUS_VARS,SankeyChart,ScatterChart,SearchableSelect,Segmented,Select_default as Select,SettingRow,ShowWhen,SidebarActionButton,SidebarGroupLabel,SidebarNavGroup,SidebarNavItem,SidesEachToggle,SidesInput,Skeleton,Slider,SliderGroup,Snippet,SortableList,Sparkline,SplitButton_default as SplitButton,Stack,StatCard,StatTile,Statistic,StatusBadge,StatusBadgeProvider,Stepper,SunburstChart,Switch_default as Switch,TYPE_SCALE,Tabs,TagInput,Text,TextLinkField,TextToolbar,TileButton_default as TileButton,TimeAgo,TimePicker_default as TimePicker,TimeSeriesChart,TimelineTrack,Title,TopNav,TransferProgress,Tree,TreeEmptySlot,TreeGroup,TreeGroupLabel,TreeRow,TreeSeam,TreemapChart,WaterfallChart,WidthsBar,angleScale,appendKey,applyCorners,applyIconSet,applyThemePrefs,arcPath,areaBetween,areaFrom,assignSeriesSlots,autoHighlightIndex,backspace,bandScale,binValues,borderSides,borderStartEach,budgetState,bumpPath,calcOverall,calcReportOverall,colorFill,colorSwatchClasses,columnSharesWidths,cornersFor,curvePath,dashFor,fillFor,fillId,fmtSliderDate,fromKey as fromDateKey,glowId,groundId,groupColors,hexToHsv,highlightOpacity,hsvToHex,isSeverityTone,isShown,isSpacingStep,labelClasses,ladderScale,languageSelectWidth,linearPath,linearScale,logScale,maskId,mediaFileName,monotonePath,niceAxis,niceMax,parseHexColor,polygonPoints,radiusScale,resolveColumnShares,resolveColumnWidths,resolveCorners,resolvePortalBrandAsset,resolveSeriesColor,resolveSeriesColorWithin,resolveTheme,seriesColor,severityOf,sidesStartEach,splinePath,squarify,stagger,stepPath,tabButtonId,tabPanelId,textToolbarRows,textToolbarWindowColumns,toKey as toDateKey,toDayMs,toISODate,toggleSeriesSlot,useAppUpdate,useClickOutside,useContextMenu,useDebouncedValue,useHighlight,usePlotWidth,usePortalBranding,useProductionTimeline,useStatusLabel,useTheme,useTransferProgress}from"../chunk-VA4OTNJP.js";export{Breadcrumbs}from"../chunk-7SNZKUCI.js";export{BrandMark,GlobalSearch,openGlobalSearch,pushRecent as pushRecentSearch,resolveBrandMarkTreatment,sanitizeRecent as sanitizeRecentSearches}from"../chunk-UB2IV2II.js";export{EditableGrid}from"../chunk-S5XQ5DBA.js";import"../chunk-BR22X7E5.js";import"../chunk-NZBX24NL.js";export{ResizeHandle,SidebarLayout}from"../chunk-TXLJEUYC.js";export{ENGLISH,SHELL_LANGUAGE_STORAGE_KEY,ShellLanguageProvider,matchShellLanguage,readSavedShellLanguage,resolveShellLanguage,saveShellLanguage,useShellLanguage}from"../chunk-R42GJPQL.js";export{ICON_NAMES,ICON_SET_FOR_THEME,THEME_ICON_SETS,iconSetFor,isIconName,loadIconSet}from"../chunk-BMKGFJR7.js";export{Banner,Markdown,Markdown as MarkdownLite,StepChain,StepChainItem,Textarea_default as Textarea}from"../chunk-EQZ7DF3J.js";export{IconButton_default as IconButton}from"../chunk-EU4BCXGA.js";export{INPUT_BASE,INPUT_SIZES,PLACEHOLDER_INK,inputClasses}from"../chunk-HJQAE6SP.js";export{isSafeLinkHref}from"../chunk-PJPK2ADX.js";export{UNDOABLE_MS,toast_default as toast}from"../chunk-OUURHOIS.js";export{ALT,ALT_SHIFT_D,ALT_SHIFT_E,ALT_SHIFT_N,CMD_A,CMD_DOT,CMD_ENTER,CMD_K,CMD_S,ENTER,Kbd,MOD,NEXT_CHUNK_PATH_PREFIX,Result,SHIFT,STALE_CHUNK_RELOAD_COOLDOWN_MS,STALE_CHUNK_RELOAD_KEY,ShellPrefsProvider,VITE_PRELOAD_ERROR_EVENT,installStaleChunkReload,isMac,isStaleChunkError,useIsMobile,useLocalStoragePrefs,useShellPrefs}from"../chunk-FNR5SPQM.js";import"../chunk-5A7MWTXX.js";export{PopupMenu,PopupMenuDivider,PopupMenuItem,PopupMenuLabel,PopupSubmenu,leavesContextMenuAlone}from"../chunk-K73JEGD5.js";export{VERSION}from"../chunk-RC27X4SF.js";import"../chunk-KNUR2UEG.js";export{ConfirmProvider,Dialog,confirm,confirmDestructive,prompt,useConfirm,useFocusTrap,useScrollLock}from"../chunk-VOUSFISE.js";import"../chunk-UVBK6YSR.js";export{Button_default as Button}from"../chunk-DELNCIUK.js";export{MENU_MAX_HEIGHT,POPUP_MAX_WIDTH,Tooltip,placeMenu,popupBounds,useDropdownPosition}from"../chunk-RDLWLATO.js";export{GLASS_DIVIDER,glassStyle,solidSurfaceStyle}from"../chunk-7IQ3B77H.js";import"../chunk-D65T4H6J.js";export{OVERLAY_OPEN_EVENT,Z_LAYERS,dismissPopups,registerModalEscapeInterceptor}from"../chunk-FIEA5CGB.js";export{buttonClasses,iconButtonClasses}from"../chunk-K7PQXJO7.js";export{Icon,activeIconSet,iconSets,iconsVersion,registerIconSet,registerIcons,resolveIcon,setDefaultIconSet,setIconSet,subscribeIcons}from"../chunk-YT4B3NSV.js";export{FOCAL_DEFAULT,FOCAL_NUDGE_COARSE,FOCAL_NUDGE_STEP,focalFromRect,formatFocal,nudgeFocal,parseFocal}from"../chunk-AP2QEJXQ.js";export{DATE_FORMAT_OPTIONS,EMPTY_VALUE,TZ_AUTO,currencyDecimals,currencySymbol,firstDayOfWeek,formatBytes,formatDate,formatDateTime,formatMoney,formatTime,getUserDateFormat,getUserTimezone,setCurrencyFormats,setUserDateFormat,setUserTimezone,syncTimezoneFromProfile,timeAgo}from"../chunk-W32SKK3D.js";export{FileIntakeAlert,acceptsFile,useFileIntake}from"../chunk-SGIM64RL.js";export{DEFAULT_SHELL_STRINGS,ShellStringsProvider,useShellLocale,useShellStrings}from"../chunk-HQLDTFAF.js";import"../chunk-C3QOHMR6.js";export{LoadingSpinner,SpinnerRing}from"../chunk-2J6F4EE7.js";
2
+ export{APP_UPDATE_POLL_MS,Accordion,AlignmentGrid,AppUpdateBanner,AttachButton,AttachmentDropZone,AttachmentList,AuthScreen,Avatar,AvatarGroup,BORDER_LINE_STYLES,BORDER_WIDTHS,BorderInput,BoxPlotChart,BrandAssetEditor,BudgetBar,CHART_INK,COLUMN_COUNT_MAX,COLUMN_COUNT_WIDTHS,COLUMN_SHARES_EQUAL,COLUMN_SHARE_MIN,CONTROL_HEIGHTS,CORNERS,CORNERS_FOR_THEME,Calendar,CandlestickChart,Card,CartesianPlot,ChartBrush,ChartDefs,ChartDot,ChartFrame,ChartHighlightProvider,ChartSkeleton,ChartTooltip,ChatTemplate,Checkbox_default as Checkbox,CheckoutTemplate,ChordChart,ColorPicker,ColorPickerPanel,ColorSwatch,ColumnChart,ComposerAttachments,ContainerFillChart,ContextMenu,CornersInput,CountBadge,DAY_MS,DashboardTemplate,DataTable,DataTablePage,DatePicker_default as DatePicker,DateRangePicker,DateTimePicker_default as DateTimePicker,DescriptionList,DisplayChips,Divider,Drawer,DropdownMenu,ELEVATION_LEVELS,EmailTemplate,EmptyState,EmptyValue,ErrorBoundary,ErrorPage,FONT_WEIGHTS,FilePicker_default as FilePicker,FloatingBar,FormErrorSummary,FormField,FormLayoutPage,FunnelChart,GalleryTemplate,Grid,HeatmapChart,HelpCenter,HexInput,HistogramChart,IconPicker,IconRail,IconRailButton,ImageFocusPoint,Inline,Input_default as Input,InputNumber_default as InputNumber,Kanban,Label,LanguagePanel,LanguageSelect,LinkPicker,ListFooter,ListLoadError,ListRow,MAX_FRACTION_DIGITS,MOTION,MOTION_DURATIONS,MediaUploadField,MediaUploadGrid,Meter,MetricBar,MilestoneTimeline,NativeSelect,NumericKeypad,POST_PRODUCTION_STATUSES,PageHeader,Pagination,PaperclipGlyph,Paragraph,PictureTiles,PieChart,Popover,PortalBrandingProvider,ProductionTimeline,RADAR_SERIES_CAP,RADIUS_ROLES,ROW_HEIGHTS,RadarChart,RadialBarChart,Radio_default as Radio,RadioGroup,RangeChart,RankedBars,SCATTER_SERIES_CAP,SERIES_SLOT_COUNT,SERIES_VARS,SPACING_ROLES,SPACING_SCALE,STAGES,STATUS_VARS,SankeyChart,ScatterChart,SearchableSelect,Segmented,Select_default as Select,SettingRow,ShowWhen,SidebarActionButton,SidebarGroupLabel,SidebarNavGroup,SidebarNavItem,SidesEachToggle,SidesInput,Skeleton,Slider,SliderGroup,Snippet,SortableList,Sparkline,SplitButton_default as SplitButton,Stack,StatCard,StatTile,Statistic,Stepper,SunburstChart,Switch_default as Switch,TYPE_SCALE,Tabs,TagInput,Text,TextLinkField,TextToolbar,TileButton_default as TileButton,TimeAgo,TimePicker_default as TimePicker,TimeSeriesChart,TimelineTrack,Title,TopNav,TransferProgress,Tree,TreeEmptySlot,TreeGroup,TreeGroupLabel,TreeRow,TreeSeam,TreemapChart,WaterfallChart,WidthsBar,angleScale,appendKey,applyCorners,applyIconSet,applyThemePrefs,arcPath,areaBetween,areaFrom,assignSeriesSlots,autoHighlightIndex,backspace,bandScale,binValues,borderSides,borderStartEach,budgetState,bumpPath,calcOverall,calcReportOverall,colorFill,colorSwatchClasses,columnSharesWidths,cornersFor,curvePath,dashFor,fillFor,fillId,fmtSliderDate,fromKey as fromDateKey,glowId,groundId,hexToHsv,highlightOpacity,hsvToHex,isSeverityTone,isShown,isSpacingStep,labelClasses,ladderScale,languageSelectWidth,linearPath,linearScale,logScale,maskId,mediaFileName,monotonePath,niceAxis,niceMax,parseHexColor,polygonPoints,radiusScale,resolveColumnShares,resolveColumnWidths,resolveCorners,resolvePortalBrandAsset,resolveSeriesColor,resolveSeriesColorWithin,resolveTheme,seriesColor,severityOf,sidesStartEach,splinePath,squarify,stagger,stepPath,tabButtonId,tabPanelId,textToolbarRows,textToolbarWindowColumns,toKey as toDateKey,toDayMs,toISODate,toggleSeriesSlot,useAppUpdate,useClickOutside,useContextMenu,useDebouncedValue,useHighlight,usePlotWidth,usePortalBranding,useProductionTimeline,useTheme,useTransferProgress}from"../chunk-MRQLTNG6.js";export{Breadcrumbs}from"../chunk-DRQF3Z2O.js";export{BrandMark,GlobalSearch,openGlobalSearch,pushRecent as pushRecentSearch,resolveBrandMarkTreatment,sanitizeRecent as sanitizeRecentSearches}from"../chunk-7ZYZDQ5V.js";export{EditableGrid}from"../chunk-KNOKDBRY.js";import"../chunk-BR22X7E5.js";export{ResizeHandle,SidebarLayout}from"../chunk-6ST5FSQF.js";export{ENGLISH,SHELL_LANGUAGE_STORAGE_KEY,ShellLanguageProvider,matchShellLanguage,readSavedShellLanguage,resolveShellLanguage,saveShellLanguage,useShellLanguage}from"../chunk-NKOABAWD.js";export{ICON_NAMES,ICON_SET_FOR_THEME,THEME_ICON_SETS,iconSetFor,isIconName,loadIconSet}from"../chunk-63RTIL66.js";export{Banner,Markdown,Markdown as MarkdownLite,StepChain,StepChainItem,Textarea_default as Textarea}from"../chunk-56DUNIS6.js";export{IconButton_default as IconButton}from"../chunk-EU4BCXGA.js";export{INPUT_BASE,INPUT_SIZES,PLACEHOLDER_INK,inputClasses}from"../chunk-HJQAE6SP.js";export{isSafeLinkHref}from"../chunk-PJPK2ADX.js";export{UNDOABLE_MS,toast_default as toast}from"../chunk-YIIFH7CK.js";export{ALT,ALT_SHIFT_D,ALT_SHIFT_E,ALT_SHIFT_N,CMD_A,CMD_DOT,CMD_ENTER,CMD_K,CMD_S,ColoredBadge,ENTER,GROUP_COLORS,GROUP_COLORS_SOLID,Kbd,MOD,NEXT_CHUNK_PATH_PREFIX,Result,SHIFT,STALE_CHUNK_RELOAD_COOLDOWN_MS,STALE_CHUNK_RELOAD_KEY,ShellPrefsProvider,StatusBadge,StatusBadgeProvider,VITE_PRELOAD_ERROR_EVENT,groupColors,installStaleChunkReload,isMac,isStaleChunkError,useIsMobile,useLocalStoragePrefs,useShellPrefs,useStatusLabel}from"../chunk-2H3XIWVB.js";import"../chunk-5A7MWTXX.js";export{PopupMenu,PopupMenuDivider,PopupMenuItem,PopupMenuLabel,PopupSubmenu,leavesContextMenuAlone}from"../chunk-4AHFABYE.js";export{VERSION}from"../chunk-T6D5LTQR.js";import"../chunk-KNUR2UEG.js";export{ConfirmProvider,Dialog,confirm,confirmDestructive,prompt,useConfirm,useFocusTrap,useScrollLock}from"../chunk-J5USRYOM.js";import"../chunk-UVBK6YSR.js";export{Button_default as Button}from"../chunk-DELNCIUK.js";export{MENU_MAX_HEIGHT,POPUP_MAX_WIDTH,Tooltip,placeMenu,popupBounds,useDropdownPosition}from"../chunk-RDLWLATO.js";export{GLASS_DIVIDER,glassStyle,solidSurfaceStyle}from"../chunk-7IQ3B77H.js";import"../chunk-D65T4H6J.js";export{OVERLAY_OPEN_EVENT,Z_LAYERS,dismissPopups,registerModalEscapeInterceptor}from"../chunk-FIEA5CGB.js";export{buttonClasses,iconButtonClasses}from"../chunk-K7PQXJO7.js";export{LoadingSpinner,SpinnerRing}from"../chunk-2J6F4EE7.js";export{Icon,activeIconSet,iconSets,iconsVersion,registerIconSet,registerIcons,resolveIcon,setDefaultIconSet,setIconSet,subscribeIcons}from"../chunk-TAUIAKU3.js";export{FOCAL_DEFAULT,FOCAL_NUDGE_COARSE,FOCAL_NUDGE_STEP,focalFromRect,formatFocal,nudgeFocal,parseFocal}from"../chunk-AP2QEJXQ.js";export{DATE_FORMAT_OPTIONS,EMPTY_VALUE,TZ_AUTO,currencyDecimals,currencySymbol,firstDayOfWeek,formatBytes,formatDate,formatDateTime,formatMoney,formatTime,getUserDateFormat,getUserTimezone,setCurrencyFormats,setUserDateFormat,setUserTimezone,syncTimezoneFromProfile,timeAgo}from"../chunk-W32SKK3D.js";export{FileIntakeAlert,acceptsFile,useFileIntake}from"../chunk-54LUMK66.js";export{DEFAULT_SHELL_STRINGS,ShellStringsProvider,useShellLocale,useShellStrings}from"../chunk-BLMDTJOK.js";import"../chunk-C3QOHMR6.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-shell",
3
- "version": "7.54.0",
3
+ "version": "7.56.0",
4
4
  "description": "Desktop-style React UI shell — windows, taskbar, start menu, sticky notes, frosted glass theming, and bundled apps.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Efficient Pty Ltd",
@@ -1 +0,0 @@
1
- export{ConfirmProvider,confirm,confirmDestructive,prompt,useConfirm}from"./chunk-VOUSFISE.js";import"./chunk-UVBK6YSR.js";import"./chunk-FIEA5CGB.js";import"./chunk-K7PQXJO7.js";import"./chunk-YT4B3NSV.js";import"./chunk-HQLDTFAF.js";import"./chunk-C3QOHMR6.js";
@@ -1,87 +0,0 @@
1
- import{openPreviewFile as e}from"./chunk-LBZF6GCK.js";import{Breadcrumbs as t}from"./chunk-7SNZKUCI.js";import{TH_ONE_LINE as a}from"./chunk-NZBX24NL.js";import{SidebarLayout as r}from"./chunk-TXLJEUYC.js";import{getFilesDemoTree as n}from"./chunk-3ZZ2UPNR.js";import{AboutApp as s}from"./chunk-HXU6LDQB.js";import{peekFilesViewRequest as i,consumeFilesViewRequest as l,FILES_SHOW_TRASH_EVENT as o,FILES_OPEN_DESKTOP_FOLDER_EVENT as d,subscribeDesktopFolders as c,getDesktopFoldersSnapshot as m,FolderGlyph as h,DesktopItemMiniIcon as p,desktopItemTypeLabel as u}from"./chunk-4FQTMGCA.js";import"./chunk-ESL5TDNA.js";import"./chunk-VTVSMRFX.js";import{useWindowManager as f,WindowTitle as x}from"./chunk-2ZRV46PX.js";import"./chunk-DSSLOQDW.js";import"./chunk-YDDG7MXB.js";import{toast_default as g}from"./chunk-OUURHOIS.js";import"./chunk-FNR5SPQM.js";import"./chunk-5A7MWTXX.js";import"./chunk-K73JEGD5.js";import"./chunk-RC27X4SF.js";import"./chunk-KNUR2UEG.js";import{confirm as y,prompt as b}from"./chunk-VOUSFISE.js";import"./chunk-UVBK6YSR.js";import"./chunk-DELNCIUK.js";import"./chunk-RDLWLATO.js";import"./chunk-7IQ3B77H.js";import"./chunk-D65T4H6J.js";import"./chunk-FIEA5CGB.js";import"./chunk-K7PQXJO7.js";import{Icon as k}from"./chunk-YT4B3NSV.js";import{formatBytes as N}from"./chunk-W32SKK3D.js";import"./chunk-HQLDTFAF.js";import"./chunk-C3QOHMR6.js";import{LoadingSpinner as w}from"./chunk-2J6F4EE7.js";import{useState as v,useEffect as $,useSyncExternalStore as j,useRef as C,useCallback as D}from"react";import{jsxs as L,jsx as E,Fragment as T}from"react/jsx-runtime";var R="undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000",S={pdf:"pdf",dxf:"dxf",csv:"csv",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",avif:"image",bmp:"image",stp:"3d",step:"3d",stl:"3d",obj:"3d",gltf:"3d",glb:"3d","3mf":"3d",iges:"3d",igs:"3d",ply:"3d",fbx:"3d"};function F(e,t){return"/"===e||""===e?"/"+t:e.replace(/\/$/,"")+"/"+t}function U(e){if(!e)return"—";try{const t=new Date(e);return isNaN(t.getTime())?"—":t.toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})}catch{return e}}function I(){const I=R.replace(/\/$/,""),P=null!==n(),[O,W]=v("/"),[A,M]=v([]),[B,K]=v([]),[V,z]=v(null),[H,X]=v(!0),[Q,J]=v(!1),[_,G]=v(null),[Z,Y]=v(!1),[q,ee]=v(()=>{const e=i();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"});$(()=>{l()},[]);const[te,ae]=v([]);$(()=>{const e=()=>{l(),ee("trash")},t=e=>{l();const t=e.detail?.folderId;t&&ee({desktopFolderId:t})};return window.addEventListener(o,e),window.addEventListener(d,t),()=>{window.removeEventListener(o,e),window.removeEventListener(d,t)}},[]);const re=j(c,m,m),ne="object"==typeof q?q.desktopFolderId:null,se=ne?re?.folders.find(e=>e.id===ne)??null:null,ie=ne&&re?.itemsByFolder[ne]||[];$(()=>{ne&&re&&!re.folders.some(e=>e.id===ne)&&ee("files")},[ne,re]);const le=C(0),oe=C(null),{openPage:de,openEntity:ce}=f(),me=t=>{"preview-file"===t.entityType&&t.filePath&&t.fileKind?e({filePath:t.filePath,filename:t.label,kind:t.fileKind,onStaged:e=>de(e)}):"page"===t.entityType?de(t.entityId):ce(t.entityType,t.entityId,null,t.label)},he=D((e,t={})=>fetch(e,{...t,credentials:"include"}),[]),pe=D(async()=>{try{const e=await he(`${I}/api/quota`);if(e.ok){const t=await e.json();G({used:t.used,limit:t.limit})}}catch{}},[he,I]),ue=D(async e=>{if(z(null),P){const t=function(e){const t=n();if(!t)return[];let a=t;for(const t of e.split("/").filter(Boolean)){const e=a.find(e=>"folder"===e.kind&&e.name===t);if(!e||!e.children)return[];a=e.children}return a.map(e=>({name:e.name,kind:e.kind,size:e.size??0,modifiedAt:e.modifiedAt??""}))}(e);return M(t),W(e),J(!1),X(!1),void("/"===e&&K(t.filter(e=>"folder"===e.kind).map(e=>e.name)))}X(!0);try{const t=await he(`${I}/api/files?path=${encodeURIComponent(e)}`);if(!t.ok){const e=await t.json().catch(()=>({}));return void g.error(e.error||`Failed to list (${t.status})`)}const a=await t.json(),r=a.entries||[];M(r),W(a.path||e),J(!1),"/"===(a.path||e)&&K(r.filter(e=>"folder"===e.kind).map(e=>e.name))}catch(e){J(!0)}finally{X(!1)}pe()},[he,I,pe,P]),fe=D(async()=>{if(P)return ae([]),void X(!1);X(!0),z(null);try{const e=await he(`${I}/api/trash`);if(!e.ok){const t=await e.json().catch(()=>({}));return void g.error(t.error||`Failed to list trash (${e.status})`)}const t=await e.json();ae(t.entries||[]),J(!1)}catch{J(!0)}finally{X(!1)}pe()},[he,I,pe,P]);$(()=>{"files"===q?ue(O):"trash"===q&&fe()},[O,q]);const xe=async e=>{const t=F(O,e.name);try{const a=await he(`${I}/api/file?path=${encodeURIComponent(t)}`);if(!a.ok)return void g.error(`Download failed (${a.status})`);const r=await a.blob(),n=URL.createObjectURL(r),s=document.createElement("a");s.href=n,s.download=e.name,s.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}catch(e){g.error(e?.message||"Download failed")}},ge=async e=>{const t=Array.from(e);for(const e of t){const t=new FormData;t.append("file",e);try{const a=await he(`${I}/api/upload?path=${encodeURIComponent(O)}`,{method:"POST",body:t});if(!a.ok){const t=await a.json().catch(()=>({}));if(413===a.status){const a=Math.max(0,(t.limit||0)-(t.used||0));g.error(`Quota exceeded — ${N(a)} free, ${e.name} is ${N(t.attempted||e.size)}`)}else g.error(`Upload ${e.name}: ${t.error||a.status}`)}}catch(t){g.error(`Upload ${e.name}: ${t?.message||"failed"}`)}}ue(O)},ye=()=>{le.current=0,Y(!1)};if($(()=>{const e=()=>ye();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]),Q)/* @__PURE__ */
2
- return L("div",{className:"flex flex-col h-full bg-white",children:[
3
- /* @__PURE__ */E(x,{title:"Files - offline"}),
4
- /* @__PURE__ */E("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */L("div",{className:"max-w-md",children:[
5
- /* @__PURE__ */E(k,{name:"close-circle",className:"h-12 w-12 mx-auto text-gray-300 mb-3",strokeWidth:1.4}),
6
- /* @__PURE__ */E("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:"Can't reach the file server"}),
7
- /* @__PURE__ */L("p",{className:"text-sm text-gray-500 mb-3",children:["No response from ",
8
- /* @__PURE__ */E("span",{className:"font-mono",children:I}),". Make sure the server is running — see ",
9
- /* @__PURE__ */E("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]}),
10
- /* @__PURE__ */E("button",{onClick:()=>ue(O),className:"px-3 h-8 text-sm bg-blue-500 text-white rounded hover:bg-blue-600",children:"Retry"})]})})]});const be="/"===O?[]:O.split("/").filter(Boolean),ke=_&&_.limit>0?Math.min(100,Math.round(_.used/_.limit*100)):0,Ne=ke>90?"bg-red-500":ke>75?"bg-amber-500":"bg-blue-500",we=[{label:"My files",onClick:()=>W("/")},...be.map((e,t)=>({label:e,onClick:()=>W("/"+be.slice(0,t+1).join("/"))}))],ve=e=>"flex w-full items-center gap-2 rounded-md px-3 min-h-(--row-height-menu) py-2 text-left text-sm transition-colors "+(e?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),$e=e=>/* @__PURE__ */E("svg",{className:"h-4 w-4 shrink-0 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.6,children:/* @__PURE__ */E("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),je=/* @__PURE__ */L("nav",{className:"p-2",children:[
11
- /* @__PURE__ */E("div",{className:"px-2 py-2 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:"Locations"}),
12
- /* @__PURE__ */L("button",{onClick:()=>{ee("files"),W("/")},className:ve("files"===q&&"/"===O),children:[$e("M2.25 12l8.954-8.955a1.5 1.5 0 012.122 0L21.75 12M4.5 9.75v9.75a.75.75 0 00.75.75H9V15a.75.75 0 01.75-.75h4.5A.75.75 0 0115 15v5.25h3.75a.75.75 0 00.75-.75V9.75"),"My files"]}),B.map(e=>/* @__PURE__ */L("button",{onClick:()=>{ee("files"),W("/"+e)},className:ve("files"===q&&O==="/"+e),children:[$e("M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"),
13
- /* @__PURE__ */E("span",{className:"truncate",children:e})]},e)),!P&&/* @__PURE__ */L("button",{onClick:()=>ee("trash"),className:ve("trash"===q),children:[$e("M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79"),"Trash"]}),re&&re.folders.length>0&&/* @__PURE__ */L(T,{children:[
14
- /* @__PURE__ */E("div",{className:"px-2 pt-3 pb-2 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:"Desktop"}),re.folders.map(e=>/* @__PURE__ */L("button",{onClick:()=>ee({desktopFolderId:e.id}),className:ve(ne===e.id),children:[
15
- /* @__PURE__ */E(h,{className:"h-4 w-4 shrink-0 text-amber-500"}),
16
- /* @__PURE__ */E("span",{className:"truncate",children:e.name}),e.itemCount>0&&/* @__PURE__ */E("span",{className:"ml-auto text-2xs text-gray-400 tabular-nums",children:e.itemCount})]},e.id))]})]});/* @__PURE__ */
17
- return L("div",{className:"relative flex flex-col h-full bg-white",onDragEnter:e=>{P||"object"==typeof q||e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),le.current++,Z||Y(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&e.preventDefault()},onDragLeave:()=>{le.current>0&&le.current--,0===le.current&&Y(!1)},onDrop:e=>{e.preventDefault(),ye(),P||"object"==typeof q||e.dataTransfer.files?.length&&ge(e.dataTransfer.files)},children:[
18
- /* @__PURE__ */E(x,{title:se?`Files - ${se.name}`:"Files"+("/"===O?"":" - "+O)}),
19
- /* @__PURE__ */E(s,{app:"files"}),
20
- /* @__PURE__ */E("input",{ref:oe,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&ge(e.target.files),oe.current&&(oe.current.value="")}}),
21
- /* @__PURE__ */E("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */E(r,{sidebar:je,storageKey:"files.sidebarWidth",defaultWidth:200,minWidth:150,maxWidth:320,children:/* @__PURE__ */L("div",{className:"flex h-full min-w-0 flex-col",children:[
22
- /* @__PURE__ */L("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-gray-200 bg-gray-50 shrink-0 text-xs",children:[/* @__PURE__ */L(T,"files"===q?{children:[
23
- /* @__PURE__ */E("button",{onClick:()=>W(function(e){if("/"===e||""===e)return"/";const t=e.replace(/\/$/,""),a=t.lastIndexOf("/");return a<=0?"/":t.slice(0,a)}(O)),disabled:"/"===O,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",title:"Parent folder",children:/* @__PURE__ */E(k,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
24
- /* @__PURE__ */E("div",{className:"flex-1 min-w-0",children:/* @__PURE__ */E(t,{items:we,maxItems:5})}),
25
- /* @__PURE__ */E("button",{onClick:()=>ue(O),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */E(k,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),!P&&/* @__PURE__ */L(T,{children:[
26
- /* @__PURE__ */L("button",{onClick:()=>ee("trash"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",title:"Open trash",children:[
27
- /* @__PURE__ */E(k,{name:"trash",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Trash"]}),
28
- /* @__PURE__ */L("button",{onClick:async()=>{const e=await b({title:"New folder",placeholder:"Folder name",confirmLabel:"Create"});if(!e)return;if(/[\\/]/.test(e))return void g.error("Folder names cannot contain slashes");const t=F(O,e),a=await he(`${I}/api/folder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})});if(!a.ok){const e=await a.json().catch(()=>({}));return void g.error(e.error||`Create folder failed (${a.status})`)}ue(O)},className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",children:[
29
- /* @__PURE__ */E(k,{name:"folder-plus",className:"h-3.5 w-3.5",strokeWidth:1.5}),"New Folder"]}),
30
- /* @__PURE__ */L("button",{onClick:()=>oe.current?.click(),className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 flex items-center gap-1",children:[
31
- /* @__PURE__ */E(k,{name:"upload",className:"h-3.5 w-3.5",strokeWidth:1.8}),"Upload"]})]})]}:"trash"===q?{children:[
32
- /* @__PURE__ */E("button",{onClick:()=>ee("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */E(k,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
33
- /* @__PURE__ */E("span",{className:"flex-1 text-gray-700 font-medium px-2",children:"Trash"}),
34
- /* @__PURE__ */E("button",{onClick:fe,className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */E(k,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),
35
- /* @__PURE__ */E("button",{onClick:async()=>{if(0===te.length)return;if(!await y({title:"Empty trash",message:`${te.length} item${1===te.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"}))return;const e=await he(`${I}/api/trash`,{method:"DELETE"});if(!e.ok){const t=await e.json().catch(()=>({}));return void g.error(t.error||`Empty trash failed (${e.status})`)}fe()},disabled:0===te.length,className:"px-2 py-1 rounded text-red-600 hover:bg-red-50 disabled:opacity-30 flex items-center gap-1",children:"Empty trash"})]}:{children:[
36
- /* @__PURE__ */E("button",{onClick:()=>ee("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */E(k,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
37
- /* @__PURE__ */E(h,{className:"h-4 w-4 text-amber-500 ml-1"}),
38
- /* @__PURE__ */E("span",{className:"flex-1 text-gray-700 font-medium px-1 truncate",children:se?.name??"Desktop folder"}),
39
- /* @__PURE__ */E("span",{className:"text-2xs text-gray-400 px-2",children:"Desktop shortcuts"})]}),_&&/* @__PURE__ */L(T,{children:[
40
- /* @__PURE__ */E("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
41
- /* @__PURE__ */L("div",{className:"flex items-center gap-2",title:`${N(_.used)} of ${N(_.limit)} used`,children:[
42
- /* @__PURE__ */E("div",{className:"w-20 h-1.5 rounded-full bg-gray-200 overflow-hidden",children:/* @__PURE__ */E("div",{className:`h-full ${Ne} transition-all`,style:{width:`${ke}%`}})}),
43
- /* @__PURE__ */L("span",{className:"text-2xs text-gray-500 tabular-nums whitespace-nowrap",children:[N(_.used)," / ",N(_.limit)]})]})]})]}),
44
- /* @__PURE__ */E("div",{className:"flex-1 overflow-auto",children:"object"==typeof q?0===ie.length?/* @__PURE__ */E("div",{className:"p-10 text-center text-sm text-gray-400",children:"This desktop folder is empty. Drag shortcuts onto it on the desktop."}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
45
- /* @__PURE__ */E("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */L("tr",{children:[
46
- /* @__PURE__ */E("th",{className:`${a} text-left font-medium px-3 h-8`,children:"Name"}),
47
- /* @__PURE__ */E("th",{className:`${a} text-left font-medium px-3 h-8 w-28`,children:"Type"}),
48
- /* @__PURE__ */E("th",{className:`${a} w-56`})]})}),
49
- /* @__PURE__ */E("tbody",{children:ie.map(e=>{const t=`${e.entityType}|${e.entityId}`;/* @__PURE__ */
50
- return L("tr",{onClick:()=>z(t),onDoubleClick:()=>me(e),className:"cursor-default border-b border-gray-100 "+(V===t?"bg-blue-50":"hover:bg-gray-50"),children:[
51
- /* @__PURE__ */L("td",{className:"px-3 h-8 flex items-center gap-2",children:[
52
- /* @__PURE__ */E(p,{item:e}),
53
- /* @__PURE__ */E("span",{className:"truncate",title:e.label,children:e.label})]}),
54
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-xs text-gray-500",children:u(e)}),
55
- /* @__PURE__ */L("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
56
- /* @__PURE__ */E("button",{onClick:t=>{t.stopPropagation(),me(e)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Open"}),
57
- /* @__PURE__ */E("button",{onClick:t=>{t.stopPropagation(),re?.moveToDesktop([e])},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs ml-1",children:"Move to desktop"}),
58
- /* @__PURE__ */E("button",{onClick:t=>{t.stopPropagation(),re?.removeShortcuts([e])},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Remove"})]})]},t)})})]}):"trash"===q?H&&0===te.length?/* @__PURE__ */E(w,{size:"sm",padding:"p-6",label:"Loading"}):0===te.length?/* @__PURE__ */E("div",{className:"p-10 text-center text-sm text-gray-400",children:"Trash is empty."}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
59
- /* @__PURE__ */E("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */L("tr",{children:[
60
- /* @__PURE__ */E("th",{className:`${a} text-left font-medium px-3 h-8`,children:"Name"}),
61
- /* @__PURE__ */E("th",{className:`${a} text-left font-medium px-3 h-8`,children:"Original location"}),
62
- /* @__PURE__ */E("th",{className:`${a} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
63
- /* @__PURE__ */E("th",{className:`${a} text-right font-medium px-3 h-8 w-40`,children:"Deleted"}),
64
- /* @__PURE__ */E("th",{className:`${a} w-44`})]})}),
65
- /* @__PURE__ */E("tbody",{children:te.map(e=>/* @__PURE__ */L("tr",{className:"border-b border-gray-100 hover:bg-gray-50",children:[
66
- /* @__PURE__ */L("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===e.kind?/* @__PURE__ */E(k,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */E(k,{name:"page",className:"h-4 w-4 text-gray-400 shrink-0",strokeWidth:1.5}),
67
- /* @__PURE__ */E("span",{className:"truncate",title:e.name,children:e.name})]}),
68
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-gray-500 text-xs font-mono truncate",title:e.originalPath,children:e.originalPath||"—"}),
69
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-right tabular-nums text-gray-500",children:N(e.size)}),
70
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-right text-gray-500 tabular-nums",children:e.deletedAt?U(e.deletedAt):"—"}),
71
- /* @__PURE__ */L("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
72
- /* @__PURE__ */E("button",{onClick:()=>(async e=>{const t=await he(`${I}/api/trash/restore`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id})});if(!t.ok){const e=await t.json().catch(()=>({}));return void g.error(e.error||`Restore failed (${t.status})`)}g.success(`Restored "${e.name}"`),fe()})(e),className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Restore"}),
73
- /* @__PURE__ */E("button",{onClick:()=>(async e=>{if(!await y({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"}))return;const t=await he(`${I}/api/trash/${encodeURIComponent(e.id)}`,{method:"DELETE"});if(!t.ok){const e=await t.json().catch(()=>({}));return void g.error(e.error||`Delete failed (${t.status})`)}fe()})(e),className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete forever"})]})]},e.id))})]}):H&&0===A.length?/* @__PURE__ */E(w,{size:"sm",padding:"p-6",label:"Loading"}):0===A.length?/* @__PURE__ */L("div",{className:"p-10 text-center text-sm text-gray-400",children:["Empty folder.",!P&&/* @__PURE__ */L(T,{children:[" Drop files here or click ",
74
- /* @__PURE__ */E("span",{className:"font-medium",children:"Upload"}),"."]})]}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
75
- /* @__PURE__ */E("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */L("tr",{children:[
76
- /* @__PURE__ */E("th",{className:`${a} text-left font-medium px-3 h-8`,children:"Name"}),
77
- /* @__PURE__ */E("th",{className:`${a} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
78
- /* @__PURE__ */E("th",{className:`${a} text-right font-medium px-3 h-8 w-40`,children:"Modified"}),
79
- /* @__PURE__ */E("th",{className:`${a} w-32`})]})}),
80
- /* @__PURE__ */E("tbody",{children:A.map(t=>/* @__PURE__ */L("tr",{onClick:()=>z(t.name),onDoubleClick:()=>{"folder"===t.kind?W(F(O,t.name)):(async t=>{if(P)return;const a=F(O,t.name),r=(t.name.split(".").pop()||"").toLowerCase(),n=S[r];n?await e({filePath:a,filename:t.name,kind:n,onStaged:e=>de(e)}):xe(t)})(t)},className:"cursor-default border-b border-gray-100 "+(V===t.name?"bg-blue-50":"hover:bg-gray-50"),children:[
81
- /* @__PURE__ */L("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===t.kind?/* @__PURE__ */E(k,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */E(k,{name:"page",className:"h-4 w-4 text-gray-400 shrink-0",strokeWidth:1.5}),
82
- /* @__PURE__ */E("span",{className:"truncate",title:t.name,children:t.name})]}),
83
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-right tabular-nums text-gray-500",children:"folder"===t.kind?"—":N(t.size)}),
84
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-right text-gray-500 tabular-nums",children:U(t.modifiedAt)}),
85
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:!P&&/* @__PURE__ */L(T,{children:["file"===t.kind&&/* @__PURE__ */E("button",{onClick:e=>{e.stopPropagation(),xe(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs",children:"Download"}),
86
- /* @__PURE__ */E("button",{onClick:e=>{e.stopPropagation(),(async e=>{const t=await b({title:`Rename ${e.kind}`,defaultValue:e.name,confirmLabel:"Rename"});if(!t||t===e.name)return;if(/[\\/]/.test(t))return void g.error("Names cannot contain slashes");const a=F(O,e.name),r=F(O,t),n=await he(`${I}/api/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:a,to:r})});if(!n.ok){const e=await n.json().catch(()=>({}));return void g.error(e.error||`Rename failed (${n.status})`)}ue(O)})(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs ml-1",children:"Rename"}),
87
- /* @__PURE__ */E("button",{onClick:e=>{e.stopPropagation(),(async e=>{if(!await y({title:`Delete ${e.kind}`,message:`"${e.name}"${"folder"===e.kind?" and everything inside":""} will be permanently removed.`,confirmLabel:"Delete",variant:"danger"}))return;const t=F(O,e.name),a=await he(`${I}/api/files?path=${encodeURIComponent(t)}`,{method:"DELETE"});if(!a.ok){const e=await a.json().catch(()=>({}));return void g.error(e.error||`Delete failed (${a.status})`)}ue(O)})(t)},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete"})]})})]},t.name))})]})})]})})}),Z&&/* @__PURE__ */E("div",{className:"absolute inset-0 bg-blue-500/15 border-4 border-dashed border-blue-500 pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */E("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop to upload"})})]})}export{I as default};
@@ -1 +0,0 @@
1
- export{PdfViewer as default,fitScale,pdfWasmParams}from"./chunk-SFO2M76G.js";import"./chunk-OUURHOIS.js";import"./chunk-K7PQXJO7.js";import"./chunk-YT4B3NSV.js";import"./chunk-HQLDTFAF.js";import"./chunk-C3QOHMR6.js";import"./chunk-2J6F4EE7.js";
@@ -1,37 +0,0 @@
1
- import{EditableGrid as e}from"./chunk-S5XQ5DBA.js";import"./chunk-BR22X7E5.js";import"./chunk-NZBX24NL.js";import{AboutApp as t}from"./chunk-HXU6LDQB.js";import{peekSpreadsheetPreviewStage as r,claimSpreadsheetPreviewStage as n,SPREADSHEET_PREVIEW_UPDATE_EVENT as o}from"./chunk-VTVSMRFX.js";import{WindowTitle as a}from"./chunk-2ZRV46PX.js";import"./chunk-DSSLOQDW.js";import"./chunk-YDDG7MXB.js";import"./chunk-FNR5SPQM.js";import"./chunk-5A7MWTXX.js";import"./chunk-K73JEGD5.js";import"./chunk-RC27X4SF.js";import"./chunk-KNUR2UEG.js";import"./chunk-VOUSFISE.js";import"./chunk-UVBK6YSR.js";import"./chunk-DELNCIUK.js";import"./chunk-RDLWLATO.js";import"./chunk-7IQ3B77H.js";import"./chunk-D65T4H6J.js";import"./chunk-FIEA5CGB.js";import"./chunk-K7PQXJO7.js";import"./chunk-YT4B3NSV.js";import"./chunk-HQLDTFAF.js";import"./chunk-C3QOHMR6.js";import"./chunk-2J6F4EE7.js";import{useRef as l,useState as s,useEffect as c,useCallback as i}from"react";import{jsxs as u,jsx as d,Fragment as h}from"react/jsx-runtime";var m="ABCDEFGHIJKLMNOPQRSTUVWXYZ",p=10,x=30;function g(e){return e<26?m[e]:m[Math.floor(e/26)-1]+m[e%26]}function y(e){return Array.from({length:e},(e,t)=>({key:`col_${t}`,title:g(t),width:100}))}function b(e,t){return Array.from({length:e},()=>Array(t).fill(""))}function f(e){return{id:crypto.randomUUID(),name:e,columns:y(p),data:b(x,p),cellStyles:{}}}function v(e){return e.split("\n").map(e=>{if(e.includes("\t"))return e.split("\t").map(e=>e.trim());const t=[];let r="",n=!1;for(const o of e)'"'!==o?","!==o||n?r+=o:(t.push(r.trim()),r=""):n=!n;return t.push(r.trim()),t}).filter(e=>e.some(e=>e.trim()))}function k(e,t){const r=v(e);if(0===r.length)return null;const n=Math.max(p,r.reduce((e,t)=>Math.max(e,t.length),0)),o=r.map(e=>{for(;e.length<n;)e.push("");return e});for(;o.length<x;)o.push(Array(n).fill(""));return{id:crypto.randomUUID(),name:t,columns:y(n),data:o,cellStyles:{}}}function w(){const m=l(null),g=l(void 0);void 0===g.current&&(g.current=r());const w=l(g.current?.data??null),N=(()=>{const e=g.current;if(!e)return null;const t=k(e.data.csv,"Sheet 1");if(!t)return null;return{sheet:t,title:e.data.filename.replace(/\.(csv|tsv|txt)$/i,"")}})(),[C,S]=s(N?[N.sheet]:[f("Sheet 1")]),[j,E]=s(0),D=l([]),U=l(C),M=l(!1);c(()=>{M.current?M.current=!1:U.current!==C&&(D.current.push(U.current),D.current.length>50&&D.current.shift()),U.current=C},[C]);const $=i(()=>{const e=D.current.pop();e&&(M.current=!0,S(e))},[]);c(()=>{const e=e=>{if(!m.current?.contains(document.activeElement)&&!m.current?.matches(":focus-within"))return;(e.ctrlKey||e.metaKey)&&!e.shiftKey&&("z"===e.key||"Z"===e.key)&&(e.preventDefault(),$())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[$]);const[L,A]=s(N?.title??"Untitled"),[R,B]=s(()=>g.current?.data.onEmail),F=i(e=>{const t=k(e.csv,"Sheet 1");t&&(S([t]),E(0),A(e.filename.replace(/\.(csv|tsv|txt)$/i,"")),B(()=>e.onEmail))},[]);c(()=>{const e=g.current;null!=e&&(n(e),e.data!==w.current&&F(e.data))},[]),c(()=>{const e=g.current?.token;if(null==e)return;const t=t=>{const r=t.detail;r&&r.token===e&&F(r.data)};return window.addEventListener(o,t),()=>window.removeEventListener(o,t)},[]);const[X,I]=s(!1),[K,O]=s(null),[Q,V]=s(""),H=l(null),[T,G]=s("1"),[J,P]=s("10"),z=C[j]||C[0],W=z.data,Y=z.columns,Z=z.cellStyles??{},[_,q]=s(null),[ee,te]=s(null),re=i(()=>{if(ee){const e=Math.min(ee.anchor.row,ee.end.row),t=Math.max(ee.anchor.row,ee.end.row),r=Math.min(ee.anchor.col,ee.end.col),n=Math.max(ee.anchor.col,ee.end.col),o=[];for(let a=e;a<=t;a++)for(let e=r;e<=n;e++)o.push({row:a,col:e});return o}return _?[_]:[]},[ee,_]),ne=i((e,t)=>{const r=re();0!==r.length&&S(n=>n.map((n,o)=>{if(o!==j)return n;const a={...n.cellStyles??{}},l=`${r[0].row}:${r[0].col}`,s=void 0!==t?t:!(a[l]??{})[e];for(const{row:t,col:n}of r){const r=`${t}:${n}`;a[r]={...a[r]??{},[e]:s}}return{...n,cellStyles:a}}))},[re,j]),oe=ee?{row:ee.anchor.row,col:ee.anchor.col}:_,ae=oe?Z[`${oe.row}:${oe.col}`]??{}:{},le=!!oe,se=i(e=>{S(t=>t.map((t,r)=>r===j?{...t,...e}:t))},[j]),ce=i(e=>{const t=e.reduce((e,t)=>Math.max(e,t.length),0);t!==Y.length?se({data:e,columns:y(t)}):se({data:e})},[se,Y.length]),ie=(e,t)=>{S(r=>r.map((r,n)=>n===e?{...r,name:t}:r)),O(null)},ue=()=>W.filter(e=>e.some(e=>e.trim())).map(e=>e.map(e=>e.includes(",")||e.includes('"')||e.includes("\n")?`"${e.replace(/"/g,'""')}"`:e).join(",")).join("\n"),de=[];W.forEach(e=>e.forEach(e=>{const t=parseFloat(e);!isNaN(t)&&e.trim()&&de.push(t)}));const he=W.reduce((e,t)=>e+t.filter(e=>e.trim()).length,0);/* @__PURE__ */
2
- return u("div",{ref:m,className:"flex flex-col h-full",children:[
3
- /* @__PURE__ */d(a,{title:`${me=L||"Untitled",me.length>24?`${me.slice(0,23)}…`:me} - Spreadsheets`}),
4
- /* @__PURE__ */d(t,{app:"spreadsheet"}),
5
- /* @__PURE__ */u("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[X?/* @__PURE__ */d("input",{type:"text",value:L,onChange:e=>A(e.target.value),onBlur:()=>I(!1),onKeyDown:e=>{"Enter"===e.key&&I(!1)},autoFocus:!0,className:"text-sm font-medium text-gray-900 border border-gray-300 rounded px-2 py-0.5 w-40 focus:border-blue-500 focus:ring-blue-500"}):/* @__PURE__ */d("button",{onClick:()=>I(!0),className:"text-sm font-medium text-gray-900 hover:text-blue-600 truncate max-w-[200px]",title:"Click to rename",children:L||"Untitled"}),
6
- /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
7
- /* @__PURE__ */d("input",{ref:H,type:"file",accept:".csv,.tsv,.txt,.xlsx,.xls,.ods",onChange:async e=>{const t=e.target.files?.[0];if(!t)return;const r=t.name.replace(/\.(csv|tsv|txt|xlsx|xls|ods)$/i,"");if(/\.(xlsx|xls|ods)$/i.test(t.name)){const e=new Uint8Array(await t.arrayBuffer()),n=await(import("xlsx")),o=n.read(e,{type:"array"}),a=o.SheetNames.map(e=>{const t=n.utils.sheet_to_json(o.Sheets[e],{header:1,defval:""}),r=Math.max(p,t.reduce((e,t)=>Math.max(e,t.length),0)),a=t.map(e=>{const t=e.map(e=>String(e??""));for(;t.length<r;)t.push("");return t});for(;a.length<x;)a.push(Array(r).fill(""));return{id:crypto.randomUUID(),name:e,columns:y(r),data:a}});S(a),E(0),A(r)}else{const e=v(await t.text());if(0===e.length)return;const n=Math.max(p,e.reduce((e,t)=>Math.max(e,t.length),0)),o=e.map(e=>{for(;e.length<n;)e.push("");return e});for(;o.length<x;)o.push(Array(n).fill(""));se({columns:y(n),data:o}),A(r)}H.current&&(H.current.value="")},className:"hidden"}),
8
- /* @__PURE__ */d("button",{onClick:()=>H.current?.click(),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Open"}),
9
- /* @__PURE__ */d("button",{onClick:()=>{const e=new Blob([ue()],{type:"text/csv"}),t=URL.createObjectURL(e),r=document.createElement("a");r.href=t,r.download=`${L||"spreadsheet"}.csv`,r.click(),URL.revokeObjectURL(t)},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Save CSV"}),R&&/* @__PURE__ */d("button",{onClick:()=>R(ue(),`${L||"spreadsheet"}.csv`),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Email"}),
10
- /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
11
- /* @__PURE__ */u("div",{className:"flex items-center gap-1",children:[
12
- /* @__PURE__ */d("input",{type:"number",min:"1",max:"50",value:T,onChange:e=>G(e.target.value),className:"w-10 text-xs text-center border border-gray-300 rounded px-1 py-0.5 focus:border-blue-500 focus:ring-blue-500"}),
13
- /* @__PURE__ */d("button",{onClick:()=>(e=>{const t=Y.length+e;se({columns:y(t),data:W.map(t=>[...t,...Array(e).fill("")])})})(parseInt(T)||1),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"+ Col"})]}),
14
- /* @__PURE__ */u("div",{className:"flex items-center gap-1",children:[
15
- /* @__PURE__ */d("input",{type:"number",min:"1",max:"500",value:J,onChange:e=>P(e.target.value),className:"w-10 text-xs text-center border border-gray-300 rounded px-1 py-0.5 focus:border-blue-500 focus:ring-blue-500"}),
16
- /* @__PURE__ */d("button",{onClick:()=>{return e=parseInt(J)||10,void se({data:[...W,...Array.from({length:e},()=>Array(Y.length).fill(""))]});var e},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"+ Row"})]}),
17
- /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
18
- /* @__PURE__ */d("button",{onClick:()=>{se({columns:y(p),data:b(x,p)})},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Clear"}),
19
- /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
20
- /* @__PURE__ */u("div",{className:"flex items-center gap-0.5",title:le?"":"Click a cell first",children:[
21
- /* @__PURE__ */d("button",{onClick:()=>ne("bold"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors font-bold ${ae.bold?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"B"}),
22
- /* @__PURE__ */d("button",{onClick:()=>ne("italic"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors italic ${ae.italic?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"I"}),
23
- /* @__PURE__ */d("button",{onClick:()=>ne("underline"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors underline ${ae.underline?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"U"}),
24
- /* @__PURE__ */u("select",{value:ae.fontSize??"base",onChange:e=>ne("fontSize",e.target.value),disabled:!le,className:"ml-1 text-xs border border-gray-300 rounded px-1 py-0.5 bg-white disabled:opacity-40 disabled:cursor-not-allowed",children:[
25
- /* @__PURE__ */d("option",{value:"sm",children:"XS"}),
26
- /* @__PURE__ */d("option",{value:"base",children:"S"}),
27
- /* @__PURE__ */d("option",{value:"lg",children:"M"}),
28
- /* @__PURE__ */d("option",{value:"xl",children:"L"})]})]})]}),
29
- /* @__PURE__ */d("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */d(e,{columns:Y,data:W,onChange:ce,onColumnsChange:e=>se({columns:e}),cellStyles:Z,onFocusChange:q,onSelectionChange:te,minRows:x,maxHeight:"100%"})}),
30
- /* @__PURE__ */u("div",{className:"flex items-center border-t border-gray-200 bg-gray-50 shrink-0",children:[
31
- /* @__PURE__ */u("div",{className:"flex items-center gap-0.5 px-1 py-1 overflow-x-auto flex-1 min-w-0",children:[C.map((e,t)=>/* @__PURE__ */d("button",{onClick:()=>E(t),onDoubleClick:()=>{O(t),V(e.name)},onContextMenu:e=>{e.preventDefault(),C.length>1&&(e=>{C.length<=1||(S(t=>t.filter((t,r)=>r!==e)),j>=e&&j>0&&E(j-1))})(t)},className:"px-3 py-1 text-xs font-medium rounded-b whitespace-nowrap transition-colors "+(t===j?"bg-white text-blue-700 border border-t-0 border-gray-300 -mt-px relative z-10":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"),children:K===t?/* @__PURE__ */d("input",{type:"text",value:Q,onChange:e=>V(e.target.value),onBlur:()=>ie(t,Q||e.name),onKeyDown:r=>{"Enter"===r.key&&ie(t,Q||e.name),"Escape"===r.key&&O(null)},onClick:e=>e.stopPropagation(),autoFocus:!0,className:"w-20 text-xs border border-blue-400 rounded px-1 py-0 focus:ring-0 focus:outline-none"}):e.name},e.id)),
32
- /* @__PURE__ */d("button",{onClick:()=>{const e=`Sheet ${C.length+1}`;S(t=>[...t,f(e)]),E(C.length)},className:"px-2 py-1 text-xs text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded",title:"Add sheet",children:"+"})]}),
33
- /* @__PURE__ */u("div",{className:"flex items-center gap-4 px-3 py-1 text-xs text-gray-500 shrink-0 border-l border-gray-200",children:[
34
- /* @__PURE__ */u("span",{children:[he," cells"]}),de.length>0&&/* @__PURE__ */u(h,{children:[
35
- /* @__PURE__ */u("span",{children:["Sum: ",de.reduce((e,t)=>e+t,0).toLocaleString(void 0,{maximumFractionDigits:2})]}),
36
- /* @__PURE__ */u("span",{children:["Avg: ",(de.reduce((e,t)=>e+t,0)/de.length).toLocaleString(void 0,{maximumFractionDigits:2})]})]}),
37
- /* @__PURE__ */u("span",{children:[W.length," × ",Y.length]})]})]})]});var me}export{w as default};
@@ -1,108 +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-DSSLOQDW.js";import{CopyButton as d}from"./chunk-YDDG7MXB.js";import{isStaleChunkError as u,CMD_Z as h,CMD_SHIFT_Z as m,Result as p,useIsMobile as f,useIsPhone as w,useShellPrefs as y}from"./chunk-FNR5SPQM.js";import{PopupMenu as g,PopupMenuItem as b,PopupMenuDivider as v,PopupMenuLabel as x}from"./chunk-K73JEGD5.js";import{reportBoundaryError as k}from"./chunk-KNUR2UEG.js";import{confirm as E,dialogA11y as C}from"./chunk-VOUSFISE.js";import{Button_default as M}from"./chunk-DELNCIUK.js";import{Z_LAYERS as N,runEscapeInterceptors as S}from"./chunk-FIEA5CGB.js";import{Icon as L}from"./chunk-YT4B3NSV.js";import{useShellStrings as T}from"./chunk-HQLDTFAF.js";import{LoadingSpinner as z}from"./chunk-2J6F4EE7.js";import{createContext as A,useContext as D,Component as I,useLayoutEffect as P,useRef as $,useEffect as K,useState as W,useSyncExternalStore as O,useCallback as R,isValidElement as F,Fragment as q,Children as j,cloneElement as B,useMemo as H,useId as Y,useReducer as U,Suspense as X}from"react";import{jsxs as V,jsx as _,Fragment as J}from"react/jsx-runtime";import{createPortal as G}from"react-dom";import{useLocation as Q}from"react-router-dom";import{useQueryClient as Z,useQuery as ee}from"@tanstack/react-query";function te(e){return"component"in e}function ne(e){return"endpoint"in e}var re={};function oe(e){re=e}var ie=new Proxy({},{get:(e,t)=>re[t],has:(e,t)=>t in re,ownKeys:()=>Object.keys(re),getOwnPropertyDescriptor(e,t){if(t in re)return{configurable:!0,enumerable:!0,value:re[t]}}}),ae=null;function se(e){ae=e}function le(){return null!==ae}var ce=/* @__PURE__ */new Set(["get","post","put","patch","delete","head","options","request"]),de=new Proxy({},{get:(e,t)=>ae?ae[t]:"string"==typeof t&&ce.has(t)?()=>Promise.resolve({data:null,status:0,statusText:"",headers:{},config:{}}):void 0}),ue=A(null);function he(){return D(ue)?.pageSearch??""}var me=null,pe=/* @__PURE__ */new Set;function fe(e){me!==e&&(me=e,pe.forEach(e=>e()))}function we(){return me}function ye(e){return pe.add(e),()=>{pe.delete(e)}}function ge({error:e,onReload:t}){const n=u(e);/* @__PURE__ */
2
- return V("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
3
- /* @__PURE__ */_(L,{name:"warning",className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
4
- /* @__PURE__ */V("div",{className:"min-w-0",children:[
5
- /* @__PURE__ */_("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__ */_("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__ */_("button",{type:"button",onClick:n?()=>window.location.reload():t,className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg",children:n?"Reload page":"Reload window"})]})}var be=class extends I{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),k(e)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */_(ge,{error:e,onReload:this.reset}):this.props.children}},ve=A(null),xe="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function ke({className:e="",auto:t=!1}){const n=D(ve),r=T().undo,o=n?.claimOwnMount;if(P(()=>{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:d}=n;/* @__PURE__ */
8
- return V("div",{className:`flex items-center gap-2 ${e}`,"data-undo-controls":t?"shell":"form",children:[
9
- /* @__PURE__ */_("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",h):r.nothingToUndo,className:xe,children:r.undo}),
10
- /* @__PURE__ */_("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(d??"",m):r.nothingToRedo,className:xe,children:r.redo})]})}var Ee=/* @__PURE__ */new Set([408,429]);function Ce(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function Me(e){const t=Ce(e);return null!=t&&(t>=400&&t<500&&!Ee.has(t))}function Ne(e,t){return!Me(t)&&e<3}function Se(){const e=T().loading;/* @__PURE__ */
11
- return _(z,{size:"sm",padding:"p-8",label:e.label})}var Le="flex-1 min-h-0";function Te(){const e=T().record;/* @__PURE__ */
12
- return _(z,{label:e.loading,padding:"",className:Le})}function ze(e){return e??void 0}function Ae({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:o}){const i=T().record;if(t||e&&n)/* @__PURE__ */return _(Te,{});if(r){const e=Ce(r);if(401===e)/* @__PURE__ */
13
- return _(p,{status:"warning",title:i.signInRequired,subTitle:i.signInBody,className:Le});if(403===e)/* @__PURE__ */
14
- return _(p,{status:"403",className:Le});if(404===e||410===e)/* @__PURE__ */
15
- return _(p,{status:"404",title:i.notFound,className:Le});const t=null==e||408===e||429===e||e>=500;/* @__PURE__ */
16
- return _(p,{status:"500",title:i.loadFailed,subTitle:t?i.checkConnection:i.rejected,extra:t?/* @__PURE__ */_(M,{variant:"secondary",size:"sm",onClick:o,children:i.retry}):void 0,className:Le})}/* @__PURE__ */
17
- return _(p,{status:"404",title:i.notFound,className:Le})}function De({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */_(J,{children:t(e)}):/* @__PURE__ */_(Ae,{...n})}var Ie=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function Pe(e){return"string"==typeof e&&(e.startsWith("new-")||Ie.test(e))}function $e(e){if(Pe(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var Ke=A({openWindows:[],openEntity:()=>{},openPage:()=>{},closeEntity:()=>{},minimize:()=>{},items:[],restore:()=>{},remove:()=>{},restoreIfMinimized:()=>!1,openItems:[]}),We=A(null);function Oe(e){const t=D(We),n=$(null);null===n.current&&(n.current=/* @__PURE__ */Symbol("window-dirty")),P(()=>{if(t)return t(n.current,e)},[t,e]),K(()=>{if(!t||!e)return;const n=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t,e])}function Re(){const e=$(/* @__PURE__ */new Map),[t,n]=W(!1);return{dirty:t,registerDirty:R((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 Fe(){return D(Ke)}function qe(e){if("page"!==e.type&&$e(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 je({item:e,onClose:t,accentRgb:n}){const{dirty:r,registerDirty:o}=Re(),i=ie[e.route];if(!i||!te(i))return null;const a=i,s=a.component;/* @__PURE__ */
18
- return _(Ar,{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__ */_(We.Provider,{value:o,children:/* @__PURE__ */_(X,{fallback:/* @__PURE__ */_("div",{className:"flex items-center justify-center py-12",children:/* @__PURE__ */_(Se,{})}),children:/* @__PURE__ */_(s,{})})})})}function Be({entityType:e,entityId:t,label:n}){const r=T(),o=Z(),{data:i}=ee({queryKey:["my-profile-sidebar"],enabled:le(),queryFn:()=>de.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 _("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];de.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__ */_(L,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var He=/* @__PURE__ */new Set;function Ye({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=ie[e.entityType];if(!o||!ne(o))return null;const i=o,[a,s]=W(!1),{dirty:l,registerDirty:d}=Re(),u=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=Pe(e.entityId),p=!i.selfFetching&&!h&&!m&&le(),f=ee({queryKey:[u,e.entityId],queryFn:()=>{return de.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:ze(e.entitySnapshot),initialDataUpdatedAt:0,enabled:p,staleTime:0,refetchOnWindowFocus:!0,refetchOnMount:"always",refetchInterval:e=>!Me(e.state.error)&&6e4,refetchIntervalInBackground:!1,retry:Ne}),w=f.data,y=f.refetch;K(()=>{var t;if(p)return t=t=>{t!==e.id||He.has(t)||y({cancelRefetch:!1})},$n.add(t),()=>{$n.delete(t)}},[y,e.id,p]);const g=R(()=>{a&&!l?s(!1):t()},[a,l,t]),b=i.selfFetching?e.label:w?i.title(w,a,s):e.label,v=i.icon,x=v?c[v]:null,k=b,E=!i.selfFetching&&w&&i.footer&&!h?i.footer(w):void 0;return i.rendersOwnModal?i.selfFetching?/* @__PURE__ */_(X,{fallback:/* @__PURE__ */_(Se,{}),children:i.render(w??e.entitySnapshot,t,e.entityId,a,s)}):null!=w?/* @__PURE__ */_(X,{fallback:/* @__PURE__ */_(Ar,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */_(Te,{})}),children:i.render(w,t,e.entityId,a,s)}):/* @__PURE__ */_(Ar,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */_(Ae,{isPending:f.isPending,isFetching:f.isFetching,enabled:p,error:f.error,onRetry:y})}):/* @__PURE__ */_(Ar,{open:!0,onClose:g,onMinimize:n,initialBox:e.savedBox,icon:x,title:k,footer:E,copyText:e.label,windowKey:e.id,openedFromKey:e.openedFrom,size:i.size||"2xl",dirty:l,editing:a||m||h,dimensions:i.dimensions,autoHeight:i.autoHeight,autoMinHeight:i.autoMinHeight,autoWidth:i.autoWidth,appStyle:i.appStyle,flushBody:i.flushBody,accentRgb:r,children:/* @__PURE__ */_(We.Provider,{value:d,children:/* @__PURE__ */_(X,{fallback:/* @__PURE__ */_(Te,{}),children:i.selfFetching?i.render(null,t,e.entityId,a,s):/* @__PURE__ */_(De,{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 Ue(e){return document.querySelector(`[data-modal-panel][data-window-key="${e}"]`)}function Xe(e){return document.querySelector(`[data-modal-panel][data-window-root][data-window-owner="${e}"]`)}function Ve(e){const t=Ue(e),n=t??Xe(e);if(!n)return;if(t&&!Xn(t))return r=e,void window.dispatchEvent(new CustomEvent("modal-reveal",{detail:{windowKey:r}}));var r;const o=n.getAttribute("data-modal-id");o&&Kn(o)}function _e(e){if("page"!==e.type)return!0;const t=e.route?ie[e.route]:void 0;if(!t||!te(t))return!0;const n=t;return!n.widget&&!n.utility}function Je(){const e=sr();if(!e)return;const t=document.querySelector(`[data-modal-panel][data-modal-id="${e}"]`);return t?.getAttribute("data-window-key")??void 0}var Ge=/* @__PURE__ */new Map;function Qe(){const e=Je();if(e)return Ge.get(e)}function Ze(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 et="rosh-peek-style",tt=N.peek,nt=N.taskbarPreview;function rt(e){"undefined"!=typeof document&&(!function(){if("undefined"==typeof document||document.getElementById(et))return;const e=document.createElement("style");e.id=et,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:${tt}!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 ot(){"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 it({id:e,label:t,maxW:n,maxH:r,titleAbove:o=!1,onClick:i,onClose:a}){const s=T(),l=$(null),[c,d]=W({w:n,h:Math.round(.75*r)}),[u,h]=W(!1);return P(()=>{const o=l.current;if(!o)return;const i=Ue(e)??Ze(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)),u=Math.max(60,Math.round(a.height*s));d({w:c,h:u}),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.querySelectorAll('[role="dialog"], [data-portal]').forEach(e=>{e.style.display="none"}),o.innerHTML="",o.appendChild(m),()=>{o.innerHTML=""}},[e,t,n,r]),/* @__PURE__ */V("div",{style:{width:c.w,height:c.h},className:"relative rounded-md overflow-hidden bg-white/95 border border-gray-300 shadow-(--elevation-panel) cursor-pointer ring-2 ring-transparent group-hover:ring-blue-400 transition shrink-0",onClick:i,children:[
20
- /* @__PURE__ */_("div",{ref:l,className:"absolute inset-0 z-0 overflow-hidden"}),!u&&/* @__PURE__ */V("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-gray-400 bg-gray-50",children:[
21
- /* @__PURE__ */_(L,{name:"window",className:"h-6 w-6",strokeWidth:1.5}),
22
- /* @__PURE__ */_("span",{className:"mt-1 text-3xs uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */_("div",{className:"absolute bottom-0 left-0 right-0 z-10 px-2 py-1 text-2xs font-medium text-white bg-gradient-to-t from-black/80 to-transparent truncate pointer-events-none",children:t}),a&&/* @__PURE__ */_("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-white flex items-center justify-center",title:s.taskbar.closeWindow,children:/* @__PURE__ */_(L,{name:"close",className:"h-3 w-3",strokeWidth:3})})]})}function at({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=T(),s=e.length>1,l=$(null),[c,d]=W({left:-9999,top:-9999,ready:!1}),[u,h]=W(()=>"undefined"!=typeof document&&getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom");P(()=>{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)),d({left:a,top:i,ready:!0})};n();const r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t,e.length]),K(()=>ot,[]);const m="top"===u,p=(m?"mt-1":"mb-1")+" max-w-[240px] truncate text-2xs font-medium text-gray-900 bg-white/80 px-2 py-0.5 rounded shadow-sm ring-2 ring-transparent transition group-hover:ring-blue-400";return G(
23
- /* @__PURE__ */_("div",{ref:l,"data-taskbar-preview":"",style:{position:"fixed",left:c.left,top:c.top,zIndex:nt,maxWidth:"calc(100vw - 16px)",opacity:c.ready?1:0},className:s?"flex gap-2 flex-wrap":"",onMouseEnter:o,onMouseLeave:()=>{ot(),i()},children:e.map(e=>{const t=Ue(e.id)??Ze(e.label),o=t?function(e){if(Xn(e))return null;const t=e.getBoundingClientRect(),n=qn(),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 V("div",{className:"group flex flex-col items-center",onMouseEnter:()=>rt(t),children:[!m&&/* @__PURE__ */_("span",{className:p,children:e.label}),
25
- /* @__PURE__ */_(it,{id:e.id,label:e.label,maxW:240,maxH:160,titleAbove:!0,onClick:()=>n(e.id),onClose:()=>r(e.id)}),m&&/* @__PURE__ */_("span",{className:p,children:e.label}),null!==o&&/* @__PURE__ */V("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-white shadow-sm",children:[
26
- /* @__PURE__ */_(L,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function st(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 lt({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=T(),[a,s]=W(null);K(()=>{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=O(lr,sr),[,d]=W(0);K(()=>{const e=()=>d(e=>e+1);return window.addEventListener("modal-geometry",e),window.addEventListener("resize",e),()=>{window.removeEventListener("modal-geometry",e),window.removeEventListener("resize",e)}},[]);const[,u]=W(0);K(()=>{const e=()=>u(e=>e+1);return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[]);const h=e=>{const t=Ze(e),n=t?.querySelector("[data-window-title]");return n?.textContent?.trim()||e},[m,p]=W(null),[f,w]=W(null),[y,k]=W(null),E=$(null),C=()=>{E.current&&(clearTimeout(E.current),E.current=null),E.current=setTimeout(()=>{p(null),w(null)},150)},M=e.filter(e=>!e.route||!ie[e.route]?.utility);if(!a||!a.isConnected||0===M.length)return null;const N=[],S=/* @__PURE__ */new Map;for(const e of M){const t=e.route?ie[e.route]:void 0,n=t?.taskbarGroup,r=n?.key??e.route??`entity:${e.id}`,o=S.get(r);if(void 0!==o)N[o].items.push(e);else{S.set(r,N.length);const o=n?.label??t?.label??e.label;N.push({key:r,route:n?.icon??e.route,label:o,items:[e]})}}return G(
27
- /* @__PURE__ */V(J,{children:[N.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,d=e.items.some(e=>{const t=Ue(e.id)??Ze(e.label);return!!t&&!Xn(t)});/* @__PURE__ */
28
- return V("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.currentTarget,void(y||(E.current&&(clearTimeout(E.current),E.current=null),E.current=setTimeout(()=>{p(n),w(r)},350)));var n,r},onMouseLeave:C,onDoubleClick:e=>{e.stopPropagation(),window.dispatchEvent(new CustomEvent("modal-center",{detail:{windowKey:r.id,label:r.label}}))},onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),E.current&&(clearTimeout(E.current),E.current=null),p(null),w(null),s?k({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&&F(n)?B(n,{className:"h-3.5 w-3.5 shrink-0"}):/* @__PURE__ */_(L,{name:"expand",className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),
29
- /* @__PURE__ */_("span",{className:"truncate flex-1",children:s?e.label:h(r.label)}),d&&/* @__PURE__ */_("span",{title:i.taskbar.offscreenDot,className:"shrink-0 h-1.5 w-1.5 rounded-full bg-amber-500"}),s&&/* @__PURE__ */_("span",{className:"shrink-0 px-2 py-0.5 rounded-full bg-blue-500/80 text-white text-2xs font-bold leading-none",children:e.items.length}),!s&&/* @__PURE__ */_("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__ */_(L,{name:"close",className:"h-3 w-3",strokeWidth:2})})]},e.key)}),
30
- /* @__PURE__ */_("div",{className:"flex-1"}),M.length>=2&&/* @__PURE__ */V("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-blue-50 transition-colors shrink-0",children:[
31
- /* @__PURE__ */_(L,{name:"grid",className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),y&&/* @__PURE__ */V(g,{portal:!0,minWidth:200,style:st(y.x,y.y),onClose:()=>k(null),children:[
32
- /* @__PURE__ */_(x,{children:y.label}),
33
- /* @__PURE__ */V(b,{onClick:()=>{k(null),y.items.forEach(e=>function(e){const t=En.get(e);t&&Wn(t)}(e.id))},children:[
34
- /* @__PURE__ */_(L,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),i.taskbar.minimizeAllWindows]}),
35
- /* @__PURE__ */V(b,{onClick:()=>{k(null),y.items.forEach(e=>o(e.id))},children:[
36
- /* @__PURE__ */_("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */_("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__ */_(v,{}),
38
- /* @__PURE__ */V(b,{danger:!0,onClick:()=>{k(null),y.items.forEach(e=>t(e.id))},children:[
39
- /* @__PURE__ */_(L,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${y.items.length})`]})]}),m&&f&&/* @__PURE__ */_(at,{items:m,anchorEl:f,onActivate:e=>{o(e),p(null),w(null)},onClose:e=>{t(e),p(null),w(null)},onMouseEnter:()=>{E.current&&(clearTimeout(E.current),E.current=null)},onMouseLeave:C})]}),a)}var ct=["/login","/forgot-password","/reset-password","/force-change-password"];function dt({children:e,windowAccentForRoute:t}){const n=Q(),r=ct.some(e=>n.pathname.startsWith(e)),[o,i]=W([]),a=$(o);P(()=>{a.current=o},[o]);const s=O(ye,we,we),l=$(/* @__PURE__ */new Map),c=e=>{const t=_e(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};K(()=>{Ge.clear();for(const e of o)e.route&&Ge.set(e.id,e.route)},[o]);const d=R(e=>{i(t=>t.filter(t=>t.id!==e))},[]),u=R(e=>{var t;Ue(e)||Xe(e)?(t=e,window.dispatchEvent(new CustomEvent(cr,{detail:{windowKey:t}}))):d(e)},[d]),h=(e,t=!1)=>{const n=gn;t&&He.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,(bn.get(i)??-1)>a)||Kn(o),t&&He.delete(e)},50)},m=R((e,t,n,r,o)=>{if(!ie[e]||!ne(ie[e]))return;const a=`${e}:${t}`,s=Je();i(i=>{const l=i.find(n=>n.entityType===e&&String(n.entityId)===String(t));return l?(h(l.id),i):(h(a,!0),[...i,{id:a,type:"modal",label:r||t,route:o||window.location.pathname,entityType:e,entityId:t,entitySnapshot:ze(n),openedFrom:s}])})},[]),p=R((e,t={})=>{if(!ie[e]||!te(ie[e]))return;const n=ie[e],{reuse:r=!1,background:o=!1,shellOwned:s,search:l}=t,c=e=>{var t;o?(t=e,Ln.add(t)):h(e)};if(n.widget){const t=a.current.find(t=>"page"===t.type&&t.route===e);if(t)return void u(t.id)}const d=Je();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 c(a),[...t,{id:a,type:"page",label:n.label,route:e,openedFrom:d,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}}]}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 c(a),[...t,{id:a,type:"page",label:n.label,route:e,openedFrom:d,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}}]})},[u]),f=R(()=>{},[]),w=R(()=>{},[]),y=u,g=u;/* @__PURE__ */
40
- return V(Ke.Provider,{value:{openWindows:o,openEntity:m,openPage:p,closeEntity:y,minimize:f,items:[],openItems:o,restore:w,remove:g,restoreIfMinimized:()=>!1},children:[e,
41
- /* @__PURE__ */_(lt,{openWindows:o,onRemove:u,onSplitView:Tr,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&&Kn(e)}})},onActivateById:Ve}),
42
- /* @__PURE__ */_(zr,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
43
- /* @__PURE__ */
44
- return _(ue.Provider,{value:c(e),children:/* @__PURE__ */_(be,{fallback:(t,n)=>/* @__PURE__ */_(Ar,{open:!0,onClose:()=>d(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */_(ge,{error:t,onReload:n})}),children:/* @__PURE__ */_(Kt,{spec:qe(e),children:/* @__PURE__ */_(Or,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */_(je,{item:e,onClose:()=>d(e.id),accentRgb:n}):/* @__PURE__ */_(Ye,{item:e,onClose:()=>d(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var ut=null,ht=/* @__PURE__ */new Set;function mt(){return ut}function pt(e){if(ut!==e){ut=e;for(const e of ht)e()}}function ft(e){return ht.add(e),()=>{ht.delete(e)}}var wt=!1,yt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},gt=()=>{};function bt(e){wt=e,yt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function vt(e,t){wt&&("submenu"===e?yt.submenus++:yt.menus++,yt.menuKey=t)}function xt(e){if(!wt)return gt;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!wt)return;const r=performance.now()-t;"move"===e?yt.moveMs+=r:yt.resizeMs+=r}}function kt(){const e=yt;return yt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var Et=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),Ct=/* @__PURE__ */new Set(["svg"]);function Mt(e){const t=[],n={text:"",accessories:[]};return Nt(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function Nt(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=>Nt(e,t,n));if(!F(e))return;const r=e;if(r.type!==d)if(r.type!==q){if("string"==typeof r.type){if(Ct.has(r.type))return;if(!Et.has(r.type))return n.push(" "),j.toArray(r.props.children).forEach(e=>Nt(e,t,n)),void n.push(" ")}t.accessories.push(B(r,{key:`title-part-${t.accessories.length}`}))}else j.toArray(r.props.children).forEach(e=>Nt(e,t,n));else void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text)}var St=/* @__PURE__ */new Map,Lt=/* @__PURE__ */new Set,Tt=0;function zt(){Tt++,Lt.forEach(e=>e())}function At(e){return St.get(e)}function Dt(e){return Lt.add(e),()=>{Lt.delete(e)}}function It(){return Tt}var Pt=A(""),$t=A(null);function Kt({spec:e,children:t}){/* @__PURE__ */
45
- return _($t.Provider,{value:e,children:t})}var Wt=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),Ot='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600',Rt='button, a[href], summary, [role="button"], [role="link"], [role="menuitem"], select';function Ft(e){return qt(e).replace(/\s+/g," ").trim()}function qt(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(qt).join("");if(F(e)){const t=e,n="string"==typeof t.type?t.type:"";return Wt.has(n)?"":` ${qt(t.props?.children)} `}return""}function jt(e){const t=D(Pt);K(()=>{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 Bt={};function Ht(e,t,n){const r=D(Pt);K(()=>{if(!r)return;Bt[r]||(Bt[r]=[]);const o={label:e,icon:n,onClick:t};return Bt[r].push(o),()=>{Bt[r]=(Bt[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function Yt({title:e}){const t=$(null);return K(()=>{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__ */_("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function Ut(e){}var Xt=A(null);function Vt(){return D(Pt)}function _t(){const e=O(lr,sr),t=D(Xt);return t?.active??(fn.length<=1||null!=e)}function Jt({children:e,position:t="right",quiet:n=!1}){const r=D(Xt),[o,i]=W(null);return K(()=>{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?G(e,o):null}function Gt({onClick:e,children:t,className:n}){const r=D(Xt);/* @__PURE__ */
46
- return _("button",{type:"button",onClick:async()=>{if(r?.isDirty){const{confirm:e}=await(import("./ConfirmDialog-5LHOXDQS.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 Qt="erp_window_positions",Zt={};try{const e=localStorage.getItem(Qt);e&&(Zt=JSON.parse(e))}catch{}var en=null;function tn(){en&&clearTimeout(en),en=setTimeout(()=>{try{localStorage.setItem(Qt,JSON.stringify(Zt))}catch{}},500)}var nn="erp_activation_order",rn=[];try{const e=localStorage.getItem(nn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(rn=t)}catch{}var on=null;function an(){on&&clearTimeout(on),on=setTimeout(()=>{try{localStorage.setItem(nn,JSON.stringify(rn))}catch{}},500)}function sn(e,t){Zt[e]||(Zt[e]=t,tn())}function ln(e){return Zt[e]?{...Zt[e]}:null}function cn(e,t){Zt[e]=t,tn()}function dn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(Zt))n(Zt[e],r,o)&&(delete Zt[e],i=!0);i&&tn()}var un={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},hn=4e3,mn=()=>{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"},pn={small:.8,medium:1,large:1.25,maximized:1.25},fn=[],wn=/* @__PURE__ */new Set,yn=/* @__PURE__ */new Set,gn=0,bn=/* @__PURE__ */new Map;var vn=0;function xn(){return vn}function kn(){vn++,wn.forEach(e=>e())}var En=/* @__PURE__ */new Map,Cn=/* @__PURE__ */new Map,Mn=/* @__PURE__ */new Map;function Nn(){for(let e=fn.length-1;e>=0;e--){const t=Mn.get(fn[e]);if(t?.tab)return t.owner}return null}function Sn(){return O(lr,Nn,()=>null)}var Ln=/* @__PURE__ */new Set;var Tn=null;function zn(e){Tn=null,Kn(e)}function An(e){Tn=e;const t=En.get(e);t&&zn(t)}function Dn(e){Tn===e&&(Tn=null)}function In(e,t,n){if(n&&Mn.set(e,n),t)if(En.set(t,e),Cn.set(e,t),Ln.delete(t)){fn.unshift(e);const n=rn.indexOf(t);-1!==n&&rn.splice(n,1),rn.unshift(t),an()}else!function(e,t){const n=rn.indexOf(t);if(-1===n)return void fn.push(e);let r=fn.length;for(let e=0;e<fn.length;e++){const t=Cn.get(fn[e]);if(t&&rn.indexOf(t)>n){r=e;break}}fn.splice(r,0,e)}(e,t),-1===rn.indexOf(t)&&(rn.push(t),an());else fn.push(e);kn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&Tn===t&&zn(e)}function Pn(e){return e?Mn.get(e)?.owner??Cn.get(e)??null:null}var $n=/* @__PURE__ */new Set;function Kn(e){const t=Pn(sr()),n=fn.indexOf(e);-1!==n&&fn.splice(n,1),fn.push(e);const o=Mn.get(e);if(o?.root&&o.tab&&r()){const e=fn.filter(e=>{const t=Mn.get(e);return!!t&&!t.root&&t.owner===o.owner});for(const t of e)fn.splice(fn.indexOf(t),1),fn.push(t)}yn.delete(e);const i=Cn.get(e);if(i){const e=rn.indexOf(i);-1!==e&&rn.splice(e,1),rn.push(i),an(),Tn&&Tn!==i&&(Tn=null)}kn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const a=Pn(sr());a&&a!==t&&$n.forEach(e=>e(a))}function Wn(e){const t=fn.indexOf(e);-1!==t&&fn.splice(t,1),yn.add(e),bn.set(e,++gn);const n=Cn.get(e);if(n){const e=rn.indexOf(n);-1!==e&&(rn.splice(e,1),an())}kn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var On=/* @__PURE__ */new Set;var Rn=8,Fn=32;function qn(){return e()}var jn=40,Bn=80,Hn=384,Yn=400;function Un(e,t=qn()){const n=Math.min(Math.max(e.x,t.x+Bn-e.w),t.x+t.w-Bn),r=Math.min(Math.max(e.y,t.y),t.y+t.h-jn);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function Xn(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=qn();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 Vn(e){const t=qn(),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 _n=null;function Jn(e){const t=(_n||((_n=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none",`z-index: ${N.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(_n)),_n);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 Gn(){_n&&(_n.style.opacity="0",_n.style.display="none")}var Qn=[{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"}],Zn=350,er=200;function tr({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o}){const[i,a]=W(!1),s=$(void 0),l=$(void 0);K(()=>()=>{clearTimeout(s.current),clearTimeout(l.current)},[]);const c=()=>{clearTimeout(l.current),s.current=setTimeout(()=>a(!0),Zn)},d=()=>{clearTimeout(s.current),l.current=setTimeout(()=>a(!1),er)};/* @__PURE__ */
47
- return V("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:d,children:[
48
- /* @__PURE__ */_("button",{onClick:t,onFocus:c,onBlur:d,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */_("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(l.current),onMouseLeave:d,className:"absolute right-0 top-full z-30 mt-1 grid w-max grid-cols-2 gap-1 rounded-lg border border-gray-200 bg-white p-2 shadow-lg",children:Qn.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */_("button",{type:"button","aria-label":o[t],title:o[t],onClick:()=>{a(!1),n(e)},onFocus:()=>clearTimeout(l.current),onBlur:d,className:"relative h-7 w-11 rounded border border-gray-300 bg-gray-50 hover:border-blue-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",children:/* @__PURE__ */_("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var nr="rosh-gesture-style";var rr={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},or=4;function ir(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(nr))return;const e=document.createElement("style");e.id=nr,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=xt(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function ar(e){const t=fn.indexOf(e);if(-1===t)return-1;const n=N.window+t*N.windowStep,o=Mn.get(e);if(!o||o.root||!o.tab||!r())return n;let i=-1;for(const[e,t]of Mn){if(!t.root||t.owner!==o.owner)continue;const n=fn.indexOf(e);-1!==n&&(i=Math.max(i,N.window+n*N.windowStep))}return i>=n?i+2+Math.min(t,7):n}function sr(){return fn[fn.length-1]||null}function lr(e){return wn.add(e),()=>{wn.delete(e)}}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=fn.length-1;e>=0;e--)On.has(fn[e])||fn.splice(e,1);rn=rn.filter(e=>{const t=En.get(e);return null!=t&&On.has(t)}),an(),kn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var cr="modal-close-request";function dr(e){O(lr,xn);const t=D(Xt);if(fn.length<=1)return!0;if(e){const t=En.get(e);if(null!=t)return sr()===t}return t?.active??null!=sr()}var ur=!1,hr=/* @__PURE__ */new Set;function mr(e){return hr.add(e),()=>hr.delete(e)}function pr(){return ur}function fr(e){ur!==e&&(ur=e,hr.forEach(e=>e()))}function wr(){fr(!ur)}function yr(){fr(!1)}var gr=null,br=/* @__PURE__ */new Set;function vr(e){return br.add(e),()=>br.delete(e)}function xr(){return gr}function kr(e){gr!==e&&(gr=e,br.forEach(e=>e()))}var Er=null,Cr=/* @__PURE__ */new Set;function Mr(e){return Cr.add(e),()=>Cr.delete(e)}function Nr(){return Er}function Sr(e){Er!==e&&(Er=e,Cr.forEach(e=>e()))}function Lr(){if(!Er)return void fr(!1);kr(Er),Sr(null),fr(!1)}function Tr(){fr(!ur),window.dispatchEvent(new CustomEvent("modal-split-view"))}function zr(){const e=O(mr,pr),[t,n]=W(e),[r,o]=W(e);return K(()=>{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?G(
49
- /* @__PURE__ */_("div",{onMouseDown:e=>{e.stopPropagation(),fr(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:N.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 Ar({open:t,onClose:i,title:c,icon:d,copyText:u,size:h="lg",dirty:m=!1,onNext:p,onPrev:x,footer:k,bodyScroll:M,onMinimize:z,initialBox:A,actions:I,actionsLeft:q,editing:j=!1,allowPinOnTop:U,initialPosition:X,widget:Q,compact:Z,appStyle:ee,flushBody:te,autoHeight:ne,autoMinHeight:re,autoWidth:oe,widgetMenu:ie,dimensions:ae,windowKey:se,openedFromKey:le,accentRgb:ce,children:de}){const[he,me]=W(()=>r()),pe=f()&&!he,fe=w()&&!!Q,[we,ye]=W(0),[ge,xe]=W(!1),Ee=$(null),Ce=$(0);K(()=>{Ce.current=we},[we]);const Me=R(e=>{pe&&(Ee.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},xe(!0),pt(le??null))},[pe,le]),Ne=O(ft,mt);K(()=>{if(!ge)return;const e=e=>{if(!Ee.current)return;const t=e.clientX-Ee.current.startX;if(Math.abs(e.clientY-Ee.current.startY)>Math.abs(t)+12)return Ee.current=null,xe(!1),ye(0),void pt(null);ye(Math.max(0,t))},t=()=>{if(!Ee.current)return;const e=.3*window.innerWidth,t=Ce.current>e;Ee.current=null,xe(!1),t?(ye(window.innerWidth),setTimeout(()=>{i(),ye(0),pt(null)},180)):(ye(0),pt(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)}},[ge]);const[Se,Le]=W(c),Te=T(),ze=Te.window;K(()=>{Le(c)},[c]);const Ae=H(()=>Ft(Se).trim()||void 0,[Se]),De=Y(),[Ie,Pe]=W(!1),$e=$(!1),[Ke,We]=W(!1),[Re,qe]=W(null),je=D($t),Be=D(ue),{prefs:He,save:Ye}=y(),Ue=!!He.window_accent_stripe,Xe=He.favorite_documents||[],Ve=!!je&&Xe.some(e=>e.entityType===je.entityType&&e.entityId===je.entityId),_e=R(()=>{if(!je)return;const e=Ve?Xe.filter(e=>!(e.entityType===je.entityType&&e.entityId===je.entityId)):[...Xe,{entityType:je.entityType,entityId:je.entityId,label:je.label}];Ye({favorite_documents:e})},[je,Ve,Xe,Ye]),[Je,Ge]=W(null),[Qe,Ze]=W("top-right"===X?"right":"left"),et=$(!1),tt=$(null);P(()=>{const e=tt.current;e&&(ce?e.style.setProperty("--window-accent-rgb",ce):e.style.removeProperty("--window-accent-rgb"))},[ce]);const nt=$(!1),rt=$(null),ot=$(null),it=$(null),[at,st]=W(!1),lt=$(null),ct=!!(k||I||q)||at,dt=D(ve),ut=""!==D(Pt),ht=$(null);ht.current=Be?{owner:Be.key,tab:Be.tab,root:!ut}:null;const wt=se||(Be&&!ut?Be.key:null),yt=!!dt&&!ut&&dt.enabled&&dt.hasState&&(j||dt.declaredEditable)&&!dt.handMounted&&ct&&!Q&&!Z&&!ee&&!pe,gt=/* @__PURE__ */_(L,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),bt=d&&F(d)?B(d,{className:`h-4 w-4 ${d.props?.className??""}`.trim()}):d??gt,vt=()=>/* @__PURE__ */_("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();qe(e=>e?null:{x:t.left,y:t.bottom+4})},className:"shrink-0 p-0.5 rounded hover:bg-gray-200/50 transition-colors",title:"Window menu",children:bt}),xt=40,{minimize:kt,items:Et,restoreIfMinimized:Ct,openWindows:Nt}=Fe(),Lt=$(`modal-${Math.random().toString(36).slice(2,8)}`).current;K(()=>{if(Q)return On.add(Lt),()=>{On.delete(Lt)}},[Q,Lt]),K(()=>{const e=e=>{const t=e.detail;t?.id===Lt&&Le(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[Lt]);const[Tt,At]=W(N.window),Dt=function(e){const t=O(lr,sr);return fn.length<=1||t===e}(Lt),It=function(e){return O(lr,()=>yn.has(e))}(Lt),Kt=O(mr,pr),Wt=O(vr,xr),qt=O(Mr,Nr),jt=!U&&!Q,Ht=Kt&&jt,[Yt,Ut]=W(!1),Vt=Ht&&qt===Lt,[_t,Jt]=W(!1),Gt=_t&&jt&&Wt===Lt?"picked":null,Qt=$(Ht);K(()=>{if(Qt.current&&!Ht){Jt(!0);const e=setTimeout(()=>{Jt(!1),gr===Lt&&kr(null)},700);return Qt.current=Ht,()=>clearTimeout(e)}Qt.current=Ht},[Ht,Lt]),K(()=>{Ht||Ut(!1)},[Ht]),K(()=>{const e=ot.current,t=it.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>st(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]),K(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&tt.current){const t=tt.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=ot.current,n=it.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const en=$(!1),nn=R(e,[]),rn=R(()=>{const t=e(),n=ae?ae[0]:un[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=pn[mn()],l=ae?Math.min(ae[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*(fn.length-1),d=Math.max(xt,(i-l)/2),u=(o-a)/2,m=t.h-xt-l-d;return"top-right"===X?{x:t.x+t.w-a-xt,y:t.y+xt,w:a,h:l}:"top-left"===X?{x:t.x+xt,y:t.y+xt,w:a,h:l}:{x:t.x+Math.max(xt,(o-a)/2+xt)+Math.min(c,Math.max(0,u)),y:t.y+d+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),on=$(!1);t||(on.current=!1);const an=se||u||null;K(()=>{if(!t)return;In(Lt,an,ht.current??void 0),se||Kn(Lt),en.current=!1,At(ar(Lt));const e=()=>{At(ar(Lt))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===se;if(!e.label)return!1;const t=tt.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(Kn(Lt),Ln.current)return;const t=qn(),n=Math.min(Pn.current.w,t.w-40),o=Math.min(Pn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;cn({x:i,y:a,w:n,h:o}),Dn(!1)},i=e=>{const t=e.detail;r(t)&&(Kn(Lt),qe({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==se)return;Kn(Lt);const t=Pn.current,n=function(e,t=qn()){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=tt.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)}cn(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=fn.indexOf(e);-1!==t&&(fn.splice(t,1),kn()),yn.delete(e),bn.delete(e),Mn.delete(e);const n=Cn.get(e);n&&(Cn.delete(e),En.delete(n))}(Lt),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,Lt,an,nn]);const sn=!Q&&"maximized"===mn(),[ln,cn]=W(()=>{if(an&&Zt[an]){const e={...Zt[an]};return ae&&(e.w=ae[0],ne||(e.h=ae[1])),Un(e)}return A?{x:A.x,y:A.y,w:A.w,h:A.h}:sn?nn():rn()}),[dn,wn]=W(()=>!ne),gn=$(he),vn=$(null);K(()=>{const e=()=>{const e=r();e!==gn.current&&vn.current?.(e),gn.current=e,me(e),At(ar(Lt))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[Lt]);const xn=he&&!!Be?.tab&&!ut&&!Q&&!pe,Nn=xn,Ln=$(Nn);Ln.current=Nn;const Tn=Sn(),zn=he&&!!Be?.tab&&!Q&&!pe&&!Kt&&Tn!==Be.key,[An,Dn]=W(()=>an&&Zt[an]||A?Nn:Nn||sn),Pn=$(ln);Pn.current=ln;const $n=$(An);P(()=>{$n.current=An},[An]),P(()=>{if(dn||xn)return;const e=tt.current,t=rt.current;if(!e||!t)return;const n=re??(Q?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 d=e.offsetHeight-t.offsetHeight,u=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=u,t.style.height=m,t.style.overflowY=h;const w=c.offsetHeight>f+4,y=Math.max(n,window.innerHeight-r-Math.max(0,Pn.current.y)-24),g=w?Math.min(Pn.current.h,y):Math.min(Math.max(n,d+p),y),b=Math.abs(g-o)>1;b&&(o=g,cn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),Q||(g<=n?i&&(clearTimeout(i),i=null):(b||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&wn(!0)},160)))},l=new ResizeObserver(s);s(),lt.current&&l.observe(lt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[dn,Q,re,ct,xn]),P(()=>{if(!ne||!dn||Q||!t)return;const e=lt.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||An)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=re??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,Pn.current.y)-24);cn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[ne,dn,Q,t,An,re]);const jn=!1!==oe&&!Q&&!ee&&!pe,[Bn,Xn]=W(()=>!jn);P(()=>{if(Bn||!t)return;if(!jn||An)return void Xn(!0);const n=tt.current,r=rt.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let i=Pn.current.w,c=0;const d=()=>Xn(!0),u=()=>{c=0;const t=Pn.current;if(Math.abs(t.w-i)>1||document.body.classList.contains("rosh-gesturing"))return void d();const u=e(),h=u.w-80;if(t.w>=h)return void d();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 b=s(t,l(t.w,w,g),u,xt);b!==t&&(i=b.w,cn(b))};u();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(u))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(d,hn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Bn,t,jn,An]);const _n=$(null),Qn=!(!Be?.tab||ut||Q||pe);vn.current=t=>{if(!Qn)return;if(t)return _n.current||(_n.current={box:{...Pn.current},maximized:$n.current}),void($n.current=!0);const r=_n.current;_n.current=null;const o=e();if(r?.maximized)return $n.current=!0,Dn(!0),void cn(o);const i=r?.box??(an?Zt[an]:void 0);if($n.current=!1,Dn(!1),i&&!n(i,o,!1)){const e={...i};ae&&(e.w=ae[0],ne||(e.h=ae[1])),cn(Un(e))}else cn(rn())},K(()=>{Nn&&($n.current=!0,Dn(!0),cn(nn()))},[Nn,nn]),K(()=>{if(Q)return;const e=()=>{const e=an?Zt[an]:void 0;if($n.current=!1,Dn(!1),e){const t={...e};ae&&(t.w=ae[0],ne||(t.h=ae[1])),cn(Un(t))}else cn(rn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[Q,rn,an]),K(()=>{t&&an&&!xn&&(Zt[an]=ln,tn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[ln,t,an,xn]),K(()=>{if(!t)return;const e=()=>{$n.current?cn(nn()):document.body.classList.contains("rosh-gesturing")||cn(Un)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return An&&(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,An,nn]),K(()=>{if(t&&(Pe(!1),$e.current=!1,et.current=!1,Xn(!jn),!Ln.current)){if(an&&Zt[an]){const e=Zt[an];return void cn(t=>Un({...e,...ne?{h:t.h}:{},...jn?{x:t.x,w:t.w}:{}}))}A&&(cn({x:A.x,y:A.y,w:A.w,h:A.h}),Dn(A.maximized))}},[t]),K(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{tt.current?.contains(t.target)&&!$e.current&&($e.current=!0,e=setTimeout(()=>Pe(!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 Zn="auto"===m?Ie:!0===m,er=Be&&!ut?Be.key:null,nr=H(()=>Mt(Se),[Se]),dr=$({shortcutSpec:je,isOnDesktop:Ve,toggleDesktopShortcut:_e,taskbarStrings:Te.taskbar});P(()=>{dr.current={shortcutSpec:je,isOnDesktop:Ve,toggleDesktopShortcut:_e,taskbarStrings:Te.taskbar}});const ur=$(null);ur.current||(ur.current={open:(e,t)=>qe({x:e,y:t}),items:()=>{const e=dr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of Bt[Lt]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),K(()=>{t&&er&&function(e,t){const n=St.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.menu===t.menu||(St.set(e,t),zt())}(er,{title:nr.text||Ae,dirty:Zn,copy:nr.copy,menu:ur.current??void 0})},[t,er,Ae,Zn,nr.text,nr.copy]),K(()=>{if(t&&er)return()=>{return e=er,void(St.delete(e)&&zt());var e}},[t,er]),Oe(!(se||!t)&&Zn);const hr=R(async()=>{if(!et.current){if(Zn||"auto"===m&&$e.current){et.current=!0;const e=Ae,t=await E({title:"Discard changes?",message:e?`“${e}” has unsaved changes. Are you sure you want to close? All changes will be lost.`:"You have unsaved changes. Are you sure you want to close? All changes will be lost.",confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});if(et.current=!1,!t)return}i()}},[Zn,m,i,Ae]);P(()=>{if(!t||!wt)return;const e=e=>{e.detail?.windowKey===wt&&hr()};return window.addEventListener(cr,e),()=>window.removeEventListener(cr,e)},[t,wt,hr]);const wr=$(null),yr=R(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(qe(null),Kn(Lt),Ln.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=tt.current,s=a?.getBoundingClientRect();let l,c,d,u;if(wr.current){const t=wr.current;wr.current=null,u=t.w,d=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=`${u}px`,a.style.height=`${d}px`,a.style.left=`${l}px`,a.style.top=`${c}px`)}else l=s?s.left:Pn.current.x,c=s?s.top:Pn.current.y,d=s?s.height:Pn.current.h,u=s?s.width:Pn.current.w;Dn(!1),cn(e=>({...e,x:l,y:c,w:u,h:d}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<or&&Math.abs(e.clientY-i)<or)return;r=ir(t,n,"move","move"),a&&(a.style.transition="none")}const s=l+e.clientX-o,d=Math.max(0,c+e.clientY-i);if(a&&(a.style.transform=`translate(${s-l}px, ${d-c}px)`),Pn.current={...Pn.current,x:s,y:d},!Q){const t=function(e,t){const n=qn(),r=e<=n.x+Rn,o=e>=n.x+n.w-Rn,i=t<=n.y+Rn,a=t>=n.y+n.h-Rn,s=e<=n.x+Fn,l=e>=n.x+n.w-Fn,c=t<=n.y+Fn,d=t>=n.y+n.h-Fn;return i&&s?"tl":i&&l?"tr":a&&s?"bl":a&&l?"br":c&&r?"tl":c&&o?"tr":d&&r?"bl":d&&o?"br":i?"top":r?"left":o?"right":null}(e.clientX,e.clientY);t!==h&&(h=t,t?Jn(Vn(t)):Gn())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),Gn();const e=Un({...Pn.current});if(Pn.current=e,!Q&&h){wr.current={x:l,y:c,w:u,h:d};const e=Vn(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 cn(e)}if(Q){const t=e.x+e.w/2,n=window.innerWidth/2;Ze(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),cn(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),br=R((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=tt.current,l=s?.getBoundingClientRect(),c=l?l.left:Pn.current.x,d=l?l.top:Pn.current.y,u=l?l.width:Pn.current.w,h=l?l.height:Pn.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;Dn(!1),cn({x:c,y:d,w:u,h:h}),Pn.current={x:c,y:d,w:u,h:h};let y=0,g=null;const b=()=>{if(y=0,!g)return;const e=g;g=null,Pn.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},v=e=>{if(!o){if(Math.abs(e.clientX-i)<or&&Math.abs(e.clientY-a)<or)return;o=ir(n,r,rr[t],"resize")}g=((e,t)=>{let n=c,r=d,o=u,i=h;if(f&&(o=Math.max(Hn,u+e)),w&&(i=Math.max(Yn,h+t)),m){const t=Math.max(Hn,u-e);n=c+u-t,o=t}if(p){const e=Math.max(Yn,h-t);r=d+h-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(b))},x=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),b(),o?.(),cn({...Pn.current})};window.addEventListener("pointermove",v),window.addEventListener("pointerup",x)},[]),Er=R(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(),Kn(Lt),"Enter"===e.key)return void(An?(Dn(!1),cn(rn())):(Dn(!0),cn(nn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{wr.current||(wr.current={...Pn.current})};if(r<0)return e(),Dn(!0),void cn(nn());if(r>0){if(An)return Dn(!1),void cn(rn());if(wr.current){const e=Un(wr.current);return wr.current=null,Pn.current=e,void cn(e)}return void Wn(Lt)}e(),Dn(!1);const t=Vn(n<0?"left":"right");return Pn.current=t,void cn(t)}if(An)return;const o=Pn.current,i=e.shiftKey?{...o,w:Math.max(Hn,o.w+24*n),h:Math.max(Yn,o.h+24*r)}:Un({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Pn.current=i,cn(i)},[Lt,An,rn,nn]),Cr=R(e=>{wr.current||(wr.current={...Pn.current}),Dn(!1);const t=Vn(e);Pn.current=t,cn(t),Kn(Lt)},[Lt]),Sr=Nn||Ht?{}:{tabIndex:0,role:"group","aria-label":Ae?`${Ae} — ${ze.windowSuffix}`:ze.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:Er},Lr=()=>{Dn(!0),cn(nn())},Tr=R(()=>{const e=tt.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(Ot);t&&!t.disabled&&t.click()}},[]);K(()=>{if(!t)return;if(Q)return;const e=e=>{if(fn[fn.length-1]===Lt&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Tr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&tt.current?.contains(t)))return;if(t.closest(Rt))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Tr,Lt,Q]),K(()=>{if(!t)return;const e=e=>{fn[fn.length-1]===Lt&&((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:Lt}})),$e.current=!1,Pe(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:Lt}}))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),K(()=>{if(!t)return;if(Q)return;const e=e=>{if("Escape"===e.key&&fn[fn.length-1]===Lt){if(S(e))return e.preventDefault(),void e.stopPropagation();if(xn&&!j)return;e.preventDefault(),e.stopPropagation(),hr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,hr,Lt,Q,xn,j]);const zr=t&&(void 0!==p||void 0!==x),Ar=R(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-white 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(K(()=>{if(!t)return;const e=e=>{if(fn[fn.length-1]!==Lt)return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&zr&&(e.preventDefault(),p?p():Ar("bottom")),"k"===e.key&&zr&&(e.preventDefault(),x?x():Ar("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,x,zr,Ar,Lt]),!t||on.current)return null;const Dr=Ht?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,d=qn(),u=(d.w-20*(o+1))/o,h=(d.h-14*(i+1)-22*i)/i,m=c?(o-l)*(u+20)/2:0;return{x:d.x+20+s*(u+20)+m,y:d.y+14+a*(h+14+22),w:u,h:h}}(Lt):null,Ir=Ht&&Dr?Math.min(Dr.w/ln.w,Dr.h/ln.h):1,Pr=(()=>{if(Ht&&Dr){const e=Ir,t=ln.w*e,n=ln.h*e,r=Dr.x+(Dr.w-t)/2-ln.x,o=Dr.y+(Dr.h-n)/2-ln.y,i=Yt||Vt;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:N.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(_t&&jt){const e="picked"===Gt;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:N.expose+30}:{}}}return null})(),$r=C({modal:!1,titleId:!Q&&(xn?!Be?.home:!pe)?De:void 0,label:nr.text||Ae}),Kr=/* @__PURE__ */V("div",{children:[
50
- /* @__PURE__ */V("div",{ref:tt,"data-modal-panel":!0,"data-modal-id":Lt,"data-window-key":se||void 0,...U?{"data-utility":""}:{},...Ke?{"data-pinned-top":""}:{},...Q?{"data-widget":""}:{},...Be?{"data-window-owner":Be.key}:{},...Be&&!ut?{"data-window-root":""}:{},...xn?{"data-window-tab":""}:{},...$r,className:xn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(Q?Dt?"shadow-xl":"shadow-lg":"border "+(Dt?"shadow-xl border-gray-200":"shadow-lg border-gray-300")),onMouseDownCapture:e=>{if(nt.current=!1,Ht){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),kr(Lt),fr(!1),void Kn(Lt)}if(!Dt&&!Q&&!Ke&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===tt.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),nt.current=!0,qe(null),Kn(Lt),window.addEventListener("mouseup",()=>{setTimeout(()=>{nt.current=!1},0)},{once:!0}))}},onClickCapture:e=>{nt.current&&(nt.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(Ht)return;qe(null);e.target.closest("[data-modal-panel]")===tt.current&&(e.target.closest("button, input, a, select, textarea")||Kn(Lt))},style:pe?{zIndex:Tt+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${we}px)`,transition:ge?"none":"transform 180ms ease-out",...Q?{display:"none"}:{},...Tt<0?{display:"none"}:{},...Dt||Ke||Ne&&se===Ne?{}:{display:"none"}}:{zIndex:Ke?N.pinnedWindow:Tt+1,width:ln.w,height:ln.h,top:ln.y,...Q&&"right"===Qe?{right:window.innerWidth-ln.x-ln.w}:{left:ln.x},...Tt<0&&!Ke?{display:"none"}:{},...fe?{display:"none"}:{},...zn?{visibility:"hidden",pointerEvents:"none"}:{},...Pr??{}},children:[pe&&!Q&&/* @__PURE__ */_("div",{onPointerDown:Me,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),Q?null:xn?Be?.home?null:/* @__PURE__ */V(J,{children:[
51
- /* @__PURE__ */_("h2",{id:De,"data-window-title":!0,className:"sr-only",children:nr.text||Ae}),(nr.accessories.length>0||zr)&&/* @__PURE__ */V("div",{"data-window-chrome":"","data-record-bar":"",className:"flex h-9 shrink-0 select-none items-center gap-3 border-b border-gray-200 px-4",style:{backgroundColor:"rgb(var(--window-content-rgb))"},children:[
52
- /* @__PURE__ */_("div",{className:"flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:nr.accessories}),zr&&/* @__PURE__ */V("span",{className:"flex items-center gap-1 shrink-0 text-2xs text-gray-400",children:[
53
- /* @__PURE__ */_("kbd",{className:"rounded border border-gray-300 bg-gray-100 px-2 py-0.5 font-medium text-gray-500",children:"K"}),
54
- /* @__PURE__ */_("span",{children:ze.prev}),
55
- /* @__PURE__ */_("kbd",{className:"rounded border border-gray-300 bg-gray-100 px-2 py-0.5 font-medium ml-1 text-gray-500",children:"J"}),
56
- /* @__PURE__ */_("span",{children:ze.next})]})]})]}):pe?null:
57
- /* @__PURE__ */V("div",Z?{onPointerDown:yr,"data-window-chrome":"",...Sr,className:"flex items-center justify-between h-(--row-height-compact-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 "+(Dt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Dt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
58
- /* @__PURE__ */V("div",{"data-window-title":!0,title:Ae,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Dt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Ht&&vt(),
59
- /* @__PURE__ */_("span",{id:De,className:"truncate",children:Ht?Ft(Se):Se})]}),!Ht&&/* @__PURE__ */V("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[U&&/* @__PURE__ */_("button",{onClick:()=>We(e=>!e),title:Ke?ze.unpin:ze.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(Ke?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */_(L,{name:"bookmark-square",className:"h-3 w-3",fill:Ke?"currentColor":"none",strokeWidth:1.5})}),
60
- /* @__PURE__ */_("button",{type:"button",onClick:hr,className:"rounded p-0.5 text-gray-400 hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */_(L,{name:"close",className:"h-4 w-4"})})]})]}:ee?{onPointerDown:yr,"data-window-chrome":"",...Sr,className:"flex items-center justify-between h-(--row-height-compact-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 "+(Dt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Dt?"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__ */V("div",{"data-window-title":!0,title:Ae,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Dt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Ht&&vt(),
62
- /* @__PURE__ */_("span",{id:De,className:"truncate",children:Ht?Ft(Se):Se})]}),!Ht&&/* @__PURE__ */V("div",{className:"flex items-center gap-0.5 shrink-0 ml-2",children:[U&&/* @__PURE__ */_("button",{onClick:()=>We(e=>!e),title:Ke?ze.unpin:ze.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(Ke?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */_(L,{name:"bookmark-square",className:"h-3 w-3",fill:Ke?"currentColor":"none",strokeWidth:1.5})}),
63
- /* @__PURE__ */_("button",{onClick:()=>Wn(Lt),title:ze.minimize,className:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",children:"─"}),!Nn&&/* @__PURE__ */_(tr,{maximized:An,onToggleMax:()=>{An?(Dn(!1),cn(rn())):Lr()},onSnap:Cr,buttonClassName:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",strings:ze}),
64
- /* @__PURE__ */_("button",{type:"button",onClick:hr,className:"rounded p-0.5 text-gray-400 hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */_(L,{name:"close",className:"h-4 w-4"})})]})]}:{onPointerDown:yr,"data-window-chrome":"",...Sr,className:"flex items-center justify-between h-(--row-height-window-bar) px-4 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 "+(Dt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Dt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
65
- /* @__PURE__ */V("div",{"data-window-title":!0,title:Ae,className:"text-base font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Dt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Ht&&vt(),
66
- /* @__PURE__ */_("span",{id:De,className:"truncate",children:Ht?Ft(Se):Se})]}),!Ht&&/* @__PURE__ */V("div",{className:"flex items-center gap-2 shrink-0 ml-4",children:[zr&&/* @__PURE__ */V("span",{className:"flex items-center gap-1 mr-1 text-2xs text-gray-400",children:[
67
- /* @__PURE__ */_("kbd",{className:"rounded border border-gray-300 bg-gray-200 px-2 py-0.5 font-medium text-gray-500",children:"K"}),
68
- /* @__PURE__ */_("span",{children:ze.prev}),
69
- /* @__PURE__ */_("kbd",{className:"rounded border border-gray-300 bg-gray-200 px-2 py-0.5 font-medium ml-1 text-gray-500",children:"J"}),
70
- /* @__PURE__ */_("span",{children:ze.next})]}),U&&/* @__PURE__ */_("button",{onClick:()=>We(e=>!e),title:Ke?ze.unpin:ze.pinOnTop,className:"text-xs px-2 py-1 rounded hover:bg-gray-200 "+(Ke?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */_(L,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:Ke?"currentColor":"none",strokeWidth:1.5})}),
71
- /* @__PURE__ */_("button",{onClick:()=>Wn(Lt),title:ze.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!Nn&&/* @__PURE__ */_(tr,{maximized:An,onToggleMax:()=>{An?(Dn(!1),cn(rn())):Lr()},onSnap:Cr,buttonClassName:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",strings:ze}),
72
- /* @__PURE__ */_("kbd",{className:"rounded border border-gray-300 bg-gray-200 px-2 py-0.5 text-2xs font-medium text-gray-400",children:"ESC"}),
73
- /* @__PURE__ */_("button",{type:"button",onClick:hr,className:"rounded-(--radius-control) text-gray-400 hover:text-gray-600",children:/* @__PURE__ */_(L,{name:"close",className:"h-5 w-5"})})]})]}),ce&&Ue&&!Q&&!pe&&/* @__PURE__ */_("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${Dt?.9:.55})`}}),
74
- /* @__PURE__ */_(Pt.Provider,{value:Lt,children:/* @__PURE__ */_(Xt.Provider,{value:{rightRef:ot,leftRef:it,notify:()=>st(!0),active:Dt,isDirty:Zn,footerOpen:ct&&!Q&&!Z&&!ee&&!pe},children:/* @__PURE__ */_("div",{ref:rt,...Q?{onPointerDown:yr,onContextMenu:e=>{e.preventDefault(),Ge({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${Q?"p-0 cursor-move":ee||te?"p-0":Z?"p-2":"p-4"} ${Q||xn?"":"backdrop-blur-sm"} ${!1===M||ee||te?"overflow-hidden":"overflow-y-auto overscroll-contain"} ${Q?"rounded-2xl select-none":""}`,style:{...Q?{touchAction:"none"}:{},backgroundColor:Q?"transparent":xn?"rgb(var(--window-content-rgb))":Dt?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */_(be,{children:de})})})}),Q&&Je&&/* @__PURE__ */V(g,{minWidth:160,style:{left:Je.x,top:Je.y},onClose:()=>Ge(null),children:[
75
- /* @__PURE__ */_(b,{onClick:()=>{Ge(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:Lt}))},children:"Settings"}),
76
- /* @__PURE__ */_(v,{}),ie&&/* @__PURE__ */V(J,{children:[ie,
77
- /* @__PURE__ */_(v,{})]}),
78
- /* @__PURE__ */V(b,{onClick:()=>{Ge(null),We(e=>!e)},children:[
79
- /* @__PURE__ */_("span",{className:"flex-1",children:"Always on Top"}),Ke&&/* @__PURE__ */_(L,{name:"check",className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
80
- /* @__PURE__ */_(v,{}),
81
- /* @__PURE__ */_(b,{onClick:()=>{Ge(null),hr()},children:"Close"})]}),
82
- /* @__PURE__ */V("div",{onPointerDown:yr,ref:lt,className:`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${xn?"":" cursor-move"}${Dt&&!xn?" backdrop-blur-sm":""}${Q||Z||ee||pe||!ct?" hidden":""}`,style:{touchAction:"none",backgroundColor:xn?"rgb(var(--window-footer-rgb))":Dt?"rgb(var(--window-footer-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-footer-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
83
- /* @__PURE__ */V("div",{className:"flex items-center gap-2 min-w-0",children:[yt&&/* @__PURE__ */_(ke,{auto:!0}),q,
84
- /* @__PURE__ */_("div",{ref:it,"data-modal-actions-left":!0,className:"flex items-center gap-2"}),k]}),
85
- /* @__PURE__ */V("div",{className:"flex items-center gap-2 ml-auto",children:[
86
- /* @__PURE__ */_("div",{ref:ot,"data-modal-actions":!0,className:"flex items-center gap-2"}),I]})]}),!Q&&!pe&&!Ht&&Dt&&!Nn&&/* @__PURE__ */V(J,{children:[
87
- /* @__PURE__ */_("div",{onPointerDown:e=>br(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
88
- /* @__PURE__ */_("div",{onPointerDown:e=>br(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
89
- /* @__PURE__ */_("div",{onPointerDown:e=>br(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
90
- /* @__PURE__ */_("div",{onPointerDown:e=>br(e,"nw"),className:"absolute top-0 left-0 w-3 h-3 cursor-nwse-resize z-10"}),
91
- /* @__PURE__ */_("div",{onPointerDown:e=>br(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
92
- /* @__PURE__ */_("div",{onPointerDown:e=>br(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
93
- /* @__PURE__ */_("div",{onPointerDown:e=>br(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
94
- /* @__PURE__ */_("div",{onPointerDown:e=>br(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),Ht&&/* @__PURE__ */_("div",{className:"absolute inset-0",style:{zIndex:N.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>Ut(!0),onMouseLeave:()=>Ut(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),Kn(Lt),fr(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:Yt&&/* @__PURE__ */_("button",{type:"button","data-expose-close":!0,"aria-label":Te.taskbar.closeWindow,title:"Close",className:"absolute flex items-center justify-center rounded-full bg-black/55 text-white 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/Ir})`,transformOrigin:"top right",zIndex:N.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),hr()},children:/* @__PURE__ */_(L,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),Ht&&Dr&&/* @__PURE__ */_("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:Dr.x,top:Dr.y+Dr.h+4,width:Dr.w,zIndex:N.expose+(Yt?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:Ft(Se)})]}),Wr=Re&&/* @__PURE__ */V(g,{style:{left:Re.x,top:Re.y},onClose:()=>qe(null),minWidth:160,children:[!Q&&!Z&&!xn&&/* @__PURE__ */V(J,{children:[
95
- /* @__PURE__ */V(b,{onClick:()=>{Wn(Lt),qe(null)},children:[
96
- /* @__PURE__ */_(L,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),ze.minimize]}),!Nn&&/* @__PURE__ */V(b,An?{onClick:()=>{Dn(!1),cn(rn()),qe(null)},children:[
97
- /* @__PURE__ */_("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */_("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 4.5v15m6-15v15M4.5 9h15M4.5 15h15"})}),ze.windowed]}:{onClick:()=>{Lr(),qe(null)},children:[
98
- /* @__PURE__ */_(L,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),ze.maximize]})]}),U&&!xn&&/* @__PURE__ */V(b,{onClick:()=>{We(e=>!e),qe(null)},children:[
99
- /* @__PURE__ */_(L,{name:"bookmark-square",className:"h-4 w-4 "+(Ke?"text-blue-600":""),fill:Ke?"currentColor":"none",strokeWidth:1.5}),Ke?ze.unpin:ze.pinOnTop]}),je&&/* @__PURE__ */V(b,{onClick:()=>{qe(null),_e()},children:[
100
- /* @__PURE__ */_(L,{name:"star",className:"h-4 w-4",fill:Ve?"currentColor":"none",strokeWidth:1.5}),Ve?Te.taskbar.removeFromDesktop:Te.taskbar.addToDesktop]}),(Bt[Lt]||[]).length>0&&/* @__PURE__ */_(J,{children:(Bt[Lt]||[]).map((e,t)=>/* @__PURE__ */V(b,{onClick:()=>{qe(null),e.onClick()},children:[e.icon,e.label]},t))}),!(xn&&Be?.home)&&/* @__PURE__ */V(J,{children:[
101
- /* @__PURE__ */_(v,{}),
102
- /* @__PURE__ */V(b,{danger:!0,onClick:()=>{qe(null),hr()},children:[
103
- /* @__PURE__ */_(L,{name:"close",className:"h-4 w-4"}),ze.close]})]})]}),Or=!!se&&Nt.some(e=>e.id===se),Rr=!It||Or||Q?null:/* @__PURE__ */V("div",{"data-modal-restore-tab":!0,"data-modal-id":Lt,className:"fixed left-1/2 z-(--z-restore-tab) flex -translate-x-1/2 items-center gap-1 rounded-lg border border-gray-300 bg-white px-2 py-1 shadow-lg",style:{bottom:"calc(var(--taskbar-height, 0px) + 12px)"},children:[
104
- /* @__PURE__ */_("button",{type:"button",onClick:()=>Kn(Lt),title:ze.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:Ae||ze.windowSuffix}),
105
- /* @__PURE__ */_("button",{type:"button",onClick:()=>Kn(Lt),title:ze.restore,"aria-label":ze.restore,className:"rounded px-2 py-0.5 text-xs leading-none text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:"▴"}),
106
- /* @__PURE__ */_("button",{type:"button",onClick:()=>{hr()},title:ze.close,"aria-label":ze.close,className:"rounded px-2 py-0.5 text-xs leading-none text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:"✕"})]});return G(
107
- /* @__PURE__ */V($t.Provider,{value:null,children:[Kr,Wr,Rr]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{ur&&"Escape"===e.key&&(Sr(null),fr(!1))});var Dr=100,Ir={past:[],future:[]};function Pr(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>Dr?r.slice(r.length-Dr):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:Ir}}var $r=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var Kr=500,Wr=250;function Or({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,a]=U(Pr,Ir),s=$(/* @__PURE__ */new Map),[l,c]=W(0),d=l>0,[u,h]=W(0),[m,p]=W(0),f=m>0,{hasAnyPerm:w}=i(),y=t&&0===u&&(!(n&&n.length>0)||w(n)),g=$(null),b=$(!1),v=R(()=>{const e={};for(const[t,n]of s.current)e[t]=n.getLast();return e},[]),x=R((e,t)=>{s.current.has(e)||c(e=>e+1),s.current.set(e,t)},[]),k=R(e=>{s.current.delete(e)&&c(e=>e-1)},[]),E=R(e=>{h(t=>t+(e?1:-1))},[]),C=R(e=>{p(t=>t+(e?1:-1))},[]),[M,N]=W(0),S=M>0,L=R(e=>{N(t=>t+(e?1:-1))},[]),T=D(ve),z=T?.claimReadOnly;K(()=>{if(z&&!y)return z(!0),()=>z(!1)},[z,y]);const A=T?.claimOwnMount;K(()=>{if(A&&S)return A(!0),()=>A(!1)},[A,S]);const I=$({last:0,count:0,tripped:!1}),P=$(!1),O=R((e,t,n)=>{if(b.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=I.current;if(r.tripped)return;const o=Date.now();if(o-r.last>Wr&&(r.count=0),r.last=o,++r.count>Kr)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${Kr} 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:v(),label:e,coalesceKey:t},queueMicrotask(()=>{const e=g.current;g.current=null,e&&a({type:"record",step:e})})},[y,v]),F=R(e=>{for(const[t,n]of Object.entries(e)){const e=s.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),q=R(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};F(e.values),a({type:"undo",redoStep:t})},[o.past,v,F]),j=R(()=>{const e=o.future[0];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};F(e.values),a({type:"redo",undoStep:t})},[o.future,v,F]),[B,Y]=W(0),X=$(0),J=$(0),G=$(!1),Q=R(()=>{b.current=!0,P.current=!1,g.current=null,X.current+=1,J.current=X.current,Y(X.current)},[]),Z=$(void 0),ee=R(e=>{void 0!==e&&(void 0!==Z.current&&e!==Z.current&&(G.current=!0),Z.current=e),Q()},[Q]);K(()=>{b.current&&B===J.current&&(b.current=!1,g.current=null,(P.current||G.current)&&a({type:"clear"}),P.current=!1,G.current=!1)},[B]);const te=R(()=>{G.current=!0,a({type:"clear"}),Q()},[Q]),ne=y&&o.past.length>0,re=y&&o.future.length>0,oe=dr(r),ie=$({undo:q,redo:j,canUndo:ne,canRedo:re});ie.current={undo:q,redo:j,canUndo:ne,canRedo:re},K(()=>{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&&$r.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=H(()=>({register:x,unregister:k,record:O,undo:q,redo:j,clear:te,baseline:ee,canUndo:ne,canRedo:re,enabled:y,hasState:d,handMounted:S,claimOwnMount:L,claimReadOnly:E,declaredEditable:f,claimEditable:C,undoLabel:ne?o.past[o.past.length-1].label:null,redoLabel:re?o.future[0].label:null}),[x,k,O,q,j,te,ee,ne,re,y,d,S,L,E,f,C,o.past,o.future]),se=""!==Vt(),le=D(Xt)?.footerOpen??!1,ce=se&&y&&d&&!S&&le;/* @__PURE__ */
108
- return V(ve.Provider,{value:ae,children:[ce&&/* @__PURE__ */_(Jt,{position:"left",quiet:!0,children:/* @__PURE__ */_(ke,{auto:!0})}),e]})}function Rr(){const e=D(ve),t=R(()=>{},[]);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 Fr(e){const t=D(ve),n=t?.claimReadOnly,r=t?.claimEditable;K(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function qr(e,t,n){const r=D(ve),o=Y(),i=$(e),a=$(t);a.current=t,K(()=>{if(r)return r.register(o,{getLast:()=>i.current,setLast:e=>{i.current=e},apply:e=>a.current(e)}),()=>r.unregister(o)},[r,o]);const{label:s,coalesceKey:l=null}=n,c=$(r);c.current=r;const d=$({label:s,coalesceKey:l});d.current={label:s,coalesceKey:l},K(()=>{const t=c.current;t&&(Object.is(e,i.current)||(t.record(d.current.label,d.current.coalesceKey,{prev:i.current,next:e}),i.current=e))},[e])}function jr(e,t){const[n,r]=W(e);return qr(n,e=>r(()=>e),t),[n,r]}export{Gt as CancelButton,Be as DocFavStar,Ae as EntityWindowFallback,Te as EntityWindowLoading,De as EntityWindowState,Rt as KEY_ACTIVATED_SELECTOR,Se as LoadingSpinner,Ot as MODAL_SUBMIT_SELECTOR,Ar as Modal,Jt as ModalActions,ke as UndoControls,Or as UndoProvider,ie as WINDOW_REGISTRY,ge as WindowCrashedFallback,be as WindowErrorBoundary,dt as WindowManagerProvider,Yt as WindowTitle,Ve as activateWindowById,xt as beginWindowGesture,Dn as cancelWindowFront,de as client_default,Lr as commitExposeHighlight,kt as drainPerfEvents,yr as exitExposeMode,dn as forgetMaximizedWindowBoxes,sr as getActiveModalId,Qe as getActiveWindowRoute,Nr as getExposeHighlight,It as getWindowChromeVersion,ln as getWindowPosition,Pe as isDraftEntityId,$e as isDraftEntityWindow,ne as isEntityEntry,te as isPageEntry,le as isShellApiClientConfigured,_e as isTabWindow,vt as markMenuOpen,At as readWindowChrome,An as requestWindowFront,Sr as setExposeHighlight,bt as setPerfCollecting,se as setShellApiClient,fe as setShellHomeRoute,oe as setShellWindowRegistry,sn as setWindowDefaultPosition,cn as setWindowPosition,Mt as splitTitle,Mr as subscribeExposeHighlight,Dt as subscribeWindowChrome,wr as toggleExposeMode,Sn as useCurrentTabKey,Vt as useEnclosingModalId,dr as useIsActiveWindow,_t as useModalActive,he as usePageSearch,Rr as useUndo,Fr as useUndoCanEdit,qr as useUndoable,jr as useUndoableState,jt as useWidgetSettings,Oe as useWindowDirty,Fe as useWindowManager,Ht as useWindowMenuItem,Ut as useWindowTitle};