@nextclaw/ui 0.20.3 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/assets/{api-iMkU_o5P.js → api-m33O1Kb0.js} +6 -6
  3. package/dist/assets/{appearance-settings-page-CU5k4b-M.js → appearance-settings-page-x4Vjnfmz.js} +1 -1
  4. package/dist/assets/{book-open-nD8gdMhA.js → book-open-BHiasMCg.js} +1 -1
  5. package/dist/assets/{channels-list-page-Drlt62kY.js → channels-list-page-DOxJZeXq.js} +2 -2
  6. package/dist/assets/{config-split-page-BtJZp1E5.js → config-split-page-DBnMEP1o.js} +1 -1
  7. package/dist/assets/{confirm-dialog-k2-Jq_x3.js → confirm-dialog-f5NKLh5I.js} +2 -2
  8. package/dist/assets/{createLucideIcon-DxlwKLr-.js → createLucideIcon-CHALGA42.js} +1 -1
  9. package/dist/assets/desktop-capabilities-page-DixayAe6.js +1 -0
  10. package/dist/assets/desktop-update-config-ChhfeOHj.js +1 -0
  11. package/dist/assets/{dist-Cy_e4kNb.js → dist-_UMsWSY0.js} +1 -1
  12. package/dist/assets/{dist-m08DUswB.js → dist-sD6V4nHX.js} +1 -1
  13. package/dist/assets/doc-browser-Bq7LJsQY.js +1 -0
  14. package/dist/assets/doc-browser-BuDgpY2e.js +1 -0
  15. package/dist/assets/{doc-browser-context-jiy-O4F8.js → doc-browser-context-Capim3og.js} +1 -1
  16. package/dist/assets/{extensions-CIb17__o.js → extensions-Bdclr3Wr.js} +1 -1
  17. package/dist/assets/{form-actions-DGf5zUg_.js → form-actions-CH0kWhEt.js} +1 -1
  18. package/dist/assets/index-BjxnLYE3.js +109 -0
  19. package/dist/assets/index-CBmwJjwE.css +1 -0
  20. package/dist/assets/loader-circle-CH_0iPLy.js +1 -0
  21. package/dist/assets/mcp-marketplace-page-BUsxLVB5.js +10 -0
  22. package/dist/assets/mcp-marketplace-page-GPRV3fB0.js +1 -0
  23. package/dist/assets/model-config-page-CIevwqp4.js +1 -0
  24. package/dist/assets/{navigation-link-DAfwFCj4.js → navigation-link-CAUiM3zS.js} +1 -1
  25. package/dist/assets/plus-B3obD55V.js +1 -0
  26. package/dist/assets/privacy-settings-page-CNKfZsYH.js +1 -0
  27. package/dist/assets/providers-config-page-DAah2NIS.js +1 -0
  28. package/dist/assets/react-Co6JiC1n.js +8 -0
  29. package/dist/assets/{refresh-cw-D_Eibznw.js → refresh-cw-BG_LX3SS.js} +1 -1
  30. package/dist/assets/remote-DuscgfvR.js +1 -0
  31. package/dist/assets/{rotate-cw-QQjmoWuq.js → rotate-cw-Cz7I_m7O.js} +1 -1
  32. package/dist/assets/runtime-config-page-Cl1RpmSC.js +1 -0
  33. package/dist/assets/{save-W2xthJJ2.js → save-BiHnb8ps.js} +1 -1
  34. package/dist/assets/{search-Vih1R2BD.js → search-C47TyRg0.js} +1 -1
  35. package/dist/assets/{search-config-page-CtBcL2uc.js → search-config-page-BAIzd6gN.js} +1 -1
  36. package/dist/assets/{secrets-config-page-Q6XfIj0h.js → secrets-config-page-Ddi-n43R.js} +2 -2
  37. package/dist/assets/security-config-C8MHnE1r.js +1 -0
  38. package/dist/assets/{select-lNdozU4o.js → select-BzQKfW1e.js} +2 -2
  39. package/dist/assets/skeleton-BXFAE9SE.js +1 -0
  40. package/dist/assets/{tag-chip-gdaU9bE7.js → tag-chip-C3K814HZ.js} +1 -1
  41. package/dist/assets/x-C1r9IXet.js +1 -0
  42. package/dist/index.html +29 -21
  43. package/dist/themes/island/island-atmosphere.webp +0 -0
  44. package/index.html +8 -0
  45. package/package.json +8 -8
  46. package/public/themes/island/island-atmosphere.webp +0 -0
  47. package/src/app/components/layout/header.tsx +4 -1
  48. package/src/app/components/layout/page-layout.tsx +4 -1
  49. package/src/app/components/layout/sidebar.tsx +6 -1
  50. package/src/app/configs/app-navigation.config.ts +17 -2
  51. package/src/app/hooks/use-feature-controls.ts +11 -0
  52. package/src/app/index.tsx +10 -0
  53. package/src/app/styles/island-theme.css +542 -0
  54. package/src/features/chat/components/conversation/__tests__/chat-conversation-header.test.tsx +1 -0
  55. package/src/features/chat/components/conversation/chat-conversation-header.tsx +5 -1
  56. package/src/features/chat/components/conversation/chat-conversation-panel.tsx +4 -1
  57. package/src/features/chat/components/layout/__tests__/chat-sidebar-toolbar.test.tsx +10 -0
  58. package/src/features/chat/components/layout/chat-page-shell.tsx +4 -1
  59. package/src/features/chat/components/layout/chat-sidebar-toolbar.tsx +2 -0
  60. package/src/features/chat/components/layout/chat-sidebar.tsx +2 -0
  61. package/src/features/chat/features/session/components/__tests__/chat-sidebar-session-item.test.tsx +12 -0
  62. package/src/features/chat/features/session/components/chat-sidebar-session-entry.tsx +3 -0
  63. package/src/features/chat/features/session/components/chat-sidebar-session-item.tsx +14 -1
  64. package/src/features/chat/features/session/utils/chat-session-deletion.utils.ts +25 -0
  65. package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel.test.tsx +1 -0
  66. package/src/features/chat/features/workspace/components/chat-session-workspace-panel-content.tsx +1 -0
  67. package/src/features/chat/features/workspace/components/chat-session-workspace-panel.tsx +1 -0
  68. package/src/features/chat/managers/__tests__/chat-thread-deletion.manager.test.ts +125 -0
  69. package/src/features/chat/managers/__tests__/chat-thread.manager.test.ts +0 -37
  70. package/src/features/chat/managers/chat-thread.manager.ts +17 -28
  71. package/src/features/desktop-capabilities/components/desktop-authorization-dialog.test.tsx +58 -0
  72. package/src/features/desktop-capabilities/components/desktop-authorization-dialog.tsx +161 -0
  73. package/src/features/desktop-capabilities/hooks/use-desktop-capabilities.test.ts +10 -0
  74. package/src/features/desktop-capabilities/hooks/use-desktop-capabilities.ts +55 -0
  75. package/src/features/desktop-capabilities/index.ts +1 -0
  76. package/src/features/desktop-capabilities/managers/desktop-capability.manager.ts +25 -0
  77. package/src/features/desktop-capabilities/pages/desktop-capabilities-page.test.tsx +44 -0
  78. package/src/features/desktop-capabilities/pages/desktop-capabilities-page.tsx +171 -0
  79. package/src/features/desktop-capabilities/stores/desktop-authorization.store.ts +21 -0
  80. package/src/features/marketplace/components/mcp/__tests__/mcp-connection-dialog.test.tsx +23 -0
  81. package/src/features/marketplace/components/mcp/mcp-connection-dialog.tsx +35 -0
  82. package/src/features/marketplace/components/mcp/mcp-marketplace-page.tsx +20 -2
  83. package/src/features/pwa/managers/__tests__/pwa-shell-theme.manager.test.ts +9 -0
  84. package/src/features/pwa/managers/pwa-shell-theme.manager.ts +1 -0
  85. package/src/features/service-apps/components/__tests__/service-apps-panel.test.tsx +35 -1
  86. package/src/features/service-apps/components/service-action-row.tsx +130 -0
  87. package/src/features/service-apps/components/service-app-list-item.tsx +11 -66
  88. package/src/features/service-apps/components/service-apps-panel.tsx +12 -0
  89. package/src/features/service-apps/hooks/use-service-apps.ts +20 -1
  90. package/src/features/settings/pages/__tests__/appearance-settings-page.test.tsx +2 -2
  91. package/src/features/side-dock/components/side-dock.tsx +1 -0
  92. package/src/index.css +1 -0
  93. package/src/platforms/desktop/components/__tests__/desktop-app-shell.test.tsx +8 -0
  94. package/src/platforms/desktop/components/desktop-app-shell.tsx +56 -2
  95. package/src/platforms/desktop/components/desktop-window-chrome.tsx +1 -0
  96. package/src/platforms/mobile/components/mobile-settings-shell.tsx +5 -1
  97. package/src/shared/components/doc-browser/__tests__/doc-browser.test.tsx +3 -0
  98. package/src/shared/components/doc-browser/doc-browser.tsx +2 -0
  99. package/src/shared/components/ui/__tests__/confirm-dialog.test.tsx +31 -0
  100. package/src/shared/components/ui/confirm-dialog.tsx +11 -1
  101. package/src/shared/components/ui/context-menu/context-menu.tsx +1 -0
  102. package/src/shared/components/ui/dialog.tsx +2 -0
  103. package/src/shared/components/ui/overlays/sheet.tsx +2 -0
  104. package/src/shared/components/ui/popover.tsx +1 -0
  105. package/src/shared/components/ui/select.tsx +1 -0
  106. package/src/shared/components/ui/tooltip.tsx +1 -0
  107. package/src/shared/lib/api/index.ts +1 -0
  108. package/src/shared/lib/api/utils/mcp-connection.utils.ts +10 -0
  109. package/src/shared/lib/i18n/locales/en-US/chat.json +2 -0
  110. package/src/shared/lib/i18n/locales/en-US/core.json +44 -0
  111. package/src/shared/lib/i18n/locales/en-US/doc-browser.json +1 -0
  112. package/src/shared/lib/i18n/locales/en-US/marketplace.json +29 -1
  113. package/src/shared/lib/i18n/locales/zh-CN/chat.json +2 -0
  114. package/src/shared/lib/i18n/locales/zh-CN/core.json +44 -0
  115. package/src/shared/lib/i18n/locales/zh-CN/doc-browser.json +1 -0
  116. package/src/shared/lib/i18n/locales/zh-CN/marketplace.json +29 -1
  117. package/src/shared/lib/theme/index.test.ts +9 -0
  118. package/src/shared/lib/theme/index.ts +2 -0
  119. package/dist/assets/desktop-update-config-BiZmy7FC.js +0 -1
  120. package/dist/assets/doc-browser-CPsPHh12.js +0 -1
  121. package/dist/assets/doc-browser-npOvWtgf.js +0 -1
  122. package/dist/assets/index-C86hxgv5.css +0 -1
  123. package/dist/assets/index-CYBXR7zN.js +0 -109
  124. package/dist/assets/loader-circle-BlLuRFVW.js +0 -1
  125. package/dist/assets/mcp-marketplace-page-B12JNh7Q.js +0 -1
  126. package/dist/assets/mcp-marketplace-page-kLWW6kzt.js +0 -9
  127. package/dist/assets/model-config-page-DSeAjVT_.js +0 -1
  128. package/dist/assets/plus-D4LtWtTk.js +0 -1
  129. package/dist/assets/privacy-settings-page-tN0Mt15x.js +0 -1
  130. package/dist/assets/providers-config-page-CgPrXR1u.js +0 -1
  131. package/dist/assets/react-8iBFECZE.js +0 -8
  132. package/dist/assets/remote-Derr_AQp.js +0 -1
  133. package/dist/assets/runtime-config-page-Crq96Jjq.js +0 -1
  134. package/dist/assets/security-config-CE9rkQvq.js +0 -1
  135. package/dist/assets/skeleton-B__aTcly.js +0 -1
  136. package/dist/assets/x-CWdWBu_U.js +0 -1
@@ -18,6 +18,7 @@ const DialogOverlay = React.forwardRef<
18
18
  >(({ className, ...props }, ref) => (
19
19
  <DialogPrimitive.Overlay
20
20
  ref={ref}
21
+ data-theme-overlay="modal-backdrop"
21
22
  className={cn(
22
23
  "fixed inset-0 z-[var(--z-modal-backdrop,10000)] bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
23
24
  className
@@ -35,6 +36,7 @@ const DialogContent = React.forwardRef<
35
36
  <DialogOverlay />
36
37
  <DialogPrimitive.Content
37
38
  ref={ref}
39
+ data-theme-overlay="dialog"
38
40
  className={cn(
39
41
  "fixed left-[50%] top-[50%] z-[var(--z-modal,10050)] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-2xl border border-border bg-popover p-6 text-popover-foreground shadow-xl duration-base data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
40
42
  className
@@ -16,6 +16,7 @@ const SheetOverlay = React.forwardRef<
16
16
  >(({ className, ...props }, ref) => (
17
17
  <SheetPrimitive.Overlay
18
18
  ref={ref}
19
+ data-theme-overlay="modal-backdrop"
19
20
  className={cn(
20
21
  "fixed inset-0 z-[var(--z-modal-backdrop,10000)] bg-black/35 backdrop-blur-[1px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
21
22
  className,
@@ -59,6 +60,7 @@ const SheetContent = React.forwardRef<
59
60
  <SheetOverlay />
60
61
  <SheetPrimitive.Content
61
62
  ref={ref}
63
+ data-theme-overlay="sheet"
62
64
  className={cn(sheetVariants({ side }), className)}
63
65
  {...props}
64
66
  >
@@ -24,6 +24,7 @@ const PopoverContent = React.forwardRef<
24
24
  <PopoverPrimitive.Portal>
25
25
  <PopoverPrimitive.Content
26
26
  ref={ref}
27
+ data-theme-overlay="popover"
27
28
  sideOffset={sideOffset}
28
29
  align={align}
29
30
  collisionPadding={collisionPadding}
@@ -77,6 +77,7 @@ const SelectContent = React.forwardRef<
77
77
  <SelectPrimitive.Portal>
78
78
  <SelectPrimitive.Content
79
79
  ref={ref}
80
+ data-theme-overlay="select"
80
81
  className={cn(
81
82
  "relative z-[var(--z-popover,10100)] flex max-h-96 min-w-[8rem] flex-col overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
82
83
  position === "popper" &&
@@ -31,6 +31,7 @@ const TooltipContent = React.forwardRef<
31
31
  <TooltipPrimitive.Portal>
32
32
  <TooltipPrimitive.Content
33
33
  ref={ref}
34
+ data-theme-overlay="tooltip"
34
35
  sideOffset={sideOffset}
35
36
  className={cn(
36
37
  'z-[var(--z-tooltip,10150)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
@@ -8,6 +8,7 @@ export * from './managers/client.manager';
8
8
  export * from './utils/config.utils';
9
9
  export * from './utils/marketplace.utils';
10
10
  export * from './utils/mcp-marketplace.utils';
11
+ export * from './utils/mcp-connection.utils';
11
12
  export * from './utils/ncp-attachments.utils';
12
13
  export * from './utils/ncp-session.utils';
13
14
  export * from './projects/project.utils';
@@ -0,0 +1,10 @@
1
+ import type { McpConnectionCreateResult, McpConnectionRequest, McpConnectionTestResult } from "@nextclaw/client-sdk";
2
+ import { nextclawClient } from "@/shared/lib/api/managers/client.manager";
3
+
4
+ export async function testMcpConnection(request: McpConnectionRequest): Promise<McpConnectionTestResult> {
5
+ return await nextclawClient.mcp.testConnection(request);
6
+ }
7
+
8
+ export async function createMcpConnection(request: McpConnectionRequest): Promise<McpConnectionCreateResult> {
9
+ return await nextclawClient.mcp.createConnection(request);
10
+ }
@@ -476,6 +476,8 @@
476
476
  "chatSteeringPending": "Waiting for the next step",
477
477
  "chatDeleteSession": "Delete Session",
478
478
  "chatDeleteSessionConfirm": "Delete the current session?",
479
+ "chatDeleteSessionSucceeded": "Session deleted.",
480
+ "chatDeleteSessionFailed": "Could not delete session",
479
481
  "chatSessionMoreActions": "More actions",
480
482
  "chatSessionCopyId": "Copy session ID",
481
483
  "chatSessionCopyIdSuccess": "Session ID copied",
@@ -26,6 +26,49 @@
26
26
  "sidebarExpand": "Expand sidebar",
27
27
  "security": "Sign-in Management",
28
28
  "privacy": "Privacy & Analytics",
29
+ "desktopCapabilities": "Desktop Access",
30
+ "desktopCapabilitiesPageTitle": "Desktop Access",
31
+ "desktopCapabilitiesPageDescription": "Check NextClaw Desktop system permissions and manage which desktop apps AI agents and Extensions can access.",
32
+ "desktopCapabilitiesSystemTitle": "System permission",
33
+ "desktopCapabilitiesSystemDescription": "macOS only needs permission for NextClaw Desktop. Each AI agent or Extension still needs separate access to an app.",
34
+ "desktopCapabilitiesHostStatus": "Desktop Host",
35
+ "desktopCapabilitiesHostOnline": "Connected and ready to check desktop apps and system permissions.",
36
+ "desktopCapabilitiesHostOffline": "Not connected. Start NextClaw Desktop first.",
37
+ "desktopCapabilitiesRecheck": "Check again",
38
+ "desktopCapabilitiesAccessibility": "Accessibility",
39
+ "desktopCapabilitiesOpenSettings": "Open System Settings",
40
+ "desktopCapabilitiesRequestPermission": "Request permission",
41
+ "desktopCapabilitiesPermissionGranted": "NextClaw Desktop can control local apps.",
42
+ "desktopCapabilitiesPermissionNotGranted": "Not allowed yet. Open System Settings and enable Accessibility for NextClaw Desktop.",
43
+ "desktopCapabilitiesPermissionNotSupported": "Desktop access is not supported on this system.",
44
+ "desktopCapabilitiesPermissionUnknown": "The permission state is currently unavailable.",
45
+ "desktopCapabilitiesGrantsTitle": "App access",
46
+ "desktopCapabilitiesGrantsDescription": "These permissions decide which AI agent or Extension can read or operate an app. Revoking access stops related operations immediately.",
47
+ "desktopCapabilitiesNoGrants": "No app access yet",
48
+ "desktopCapabilitiesNoGrantsDescription": "NextClaw will ask for permission when an AI agent or Extension first accesses a desktop app.",
49
+ "desktopCapabilitiesAgent": "AI",
50
+ "desktopCapabilitiesExtension": "Extension",
51
+ "desktopCapabilitiesUnknownApplication": "Unknown app",
52
+ "desktopCapabilitiesRevoke": "Revoke access",
53
+ "desktopAuthorizationTitle": "Allow desktop access?",
54
+ "desktopAuthorizationDescription": "This action needs access to a local app. Check who is asking, which app, and what they can do.",
55
+ "desktopAuthorizationCaller": "Requested by",
56
+ "desktopAuthorizationApplication": "App",
57
+ "desktopAuthorizationAccess": "Access",
58
+ "desktopAuthorizationRead": "Read visible content",
59
+ "desktopAuthorizationObserve": "Watch visible changes",
60
+ "desktopAuthorizationWrite": "Write to the app",
61
+ "desktopAuthorizationScreenCapture": "Capture visible window content",
62
+ "desktopAuthorizationPointerInput": "Click inside the app window",
63
+ "desktopAuthorizationReadRisk": "Once allowed, this requester can read or watch currently visible content in this app until you revoke access in Desktop Access.",
64
+ "desktopAuthorizationWriteRisk": "Once allowed, this AI agent can write a draft into this app. This permission does not allow sending or confirming.",
65
+ "desktopAuthorizationScreenCaptureRisk": "Once allowed, this requester can capture the currently visible content of this app window for AI understanding until you revoke access in Desktop Access.",
66
+ "desktopAuthorizationPointerInputRisk": "Once allowed, this AI can click inside this app's authorized window. It cannot use keys, scroll, drag, send, or confirm.",
67
+ "desktopAuthorizationReject": "Don't allow",
68
+ "desktopAuthorizationAllow": "Allow",
69
+ "desktopAuthorizationAllowing": "Allowing…",
70
+ "desktopAuthorizationAllowed": "Access allowed. The AI can retry the previous action.",
71
+ "desktopAuthorizationFailed": "Desktop access could not be saved.",
29
72
  "backToMain": "Back to Main",
30
73
  "enabled": "Enabled",
31
74
  "disabled": "Disabled",
@@ -60,6 +103,7 @@
60
103
  "themeGraphite": "Graphite",
61
104
  "themeNight": "Night",
62
105
  "themeCharcoal": "Charcoal",
106
+ "themeIsland": "Island",
63
107
  "themeProbe": "Probe",
64
108
  "isRequired": "is required",
65
109
  "duplicate": "duplicate",
@@ -227,6 +227,7 @@
227
227
  "serviceAppsActionsEmpty": "No actions discovered yet",
228
228
  "serviceAppsDetails": "Runtime details",
229
229
  "serviceAppsGrantedTo": "Granted to",
230
+ "serviceAppsGrantToAgent": "Grant to Agent",
230
231
  "serviceAppsRevokeGrant": "Revoke grant",
231
232
  "serviceAppsRuntimeState_matched": "Matched",
232
233
  "serviceAppsRuntimeState_missing": "Missing",
@@ -79,5 +79,33 @@
79
79
  "marketplaceMcpDoctorTools": "Tools",
80
80
  "marketplaceMcpRemove": "Remove",
81
81
  "marketplaceMcpRemoveTitle": "Remove MCP Server",
82
- "marketplaceMcpRemoveDescription": "This removes the MCP server config and hot-unplugs it from the tool source immediately."
82
+ "marketplaceMcpRemoveDescription": "This removes the MCP server config and hot-unplugs it from the tool source immediately.",
83
+ "mcpConnectionOpen": "Connect external MCP",
84
+ "mcpConnectionTitle": "Connect external MCP",
85
+ "mcpConnectionDescription": "Test the connection, then save it for your agents to use.",
86
+ "mcpConnectionTransport": "Connection type",
87
+ "mcpConnectionStdio": "Local command (stdio)",
88
+ "mcpConnectionName": "Name",
89
+ "mcpConnectionCommand": "Command",
90
+ "mcpConnectionArgs": "Command arguments",
91
+ "mcpConnectionArgsHint": "Separate arguments with spaces.",
92
+ "mcpConnectionCwd": "Working directory (optional)",
93
+ "mcpConnectionEnv": "Environment variables (optional)",
94
+ "mcpConnectionHeaders": "Request headers (optional)",
95
+ "mcpConnectionPairsHint": "One key=value pair per line.",
96
+ "mcpConnectionUrl": "Server URL",
97
+ "mcpConnectionTimeout": "Timeout (ms)",
98
+ "mcpConnectionVerifyTls": "Verify TLS certificate",
99
+ "mcpConnectionLocalWarning": "This MCP runs a command on this computer. Connect only to servers you trust.",
100
+ "mcpConnectionRemoteWarning": "NextClaw connects to this remote service. Confirm that its address and permissions are trusted.",
101
+ "mcpConnectionTest": "Test connection",
102
+ "mcpConnectionTesting": "Testing",
103
+ "mcpConnectionSave": "Save connection",
104
+ "mcpConnectionTestSuccess": "Connected. Found {count} tools.",
105
+ "mcpConnectionTestFailed": "Could not connect to the MCP server.",
106
+ "mcpConnectionNameRequired": "Enter an MCP name.",
107
+ "mcpConnectionCommandRequired": "Enter a command.",
108
+ "mcpConnectionUrlRequired": "Enter a server URL.",
109
+ "mcpConnectionTimeoutInvalid": "Timeout must be greater than 0.",
110
+ "mcpConnectionPairsInvalid": "Each line must use key=value."
83
111
  }
@@ -476,6 +476,8 @@
476
476
  "chatSteeringPending": "等待进入下一步",
477
477
  "chatDeleteSession": "删除会话",
478
478
  "chatDeleteSessionConfirm": "确认删除当前会话?",
479
+ "chatDeleteSessionSucceeded": "会话已删除。",
480
+ "chatDeleteSessionFailed": "无法删除会话",
479
481
  "chatSessionMoreActions": "更多操作",
480
482
  "chatSessionCopyId": "复制会话 ID",
481
483
  "chatSessionCopyIdSuccess": "会话 ID 已复制",
@@ -26,6 +26,49 @@
26
26
  "sidebarExpand": "展开侧边栏",
27
27
  "security": "登录管理",
28
28
  "privacy": "隐私与统计",
29
+ "desktopCapabilities": "桌面操作",
30
+ "desktopCapabilitiesPageTitle": "桌面操作",
31
+ "desktopCapabilitiesPageDescription": "查看 NextClaw Desktop 的系统权限,并管理 AI 和 Extension 可以访问的桌面应用。",
32
+ "desktopCapabilitiesSystemTitle": "系统权限",
33
+ "desktopCapabilitiesSystemDescription": "macOS 只需要授权 NextClaw Desktop;每个 AI 或 Extension 仍需单独获得应用访问许可。",
34
+ "desktopCapabilitiesHostStatus": "Desktop Host",
35
+ "desktopCapabilitiesHostOnline": "已连接,可以检查桌面应用和系统权限。",
36
+ "desktopCapabilitiesHostOffline": "未连接。请先启动 NextClaw Desktop。",
37
+ "desktopCapabilitiesRecheck": "重新检查",
38
+ "desktopCapabilitiesAccessibility": "辅助功能",
39
+ "desktopCapabilitiesOpenSettings": "打开系统设置",
40
+ "desktopCapabilitiesRequestPermission": "请求权限",
41
+ "desktopCapabilitiesPermissionGranted": "已允许 NextClaw Desktop 控制本机应用。",
42
+ "desktopCapabilitiesPermissionNotGranted": "尚未允许。打开系统设置后为 NextClaw Desktop 开启辅助功能。",
43
+ "desktopCapabilitiesPermissionNotSupported": "当前系统不支持这项桌面操作。",
44
+ "desktopCapabilitiesPermissionUnknown": "暂时无法读取权限状态。",
45
+ "desktopCapabilitiesGrantsTitle": "应用访问许可",
46
+ "desktopCapabilitiesGrantsDescription": "这里的许可决定哪个 AI 或 Extension 可以读取或操作哪个应用。撤销后,相关操作会立即停止。",
47
+ "desktopCapabilitiesNoGrants": "还没有应用访问许可",
48
+ "desktopCapabilitiesNoGrantsDescription": "AI 或 Extension 首次访问桌面应用时,NextClaw 会请求你的允许。",
49
+ "desktopCapabilitiesAgent": "AI",
50
+ "desktopCapabilitiesExtension": "Extension",
51
+ "desktopCapabilitiesUnknownApplication": "未知应用",
52
+ "desktopCapabilitiesRevoke": "撤销许可",
53
+ "desktopAuthorizationTitle": "允许桌面访问?",
54
+ "desktopAuthorizationDescription": "这项操作需要访问本机应用。请确认发起者、应用和操作范围。",
55
+ "desktopAuthorizationCaller": "发起者",
56
+ "desktopAuthorizationApplication": "应用",
57
+ "desktopAuthorizationAccess": "操作范围",
58
+ "desktopAuthorizationRead": "读取可见内容",
59
+ "desktopAuthorizationObserve": "持续观察可见变化",
60
+ "desktopAuthorizationWrite": "写入应用",
61
+ "desktopAuthorizationScreenCapture": "截取当前窗口可见内容",
62
+ "desktopAuthorizationPointerInput": "在应用窗口内点击",
63
+ "desktopAuthorizationReadRisk": "允许后,这个发起者可以读取或观察该应用中当前可见的内容,直到你在“桌面操作”中撤销许可。",
64
+ "desktopAuthorizationWriteRisk": "允许后,这个 AI 可以向该应用写入草稿。当前许可不包含发送或确认操作。",
65
+ "desktopAuthorizationScreenCaptureRisk": "允许后,这个发起者可以截取该应用当前窗口的可见内容并交给 AI 理解,直到你在“桌面操作”中撤销许可。",
66
+ "desktopAuthorizationPointerInputRisk": "允许后,这个 AI 可以在该应用已授权的窗口内点击,但不能按键、滚动、拖拽、发送或确认。",
67
+ "desktopAuthorizationReject": "不允许",
68
+ "desktopAuthorizationAllow": "允许",
69
+ "desktopAuthorizationAllowing": "正在允许…",
70
+ "desktopAuthorizationAllowed": "已允许。AI 可以重试刚才的操作。",
71
+ "desktopAuthorizationFailed": "未能保存桌面访问许可。",
29
72
  "backToMain": "返回主界面",
30
73
  "enabled": "启用",
31
74
  "disabled": "禁用",
@@ -60,6 +103,7 @@
60
103
  "themeGraphite": "石墨",
61
104
  "themeNight": "暗夜",
62
105
  "themeCharcoal": "炭夜",
106
+ "themeIsland": "岛屿",
63
107
  "themeProbe": "探针",
64
108
  "isRequired": "必填",
65
109
  "duplicate": "重复",
@@ -227,6 +227,7 @@
227
227
  "serviceAppsActionsEmpty": "尚未发现动作",
228
228
  "serviceAppsDetails": "运行时详情",
229
229
  "serviceAppsGrantedTo": "已授权给",
230
+ "serviceAppsGrantToAgent": "授权给 Agent",
230
231
  "serviceAppsRevokeGrant": "撤销授权",
231
232
  "serviceAppsRuntimeState_matched": "已匹配",
232
233
  "serviceAppsRuntimeState_missing": "运行时缺失",
@@ -79,5 +79,33 @@
79
79
  "marketplaceMcpDoctorTools": "工具数",
80
80
  "marketplaceMcpRemove": "移除",
81
81
  "marketplaceMcpRemoveTitle": "确认移除",
82
- "marketplaceMcpRemoveDescription": "该操作会删除 MCP server 配置,并通过热插拔立即从工具源中移除。"
82
+ "marketplaceMcpRemoveDescription": "该操作会删除 MCP server 配置,并通过热插拔立即从工具源中移除。",
83
+ "mcpConnectionOpen": "连接外部 MCP",
84
+ "mcpConnectionTitle": "连接外部 MCP",
85
+ "mcpConnectionDescription": "先测试连接,再保存并让 Agent 使用这个 MCP 服务。",
86
+ "mcpConnectionTransport": "连接方式",
87
+ "mcpConnectionStdio": "本地命令(stdio)",
88
+ "mcpConnectionName": "名称",
89
+ "mcpConnectionCommand": "启动命令",
90
+ "mcpConnectionArgs": "命令参数",
91
+ "mcpConnectionArgsHint": "用空格分隔参数。",
92
+ "mcpConnectionCwd": "工作目录(可选)",
93
+ "mcpConnectionEnv": "环境变量(可选)",
94
+ "mcpConnectionHeaders": "请求头(可选)",
95
+ "mcpConnectionPairsHint": "每行一个 key=value。",
96
+ "mcpConnectionUrl": "服务地址",
97
+ "mcpConnectionTimeout": "超时(毫秒)",
98
+ "mcpConnectionVerifyTls": "验证 TLS 证书",
99
+ "mcpConnectionLocalWarning": "此 MCP 会在本机执行命令。只连接你信任的服务。",
100
+ "mcpConnectionRemoteWarning": "NextClaw 会连接这个远程服务。请确认地址和权限可信。",
101
+ "mcpConnectionTest": "测试连接",
102
+ "mcpConnectionTesting": "正在测试",
103
+ "mcpConnectionSave": "保存连接",
104
+ "mcpConnectionTestSuccess": "连接成功,发现 {count} 个工具。",
105
+ "mcpConnectionTestFailed": "无法连接到 MCP 服务。",
106
+ "mcpConnectionNameRequired": "请填写 MCP 名称。",
107
+ "mcpConnectionCommandRequired": "请填写启动命令。",
108
+ "mcpConnectionUrlRequired": "请填写服务地址。",
109
+ "mcpConnectionTimeoutInvalid": "超时必须是大于 0 的数字。",
110
+ "mcpConnectionPairsInvalid": "每一行都必须是 key=value。"
83
111
  }
@@ -29,4 +29,13 @@ describe('ui theme defaults', () => {
29
29
  labelKey: 'themeCharcoal',
30
30
  });
31
31
  });
32
+
33
+ it('recognizes island as a light theme option', () => {
34
+ expect(normalizeTheme('island')).toBe('island');
35
+ expect(getThemeAppearance('island')).toBe('light');
36
+ expect(THEME_OPTIONS).toContainEqual({
37
+ value: 'island',
38
+ labelKey: 'themeIsland',
39
+ });
40
+ });
32
41
  });
@@ -8,6 +8,7 @@ export type UiTheme =
8
8
  | 'graphite'
9
9
  | 'night'
10
10
  | 'charcoal'
11
+ | 'island'
11
12
  | 'probe';
12
13
  export type UiThemeAppearance = 'light' | 'dark';
13
14
 
@@ -24,6 +25,7 @@ const THEME_DEFINITIONS: readonly UiThemeDefinition[] = [
24
25
  { value: 'work', labelKey: 'themeWork', appearance: 'light' },
25
26
  { value: 'night', labelKey: 'themeNight', appearance: 'dark' },
26
27
  { value: 'charcoal', labelKey: 'themeCharcoal', appearance: 'dark' },
28
+ { value: 'island', labelKey: 'themeIsland', appearance: 'light' },
27
29
  { value: 'natural', labelKey: 'themeNatural', appearance: 'light' },
28
30
  { value: 'minimal', labelKey: 'themeMinimal', appearance: 'light' },
29
31
  { value: 'warm', labelKey: 'themeWarm', appearance: 'light' },
@@ -1 +0,0 @@
1
- import{B as e,L as t,a as n,r,s as i}from"./react-8iBFECZE.js";import{t as a}from"./navigation-link-DAfwFCj4.js";import{Ht as o,Kt as s,Ut as c,Wt as l,_n as u,an as d,in as f,nn as p,qt as m,rn as h,un as g}from"./api-iMkU_o5P.js";import{a as _,i as v,n as y,r as b,t as x}from"./select-lNdozU4o.js";import{t as S}from"./refresh-cw-D_Eibznw.js";import{t as C}from"./rotate-cw-QQjmoWuq.js";import{J as w,X as T,Y as E,Z as D,q as O}from"./index-CYBXR7zN.js";var k=e(),A={checking:`desktopUpdatesStatusChecking`,"update-available":`desktopUpdatesStatusAvailable`,downloading:`desktopUpdatesStatusDownloading`,downloaded:`desktopUpdatesStatusDownloaded`,applying:`desktopUpdatesStatusApplying`,"restart-required":`desktopUpdatesStatusRestartRequired`,"up-to-date":`desktopUpdatesStatusUpToDate`,blocked:`desktopUpdatesStatusBlocked`,failed:`desktopUpdatesStatusFailed`},j={feature:`desktopUpdatesReleaseNotesFeature`,enhancement:`desktopUpdatesReleaseNotesEnhancement`,fix:`desktopUpdatesReleaseNotesFix`,compatibility:`desktopUpdatesReleaseNotesCompatibility`};function M({snapshot:e}){return(0,k.jsx)(`span`,{className:t(`inline-flex rounded-full px-3 py-1 text-xs font-medium ring-1`,V(e.status)),children:B(e)})}function N({label:e,value:t}){return(0,k.jsxs)(`div`,{className:`rounded-lg bg-background/70 p-3`,children:[(0,k.jsx)(`p`,{className:`text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,k.jsx)(`p`,{className:`mt-1 text-sm font-semibold text-foreground`,children:t})]})}function P({snapshot:e}){if(e.status!==`downloading`)return null;let t=e.progress?.percent,r=t==null?n(`desktopUpdatesDownloadProgressUnknown`):n(`desktopUpdatesDownloadProgressPercent`).replace(`{percent}`,String(t)),i=L(e.progress?.downloadedBytes??0,e.progress?.totalBytes??null);return(0,k.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:r}),(0,k.jsx)(`p`,{className:`text-xs font-medium text-amber-700`,children:i})]}),(0,k.jsx)(`div`,{className:`mt-3 h-2 overflow-hidden rounded-full bg-amber-100`,children:(0,k.jsx)(`div`,{className:`h-full rounded-full bg-amber-500 transition-[width]`,style:{width:`${t??0}%`}})})]})}function F(e){return e?.trim()||`-`}function I(e){return e?r(e):`-`}function L(e,t){let n=R(e);return t&&t>0?`${n} / ${R(t)}`:n}function R(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function z(e){return n(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}function B(e){return e.status===`failed`&&e.failureStage?n(`desktopUpdatesFailureStage.${e.failureStage}`):n(A[e.status]??`desktopUpdatesStatusIdle`)}function V(e){return e===`downloaded`||e===`restart-required`?`bg-emerald-50 text-emerald-700 ring-emerald-100`:e===`update-available`||e===`downloading`||e===`checking`?`bg-amber-50 text-amber-700 ring-amber-100`:e===`failed`||e===`blocked`?`bg-red-50 text-red-700 ring-red-100`:`bg-gray-100 text-gray-700 ring-gray-200`}function H(){return i()===`zh`?`zh-CN`:`en-US`}function U(e,t){return c(e.title,t)??n(j[e.kind]??`desktopUpdatesReleaseNotesEnhancement`)}function W({snapshot:e}){let t=l(e),r=H(),i=u({queryKey:[`runtime-release-notes`,t],queryFn:async()=>await o(t??``),enabled:!!t,retry:!1,staleTime:300*1e3}),s=i.data,d=c(s?.title,r)??n(`desktopUpdatesReleaseNotesPreviewTitle`),f=c(s?.summary,r)??n(`desktopUpdatesReleaseNotesPreviewDescription`);return e.releaseNotesUrl?(0,k.jsxs)(O,{children:[(0,k.jsx)(T,{children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,k.jsxs)(`div`,{className:`space-y-1`,children:[(0,k.jsx)(D,{children:d}),(0,k.jsx)(E,{children:f})]}),(0,k.jsx)(a,{href:e.releaseNotesUrl,external:!0,children:n(`desktopUpdatesReleaseNotes`)})]})}),(0,k.jsxs)(w,{className:`space-y-4`,children:[i.isLoading?(0,k.jsx)(`p`,{className:`text-sm text-gray-500`,children:n(`desktopUpdatesReleaseNotesPreviewLoading`)}):null,!t||i.isError?(0,k.jsx)(`p`,{className:`text-sm text-gray-500`,children:n(`desktopUpdatesReleaseNotesPreviewUnavailable`)}):null,s?(0,k.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:s.sections.map(e=>(0,k.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-gray-50/60 p-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:U(e,r)}),(0,k.jsx)(`ul`,{className:`mt-3 space-y-3`,children:e.items.map((t,n)=>{let i=c(t.title,r),a=c(t.body,r);return(0,k.jsxs)(`li`,{className:`space-y-1`,children:[i?(0,k.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:i}):null,a?(0,k.jsx)(`p`,{className:`text-sm leading-5 text-gray-600`,children:a}):null]},`${i??e.kind}-${n}`)})})]},e.kind))}):null]})]}):null}function G(){return(0,k.jsx)(d,{title:n(`runtimeUpdatesPageTitle`),description:n(`runtimeUpdatesPageDescription`),children:(0,k.jsx)(f,{title:n(`runtimeUpdatesUnavailableTitle`),description:n(`runtimeUpdatesUnavailableDescription`),children:(0,k.jsx)(h,{children:(0,k.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:n(`runtimeUpdatesUnavailableHint`)})})})})}function K(){let{supported:e,initialized:r,busyAction:i,snapshot:a}=m();if(!r)return(0,k.jsx)(d,{title:n(`runtimeUpdatesPageTitle`),description:n(`runtimeUpdatesPageDescription`),children:(0,k.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:n(`loading`)})});if(!e||!a)return(0,k.jsx)(G,{});let o=i===`checking`,c=i===`downloading`,l=i===`applying`,u=i===`updating`,w=i===`switching-channel`,T=(a.status===`update-available`||a.status===`downloaded`)&&!c&&!l&&!u,E=[[n(`runtimeUpdatesHostVersion`),F(a.hostVersion)],[n(`desktopUpdatesCurrentBundleVersion`),F(a.currentVersion)],[n(`desktopUpdatesAvailableVersion`),F(a.availableVersion)],[n(`desktopUpdatesLastCheckedAt`),I(a.lastCheckedAt)],[n(`desktopUpdatesCurrentChannel`),z(a.channel)]];return(0,k.jsxs)(d,{title:n(`runtimeUpdatesPageTitle`),description:n(`runtimeUpdatesPageDescription`),actions:(0,k.jsxs)(g,{variant:`outline`,onClick:()=>void s.checkForUpdates(),disabled:o||c||l||u,children:[(0,k.jsx)(S,{className:t(`mr-2 h-4 w-4`,o&&`animate-spin`)}),n(`desktopUpdatesCheckNow`)]}),children:[(0,k.jsx)(f,{title:n(`desktopUpdatesOverviewTitle`),description:n(`desktopUpdatesOverviewDescription`),children:(0,k.jsx)(h,{children:(0,k.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,k.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:n(`desktopUpdatesStatusLabel`)}),(0,k.jsx)(M,{snapshot:a})]}),(0,k.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-5`,children:E.map(([e,t])=>(0,k.jsx)(N,{label:e,value:t},e))}),a.channel===`beta`?(0,k.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:n(`desktopUpdatesBetaBadgeTitle`)}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-amber-700`,children:n(`desktopUpdatesBetaBadgeDescription`)})]}):null,a.downloadedVersion?(0,k.jsxs)(`div`,{className:`rounded-2xl border border-emerald-200 bg-emerald-50/70 p-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-emerald-800`,children:n(`desktopUpdatesDownloadedBannerTitle`)}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-emerald-700`,children:n(`runtimeUpdatesDownloadedBannerDescription`).replace(`{version}`,a.downloadedVersion)})]}):null,(0,k.jsx)(P,{snapshot:a}),a.status===`blocked`?(0,k.jsxs)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-red-800`,children:n(`desktopUpdatesBlockedTitle`)}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-red-700`,children:a.errorMessage??n(`desktopUpdatesBlockedDescription`)}),a.recoveryCommand?(0,k.jsx)(`code`,{className:`mt-3 block rounded-lg bg-white/70 px-3 py-2 text-xs text-red-800`,children:a.recoveryCommand}):null]}):null,a.errorMessage&&a.status!==`blocked`?(0,k.jsx)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4 text-sm text-red-700`,children:a.errorMessage}):null]})})}),(0,k.jsx)(W,{snapshot:a}),(0,k.jsx)(f,{title:n(`desktopUpdatesChannelSettingsTitle`),description:n(`desktopUpdatesChannelSettingsDescription`),children:(0,k.jsx)(h,{children:(0,k.jsx)(p,{title:n(`desktopUpdatesReleaseChannel`),description:n(`desktopUpdatesReleaseChannelHelp`),layout:`stacked`,children:(0,k.jsxs)(`div`,{className:`space-y-2`,children:[(0,k.jsxs)(x,{value:a.channel,disabled:w||o||c||l||u,onValueChange:e=>void s.updateChannel(e),children:[(0,k.jsx)(v,{className:`w-full max-w-sm`,children:(0,k.jsx)(_,{placeholder:n(`desktopUpdatesReleaseChannel`)})}),(0,k.jsxs)(y,{children:[(0,k.jsx)(b,{value:`stable`,children:n(`desktopUpdatesChannelStable`)}),(0,k.jsx)(b,{value:`beta`,children:n(`desktopUpdatesChannelBeta`)})]})]}),(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`desktopUpdatesReleaseChannelDowngradeHint`)})]})})})}),(0,k.jsx)(f,{title:n(`desktopUpdatesActionsTitle`),description:n(`runtimeUpdatesActionsDescription`),children:(0,k.jsx)(h,{children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 p-4`,children:[(0,k.jsxs)(g,{variant:`outline`,onClick:()=>void s.checkForUpdates(),disabled:o||c||l||u,children:[(0,k.jsx)(S,{className:t(`mr-2 h-4 w-4`,o&&`animate-spin`)}),n(`desktopUpdatesCheckNow`)]}),(0,k.jsxs)(g,{onClick:()=>void s.updateNow(),disabled:!T,children:[(0,k.jsx)(C,{className:t(`mr-2 h-4 w-4`,u&&`animate-spin`)}),n(`runtimeUpdatesApplyNow`)]})]})})})]})}export{K as DesktopUpdateConfig};
@@ -1 +0,0 @@
1
- import{t as e}from"./doc-browser-npOvWtgf.js";export{e as DocBrowser};
@@ -1 +0,0 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{B as t,H as n,L as r,S as i,V as a,a as o,m as s}from"./react-8iBFECZE.js";import{t as c}from"./navigation-link-DAfwFCj4.js";import{a as l,b as u,c as d,d as f,h as p,i as m,l as h,m as g,o as _,p as v,r as y,s as b,t as x,v as S,y as C}from"./dist-Cy_e4kNb.js";import{t as w}from"./dist-m08DUswB.js";import{t as T}from"./createLucideIcon-DxlwKLr-.js";import{n as ee,t as te}from"./search-Vih1R2BD.js";import{t as E}from"./book-open-nD8gdMhA.js";import{t as D}from"./plus-D4LtWtTk.js";import{t as O}from"./refresh-cw-D_Eibznw.js";import{t as k}from"./x-CWdWBu_U.js";import{_ as ne,d as re,g as A,m as j,n as ie,p as ae}from"./doc-browser-context-jiy-O4F8.js";var M=T(`AppWindow`,[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]),N=T(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),P=T(`Boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),F=T(`EllipsisVertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),I=T(`Github`,[[`path`,{d:`M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4`,key:`tonef`}],[`path`,{d:`M9 18c-4.51 2-5-2-7-2`,key:`9comsn`}]]),oe=T(`GripVertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),se=T(`PanelRightOpen`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),ce=T(`PictureInPicture2`,[[`path`,{d:`M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4`,key:`daa4of`}],[`rect`,{width:`10`,height:`7`,x:`12`,y:`13`,rx:`2`,key:`1nb8gs`}]]),le=T(`PinOff`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),L=T(`Pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),R=e(n(),1),z=t(),[B,ue]=S(`Tooltip`,[b]),V=b(),de=`TooltipProvider`,fe=700,H=`tooltip.open`,[pe,U]=B(de),W=e=>{let{__scopeTooltip:t,delayDuration:n=fe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=R.useRef(!0),s=R.useRef(!1),c=R.useRef(0);return R.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,z.jsx)(pe,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:R.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:R.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:R.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};W.displayName=de;var G=`Tooltip`,[me,K]=B(G),q=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=U(G,e.__scopeTooltip),l=V(t),[u,d]=R.useState(null),f=p(),m=R.useRef(0),h=o??c.disableHoverableContent,v=s??c.delayDuration,y=R.useRef(!1),[b,x]=g({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(H))):c.onClose(),a?.(e)},caller:G}),S=R.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=R.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,x(!0)},[x]),w=R.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),T=R.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,x(!0),m.current=0},v)},[v,x]);return R.useEffect(()=>()=>{m.current&&=(window.clearTimeout(m.current),0)},[]),(0,z.jsx)(_,{...l,children:(0,z.jsx)(me,{scope:t,contentId:f,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:R.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:R.useCallback(()=>{h?w():(window.clearTimeout(m.current),m.current=0)},[w,h]),onOpen:C,onClose:w,disableHoverableContent:h,children:n})})};q.displayName=G;var J=`TooltipTrigger`,he=R.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=K(J,n),a=U(J,n),o=V(n),s=C(t,R.useRef(null),i.onTriggerChange),c=R.useRef(!1),l=R.useRef(!1),d=R.useCallback(()=>c.current=!1,[]);return R.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,z.jsx)(y,{asChild:!0,...o,children:(0,z.jsx)(f.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:u(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:u(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:u(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:u(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:u(e.onBlur,i.onClose),onClick:u(e.onClick,i.onClose)})})});he.displayName=J;var Y=`TooltipPortal`,[ge,_e]=B(Y,{forceMount:void 0}),ve=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=K(Y,t);return(0,z.jsx)(ge,{scope:t,forceMount:n,children:(0,z.jsx)(w,{present:n||a.open,children:(0,z.jsx)(d,{asChild:!0,container:i,children:r})})})};ve.displayName=Y;var X=`TooltipContent`,ye=R.forwardRef((e,t)=>{let n=_e(X,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=K(X,e.__scopeTooltip);return(0,z.jsx)(w,{present:r||o.open,children:o.disableHoverableContent?(0,z.jsx)(we,{side:i,...a,ref:t}):(0,z.jsx)(be,{side:i,...a,ref:t})})}),be=R.forwardRef((e,t)=>{let n=K(X,e.__scopeTooltip),r=U(X,e.__scopeTooltip),i=R.useRef(null),a=C(t,i),[o,s]=R.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=R.useCallback(()=>{s(null),d(!1)},[d]),p=R.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Oe(r,De(r,n.getBoundingClientRect())),a=ke(t.getBoundingClientRect());s(je([...i,...a])),d(!0)},[d]);return R.useEffect(()=>()=>f(),[f]),R.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),R.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Ae(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,z.jsx)(we,{...e,ref:a})}),[xe,Se]=B(G,{isInside:!1}),Ce=v(`TooltipContent`),we=R.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=K(X,n),u=V(n),{onClose:d}=c;return R.useEffect(()=>(document.addEventListener(H,d),()=>document.removeEventListener(H,d)),[d]),R.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,d]),(0,z.jsx)(h,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,z.jsxs)(l,{"data-state":c.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,z.jsx)(Ce,{children:r}),(0,z.jsx)(xe,{scope:n,isInside:!0,children:(0,z.jsx)(x,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});ye.displayName=X;var Te=`TooltipArrow`,Ee=R.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=V(n);return Se(Te,n).isInside?null:(0,z.jsx)(m,{...i,...r,ref:t})});Ee.displayName=Te;function De(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Oe(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ke(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Ae(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function je(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),Me(t)}function Me(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Ne=W,Pe=q,Fe=he,Ie=ve,Le=ye,Re=Ne,ze=Pe,Be=R.forwardRef(({onFocus:e,...t},n)=>(0,z.jsx)(Fe,{ref:n,onFocus:t=>{e?.(t),!t.defaultPrevented&&!t.currentTarget.matches(`:focus-visible`)&&t.preventDefault()},...t}));Be.displayName=Fe.displayName;var Ve=R.forwardRef(({className:e,sideOffset:t=4,...n},i)=>(0,z.jsx)(Ie,{children:(0,z.jsx)(Le,{ref:i,sideOffset:t,className:r(`z-[var(--z-tooltip,10150)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));Ve.displayName=Le.displayName;var He={sm:`h-6 w-6 rounded-md p-1`,md:`h-7 w-7 rounded-md p-1.5`,lg:`h-8 w-8 rounded-lg p-1.5`},Ue={default:`text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground disabled:text-muted-foreground/45 disabled:hover:bg-transparent disabled:hover:text-muted-foreground/45`,surface:`text-muted-foreground hover:bg-gray-200/60 hover:text-gray-900 active:bg-gray-200/80 disabled:text-muted-foreground/45 disabled:hover:bg-transparent disabled:hover:text-muted-foreground/45`,strong:`text-muted-foreground hover:bg-black/10 hover:text-foreground disabled:text-muted-foreground/45 disabled:hover:bg-transparent disabled:hover:text-muted-foreground/45`},Z=R.forwardRef(({className:e,disabled:t=!1,icon:n,label:i,size:a=`md`,tone:o=`default`,tooltip:s,tooltipSide:c=`bottom`,...l},u)=>{let d=(0,z.jsx)(`button`,{...l,ref:u,type:`button`,disabled:t,"aria-label":i,className:r(`inline-flex shrink-0 items-center justify-center transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:cursor-not-allowed`,He[a],Ue[o],e),children:n}),f=s===!1?null:s??i;return f?(0,z.jsx)(Re,{delayDuration:250,children:(0,z.jsxs)(ze,{disableHoverableContent:!0,children:[(0,z.jsx)(Be,{asChild:!0,children:t?(0,z.jsx)(`span`,{className:`inline-flex`,children:d}):d}),(0,z.jsx)(Ve,{side:c,className:`text-xs`,children:f})]})}):d});Z.displayName=`IconActionButton`;function We(e){return e.index>0&&e.entries.length>0}function Ge(e){return e.index>=0&&e.index<e.entries.length-1}function Ke(e,t,n=Object.is){let r=Ye(e),i=e.entries[r];if(i&&n(i,t))return{entries:e.entries,index:r};let a=[...e.entries.slice(0,r+1),t];return{entries:a,index:a.length-1}}function qe(e,t){let n=Ye(e),r=t===`back`?n-1:n+1,i=e.entries[r];return i?{history:{entries:e.entries,index:r},entry:i}:null}function Je(e,t,n){let r=Ye(e),i=e.entries.filter(t);if(i.length===0)return n===void 0?{entries:[],index:0}:{entries:[n],index:0};let a=e.entries.slice(0,r+1).filter(t);return{entries:i,index:Math.min(Math.max(0,a.length-1),i.length-1)}}function Ye(e){return e.entries.length===0?0:Number.isInteger(e.index)?Math.min(Math.max(0,e.index),e.entries.length-1):e.entries.length-1}var Xe=200;function Ze(e){return Number.isFinite(e)?Math.max(0,e):0}function Qe(e){return e.trim()||null}var $e=new class{constructor(e=Xe){this.capacity=e,this.positions=new Map}save(e,t){let n=Qe(e);if(n)for(this.positions.delete(n),this.positions.set(n,{x:Ze(t.x),y:Ze(t.y),...t.payload===void 0?{}:{payload:t.payload}});this.positions.size>this.capacity;){let e=this.positions.keys().next().value;if(!e)return;this.positions.delete(e)}}read(e){let t=Qe(e);if(!t)return null;let n=this.positions.get(t);return n?{...n}:null}delete(e){let t=Qe(e);t&&this.positions.delete(t)}clear(){this.positions.clear()}},et=e(a(),1),tt=(0,R.createContext)(null),nt=8;function rt({groups:e,label:t,onClose:n,position:i}){let a=(0,R.useRef)(null);(0,R.useLayoutEffect)(()=>{let e=a.current;if(!e)return;let t=e.getBoundingClientRect(),n=i.align===`end`?i.x-t.width:i.x,r=Math.max(nt,Math.min(n,window.innerWidth-t.width-nt)),o=Math.max(nt,Math.min(i.y,window.innerHeight-t.height-nt));e.style.left=`${r}px`,e.style.top=`${o}px`,e.querySelector(`[role="menuitem"]:not(:disabled)`)?.focus()},[i]);let o=e=>{let t=Array.from(a.current?.querySelectorAll(`[role="menuitem"]:not(:disabled)`)??[]);if(t.length===0)return;let n=t.indexOf(document.activeElement);t[n<0?0:(n+e+t.length)%t.length]?.focus()};return(0,et.createPortal)((0,z.jsx)(`div`,{className:`fixed inset-0 z-[var(--z-tooltip)]`,onContextMenu:e=>e.preventDefault(),onPointerDown:()=>n(!0),children:(0,z.jsx)(`div`,{ref:a,role:`menu`,"aria-label":t,className:`fixed min-w-52 max-w-72 overflow-hidden rounded-xl border border-border bg-popover p-1 text-popover-foreground shadow-[0_18px_48px_-20px_rgba(15,23,42,0.42)]`,style:{left:i.x,top:i.y},onPointerDown:e=>e.stopPropagation(),onKeyDown:e=>{if(e.key===`Escape`)e.preventDefault(),n(!0);else if(e.key===`ArrowDown`)e.preventDefault(),o(1);else if(e.key===`ArrowUp`)e.preventDefault(),o(-1);else if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=a.current?.querySelectorAll(`[role="menuitem"]:not(:disabled)`);t?.[e.key===`Home`?0:t.length-1]?.focus()}},children:e.map((e,t)=>(0,z.jsxs)(`div`,{role:`group`,children:[t>0?(0,z.jsx)(`div`,{className:`my-1 h-px bg-border`}):null,e.items.map(e=>{let t=r(`flex h-8 w-full items-center gap-2 rounded-lg px-2.5 text-left text-[13px] font-medium outline-none transition-colors`,e.destructive?`text-destructive hover:bg-destructive/10 focus-visible:bg-destructive/10`:`text-foreground hover:bg-muted focus-visible:bg-muted`,`disabled:pointer-events-none disabled:opacity-45`),i=(0,z.jsxs)(z.Fragment,{children:[e.icon?(0,z.jsx)(`span`,{className:r(`inline-flex h-4 w-4 shrink-0 items-center justify-center`,e.destructive?`text-destructive`:`text-muted-foreground`),children:e.icon}):null,(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label})]});return e.href?(0,z.jsx)(`a`,{role:`menuitem`,className:t,href:e.href,download:e.download,onClick:()=>{e.onSelect?.(),n(!1)},children:i},e.key):(0,z.jsx)(`button`,{type:`button`,role:`menuitem`,disabled:e.disabled,className:t,onClick:()=>{e.onSelect?.(),n(e.restoreFocus!==!1)},children:i},e.key)})]},e.key))})}),document.body)}function it({children:e,groups:t,label:n}){let[r,i]=(0,R.useState)(null),a=t.filter(e=>e.items.length>0),o=e=>{let t=r?.trigger;i(null),e&&t&&window.setTimeout(()=>t.isConnected&&t.focus(),0)},s=e=>{if(r?.trigger===e){o(!0);return}if(a.length===0)return;let t=e.getBoundingClientRect();i({align:`end`,x:t.right,y:t.bottom,trigger:e})},c=(0,R.cloneElement)(e,{"data-context-menu-open":r?``:void 0,onContextMenu:t=>{if(e.props.onContextMenu?.(t),t.defaultPrevented||a.length===0)return;t.preventDefault();let n=t.currentTarget,r=n.getBoundingClientRect();i({align:`start`,x:t.clientX||r.left,y:t.clientY||r.bottom,trigger:n})}});return(0,z.jsxs)(tt.Provider,{value:{isOpen:!!r,toggleFromButton:s},children:[c,r?(0,z.jsx)(rt,{groups:a,label:n,position:r,onClose:o}):null]})}function at({children:e}){let t=(0,R.useContext)(tt);if(!t)throw Error(`ContextMenuTrigger must be rendered inside ContextMenu`);return(0,R.cloneElement)(e,{"aria-expanded":t.isOpen,"aria-haspopup":`menu`,onClick:n=>{e.props.onClick?.(n),!n.defaultPrevented&&(n.stopPropagation(),t.toggleFromButton(n.currentTarget))}})}function ot(e,t){e.stopPropagation(),t()}function st(e){return(0,z.jsx)(Z,{...e,size:`sm`,tone:`strong`})}function ct({tab:e}){if(!e.menuGroups?.some(e=>e.items.length>0))return null;let t=e.menuLabel??e.label;return(0,z.jsx)(`div`,{className:`flex shrink-0`,children:(0,z.jsx)(at,{children:(0,z.jsx)(st,{icon:(0,z.jsx)(F,{className:`h-3.5 w-3.5`}),label:t})})})}function lt({tab:e}){let t=e.menuGroups?.some(e=>e.items.length>0)??!1,n=!!(e.onClose&&e.closePlacement!==`leading-hover`),i=n?(0,z.jsx)(st,{icon:(0,z.jsx)(k,{className:`h-3.5 w-3.5`}),label:e.closeLabel??``,tooltip:e.closeLabel??null,onClick:t=>ot(t,e.onClose)}):null;return!t&&!n?null:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,"data-compact-tab-trailing-spacer":``,className:r(`shrink-0`,t&&n?`w-[50px]`:`w-6`)}),(0,z.jsxs)(`div`,{"data-compact-tab-trailing-actions":``,className:r(`pointer-events-none absolute inset-y-0 right-1 z-10 flex items-center gap-0.5 opacity-0`,`group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100`,`group-data-[context-menu-open]:pointer-events-auto group-data-[context-menu-open]:opacity-100`),children:[t?(0,z.jsx)(ct,{tab:e}):null,i]})]})}function ut({tab:e}){return!e.onClose||e.closePlacement!==`leading-hover`?null:(0,z.jsx)(`div`,{"data-compact-tab-leading-actions":``,className:r(`pointer-events-none absolute inset-y-0 left-1 z-10 flex items-center opacity-0`,`group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100`),children:(0,z.jsx)(st,{icon:(0,z.jsx)(k,{className:`h-3.5 w-3.5`}),label:e.closeLabel??``,tooltip:e.closeLabel??null,onClick:t=>ot(t,e.onClose)})})}function dt({labelClassName:e,tab:t}){let n=!!(t.onClose&&t.closePlacement===`leading-hover`),i=(0,z.jsxs)(`button`,{type:`button`,onClick:t.onSelect,"aria-label":t.label,className:`flex min-w-0 flex-1 items-center gap-1.5 text-left`,children:[t.leadingIcon||n?(0,z.jsx)(`span`,{"data-compact-tab-leading-slot":``,className:r(`inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center`,n&&`group-hover:opacity-0 group-focus-within:opacity-0`),children:t.leadingIcon}):null,(0,z.jsx)(`span`,{className:r(`min-w-0 truncate text-[12px] font-medium`,e,t.labelClassName),children:t.label}),t.badge,t.unreadIndicator]}),a=t.tooltip??t.label;return a?(0,z.jsx)(Re,{delayDuration:250,children:(0,z.jsxs)(ze,{children:[(0,z.jsx)(Be,{asChild:!0,children:i}),(0,z.jsx)(Ve,{side:`bottom`,className:`text-xs`,children:a})]})}):i}function ft({activeTabClassName:e,inactiveTabClassName:t,itemRef:n,labelClassName:i,tab:a,tabBaseClassName:o}){let s=(0,z.jsxs)(`div`,{ref:n,"data-compact-tab-item":``,onClick:e=>e.target===e.currentTarget&&a.onSelect(),className:r(o??`flex max-w-[180px] cursor-pointer items-center gap-1.5 border-r border-gray-200/70 border-b-2 px-2.5 py-2 transition-colors`,`group relative`,a.active?e??`border-b-primary bg-white text-gray-900`:t??`border-b-transparent bg-gray-50/85 text-gray-500 hover:bg-gray-100`),children:[(0,z.jsx)(dt,{tab:a,labelClassName:i}),(0,z.jsx)(ut,{tab:a}),(0,z.jsx)(lt,{tab:a})]});return a.menuGroups?.some(e=>e.items.length>0)?(0,z.jsx)(it,{groups:a.menuGroups,label:a.menuLabel??a.label,children:s}):s}function pt({actionButtonClassName:e,actions:t,actionsClassName:n,actionsTestId:i,className:a,onPointerDown:o,onScrollPointerDown:s,scrollClassName:c,scrollTestId:l,tabs:u,tabsClassName:d,testId:f,...p}){let m=R.useCallback(e=>{e?.scrollIntoView?.({block:`nearest`,inline:`nearest`})},[]);return(0,z.jsxs)(`div`,{"data-testid":f,className:r(`flex min-w-0 items-stretch border-b border-gray-200/70 bg-gray-50/85`,a),onPointerDown:o,children:[(0,z.jsx)(`div`,{className:r(`min-w-0 flex-1 overflow-x-auto overflow-y-hidden`,c),onPointerDown:s,children:(0,z.jsx)(`div`,{"data-testid":l,className:r(`flex min-w-max items-stretch`,d),children:u.map(e=>(0,z.jsx)(ft,{itemRef:e.active?m:void 0,tab:e,...p},e.key))})}),(0,z.jsx)(`div`,{className:r(`flex shrink-0 items-center gap-1`,n),"data-testid":i,onPointerDown:e=>e.stopPropagation(),children:t.map(t=>(0,z.jsx)(Z,{icon:t.icon,label:t.label,disabled:t.disabled,onClick:t.onClick,className:e},t.key))})]})}function mt(){return(0,z.jsx)(`div`,{className:`flex h-full items-center justify-center bg-background px-5 py-6`,children:(0,z.jsxs)(`div`,{className:`flex max-w-[260px] flex-col items-center gap-3 text-center`,children:[(0,z.jsx)(`span`,{className:`flex h-12 w-12 items-center justify-center rounded-lg border border-border bg-muted text-muted-foreground shadow-[0_1px_2px_rgba(30,20,10,0.04)]`,children:(0,z.jsx)(P,{className:`h-5 w-5`})}),(0,z.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:o(`docBrowserHomeTitle`)})]})})}function ht(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.kind===`document`?!0:t.kind===`element`&&Array.isArray(t.path)&&t.path.length>0&&t.path.length<=30&&t.path.every(e=>typeof e?.index==`number`&&Number.isInteger(e.index)&&e.index>=0&&e.index<=1e3&&typeof e.tagName==`string`&&e.tagName.length>0&&e.tagName.length<=32)}function gt(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.currentUrl==`string`&&ht(t.target)}function _t(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.type===s.scrollMessageType&&t.version===s.version&&ht(t.target)&&typeof t.x==`number`&&Number.isFinite(t.x)&&t.x>=0&&typeof t.y==`number`&&Number.isFinite(t.y)&&t.y>=0}function vt({currentUrl:e,iframeRef:t,isEnabled:n,restorationKey:r}){return(0,R.useEffect)(()=>{if(!e||!n||!r)return;let i=n=>{n.source!==t.current?.contentWindow||!_t(n.data)||$e.save(r,{x:n.data.x,y:n.data.y,payload:{currentUrl:e,target:n.data.target}})};return window.addEventListener(`message`,i),()=>window.removeEventListener(`message`,i)},[e,t,n,r]),(0,R.useCallback)(()=>{if(!e||!n||!r)return;let i=$e.read(r);!i||!gt(i.payload)||i.payload.currentUrl!==e||t.current?.contentWindow?.postMessage({type:s.restoreScrollMessageType,version:s.version,target:i.payload.target,x:i.x,y:i.y},`*`)},[e,t,n,r])}function yt({currentTab:e,iframeRef:t,isEnabled:n}){return vt({currentUrl:e?.currentUrl??null,iframeRef:t,isEnabled:n,restorationKey:e?`panel-app:doc-browser:${e.id}`:null})}function bt({isVisible:e,onRefresh:t,onSubmit:n,onUrlInputChange:r,placeholder:i,urlInput:a}){return e?(0,z.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/70 bg-card px-3.5 py-2 shrink-0`,children:[(0,z.jsxs)(`form`,{onSubmit:n,className:`flex-1 relative`,children:[(0,z.jsx)(te,{className:`absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`}),(0,z.jsx)(`input`,{type:`text`,value:a,onChange:e=>r(e.target.value),"aria-label":o(`docBrowserAddressLabel`),placeholder:i,className:`h-8 w-full rounded-lg border border-border/75 bg-background pl-8 pr-3 text-xs text-foreground transition-colors placeholder:text-muted-foreground/55 focus:outline-none focus:ring-0`})]}),(0,z.jsx)(Z,{icon:(0,z.jsx)(O,{className:`h-3.5 w-3.5`}),label:o(`docBrowserRefresh`),onClick:t})]}):null}function xt({currentTab:e,currentUrl:t,customContent:n,iframeRef:r,iframeInstanceId:a,iframeSandbox:o,isDragging:s,isResizing:c,onIframeLoad:l,onIframePointerOver:u}){return(0,z.jsxs)(`div`,{className:`flex-1 relative overflow-hidden`,children:[n||(0,z.jsx)(`iframe`,{ref:r,src:t,name:i(e?.contentParams),className:`absolute inset-0 w-full h-full border-0`,title:e?.title||`NextClaw Docs`,sandbox:o,tabIndex:u?0:void 0,onLoad:l,onPointerOver:u,allow:`clipboard-read; clipboard-write`,allowFullScreen:!0},a),(c||s)&&(0,z.jsx)(`div`,{className:`absolute inset-0 z-10`})]})}function St(e){try{let t=new URL(e,window.location.origin);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function Ct({currentUrl:e,isVisible:t}){if(!t||!St(e))return null;let n=A(e)?o(`docBrowserOpenExternal`):o(`docBrowserOpenInBrowser`);return(0,z.jsx)(`div`,{className:`flex items-center justify-between border-t border-border/70 bg-muted/55 px-4 py-2 shrink-0`,children:(0,z.jsx)(c,{href:e,external:!0,iconPosition:`trailing`,size:`xs`,"data-doc-external":!0,children:n})})}var wt={apps:P,docs:E,github:I,"new-tab":D,"panel-app":M,"service-apps":M};function Tt({fallbackIcon:e,url:t}){let[n,r]=(0,R.useState)(!1);return n?(0,z.jsx)(e,{className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`}):(0,z.jsx)(`img`,{src:t,alt:``,className:`h-3.5 w-3.5 rounded-sm object-cover`,onError:()=>r(!0)})}function Et({tab:e}){let{dockIcon:t}=e,n=e.kind===`docs`?E:e.kind===`home`?D:e.kind===`apps`?P:M,r=t?.type===`builtin`?wt[t.name]??n:n;return t?.type===`url`?(0,z.jsx)(Tt,{fallbackIcon:n,url:t.url},t.url):t?.type===`text`?(0,z.jsx)(`span`,{className:`max-w-3.5 truncate text-[10px] font-semibold leading-none`,"aria-hidden":`true`,children:t.value}):(0,z.jsx)(r,{className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`})}function Dt(e){return e instanceof Element&&!!e.closest(`button, a, input, textarea, select, [data-compact-tab-item]`)}function Ot({tabs:e,activeTabId:t,canGoBack:n,canGoForward:i,isDocked:a,isFullscreen:s,dockState:c,onGoBack:l,onGoForward:u,onOpenNewTab:d,onToggleDock:f,onSetActiveTab:p,onCloseTab:m,onClose:h,onDragStart:g,onToggleMode:_,getTabMenuGroups:v}){let y=o(`docBrowserBack`),b=o(`docBrowserClose`),x=o(`docBrowserCloseTab`),S=c?.isDocked?c.removable?o(`sideDockUnpinCurrent`):o(`sideDockBuiltInDocked`):o(`sideDockPinCurrent`),C=o(`docBrowserForward`),w=o(a?`docBrowserFloatMode`:`docBrowserDockMode`),T=o(`docBrowserNewTab`);return(0,z.jsx)(pt,{testId:`doc-browser-tab-strip`,actionsTestId:`doc-browser-tab-actions`,tabs:e.map(e=>({key:e.id,label:e.title||o(`docBrowserTabUntitled`),active:e.id===t,tooltip:e.title,leadingIcon:(0,z.jsx)(Et,{tab:e}),closeLabel:x,closePlacement:`leading-hover`,onSelect:()=>p(e.id),onClose:()=>m(e.id),menuLabel:o(`docBrowserTabMoreActions`),menuGroups:v?.(e)})),actions:[{key:`back`,disabled:!n,icon:(0,z.jsx)(ee,{className:`h-3.5 w-3.5`}),label:y,onClick:l},{key:`forward`,disabled:!i,icon:(0,z.jsx)(N,{className:`h-3.5 w-3.5`}),label:C,onClick:u},{key:`new-tab`,icon:(0,z.jsx)(D,{className:`h-3.5 w-3.5`}),label:T,onClick:d},...c?.canDock?[{key:`dock`,disabled:c.isDocked&&!c.removable,icon:c.isDocked&&c.removable?(0,z.jsx)(le,{className:`h-3.5 w-3.5`}):(0,z.jsx)(L,{className:`h-3.5 w-3.5`}),label:S,onClick:()=>f?.()}]:[],...s?[]:[{key:`mode`,icon:a?(0,z.jsx)(ce,{className:`h-3.5 w-3.5`}):(0,z.jsx)(se,{className:`h-3.5 w-3.5`}),label:w,onClick:_}],{key:`close`,icon:(0,z.jsx)(k,{className:`h-3.5 w-3.5`}),label:b,onClick:h}],className:r(`h-10 gap-1.5 border-border/50 bg-card/80 px-2 shrink-0 select-none`,s&&`h-[calc(env(safe-area-inset-top,0px)+2.5rem)] pt-[env(safe-area-inset-top,0px)]`),scrollClassName:r(`doc-browser-tab-scrollbar flex h-full items-center gap-0.5`,!a&&!s&&`cursor-grab active:cursor-grabbing`),tabsClassName:`items-center gap-0.5`,actionsClassName:`h-full items-center gap-0.5`,actionButtonClassName:`rounded-md p-1.5 text-muted-foreground hover:bg-muted/60 hover:text-foreground disabled:opacity-50`,tabBaseClassName:`inline-flex cursor-pointer items-center gap-0.5 h-7 px-2 rounded-md text-xs max-w-[220px] shrink-0 transition-colors`,activeTabClassName:`bg-muted/80 text-foreground`,inactiveTabClassName:`text-muted-foreground hover:bg-muted/45 hover:text-foreground`,labelClassName:`px-0.5 text-xs font-normal`,onPointerDown:!a&&!s?g:void 0,onScrollPointerDown:e=>{if(Dt(e.target)){e.stopPropagation();return}!a&&!s&&(e.stopPropagation(),g(e))}})}var Q=40,kt=360,At=400;function $(e,t,n){return Math.min(n,Math.max(t,e))}function jt(e,t){return e.split(`-`).includes(t)}function Mt(){return{x:Math.max(Q,window.innerWidth-520),y:80,w:480,h:600}}function Nt(e,t,n){return{...e,x:$(e.x+t,Q,window.innerWidth-Q-e.w),y:$(e.y+n,Q,window.innerHeight-Q-e.h)}}function Pt(e,t,n,r){let i=t.x+t.w,a=t.y+t.h,o=jt(e,`left`)?$(t.x+n,Q,i-kt):t.x,s=jt(e,`right`)?$(i+n,o+kt,window.innerWidth-Q):i,c=jt(e,`top`)?$(t.y+r,Q,a-At):t.y,l=jt(e,`bottom`)?$(a+r,c+At,window.innerHeight-Q):a;return{x:o,y:c,w:s-o,h:l-c}}function Ft({children:e,className:t,style:n,defaultWidth:i=420,minWidth:a=320,maxWidth:o=860,onWidthCommit:s,overlay:c=!1,overlayScope:l=`viewport`,width:u,...d}){let f=(0,R.useRef)(null),p=(0,R.useRef)(u??i),[m,h]=(0,R.useState)(!1),[g,_]=(0,R.useState)(null),[v,y]=(0,R.useState)(i),b=g??u??v,x=c?l===`container`?`absolute inset-0 z-30`:`fixed inset-0 z-40`:`border-l border-border`,S=e=>{if(c)return;e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture?.(e.pointerId),h(!0),p.current=b,f.current={startX:e.clientX,startWidth:b};let t=e=>{let t=f.current;if(!t)return;let n=t.startWidth+t.startX-e.clientX,r=Math.max(a,Math.min(o,n));p.current=r,_(r)},n=()=>{u===void 0&&y(p.current),s?.(p.current),_(null),h(!1),f.current=null,window.removeEventListener(`pointermove`,t),window.removeEventListener(`pointerup`,n),window.removeEventListener(`pointercancel`,n)};window.addEventListener(`pointermove`,t),window.addEventListener(`pointerup`,n),window.addEventListener(`pointercancel`,n)};return(0,z.jsxs)(`aside`,{...d,className:r(`relative flex h-full min-h-0 shrink-0 overflow-hidden bg-card text-card-foreground`,x,t),style:c?n:{...n,width:b},children:[(0,z.jsx)(`div`,{className:`flex h-full min-h-0 w-full flex-col overflow-hidden`,children:e}),c?null:(0,z.jsx)(`div`,{className:`absolute left-0 top-0 z-30 h-full w-3 cursor-ew-resize transition-colors hover:bg-primary/10`,"data-testid":`resizable-right-panel-handle`,onPointerDown:S}),m?(0,z.jsx)(`div`,{className:`absolute inset-0 z-10 cursor-ew-resize`,"data-testid":`resizable-right-panel-resize-shield`}):null]})}var It=`allow-same-origin allow-scripts allow-popups allow-forms`;function Lt(e,t){if(e.startsWith(`/`))try{return new URL(e,t).toString()}catch{return e}return/^[a-z][a-z\d+.-]*:\/\//i.test(e)||e===`about:blank`?e:/^(localhost|127\.|0\.0\.0\.0|\[::1\])(?::|\/|$)/i.test(e)?`http://${e}`:`https://${e}`}function Rt(e,t){if(!t)return It;let n=e?.getIframeSandbox?.(t);return n===void 0?t.kind===`content`?void 0:It:n}function zt(e,t,n){return(0,R.useCallback)(()=>{if(n?.canDock){if(n.isDocked){n.removable&&e?.unpinTab(t);return}e?.pinTab(t)}},[t,e,n])}function Bt({activeTabId:e,currentUrl:t,isAddressToolbarTab:n,isContentTab:r,isDocsTab:i,navigate:a}){let o=`${e}:${t}:${r?`content`:`docs`}`,[s,c]=(0,R.useState)(null),l=(()=>{if(!n)return``;if(r)return t;try{return new URL(t).pathname}catch{return t}})(),u=s?.key===o?s.value:l,d=(0,R.useCallback)(e=>c({key:o,value:e}),[o]);return{handleUrlSubmit:(0,R.useCallback)(e=>{if(e.preventDefault(),!n)return;let r=u.trim();r&&(i&&r.startsWith(`/`)?a(j(r)):i&&r.startsWith(`http`)?a(r):a(i?j(`/${r}`):Lt(r,t)))},[t,n,i,a,u]),setUrlInput:d,urlInput:u}}function Vt({customTabRenderers:e={},displayMode:t=`desktop`,dockControls:n,getTabMenuGroups:i}){let{isOpen:a,mode:s,dockedWidth:c,tabs:l,activeTabId:u,activeHistory:d,activeHistoryIndex:f,currentTab:p,open:m,openTarget:h,openNewTab:g,close:_,toggleMode:v,setDockedWidth:y,goBack:b,goForward:x,navigate:S,syncUrl:C,setActiveTab:w,closeTab:T}=ie(),[ee,te]=(0,R.useState)(0),[E,D]=(0,R.useState)(Mt),[O,k]=(0,R.useState)(null),A=(0,R.useRef)(null),j=p?.currentUrl??ae(),M=p?.navVersion??0,N=`${u}:${M}:${ee}`,P=(0,R.useRef)(null),F=(0,R.useRef)(M),I=p?.kind===`docs`,se=p?.kind===re,ce=f>0,le=f<d.length-1,L=p?e[p.kind]:void 0,B=n?.getDockState(p),ue=p?.kind===`content`,V=I||ue,de=yt({currentTab:p,iframeRef:A,isEnabled:L?.supportsScrollRestoration===!0}),{handleUrlSubmit:fe,setUrlInput:H,urlInput:pe}=Bt({activeTabId:u,currentUrl:j,isAddressToolbarTab:V,isContentTab:ue,isDocsTab:I,navigate:S});(0,R.useEffect)(()=>{if(!I){P.current=null;return}if(M!==F.current){F.current=M,P.current=ne(j);return}if(A.current?.contentWindow)try{let e=new URL(j).pathname;P.current=ne(j),A.current.contentWindow.postMessage({type:`docs-navigate`,path:e},`*`)}catch{}},[j,M,I]),(0,R.useEffect)(()=>{let e=e=>{if(I&&e.data?.type===`docs-route-change`&&typeof e.data.url==`string`){let t=ne(e.data.url);if(P.current&&t!==P.current)return;P.current=null,C(e.data.url)}};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[j,C,I]),(0,R.useEffect)(()=>{if(!p||!L?.onIframeMessage)return;let e=e=>{L.onIframeMessage?.({event:e,iframe:A.current,iframeInstanceId:N,tab:p})};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[p,L,N]);let U=(0,R.useCallback)(e=>{e.preventDefault(),k({kind:`drag`,startX:e.clientX,startY:e.clientY,startRect:E})},[E]),W=(0,R.useCallback)(e=>t=>{t.preventDefault(),t.stopPropagation(),k({kind:`resize`,edge:e,startX:t.clientX,startY:t.clientY,startRect:E})},[E]);(0,R.useEffect)(()=>{if(!O)return;let e=e=>{let{startRect:t,startX:n,startY:r}=O,i=e.clientX-n,a=e.clientY-r;if(O.kind===`drag`){D(Nt(t,i,a));return}D(Pt(O.edge,t,i,a))},t=()=>k(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)}},[O]);let G=(0,R.useCallback)(()=>{te(e=>e+1)},[]),me=zt(n,p,B);if(!a)return null;let K=s===`docked`,q=t===`fullscreen`,J=p?{currentUrl:j,open:m,openTarget:h,refreshIframe:G,tab:p}:void 0,he=J?L?.renderToolbar?.(J):null,Y=J?L?.renderContent?.(J)??(se?(0,z.jsx)(mt,{}):null):null,ge=Rt(L,p),_e=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Ot,{tabs:l,activeTabId:u,canGoBack:ce,canGoForward:le,dockState:B,isDocked:K,isFullscreen:q,onGoBack:b,onGoForward:x,onOpenNewTab:g,onToggleDock:me,onSetActiveTab:w,onCloseTab:T,onClose:_,onDragStart:U,onToggleMode:v,getTabMenuGroups:i}),(0,z.jsx)(bt,{isVisible:V,onRefresh:G,onSubmit:fe,onUrlInputChange:H,placeholder:o(I?`docBrowserSearchPlaceholder`:`docBrowserAddressPlaceholder`),urlInput:pe}),he,(0,z.jsx)(xt,{currentTab:p,currentUrl:j,customContent:Y,iframeRef:A,iframeInstanceId:N,iframeSandbox:ge,isDragging:O?.kind===`drag`,isResizing:O?.kind===`resize`,onIframeLoad:de,onIframePointerOver:L?.onIframePointerOver}),(0,z.jsx)(Ct,{currentUrl:j,isVisible:I||ue})]});return K&&!q?(0,z.jsx)(Ft,{"data-testid":`doc-browser-panel`,defaultWidth:c,width:c,minWidth:320,maxWidth:860,onWidthCommit:y,children:_e}):(0,z.jsxs)(`div`,{"data-testid":`doc-browser-panel`,className:r(`relative flex flex-col overflow-hidden bg-card text-card-foreground`,q?`fixed inset-0 z-[var(--z-floating-panel)] h-[100dvh] w-screen rounded-none border-0 shadow-2xl`:`rounded-2xl border border-border shadow-2xl`),style:q?void 0:{position:`fixed`,left:E.x,top:E.y,width:E.w,height:E.h,zIndex:`var(--z-floating-panel)`},children:[_e,!K&&!q&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`absolute top-0 left-0 h-3 w-full cursor-ns-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-top`,onPointerDown:W(`top`)}),(0,z.jsx)(`div`,{className:`absolute top-0 left-0 w-3 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-left`,onPointerDown:W(`left`)}),(0,z.jsx)(`div`,{className:`absolute top-0 right-0 w-3 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-right`,onPointerDown:W(`right`)}),(0,z.jsx)(`div`,{className:`absolute bottom-0 left-0 h-3 w-full cursor-ns-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-bottom`,onPointerDown:W(`bottom`)}),(0,z.jsx)(`div`,{className:`absolute top-0 left-0 z-30 h-4 w-4 cursor-nw-resize hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-top-left`,onPointerDown:W(`top-left`)}),(0,z.jsx)(`div`,{className:`absolute top-0 right-0 z-30 h-4 w-4 cursor-ne-resize hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-top-right`,onPointerDown:W(`top-right`)}),(0,z.jsx)(`div`,{className:`absolute bottom-0 left-0 z-30 h-4 w-4 cursor-sw-resize hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-bottom-left`,onPointerDown:W(`bottom-left`)}),(0,z.jsx)(`div`,{className:`absolute bottom-0 right-0 z-30 flex h-4 w-4 cursor-se-resize items-center justify-center text-muted-foreground/45 transition-colors hover:text-muted-foreground`,"data-testid":`doc-browser-resize-bottom-right`,onPointerDown:W(`bottom-right`),children:(0,z.jsx)(oe,{className:`w-3 h-3 rotate-[-45deg]`})})]})]})}export{L as C,P as D,F as E,N as O,Fe as S,I as T,Be as _,it as a,Ne as b,We as c,Ke as d,qe as f,Re as g,Ve as h,pt as i,M as k,Ge as l,ze as m,Ft as n,at as o,Z as p,vt as r,$e as s,Vt as t,Je as u,Le as v,se as w,Pe as x,Ie as y};