arco-workbench 0.1.4 → 0.1.5

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 (1363) hide show
  1. package/CONTRIBUTING.md +40 -8
  2. package/README.md +35 -21
  3. package/THIRD_PARTY_NOTICES +789 -0
  4. package/client/dist/assets/{PhosphorBackdrop-CNumba2X.js → PhosphorBackdrop-D6cbmLNY.js} +1 -1
  5. package/client/dist/assets/{ThemedBackgroundShaderImpl-DX5KyCt3.js → ThemedBackgroundShaderImpl-2dyerOi4.js} +1 -1
  6. package/client/dist/assets/{XtermView-DhS5g8Rt.js → XtermView-AIwo7O3D.js} +2 -2
  7. package/client/dist/assets/galleryEditor-DXAuxS8D.js +702 -0
  8. package/client/dist/assets/index-8j6p-pmQ.js +610 -0
  9. package/client/dist/assets/index-DD9kFGsF.css +1 -0
  10. package/client/dist/index.html +2 -2
  11. package/client/src/App.tsx +44 -55
  12. package/client/src/alerts/desktopAlerts.ts +20 -12
  13. package/client/src/alerts/desktopTest.ts +68 -0
  14. package/client/src/alerts/focusNotice.ts +16 -0
  15. package/client/src/buildCheck.ts +42 -2
  16. package/client/src/components/ArchitectureReviewDialog.tsx +98 -0
  17. package/client/src/components/ArtifactModal.tsx +4 -6
  18. package/client/src/components/ArtifactMoveDialog.tsx +11 -7
  19. package/client/src/components/AskUserQuestionNotice.tsx +2 -1
  20. package/client/src/components/AutomaticMessage.tsx +19 -0
  21. package/client/src/components/BriefControl.tsx +4 -2
  22. package/client/src/components/BrowserNotice.tsx +35 -0
  23. package/client/src/components/CatchMeUp.tsx +12 -6
  24. package/client/src/components/ChatMessage.tsx +15 -4
  25. package/client/src/components/ChatModeView.tsx +23 -16
  26. package/client/src/components/ChatPanel.tsx +33 -5
  27. package/client/src/components/CheckpointActions.tsx +91 -26
  28. package/client/src/components/ClusterActivityTab.tsx +4 -2
  29. package/client/src/components/ClusterMemberPicker.tsx +6 -3
  30. package/client/src/components/ClusterPlanTab.tsx +93 -62
  31. package/client/src/components/ClusterRightPanel/AddWorkerSection.tsx +16 -5
  32. package/client/src/components/ClusterRightPanel/AutoPickupControl.tsx +25 -14
  33. package/client/src/components/ClusterRightPanel/MailboxModal.tsx +7 -3
  34. package/client/src/components/ClusterRightPanel/MemberRow.tsx +5 -2
  35. package/client/src/components/ClusterRightPanel/MemberSettingsFields.tsx +104 -0
  36. package/client/src/components/ClusterRightPanel/MessageGuardControl.tsx +1 -1
  37. package/client/src/components/ClusterRightPanel/ReplaceMemberDialog.tsx +85 -7
  38. package/client/src/components/ClusterRightPanel/index.tsx +90 -36
  39. package/client/src/components/ClusterRightPanel/memberSettings.ts +52 -0
  40. package/client/src/components/ClusterRightPanel/panels.ts +18 -0
  41. package/client/src/components/ClusterRightPanel/types.ts +9 -10
  42. package/client/src/components/ClusterTab.tsx +252 -62
  43. package/client/src/components/ClusterTaskBoardTab.tsx +22 -598
  44. package/client/src/components/CommandPalette.tsx +17 -6
  45. package/client/src/components/ComputerAgentPicker.tsx +1 -1
  46. package/client/src/components/ComputerPanel.tsx +4 -2
  47. package/client/src/components/Connections/Connections.tsx +5 -2
  48. package/client/src/components/Connections/EndpointEditor.tsx +2 -2
  49. package/client/src/components/Connections/connections.css +1 -1
  50. package/client/src/components/Connections/model.ts +5 -1
  51. package/client/src/components/ContextMeter.tsx +15 -4
  52. package/client/src/components/DeepSeekControls.tsx +7 -6
  53. package/client/src/components/DiagnosticsTab.tsx +3 -2
  54. package/client/src/components/DialogShell.tsx +19 -11
  55. package/client/src/components/FileExplorer.tsx +8 -9
  56. package/client/src/components/FileViewerModal.tsx +37 -12
  57. package/client/src/components/FirstRun.tsx +8 -7
  58. package/client/src/components/GateApprovalNotice.tsx +4 -2
  59. package/client/src/components/GitDialog.tsx +1 -0
  60. package/client/src/components/GitHubPanel/CodeView.tsx +35 -23
  61. package/client/src/components/GitHubPanel/IssueView.tsx +6 -4
  62. package/client/src/components/GitHubPanel/PullView.tsx +7 -6
  63. package/client/src/components/GitHubPanel/RunView.tsx +7 -5
  64. package/client/src/components/GitHubPanel/shared.tsx +23 -8
  65. package/client/src/components/HandoffSeedPill.tsx +5 -5
  66. package/client/src/components/HandoffSource.tsx +54 -0
  67. package/client/src/components/HeaderAuthChip.tsx +22 -1
  68. package/client/src/components/HeaderDropdown.tsx +5 -0
  69. package/client/src/components/HeaderVersionBox.tsx +3 -0
  70. package/client/src/components/HistoryTab.tsx +59 -32
  71. package/client/src/components/Home/AddProject.tsx +1 -1
  72. package/client/src/components/Home/HomeView.tsx +28 -19
  73. package/client/src/components/Home/LocationDialog.tsx +1 -1
  74. package/client/src/components/Home/ProjectCard.tsx +5 -3
  75. package/client/src/components/Home/home.css +4 -4
  76. package/client/src/components/KeepButton.tsx +22 -0
  77. package/client/src/components/LlamacppCatalogEditor.tsx +12 -3
  78. package/client/src/components/LocalRuntimeStatus.tsx +54 -0
  79. package/client/src/components/MdTuneupDialog.tsx +3 -1
  80. package/client/src/components/MemberCard.tsx +44 -42
  81. package/client/src/components/MemberPane.tsx +11 -10
  82. package/client/src/components/ModelHealthPanel.tsx +5 -4
  83. package/client/src/components/NativeSubagentControls.tsx +64 -0
  84. package/client/src/components/NeedsYouBadge.tsx +13 -6
  85. package/client/src/components/NorthStarBar.tsx +5 -3
  86. package/client/src/components/NotificationCenter.tsx +14 -2
  87. package/client/src/components/NotificationChannelsSettings.tsx +38 -30
  88. package/client/src/components/NotificationToasts.tsx +6 -8
  89. package/client/src/components/PendingQuestionsButton.tsx +4 -1
  90. package/client/src/components/PlanBodyRenderer.tsx +1 -0
  91. package/client/src/components/PlanCandidateBanner.tsx +20 -3
  92. package/client/src/components/PlanReviewPicker.tsx +6 -3
  93. package/client/src/components/PreviewTab.tsx +62 -25
  94. package/client/src/components/PrimaryStatus.tsx +20 -74
  95. package/client/src/components/ProjectsSettings.tsx +28 -2
  96. package/client/src/components/ProviderReleasesModal.tsx +13 -3
  97. package/client/src/components/ProvidersPopover.tsx +81 -23
  98. package/client/src/components/PublicProjectBox.tsx +10 -6
  99. package/client/src/components/PurgeConversationModal.tsx +7 -2
  100. package/client/src/components/QueuedMessagesIndicator.tsx +42 -150
  101. package/client/src/components/Recall/RecallResultRow.tsx +4 -2
  102. package/client/src/components/Recall/RecallView.tsx +12 -9
  103. package/client/src/components/ResearchDialog.tsx +1 -1
  104. package/client/src/components/ReviewDialog.tsx +12 -5
  105. package/client/src/components/RightPanel/ActivityTab.tsx +32 -16
  106. package/client/src/components/RightPanel/CodebaseMemorySection.tsx +3 -1
  107. package/client/src/components/RightPanel/ConfigTab.tsx +129 -140
  108. package/client/src/components/RightPanel/GenesisTab.tsx +67 -24
  109. package/client/src/components/RightPanel/HandoffsTab.tsx +4 -0
  110. package/client/src/components/RightPanel/KnowledgeTab.tsx +1 -1
  111. package/client/src/components/RightPanel/LedgerTab.tsx +1 -1
  112. package/client/src/components/RightPanel/McpRegistrySection.tsx +7 -6
  113. package/client/src/components/RightPanel/MoveTargetModal.tsx +6 -3
  114. package/client/src/components/RightPanel/OutputsPanel.tsx +40 -17
  115. package/client/src/components/RightPanel/PlanTab.tsx +109 -111
  116. package/client/src/components/RightPanel/ReviewTab.tsx +7 -4
  117. package/client/src/components/RightPanel/UsageTab.tsx +18 -5
  118. package/client/src/components/RightPanel/format.ts +3 -1
  119. package/client/src/components/RightPanel/index.tsx +10 -2
  120. package/client/src/components/RightPanel/types.ts +4 -2
  121. package/client/src/components/RunAsPicker.tsx +5 -3
  122. package/client/src/components/RuntimeStateBanner.tsx +13 -3
  123. package/client/src/components/SavedClustersList.tsx +30 -3
  124. package/client/src/components/ServicesTab.tsx +17 -34
  125. package/client/src/components/SettingsPanel.tsx +101 -337
  126. package/client/src/components/ShortcutCheatSheet.tsx +6 -4
  127. package/client/src/components/SkillEditorDialog.tsx +2 -1
  128. package/client/src/components/SkillsSettings.tsx +307 -0
  129. package/client/src/components/SpawnDialog.tsx +3 -3
  130. package/client/src/components/SpawnSeedPill.tsx +5 -4
  131. package/client/src/components/StaleBuildBanner.tsx +3 -1
  132. package/client/src/components/StorageWarnings.tsx +3 -1
  133. package/client/src/components/SystemHeader.tsx +17 -10
  134. package/client/src/components/SystemModal.tsx +6 -5
  135. package/client/src/components/TabBar.tsx +20 -10
  136. package/client/src/components/TabContextMenu.tsx +36 -10
  137. package/client/src/components/TaskCard.tsx +16 -11
  138. package/client/src/components/TasksPanel.tsx +13 -11
  139. package/client/src/components/Terminal/XtermView.tsx +2 -0
  140. package/client/src/components/TerminalInput.tsx +248 -447
  141. package/client/src/components/TerminalSessions.tsx +1 -1
  142. package/client/src/components/TokenBadge.tsx +20 -17
  143. package/client/src/components/ToolCallPill.tsx +5 -3
  144. package/client/src/components/ToolboxMenu.tsx +5 -5
  145. package/client/src/components/TranscriptSendDialog.tsx +1 -1
  146. package/client/src/components/TurnTimer.tsx +21 -0
  147. package/client/src/components/UpdateAction.tsx +4 -1
  148. package/client/src/components/UsageBar.tsx +32 -126
  149. package/client/src/components/UserManual/index.tsx +6 -4
  150. package/client/src/components/VoiceMenu.tsx +5 -1
  151. package/client/src/components/VoiceSetupSettings.tsx +21 -11
  152. package/client/src/components/WorkerCard.tsx +7 -1
  153. package/client/src/components/WorkerDetailModal.tsx +7 -3
  154. package/client/src/components/WorkflowCreator/ClusterMembersSection.tsx +6 -6
  155. package/client/src/components/WorkflowCreator/ProjectPicker.tsx +13 -12
  156. package/client/src/components/WorkflowCreator/index.tsx +237 -78
  157. package/client/src/components/WorkflowCreator/types.ts +5 -3
  158. package/client/src/components/WorkflowStatusChip.tsx +93 -13
  159. package/client/src/components/WorkflowView.tsx +55 -24
  160. package/client/src/components/WorkspaceRename.tsx +11 -1
  161. package/client/src/components/activityTime.ts +4 -0
  162. package/client/src/components/compare/CompareDialog.tsx +6 -3
  163. package/client/src/components/compare/CompareOverlay.tsx +10 -3
  164. package/client/src/components/composer/submitComposer.ts +191 -0
  165. package/client/src/components/diff/ChangesPanel.tsx +4 -2
  166. package/client/src/components/diff/LiveChangesPanel.tsx +18 -2
  167. package/client/src/components/editor/CodeEditor.tsx +17 -2
  168. package/client/src/components/headerPopoverState.ts +15 -0
  169. package/client/src/components/help/DocViewer.tsx +6 -4
  170. package/client/src/components/help/HelpCard.tsx +3 -2
  171. package/client/src/components/help/HelpPopover.tsx +3 -1
  172. package/client/src/components/media/AudioEditor/AudioOpsPanel.tsx +16 -2
  173. package/client/src/components/media/DirectoryPicker.tsx +18 -11
  174. package/client/src/components/media/ImageEditor/ImageEditor.tsx +2 -2
  175. package/client/src/components/media/MediaModalHost.tsx +7 -15
  176. package/client/src/components/media/MediaStemsControls.tsx +16 -2
  177. package/client/src/components/media/VideoEditor/VideoOpsPanel.tsx +16 -2
  178. package/client/src/components/media/launchers.ts +4 -0
  179. package/client/src/components/plans/PlanChooser.tsx +135 -0
  180. package/client/src/components/plans/PlanRefsSection.tsx +47 -28
  181. package/client/src/components/plans/planBodySave.ts +17 -0
  182. package/client/src/components/plans/planRefs.ts +21 -11
  183. package/client/src/components/plans/startPlanGenesis.ts +37 -0
  184. package/client/src/components/primitives/Panel.tsx +1 -0
  185. package/client/src/components/providerPanelState.ts +17 -0
  186. package/client/src/components/settings/AppVersionSection.tsx +5 -5
  187. package/client/src/components/settings/AppWindowBrowserSection.tsx +88 -0
  188. package/client/src/components/settings/PreviewPortsSection.tsx +31 -0
  189. package/client/src/components/settings/SettingsLayout.tsx +1 -1
  190. package/client/src/components/settings/appWindowBrowserReport.ts +23 -0
  191. package/client/src/components/settings/navigation.ts +5 -1
  192. package/client/src/components/settings/settings.css +6 -0
  193. package/client/src/components/terminalInput/planDraft.ts +5 -5
  194. package/client/src/components/usageVisibility.ts +3 -2
  195. package/client/src/components/workSurface/WorkSurfaceControls.tsx +125 -10
  196. package/client/src/components/workSurface/workSurface.css +10 -2
  197. package/client/src/explorer/ArtifactsLens.tsx +53 -17
  198. package/client/src/explorer/ExplorerApp.tsx +8 -6
  199. package/client/src/explorer/PlansLens.tsx +80 -20
  200. package/client/src/explorer/RecentsLens.tsx +22 -61
  201. package/client/src/explorer/StorageLens.tsx +10 -4
  202. package/client/src/explorer/changedAttribution.ts +23 -0
  203. package/client/src/explorer/launch.ts +6 -3
  204. package/client/src/explorer/treeReveal.ts +21 -0
  205. package/client/src/explorer/types.ts +3 -3
  206. package/client/src/help/content/chat.tsx +17 -10
  207. package/client/src/help/content/cluster.tsx +135 -104
  208. package/client/src/help/content/composer.tsx +124 -43
  209. package/client/src/help/content/gitOps.tsx +19 -19
  210. package/client/src/help/content/github.tsx +9 -4
  211. package/client/src/help/content/header.tsx +70 -51
  212. package/client/src/help/content/media.tsx +20 -20
  213. package/client/src/help/content/misc.tsx +347 -163
  214. package/client/src/help/content/recall.tsx +12 -12
  215. package/client/src/help/content/rightPanel.tsx +199 -102
  216. package/client/src/help/content/settings.tsx +117 -44
  217. package/client/src/help/content/shared.tsx +1 -1
  218. package/client/src/help/content/tabbar.tsx +1 -1
  219. package/client/src/help/manualSections/actions.tsx +24 -17
  220. package/client/src/help/manualSections/chat.tsx +28 -5
  221. package/client/src/help/manualSections/clusters.tsx +193 -131
  222. package/client/src/help/manualSections/configuration.tsx +232 -48
  223. package/client/src/help/manualSections/deepseek.tsx +7 -5
  224. package/client/src/help/manualSections/gettingStarted.tsx +74 -12
  225. package/client/src/help/manualSections/maintenance.tsx +60 -13
  226. package/client/src/help/manualSections/media.tsx +14 -12
  227. package/client/src/help/manualSections/plans.tsx +108 -25
  228. package/client/src/help/manualSections/powerFeatures.tsx +145 -50
  229. package/client/src/help/manualSections/providers.tsx +237 -42
  230. package/client/src/help/manualSections/reference.tsx +19 -11
  231. package/client/src/help/manualSections/strata.tsx +6 -6
  232. package/client/src/help/manualSections/troubleshooting.tsx +14 -8
  233. package/client/src/help/manualSections/voice.tsx +12 -7
  234. package/client/src/help/manualSections/workflows.tsx +76 -19
  235. package/client/src/help/manualSections/workspace.tsx +173 -46
  236. package/client/src/help/shortcuts.ts +1 -0
  237. package/client/src/hooks/useWebSocket.ts +49 -25
  238. package/client/src/layout/SlideOut.tsx +77 -0
  239. package/client/src/layout/ToolbarOverflow.tsx +97 -0
  240. package/client/src/layout/keepInWindow.ts +216 -0
  241. package/client/src/layout/layoutRange.ts +129 -0
  242. package/client/src/main.tsx +2 -0
  243. package/client/src/phosphor-demo/Demo.tsx +5 -13
  244. package/client/src/phosphor-demo/demo.css +1 -1
  245. package/client/src/stores/appStore.ts +65 -14
  246. package/client/src/stores/appStore.types.ts +35 -16
  247. package/client/src/stores/docEditStore.ts +13 -21
  248. package/client/src/stores/draftStore.ts +28 -4
  249. package/client/src/stores/knowledgeDistillStore.ts +4 -2
  250. package/client/src/stores/mdTuneupStore.ts +10 -5
  251. package/client/src/stores/notificationChannelsStore.ts +21 -11
  252. package/client/src/stores/planGenesisStore.ts +67 -0
  253. package/client/src/stores/recallStore.ts +6 -0
  254. package/client/src/stores/terminalStore.ts +1 -1
  255. package/client/src/styles/global.css +72 -0
  256. package/client/src/styles/matrix.css +7 -0
  257. package/client/src/themes/apply.ts +3 -3
  258. package/client/src/themes/bootstrap.ts +3 -0
  259. package/client/src/utils/activeProject.ts +6 -0
  260. package/client/src/utils/activityPresentation.ts +51 -0
  261. package/client/src/utils/browserFamily.ts +22 -0
  262. package/client/src/utils/chatFileLinks.ts +3 -2
  263. package/client/src/utils/chatText.ts +14 -6
  264. package/client/src/utils/checkedJson.ts +11 -0
  265. package/client/src/utils/checkpointChanges.ts +18 -0
  266. package/client/src/utils/clusterCreation.ts +39 -0
  267. package/client/src/utils/clusterNudge.ts +31 -0
  268. package/client/src/utils/displayMessages.ts +45 -7
  269. package/client/src/utils/effortDefaults.ts +4 -3
  270. package/client/src/utils/format.ts +11 -4
  271. package/client/src/utils/gateArgs.ts +3 -2
  272. package/client/src/utils/handoffSeeds.ts +13 -0
  273. package/client/src/utils/historyEvents.ts +21 -12
  274. package/client/src/utils/homeModel.ts +19 -3
  275. package/client/src/utils/memberReviewScope.ts +6 -0
  276. package/client/src/utils/outputNavigation.ts +16 -0
  277. package/client/src/utils/outputStyleText.ts +8 -0
  278. package/client/src/utils/publicProject.ts +102 -28
  279. package/client/src/utils/queuedMessageEdit.ts +40 -0
  280. package/client/src/utils/requestGeneration.ts +8 -0
  281. package/client/src/utils/rewindSupport.ts +17 -0
  282. package/client/src/utils/settingsRequests.ts +36 -0
  283. package/client/src/utils/settingsResponse.ts +8 -0
  284. package/client/src/utils/wsSession.ts +12 -5
  285. package/client/src/vendor/odysseus-editor/editor/clipboard-and-drop.js +9 -9
  286. package/client/src/vendor/odysseus-editor/editor/keyboard-shortcuts.js +2 -2
  287. package/client/src/vendor/odysseus-editor/editor/state.js +8 -0
  288. package/client/src/vendor/odysseus-editor/editor.css +13 -5
  289. package/client/src/vendor/odysseus-editor/galleryEditor.d.ts +1 -1
  290. package/client/src/vendor/odysseus-editor/galleryEditor.js +16 -5
  291. package/client/src/voice/executor.ts +4 -3
  292. package/client/src/voice/panels.ts +14 -3
  293. package/client/src/voice/screen.ts +48 -6
  294. package/client/src/voice/setupAudio.ts +5 -3
  295. package/client/src/ws/handleServerMessage.ts +154 -36
  296. package/client/src/ws/operatorQuestions.ts +2 -2
  297. package/docs/ARCHITECTURE.md +95 -55
  298. package/docs/ARCHITECTURE_REVIEW.md +47 -0
  299. package/docs/BACKUP.md +5 -2
  300. package/docs/CHAT.md +48 -37
  301. package/docs/CHECKPOINTS.md +43 -16
  302. package/docs/CLIENT.md +218 -82
  303. package/docs/CODEX_GPT56_CLUSTER_INCOMPAT.md +1 -1
  304. package/docs/DEEPSEEK.md +6 -6
  305. package/docs/DIAGNOSTICS.md +12 -7
  306. package/docs/EXTENDING.md +52 -48
  307. package/docs/FEATURES.md +33 -20
  308. package/docs/GENESIS.md +42 -6
  309. package/docs/GETTING_STARTED.md +59 -25
  310. package/docs/GIT_WORKBENCH.md +15 -9
  311. package/docs/GLOSSARY.md +42 -40
  312. package/docs/GOTCHAS.md +70 -57
  313. package/docs/HTTP_API.md +145 -47
  314. package/docs/INDEX.md +3 -4
  315. package/docs/KNOWLEDGE.md +6 -4
  316. package/docs/LOCAL_SERVICES.md +6 -6
  317. package/docs/LSP.md +4 -3
  318. package/docs/MCP_REGISTRY.md +16 -12
  319. package/docs/MEDIA_STUDIO.md +23 -16
  320. package/docs/NOTIFICATIONS.md +50 -17
  321. package/docs/OPERATIONS.md +211 -120
  322. package/docs/OPERATOR_ACTIONS.md +43 -24
  323. package/docs/OUTPUTS.md +27 -10
  324. package/docs/PERSISTENCE.md +88 -34
  325. package/docs/PHOSPHOR_DEMO.md +4 -4
  326. package/docs/PLAN_OR_BOARD.md +9 -4
  327. package/docs/PREVIEW_VERIFY.md +10 -8
  328. package/docs/PRIMITIVES.md +90 -87
  329. package/docs/PROTOCOL.md +100 -29
  330. package/docs/PROTOCOL_CLUSTER.md +77 -14
  331. package/docs/PROTOCOL_PRIMITIVES.md +9 -9
  332. package/docs/PROVIDERS.md +471 -82
  333. package/docs/RECALL.md +17 -12
  334. package/docs/REMOTE_MANAGEMENT.md +69 -8
  335. package/docs/REPO_LAYOUT.md +1 -1
  336. package/docs/RESUME_INDEX.md +16 -17
  337. package/docs/SERVICE_MODE.md +45 -10
  338. package/docs/SETTINGS.md +58 -7
  339. package/docs/STORAGE_PLAN.md +54 -49
  340. package/docs/STRATA.md +4 -4
  341. package/docs/TASK_LEDGER.md +33 -12
  342. package/docs/TERMINAL.md +14 -12
  343. package/docs/THIRD_PARTY.md +1 -3
  344. package/docs/VOICE.md +15 -7
  345. package/native/darwin-arm64/manifest.json +1 -1
  346. package/native/win32-arm64/manifest.json +1 -1
  347. package/node_modules/@arco/shared/dist/clusterCoordination.js +15 -7
  348. package/node_modules/@arco/shared/dist/clusterRolePresets.js +8 -6
  349. package/node_modules/@arco/shared/dist/codexChat.d.ts +2 -0
  350. package/node_modules/@arco/shared/dist/codexChat.js +5 -0
  351. package/node_modules/@arco/shared/dist/folderName.d.ts +1 -0
  352. package/node_modules/@arco/shared/dist/folderName.js +18 -0
  353. package/node_modules/@arco/shared/dist/index.d.ts +6 -0
  354. package/node_modules/@arco/shared/dist/index.js +6 -0
  355. package/node_modules/@arco/shared/dist/localRuntimeStatus.d.ts +23 -0
  356. package/node_modules/@arco/shared/dist/localRuntimeStatus.js +47 -0
  357. package/node_modules/@arco/shared/dist/notificationTitle.d.ts +9 -0
  358. package/node_modules/@arco/shared/dist/notificationTitle.js +23 -0
  359. package/node_modules/@arco/shared/dist/outputStyle.d.ts +10 -0
  360. package/node_modules/@arco/shared/dist/outputStyle.js +28 -0
  361. package/node_modules/@arco/shared/dist/outputs.d.ts +1 -0
  362. package/node_modules/@arco/shared/dist/protocol/autoPickup.d.ts +2 -0
  363. package/node_modules/@arco/shared/dist/protocol/chat.d.ts +4 -0
  364. package/node_modules/@arco/shared/dist/protocol/checkpoints.d.ts +24 -2
  365. package/node_modules/@arco/shared/dist/protocol/checkpoints.js +1 -0
  366. package/node_modules/@arco/shared/dist/protocol/clientMessages.d.ts +9 -14
  367. package/node_modules/@arco/shared/dist/protocol/clusters.d.ts +21 -4
  368. package/node_modules/@arco/shared/dist/protocol/clusters.js +3 -3
  369. package/node_modules/@arco/shared/dist/protocol/connections.d.ts +2 -0
  370. package/node_modules/@arco/shared/dist/protocol/diagnostics.js +1 -1
  371. package/node_modules/@arco/shared/dist/protocol/genesis.d.ts +9 -0
  372. package/node_modules/@arco/shared/dist/protocol/mcp.d.ts +1 -0
  373. package/node_modules/@arco/shared/dist/protocol/mcp.js +8 -5
  374. package/node_modules/@arco/shared/dist/protocol/mdTuneup.d.ts +2 -0
  375. package/node_modules/@arco/shared/dist/protocol/models.d.ts +3 -1
  376. package/node_modules/@arco/shared/dist/protocol/models.js +19 -8
  377. package/node_modules/@arco/shared/dist/protocol/notifications.d.ts +2 -1
  378. package/node_modules/@arco/shared/dist/protocol/notifications.js +15 -3
  379. package/node_modules/@arco/shared/dist/protocol/plans.d.ts +2 -1
  380. package/node_modules/@arco/shared/dist/protocol/remoteManagement.d.ts +6 -0
  381. package/node_modules/@arco/shared/dist/protocol/serverMessages.d.ts +69 -10
  382. package/node_modules/@arco/shared/dist/protocol/settings.d.ts +16 -4
  383. package/node_modules/@arco/shared/dist/protocol/settings.js +17 -1
  384. package/node_modules/@arco/shared/dist/protocol/tasks.d.ts +1 -0
  385. package/node_modules/@arco/shared/dist/protocol/usage.d.ts +1 -0
  386. package/node_modules/@arco/shared/dist/protocol/workers.d.ts +1 -0
  387. package/node_modules/@arco/shared/dist/protocol/workflows.d.ts +73 -14
  388. package/node_modules/@arco/shared/dist/protocol/workflows.js +66 -0
  389. package/node_modules/@arco/shared/dist/publicGuardrails.d.ts +1 -1
  390. package/node_modules/@arco/shared/dist/publicGuardrails.js +1 -1
  391. package/node_modules/@arco/shared/dist/runtimeVersions.d.ts +2 -0
  392. package/node_modules/@arco/shared/dist/runtimeVersions.js +13 -0
  393. package/node_modules/@arco/shared/dist/shellTool.d.ts +2 -0
  394. package/node_modules/@arco/shared/dist/shellTool.js +9 -0
  395. package/node_modules/@arco/shared/package.json +1 -1
  396. package/node_modules/xlsx/LICENSE +201 -0
  397. package/node_modules/xlsx/dist/cpexcel.js +1506 -0
  398. package/node_modules/xlsx/package.json +69 -0
  399. package/node_modules/xlsx/xlsx.js +28103 -0
  400. package/node_modules/xlsx/xlsx.mjs +28228 -0
  401. package/package.json +22 -3
  402. package/scripts/packaging/arco.mjs +3 -3
  403. package/scripts/packaging/browsers.mjs +366 -0
  404. package/scripts/packaging/launch.mjs +34 -20
  405. package/scripts/packaging/services.mjs +1 -1
  406. package/scripts/packaging/storage.mjs +39 -3
  407. package/server/dist/appBrowsers.d.ts +45 -0
  408. package/server/dist/appBrowsers.js +73 -0
  409. package/server/dist/architectureReview.d.ts +60 -0
  410. package/server/dist/architectureReview.js +347 -0
  411. package/server/dist/architectureSkill.d.ts +8 -0
  412. package/server/dist/architectureSkill.js +70 -0
  413. package/server/dist/arcoHome.d.ts +1 -0
  414. package/server/dist/arcoHome.js +43 -3
  415. package/server/dist/artifactCopy.d.ts +3 -0
  416. package/server/dist/artifactCopy.js +113 -36
  417. package/server/dist/atomicFile.d.ts +1 -1
  418. package/server/dist/atomicFile.js +6 -1
  419. package/server/dist/attention.d.ts +5 -1
  420. package/server/dist/attention.js +27 -16
  421. package/server/dist/auth.d.ts +1 -0
  422. package/server/dist/auth.js +19 -6
  423. package/server/dist/authLoginSession.d.ts +2 -0
  424. package/server/dist/authLoginSession.js +6 -1
  425. package/server/dist/boundedRead.d.ts +26 -0
  426. package/server/dist/boundedRead.js +246 -0
  427. package/server/dist/capabilities.d.ts +4 -1
  428. package/server/dist/capabilities.js +25 -8
  429. package/server/dist/catchUp.d.ts +7 -0
  430. package/server/dist/catchUp.js +20 -1
  431. package/server/dist/checkedFile.d.ts +5 -0
  432. package/server/dist/checkedFile.js +138 -0
  433. package/server/dist/claudeTransport.d.ts +7 -0
  434. package/server/dist/claudeTransport.js +14 -0
  435. package/server/dist/clusterAutoTurn.d.ts +7 -0
  436. package/server/dist/clusterAutoTurn.js +54 -7
  437. package/server/dist/clusterBusyReminder.d.ts +7 -0
  438. package/server/dist/clusterBusyReminder.js +45 -0
  439. package/server/dist/clusterDirector.js +6 -3
  440. package/server/dist/clusterIdleNudger.d.ts +6 -0
  441. package/server/dist/clusterIdleNudger.js +5 -0
  442. package/server/dist/clusterMailbox.d.ts +4 -2
  443. package/server/dist/clusterMailbox.js +104 -24
  444. package/server/dist/clusterPeerOps.js +9 -21
  445. package/server/dist/clusterPlanBridge.d.ts +6 -3
  446. package/server/dist/clusterPlanBridge.js +48 -45
  447. package/server/dist/clusterPresets.js +46 -32
  448. package/server/dist/clusterProgress.js +3 -0
  449. package/server/dist/clusterSnapshots.d.ts +1 -1
  450. package/server/dist/clusterSnapshots.js +17 -2
  451. package/server/dist/clusterStore.d.ts +3 -0
  452. package/server/dist/clusterStore.js +23 -13
  453. package/server/dist/clusterTurnTools.d.ts +4 -0
  454. package/server/dist/clusterTurnTools.js +9 -0
  455. package/server/dist/commandShell.d.ts +56 -0
  456. package/server/dist/commandShell.js +278 -0
  457. package/server/dist/compactionCounter.d.ts +6 -0
  458. package/server/dist/compactionCounter.js +73 -0
  459. package/server/dist/compactionReport.d.ts +8 -0
  460. package/server/dist/compactionReport.js +15 -0
  461. package/server/dist/contentSearch.js +16 -6
  462. package/server/dist/contextCalibrator.js +7 -2
  463. package/server/dist/contextEstimator.d.ts +4 -0
  464. package/server/dist/contextEstimator.js +76 -17
  465. package/server/dist/contextRefs.d.ts +1 -0
  466. package/server/dist/contextRefs.js +44 -9
  467. package/server/dist/conversationActivity.d.ts +3 -0
  468. package/server/dist/conversationActivity.js +27 -0
  469. package/server/dist/cursorUsage.js +15 -4
  470. package/server/dist/diagnostics/checks.js +4 -12
  471. package/server/dist/diagnostics/executableLookup.d.ts +2 -0
  472. package/server/dist/diagnostics/executableLookup.js +28 -0
  473. package/server/dist/diagnostics/modelHealth.js +3 -12
  474. package/server/dist/diagnostics/supportBundle.js +5 -13
  475. package/server/dist/eventLog.d.ts +19 -0
  476. package/server/dist/eventLog.js +299 -99
  477. package/server/dist/existingClusterMembers.d.ts +1 -0
  478. package/server/dist/existingClusterMembers.js +9 -0
  479. package/server/dist/explorerArtifacts.js +46 -12
  480. package/server/dist/explorerChanged.d.ts +7 -0
  481. package/server/dist/explorerChanged.js +116 -80
  482. package/server/dist/explorerDocs.d.ts +11 -0
  483. package/server/dist/explorerDocs.js +46 -48
  484. package/server/dist/explorerLaunch.d.ts +4 -0
  485. package/server/dist/explorerLaunch.js +9 -1
  486. package/server/dist/fileAccessPolicy.d.ts +21 -0
  487. package/server/dist/fileAccessPolicy.js +89 -1
  488. package/server/dist/fileContent/decodeSlots.d.ts +1 -0
  489. package/server/dist/fileContent/decodeSlots.js +50 -0
  490. package/server/dist/fileContent/detect.d.ts +2 -0
  491. package/server/dist/fileContent/detect.js +55 -0
  492. package/server/dist/fileContent/externalImage.d.ts +3 -0
  493. package/server/dist/fileContent/externalImage.js +68 -0
  494. package/server/dist/fileContent/icons.d.ts +4 -0
  495. package/server/dist/fileContent/icons.js +58 -0
  496. package/server/dist/fileContent/images.d.ts +15 -0
  497. package/server/dist/fileContent/images.js +182 -0
  498. package/server/dist/fileContent/legacyText.d.ts +3 -0
  499. package/server/dist/fileContent/legacyText.js +19 -0
  500. package/server/dist/fileContent/notebook.d.ts +2 -0
  501. package/server/dist/fileContent/notebook.js +54 -0
  502. package/server/dist/fileContent/office.d.ts +3 -0
  503. package/server/dist/fileContent/office.js +349 -0
  504. package/server/dist/fileContent/pdf.d.ts +2 -0
  505. package/server/dist/fileContent/pdf.js +76 -0
  506. package/server/dist/fileContent/pngRows.d.ts +4 -0
  507. package/server/dist/fileContent/pngRows.js +118 -0
  508. package/server/dist/fileContent/svg.d.ts +3 -0
  509. package/server/dist/fileContent/svg.js +60 -0
  510. package/server/dist/fileContent/types.d.ts +8 -0
  511. package/server/dist/fileContent/types.js +43 -0
  512. package/server/dist/fileContent/worker.d.ts +1 -0
  513. package/server/dist/fileContent/worker.js +68 -0
  514. package/server/dist/fileContent.d.ts +55 -0
  515. package/server/dist/fileContent.js +81 -0
  516. package/server/dist/fileContextReceipts.d.ts +12 -0
  517. package/server/dist/fileContextReceipts.js +53 -0
  518. package/server/dist/fileFetch.d.ts +17 -0
  519. package/server/dist/fileFetch.js +191 -0
  520. package/server/dist/fileVersion.d.ts +10 -0
  521. package/server/dist/fileVersion.js +43 -0
  522. package/server/dist/genesis/creative.js +28 -36
  523. package/server/dist/genesis/prompts.js +4 -0
  524. package/server/dist/genesis/savePlan.d.ts +5 -0
  525. package/server/dist/genesis/savePlan.js +49 -0
  526. package/server/dist/genesis/stages.js +4 -4
  527. package/server/dist/gitDiff.js +25 -5
  528. package/server/dist/gitSnapshots.d.ts +18 -0
  529. package/server/dist/gitSnapshots.js +280 -149
  530. package/server/dist/gitWorking.js +15 -13
  531. package/server/dist/github.js +5 -1
  532. package/server/dist/goalRun.d.ts +1 -1
  533. package/server/dist/goalRun.js +7 -5
  534. package/server/dist/handoffHistory.d.ts +26 -0
  535. package/server/dist/handoffHistory.js +80 -0
  536. package/server/dist/handoffHistoryProtocol.d.ts +59 -0
  537. package/server/dist/handoffHistoryProtocol.js +20 -0
  538. package/server/dist/handoffHistorySupport.d.ts +2 -0
  539. package/server/dist/handoffHistorySupport.js +11 -0
  540. package/server/dist/handoffHistoryTool.d.ts +29 -0
  541. package/server/dist/handoffHistoryTool.js +235 -0
  542. package/server/dist/handoffPrompts.js +6 -4
  543. package/server/dist/handoffReplay.d.ts +9 -0
  544. package/server/dist/handoffReplay.js +14 -0
  545. package/server/dist/handoffSeedCache.d.ts +3 -0
  546. package/server/dist/handoffSeedCache.js +26 -0
  547. package/server/dist/http/appBrowserRoutes.d.ts +3 -0
  548. package/server/dist/http/appBrowserRoutes.js +16 -0
  549. package/server/dist/http/architectureReviewRoutes.d.ts +3 -0
  550. package/server/dist/http/architectureReviewRoutes.js +117 -0
  551. package/server/dist/http/clusterRoutes.js +13 -1
  552. package/server/dist/http/clusterSnapshotRoutes.js +8 -3
  553. package/server/dist/http/connectionsRoutes.js +3 -1
  554. package/server/dist/http/diffRoutes.js +37 -3
  555. package/server/dist/http/explorerRoot.d.ts +3 -0
  556. package/server/dist/http/explorerRoot.js +22 -0
  557. package/server/dist/http/explorerRoutes.js +65 -12
  558. package/server/dist/http/fileRead.js +2 -3
  559. package/server/dist/http/fileWriteRoutes.js +4 -3
  560. package/server/dist/http/gitCompareRoutes.js +4 -6
  561. package/server/dist/http/gitDiffRoutes.js +3 -3
  562. package/server/dist/http/gitOpRoutes.js +3 -5
  563. package/server/dist/http/gitWorktreeRoutes.js +3 -3
  564. package/server/dist/http/handoffHistoryRoutes.d.ts +4 -0
  565. package/server/dist/http/handoffHistoryRoutes.js +59 -0
  566. package/server/dist/http/imageWriteRoutes.js +6 -2
  567. package/server/dist/http/knowledgeRoutes.js +2 -0
  568. package/server/dist/http/mediaOpsRoutes.js +2 -3
  569. package/server/dist/http/originGuard.d.ts +1 -1
  570. package/server/dist/http/originGuard.js +95 -12
  571. package/server/dist/http/outputRoutes.js +31 -6
  572. package/server/dist/http/projectBinding.d.ts +3 -0
  573. package/server/dist/http/projectBinding.js +133 -0
  574. package/server/dist/http/providerThrottleRoutes.d.ts +8 -0
  575. package/server/dist/http/providerThrottleRoutes.js +96 -0
  576. package/server/dist/http/publicProjectRoutes.js +50 -9
  577. package/server/dist/http/readConfinement.d.ts +2 -1
  578. package/server/dist/http/readConfinement.js +17 -15
  579. package/server/dist/http/router.js +224 -62
  580. package/server/dist/http/searchRoutes.js +4 -4
  581. package/server/dist/http/sessionTransport.d.ts +2 -0
  582. package/server/dist/http/sessionTransport.js +32 -0
  583. package/server/dist/http/skillManagementRoutes.d.ts +5 -0
  584. package/server/dist/http/skillManagementRoutes.js +166 -0
  585. package/server/dist/http/storageRoutes.js +20 -6
  586. package/server/dist/http/utilityAgentRoutes.js +27 -5
  587. package/server/dist/http/workflowDataRoutes.js +75 -14
  588. package/server/dist/http/writeConfinement.d.ts +5 -3
  589. package/server/dist/http/writeConfinement.js +37 -11
  590. package/server/dist/http/wsAuth.d.ts +3 -2
  591. package/server/dist/http/wsAuth.js +26 -8
  592. package/server/dist/imageTokens.d.ts +7 -0
  593. package/server/dist/imageTokens.js +85 -0
  594. package/server/dist/index.js +283 -178
  595. package/server/dist/inputDeliveryHistory.d.ts +21 -0
  596. package/server/dist/inputDeliveryHistory.js +146 -0
  597. package/server/dist/keepStore.d.ts +4 -0
  598. package/server/dist/keepStore.js +48 -0
  599. package/server/dist/knowledge/store.js +28 -20
  600. package/server/dist/legacyTarRestore.d.ts +1 -0
  601. package/server/dist/legacyTarRestore.js +240 -0
  602. package/server/dist/llamacppCatalog.d.ts +8 -1
  603. package/server/dist/llamacppCatalog.js +65 -13
  604. package/server/dist/localRuntimeStatus.d.ts +35 -0
  605. package/server/dist/localRuntimeStatus.js +136 -0
  606. package/server/dist/lsp/client.js +28 -9
  607. package/server/dist/lsp/servers.js +2 -2
  608. package/server/dist/managedPath.d.ts +2 -0
  609. package/server/dist/managedPath.js +47 -0
  610. package/server/dist/management/hubGuard.d.ts +23 -0
  611. package/server/dist/management/hubGuard.js +118 -0
  612. package/server/dist/management/hubLink.d.ts +4 -1
  613. package/server/dist/management/hubLink.js +8 -1
  614. package/server/dist/management/initHubLink.d.ts +12 -0
  615. package/server/dist/management/initHubLink.js +44 -22
  616. package/server/dist/manualCompactCapability.d.ts +2 -0
  617. package/server/dist/manualCompactCapability.js +7 -0
  618. package/server/dist/mcp/arcoMcpServer.js +4 -0
  619. package/server/dist/mcp/client.d.ts +4 -4
  620. package/server/dist/mcp/client.js +31 -10
  621. package/server/dist/mcp/clusterMcpLoopback.d.ts +4 -0
  622. package/server/dist/mcp/clusterMcpLoopback.js +21 -1
  623. package/server/dist/mcp/clusterMcpTools.js +25 -26
  624. package/server/dist/mcp/fileContent.d.ts +8 -0
  625. package/server/dist/mcp/fileContent.js +55 -0
  626. package/server/dist/mcp/fileMcpServer.d.ts +1 -0
  627. package/server/dist/mcp/fileMcpServer.js +13 -0
  628. package/server/dist/mcp/fileMcpTools.d.ts +2 -0
  629. package/server/dist/mcp/fileMcpTools.js +54 -0
  630. package/server/dist/mcp/handoffHistoryMcpTools.d.ts +3 -0
  631. package/server/dist/mcp/handoffHistoryMcpTools.js +27 -0
  632. package/server/dist/mcp/mcpConfigWriter.d.ts +5 -0
  633. package/server/dist/mcp/mcpConfigWriter.js +44 -12
  634. package/server/dist/mcp/planMcpTools.d.ts +6 -14
  635. package/server/dist/mcp/planMcpTools.js +6 -250
  636. package/server/dist/mcp/planReadMcpServer.d.ts +1 -0
  637. package/server/dist/mcp/planReadMcpServer.js +19 -0
  638. package/server/dist/mcp/registry.js +44 -38
  639. package/server/dist/mcp/registryWiring.js +4 -5
  640. package/server/dist/media/demucs.d.ts +5 -0
  641. package/server/dist/media/demucs.js +16 -4
  642. package/server/dist/media/ffmpeg.js +24 -16
  643. package/server/dist/media/scratch.js +24 -9
  644. package/server/dist/noticeSource.d.ts +2 -0
  645. package/server/dist/noticeSource.js +11 -0
  646. package/server/dist/notifications.d.ts +1 -0
  647. package/server/dist/notifications.js +7 -3
  648. package/server/dist/npmPlatformResolve.d.ts +9 -3
  649. package/server/dist/npmPlatformResolve.js +24 -5
  650. package/server/dist/ntfyTransport.d.ts +2 -1
  651. package/server/dist/ntfyTransport.js +15 -4
  652. package/server/dist/outputGrants.d.ts +9 -0
  653. package/server/dist/outputGrants.js +63 -0
  654. package/server/dist/outputs.js +78 -13
  655. package/server/dist/peerRecipientContext.js +22 -5
  656. package/server/dist/planStore.d.ts +11 -2
  657. package/server/dist/planStore.js +236 -64
  658. package/server/dist/planTools.d.ts +41 -0
  659. package/server/dist/planTools.js +259 -0
  660. package/server/dist/previewAutoDetect.js +31 -23
  661. package/server/dist/previewPortConfiguration.d.ts +2 -0
  662. package/server/dist/previewPortConfiguration.js +32 -0
  663. package/server/dist/previewPorts.d.ts +1 -0
  664. package/server/dist/previewPorts.js +3 -0
  665. package/server/dist/previewProxy.d.ts +30 -9
  666. package/server/dist/previewProxy.js +226 -183
  667. package/server/dist/primaryBackgroundTracker.d.ts +15 -2
  668. package/server/dist/primaryBackgroundTracker.js +172 -63
  669. package/server/dist/primitives/exportContext.d.ts +3 -0
  670. package/server/dist/primitives/exportContext.js +77 -15
  671. package/server/dist/primitives/localFileContext.d.ts +3 -0
  672. package/server/dist/primitives/localFileContext.js +38 -0
  673. package/server/dist/primitives/reviewContent.d.ts +2 -0
  674. package/server/dist/primitives/reviewContent.js +53 -6
  675. package/server/dist/primitives/runCompare.js +1 -1
  676. package/server/dist/primitives/runDocEdit.js +1 -1
  677. package/server/dist/primitives/runMdTuneup.d.ts +2 -1
  678. package/server/dist/primitives/runMdTuneup.js +20 -34
  679. package/server/dist/primitives/runResearch.js +1 -1
  680. package/server/dist/primitives/runReviewer.d.ts +2 -0
  681. package/server/dist/primitives/runReviewer.js +5 -2
  682. package/server/dist/primitives/seedWorker.d.ts +11 -2
  683. package/server/dist/primitives/seedWorker.js +26 -12
  684. package/server/dist/project/orchestrationProposals.d.ts +1 -0
  685. package/server/dist/project/orchestrationProposals.js +5 -1
  686. package/server/dist/project/taskLedger.d.ts +1 -0
  687. package/server/dist/project/taskLedger.js +17 -11
  688. package/server/dist/projectGlob.d.ts +1 -0
  689. package/server/dist/projectGlob.js +9 -0
  690. package/server/dist/projectIgnore.d.ts +1 -0
  691. package/server/dist/projectIgnore.js +24 -0
  692. package/server/dist/projectScan.d.ts +24 -0
  693. package/server/dist/projectScan.js +101 -0
  694. package/server/dist/projectStateIgnore.d.ts +13 -0
  695. package/server/dist/projectStateIgnore.js +36 -1
  696. package/server/dist/projects.d.ts +11 -3
  697. package/server/dist/projects.js +141 -40
  698. package/server/dist/prompts.js +7 -8
  699. package/server/dist/proportionateTestingSkill.d.ts +7 -0
  700. package/server/dist/proportionateTestingSkill.js +32 -0
  701. package/server/dist/providers/attachmentLabels.d.ts +4 -0
  702. package/server/dist/providers/attachmentLabels.js +9 -0
  703. package/server/dist/providers/attachments.d.ts +1 -3
  704. package/server/dist/providers/attachments.js +58 -173
  705. package/server/dist/providers/claude-native/apiEndpoint.d.ts +2 -0
  706. package/server/dist/providers/claude-native/apiEndpoint.js +8 -0
  707. package/server/dist/providers/claude-native/appendOnlyPrefix.js +21 -1
  708. package/server/dist/providers/claude-native/catalog.js +17 -15
  709. package/server/dist/providers/claude-native/contentBlocks.d.ts +22 -2
  710. package/server/dist/providers/claude-native/contentBlocks.js +31 -8
  711. package/server/dist/providers/claude-native/contextBudget.d.ts +0 -4
  712. package/server/dist/providers/claude-native/contextBudget.js +0 -2
  713. package/server/dist/providers/claude-native/editApply.js +6 -1
  714. package/server/dist/providers/claude-native/fileContent.d.ts +15 -0
  715. package/server/dist/providers/claude-native/fileContent.js +120 -0
  716. package/server/dist/providers/claude-native/filterConfigs/bash-cargo-test.js +2 -0
  717. package/server/dist/providers/claude-native/filterConfigs/bash-jest-vitest.js +2 -0
  718. package/server/dist/providers/claude-native/filterConfigs/bash-pytest.js +2 -0
  719. package/server/dist/providers/claude-native/filterConfigs/index.js +2 -1
  720. package/server/dist/providers/claude-native/foldDigest.js +10 -2
  721. package/server/dist/providers/claude-native/gateReview.d.ts +1 -1
  722. package/server/dist/providers/claude-native/gateReview.js +0 -0
  723. package/server/dist/providers/claude-native/hookIf.d.ts +28 -0
  724. package/server/dist/providers/claude-native/hookIf.js +590 -0
  725. package/server/dist/providers/claude-native/hooks.d.ts +77 -7
  726. package/server/dist/providers/claude-native/hooks.js +344 -52
  727. package/server/dist/providers/claude-native/imageRead.d.ts +15 -0
  728. package/server/dist/providers/claude-native/imageRead.js +108 -0
  729. package/server/dist/providers/claude-native/index.d.ts +4 -1
  730. package/server/dist/providers/claude-native/index.js +32 -2
  731. package/server/dist/providers/claude-native/mediaLimits.d.ts +6 -0
  732. package/server/dist/providers/claude-native/mediaLimits.js +15 -0
  733. package/server/dist/providers/claude-native/mediaRetention.d.ts +11 -0
  734. package/server/dist/providers/claude-native/mediaRetention.js +66 -0
  735. package/server/dist/providers/claude-native/mediaRetirementNotice.d.ts +1 -0
  736. package/server/dist/providers/claude-native/mediaRetirementNotice.js +12 -0
  737. package/server/dist/providers/claude-native/modelParams.d.ts +6 -0
  738. package/server/dist/providers/claude-native/modelParams.js +21 -3
  739. package/server/dist/providers/claude-native/oauth.js +9 -8
  740. package/server/dist/providers/claude-native/outputAccumulator.d.ts +2 -0
  741. package/server/dist/providers/claude-native/outputAccumulator.js +29 -18
  742. package/server/dist/providers/claude-native/peerTools.js +3 -158
  743. package/server/dist/providers/claude-native/pretoolGuards.js +92 -9
  744. package/server/dist/providers/claude-native/registryTools.js +4 -2
  745. package/server/dist/providers/claude-native/resumeSummary.d.ts +23 -2
  746. package/server/dist/providers/claude-native/resumeSummary.js +135 -28
  747. package/server/dist/providers/claude-native/sandboxExecutor.js +26 -19
  748. package/server/dist/providers/claude-native/taskAdmission.d.ts +21 -0
  749. package/server/dist/providers/claude-native/taskAdmission.js +75 -0
  750. package/server/dist/providers/claude-native/toolChecks.d.ts +38 -0
  751. package/server/dist/providers/claude-native/toolChecks.js +96 -0
  752. package/server/dist/providers/claude-native/toolPosture.js +5 -3
  753. package/server/dist/providers/claude-native/toolResultEviction.d.ts +4 -3
  754. package/server/dist/providers/claude-native/toolResultEviction.js +18 -29
  755. package/server/dist/providers/claude-native/tools.d.ts +17 -4
  756. package/server/dist/providers/claude-native/tools.js +248 -135
  757. package/server/dist/providers/claude-native/usageContext.d.ts +30 -0
  758. package/server/dist/providers/claude-native/usageContext.js +70 -0
  759. package/server/dist/providers/claude-native/wireFingerprint.d.ts +2 -2
  760. package/server/dist/providers/claude-native/wireFingerprint.js +2 -2
  761. package/server/dist/providers/claude-native/worker.d.ts +63 -1
  762. package/server/dist/providers/claude-native/worker.js +1103 -324
  763. package/server/dist/providers/claude-native/workerHelpers.d.ts +13 -0
  764. package/server/dist/providers/claude-native/workerHelpers.js +117 -6
  765. package/server/dist/providers/claude-native/workspaceFacts.js +2 -2
  766. package/server/dist/providers/claude.d.ts +1 -0
  767. package/server/dist/providers/claude.js +69 -85
  768. package/server/dist/providers/clusterTaskToolDefinitions.d.ts +11 -0
  769. package/server/dist/providers/clusterTaskToolDefinitions.js +161 -0
  770. package/server/dist/providers/codex-appserver/catalog.js +26 -20
  771. package/server/dist/providers/codex-appserver/index.js +10 -3
  772. package/server/dist/providers/codex-appserver/jsonRpc.d.ts +2 -1
  773. package/server/dist/providers/codex-appserver/jsonRpc.js +11 -3
  774. package/server/dist/providers/codex-appserver/worker.d.ts +5 -0
  775. package/server/dist/providers/codex-appserver/worker.js +119 -81
  776. package/server/dist/providers/codex.js +55 -58
  777. package/server/dist/providers/codexChatBoundary.d.ts +11 -0
  778. package/server/dist/providers/codexChatBoundary.js +60 -0
  779. package/server/dist/providers/codexCodeMode.js +2 -2
  780. package/server/dist/providers/codexContextWindow.js +2 -2
  781. package/server/dist/providers/codexHome.d.ts +1 -0
  782. package/server/dist/providers/codexHome.js +6 -0
  783. package/server/dist/providers/codexImageTool.d.ts +6 -0
  784. package/server/dist/providers/codexImageTool.js +21 -0
  785. package/server/dist/providers/codexVersion.d.ts +1 -0
  786. package/server/dist/providers/codexVersion.js +14 -0
  787. package/server/dist/providers/codexWebSearch.d.ts +2 -0
  788. package/server/dist/providers/codexWebSearch.js +4 -0
  789. package/server/dist/providers/cursor/acpJsonRpc.d.ts +1 -0
  790. package/server/dist/providers/cursor/acpJsonRpc.js +3 -1
  791. package/server/dist/providers/cursor/authState.d.ts +10 -0
  792. package/server/dist/providers/cursor/authState.js +78 -0
  793. package/server/dist/providers/cursor/catalog.js +22 -14
  794. package/server/dist/providers/cursor/chatSandbox.d.ts +11 -0
  795. package/server/dist/providers/cursor/chatSandbox.js +81 -0
  796. package/server/dist/providers/cursor/filePlugin.d.ts +4 -0
  797. package/server/dist/providers/cursor/filePlugin.js +31 -0
  798. package/server/dist/providers/cursor/index.d.ts +1 -0
  799. package/server/dist/providers/cursor/index.js +30 -4
  800. package/server/dist/providers/cursor/modelMap.d.ts +35 -0
  801. package/server/dist/providers/cursor/modelMap.js +180 -0
  802. package/server/dist/providers/cursor/print.js +95 -30
  803. package/server/dist/providers/cursor/worker.d.ts +4 -1
  804. package/server/dist/providers/cursor/worker.js +169 -89
  805. package/server/dist/providers/errorClassifier.js +6 -2
  806. package/server/dist/providers/handoffHistoryBinding.d.ts +11 -0
  807. package/server/dist/providers/handoffHistoryBinding.js +43 -0
  808. package/server/dist/providers/index.d.ts +1 -1
  809. package/server/dist/providers/index.js +10 -5
  810. package/server/dist/providers/llamacpp.d.ts +1 -0
  811. package/server/dist/providers/llamacpp.js +102 -192
  812. package/server/dist/providers/llamacppManager.d.ts +5 -0
  813. package/server/dist/providers/llamacppManager.js +68 -32
  814. package/server/dist/providers/llamacppVersion.d.ts +1 -0
  815. package/server/dist/providers/llamacppVersion.js +5 -0
  816. package/server/dist/providers/lmstudio.d.ts +3 -3
  817. package/server/dist/providers/lmstudio.js +133 -207
  818. package/server/dist/providers/localFileMedia.d.ts +25 -0
  819. package/server/dist/providers/localFileMedia.js +302 -0
  820. package/server/dist/providers/localMcp.d.ts +17 -0
  821. package/server/dist/providers/localMcp.js +85 -0
  822. package/server/dist/providers/localShellLifecycle.d.ts +7 -0
  823. package/server/dist/providers/localShellLifecycle.js +33 -0
  824. package/server/dist/providers/localToolDispatch.d.ts +28 -0
  825. package/server/dist/providers/localToolDispatch.js +90 -0
  826. package/server/dist/providers/ollama.d.ts +2 -1
  827. package/server/dist/providers/ollama.js +180 -181
  828. package/server/dist/providers/ollamaDurableCompaction.js +5 -4
  829. package/server/dist/providers/ollamaExecutionHistory.d.ts +1 -1
  830. package/server/dist/providers/ollamaExecutionHistory.js +55 -14
  831. package/server/dist/providers/ollamaFencedTools.js +10 -11
  832. package/server/dist/providers/ollamaResilience.js +9 -13
  833. package/server/dist/providers/ollamaTokens.js +3 -4
  834. package/server/dist/providers/ollamaToolSubset.d.ts +2 -0
  835. package/server/dist/providers/ollamaToolSubset.js +11 -40
  836. package/server/dist/providers/ollamaTools.d.ts +13 -0
  837. package/server/dist/providers/ollamaTools.js +225 -219
  838. package/server/dist/providers/outputStyle.d.ts +2 -1
  839. package/server/dist/providers/outputStyle.js +70 -76
  840. package/server/dist/providers/providerFileContent.d.ts +40 -0
  841. package/server/dist/providers/providerFileContent.js +151 -0
  842. package/server/dist/providers/renderedTranscript.d.ts +1 -0
  843. package/server/dist/providers/renderedTranscript.js +3 -0
  844. package/server/dist/providers/requestDeadline.d.ts +1 -0
  845. package/server/dist/providers/requestDeadline.js +26 -0
  846. package/server/dist/providers/sessionScope.d.ts +2 -0
  847. package/server/dist/providers/sessionScope.js +8 -0
  848. package/server/dist/providers/types.d.ts +1 -0
  849. package/server/dist/publicProject.d.ts +10 -2
  850. package/server/dist/publicProject.js +59 -13
  851. package/server/dist/publicProjectChoice.d.ts +4 -0
  852. package/server/dist/publicProjectChoice.js +46 -0
  853. package/server/dist/quota.d.ts +10 -7
  854. package/server/dist/quota.js +49 -19
  855. package/server/dist/recall/search.js +9 -32
  856. package/server/dist/recall/transcriptSearch.d.ts +4 -0
  857. package/server/dist/recall/transcriptSearch.js +29 -0
  858. package/server/dist/recentFilesLedger.js +9 -7
  859. package/server/dist/recentProjectActivity.d.ts +11 -0
  860. package/server/dist/recentProjectActivity.js +69 -0
  861. package/server/dist/scanDeadline.d.ts +4 -0
  862. package/server/dist/scanDeadline.js +48 -0
  863. package/server/dist/searchText.d.ts +1 -0
  864. package/server/dist/searchText.js +22 -0
  865. package/server/dist/server/broadcast.d.ts +2 -2
  866. package/server/dist/server/broadcast.js +130 -58
  867. package/server/dist/sessionJsonl.js +45 -19
  868. package/server/dist/settings.d.ts +6 -1
  869. package/server/dist/settings.js +183 -56
  870. package/server/dist/skillManagement.d.ts +125 -0
  871. package/server/dist/skillManagement.js +709 -0
  872. package/server/dist/skillMutation.d.ts +1 -0
  873. package/server/dist/skillMutation.js +6 -0
  874. package/server/dist/skills.d.ts +75 -1
  875. package/server/dist/skills.js +254 -75
  876. package/server/dist/smartPickup.d.ts +1 -0
  877. package/server/dist/smartPickup.js +2 -1
  878. package/server/dist/smartPickupAdapters.d.ts +1 -0
  879. package/server/dist/smartPickupAdapters.js +31 -8
  880. package/server/dist/storageActions.d.ts +2 -2
  881. package/server/dist/storageArchive.js +55 -24
  882. package/server/dist/storageRoot.d.ts +5 -0
  883. package/server/dist/storageRoot.js +38 -0
  884. package/server/dist/storageTurnWatch.d.ts +6 -0
  885. package/server/dist/storageTurnWatch.js +36 -0
  886. package/server/dist/taskDispatcher.js +69 -41
  887. package/server/dist/templates/store.js +75 -59
  888. package/server/dist/terminal/ptyManager.d.ts +3 -1
  889. package/server/dist/terminal/ptyManager.js +44 -37
  890. package/server/dist/terminal/ptyPidRegistry.d.ts +4 -2
  891. package/server/dist/terminal/ptyPidRegistry.js +9 -63
  892. package/server/dist/thirdPartySkills.d.ts +4 -0
  893. package/server/dist/thirdPartySkills.js +80 -0
  894. package/server/dist/toolPath.d.ts +1 -0
  895. package/server/dist/toolPath.js +38 -0
  896. package/server/dist/toolboxWorkflow.js +2 -1
  897. package/server/dist/uploadImages.d.ts +6 -0
  898. package/server/dist/uploadImages.js +155 -0
  899. package/server/dist/voice/computerContext.js +2 -0
  900. package/server/dist/voice/conditionSchema.d.ts +1 -0
  901. package/server/dist/voice/conditionSchema.js +3 -1
  902. package/server/dist/voice/conditions.js +1 -1
  903. package/server/dist/workers/StreamParser.d.ts +3 -0
  904. package/server/dist/workers/StreamParser.js +45 -11
  905. package/server/dist/workers/WorkerManager.d.ts +9 -2
  906. package/server/dist/workers/WorkerManager.js +18 -18
  907. package/server/dist/workers/durablePidRegistry.d.ts +53 -0
  908. package/server/dist/workers/durablePidRegistry.js +289 -0
  909. package/server/dist/workers/limits.js +1 -1
  910. package/server/dist/workers/pidRegistry.d.ts +6 -9
  911. package/server/dist/workers/pidRegistry.js +13 -101
  912. package/server/dist/workers/processActivity.d.ts +6 -0
  913. package/server/dist/workers/processActivity.js +13 -0
  914. package/server/dist/workers/processKill.d.ts +30 -0
  915. package/server/dist/workers/processKill.js +174 -0
  916. package/server/dist/workers/processStartTime.d.ts +21 -5
  917. package/server/dist/workers/processStartTime.js +127 -50
  918. package/server/dist/workflowMeta.d.ts +15 -12
  919. package/server/dist/workflowMeta.js +42 -10
  920. package/server/dist/workflowStore.d.ts +1 -0
  921. package/server/dist/workflowStore.js +194 -23
  922. package/server/dist/workflows/modelTitles.js +4 -3
  923. package/server/dist/workflows/sessionIndex.d.ts +2 -0
  924. package/server/dist/workflows/sessionIndex.js +24 -2
  925. package/server/dist/workflows/types.d.ts +15 -5
  926. package/server/dist/workspace.d.ts +1 -0
  927. package/server/dist/workspace.js +5 -0
  928. package/server/dist/ws/afterTurn.d.ts +9 -0
  929. package/server/dist/ws/afterTurn.js +25 -0
  930. package/server/dist/ws/clusterHandlers.d.ts +7 -2
  931. package/server/dist/ws/clusterHandlers.js +361 -407
  932. package/server/dist/ws/clusterMembers.d.ts +42 -0
  933. package/server/dist/ws/clusterMembers.js +165 -0
  934. package/server/dist/ws/compactHandlers.js +38 -28
  935. package/server/dist/ws/gateHandlers.js +2 -1
  936. package/server/dist/ws/genesisHandlers.js +171 -116
  937. package/server/dist/ws/handoffHandlers.d.ts +3 -1
  938. package/server/dist/ws/handoffHandlers.js +367 -196
  939. package/server/dist/ws/previewCaptureHandlers.js +1 -4
  940. package/server/dist/ws/taskLedgerHandlers.d.ts +6 -1
  941. package/server/dist/ws/taskLedgerHandlers.js +28 -12
  942. package/server/dist/ws/taskLifecycle.d.ts +15 -0
  943. package/server/dist/ws/taskLifecycle.js +39 -0
  944. package/server/dist/ws/turnEngine.d.ts +27 -8
  945. package/server/dist/ws/turnEngine.js +1790 -1637
  946. package/server/dist/ws/turnPrompt.d.ts +17 -0
  947. package/server/dist/ws/turnPrompt.js +47 -0
  948. package/server/dist/ws/turnSettings.d.ts +41 -0
  949. package/server/dist/ws/turnSettings.js +61 -0
  950. package/server/dist/ws/updatePrimaryConfig.js +63 -40
  951. package/server/dist/ws/workflowHandlers.d.ts +2 -1
  952. package/server/dist/ws/workflowHandlers.js +220 -180
  953. package/server/package.json +1 -1
  954. package/server/src/appBrowsers.ts +95 -0
  955. package/server/src/architectureReview.ts +327 -0
  956. package/server/src/architectureSkill.ts +71 -0
  957. package/server/src/arcoHome.ts +42 -3
  958. package/server/src/artifactCopy.ts +90 -24
  959. package/server/src/atomicFile.ts +6 -1
  960. package/server/src/attention.ts +24 -17
  961. package/server/src/auth.ts +20 -6
  962. package/server/src/authLoginSession.ts +7 -2
  963. package/server/src/boundedRead.ts +172 -0
  964. package/server/src/capabilities.ts +26 -9
  965. package/server/src/catchUp.ts +19 -2
  966. package/server/src/checkedFile.ts +90 -0
  967. package/server/src/claudeTransport.ts +14 -0
  968. package/server/src/clusterAutoTurn.ts +55 -7
  969. package/server/src/clusterBusyReminder.ts +45 -0
  970. package/server/src/clusterDirector.ts +6 -3
  971. package/server/src/clusterIdleNudger.ts +6 -0
  972. package/server/src/clusterMailbox.ts +96 -26
  973. package/server/src/clusterPeerOps.ts +6 -19
  974. package/server/src/clusterPlanBridge.ts +37 -45
  975. package/server/src/clusterPresets.ts +44 -31
  976. package/server/src/clusterProgress.ts +3 -0
  977. package/server/src/clusterSnapshots.ts +16 -2
  978. package/server/src/clusterStore.ts +25 -14
  979. package/server/src/clusterTurnTools.ts +11 -0
  980. package/server/src/commandShell.ts +287 -0
  981. package/server/src/compactionCounter.ts +69 -0
  982. package/server/src/compactionReport.ts +20 -0
  983. package/server/src/contentSearch.ts +8 -3
  984. package/server/src/contextCalibrator.ts +6 -1
  985. package/server/src/contextEstimator.ts +71 -16
  986. package/server/src/contextRefs.ts +41 -11
  987. package/server/src/conversationActivity.ts +26 -0
  988. package/server/src/cursorUsage.ts +13 -3
  989. package/server/src/diagnostics/checks.ts +4 -11
  990. package/server/src/diagnostics/executableLookup.ts +20 -0
  991. package/server/src/diagnostics/modelHealth.ts +3 -11
  992. package/server/src/diagnostics/supportBundle.ts +5 -13
  993. package/server/src/eventLog.ts +228 -81
  994. package/server/src/existingClusterMembers.ts +9 -0
  995. package/server/src/explorerArtifacts.ts +27 -10
  996. package/server/src/explorerChanged.ts +99 -67
  997. package/server/src/explorerDocs.ts +37 -31
  998. package/server/src/explorerLaunch.ts +10 -2
  999. package/server/src/fileAccessPolicy.ts +82 -1
  1000. package/server/src/fileContent/decodeSlots.ts +31 -0
  1001. package/server/src/fileContent/detect.ts +28 -0
  1002. package/server/src/fileContent/externalImage.ts +49 -0
  1003. package/server/src/fileContent/icons.ts +37 -0
  1004. package/server/src/fileContent/images.ts +140 -0
  1005. package/server/src/fileContent/legacyText.ts +16 -0
  1006. package/server/src/fileContent/notebook.ts +37 -0
  1007. package/server/src/fileContent/office.ts +234 -0
  1008. package/server/src/fileContent/pdf.ts +59 -0
  1009. package/server/src/fileContent/pngRows.ts +54 -0
  1010. package/server/src/fileContent/svg.ts +42 -0
  1011. package/server/src/fileContent/types.ts +39 -0
  1012. package/server/src/fileContent/worker.ts +43 -0
  1013. package/server/src/fileContent.ts +108 -0
  1014. package/server/src/fileContextReceipts.ts +44 -0
  1015. package/server/src/fileFetch.ts +167 -0
  1016. package/server/src/fileVersion.ts +36 -0
  1017. package/server/src/genesis/creative.ts +27 -33
  1018. package/server/src/genesis/prompts.ts +3 -0
  1019. package/server/src/genesis/savePlan.ts +45 -0
  1020. package/server/src/genesis/stages.ts +4 -4
  1021. package/server/src/gitDiff.ts +20 -5
  1022. package/server/src/gitSnapshots.ts +288 -191
  1023. package/server/src/gitWorking.ts +11 -11
  1024. package/server/src/github.ts +3 -1
  1025. package/server/src/goalRun.ts +7 -4
  1026. package/server/src/handoffHistory.ts +89 -0
  1027. package/server/src/handoffHistoryProtocol.ts +20 -0
  1028. package/server/src/handoffHistorySupport.ts +10 -0
  1029. package/server/src/handoffHistoryTool.ts +192 -0
  1030. package/server/src/handoffPrompts.ts +6 -4
  1031. package/server/src/handoffReplay.ts +20 -0
  1032. package/server/src/handoffSeedCache.ts +22 -0
  1033. package/server/src/http/appBrowserRoutes.ts +17 -0
  1034. package/server/src/http/architectureReviewRoutes.ts +86 -0
  1035. package/server/src/http/clusterRoutes.ts +13 -1
  1036. package/server/src/http/clusterSnapshotRoutes.ts +8 -3
  1037. package/server/src/http/connectionsRoutes.ts +5 -1
  1038. package/server/src/http/diffRoutes.ts +36 -3
  1039. package/server/src/http/explorerRoot.ts +20 -0
  1040. package/server/src/http/explorerRoutes.ts +59 -12
  1041. package/server/src/http/fileRead.ts +2 -1
  1042. package/server/src/http/fileWriteRoutes.ts +3 -2
  1043. package/server/src/http/gitCompareRoutes.ts +4 -5
  1044. package/server/src/http/gitDiffRoutes.ts +3 -2
  1045. package/server/src/http/gitOpRoutes.ts +3 -4
  1046. package/server/src/http/gitWorktreeRoutes.ts +3 -2
  1047. package/server/src/http/handoffHistoryRoutes.ts +42 -0
  1048. package/server/src/http/imageWriteRoutes.ts +5 -1
  1049. package/server/src/http/knowledgeRoutes.ts +2 -0
  1050. package/server/src/http/mediaOpsRoutes.ts +2 -1
  1051. package/server/src/http/originGuard.ts +71 -14
  1052. package/server/src/http/outputRoutes.ts +26 -5
  1053. package/server/src/http/projectBinding.ts +108 -0
  1054. package/server/src/http/providerThrottleRoutes.ts +76 -0
  1055. package/server/src/http/publicProjectRoutes.ts +40 -8
  1056. package/server/src/http/readConfinement.ts +16 -9
  1057. package/server/src/http/router.ts +173 -60
  1058. package/server/src/http/searchRoutes.ts +4 -4
  1059. package/server/src/http/sessionTransport.ts +27 -0
  1060. package/server/src/http/skillManagementRoutes.ts +120 -0
  1061. package/server/src/http/storageRoutes.ts +19 -6
  1062. package/server/src/http/utilityAgentRoutes.ts +19 -5
  1063. package/server/src/http/workflowDataRoutes.ts +68 -16
  1064. package/server/src/http/writeConfinement.ts +31 -12
  1065. package/server/src/http/wsAuth.ts +27 -9
  1066. package/server/src/imageTokens.ts +60 -0
  1067. package/server/src/index.ts +265 -178
  1068. package/server/src/inputDeliveryHistory.ts +122 -0
  1069. package/server/src/keepStore.ts +37 -0
  1070. package/server/src/knowledge/store.ts +27 -19
  1071. package/server/src/legacyTarRestore.ts +177 -0
  1072. package/server/src/llamacppCatalog.ts +47 -12
  1073. package/server/src/localRuntimeStatus.ts +121 -0
  1074. package/server/src/lsp/client.ts +19 -11
  1075. package/server/src/lsp/servers.ts +2 -2
  1076. package/server/src/managedPath.ts +38 -0
  1077. package/server/src/management/hubGuard.ts +135 -0
  1078. package/server/src/management/hubLink.ts +8 -2
  1079. package/server/src/management/initHubLink.ts +45 -37
  1080. package/server/src/manualCompactCapability.ts +8 -0
  1081. package/server/src/mcp/arcoMcpServer.ts +4 -0
  1082. package/server/src/mcp/client.ts +28 -11
  1083. package/server/src/mcp/clusterMcpLoopback.ts +27 -1
  1084. package/server/src/mcp/clusterMcpTools.ts +24 -25
  1085. package/server/src/mcp/fileContent.ts +34 -0
  1086. package/server/src/mcp/fileMcpServer.ts +12 -0
  1087. package/server/src/mcp/fileMcpTools.ts +51 -0
  1088. package/server/src/mcp/handoffHistoryMcpTools.ts +21 -0
  1089. package/server/src/mcp/mcpConfigWriter.ts +43 -12
  1090. package/server/src/mcp/planMcpTools.ts +9 -285
  1091. package/server/src/mcp/planReadMcpServer.ts +19 -0
  1092. package/server/src/mcp/registry.ts +41 -35
  1093. package/server/src/mcp/registryWiring.ts +4 -5
  1094. package/server/src/media/demucs.ts +11 -4
  1095. package/server/src/media/ffmpeg.ts +21 -16
  1096. package/server/src/media/scratch.ts +17 -10
  1097. package/server/src/noticeSource.ts +11 -0
  1098. package/server/src/notifications.ts +8 -4
  1099. package/server/src/npmPlatformResolve.ts +25 -8
  1100. package/server/src/ntfyTransport.ts +12 -4
  1101. package/server/src/outputGrants.ts +53 -0
  1102. package/server/src/outputs.ts +54 -11
  1103. package/server/src/peerRecipientContext.ts +16 -5
  1104. package/server/src/planStore.ts +201 -55
  1105. package/server/src/planTools.ts +303 -0
  1106. package/server/src/previewAutoDetect.ts +26 -19
  1107. package/server/src/previewPortConfiguration.ts +28 -0
  1108. package/server/src/previewPorts.ts +2 -0
  1109. package/server/src/previewProxy.ts +156 -189
  1110. package/server/src/primaryBackgroundTracker.ts +151 -61
  1111. package/server/src/primitives/exportContext.ts +67 -16
  1112. package/server/src/primitives/localFileContext.ts +31 -0
  1113. package/server/src/primitives/reviewContent.ts +42 -7
  1114. package/server/src/primitives/runCompare.ts +1 -1
  1115. package/server/src/primitives/runDocEdit.ts +1 -1
  1116. package/server/src/primitives/runMdTuneup.ts +17 -27
  1117. package/server/src/primitives/runResearch.ts +1 -1
  1118. package/server/src/primitives/runReviewer.ts +6 -2
  1119. package/server/src/primitives/seedWorker.ts +36 -17
  1120. package/server/src/project/orchestrationProposals.ts +6 -1
  1121. package/server/src/project/taskLedger.ts +17 -11
  1122. package/server/src/projectGlob.ts +9 -0
  1123. package/server/src/projectIgnore.ts +19 -0
  1124. package/server/src/projectScan.ts +76 -0
  1125. package/server/src/projectStateIgnore.ts +40 -1
  1126. package/server/src/projects.ts +114 -36
  1127. package/server/src/prompts.ts +5 -8
  1128. package/server/src/proportionateTestingSkill.ts +31 -0
  1129. package/server/src/providers/attachmentLabels.ts +8 -0
  1130. package/server/src/providers/attachments.ts +52 -174
  1131. package/server/src/providers/claude-native/apiEndpoint.ts +9 -0
  1132. package/server/src/providers/claude-native/appendOnlyPrefix.ts +17 -1
  1133. package/server/src/providers/claude-native/catalog.ts +16 -14
  1134. package/server/src/providers/claude-native/contentBlocks.ts +39 -8
  1135. package/server/src/providers/claude-native/contextBudget.ts +0 -6
  1136. package/server/src/providers/claude-native/editApply.ts +6 -1
  1137. package/server/src/providers/claude-native/fileContent.ts +98 -0
  1138. package/server/src/providers/claude-native/filterConfigs/bash-cargo-test.ts +1 -0
  1139. package/server/src/providers/claude-native/filterConfigs/bash-jest-vitest.ts +1 -0
  1140. package/server/src/providers/claude-native/filterConfigs/bash-pytest.ts +1 -0
  1141. package/server/src/providers/claude-native/filterConfigs/index.ts +2 -1
  1142. package/server/src/providers/claude-native/foldDigest.ts +9 -2
  1143. package/server/src/providers/claude-native/gateReview.ts +0 -0
  1144. package/server/src/providers/claude-native/hookIf.ts +414 -0
  1145. package/server/src/providers/claude-native/hooks.ts +398 -54
  1146. package/server/src/providers/claude-native/imageRead.ts +92 -0
  1147. package/server/src/providers/claude-native/index.ts +32 -1
  1148. package/server/src/providers/claude-native/mediaLimits.ts +14 -0
  1149. package/server/src/providers/claude-native/mediaRetention.ts +49 -0
  1150. package/server/src/providers/claude-native/mediaRetirementNotice.ts +8 -0
  1151. package/server/src/providers/claude-native/modelParams.ts +23 -2
  1152. package/server/src/providers/claude-native/oauth.ts +9 -8
  1153. package/server/src/providers/claude-native/outputAccumulator.ts +29 -17
  1154. package/server/src/providers/claude-native/peerTools.ts +3 -169
  1155. package/server/src/providers/claude-native/pretoolGuards.ts +76 -9
  1156. package/server/src/providers/claude-native/registryTools.ts +4 -2
  1157. package/server/src/providers/claude-native/resumeSummary.ts +138 -28
  1158. package/server/src/providers/claude-native/sandboxExecutor.ts +24 -16
  1159. package/server/src/providers/claude-native/taskAdmission.ts +62 -0
  1160. package/server/src/providers/claude-native/toolChecks.ts +127 -0
  1161. package/server/src/providers/claude-native/toolPosture.ts +5 -3
  1162. package/server/src/providers/claude-native/toolResultEviction.ts +17 -7
  1163. package/server/src/providers/claude-native/tools.ts +228 -130
  1164. package/server/src/providers/claude-native/usageContext.ts +93 -0
  1165. package/server/src/providers/claude-native/wireFingerprint.ts +2 -2
  1166. package/server/src/providers/claude-native/worker.ts +1056 -334
  1167. package/server/src/providers/claude-native/workerHelpers.ts +133 -6
  1168. package/server/src/providers/claude-native/workspaceFacts.ts +2 -2
  1169. package/server/src/providers/claude.ts +65 -93
  1170. package/server/src/providers/clusterTaskToolDefinitions.ts +180 -0
  1171. package/server/src/providers/codex-appserver/catalog.ts +26 -19
  1172. package/server/src/providers/codex-appserver/index.ts +8 -3
  1173. package/server/src/providers/codex-appserver/jsonRpc.ts +9 -2
  1174. package/server/src/providers/codex-appserver/worker.ts +108 -77
  1175. package/server/src/providers/codex.ts +49 -57
  1176. package/server/src/providers/codexChatBoundary.ts +55 -0
  1177. package/server/src/providers/codexCodeMode.ts +2 -2
  1178. package/server/src/providers/codexContextWindow.ts +2 -2
  1179. package/server/src/providers/codexHome.ts +6 -0
  1180. package/server/src/providers/codexImageTool.ts +22 -0
  1181. package/server/src/providers/codexVersion.ts +13 -0
  1182. package/server/src/providers/codexWebSearch.ts +5 -0
  1183. package/server/src/providers/cursor/acpJsonRpc.ts +3 -1
  1184. package/server/src/providers/cursor/authState.ts +72 -0
  1185. package/server/src/providers/cursor/catalog.ts +20 -13
  1186. package/server/src/providers/cursor/chatSandbox.ts +71 -0
  1187. package/server/src/providers/cursor/filePlugin.ts +27 -0
  1188. package/server/src/providers/cursor/index.ts +29 -4
  1189. package/server/src/providers/cursor/modelMap.ts +182 -0
  1190. package/server/src/providers/cursor/print.ts +80 -27
  1191. package/server/src/providers/cursor/worker.ts +156 -84
  1192. package/server/src/providers/errorClassifier.ts +7 -2
  1193. package/server/src/providers/handoffHistoryBinding.ts +40 -0
  1194. package/server/src/providers/index.ts +12 -6
  1195. package/server/src/providers/llamacpp.ts +93 -176
  1196. package/server/src/providers/llamacppManager.ts +62 -33
  1197. package/server/src/providers/llamacppVersion.ts +4 -0
  1198. package/server/src/providers/lmstudio.ts +124 -190
  1199. package/server/src/providers/localFileMedia.ts +229 -0
  1200. package/server/src/providers/localMcp.ts +76 -0
  1201. package/server/src/providers/localShellLifecycle.ts +30 -0
  1202. package/server/src/providers/localToolDispatch.ts +111 -0
  1203. package/server/src/providers/ollama.ts +161 -171
  1204. package/server/src/providers/ollamaCtxFallback.ts +1 -2
  1205. package/server/src/providers/ollamaDurableCompaction.ts +5 -4
  1206. package/server/src/providers/ollamaExecutionHistory.ts +40 -13
  1207. package/server/src/providers/ollamaFencedTools.ts +10 -11
  1208. package/server/src/providers/ollamaResilience.ts +10 -13
  1209. package/server/src/providers/ollamaTokens.ts +4 -7
  1210. package/server/src/providers/ollamaToolSubset.ts +14 -2
  1211. package/server/src/providers/ollamaTools.ts +212 -200
  1212. package/server/src/providers/outputStyle.ts +72 -72
  1213. package/server/src/providers/providerFileContent.ts +133 -0
  1214. package/server/src/providers/renderedTranscript.ts +2 -0
  1215. package/server/src/providers/requestDeadline.ts +27 -0
  1216. package/server/src/providers/sessionScope.ts +9 -0
  1217. package/server/src/providers/types.ts +3 -0
  1218. package/server/src/publicProject.ts +54 -13
  1219. package/server/src/publicProjectChoice.ts +39 -0
  1220. package/server/src/quota.ts +48 -23
  1221. package/server/src/recall/search.ts +9 -32
  1222. package/server/src/recall/transcriptSearch.ts +27 -0
  1223. package/server/src/recentFilesLedger.ts +10 -8
  1224. package/server/src/recentProjectActivity.ts +56 -0
  1225. package/server/src/scanDeadline.ts +26 -0
  1226. package/server/src/searchText.ts +16 -0
  1227. package/server/src/server/broadcast.ts +120 -54
  1228. package/server/src/sessionJsonl.ts +31 -17
  1229. package/server/src/settings.ts +137 -41
  1230. package/server/src/skillManagement.ts +585 -0
  1231. package/server/src/skillMutation.ts +6 -0
  1232. package/server/src/skills.ts +195 -25
  1233. package/server/src/smartPickup.ts +3 -2
  1234. package/server/src/smartPickupAdapters.ts +31 -10
  1235. package/server/src/storageActions.ts +1 -1
  1236. package/server/src/storageArchive.ts +42 -22
  1237. package/server/src/storageRoot.ts +30 -0
  1238. package/server/src/storageTurnWatch.ts +39 -0
  1239. package/server/src/taskDispatcher.ts +22 -2
  1240. package/server/src/templates/store.ts +72 -57
  1241. package/server/src/terminal/ptyManager.ts +37 -27
  1242. package/server/src/terminal/ptyPidRegistry.ts +10 -58
  1243. package/server/src/thirdPartySkills.ts +79 -0
  1244. package/server/src/toolPath.ts +31 -0
  1245. package/server/src/toolboxWorkflow.ts +2 -1
  1246. package/server/src/uploadImages.ts +124 -0
  1247. package/server/src/voice/computerContext.ts +2 -1
  1248. package/server/src/voice/conditionSchema.ts +3 -1
  1249. package/server/src/voice/conditions.ts +1 -1
  1250. package/server/src/workers/StreamParser.ts +42 -11
  1251. package/server/src/workers/WorkerManager.ts +32 -35
  1252. package/server/src/workers/durablePidRegistry.ts +266 -0
  1253. package/server/src/workers/limits.ts +1 -1
  1254. package/server/src/workers/pidRegistry.ts +15 -89
  1255. package/server/src/workers/processActivity.ts +14 -0
  1256. package/server/src/workers/processKill.ts +175 -1
  1257. package/server/src/workers/processStartTime.ts +137 -49
  1258. package/server/src/workflowMeta.ts +59 -19
  1259. package/server/src/workflowStore.ts +177 -22
  1260. package/server/src/workflows/modelTitles.ts +4 -3
  1261. package/server/src/workflows/sessionIndex.ts +24 -3
  1262. package/server/src/workflows/types.ts +20 -10
  1263. package/server/src/workspace.ts +6 -0
  1264. package/server/src/ws/afterTurn.ts +34 -0
  1265. package/server/src/ws/clusterHandlers.ts +198 -276
  1266. package/server/src/ws/clusterMembers.ts +204 -0
  1267. package/server/src/ws/compactHandlers.ts +38 -11
  1268. package/server/src/ws/gateHandlers.ts +2 -1
  1269. package/server/src/ws/genesisHandlers.ts +49 -6
  1270. package/server/src/ws/handoffHandlers.ts +168 -53
  1271. package/server/src/ws/previewCaptureHandlers.ts +1 -4
  1272. package/server/src/ws/taskLedgerHandlers.ts +22 -13
  1273. package/server/src/ws/taskLifecycle.ts +41 -0
  1274. package/server/src/ws/turnEngine.ts +488 -366
  1275. package/server/src/ws/turnPrompt.ts +60 -0
  1276. package/server/src/ws/turnSettings.ts +95 -0
  1277. package/server/src/ws/updatePrimaryConfig.ts +55 -31
  1278. package/server/src/ws/workflowHandlers.ts +187 -158
  1279. package/shared/dist/clusterCoordination.js +15 -7
  1280. package/shared/dist/clusterRolePresets.js +8 -6
  1281. package/shared/dist/codexChat.d.ts +2 -0
  1282. package/shared/dist/codexChat.js +5 -0
  1283. package/shared/dist/folderName.d.ts +1 -0
  1284. package/shared/dist/folderName.js +18 -0
  1285. package/shared/dist/index.d.ts +6 -0
  1286. package/shared/dist/index.js +6 -0
  1287. package/shared/dist/localRuntimeStatus.d.ts +23 -0
  1288. package/shared/dist/localRuntimeStatus.js +47 -0
  1289. package/shared/dist/notificationTitle.d.ts +9 -0
  1290. package/shared/dist/notificationTitle.js +23 -0
  1291. package/shared/dist/outputStyle.d.ts +10 -0
  1292. package/shared/dist/outputStyle.js +28 -0
  1293. package/shared/dist/outputs.d.ts +1 -0
  1294. package/shared/dist/protocol/autoPickup.d.ts +2 -0
  1295. package/shared/dist/protocol/chat.d.ts +4 -0
  1296. package/shared/dist/protocol/checkpoints.d.ts +24 -2
  1297. package/shared/dist/protocol/checkpoints.js +1 -0
  1298. package/shared/dist/protocol/clientMessages.d.ts +9 -14
  1299. package/shared/dist/protocol/clusters.d.ts +21 -4
  1300. package/shared/dist/protocol/clusters.js +3 -3
  1301. package/shared/dist/protocol/connections.d.ts +2 -0
  1302. package/shared/dist/protocol/diagnostics.js +1 -1
  1303. package/shared/dist/protocol/genesis.d.ts +9 -0
  1304. package/shared/dist/protocol/mcp.d.ts +1 -0
  1305. package/shared/dist/protocol/mcp.js +8 -5
  1306. package/shared/dist/protocol/mdTuneup.d.ts +2 -0
  1307. package/shared/dist/protocol/models.d.ts +3 -1
  1308. package/shared/dist/protocol/models.js +19 -8
  1309. package/shared/dist/protocol/notifications.d.ts +2 -1
  1310. package/shared/dist/protocol/notifications.js +15 -3
  1311. package/shared/dist/protocol/plans.d.ts +2 -1
  1312. package/shared/dist/protocol/remoteManagement.d.ts +6 -0
  1313. package/shared/dist/protocol/serverMessages.d.ts +69 -10
  1314. package/shared/dist/protocol/settings.d.ts +16 -4
  1315. package/shared/dist/protocol/settings.js +17 -1
  1316. package/shared/dist/protocol/tasks.d.ts +1 -0
  1317. package/shared/dist/protocol/usage.d.ts +1 -0
  1318. package/shared/dist/protocol/workers.d.ts +1 -0
  1319. package/shared/dist/protocol/workflows.d.ts +73 -14
  1320. package/shared/dist/protocol/workflows.js +66 -0
  1321. package/shared/dist/publicGuardrails.d.ts +1 -1
  1322. package/shared/dist/publicGuardrails.js +1 -1
  1323. package/shared/dist/runtimeVersions.d.ts +2 -0
  1324. package/shared/dist/runtimeVersions.js +13 -0
  1325. package/shared/dist/shellTool.d.ts +2 -0
  1326. package/shared/dist/shellTool.js +9 -0
  1327. package/shared/src/clusterCoordination.ts +12 -7
  1328. package/shared/src/clusterRolePresets.ts +8 -6
  1329. package/shared/src/codexChat.ts +8 -0
  1330. package/shared/src/folderName.ts +11 -0
  1331. package/shared/src/index.ts +8 -0
  1332. package/shared/src/localRuntimeStatus.ts +53 -0
  1333. package/shared/src/notificationTitle.ts +23 -0
  1334. package/shared/src/outputStyle.ts +35 -0
  1335. package/shared/src/outputs.ts +3 -0
  1336. package/shared/src/protocol/autoPickup.ts +2 -0
  1337. package/shared/src/protocol/chat.ts +5 -0
  1338. package/shared/src/protocol/checkpoints.ts +40 -8
  1339. package/shared/src/protocol/clientMessages.ts +11 -11
  1340. package/shared/src/protocol/clusters.ts +40 -10
  1341. package/shared/src/protocol/connections.ts +6 -0
  1342. package/shared/src/protocol/diagnostics.ts +1 -1
  1343. package/shared/src/protocol/genesis.ts +11 -0
  1344. package/shared/src/protocol/mcp.ts +12 -7
  1345. package/shared/src/protocol/mdTuneup.ts +4 -2
  1346. package/shared/src/protocol/models.ts +22 -8
  1347. package/shared/src/protocol/notifications.ts +16 -3
  1348. package/shared/src/protocol/plans.ts +5 -7
  1349. package/shared/src/protocol/remoteManagement.ts +10 -3
  1350. package/shared/src/protocol/serverMessages.ts +88 -7
  1351. package/shared/src/protocol/settings.ts +35 -5
  1352. package/shared/src/protocol/tasks.ts +1 -0
  1353. package/shared/src/protocol/usage.ts +3 -3
  1354. package/shared/src/protocol/workers.ts +5 -0
  1355. package/shared/src/protocol/workflows.ts +133 -21
  1356. package/shared/src/publicGuardrails.ts +1 -1
  1357. package/shared/src/runtimeVersions.ts +15 -0
  1358. package/shared/src/shellTool.ts +9 -0
  1359. package/client/dist/assets/galleryEditor-fPb76Cjv.js +0 -702
  1360. package/client/dist/assets/index-CjkHb-_n.js +0 -592
  1361. package/client/dist/assets/index-DIbh3ae5.css +0 -1
  1362. package/client/src/components/ConversationMenu.tsx +0 -467
  1363. package/client/src/stores/sessionIndexStore.ts +0 -92
@@ -1,4 +1,4 @@
1
- import{r as F,j as d}from"./index-CjkHb-_n.js";const W=`// Adapted from the reference terminal crt.js, d52d430. No time-driven scan/band/hum.
1
+ import{r as F,j as d}from"./index-8j6p-pmQ.js";const W=`// Adapted from the reference terminal crt.js, d52d430. No time-driven scan/band/hum.
2
2
 
3
3
  precision highp float;
4
4
 
@@ -1,4 +1,4 @@
1
- import{u as ll,D as _s,a as cl,T as vs,r as Sr,j as ul}from"./index-CjkHb-_n.js";/**
1
+ import{u as ll,D as _s,a as cl,T as vs,r as Sr,j as ul}from"./index-8j6p-pmQ.js";/**
2
2
  * @license
3
3
  * Copyright 2010-2026 Three.js Authors
4
4
  * SPDX-License-Identifier: MIT
@@ -1,4 +1,4 @@
1
- import{r as ee,u as ke,j as pe,T as Le,e as De}from"./index-CjkHb-_n.js";var ge={exports:{}},Ce;function Re(){return Ce||(Ce=1,(function(se,ie){(function(Z,X){se.exports=X()})(globalThis,(()=>(()=>{var Z={4567:function(M,r,a){var l=this&&this.__decorate||function(e,t,n,u){var _,p=arguments.length,h=p<3?t:u===null?u=Object.getOwnPropertyDescriptor(t,n):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(e,t,n,u);else for(var S=e.length-1;S>=0;S--)(_=e[S])&&(h=(p<3?_(h):p>3?_(t,n,h):_(t,n))||h);return p>3&&h&&Object.defineProperty(t,n,h),h},f=this&&this.__param||function(e,t){return function(n,u){t(n,u,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const o=a(9042),d=a(9924),v=a(844),g=a(4725),c=a(2585),i=a(3656);let s=r.AccessibilityManager=class extends v.Disposable{constructor(e,t,n,u){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=u,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let _=0;_<this._terminal.rows;_++)this._rowElements[_]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[_]);if(this._topBoundaryFocusListener=_=>this._handleBoundaryFocus(_,0),this._bottomBoundaryFocusListener=_=>this._handleBoundaryFocus(_,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new d.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((_=>this._handleResize(_.rows)))),this.register(this._terminal.onRender((_=>this._refreshRows(_.start,_.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((_=>this._handleChar(_)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
1
+ import{r as ee,u as ke,j as pe,T as Le,e as De}from"./index-8j6p-pmQ.js";var ge={exports:{}},Ce;function Re(){return Ce||(Ce=1,(function(se,ie){(function(Z,X){se.exports=X()})(globalThis,(()=>(()=>{var Z={4567:function(M,r,a){var l=this&&this.__decorate||function(e,t,n,u){var _,p=arguments.length,h=p<3?t:u===null?u=Object.getOwnPropertyDescriptor(t,n):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(e,t,n,u);else for(var S=e.length-1;S>=0;S--)(_=e[S])&&(h=(p<3?_(h):p>3?_(t,n,h):_(t,n))||h);return p>3&&h&&Object.defineProperty(t,n,h),h},f=this&&this.__param||function(e,t){return function(n,u){t(n,u,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const o=a(9042),d=a(9924),v=a(844),g=a(4725),c=a(2585),i=a(3656);let s=r.AccessibilityManager=class extends v.Disposable{constructor(e,t,n,u){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=u,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let _=0;_<this._terminal.rows;_++)this._rowElements[_]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[_]);if(this._topBoundaryFocusListener=_=>this._handleBoundaryFocus(_,0),this._bottomBoundaryFocusListener=_=>this._handleBoundaryFocus(_,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new d.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((_=>this._handleResize(_.rows)))),this.register(this._terminal.onRender((_=>this._refreshRows(_.start,_.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((_=>this._handleChar(_)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
2
2
  `)))),this.register(this._terminal.onA11yTab((_=>this._handleTab(_)))),this.register(this._terminal.onKey((_=>this._handleKey(_.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,i.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,v.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
3
3
  `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=o.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){const n=this._terminal.buffer,u=n.lines.length.toString();for(let _=e;_<=t;_++){const p=n.lines.get(n.ydisp+_),h=[],S=(p==null?void 0:p.translateToString(!0,void 0,void 0,h))||"",E=(n.ydisp+_+1).toString(),k=this._rowElements[_];k&&(S.length===0?(k.innerText=" ",this._rowColumns.set(k,[0,1])):(k.textContent=S,this._rowColumns.set(k,h)),k.setAttribute("aria-posinset",E),k.setAttribute("aria-setsize",u))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){const n=e.target,u=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute("aria-posinset")===(t===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==u)return;let _,p;if(t===0?(_=n,p=this._rowElements.pop(),this._rowContainer.removeChild(p)):(_=this._rowElements.shift(),p=n,this._rowContainer.removeChild(_)),_.removeEventListener("focus",this._topBoundaryFocusListener),p.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){const h=this._createAccessibilityTreeNode();this._rowElements.unshift(h),this._rowContainer.insertAdjacentElement("afterbegin",h)}else{const h=this._createAccessibilityTreeNode();this._rowElements.push(h),this._rowContainer.appendChild(h)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var S;if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;const u=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(u)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:u,offset:((S=u.textContent)==null?void 0:S.length)??0}),!this._rowContainer.contains(n.node))return;const _=({node:E,offset:k})=>{const D=E instanceof Text?E.parentNode:E;let w=parseInt(D==null?void 0:D.getAttribute("aria-posinset"),10)-1;if(isNaN(w))return console.warn("row is invalid. Race condition?"),null;const x=this._rowColumns.get(D);if(!x)return console.warn("columns is null. Race condition?"),null;let B=k<x.length?x[k]:x.slice(-1)[0]+1;return B>=this._terminal.cols&&(++w,B=0),{row:w,column:B}},p=_(t),h=_(n);if(p&&h){if(p.row>h.row||p.row===h.row&&p.column>=h.column)throw new Error("invalid range");this._terminal.select(p.column,p.row,(h.row-p.row)*this._terminal.cols-p.column+h.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=s=l([f(1,c.IInstantiationService),f(2,g.ICoreBrowserService),f(3,g.IRenderService)],s)},3614:(M,r)=>{function a(d){return d.replace(/\r?\n/g,"\r")}function l(d,v){return v?"\x1B[200~"+d+"\x1B[201~":d}function f(d,v,g,c){d=l(d=a(d),g.decPrivateModes.bracketedPasteMode&&c.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(d,!0),v.value=""}function o(d,v,g){const c=g.getBoundingClientRect(),i=d.clientX-c.left-10,s=d.clientY-c.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${i}px`,v.style.top=`${s}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=a,r.bracketTextForPaste=l,r.copyHandler=function(d,v){d.clipboardData&&d.clipboardData.setData("text/plain",v.selectionText),d.preventDefault()},r.handlePasteEvent=function(d,v,g,c){d.stopPropagation(),d.clipboardData&&f(d.clipboardData.getData("text/plain"),v,g,c)},r.paste=f,r.moveTextAreaUnderMouseCursor=o,r.rightClickHandler=function(d,v,g,c,i){o(d,v,g),i&&c.rightClickSelect(d),v.value=c.selectionText,v.select()}},7239:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const l=a(1505);r.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(f,o,d){this._css.set(f,o,d)}getCss(f,o){return this._css.get(f,o)}setColor(f,o,d){this._color.set(f,o,d)}getColor(f,o){return this._color.get(f,o)}clear(){this._color.clear(),this._css.clear()}}},3656:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(a,l,f,o){a.addEventListener(l,f,o);let d=!1;return{dispose:()=>{d||(d=!0,a.removeEventListener(l,f,o))}}}},3551:function(M,r,a){var l=this&&this.__decorate||function(s,e,t,n){var u,_=arguments.length,p=_<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(s,e,t,n);else for(var h=s.length-1;h>=0;h--)(u=s[h])&&(p=(_<3?u(p):_>3?u(e,t,p):u(e,t))||p);return _>3&&p&&Object.defineProperty(e,t,p),p},f=this&&this.__param||function(s,e){return function(t,n){e(t,n,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;const o=a(3656),d=a(8460),v=a(844),g=a(2585),c=a(4725);let i=r.Linkifier=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(s,e,t,n,u){super(),this._element=s,this._mouseService=e,this._renderService=t,this._bufferService=n,this._linkProviderService=u,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)((()=>{var _;this._lastMouseEvent=void 0,(_=this._activeProviderReplies)==null||_.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,o.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,o.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(s){this._lastMouseEvent=s;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const t=s.composedPath();for(let n=0;n<t.length;n++){const u=t[n];if(u.classList.contains("xterm"))break;if(u.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(s){if(this._activeLine!==s.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(s,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,s)||(this._clearCurrentLink(),this._askForLink(s,!0))}_askForLink(s,e){var n,u;this._activeProviderReplies&&e||((n=this._activeProviderReplies)==null||n.forEach((_=>{_==null||_.forEach((p=>{p.link.dispose&&p.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=s.y);let t=!1;for(const[_,p]of this._linkProviderService.linkProviders.entries())e?(u=this._activeProviderReplies)!=null&&u.get(_)&&(t=this._checkLinkProviderResult(_,s,t)):p.provideLinks(s.y,(h=>{var E,k;if(this._isMouseOut)return;const S=h==null?void 0:h.map((D=>({link:D})));(E=this._activeProviderReplies)==null||E.set(_,S),t=this._checkLinkProviderResult(_,s,t),((k=this._activeProviderReplies)==null?void 0:k.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(s.y,this._activeProviderReplies)}))}_removeIntersectingLinks(s,e){const t=new Set;for(let n=0;n<e.size;n++){const u=e.get(n);if(u)for(let _=0;_<u.length;_++){const p=u[_],h=p.link.range.start.y<s?0:p.link.range.start.x,S=p.link.range.end.y>s?this._bufferService.cols:p.link.range.end.x;for(let E=h;E<=S;E++){if(t.has(E)){u.splice(_--,1);break}t.add(E)}}}}_checkLinkProviderResult(s,e,t){var _;if(!this._activeProviderReplies)return t;const n=this._activeProviderReplies.get(s);let u=!1;for(let p=0;p<s;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(u=!0);if(!u&&n){const p=n.find((h=>this._linkAtPosition(h.link,e)));p&&(t=!0,this._handleNewLink(p))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!t)for(let p=0;p<this._activeProviderReplies.size;p++){const h=(_=this._activeProviderReplies.get(p))==null?void 0:_.find((S=>this._linkAtPosition(S.link,e)));if(h){t=!0,this._handleNewLink(h);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(s){if(!this._currentLink)return;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(s,this._currentLink.link.text)}_clearCurrentLink(s,e){this._currentLink&&this._lastMouseEvent&&(!s||!e||this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(s){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(s.link,e)&&(this._currentLink=s,this._currentLink.state={decorations:{underline:s.link.decorations===void 0||s.link.decorations.underline,pointerCursor:s.link.decorations===void 0||s.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,s.link,this._lastMouseEvent),s.link.decorations={},Object.defineProperties(s.link.decorations,{pointerCursor:{get:()=>{var t,n;return(n=(t=this._currentLink)==null?void 0:t.state)==null?void 0:n.decorations.pointerCursor},set:t=>{var n;(n=this._currentLink)!=null&&n.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",t))}},underline:{get:()=>{var t,n;return(n=(t=this._currentLink)==null?void 0:t.state)==null?void 0:n.decorations.underline},set:t=>{var n,u,_;(n=this._currentLink)!=null&&n.state&&((_=(u=this._currentLink)==null?void 0:u.state)==null?void 0:_.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(s.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((t=>{if(!this._currentLink)return;const n=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,u=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=u&&(this._clearCurrentLink(n,u),this._lastMouseEvent)){const _=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);_&&this._askForLink(_,!1)}}))))}_linkHover(s,e,t){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&s.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(t,e.text)}_fireUnderlineEvent(s,e){const t=s.range,n=this._bufferService.buffer.ydisp,u=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-n-1,t.end.x,t.end.y-n-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(u)}_linkLeave(s,e,t){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&s.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(t,e.text)}_linkAtPosition(s,e){const t=s.range.start.y*this._bufferService.cols+s.range.start.x,n=s.range.end.y*this._bufferService.cols+s.range.end.x,u=e.y*this._bufferService.cols+e.x;return t<=u&&u<=n}_positionFromMouseEvent(s,e,t){const n=t.getCoords(s,e,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(s,e,t,n,u){return{x1:s,y1:e,x2:t,y2:n,cols:this._bufferService.cols,fg:u}}};r.Linkifier=i=l([f(1,c.IMouseService),f(2,c.IRenderService),f(3,g.IBufferService),f(4,c.ILinkProviderService)],i)},9042:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(M,r,a){var l=this&&this.__decorate||function(c,i,s,e){var t,n=arguments.length,u=n<3?i:e===null?e=Object.getOwnPropertyDescriptor(i,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(c,i,s,e);else for(var _=c.length-1;_>=0;_--)(t=c[_])&&(u=(n<3?t(u):n>3?t(i,s,u):t(i,s))||u);return n>3&&u&&Object.defineProperty(i,s,u),u},f=this&&this.__param||function(c,i){return function(s,e){i(s,e,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const o=a(511),d=a(2585);let v=r.OscLinkProvider=class{constructor(c,i,s){this._bufferService=c,this._optionsService=i,this._oscLinkService=s}provideLinks(c,i){var S;const s=this._bufferService.buffer.lines.get(c-1);if(!s)return void i(void 0);const e=[],t=this._optionsService.rawOptions.linkHandler,n=new o.CellData,u=s.getTrimmedLength();let _=-1,p=-1,h=!1;for(let E=0;E<u;E++)if(p!==-1||s.hasContent(E)){if(s.loadCell(E,n),n.hasExtendedAttrs()&&n.extended.urlId){if(p===-1){p=E,_=n.extended.urlId;continue}h=n.extended.urlId!==_}else p!==-1&&(h=!0);if(h||p!==-1&&E===u-1){const k=(S=this._oscLinkService.getLinkData(_))==null?void 0:S.uri;if(k){const D={start:{x:p+1,y:c},end:{x:E+(h||E!==u-1?0:1),y:c}};let w=!1;if(!(t!=null&&t.allowNonHttpProtocols))try{const x=new URL(k);["http:","https:"].includes(x.protocol)||(w=!0)}catch{w=!0}w||e.push({text:k,range:D,activate:(x,B)=>t?t.activate(x,B,D):g(0,B),hover:(x,B)=>{var P;return(P=t==null?void 0:t.hover)==null?void 0:P.call(t,x,B,D)},leave:(x,B)=>{var P;return(P=t==null?void 0:t.leave)==null?void 0:P.call(t,x,B,D)}})}h=!1,n.hasExtendedAttrs()&&n.extended.urlId?(p=E,_=n.extended.urlId):(p=-1,_=-1)}}i(e)}};function g(c,i){if(confirm(`Do you want to navigate to ${i}?
4
4
 
@@ -6,5 +6,5 @@ WARNING: This link could potentially be dangerous`)){const s=window.open();if(s)
6
6
  `:`
7
7
  `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(h){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),s.isLinux&&h&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(h){const S=this._getMouseBufferCoords(h),E=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!!(E&&k&&S)&&this._areCoordsInSelection(S,E,k)}isCellInSelection(h,S){const E=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!E||!k)&&this._areCoordsInSelection([h,S],E,k)}_areCoordsInSelection(h,S,E){return h[1]>S[1]&&h[1]<E[1]||S[1]===E[1]&&h[1]===S[1]&&h[0]>=S[0]&&h[0]<E[0]||S[1]<E[1]&&h[1]===E[1]&&h[0]<E[0]||S[1]<E[1]&&h[1]===S[1]&&h[0]>=S[0]}_selectWordAtCursor(h,S){var D,w;const E=(w=(D=this._linkifier.currentLink)==null?void 0:D.link)==null?void 0:w.range;if(E)return this._model.selectionStart=[E.start.x-1,E.start.y-1],this._model.selectionStartLength=(0,e.getRangeLength)(E,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const k=this._getMouseBufferCoords(h);return!!k&&(this._selectWordAt(k,S),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(h,S){this._model.clearSelection(),h=Math.max(h,0),S=Math.min(S,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,h],this._model.selectionEnd=[this._bufferService.cols,S],this.refresh(),this._onSelectionChange.fire()}_handleTrim(h){this._model.handleTrim(h)&&this.refresh()}_getMouseBufferCoords(h){const S=this._mouseService.getCoords(h,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(S)return S[0]--,S[1]--,S[1]+=this._bufferService.buffer.ydisp,S}_getMouseEventScrollAmount(h){let S=(0,o.getCoordsRelativeToElement)(this._coreBrowserService.window,h,this._screenElement)[1];const E=this._renderService.dimensions.css.canvas.height;return S>=0&&S<=E?0:(S>E&&(S-=E),S=Math.min(Math.max(S,-50),50),S/=50,S/Math.abs(S)+Math.round(14*S))}shouldForceSelection(h){return s.isMac?h.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:h.shiftKey}handleMouseDown(h){if(this._mouseDownTimeStamp=h.timeStamp,(h.button!==2||!this.hasSelection)&&h.button===0){if(!this._enabled){if(!this.shouldForceSelection(h))return;h.stopPropagation()}h.preventDefault(),this._dragScrollAmount=0,this._enabled&&h.shiftKey?this._handleIncrementalClick(h):h.detail===1?this._handleSingleClick(h):h.detail===2?this._handleDoubleClick(h):h.detail===3&&this._handleTripleClick(h),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(h){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(h))}_handleSingleClick(h){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(h)?3:0,this._model.selectionStart=this._getMouseBufferCoords(h),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const S=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);S&&S.length!==this._model.selectionStart[0]&&S.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(h){this._selectWordAtCursor(h,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(h){const S=this._getMouseBufferCoords(h);S&&(this._activeSelectionMode=2,this._selectLineAt(S[1]))}shouldColumnSelect(h){return h.altKey&&!(s.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(h){if(h.stopImmediatePropagation(),!this._model.selectionStart)return;const S=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(h),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(h),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const E=this._bufferService.buffer;if(this._model.selectionEnd[1]<E.lines.length){const k=E.lines.get(this._model.selectionEnd[1]);k&&k.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}S&&S[0]===this._model.selectionEnd[0]&&S[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const h=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(h.ydisp+this._bufferService.rows,h.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=h.ydisp),this.refresh()}}_handleMouseUp(h){const S=h.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&S<500&&h.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const E=this._mouseService.getCoords(h,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(E&&E[0]!==void 0&&E[1]!==void 0){const k=(0,d.moveToCellSequence)(E[0]-1,E[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(k,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const h=this._model.finalSelectionStart,S=this._model.finalSelectionEnd,E=!(!h||!S||h[0]===S[0]&&h[1]===S[1]);E?h&&S&&(this._oldSelectionStart&&this._oldSelectionEnd&&h[0]===this._oldSelectionStart[0]&&h[1]===this._oldSelectionStart[1]&&S[0]===this._oldSelectionEnd[0]&&S[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(h,S,E)):this._oldHasSelection&&this._fireOnSelectionChange(h,S,E)}_fireOnSelectionChange(h,S,E){this._oldSelectionStart=h,this._oldSelectionEnd=S,this._oldHasSelection=E,this._onSelectionChange.fire()}_handleBufferActivate(h){this.clearSelection(),this._trimListener.dispose(),this._trimListener=h.activeBuffer.lines.onTrim((S=>this._handleTrim(S)))}_convertViewportColToCharacterIndex(h,S){let E=S;for(let k=0;S>=k;k++){const D=h.loadCell(k,this._workCell).getChars().length;this._workCell.getWidth()===0?E--:D>1&&S!==k&&(E+=D-1)}return E}setSelection(h,S,E){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[h,S],this._model.selectionStartLength=E,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(h){this._isClickInSelection(h)||(this._selectWordAtCursor(h,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(h,S,E=!0,k=!0){if(h[0]>=this._bufferService.cols)return;const D=this._bufferService.buffer,w=D.lines.get(h[1]);if(!w)return;const x=D.translateBufferLineToString(h[1],!1);let B=this._convertViewportColToCharacterIndex(w,h[0]),P=B;const F=h[0]-B;let I=0,m=0,b=0,y=0;if(x.charAt(B)===" "){for(;B>0&&x.charAt(B-1)===" ";)B--;for(;P<x.length&&x.charAt(P+1)===" ";)P++}else{let H=h[0],U=h[0];w.getWidth(H)===0&&(I++,H--),w.getWidth(U)===2&&(m++,U++);const $=w.getString(U).length;for($>1&&(y+=$-1,P+=$-1);H>0&&B>0&&!this._isCharWordSeparator(w.loadCell(H-1,this._workCell));){w.loadCell(H-1,this._workCell);const R=this._workCell.getChars().length;this._workCell.getWidth()===0?(I++,H--):R>1&&(b+=R-1,B-=R-1),B--,H--}for(;U<w.length&&P+1<x.length&&!this._isCharWordSeparator(w.loadCell(U+1,this._workCell));){w.loadCell(U+1,this._workCell);const R=this._workCell.getChars().length;this._workCell.getWidth()===2?(m++,U++):R>1&&(y+=R-1,P+=R-1),P++,U++}}P++;let L=B+F-I+b,T=Math.min(this._bufferService.cols,P-B+I+m-b-y);if(S||x.slice(B,P).trim()!==""){if(E&&L===0&&w.getCodePoint(0)!==32){const H=D.lines.get(h[1]-1);if(H&&w.isWrapped&&H.getCodePoint(this._bufferService.cols-1)!==32){const U=this._getWordAt([this._bufferService.cols-1,h[1]-1],!1,!0,!1);if(U){const $=this._bufferService.cols-U.start;L-=$,T+=$}}}if(k&&L+T===this._bufferService.cols&&w.getCodePoint(this._bufferService.cols-1)!==32){const H=D.lines.get(h[1]+1);if(H!=null&&H.isWrapped&&H.getCodePoint(0)!==32){const U=this._getWordAt([0,h[1]+1],!1,!1,!0);U&&(T+=U.length)}}return{start:L,length:T}}}_selectWordAt(h,S){const E=this._getWordAt(h,S);if(E){for(;E.start<0;)E.start+=this._bufferService.cols,h[1]--;this._model.selectionStart=[E.start,h[1]],this._model.selectionStartLength=E.length}}_selectToWordAt(h){const S=this._getWordAt(h,!0);if(S){let E=h[1];for(;S.start<0;)S.start+=this._bufferService.cols,E--;if(!this._model.areSelectionValuesReversed())for(;S.start+S.length>this._bufferService.cols;)S.length-=this._bufferService.cols,E++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?S.start:S.start+S.length,E]}}_isCharWordSeparator(h){return h.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(h.getChars())>=0}_selectLineAt(h){const S=this._bufferService.buffer.getWrappedRangeForLine(h),E={start:{x:0,y:S.first},end:{x:this._bufferService.cols-1,y:S.last}};this._model.selectionStart=[0,S.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,e.getRangeLength)(E,this._bufferService.cols)}};r.SelectionService=p=l([f(3,n.IBufferService),f(4,n.ICoreService),f(5,g.IMouseService),f(6,n.IOptionsService),f(7,g.IRenderService),f(8,g.ICoreBrowserService)],p)},4725:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ILinkProviderService=r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const l=a(8343);r.ICharSizeService=(0,l.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,l.createDecorator)("CoreBrowserService"),r.IMouseService=(0,l.createDecorator)("MouseService"),r.IRenderService=(0,l.createDecorator)("RenderService"),r.ISelectionService=(0,l.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,l.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,l.createDecorator)("ThemeService"),r.ILinkProviderService=(0,l.createDecorator)("LinkProviderService")},6731:function(M,r,a){var l=this&&this.__decorate||function(p,h,S,E){var k,D=arguments.length,w=D<3?h:E===null?E=Object.getOwnPropertyDescriptor(h,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(p,h,S,E);else for(var x=p.length-1;x>=0;x--)(k=p[x])&&(w=(D<3?k(w):D>3?k(h,S,w):k(h,S))||w);return D>3&&w&&Object.defineProperty(h,S,w),w},f=this&&this.__param||function(p,h){return function(S,E){h(S,E,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const o=a(7239),d=a(8055),v=a(8460),g=a(844),c=a(2585),i=d.css.toColor("#ffffff"),s=d.css.toColor("#000000"),e=d.css.toColor("#ffffff"),t=d.css.toColor("#000000"),n={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const p=[d.css.toColor("#2e3436"),d.css.toColor("#cc0000"),d.css.toColor("#4e9a06"),d.css.toColor("#c4a000"),d.css.toColor("#3465a4"),d.css.toColor("#75507b"),d.css.toColor("#06989a"),d.css.toColor("#d3d7cf"),d.css.toColor("#555753"),d.css.toColor("#ef2929"),d.css.toColor("#8ae234"),d.css.toColor("#fce94f"),d.css.toColor("#729fcf"),d.css.toColor("#ad7fa8"),d.css.toColor("#34e2e2"),d.css.toColor("#eeeeec")],h=[0,95,135,175,215,255];for(let S=0;S<216;S++){const E=h[S/36%6|0],k=h[S/6%6|0],D=h[S%6];p.push({css:d.channels.toCss(E,k,D),rgba:d.channels.toRgba(E,k,D)})}for(let S=0;S<24;S++){const E=8+10*S;p.push({css:d.channels.toCss(E,E,E),rgba:d.channels.toRgba(E,E,E)})}return p})());let u=r.ThemeService=class extends g.Disposable{get colors(){return this._colors}constructor(p){super(),this._optionsService=p,this._contrastCache=new o.ColorContrastCache,this._halfContrastCache=new o.ColorContrastCache,this._onChangeColors=this.register(new v.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:i,background:s,cursor:e,cursorAccent:t,selectionForeground:void 0,selectionBackgroundTransparent:n,selectionBackgroundOpaque:d.color.blend(s,n),selectionInactiveBackgroundTransparent:n,selectionInactiveBackgroundOpaque:d.color.blend(s,n),ansi:r.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(p={}){const h=this._colors;if(h.foreground=_(p.foreground,i),h.background=_(p.background,s),h.cursor=_(p.cursor,e),h.cursorAccent=_(p.cursorAccent,t),h.selectionBackgroundTransparent=_(p.selectionBackground,n),h.selectionBackgroundOpaque=d.color.blend(h.background,h.selectionBackgroundTransparent),h.selectionInactiveBackgroundTransparent=_(p.selectionInactiveBackground,h.selectionBackgroundTransparent),h.selectionInactiveBackgroundOpaque=d.color.blend(h.background,h.selectionInactiveBackgroundTransparent),h.selectionForeground=p.selectionForeground?_(p.selectionForeground,d.NULL_COLOR):void 0,h.selectionForeground===d.NULL_COLOR&&(h.selectionForeground=void 0),d.color.isOpaque(h.selectionBackgroundTransparent)&&(h.selectionBackgroundTransparent=d.color.opacity(h.selectionBackgroundTransparent,.3)),d.color.isOpaque(h.selectionInactiveBackgroundTransparent)&&(h.selectionInactiveBackgroundTransparent=d.color.opacity(h.selectionInactiveBackgroundTransparent,.3)),h.ansi=r.DEFAULT_ANSI_COLORS.slice(),h.ansi[0]=_(p.black,r.DEFAULT_ANSI_COLORS[0]),h.ansi[1]=_(p.red,r.DEFAULT_ANSI_COLORS[1]),h.ansi[2]=_(p.green,r.DEFAULT_ANSI_COLORS[2]),h.ansi[3]=_(p.yellow,r.DEFAULT_ANSI_COLORS[3]),h.ansi[4]=_(p.blue,r.DEFAULT_ANSI_COLORS[4]),h.ansi[5]=_(p.magenta,r.DEFAULT_ANSI_COLORS[5]),h.ansi[6]=_(p.cyan,r.DEFAULT_ANSI_COLORS[6]),h.ansi[7]=_(p.white,r.DEFAULT_ANSI_COLORS[7]),h.ansi[8]=_(p.brightBlack,r.DEFAULT_ANSI_COLORS[8]),h.ansi[9]=_(p.brightRed,r.DEFAULT_ANSI_COLORS[9]),h.ansi[10]=_(p.brightGreen,r.DEFAULT_ANSI_COLORS[10]),h.ansi[11]=_(p.brightYellow,r.DEFAULT_ANSI_COLORS[11]),h.ansi[12]=_(p.brightBlue,r.DEFAULT_ANSI_COLORS[12]),h.ansi[13]=_(p.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),h.ansi[14]=_(p.brightCyan,r.DEFAULT_ANSI_COLORS[14]),h.ansi[15]=_(p.brightWhite,r.DEFAULT_ANSI_COLORS[15]),p.extendedAnsi){const S=Math.min(h.ansi.length-16,p.extendedAnsi.length);for(let E=0;E<S;E++)h.ansi[E+16]=_(p.extendedAnsi[E],r.DEFAULT_ANSI_COLORS[E+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(p){this._restoreColor(p),this._onChangeColors.fire(this.colors)}_restoreColor(p){if(p!==void 0)switch(p){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[p]=this._restoreColors.ansi[p]}else for(let h=0;h<this._restoreColors.ansi.length;++h)this._colors.ansi[h]=this._restoreColors.ansi[h]}modifyColors(p){p(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function _(p,h){if(p!==void 0)try{return d.css.toColor(p)}catch{}return h}r.ThemeService=u=l([f(0,c.IOptionsService)],u)},6349:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const l=a(8460),f=a(844);class o extends f.Disposable{constructor(v){super(),this._maxLength=v,this.onDeleteEmitter=this.register(new l.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new l.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new l.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(v){if(this._maxLength===v)return;const g=new Array(v);for(let c=0;c<Math.min(v,this.length);c++)g[c]=this._array[this._getCyclicIndex(c)];this._array=g,this._maxLength=v,this._startIndex=0}get length(){return this._length}set length(v){if(v>this._length)for(let g=this._length;g<v;g++)this._array[g]=void 0;this._length=v}get(v){return this._array[this._getCyclicIndex(v)]}set(v,g){this._array[this._getCyclicIndex(v)]=g}push(v){this._array[this._getCyclicIndex(this._length)]=v,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(v,g,...c){if(g){for(let i=v;i<this._length-g;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+g)];this._length-=g,this.onDeleteEmitter.fire({index:v,amount:g})}for(let i=this._length-1;i>=v;i--)this._array[this._getCyclicIndex(i+c.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;i<c.length;i++)this._array[this._getCyclicIndex(v+i)]=c[i];if(c.length&&this.onInsertEmitter.fire({index:v,amount:c.length}),this._length+c.length>this._maxLength){const i=this._length+c.length-this._maxLength;this._startIndex+=i,this._length=this._maxLength,this.onTrimEmitter.fire(i)}else this._length+=c.length}trimStart(v){v>this._length&&(v=this._length),this._startIndex+=v,this._length-=v,this.onTrimEmitter.fire(v)}shiftElements(v,g,c){if(!(g<=0)){if(v<0||v>=this._length)throw new Error("start argument out of range");if(v+c<0)throw new Error("Cannot shift elements in list beyond index 0");if(c>0){for(let s=g-1;s>=0;s--)this.set(v+s+c,this.get(v+s));const i=v+g+c-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let i=0;i<g;i++)this.set(v+i+c,this.get(v+i))}}_getCyclicIndex(v){return(this._startIndex+v)%this._maxLength}}r.CircularList=o},1439:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function a(l,f=5){if(typeof l!="object")return l;const o=Array.isArray(l)?[]:{};for(const d in l)o[d]=f<=1?l[d]:l[d]&&a(l[d],f-1);return o}},8055:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;let a=0,l=0,f=0,o=0;var d,v,g,c,i;function s(t){const n=t.toString(16);return n.length<2?"0"+n:n}function e(t,n){return t<n?(n+.05)/(t+.05):(t+.05)/(n+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(t){t.toCss=function(n,u,_,p){return p!==void 0?`#${s(n)}${s(u)}${s(_)}${s(p)}`:`#${s(n)}${s(u)}${s(_)}`},t.toRgba=function(n,u,_,p=255){return(n<<24|u<<16|_<<8|p)>>>0},t.toColor=function(n,u,_,p){return{css:t.toCss(n,u,_,p),rgba:t.toRgba(n,u,_,p)}}})(d||(r.channels=d={})),(function(t){function n(u,_){return o=Math.round(255*_),[a,l,f]=i.toChannels(u.rgba),{css:d.toCss(a,l,f,o),rgba:d.toRgba(a,l,f,o)}}t.blend=function(u,_){if(o=(255&_.rgba)/255,o===1)return{css:_.css,rgba:_.rgba};const p=_.rgba>>24&255,h=_.rgba>>16&255,S=_.rgba>>8&255,E=u.rgba>>24&255,k=u.rgba>>16&255,D=u.rgba>>8&255;return a=E+Math.round((p-E)*o),l=k+Math.round((h-k)*o),f=D+Math.round((S-D)*o),{css:d.toCss(a,l,f),rgba:d.toRgba(a,l,f)}},t.isOpaque=function(u){return(255&u.rgba)==255},t.ensureContrastRatio=function(u,_,p){const h=i.ensureContrastRatio(u.rgba,_.rgba,p);if(h)return d.toColor(h>>24&255,h>>16&255,h>>8&255)},t.opaque=function(u){const _=(255|u.rgba)>>>0;return[a,l,f]=i.toChannels(_),{css:d.toCss(a,l,f),rgba:_}},t.opacity=n,t.multiplyOpacity=function(u,_){return o=255&u.rgba,n(u,o*_/255)},t.toColorRGB=function(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}})(v||(r.color=v={})),(function(t){let n,u;try{const _=document.createElement("canvas");_.width=1,_.height=1;const p=_.getContext("2d",{willReadFrequently:!0});p&&(n=p,n.globalCompositeOperation="copy",u=n.createLinearGradient(0,0,1,1))}catch{}t.toColor=function(_){if(_.match(/#[\da-f]{3,8}/i))switch(_.length){case 4:return a=parseInt(_.slice(1,2).repeat(2),16),l=parseInt(_.slice(2,3).repeat(2),16),f=parseInt(_.slice(3,4).repeat(2),16),d.toColor(a,l,f);case 5:return a=parseInt(_.slice(1,2).repeat(2),16),l=parseInt(_.slice(2,3).repeat(2),16),f=parseInt(_.slice(3,4).repeat(2),16),o=parseInt(_.slice(4,5).repeat(2),16),d.toColor(a,l,f,o);case 7:return{css:_,rgba:(parseInt(_.slice(1),16)<<8|255)>>>0};case 9:return{css:_,rgba:parseInt(_.slice(1),16)>>>0}}const p=_.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(p)return a=parseInt(p[1]),l=parseInt(p[2]),f=parseInt(p[3]),o=Math.round(255*(p[5]===void 0?1:parseFloat(p[5]))),d.toColor(a,l,f,o);if(!n||!u)throw new Error("css.toColor: Unsupported css format");if(n.fillStyle=u,n.fillStyle=_,typeof n.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(n.fillRect(0,0,1,1),[a,l,f,o]=n.getImageData(0,0,1,1).data,o!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:d.toRgba(a,l,f,o),css:_}}})(g||(r.css=g={})),(function(t){function n(u,_,p){const h=u/255,S=_/255,E=p/255;return .2126*(h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4))+.7152*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.0722*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))}t.relativeLuminance=function(u){return n(u>>16&255,u>>8&255,255&u)},t.relativeLuminance2=n})(c||(r.rgb=c={})),(function(t){function n(_,p,h){const S=_>>24&255,E=_>>16&255,k=_>>8&255;let D=p>>24&255,w=p>>16&255,x=p>>8&255,B=e(c.relativeLuminance2(D,w,x),c.relativeLuminance2(S,E,k));for(;B<h&&(D>0||w>0||x>0);)D-=Math.max(0,Math.ceil(.1*D)),w-=Math.max(0,Math.ceil(.1*w)),x-=Math.max(0,Math.ceil(.1*x)),B=e(c.relativeLuminance2(D,w,x),c.relativeLuminance2(S,E,k));return(D<<24|w<<16|x<<8|255)>>>0}function u(_,p,h){const S=_>>24&255,E=_>>16&255,k=_>>8&255;let D=p>>24&255,w=p>>16&255,x=p>>8&255,B=e(c.relativeLuminance2(D,w,x),c.relativeLuminance2(S,E,k));for(;B<h&&(D<255||w<255||x<255);)D=Math.min(255,D+Math.ceil(.1*(255-D))),w=Math.min(255,w+Math.ceil(.1*(255-w))),x=Math.min(255,x+Math.ceil(.1*(255-x))),B=e(c.relativeLuminance2(D,w,x),c.relativeLuminance2(S,E,k));return(D<<24|w<<16|x<<8|255)>>>0}t.blend=function(_,p){if(o=(255&p)/255,o===1)return p;const h=p>>24&255,S=p>>16&255,E=p>>8&255,k=_>>24&255,D=_>>16&255,w=_>>8&255;return a=k+Math.round((h-k)*o),l=D+Math.round((S-D)*o),f=w+Math.round((E-w)*o),d.toRgba(a,l,f)},t.ensureContrastRatio=function(_,p,h){const S=c.relativeLuminance(_>>8),E=c.relativeLuminance(p>>8);if(e(S,E)<h){if(E<S){const w=n(_,p,h),x=e(S,c.relativeLuminance(w>>8));if(x<h){const B=u(_,p,h);return x>e(S,c.relativeLuminance(B>>8))?w:B}return w}const k=u(_,p,h),D=e(S,c.relativeLuminance(k>>8));if(D<h){const w=n(_,p,h);return D>e(S,c.relativeLuminance(w>>8))?k:w}return k}},t.reduceLuminance=n,t.increaseLuminance=u,t.toChannels=function(_){return[_>>24&255,_>>16&255,_>>8&255,255&_]}})(i||(r.rgba=i={})),r.toPaddedHex=s,r.contrastRatio=e},8969:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const l=a(844),f=a(2585),o=a(4348),d=a(7866),v=a(744),g=a(7302),c=a(6975),i=a(8460),s=a(1753),e=a(1480),t=a(7994),n=a(9282),u=a(5435),_=a(5981),p=a(2660);let h=!1;class S extends l.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new i.EventEmitter),this._onScroll.event((k=>{var D;(D=this._onScrollApi)==null||D.fire(k.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(k){for(const D in k)this.optionsService.options[D]=k[D]}constructor(k){super(),this._windowsWrappingHeuristics=this.register(new l.MutableDisposable),this._onBinary=this.register(new i.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new i.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new i.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new i.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new i.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new i.EventEmitter),this._instantiationService=new o.InstantiationService,this.optionsService=this.register(new g.OptionsService(k)),this._instantiationService.setService(f.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(v.BufferService)),this._instantiationService.setService(f.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(d.LogService)),this._instantiationService.setService(f.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(c.CoreService)),this._instantiationService.setService(f.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(s.CoreMouseService)),this._instantiationService.setService(f.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(e.UnicodeService)),this._instantiationService.setService(f.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(t.CharsetService),this._instantiationService.setService(f.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(p.OscLinkService),this._instantiationService.setService(f.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new u.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,i.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,i.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,i.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,i.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((D=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((D=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new _.WriteBuffer(((D,w)=>this._inputHandler.parse(D,w)))),this.register((0,i.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(k,D){this._writeBuffer.write(k,D)}writeSync(k,D){this._logService.logLevel<=f.LogLevelEnum.WARN&&!h&&(this._logService.warn("writeSync is unreliable and will be removed soon."),h=!0),this._writeBuffer.writeSync(k,D)}input(k,D=!0){this.coreService.triggerDataEvent(k,D)}resize(k,D){isNaN(k)||isNaN(D)||(k=Math.max(k,v.MINIMUM_COLS),D=Math.max(D,v.MINIMUM_ROWS),this._bufferService.resize(k,D))}scroll(k,D=!1){this._bufferService.scroll(k,D)}scrollLines(k,D,w){this._bufferService.scrollLines(k,D,w)}scrollPages(k){this.scrollLines(k*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(k){const D=k-this._bufferService.buffer.ydisp;D!==0&&this.scrollLines(D)}registerEscHandler(k,D){return this._inputHandler.registerEscHandler(k,D)}registerDcsHandler(k,D){return this._inputHandler.registerDcsHandler(k,D)}registerCsiHandler(k,D){return this._inputHandler.registerCsiHandler(k,D)}registerOscHandler(k,D){return this._inputHandler.registerOscHandler(k,D)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let k=!1;const D=this.optionsService.rawOptions.windowsPty;D&&D.buildNumber!==void 0&&D.buildNumber!==void 0?k=D.backend==="conpty"&&D.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(k=!0),k?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const k=[];k.push(this.onLineFeed(n.updateWindowsModeWrappedState.bind(null,this._bufferService))),k.push(this.registerCsiHandler({final:"H"},(()=>((0,n.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,l.toDisposable)((()=>{for(const D of k)D.dispose()}))}}}r.CoreTerminal=S},8460:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===a)return void this._listeners.splice(l,1)}}})),this._event}fire(a,l){const f=[];for(let o=0;o<this._listeners.length;o++)f.push(this._listeners[o]);for(let o=0;o<f.length;o++)f[o].call(void 0,a,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(a,l){return a((f=>l.fire(f)))},r.runAndSubscribe=function(a,l){return l(void 0),a((f=>l(f)))}},5435:function(M,r,a){var l=this&&this.__decorate||function(I,m,b,y){var L,T=arguments.length,H=T<3?m:y===null?y=Object.getOwnPropertyDescriptor(m,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(I,m,b,y);else for(var U=I.length-1;U>=0;U--)(L=I[U])&&(H=(T<3?L(H):T>3?L(m,b,H):L(m,b))||H);return T>3&&H&&Object.defineProperty(m,b,H),H},f=this&&this.__param||function(I,m){return function(b,y){m(b,y,I)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const o=a(2584),d=a(7116),v=a(2015),g=a(844),c=a(482),i=a(8437),s=a(8460),e=a(643),t=a(511),n=a(3734),u=a(2585),_=a(1480),p=a(6242),h=a(6351),S=a(5941),E={"(":0,")":1,"*":2,"+":3,"-":1,".":2},k=131072;function D(I,m){if(I>24)return m.setWinLines||!1;switch(I){case 1:return!!m.restoreWin;case 2:return!!m.minimizeWin;case 3:return!!m.setWinPosition;case 4:return!!m.setWinSizePixels;case 5:return!!m.raiseWin;case 6:return!!m.lowerWin;case 7:return!!m.refreshWin;case 8:return!!m.setWinSizeChars;case 9:return!!m.maximizeWin;case 10:return!!m.fullscreenWin;case 11:return!!m.getWinState;case 13:return!!m.getWinPosition;case 14:return!!m.getWinSizePixels;case 15:return!!m.getScreenSizePixels;case 16:return!!m.getCellSizePixels;case 18:return!!m.getWinSizeChars;case 19:return!!m.getScreenSizeChars;case 20:return!!m.getIconTitle;case 21:return!!m.getWinTitle;case 22:return!!m.pushTitle;case 23:return!!m.popTitle;case 24:return!!m.setWinLines}return!1}var w;(function(I){I[I.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",I[I.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(w||(r.WindowsOptionsReportType=w={}));let x=0;class B extends g.Disposable{getAttrData(){return this._curAttrData}constructor(m,b,y,L,T,H,U,$,R=new v.EscapeSequenceParser){super(),this._bufferService=m,this._charsetService=b,this._coreService=y,this._logService=L,this._optionsService=T,this._oscLinkService=H,this._coreMouseService=U,this._unicodeService=$,this._parser=R,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new c.StringToUtf32,this._utf8Decoder=new c.Utf8ToUtf32,this._workCell=new t.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=i.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=i.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new s.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new s.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new s.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new s.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new s.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new s.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new s.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new s.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new s.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new s.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new s.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new s.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new s.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new P(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((C=>this._activeBuffer=C.activeBuffer))),this._parser.setCsiHandlerFallback(((C,O)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(C),params:O.toArray()})})),this._parser.setEscHandlerFallback((C=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(C)})})),this._parser.setExecuteHandlerFallback((C=>{this._logService.debug("Unknown EXECUTE code: ",{code:C})})),this._parser.setOscHandlerFallback(((C,O,A)=>{this._logService.debug("Unknown OSC code: ",{identifier:C,action:O,data:A})})),this._parser.setDcsHandlerFallback(((C,O,A)=>{O==="HOOK"&&(A=A.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(C),action:O,payload:A})})),this._parser.setPrintHandler(((C,O,A)=>this.print(C,O,A))),this._parser.registerCsiHandler({final:"@"},(C=>this.insertChars(C))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(C=>this.scrollLeft(C))),this._parser.registerCsiHandler({final:"A"},(C=>this.cursorUp(C))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(C=>this.scrollRight(C))),this._parser.registerCsiHandler({final:"B"},(C=>this.cursorDown(C))),this._parser.registerCsiHandler({final:"C"},(C=>this.cursorForward(C))),this._parser.registerCsiHandler({final:"D"},(C=>this.cursorBackward(C))),this._parser.registerCsiHandler({final:"E"},(C=>this.cursorNextLine(C))),this._parser.registerCsiHandler({final:"F"},(C=>this.cursorPrecedingLine(C))),this._parser.registerCsiHandler({final:"G"},(C=>this.cursorCharAbsolute(C))),this._parser.registerCsiHandler({final:"H"},(C=>this.cursorPosition(C))),this._parser.registerCsiHandler({final:"I"},(C=>this.cursorForwardTab(C))),this._parser.registerCsiHandler({final:"J"},(C=>this.eraseInDisplay(C,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(C=>this.eraseInDisplay(C,!0))),this._parser.registerCsiHandler({final:"K"},(C=>this.eraseInLine(C,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(C=>this.eraseInLine(C,!0))),this._parser.registerCsiHandler({final:"L"},(C=>this.insertLines(C))),this._parser.registerCsiHandler({final:"M"},(C=>this.deleteLines(C))),this._parser.registerCsiHandler({final:"P"},(C=>this.deleteChars(C))),this._parser.registerCsiHandler({final:"S"},(C=>this.scrollUp(C))),this._parser.registerCsiHandler({final:"T"},(C=>this.scrollDown(C))),this._parser.registerCsiHandler({final:"X"},(C=>this.eraseChars(C))),this._parser.registerCsiHandler({final:"Z"},(C=>this.cursorBackwardTab(C))),this._parser.registerCsiHandler({final:"`"},(C=>this.charPosAbsolute(C))),this._parser.registerCsiHandler({final:"a"},(C=>this.hPositionRelative(C))),this._parser.registerCsiHandler({final:"b"},(C=>this.repeatPrecedingCharacter(C))),this._parser.registerCsiHandler({final:"c"},(C=>this.sendDeviceAttributesPrimary(C))),this._parser.registerCsiHandler({prefix:">",final:"c"},(C=>this.sendDeviceAttributesSecondary(C))),this._parser.registerCsiHandler({final:"d"},(C=>this.linePosAbsolute(C))),this._parser.registerCsiHandler({final:"e"},(C=>this.vPositionRelative(C))),this._parser.registerCsiHandler({final:"f"},(C=>this.hVPosition(C))),this._parser.registerCsiHandler({final:"g"},(C=>this.tabClear(C))),this._parser.registerCsiHandler({final:"h"},(C=>this.setMode(C))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(C=>this.setModePrivate(C))),this._parser.registerCsiHandler({final:"l"},(C=>this.resetMode(C))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(C=>this.resetModePrivate(C))),this._parser.registerCsiHandler({final:"m"},(C=>this.charAttributes(C))),this._parser.registerCsiHandler({final:"n"},(C=>this.deviceStatus(C))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(C=>this.deviceStatusPrivate(C))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(C=>this.softReset(C))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(C=>this.setCursorStyle(C))),this._parser.registerCsiHandler({final:"r"},(C=>this.setScrollRegion(C))),this._parser.registerCsiHandler({final:"s"},(C=>this.saveCursor(C))),this._parser.registerCsiHandler({final:"t"},(C=>this.windowOptions(C))),this._parser.registerCsiHandler({final:"u"},(C=>this.restoreCursor(C))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(C=>this.insertColumns(C))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(C=>this.deleteColumns(C))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(C=>this.selectProtected(C))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(C=>this.requestMode(C,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(C=>this.requestMode(C,!1))),this._parser.setExecuteHandler(o.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(o.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(o.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(o.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(o.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(o.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(o.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(o.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(o.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new p.OscHandler((C=>(this.setTitle(C),this.setIconName(C),!0)))),this._parser.registerOscHandler(1,new p.OscHandler((C=>this.setIconName(C)))),this._parser.registerOscHandler(2,new p.OscHandler((C=>this.setTitle(C)))),this._parser.registerOscHandler(4,new p.OscHandler((C=>this.setOrReportIndexedColor(C)))),this._parser.registerOscHandler(8,new p.OscHandler((C=>this.setHyperlink(C)))),this._parser.registerOscHandler(10,new p.OscHandler((C=>this.setOrReportFgColor(C)))),this._parser.registerOscHandler(11,new p.OscHandler((C=>this.setOrReportBgColor(C)))),this._parser.registerOscHandler(12,new p.OscHandler((C=>this.setOrReportCursorColor(C)))),this._parser.registerOscHandler(104,new p.OscHandler((C=>this.restoreIndexedColor(C)))),this._parser.registerOscHandler(110,new p.OscHandler((C=>this.restoreFgColor(C)))),this._parser.registerOscHandler(111,new p.OscHandler((C=>this.restoreBgColor(C)))),this._parser.registerOscHandler(112,new p.OscHandler((C=>this.restoreCursorColor(C)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const C in d.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:C},(()=>this.selectCharset("("+C))),this._parser.registerEscHandler({intermediates:")",final:C},(()=>this.selectCharset(")"+C))),this._parser.registerEscHandler({intermediates:"*",final:C},(()=>this.selectCharset("*"+C))),this._parser.registerEscHandler({intermediates:"+",final:C},(()=>this.selectCharset("+"+C))),this._parser.registerEscHandler({intermediates:"-",final:C},(()=>this.selectCharset("-"+C))),this._parser.registerEscHandler({intermediates:".",final:C},(()=>this.selectCharset("."+C))),this._parser.registerEscHandler({intermediates:"/",final:C},(()=>this.selectCharset("/"+C)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((C=>(this._logService.error("Parsing error: ",C),C))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new h.DcsHandler(((C,O)=>this.requestStatusString(C,O))))}_preserveStack(m,b,y,L){this._parseStack.paused=!0,this._parseStack.cursorStartX=m,this._parseStack.cursorStartY=b,this._parseStack.decodedLength=y,this._parseStack.position=L}_logSlowResolvingAsync(m){this._logService.logLevel<=u.LogLevelEnum.WARN&&Promise.race([m,new Promise(((b,y)=>setTimeout((()=>y("#SLOW_TIMEOUT")),5e3)))]).catch((b=>{if(b!=="#SLOW_TIMEOUT")throw b;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(m,b){let y,L=this._activeBuffer.x,T=this._activeBuffer.y,H=0;const U=this._parseStack.paused;if(U){if(y=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,b))return this._logSlowResolvingAsync(y),y;L=this._parseStack.cursorStartX,T=this._parseStack.cursorStartY,this._parseStack.paused=!1,m.length>k&&(H=this._parseStack.position+k)}if(this._logService.logLevel<=u.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof m=="string"?` "${m}"`:` "${Array.prototype.map.call(m,(C=>String.fromCharCode(C))).join("")}"`),typeof m=="string"?m.split("").map((C=>C.charCodeAt(0))):m),this._parseBuffer.length<m.length&&this._parseBuffer.length<k&&(this._parseBuffer=new Uint32Array(Math.min(m.length,k))),U||this._dirtyRowTracker.clearRange(),m.length>k)for(let C=H;C<m.length;C+=k){const O=C+k<m.length?C+k:m.length,A=typeof m=="string"?this._stringDecoder.decode(m.substring(C,O),this._parseBuffer):this._utf8Decoder.decode(m.subarray(C,O),this._parseBuffer);if(y=this._parser.parse(this._parseBuffer,A))return this._preserveStack(L,T,A,C),this._logSlowResolvingAsync(y),y}else if(!U){const C=typeof m=="string"?this._stringDecoder.decode(m,this._parseBuffer):this._utf8Decoder.decode(m,this._parseBuffer);if(y=this._parser.parse(this._parseBuffer,C))return this._preserveStack(L,T,C,0),this._logSlowResolvingAsync(y),y}this._activeBuffer.x===L&&this._activeBuffer.y===T||this._onCursorMove.fire();const $=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),R=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);R<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(R,this._bufferService.rows-1),Math.min($,this._bufferService.rows-1))}print(m,b,y){let L,T;const H=this._charsetService.charset,U=this._optionsService.rawOptions.screenReaderMode,$=this._bufferService.cols,R=this._coreService.decPrivateModes.wraparound,C=this._coreService.modes.insertMode,O=this._curAttrData;let A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&y-b>0&&A.getWidth(this._activeBuffer.x-1)===2&&A.setCellFromCodepoint(this._activeBuffer.x-1,0,1,O);let N=this._parser.precedingJoinState;for(let W=b;W<y;++W){if(L=m[W],L<127&&H){const Y=H[String.fromCharCode(L)];Y&&(L=Y.charCodeAt(0))}const z=this._unicodeService.charProperties(L,N);T=_.UnicodeService.extractWidth(z);const V=_.UnicodeService.extractShouldJoin(z),G=V?_.UnicodeService.extractWidth(N):0;if(N=z,U&&this._onA11yChar.fire((0,c.stringFromCodePoint)(L)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+T-G>$){if(R){const Y=A;let j=this._activeBuffer.x-G;for(this._activeBuffer.x=G,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),G>0&&A instanceof i.BufferLine&&A.copyCellsFrom(Y,j,0,G,!1);j<$;)Y.setCellFromCodepoint(j++,0,1,O)}else if(this._activeBuffer.x=$-1,T===2)continue}if(V&&this._activeBuffer.x){const Y=A.getWidth(this._activeBuffer.x-1)?1:2;A.addCodepointToCell(this._activeBuffer.x-Y,L,T);for(let j=T-G;--j>=0;)A.setCellFromCodepoint(this._activeBuffer.x++,0,0,O)}else if(C&&(A.insertCells(this._activeBuffer.x,T-G,this._activeBuffer.getNullCell(O)),A.getWidth($-1)===2&&A.setCellFromCodepoint($-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,O)),A.setCellFromCodepoint(this._activeBuffer.x++,L,T,O),T>0)for(;--T;)A.setCellFromCodepoint(this._activeBuffer.x++,0,0,O)}this._parser.precedingJoinState=N,this._activeBuffer.x<$&&y-b>0&&A.getWidth(this._activeBuffer.x)===0&&!A.hasContent(this._activeBuffer.x)&&A.setCellFromCodepoint(this._activeBuffer.x,0,1,O),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(m,b){return m.final!=="t"||m.prefix||m.intermediates?this._parser.registerCsiHandler(m,b):this._parser.registerCsiHandler(m,(y=>!D(y.params[0],this._optionsService.rawOptions.windowOptions)||b(y)))}registerDcsHandler(m,b){return this._parser.registerDcsHandler(m,new h.DcsHandler(b))}registerEscHandler(m,b){return this._parser.registerEscHandler(m,b)}registerOscHandler(m,b){return this._parser.registerOscHandler(m,new p.OscHandler(b))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var m;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&m.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);b.hasWidth(this._activeBuffer.x)&&!b.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const m=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-m),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(m=this._bufferService.cols-1){this._activeBuffer.x=Math.min(m,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(m,b){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=m,this._activeBuffer.y=this._activeBuffer.scrollTop+b):(this._activeBuffer.x=m,this._activeBuffer.y=b),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(m,b){this._restrictCursor(),this._setCursor(this._activeBuffer.x+m,this._activeBuffer.y+b)}cursorUp(m){const b=this._activeBuffer.y-this._activeBuffer.scrollTop;return b>=0?this._moveCursor(0,-Math.min(b,m.params[0]||1)):this._moveCursor(0,-(m.params[0]||1)),!0}cursorDown(m){const b=this._activeBuffer.scrollBottom-this._activeBuffer.y;return b>=0?this._moveCursor(0,Math.min(b,m.params[0]||1)):this._moveCursor(0,m.params[0]||1),!0}cursorForward(m){return this._moveCursor(m.params[0]||1,0),!0}cursorBackward(m){return this._moveCursor(-(m.params[0]||1),0),!0}cursorNextLine(m){return this.cursorDown(m),this._activeBuffer.x=0,!0}cursorPrecedingLine(m){return this.cursorUp(m),this._activeBuffer.x=0,!0}cursorCharAbsolute(m){return this._setCursor((m.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(m){return this._setCursor(m.length>=2?(m.params[1]||1)-1:0,(m.params[0]||1)-1),!0}charPosAbsolute(m){return this._setCursor((m.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(m){return this._moveCursor(m.params[0]||1,0),!0}linePosAbsolute(m){return this._setCursor(this._activeBuffer.x,(m.params[0]||1)-1),!0}vPositionRelative(m){return this._moveCursor(0,m.params[0]||1),!0}hVPosition(m){return this.cursorPosition(m),!0}tabClear(m){const b=m.params[0];return b===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:b===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(m){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=m.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(m){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=m.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(m){const b=m.params[0];return b===1&&(this._curAttrData.bg|=536870912),b!==2&&b!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(m,b,y,L=!1,T=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+m);H.replaceCells(b,y,this._activeBuffer.getNullCell(this._eraseAttrData()),T),L&&(H.isWrapped=!1)}_resetBufferLine(m,b=!1){const y=this._activeBuffer.lines.get(this._activeBuffer.ybase+m);y&&(y.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),b),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+m),y.isWrapped=!1)}eraseInDisplay(m,b=!1){let y;switch(this._restrictCursor(this._bufferService.cols),m.params[0]){case 0:for(y=this._activeBuffer.y,this._dirtyRowTracker.markDirty(y),this._eraseInBufferLine(y++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);y<this._bufferService.rows;y++)this._resetBufferLine(y,b);this._dirtyRowTracker.markDirty(y);break;case 1:for(y=this._activeBuffer.y,this._dirtyRowTracker.markDirty(y),this._eraseInBufferLine(y,0,this._activeBuffer.x+1,!0,b),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(y+1).isWrapped=!1);y--;)this._resetBufferLine(y,b);this._dirtyRowTracker.markDirty(0);break;case 2:for(y=this._bufferService.rows,this._dirtyRowTracker.markDirty(y-1);y--;)this._resetBufferLine(y,b);this._dirtyRowTracker.markDirty(0);break;case 3:const L=this._activeBuffer.lines.length-this._bufferService.rows;L>0&&(this._activeBuffer.lines.trimStart(L),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-L,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-L,0),this._onScroll.fire(0))}return!0}eraseInLine(m,b=!1){switch(this._restrictCursor(this._bufferService.cols),m.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,b);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,b)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(m){this._restrictCursor();let b=m.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const y=this._activeBuffer.ybase+this._activeBuffer.y,L=this._bufferService.rows-1-this._activeBuffer.scrollBottom,T=this._bufferService.rows-1+this._activeBuffer.ybase-L+1;for(;b--;)this._activeBuffer.lines.splice(T-1,1),this._activeBuffer.lines.splice(y,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(m){this._restrictCursor();let b=m.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const y=this._activeBuffer.ybase+this._activeBuffer.y;let L;for(L=this._bufferService.rows-1-this._activeBuffer.scrollBottom,L=this._bufferService.rows-1+this._activeBuffer.ybase-L;b--;)this._activeBuffer.lines.splice(y,1),this._activeBuffer.lines.splice(L,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(m){this._restrictCursor();const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return b&&(b.insertCells(this._activeBuffer.x,m.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(m){this._restrictCursor();const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return b&&(b.deleteCells(this._activeBuffer.x,m.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(m){let b=m.params[0]||1;for(;b--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(m){let b=m.params[0]||1;for(;b--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(i.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(m){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=m.params[0]||1;for(let y=this._activeBuffer.scrollTop;y<=this._activeBuffer.scrollBottom;++y){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);L.deleteCells(0,b,this._activeBuffer.getNullCell(this._eraseAttrData())),L.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(m){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=m.params[0]||1;for(let y=this._activeBuffer.scrollTop;y<=this._activeBuffer.scrollBottom;++y){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);L.insertCells(0,b,this._activeBuffer.getNullCell(this._eraseAttrData())),L.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(m){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=m.params[0]||1;for(let y=this._activeBuffer.scrollTop;y<=this._activeBuffer.scrollBottom;++y){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);L.insertCells(this._activeBuffer.x,b,this._activeBuffer.getNullCell(this._eraseAttrData())),L.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(m){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=m.params[0]||1;for(let y=this._activeBuffer.scrollTop;y<=this._activeBuffer.scrollBottom;++y){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);L.deleteCells(this._activeBuffer.x,b,this._activeBuffer.getNullCell(this._eraseAttrData())),L.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(m){this._restrictCursor();const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return b&&(b.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(m.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(m){const b=this._parser.precedingJoinState;if(!b)return!0;const y=m.params[0]||1,L=_.UnicodeService.extractWidth(b),T=this._activeBuffer.x-L,H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(T),U=new Uint32Array(H.length*y);let $=0;for(let C=0;C<H.length;){const O=H.codePointAt(C)||0;U[$++]=O,C+=O>65535?2:1}let R=$;for(let C=1;C<y;++C)U.copyWithin(R,0,$),R+=$;return this.print(U,0,R),!0}sendDeviceAttributesPrimary(m){return m.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(o.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(o.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(m){return m.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(o.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(o.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(m.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(o.C0.ESC+"[>83;40003;0c")),!0}_is(m){return(this._optionsService.rawOptions.termName+"").indexOf(m)===0}setMode(m){for(let b=0;b<m.length;b++)switch(m.params[b]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(m){for(let b=0;b<m.length;b++)switch(m.params[b]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),this._charsetService.setgCharset(1,d.DEFAULT_CHARSET),this._charsetService.setgCharset(2,d.DEFAULT_CHARSET),this._charsetService.setgCharset(3,d.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(m){for(let b=0;b<m.length;b++)switch(m.params[b]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(m){for(let b=0;b<m.length;b++)switch(m.params[b]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),m.params[b]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(m,b){const y=this._coreService.decPrivateModes,{activeProtocol:L,activeEncoding:T}=this._coreMouseService,H=this._coreService,{buffers:U,cols:$}=this._bufferService,{active:R,alt:C}=U,O=this._optionsService.rawOptions,A=V=>V?1:2,N=m.params[0];return W=N,z=b?N===2?4:N===4?A(H.modes.insertMode):N===12?3:N===20?A(O.convertEol):0:N===1?A(y.applicationCursorKeys):N===3?O.windowOptions.setWinLines?$===80?2:$===132?1:0:0:N===6?A(y.origin):N===7?A(y.wraparound):N===8?3:N===9?A(L==="X10"):N===12?A(O.cursorBlink):N===25?A(!H.isCursorHidden):N===45?A(y.reverseWraparound):N===66?A(y.applicationKeypad):N===67?4:N===1e3?A(L==="VT200"):N===1002?A(L==="DRAG"):N===1003?A(L==="ANY"):N===1004?A(y.sendFocus):N===1005?4:N===1006?A(T==="SGR"):N===1015?4:N===1016?A(T==="SGR_PIXELS"):N===1048?1:N===47||N===1047||N===1049?A(R===C):N===2004?A(y.bracketedPasteMode):0,H.triggerDataEvent(`${o.C0.ESC}[${b?"":"?"}${W};${z}$y`),!0;var W,z}_updateAttrColor(m,b,y,L,T){return b===2?(m|=50331648,m&=-16777216,m|=n.AttributeData.fromColorRGB([y,L,T])):b===5&&(m&=-50331904,m|=33554432|255&y),m}_extractColor(m,b,y){const L=[0,0,-1,0,0,0];let T=0,H=0;do{if(L[H+T]=m.params[b+H],m.hasSubParams(b+H)){const U=m.getSubParams(b+H);let $=0;do L[1]===5&&(T=1),L[H+$+1+T]=U[$];while(++$<U.length&&$+H+1+T<L.length);break}if(L[1]===5&&H+T>=2||L[1]===2&&H+T>=5)break;L[1]&&(T=1)}while(++H+b<m.length&&H+T<L.length);for(let U=2;U<L.length;++U)L[U]===-1&&(L[U]=0);switch(L[0]){case 38:y.fg=this._updateAttrColor(y.fg,L[1],L[3],L[4],L[5]);break;case 48:y.bg=this._updateAttrColor(y.bg,L[1],L[3],L[4],L[5]);break;case 58:y.extended=y.extended.clone(),y.extended.underlineColor=this._updateAttrColor(y.extended.underlineColor,L[1],L[3],L[4],L[5])}return H}_processUnderline(m,b){b.extended=b.extended.clone(),(!~m||m>5)&&(m=1),b.extended.underlineStyle=m,b.fg|=268435456,m===0&&(b.fg&=-268435457),b.updateExtended()}_processSGR0(m){m.fg=i.DEFAULT_ATTR_DATA.fg,m.bg=i.DEFAULT_ATTR_DATA.bg,m.extended=m.extended.clone(),m.extended.underlineStyle=0,m.extended.underlineColor&=-67108864,m.updateExtended()}charAttributes(m){if(m.length===1&&m.params[0]===0)return this._processSGR0(this._curAttrData),!0;const b=m.length;let y;const L=this._curAttrData;for(let T=0;T<b;T++)y=m.params[T],y>=30&&y<=37?(L.fg&=-50331904,L.fg|=16777216|y-30):y>=40&&y<=47?(L.bg&=-50331904,L.bg|=16777216|y-40):y>=90&&y<=97?(L.fg&=-50331904,L.fg|=16777224|y-90):y>=100&&y<=107?(L.bg&=-50331904,L.bg|=16777224|y-100):y===0?this._processSGR0(L):y===1?L.fg|=134217728:y===3?L.bg|=67108864:y===4?(L.fg|=268435456,this._processUnderline(m.hasSubParams(T)?m.getSubParams(T)[0]:1,L)):y===5?L.fg|=536870912:y===7?L.fg|=67108864:y===8?L.fg|=1073741824:y===9?L.fg|=2147483648:y===2?L.bg|=134217728:y===21?this._processUnderline(2,L):y===22?(L.fg&=-134217729,L.bg&=-134217729):y===23?L.bg&=-67108865:y===24?(L.fg&=-268435457,this._processUnderline(0,L)):y===25?L.fg&=-536870913:y===27?L.fg&=-67108865:y===28?L.fg&=-1073741825:y===29?L.fg&=2147483647:y===39?(L.fg&=-67108864,L.fg|=16777215&i.DEFAULT_ATTR_DATA.fg):y===49?(L.bg&=-67108864,L.bg|=16777215&i.DEFAULT_ATTR_DATA.bg):y===38||y===48||y===58?T+=this._extractColor(m,T,L):y===53?L.bg|=1073741824:y===55?L.bg&=-1073741825:y===59?(L.extended=L.extended.clone(),L.extended.underlineColor=-1,L.updateExtended()):y===100?(L.fg&=-67108864,L.fg|=16777215&i.DEFAULT_ATTR_DATA.fg,L.bg&=-67108864,L.bg|=16777215&i.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",y);return!0}deviceStatus(m){switch(m.params[0]){case 5:this._coreService.triggerDataEvent(`${o.C0.ESC}[0n`);break;case 6:const b=this._activeBuffer.y+1,y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[${b};${y}R`)}return!0}deviceStatusPrivate(m){if(m.params[0]===6){const b=this._activeBuffer.y+1,y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[?${b};${y}R`)}return!0}softReset(m){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=i.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(m){const b=m.params[0]||1;switch(b){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const y=b%2==1;return this._optionsService.options.cursorBlink=y,!0}setScrollRegion(m){const b=m.params[0]||1;let y;return(m.length<2||(y=m.params[1])>this._bufferService.rows||y===0)&&(y=this._bufferService.rows),y>b&&(this._activeBuffer.scrollTop=b-1,this._activeBuffer.scrollBottom=y-1,this._setCursor(0,0)),!0}windowOptions(m){if(!D(m.params[0],this._optionsService.rawOptions.windowOptions))return!0;const b=m.length>1?m.params[1]:0;switch(m.params[0]){case 14:b!==2&&this._onRequestWindowsOptionsReport.fire(w.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(w.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${o.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:b!==0&&b!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),b!==0&&b!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:b!==0&&b!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),b!==0&&b!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(m){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(m){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(m){return this._windowTitle=m,this._onTitleChange.fire(m),!0}setIconName(m){return this._iconName=m,!0}setOrReportIndexedColor(m){const b=[],y=m.split(";");for(;y.length>1;){const L=y.shift(),T=y.shift();if(/^\d+$/.exec(L)){const H=parseInt(L);if(F(H))if(T==="?")b.push({type:0,index:H});else{const U=(0,S.parseColor)(T);U&&b.push({type:1,index:H,color:U})}}}return b.length&&this._onColor.fire(b),!0}setHyperlink(m){const b=m.split(";");return!(b.length<2)&&(b[1]?this._createHyperlink(b[0],b[1]):!b[0]&&this._finishHyperlink())}_createHyperlink(m,b){this._getCurrentLinkId()&&this._finishHyperlink();const y=m.split(":");let L;const T=y.findIndex((H=>H.startsWith("id=")));return T!==-1&&(L=y[T].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:L,uri:b}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(m,b){const y=m.split(";");for(let L=0;L<y.length&&!(b>=this._specialColors.length);++L,++b)if(y[L]==="?")this._onColor.fire([{type:0,index:this._specialColors[b]}]);else{const T=(0,S.parseColor)(y[L]);T&&this._onColor.fire([{type:1,index:this._specialColors[b],color:T}])}return!0}setOrReportFgColor(m){return this._setOrReportSpecialColor(m,0)}setOrReportBgColor(m){return this._setOrReportSpecialColor(m,1)}setOrReportCursorColor(m){return this._setOrReportSpecialColor(m,2)}restoreIndexedColor(m){if(!m)return this._onColor.fire([{type:2}]),!0;const b=[],y=m.split(";");for(let L=0;L<y.length;++L)if(/^\d+$/.exec(y[L])){const T=parseInt(y[L]);F(T)&&b.push({type:2,index:T})}return b.length&&this._onColor.fire(b),!0}restoreFgColor(m){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(m){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(m){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),!0}selectCharset(m){return m.length!==2?(this.selectDefaultCharset(),!0):(m[0]==="/"||this._charsetService.setgCharset(E[m[0]],d.CHARSETS[m[1]]||d.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const m=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,m,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=i.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=i.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(m){return this._charsetService.setgLevel(m),!0}screenAlignmentPattern(){const m=new t.CellData;m.content=4194373,m.fg=this._curAttrData.fg,m.bg=this._curAttrData.bg,this._setCursor(0,0);for(let b=0;b<this._bufferService.rows;++b){const y=this._activeBuffer.ybase+this._activeBuffer.y+b,L=this._activeBuffer.lines.get(y);L&&(L.fill(m),L.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(m,b){const y=this._bufferService.buffer,L=this._optionsService.rawOptions;return(T=>(this._coreService.triggerDataEvent(`${o.C0.ESC}${T}${o.C0.ESC}\\`),!0))(m==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:m==='"p'?'P1$r61;1"p':m==="r"?`P1$r${y.scrollTop+1};${y.scrollBottom+1}r`:m==="m"?"P1$r0m":m===" q"?`P1$r${{block:2,underline:4,bar:6}[L.cursorStyle]-(L.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(m,b){this._dirtyRowTracker.markRangeDirty(m,b)}}r.InputHandler=B;let P=class{constructor(I){this._bufferService=I,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(I){I<this.start?this.start=I:I>this.end&&(this.end=I)}markRangeDirty(I,m){I>m&&(x=I,I=m,m=x),I<this.start&&(this.start=I),m>this.end&&(this.end=m)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function F(I){return 0<=I&&I<256}P=l([f(0,u.IBufferService)],P)},844:(M,r)=>{function a(l){for(const f of l)f.dispose();l.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const f=this._disposables.indexOf(l);f!==-1&&this._disposables.splice(f,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var f;this._isDisposed||l===this._value||((f=this._value)==null||f.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)==null||l.dispose(),this._value=void 0}},r.toDisposable=function(l){return{dispose:l}},r.disposeArray=a,r.getDisposeArrayDisposable=function(l){return{dispose:()=>a(l)}}},1505:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(f,o,d){this._data[f]||(this._data[f]={}),this._data[f][o]=d}get(f,o){return this._data[f]?this._data[f][o]:void 0}clear(){this._data={}}}r.TwoKeyMap=a,r.FourKeyMap=class{constructor(){this._data=new a}set(l,f,o,d,v){this._data.get(l,f)||this._data.set(l,f,new a),this._data.get(l,f).set(o,d,v)}get(l,f,o,d){var v;return(v=this._data.get(l,f))==null?void 0:v.get(o,d)}clear(){this._data.clear()}}},6114:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof process<"u"&&"title"in process;const a=r.isNode?"node":navigator.userAgent,l=r.isNode?"node":navigator.platform;r.isFirefox=a.includes("Firefox"),r.isLegacyEdge=a.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(a),r.getSafariVersion=function(){if(!r.isSafari)return 0;const f=a.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),r.isIpad=l==="iPad",r.isIphone=l==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),r.isLinux=l.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(a)},6106:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let a=0;r.SortedList=class{constructor(l){this._getKey=l,this._array=[]}clear(){this._array.length=0}insert(l){this._array.length!==0?(a=this._search(this._getKey(l)),this._array.splice(a,0,l)):this._array.push(l)}delete(l){if(this._array.length===0)return!1;const f=this._getKey(l);if(f===void 0||(a=this._search(f),a===-1)||this._getKey(this._array[a])!==f)return!1;do if(this._array[a]===l)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===f);return!1}*getKeyIterator(l){if(this._array.length!==0&&(a=this._search(l),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===l))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===l)}forEachByKey(l,f){if(this._array.length!==0&&(a=this._search(l),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===l))do f(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===l)}values(){return[...this._array].values()}_search(l){let f=0,o=this._array.length-1;for(;o>=f;){let d=f+o>>1;const v=this._getKey(this._array[d]);if(v>l)o=d-1;else{if(!(v<l)){for(;d>0&&this._getKey(this._array[d-1])===l;)d--;return d}f=d+1}}return f}}},7226:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const l=a(6114);class f{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(v){this._idleCallback=void 0;let g=0,c=0,i=v.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(g=Date.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,Date.now()-g),c=Math.max(g,c),s=v.timeRemaining(),1.5*c>s)return i-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(i-g))}ms`),void this._start();i=s}this.clear()}}class o extends f{_requestCallback(v){return setTimeout((()=>v(this._createDeadline(16))))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const g=Date.now()+v;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}r.PriorityTaskQueue=o,r.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(d){return requestIdleCallback(d)}_cancelCallback(d){cancelIdleCallback(d)}}:o,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(d){this._queue.clear(),this._queue.enqueue(d)}flush(){this._queue.flush()}}},9282:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const l=a(643);r.updateWindowsModeWrappedState=function(f){const o=f.buffer.lines.get(f.buffer.ybase+f.buffer.y-1),d=o==null?void 0:o.get(f.cols-1),v=f.buffer.lines.get(f.buffer.ybase+f.buffer.y);v&&d&&(v.isWrapped=d[l.CHAR_DATA_CODE_INDEX]!==l.NULL_CELL_CODE&&d[l.CHAR_DATA_CODE_INDEX]!==l.WHITESPACE_CELL_CODE)}},3734:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(o){return[o>>>16&255,o>>>8&255,255&o]}static fromColorRGB(o){return(255&o[0])<<16|(255&o[1])<<8|255&o[2]}clone(){const o=new a;return o.fg=this.fg,o.bg=this.bg,o.extended=this.extended.clone(),o}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}r.AttributeData=a;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(o){this._ext=o}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(o){this._ext&=-469762049,this._ext|=o<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(o){this._ext&=-67108864,this._ext|=67108863&o}get urlId(){return this._urlId}set urlId(o){this._urlId=o}get underlineVariantOffset(){const o=(3758096384&this._ext)>>29;return o<0?4294967288^o:o}set underlineVariantOffset(o){this._ext&=536870911,this._ext|=o<<29&3758096384}constructor(o=0,d=0){this._ext=0,this._urlId=0,this._ext=o,this._urlId=d}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=l},9092:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const l=a(6349),f=a(7226),o=a(3734),d=a(8437),v=a(4634),g=a(511),c=a(643),i=a(4863),s=a(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=d.DEFAULT_ATTR_DATA.clone(),this.savedCharset=s.DEFAULT_CHARSET,this.markers=[],this._nullCell=g.CellData.fromCharData([0,c.NULL_CELL_CHAR,c.NULL_CELL_WIDTH,c.NULL_CELL_CODE]),this._whitespaceCell=g.CellData.fromCharData([0,c.WHITESPACE_CELL_CHAR,c.WHITESPACE_CELL_WIDTH,c.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new f.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new o.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new o.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new d.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;const t=e+this._optionsService.rawOptions.scrollback;return t>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=d.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){const n=this.getNullCell(d.DEFAULT_ATTR_DATA);let u=0;const _=this._getCorrectBufferLength(t);if(_>this.lines.maxLength&&(this.lines.maxLength=_),this.lines.length>0){if(this._cols<e)for(let h=0;h<this.lines.length;h++)u+=+this.lines.get(h).resize(e,n);let p=0;if(this._rows<t)for(let h=this._rows;h<t;h++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new d.BufferLine(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+p+1?(this.ybase--,p++,this.ydisp>0&&this.ydisp--):this.lines.push(new d.BufferLine(e,n)));else for(let h=this._rows;h>t;h--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(_<this.lines.maxLength){const h=this.lines.length-_;h>0&&(this.lines.trimStart(h),this.ybase=Math.max(this.ybase-h,0),this.ydisp=Math.max(this.ydisp-h,0),this.savedY=Math.max(this.savedY-h,0)),this.lines.maxLength=_}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),p&&(this.y+=p),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let p=0;p<this.lines.length;p++)u+=+this.lines.get(p).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),u>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){const e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){const n=(0,v.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(d.DEFAULT_ATTR_DATA));if(n.length>0){const u=(0,v.reflowLargerCreateNewLayout)(this.lines,n);(0,v.reflowLargerApplyNewLayout)(this.lines,u.layout),this._reflowLargerAdjustViewport(e,t,u.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){const u=this.getNullCell(d.DEFAULT_ATTR_DATA);let _=n;for(;_-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new d.BufferLine(e,u))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){const n=this.getNullCell(d.DEFAULT_ATTR_DATA),u=[];let _=0;for(let p=this.lines.length-1;p>=0;p--){let h=this.lines.get(p);if(!h||!h.isWrapped&&h.getTrimmedLength()<=e)continue;const S=[h];for(;h.isWrapped&&p>0;)h=this.lines.get(--p),S.unshift(h);const E=this.ybase+this.y;if(E>=p&&E<p+S.length)continue;const k=S[S.length-1].getTrimmedLength(),D=(0,v.reflowSmallerGetNewLineLengths)(S,this._cols,e),w=D.length-S.length;let x;x=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+w):Math.max(0,this.lines.length-this.lines.maxLength+w);const B=[];for(let y=0;y<w;y++){const L=this.getBlankLine(d.DEFAULT_ATTR_DATA,!0);B.push(L)}B.length>0&&(u.push({start:p+S.length+_,newLines:B}),_+=B.length),S.push(...B);let P=D.length-1,F=D[P];F===0&&(P--,F=D[P]);let I=S.length-w-1,m=k;for(;I>=0;){const y=Math.min(m,F);if(S[P]===void 0)break;if(S[P].copyCellsFrom(S[I],m-y,F-y,y,!0),F-=y,F===0&&(P--,F=D[P]),m-=y,m===0){I--;const L=Math.max(I,0);m=(0,v.getWrappedLineTrimmedLength)(S,L,this._cols)}}for(let y=0;y<S.length;y++)D[y]<e&&S[y].setCell(D[y],n);let b=w-x;for(;b-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+_)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+w,this.ybase+t-1)}if(u.length>0){const p=[],h=[];for(let P=0;P<this.lines.length;P++)h.push(this.lines.get(P));const S=this.lines.length;let E=S-1,k=0,D=u[k];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+_);let w=0;for(let P=Math.min(this.lines.maxLength-1,S+_-1);P>=0;P--)if(D&&D.start>E+w){for(let F=D.newLines.length-1;F>=0;F--)this.lines.set(P--,D.newLines[F]);P++,p.push({index:E+1,amount:D.newLines.length}),w+=D.newLines.length,D=u[++k]}else this.lines.set(P,h[E--]);let x=0;for(let P=p.length-1;P>=0;P--)p[P].index+=x,this.lines.onInsertEmitter.fire(p[P]),x+=p[P].amount;const B=Math.max(0,S+_-this.lines.maxLength);B>0&&this.lines.onTrimEmitter.fire(B)}}translateBufferLineToString(e,t,n=0,u){const _=this.lines.get(e);return _?_.translateToString(t,n,u):""}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){const t=new i.Marker(e);return this.markers.push(t),t.register(this.lines.onTrim((n=>{t.line-=n,t.line<0&&t.dispose()}))),t.register(this.lines.onInsert((n=>{t.line>=n.index&&(t.line+=n.amount)}))),t.register(this.lines.onDelete((n=>{t.line>=n.index&&t.line<n.index+n.amount&&t.dispose(),t.line>n.index&&(t.line-=n.amount)}))),t.register(t.onDispose((()=>this._removeMarker(t)))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const l=a(3734),f=a(511),o=a(643),d=a(482);r.DEFAULT_ATTR_DATA=Object.freeze(new l.AttributeData);let v=0;class g{constructor(i,s,e=!1){this.isWrapped=e,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*i);const t=s||f.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]);for(let n=0;n<i;++n)this.setCell(n,t);this.length=i}get(i){const s=this._data[3*i+0],e=2097151&s;return[this._data[3*i+1],2097152&s?this._combined[i]:e?(0,d.stringFromCodePoint)(e):"",s>>22,2097152&s?this._combined[i].charCodeAt(this._combined[i].length-1):e]}set(i,s){this._data[3*i+1]=s[o.CHAR_DATA_ATTR_INDEX],s[o.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[i]=s[1],this._data[3*i+0]=2097152|i|s[o.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*i+0]=s[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|s[o.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(i){return this._data[3*i+0]>>22}hasWidth(i){return 12582912&this._data[3*i+0]}getFg(i){return this._data[3*i+1]}getBg(i){return this._data[3*i+2]}hasContent(i){return 4194303&this._data[3*i+0]}getCodePoint(i){const s=this._data[3*i+0];return 2097152&s?this._combined[i].charCodeAt(this._combined[i].length-1):2097151&s}isCombined(i){return 2097152&this._data[3*i+0]}getString(i){const s=this._data[3*i+0];return 2097152&s?this._combined[i]:2097151&s?(0,d.stringFromCodePoint)(2097151&s):""}isProtected(i){return 536870912&this._data[3*i+2]}loadCell(i,s){return v=3*i,s.content=this._data[v+0],s.fg=this._data[v+1],s.bg=this._data[v+2],2097152&s.content&&(s.combinedData=this._combined[i]),268435456&s.bg&&(s.extended=this._extendedAttrs[i]),s}setCell(i,s){2097152&s.content&&(this._combined[i]=s.combinedData),268435456&s.bg&&(this._extendedAttrs[i]=s.extended),this._data[3*i+0]=s.content,this._data[3*i+1]=s.fg,this._data[3*i+2]=s.bg}setCellFromCodepoint(i,s,e,t){268435456&t.bg&&(this._extendedAttrs[i]=t.extended),this._data[3*i+0]=s|e<<22,this._data[3*i+1]=t.fg,this._data[3*i+2]=t.bg}addCodepointToCell(i,s,e){let t=this._data[3*i+0];2097152&t?this._combined[i]+=(0,d.stringFromCodePoint)(s):2097151&t?(this._combined[i]=(0,d.stringFromCodePoint)(2097151&t)+(0,d.stringFromCodePoint)(s),t&=-2097152,t|=2097152):t=s|4194304,e&&(t&=-12582913,t|=e<<22),this._data[3*i+0]=t}insertCells(i,s,e){if((i%=this.length)&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,e),s<this.length-i){const t=new f.CellData;for(let n=this.length-i-s-1;n>=0;--n)this.setCell(i+s+n,this.loadCell(i+n,t));for(let n=0;n<s;++n)this.setCell(i+n,e)}else for(let t=i;t<this.length;++t)this.setCell(t,e);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,e)}deleteCells(i,s,e){if(i%=this.length,s<this.length-i){const t=new f.CellData;for(let n=0;n<this.length-i-s;++n)this.setCell(i+n,this.loadCell(i+s+n,t));for(let n=this.length-s;n<this.length;++n)this.setCell(n,e)}else for(let t=i;t<this.length;++t)this.setCell(t,e);i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,e),this.getWidth(i)!==0||this.hasContent(i)||this.setCellFromCodepoint(i,0,1,e)}replaceCells(i,s,e,t=!1){if(t)for(i&&this.getWidth(i-1)===2&&!this.isProtected(i-1)&&this.setCellFromCodepoint(i-1,0,1,e),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodepoint(s,0,1,e);i<s&&i<this.length;)this.isProtected(i)||this.setCell(i,e),i++;else for(i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,e),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s,0,1,e);i<s&&i<this.length;)this.setCell(i++,e)}resize(i,s){if(i===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const e=3*i;if(i>this.length){if(this._data.buffer.byteLength>=4*e)this._data=new Uint32Array(this._data.buffer,0,e);else{const t=new Uint32Array(e);t.set(this._data),this._data=t}for(let t=this.length;t<i;++t)this.setCell(t,s)}else{this._data=this._data.subarray(0,e);const t=Object.keys(this._combined);for(let u=0;u<t.length;u++){const _=parseInt(t[u],10);_>=i&&delete this._combined[_]}const n=Object.keys(this._extendedAttrs);for(let u=0;u<n.length;u++){const _=parseInt(n[u],10);_>=i&&delete this._extendedAttrs[_]}}return this.length=i,4*e*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const i=new Uint32Array(this._data.length);return i.set(this._data),this._data=i,1}return 0}fill(i,s=!1){if(s)for(let e=0;e<this.length;++e)this.isProtected(e)||this.setCell(e,i);else{this._combined={},this._extendedAttrs={};for(let e=0;e<this.length;++e)this.setCell(e,i)}}copyFrom(i){this.length!==i.length?this._data=new Uint32Array(i._data):this._data.set(i._data),this.length=i.length,this._combined={};for(const s in i._combined)this._combined[s]=i._combined[s];this._extendedAttrs={};for(const s in i._extendedAttrs)this._extendedAttrs[s]=i._extendedAttrs[s];this.isWrapped=i.isWrapped}clone(){const i=new g(0);i._data=new Uint32Array(this._data),i.length=this.length;for(const s in this._combined)i._combined[s]=this._combined[s];for(const s in this._extendedAttrs)i._extendedAttrs[s]=this._extendedAttrs[s];return i.isWrapped=this.isWrapped,i}getTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(4194303&this._data[3*i+0])return i+(this._data[3*i+0]>>22);return 0}getNoBgTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(4194303&this._data[3*i+0]||50331648&this._data[3*i+2])return i+(this._data[3*i+0]>>22);return 0}copyCellsFrom(i,s,e,t,n){const u=i._data;if(n)for(let p=t-1;p>=0;p--){for(let h=0;h<3;h++)this._data[3*(e+p)+h]=u[3*(s+p)+h];268435456&u[3*(s+p)+2]&&(this._extendedAttrs[e+p]=i._extendedAttrs[s+p])}else for(let p=0;p<t;p++){for(let h=0;h<3;h++)this._data[3*(e+p)+h]=u[3*(s+p)+h];268435456&u[3*(s+p)+2]&&(this._extendedAttrs[e+p]=i._extendedAttrs[s+p])}const _=Object.keys(i._combined);for(let p=0;p<_.length;p++){const h=parseInt(_[p],10);h>=s&&(this._combined[h-s+e]=i._combined[h])}}translateToString(i,s,e,t){s=s??0,e=e??this.length,i&&(e=Math.min(e,this.getTrimmedLength())),t&&(t.length=0);let n="";for(;s<e;){const u=this._data[3*s+0],_=2097151&u,p=2097152&u?this._combined[s]:_?(0,d.stringFromCodePoint)(_):o.WHITESPACE_CELL_CHAR;if(n+=p,t)for(let h=0;h<p.length;++h)t.push(s);s+=u>>22||1}return t&&t.push(s),n}}r.BufferLine=g},4841:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(a,l){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return l*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(M,r)=>{function a(l,f,o){if(f===l.length-1)return l[f].getTrimmedLength();const d=!l[f].hasContent(o-1)&&l[f].getWidth(o-1)===1,v=l[f+1].getWidth(0)===2;return d&&v?o-1:o}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(l,f,o,d,v){const g=[];for(let c=0;c<l.length-1;c++){let i=c,s=l.get(++i);if(!s.isWrapped)continue;const e=[l.get(c)];for(;i<l.length&&s.isWrapped;)e.push(s),s=l.get(++i);if(d>=c&&d<i){c+=e.length-1;continue}let t=0,n=a(e,t,f),u=1,_=0;for(;u<e.length;){const h=a(e,u,f),S=h-_,E=o-n,k=Math.min(S,E);e[t].copyCellsFrom(e[u],_,n,k,!1),n+=k,n===o&&(t++,n=0),_+=k,_===h&&(u++,_=0),n===0&&t!==0&&e[t-1].getWidth(o-1)===2&&(e[t].copyCellsFrom(e[t-1],o-1,n++,1,!1),e[t-1].setCell(o-1,v))}e[t].replaceCells(n,o,v);let p=0;for(let h=e.length-1;h>0&&(h>t||e[h].getTrimmedLength()===0);h--)p++;p>0&&(g.push(c+e.length-p),g.push(p)),c+=e.length-1}return g},r.reflowLargerCreateNewLayout=function(l,f){const o=[];let d=0,v=f[d],g=0;for(let c=0;c<l.length;c++)if(v===c){const i=f[++d];l.onDeleteEmitter.fire({index:c-g,amount:i}),c+=i-1,g+=i,v=f[++d]}else o.push(c);return{layout:o,countRemoved:g}},r.reflowLargerApplyNewLayout=function(l,f){const o=[];for(let d=0;d<f.length;d++)o.push(l.get(f[d]));for(let d=0;d<o.length;d++)l.set(d,o[d]);l.length=f.length},r.reflowSmallerGetNewLineLengths=function(l,f,o){const d=[],v=l.map(((s,e)=>a(l,e,f))).reduce(((s,e)=>s+e));let g=0,c=0,i=0;for(;i<v;){if(v-i<o){d.push(v-i);break}g+=o;const s=a(l,c,f);g>s&&(g-=s,c++);const e=l[c].getWidth(g-1)===2;e&&g--;const t=e?o-1:o;d.push(t),i+=t}return d},r.getWrappedLineTrimmedLength=a},5295:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const l=a(8460),f=a(844),o=a(9092);class d extends f.Disposable{constructor(g,c){super(),this._optionsService=g,this._bufferService=c,this._onBufferActivate=this.register(new l.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new o.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new o.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(g){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(g),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(g,c){this._normal.resize(g,c),this._alt.resize(g,c),this.setupTabStops(g)}setupTabStops(g){this._normal.setupTabStops(g),this._alt.setupTabStops(g)}}r.BufferSet=d},511:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const l=a(482),f=a(643),o=a(3734);class d extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const c=new d;return c.setFromCharData(g),c}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(g){this.fg=g[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let c=!1;if(g[f.CHAR_DATA_CHAR_INDEX].length>2)c=!0;else if(g[f.CHAR_DATA_CHAR_INDEX].length===2){const i=g[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const s=g[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(i-55296)+s-56320+65536|g[f.CHAR_DATA_WIDTH_INDEX]<<22:c=!0}else c=!0}else this.content=g[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[f.CHAR_DATA_WIDTH_INDEX]<<22;c&&(this.combinedData=g[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=d},643:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const l=a(8460),f=a(844);class o{get id(){return this._id}constructor(v){this.line=v,this.isDisposed=!1,this._disposables=[],this._id=o._nextId++,this._onDispose=this.register(new l.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,f.disposeArray)(this._disposables),this._disposables.length=0)}register(v){return this._disposables.push(v),v}}r.Marker=o,o._nextId=1},7116:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(M,r)=>{var a,l,f;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,(function(o){o.NUL="\0",o.SOH="",o.STX="",o.ETX="",o.EOT="",o.ENQ="",o.ACK="",o.BEL="\x07",o.BS="\b",o.HT=" ",o.LF=`
8
8
  `,o.VT="\v",o.FF="\f",o.CR="\r",o.SO="",o.SI="",o.DLE="",o.DC1="",o.DC2="",o.DC3="",o.DC4="",o.NAK="",o.SYN="",o.ETB="",o.CAN="",o.EM="",o.SUB="",o.ESC="\x1B",o.FS="",o.GS="",o.RS="",o.US="",o.SP=" ",o.DEL=""})(a||(r.C0=a={})),(function(o){o.PAD="€",o.HOP="",o.BPH="‚",o.NBH="ƒ",o.IND="„",o.NEL="…",o.SSA="†",o.ESA="‡",o.HTS="ˆ",o.HTJ="‰",o.VTS="Š",o.PLD="‹",o.PLU="Œ",o.RI="",o.SS2="Ž",o.SS3="",o.DCS="",o.PU1="‘",o.PU2="’",o.STS="“",o.CCH="”",o.MW="•",o.SPA="–",o.EPA="—",o.SOS="˜",o.SGCI="™",o.SCI="š",o.CSI="›",o.ST="œ",o.OSC="",o.PM="ž",o.APC="Ÿ"})(l||(r.C1=l={})),(function(o){o.ST=`${a.ESC}\\`})(f||(r.C1_ESCAPED=f={}))},7399:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const l=a(2584),f={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};r.evaluateKeyboardEvent=function(o,d,v,g){const c={type:0,cancel:!1,key:void 0},i=(o.shiftKey?1:0)|(o.altKey?2:0)|(o.ctrlKey?4:0)|(o.metaKey?8:0);switch(o.keyCode){case 0:o.key==="UIKeyInputUpArrow"?c.key=d?l.C0.ESC+"OA":l.C0.ESC+"[A":o.key==="UIKeyInputLeftArrow"?c.key=d?l.C0.ESC+"OD":l.C0.ESC+"[D":o.key==="UIKeyInputRightArrow"?c.key=d?l.C0.ESC+"OC":l.C0.ESC+"[C":o.key==="UIKeyInputDownArrow"&&(c.key=d?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:c.key=o.ctrlKey?"\b":l.C0.DEL,o.altKey&&(c.key=l.C0.ESC+c.key);break;case 9:if(o.shiftKey){c.key=l.C0.ESC+"[Z";break}c.key=l.C0.HT,c.cancel=!0;break;case 13:c.key=o.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,c.cancel=!0;break;case 27:c.key=l.C0.ESC,o.altKey&&(c.key=l.C0.ESC+l.C0.ESC),c.cancel=!0;break;case 37:if(o.metaKey)break;i?(c.key=l.C0.ESC+"[1;"+(i+1)+"D",c.key===l.C0.ESC+"[1;3D"&&(c.key=l.C0.ESC+(v?"b":"[1;5D"))):c.key=d?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(o.metaKey)break;i?(c.key=l.C0.ESC+"[1;"+(i+1)+"C",c.key===l.C0.ESC+"[1;3C"&&(c.key=l.C0.ESC+(v?"f":"[1;5C"))):c.key=d?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(o.metaKey)break;i?(c.key=l.C0.ESC+"[1;"+(i+1)+"A",v||c.key!==l.C0.ESC+"[1;3A"||(c.key=l.C0.ESC+"[1;5A")):c.key=d?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(o.metaKey)break;i?(c.key=l.C0.ESC+"[1;"+(i+1)+"B",v||c.key!==l.C0.ESC+"[1;3B"||(c.key=l.C0.ESC+"[1;5B")):c.key=d?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:o.shiftKey||o.ctrlKey||(c.key=l.C0.ESC+"[2~");break;case 46:c.key=i?l.C0.ESC+"[3;"+(i+1)+"~":l.C0.ESC+"[3~";break;case 36:c.key=i?l.C0.ESC+"[1;"+(i+1)+"H":d?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:c.key=i?l.C0.ESC+"[1;"+(i+1)+"F":d?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:o.shiftKey?c.type=2:o.ctrlKey?c.key=l.C0.ESC+"[5;"+(i+1)+"~":c.key=l.C0.ESC+"[5~";break;case 34:o.shiftKey?c.type=3:o.ctrlKey?c.key=l.C0.ESC+"[6;"+(i+1)+"~":c.key=l.C0.ESC+"[6~";break;case 112:c.key=i?l.C0.ESC+"[1;"+(i+1)+"P":l.C0.ESC+"OP";break;case 113:c.key=i?l.C0.ESC+"[1;"+(i+1)+"Q":l.C0.ESC+"OQ";break;case 114:c.key=i?l.C0.ESC+"[1;"+(i+1)+"R":l.C0.ESC+"OR";break;case 115:c.key=i?l.C0.ESC+"[1;"+(i+1)+"S":l.C0.ESC+"OS";break;case 116:c.key=i?l.C0.ESC+"[15;"+(i+1)+"~":l.C0.ESC+"[15~";break;case 117:c.key=i?l.C0.ESC+"[17;"+(i+1)+"~":l.C0.ESC+"[17~";break;case 118:c.key=i?l.C0.ESC+"[18;"+(i+1)+"~":l.C0.ESC+"[18~";break;case 119:c.key=i?l.C0.ESC+"[19;"+(i+1)+"~":l.C0.ESC+"[19~";break;case 120:c.key=i?l.C0.ESC+"[20;"+(i+1)+"~":l.C0.ESC+"[20~";break;case 121:c.key=i?l.C0.ESC+"[21;"+(i+1)+"~":l.C0.ESC+"[21~";break;case 122:c.key=i?l.C0.ESC+"[23;"+(i+1)+"~":l.C0.ESC+"[23~";break;case 123:c.key=i?l.C0.ESC+"[24;"+(i+1)+"~":l.C0.ESC+"[24~";break;default:if(!o.ctrlKey||o.shiftKey||o.altKey||o.metaKey)if(v&&!g||!o.altKey||o.metaKey)!v||o.altKey||o.ctrlKey||o.shiftKey||!o.metaKey?o.key&&!o.ctrlKey&&!o.altKey&&!o.metaKey&&o.keyCode>=48&&o.key.length===1?c.key=o.key:o.key&&o.ctrlKey&&(o.key==="_"&&(c.key=l.C0.US),o.key==="@"&&(c.key=l.C0.NUL)):o.keyCode===65&&(c.type=1);else{const s=f[o.keyCode],e=s==null?void 0:s[o.shiftKey?1:0];if(e)c.key=l.C0.ESC+e;else if(o.keyCode>=65&&o.keyCode<=90){const t=o.ctrlKey?o.keyCode-64:o.keyCode+32;let n=String.fromCharCode(t);o.shiftKey&&(n=n.toUpperCase()),c.key=l.C0.ESC+n}else if(o.keyCode===32)c.key=l.C0.ESC+(o.ctrlKey?l.C0.NUL:" ");else if(o.key==="Dead"&&o.code.startsWith("Key")){let t=o.code.slice(3,4);o.shiftKey||(t=t.toLowerCase()),c.key=l.C0.ESC+t,c.cancel=!0}}else o.keyCode>=65&&o.keyCode<=90?c.key=String.fromCharCode(o.keyCode-64):o.keyCode===32?c.key=l.C0.NUL:o.keyCode>=51&&o.keyCode<=55?c.key=String.fromCharCode(o.keyCode-51+27):o.keyCode===56?c.key=l.C0.DEL:o.keyCode===219?c.key=l.C0.ESC:o.keyCode===220?c.key=l.C0.FS:o.keyCode===221&&(c.key=l.C0.GS)}return c}},482:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},r.utf32ToString=function(a,l=0,f=a.length){let o="";for(let d=l;d<f;++d){let v=a[d];v>65535?(v-=65536,o+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):o+=String.fromCharCode(v)}return o},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,l){const f=a.length;if(!f)return 0;let o=0,d=0;if(this._interim){const v=a.charCodeAt(d++);56320<=v&&v<=57343?l[o++]=1024*(this._interim-55296)+v-56320+65536:(l[o++]=this._interim,l[o++]=v),this._interim=0}for(let v=d;v<f;++v){const g=a.charCodeAt(v);if(55296<=g&&g<=56319){if(++v>=f)return this._interim=g,o;const c=a.charCodeAt(v);56320<=c&&c<=57343?l[o++]=1024*(g-55296)+c-56320+65536:(l[o++]=g,l[o++]=c)}else g!==65279&&(l[o++]=g)}return o}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,l){const f=a.length;if(!f)return 0;let o,d,v,g,c=0,i=0,s=0;if(this.interim[0]){let n=!1,u=this.interim[0];u&=(224&u)==192?31:(240&u)==224?15:7;let _,p=0;for(;(_=63&this.interim[++p])&&p<4;)u<<=6,u|=_;const h=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,S=h-p;for(;s<S;){if(s>=f)return 0;if(_=a[s++],(192&_)!=128){s--,n=!0;break}this.interim[p++]=_,u<<=6,u|=63&_}n||(h===2?u<128?s--:l[c++]=u:h===3?u<2048||u>=55296&&u<=57343||u===65279||(l[c++]=u):u<65536||u>1114111||(l[c++]=u)),this.interim.fill(0)}const e=f-4;let t=s;for(;t<f;){for(;!(!(t<e)||128&(o=a[t])||128&(d=a[t+1])||128&(v=a[t+2])||128&(g=a[t+3]));)l[c++]=o,l[c++]=d,l[c++]=v,l[c++]=g,t+=4;if(o=a[t++],o<128)l[c++]=o;else if((224&o)==192){if(t>=f)return this.interim[0]=o,c;if(d=a[t++],(192&d)!=128){t--;continue}if(i=(31&o)<<6|63&d,i<128){t--;continue}l[c++]=i}else if((240&o)==224){if(t>=f)return this.interim[0]=o,c;if(d=a[t++],(192&d)!=128){t--;continue}if(t>=f)return this.interim[0]=o,this.interim[1]=d,c;if(v=a[t++],(192&v)!=128){t--;continue}if(i=(15&o)<<12|(63&d)<<6|63&v,i<2048||i>=55296&&i<=57343||i===65279)continue;l[c++]=i}else if((248&o)==240){if(t>=f)return this.interim[0]=o,c;if(d=a[t++],(192&d)!=128){t--;continue}if(t>=f)return this.interim[0]=o,this.interim[1]=d,c;if(v=a[t++],(192&v)!=128){t--;continue}if(t>=f)return this.interim[0]=o,this.interim[1]=d,this.interim[2]=v,c;if(g=a[t++],(192&g)!=128){t--;continue}if(i=(7&o)<<18|(63&d)<<12|(63&v)<<6|63&g,i<65536||i>1114111)continue;l[c++]=i}}return c}}},225:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const l=a(1480),f=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],o=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let d;r.UnicodeV6=class{constructor(){if(this.version="6",!d){d=new Uint8Array(65536),d.fill(1),d[0]=0,d.fill(0,1,32),d.fill(0,127,160),d.fill(2,4352,4448),d[9001]=2,d[9002]=2,d.fill(2,11904,42192),d[12351]=1,d.fill(2,44032,55204),d.fill(2,63744,64256),d.fill(2,65040,65050),d.fill(2,65072,65136),d.fill(2,65280,65377),d.fill(2,65504,65511);for(let v=0;v<f.length;++v)d.fill(0,f[v][0],f[v][1]+1)}}wcwidth(v){return v<32?0:v<127?1:v<65536?d[v]:(function(g,c){let i,s=0,e=c.length-1;if(g<c[0][0]||g>c[e][1])return!1;for(;e>=s;)if(i=s+e>>1,g>c[i][1])s=i+1;else{if(!(g<c[i][0]))return!0;e=i-1}return!1})(v,o)?0:v>=131072&&v<=196605||v>=196608&&v<=262141?2:1}charProperties(v,g){let c=this.wcwidth(v),i=c===0&&g!==0;if(i){const s=l.UnicodeService.extractWidth(g);s===0?i=!1:s>c&&(c=s)}return l.UnicodeService.createPropertyValue(0,c,i)}}},5981:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const l=a(8460),f=a(844);class o extends f.Disposable{constructor(v){super(),this._action=v,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(v,g){if(g!==void 0&&this._syncCalls>g)return void(this._syncCalls=0);if(this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let c;for(this._isSyncWriting=!0;c=this._writeBuffer.shift();){this._action(c);const i=this._callbacks.shift();i&&i()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(v,g){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(g),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(g)}_innerWrite(v=0,g=!0){const c=v||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const i=this._writeBuffer[this._bufferOffset],s=this._action(i,g);if(s){const t=n=>Date.now()-c>=12?setTimeout((()=>this._innerWrite(0,n))):this._innerWrite(c,n);return void s.catch((n=>(queueMicrotask((()=>{throw n})),Promise.resolve(!1)))).then(t)}const e=this._callbacks[this._bufferOffset];if(e&&e(),this._bufferOffset++,this._pendingData-=i.length,Date.now()-c>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}r.WriteBuffer=o},5941:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,l=/^[\da-f]+$/;function f(o,d){const v=o.toString(16),g=v.length<2?"0"+v:v;switch(d){case 4:return v[0];case 8:return g;case 12:return(g+g).slice(0,3);default:return g+g}}r.parseColor=function(o){if(!o)return;let d=o.toLowerCase();if(d.indexOf("rgb:")===0){d=d.slice(4);const v=a.exec(d);if(v){const g=v[1]?15:v[4]?255:v[7]?4095:65535;return[Math.round(parseInt(v[1]||v[4]||v[7]||v[10],16)/g*255),Math.round(parseInt(v[2]||v[5]||v[8]||v[11],16)/g*255),Math.round(parseInt(v[3]||v[6]||v[9]||v[12],16)/g*255)]}}else if(d.indexOf("#")===0&&(d=d.slice(1),l.exec(d)&&[3,6,9,12].includes(d.length))){const v=d.length/3,g=[0,0,0];for(let c=0;c<3;++c){const i=parseInt(d.slice(v*c,v*c+v),16);g[c]=v===1?i<<4:v===2?i:v===3?i>>4:i>>8}return g}},r.toRgbString=function(o,d=16){const[v,g,c]=o;return`rgb:${f(v,d)}/${f(g,d)}/${f(c,d)}`}},5770:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const l=a(482),f=a(8742),o=a(5770),d=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=d,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}registerHandler(g,c){this._handlers[g]===void 0&&(this._handlers[g]=[]);const i=this._handlers[g];return i.push(c),{dispose:()=>{const s=i.indexOf(c);s!==-1&&i.splice(s,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}reset(){if(this._active.length)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].unhook(!1);this._stack.paused=!1,this._active=d,this._ident=0}hook(g,c){if(this.reset(),this._ident=g,this._active=this._handlers[g]||d,this._active.length)for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(c);else this._handlerFb(this._ident,"HOOK",c)}put(g,c,i){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(g,c,i);else this._handlerFb(this._ident,"PUT",(0,l.utf32ToString)(g,c,i))}unhook(g,c=!0){if(this._active.length){let i=!1,s=this._active.length-1,e=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=c,e=this._stack.fallThrough,this._stack.paused=!1),!e&&i===!1){for(;s>=0&&(i=this._active[s].unhook(g),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}else this._handlerFb(this._ident,"UNHOOK",g);this._active=d,this._ident=0}};const v=new f.Params;v.addParam(0),r.DcsHandler=class{constructor(g){this._handler=g,this._data="",this._params=v,this._hitLimit=!1}hook(g){this._params=g.length>1||g.params[0]?g.clone():v,this._data="",this._hitLimit=!1}put(g,c,i){this._hitLimit||(this._data+=(0,l.utf32ToString)(g,c,i),this._data.length>o.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(g){let c=!1;if(this._hitLimit)c=!1;else if(g&&(c=this._handler(this._data,this._params),c instanceof Promise))return c.then((i=>(this._params=v,this._data="",this._hitLimit=!1,i)));return this._params=v,this._data="",this._hitLimit=!1,c}}},2015:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const l=a(844),f=a(8742),o=a(6242),d=a(6351);class v{constructor(s){this.table=new Uint8Array(s)}setDefault(s,e){this.table.fill(s<<4|e)}add(s,e,t,n){this.table[e<<8|s]=t<<4|n}addMany(s,e,t,n){for(let u=0;u<s.length;u++)this.table[e<<8|s[u]]=t<<4|n}}r.TransitionTable=v;const g=160;r.VT500_TRANSITION_TABLE=(function(){const i=new v(4095),s=Array.apply(null,Array(256)).map(((p,h)=>h)),e=(p,h)=>s.slice(p,h),t=e(32,127),n=e(0,24);n.push(25),n.push.apply(n,e(28,32));const u=e(0,14);let _;for(_ in i.setDefault(1,0),i.addMany(t,0,2,0),u)i.addMany([24,26,153,154],_,3,0),i.addMany(e(128,144),_,3,0),i.addMany(e(144,152),_,3,0),i.add(156,_,0,0),i.add(27,_,11,1),i.add(157,_,4,8),i.addMany([152,158,159],_,0,7),i.add(155,_,11,3),i.add(144,_,11,9);return i.addMany(n,0,3,0),i.addMany(n,1,3,1),i.add(127,1,0,1),i.addMany(n,8,0,8),i.addMany(n,3,3,3),i.add(127,3,0,3),i.addMany(n,4,3,4),i.add(127,4,0,4),i.addMany(n,6,3,6),i.addMany(n,5,3,5),i.add(127,5,0,5),i.addMany(n,2,3,2),i.add(127,2,0,2),i.add(93,1,4,8),i.addMany(t,8,5,8),i.add(127,8,5,8),i.addMany([156,27,24,26,7],8,6,0),i.addMany(e(28,32),8,0,8),i.addMany([88,94,95],1,0,7),i.addMany(t,7,0,7),i.addMany(n,7,0,7),i.add(156,7,0,0),i.add(127,7,0,7),i.add(91,1,11,3),i.addMany(e(64,127),3,7,0),i.addMany(e(48,60),3,8,4),i.addMany([60,61,62,63],3,9,4),i.addMany(e(48,60),4,8,4),i.addMany(e(64,127),4,7,0),i.addMany([60,61,62,63],4,0,6),i.addMany(e(32,64),6,0,6),i.add(127,6,0,6),i.addMany(e(64,127),6,0,0),i.addMany(e(32,48),3,9,5),i.addMany(e(32,48),5,9,5),i.addMany(e(48,64),5,0,6),i.addMany(e(64,127),5,7,0),i.addMany(e(32,48),4,9,5),i.addMany(e(32,48),1,9,2),i.addMany(e(32,48),2,9,2),i.addMany(e(48,127),2,10,0),i.addMany(e(48,80),1,10,0),i.addMany(e(81,88),1,10,0),i.addMany([89,90,92],1,10,0),i.addMany(e(96,127),1,10,0),i.add(80,1,11,9),i.addMany(n,9,0,9),i.add(127,9,0,9),i.addMany(e(28,32),9,0,9),i.addMany(e(32,48),9,9,12),i.addMany(e(48,60),9,8,10),i.addMany([60,61,62,63],9,9,10),i.addMany(n,11,0,11),i.addMany(e(32,128),11,0,11),i.addMany(e(28,32),11,0,11),i.addMany(n,10,0,10),i.add(127,10,0,10),i.addMany(e(28,32),10,0,10),i.addMany(e(48,60),10,8,10),i.addMany([60,61,62,63],10,0,11),i.addMany(e(32,48),10,9,12),i.addMany(n,12,0,12),i.add(127,12,0,12),i.addMany(e(28,32),12,0,12),i.addMany(e(32,48),12,9,12),i.addMany(e(48,64),12,0,11),i.addMany(e(64,127),12,12,13),i.addMany(e(64,127),10,12,13),i.addMany(e(64,127),9,12,13),i.addMany(n,13,13,13),i.addMany(t,13,13,13),i.add(127,13,0,13),i.addMany([27,156,24,26],13,14,0),i.add(g,0,2,0),i.add(g,8,5,8),i.add(g,6,0,6),i.add(g,11,0,11),i.add(g,13,13,13),i})();class c extends l.Disposable{constructor(s=r.VT500_TRANSITION_TABLE){super(),this._transitions=s,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new f.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,t,n)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,l.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new o.OscParser),this._dcsParser=this.register(new d.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(s,e=[64,126]){let t=0;if(s.prefix){if(s.prefix.length>1)throw new Error("only one byte as prefix supported");if(t=s.prefix.charCodeAt(0),t&&60>t||t>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(s.intermediates){if(s.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let u=0;u<s.intermediates.length;++u){const _=s.intermediates.charCodeAt(u);if(32>_||_>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");t<<=8,t|=_}}if(s.final.length!==1)throw new Error("final must be a single byte");const n=s.final.charCodeAt(0);if(e[0]>n||n>e[1])throw new Error(`final must be in range ${e[0]} .. ${e[1]}`);return t<<=8,t|=n,t}identToString(s){const e=[];for(;s;)e.push(String.fromCharCode(255&s)),s>>=8;return e.reverse().join("")}setPrintHandler(s){this._printHandler=s}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(s,e){const t=this._identifier(s,[48,126]);this._escHandlers[t]===void 0&&(this._escHandlers[t]=[]);const n=this._escHandlers[t];return n.push(e),{dispose:()=>{const u=n.indexOf(e);u!==-1&&n.splice(u,1)}}}clearEscHandler(s){this._escHandlers[this._identifier(s,[48,126])]&&delete this._escHandlers[this._identifier(s,[48,126])]}setEscHandlerFallback(s){this._escHandlerFb=s}setExecuteHandler(s,e){this._executeHandlers[s.charCodeAt(0)]=e}clearExecuteHandler(s){this._executeHandlers[s.charCodeAt(0)]&&delete this._executeHandlers[s.charCodeAt(0)]}setExecuteHandlerFallback(s){this._executeHandlerFb=s}registerCsiHandler(s,e){const t=this._identifier(s);this._csiHandlers[t]===void 0&&(this._csiHandlers[t]=[]);const n=this._csiHandlers[t];return n.push(e),{dispose:()=>{const u=n.indexOf(e);u!==-1&&n.splice(u,1)}}}clearCsiHandler(s){this._csiHandlers[this._identifier(s)]&&delete this._csiHandlers[this._identifier(s)]}setCsiHandlerFallback(s){this._csiHandlerFb=s}registerDcsHandler(s,e){return this._dcsParser.registerHandler(this._identifier(s),e)}clearDcsHandler(s){this._dcsParser.clearHandler(this._identifier(s))}setDcsHandlerFallback(s){this._dcsParser.setHandlerFallback(s)}registerOscHandler(s,e){return this._oscParser.registerHandler(s,e)}clearOscHandler(s){this._oscParser.clearHandler(s)}setOscHandlerFallback(s){this._oscParser.setHandlerFallback(s)}setErrorHandler(s){this._errorHandler=s}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(s,e,t,n,u){this._parseStack.state=s,this._parseStack.handlers=e,this._parseStack.handlerPos=t,this._parseStack.transition=n,this._parseStack.chunkPos=u}parse(s,e,t){let n,u=0,_=0,p=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,p=this._parseStack.chunkPos+1;else{if(t===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const h=this._parseStack.handlers;let S=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(t===!1&&S>-1){for(;S>=0&&(n=h[S](this._params),n!==!0);S--)if(n instanceof Promise)return this._parseStack.handlerPos=S,n}this._parseStack.handlers=[];break;case 4:if(t===!1&&S>-1){for(;S>=0&&(n=h[S](),n!==!0);S--)if(n instanceof Promise)return this._parseStack.handlerPos=S,n}this._parseStack.handlers=[];break;case 6:if(u=s[this._parseStack.chunkPos],n=this._dcsParser.unhook(u!==24&&u!==26,t),n)return n;u===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(u=s[this._parseStack.chunkPos],n=this._oscParser.end(u!==24&&u!==26,t),n)return n;u===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,p=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let h=p;h<e;++h){switch(u=s[h],_=this._transitions.table[this.currentState<<8|(u<160?u:g)],_>>4){case 2:for(let w=h+1;;++w){if(w>=e||(u=s[w])<32||u>126&&u<g){this._printHandler(s,h,w),h=w-1;break}if(++w>=e||(u=s[w])<32||u>126&&u<g){this._printHandler(s,h,w),h=w-1;break}if(++w>=e||(u=s[w])<32||u>126&&u<g){this._printHandler(s,h,w),h=w-1;break}if(++w>=e||(u=s[w])<32||u>126&&u<g){this._printHandler(s,h,w),h=w-1;break}}break;case 3:this._executeHandlers[u]?this._executeHandlers[u]():this._executeHandlerFb(u),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:h,code:u,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const S=this._csiHandlers[this._collect<<8|u];let E=S?S.length-1:-1;for(;E>=0&&(n=S[E](this._params),n!==!0);E--)if(n instanceof Promise)return this._preserveStack(3,S,E,_,h),n;E<0&&this._csiHandlerFb(this._collect<<8|u,this._params),this.precedingJoinState=0;break;case 8:do switch(u){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(u-48)}while(++h<e&&(u=s[h])>47&&u<60);h--;break;case 9:this._collect<<=8,this._collect|=u;break;case 10:const k=this._escHandlers[this._collect<<8|u];let D=k?k.length-1:-1;for(;D>=0&&(n=k[D](),n!==!0);D--)if(n instanceof Promise)return this._preserveStack(4,k,D,_,h),n;D<0&&this._escHandlerFb(this._collect<<8|u),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|u,this._params);break;case 13:for(let w=h+1;;++w)if(w>=e||(u=s[w])===24||u===26||u===27||u>127&&u<g){this._dcsParser.put(s,h,w),h=w-1;break}break;case 14:if(n=this._dcsParser.unhook(u!==24&&u!==26),n)return this._preserveStack(6,[],0,_,h),n;u===27&&(_|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let w=h+1;;w++)if(w>=e||(u=s[w])<32||u>127&&u<g){this._oscParser.put(s,h,w),h=w-1;break}break;case 6:if(n=this._oscParser.end(u!==24&&u!==26),n)return this._preserveStack(5,[],0,_,h),n;u===27&&(_|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&_}}}r.EscapeSequenceParser=c},6242:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const l=a(5770),f=a(482),o=[];r.OscParser=class{constructor(){this._state=0,this._active=o,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(d,v){this._handlers[d]===void 0&&(this._handlers[d]=[]);const g=this._handlers[d];return g.push(v),{dispose:()=>{const c=g.indexOf(v);c!==-1&&g.splice(c,1)}}}clearHandler(d){this._handlers[d]&&delete this._handlers[d]}setHandlerFallback(d){this._handlerFb=d}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}reset(){if(this._state===2)for(let d=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;d>=0;--d)this._active[d].end(!1);this._stack.paused=!1,this._active=o,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||o,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].start();else this._handlerFb(this._id,"START")}_put(d,v,g){if(this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].put(d,v,g);else this._handlerFb(this._id,"PUT",(0,f.utf32ToString)(d,v,g))}start(){this.reset(),this._state=1}put(d,v,g){if(this._state!==3){if(this._state===1)for(;v<g;){const c=d[v++];if(c===59){this._state=2,this._start();break}if(c<48||57<c)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+c-48}this._state===2&&g-v>0&&this._put(d,v,g)}}end(d,v=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let g=!1,c=this._active.length-1,i=!1;if(this._stack.paused&&(c=this._stack.loopPosition-1,g=v,i=this._stack.fallThrough,this._stack.paused=!1),!i&&g===!1){for(;c>=0&&(g=this._active[c].end(d),g!==!0);c--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!1,g;c--}for(;c>=0;c--)if(g=this._active[c].end(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!0,g}else this._handlerFb(this._id,"END",d);this._active=o,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(d){this._handler=d,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(d,v,g){this._hitLimit||(this._data+=(0,f.utf32ToString)(d,v,g),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(d){let v=!1;if(this._hitLimit)v=!1;else if(d&&(v=this._handler(this._data),v instanceof Promise))return v.then((g=>(this._data="",this._hitLimit=!1,g)));return this._data="",this._hitLimit=!1,v}}},8742:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const a=2147483647;class l{static fromArray(o){const d=new l;if(!o.length)return d;for(let v=Array.isArray(o[0])?1:0;v<o.length;++v){const g=o[v];if(Array.isArray(g))for(let c=0;c<g.length;++c)d.addSubParam(g[c]);else d.addParam(g)}return d}constructor(o=32,d=32){if(this.maxLength=o,this.maxSubParamsLength=d,d>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(o),this.length=0,this._subParams=new Int32Array(d),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(o),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const o=new l(this.maxLength,this.maxSubParamsLength);return o.params.set(this.params),o.length=this.length,o._subParams.set(this._subParams),o._subParamsLength=this._subParamsLength,o._subParamsIdx.set(this._subParamsIdx),o._rejectDigits=this._rejectDigits,o._rejectSubDigits=this._rejectSubDigits,o._digitIsSub=this._digitIsSub,o}toArray(){const o=[];for(let d=0;d<this.length;++d){o.push(this.params[d]);const v=this._subParamsIdx[d]>>8,g=255&this._subParamsIdx[d];g-v>0&&o.push(Array.prototype.slice.call(this._subParams,v,g))}return o}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(o){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=o>a?a:o}}addSubParam(o){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=o>a?a:o,this._subParamsIdx[this.length-1]++}}hasSubParams(o){return(255&this._subParamsIdx[o])-(this._subParamsIdx[o]>>8)>0}getSubParams(o){const d=this._subParamsIdx[o]>>8,v=255&this._subParamsIdx[o];return v-d>0?this._subParams.subarray(d,v):null}getSubParamsAll(){const o={};for(let d=0;d<this.length;++d){const v=this._subParamsIdx[d]>>8,g=255&this._subParamsIdx[d];g-v>0&&(o[d]=this._subParams.slice(v,g))}return o}addDigit(o){let d;if(this._rejectDigits||!(d=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const v=this._digitIsSub?this._subParams:this.params,g=v[d-1];v[d-1]=~g?Math.min(10*g+o,a):o}}r.Params=l},5741:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,l){const f={instance:l,dispose:l.dispose,isDisposed:!1};this._addons.push(f),l.dispose=()=>this._wrappedAddonDispose(f),l.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let l=-1;for(let f=0;f<this._addons.length;f++)if(this._addons[f]===a){l=f;break}if(l===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(l,1)}}},8771:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const l=a(3785),f=a(511);r.BufferApiView=class{constructor(o,d){this._buffer=o,this.type=d}init(o){return this._buffer=o,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(o){const d=this._buffer.lines.get(o);if(d)return new l.BufferLineApiView(d)}getNullCell(){return new f.CellData}}},3785:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const l=a(511);r.BufferLineApiView=class{constructor(f){this._line=f}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(f,o){if(!(f<0||f>=this._line.length))return o?(this._line.loadCell(f,o),o):this._line.loadCell(f,new l.CellData)}translateToString(f,o,d){return this._line.translateToString(f,o,d)}}},8285:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const l=a(8771),f=a(8460),o=a(844);class d extends o.Disposable{constructor(g){super(),this._core=g,this._onBufferChange=this.register(new f.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new l.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new l.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}r.BufferNamespaceApi=d},7975:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,l){return this._core.registerCsiHandler(a,(f=>l(f.toArray())))}addCsiHandler(a,l){return this.registerCsiHandler(a,l)}registerDcsHandler(a,l){return this._core.registerDcsHandler(a,((f,o)=>l(f,o.toArray())))}addDcsHandler(a,l){return this.registerDcsHandler(a,l)}registerEscHandler(a,l){return this._core.registerEscHandler(a,l)}addEscHandler(a,l){return this.registerEscHandler(a,l)}registerOscHandler(a,l){return this._core.registerOscHandler(a,l)}addOscHandler(a,l){return this.registerOscHandler(a,l)}}},7090:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(M,r,a){var l=this&&this.__decorate||function(i,s,e,t){var n,u=arguments.length,_=u<3?s:t===null?t=Object.getOwnPropertyDescriptor(s,e):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(i,s,e,t);else for(var p=i.length-1;p>=0;p--)(n=i[p])&&(_=(u<3?n(_):u>3?n(s,e,_):n(s,e))||_);return u>3&&_&&Object.defineProperty(s,e,_),_},f=this&&this.__param||function(i,s){return function(e,t){s(e,t,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const o=a(8460),d=a(844),v=a(5295),g=a(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let c=r.BufferService=class extends d.Disposable{get buffer(){return this.buffers.active}constructor(i){super(),this.isUserScrolling=!1,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(i.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(i.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new v.BufferSet(i,this))}resize(i,s){this.cols=i,this.rows=s,this.buffers.resize(i,s),this._onResize.fire({cols:i,rows:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(i,s=!1){const e=this.buffer;let t;t=this._cachedBlankLine,t&&t.length===this.cols&&t.getFg(0)===i.fg&&t.getBg(0)===i.bg||(t=e.getBlankLine(i,s),this._cachedBlankLine=t),t.isWrapped=s;const n=e.ybase+e.scrollTop,u=e.ybase+e.scrollBottom;if(e.scrollTop===0){const _=e.lines.isFull;u===e.lines.length-1?_?e.lines.recycle().copyFrom(t):e.lines.push(t.clone()):e.lines.splice(u+1,0,t.clone()),_?this.isUserScrolling&&(e.ydisp=Math.max(e.ydisp-1,0)):(e.ybase++,this.isUserScrolling||e.ydisp++)}else{const _=u-n+1;e.lines.shiftElements(n+1,_-1,-1),e.lines.set(u,t.clone())}this.isUserScrolling||(e.ydisp=e.ybase),this._onScroll.fire(e.ydisp)}scrollLines(i,s,e){const t=this.buffer;if(i<0){if(t.ydisp===0)return;this.isUserScrolling=!0}else i+t.ydisp>=t.ybase&&(this.isUserScrolling=!1);const n=t.ydisp;t.ydisp=Math.max(Math.min(t.ydisp+i,t.ybase),0),n!==t.ydisp&&(s||this._onScroll.fire(t.ydisp))}};r.BufferService=c=l([f(0,g.IOptionsService)],c)},7994:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,l){this._charsets[a]=l,this.glevel===a&&(this.charset=l)}}},1753:function(M,r,a){var l=this&&this.__decorate||function(t,n,u,_){var p,h=arguments.length,S=h<3?n:_===null?_=Object.getOwnPropertyDescriptor(n,u):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(t,n,u,_);else for(var E=t.length-1;E>=0;E--)(p=t[E])&&(S=(h<3?p(S):h>3?p(n,u,S):p(n,u))||S);return h>3&&S&&Object.defineProperty(n,u,S),S},f=this&&this.__param||function(t,n){return function(u,_){n(u,_,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const o=a(2585),d=a(8460),v=a(844),g={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button!==4&&t.action===1&&(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>t.action!==32||t.button!==3},ANY:{events:31,restrict:t=>!0}};function c(t,n){let u=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(u|=64,u|=t.action):(u|=3&t.button,4&t.button&&(u|=64),8&t.button&&(u|=128),t.action===32?u|=32:t.action!==0||n||(u|=3)),u}const i=String.fromCharCode,s={DEFAULT:t=>{const n=[c(t,!1)+32,t.col+32,t.row+32];return n[0]>255||n[1]>255||n[2]>255?"":`\x1B[M${i(n[0])}${i(n[1])}${i(n[2])}`},SGR:t=>{const n=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${c(t,!0)};${t.col};${t.row}${n}`},SGR_PIXELS:t=>{const n=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${c(t,!0)};${t.x};${t.y}${n}`}};let e=r.CoreMouseService=class extends v.Disposable{constructor(t,n){super(),this._bufferService=t,this._coreService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new d.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const u of Object.keys(g))this.addProtocol(u,g[u]);for(const u of Object.keys(s))this.addEncoding(u,s[u]);this.reset()}addProtocol(t,n){this._protocols[t]=n}addEncoding(t,n){this._encodings[t]=n}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;const n=this._encodings[this._activeEncoding](t);return n&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(n):this._coreService.triggerDataEvent(n,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(1&t),up:!!(2&t),drag:!!(4&t),move:!!(8&t),wheel:!!(16&t)}}_equalEvents(t,n,u){if(u){if(t.x!==n.x||t.y!==n.y)return!1}else if(t.col!==n.col||t.row!==n.row)return!1;return t.button===n.button&&t.action===n.action&&t.ctrl===n.ctrl&&t.alt===n.alt&&t.shift===n.shift}};r.CoreMouseService=e=l([f(0,o.IBufferService),f(1,o.ICoreService)],e)},6975:function(M,r,a){var l=this&&this.__decorate||function(e,t,n,u){var _,p=arguments.length,h=p<3?t:u===null?u=Object.getOwnPropertyDescriptor(t,n):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(e,t,n,u);else for(var S=e.length-1;S>=0;S--)(_=e[S])&&(h=(p<3?_(h):p>3?_(t,n,h):_(t,n))||h);return p>3&&h&&Object.defineProperty(t,n,h),h},f=this&&this.__param||function(e,t){return function(n,u){t(n,u,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const o=a(1439),d=a(8460),v=a(844),g=a(2585),c=Object.freeze({insertMode:!1}),i=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let s=r.CoreService=class extends v.Disposable{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new d.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new d.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,o.clone)(c),this.decPrivateModes=(0,o.clone)(i)}reset(){this.modes=(0,o.clone)(c),this.decPrivateModes=(0,o.clone)(i)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;const n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split("").map((u=>u.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split("").map((t=>t.charCodeAt(0))))),this._onBinary.fire(e))}};r.CoreService=s=l([f(0,g.IBufferService),f(1,g.ILogService),f(2,g.IOptionsService)],s)},9074:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const l=a(8055),f=a(8460),o=a(844),d=a(6106);let v=0,g=0;class c extends o.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new d.SortedList((e=>e==null?void 0:e.marker.line)),this._onDecorationRegistered=this.register(new f.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new f.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,o.toDisposable)((()=>this.reset())))}registerDecoration(e){if(e.marker.isDisposed)return;const t=new i(e);if(t){const n=t.marker.onDispose((()=>t.dispose()));t.onDispose((()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),n.dispose())})),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(const e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let u=0,_=0;for(const p of this._decorations.getKeyIterator(t))u=p.options.x??0,_=u+(p.options.width??1),e>=u&&e<_&&(!n||(p.options.layer??"bottom")===n)&&(yield p)}forEachDecorationAtCell(e,t,n,u){this._decorations.forEachByKey(t,(_=>{v=_.options.x??0,g=v+(_.options.width??1),e>=v&&e<g&&(!n||(_.options.layer??"bottom")===n)&&u(_)}))}}r.DecorationService=c;class i extends o.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=l.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=l.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(e){super(),this.options=e,this.onRenderEmitter=this.register(new f.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const l=a(2585),f=a(8343);class o{constructor(...v){this._entries=new Map;for(const[g,c]of v)this.set(g,c)}set(v,g){const c=this._entries.get(v);return this._entries.set(v,g),c}forEach(v){for(const[g,c]of this._entries.entries())v(g,c)}has(v){return this._entries.has(v)}get(v){return this._entries.get(v)}}r.ServiceCollection=o,r.InstantiationService=class{constructor(){this._services=new o,this._services.set(l.IInstantiationService,this)}setService(d,v){this._services.set(d,v)}getService(d){return this._services.get(d)}createInstance(d,...v){const g=(0,f.getServiceDependencies)(d).sort(((s,e)=>s.index-e.index)),c=[];for(const s of g){const e=this._services.get(s.id);if(!e)throw new Error(`[createInstance] ${d.name} depends on UNKNOWN service ${s.id}.`);c.push(e)}const i=g.length>0?g[0].index:v.length;if(v.length!==i)throw new Error(`[createInstance] First service dependency of ${d.name} at position ${i+1} conflicts with ${v.length} static arguments`);return new d(...v,...c)}}},7866:function(M,r,a){var l=this&&this.__decorate||function(i,s,e,t){var n,u=arguments.length,_=u<3?s:t===null?t=Object.getOwnPropertyDescriptor(s,e):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(i,s,e,t);else for(var p=i.length-1;p>=0;p--)(n=i[p])&&(_=(u<3?n(_):u>3?n(s,e,_):n(s,e))||_);return u>3&&_&&Object.defineProperty(s,e,_),_},f=this&&this.__param||function(i,s){return function(e,t){s(e,t,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const o=a(844),d=a(2585),v={trace:d.LogLevelEnum.TRACE,debug:d.LogLevelEnum.DEBUG,info:d.LogLevelEnum.INFO,warn:d.LogLevelEnum.WARN,error:d.LogLevelEnum.ERROR,off:d.LogLevelEnum.OFF};let g,c=r.LogService=class extends o.Disposable{get logLevel(){return this._logLevel}constructor(i){super(),this._optionsService=i,this._logLevel=d.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),g=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(i){for(let s=0;s<i.length;s++)typeof i[s]=="function"&&(i[s]=i[s]())}_log(i,s,e){this._evalLazyOptionalParams(e),i.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+s,...e)}trace(i,...s){var e;this._logLevel<=d.LogLevelEnum.TRACE&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.trace.bind(this._optionsService.options.logger))??console.log,i,s)}debug(i,...s){var e;this._logLevel<=d.LogLevelEnum.DEBUG&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.debug.bind(this._optionsService.options.logger))??console.log,i,s)}info(i,...s){var e;this._logLevel<=d.LogLevelEnum.INFO&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.info.bind(this._optionsService.options.logger))??console.info,i,s)}warn(i,...s){var e;this._logLevel<=d.LogLevelEnum.WARN&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.warn.bind(this._optionsService.options.logger))??console.warn,i,s)}error(i,...s){var e;this._logLevel<=d.LogLevelEnum.ERROR&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.error.bind(this._optionsService.options.logger))??console.error,i,s)}};r.LogService=c=l([f(0,d.IOptionsService)],c),r.setTraceLogger=function(i){g=i},r.traceCall=function(i,s,e){if(typeof e.value!="function")throw new Error("not supported");const t=e.value;e.value=function(...n){if(g.logLevel!==d.LogLevelEnum.TRACE)return t.apply(this,n);g.trace(`GlyphRenderer#${t.name}(${n.map((_=>JSON.stringify(_))).join(", ")})`);const u=t.apply(this,n);return g.trace(`GlyphRenderer#${t.name} return`,u),u}}},7302:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const l=a(8460),f=a(844),o=a(6114);r.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:o.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const d=["normal","bold","100","200","300","400","500","600","700","800","900"];class v extends f.Disposable{constructor(c){super(),this._onOptionChange=this.register(new l.EventEmitter),this.onOptionChange=this._onOptionChange.event;const i={...r.DEFAULT_OPTIONS};for(const s in c)if(s in i)try{const e=c[s];i[s]=this._sanitizeAndValidateOption(s,e)}catch(e){console.error(e)}this.rawOptions=i,this.options={...i},this._setupOptions(),this.register((0,f.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(c,i){return this.onOptionChange((s=>{s===c&&i(this.rawOptions[c])}))}onMultipleOptionChange(c,i){return this.onOptionChange((s=>{c.indexOf(s)!==-1&&i()}))}_setupOptions(){const c=s=>{if(!(s in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},i=(s,e)=>{if(!(s in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);e=this._sanitizeAndValidateOption(s,e),this.rawOptions[s]!==e&&(this.rawOptions[s]=e,this._onOptionChange.fire(s))};for(const s in this.rawOptions){const e={get:c.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this.options,s,e)}}_sanitizeAndValidateOption(c,i){switch(c){case"cursorStyle":if(i||(i=r.DEFAULT_OPTIONS[c]),!(function(s){return s==="block"||s==="underline"||s==="bar"})(i))throw new Error(`"${i}" is not a valid value for ${c}`);break;case"wordSeparator":i||(i=r.DEFAULT_OPTIONS[c]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=d.includes(i)?i:r.DEFAULT_OPTIONS[c];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${c} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(10*i)/10));break;case"scrollback":if((i=Math.min(i,4294967295))<0)throw new Error(`${c} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${c} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&i!==0)throw new Error(`${c} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{}}return i}}r.OptionsService=v},2660:function(M,r,a){var l=this&&this.__decorate||function(v,g,c,i){var s,e=arguments.length,t=e<3?g:i===null?i=Object.getOwnPropertyDescriptor(g,c):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(v,g,c,i);else for(var n=v.length-1;n>=0;n--)(s=v[n])&&(t=(e<3?s(t):e>3?s(g,c,t):s(g,c))||t);return e>3&&t&&Object.defineProperty(g,c,t),t},f=this&&this.__param||function(v,g){return function(c,i){g(c,i,v)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const o=a(2585);let d=r.OscLinkService=class{constructor(v){this._bufferService=v,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(v){const g=this._bufferService.buffer;if(v.id===void 0){const n=g.addMarker(g.ybase+g.y),u={data:v,id:this._nextId++,lines:[n]};return n.onDispose((()=>this._removeMarkerFromLink(u,n))),this._dataByLinkId.set(u.id,u),u.id}const c=v,i=this._getEntryIdKey(c),s=this._entriesWithId.get(i);if(s)return this.addLineToLink(s.id,g.ybase+g.y),s.id;const e=g.addMarker(g.ybase+g.y),t={id:this._nextId++,key:this._getEntryIdKey(c),data:c,lines:[e]};return e.onDispose((()=>this._removeMarkerFromLink(t,e))),this._entriesWithId.set(t.key,t),this._dataByLinkId.set(t.id,t),t.id}addLineToLink(v,g){const c=this._dataByLinkId.get(v);if(c&&c.lines.every((i=>i.line!==g))){const i=this._bufferService.buffer.addMarker(g);c.lines.push(i),i.onDispose((()=>this._removeMarkerFromLink(c,i)))}}getLinkData(v){var g;return(g=this._dataByLinkId.get(v))==null?void 0:g.data}_getEntryIdKey(v){return`${v.id};;${v.uri}`}_removeMarkerFromLink(v,g){const c=v.lines.indexOf(g);c!==-1&&(v.lines.splice(c,1),v.lines.length===0&&(v.data.id!==void 0&&this._entriesWithId.delete(v.key),this._dataByLinkId.delete(v.id)))}};r.OscLinkService=d=l([f(0,o.IBufferService)],d)},8343:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const a="di$target",l="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(f){return f[l]||[]},r.createDecorator=function(f){if(r.serviceRegistry.has(f))return r.serviceRegistry.get(f);const o=function(d,v,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(c,i,s){i[a]===i?i[l].push({id:c,index:s}):(i[l]=[{id:c,index:s}],i[a]=i)})(o,d,g)};return o.toString=()=>f,r.serviceRegistry.set(f,o),o}},2585:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const l=a(8343);var f;r.IBufferService=(0,l.createDecorator)("BufferService"),r.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),r.ICoreService=(0,l.createDecorator)("CoreService"),r.ICharsetService=(0,l.createDecorator)("CharsetService"),r.IInstantiationService=(0,l.createDecorator)("InstantiationService"),(function(o){o[o.TRACE=0]="TRACE",o[o.DEBUG=1]="DEBUG",o[o.INFO=2]="INFO",o[o.WARN=3]="WARN",o[o.ERROR=4]="ERROR",o[o.OFF=5]="OFF"})(f||(r.LogLevelEnum=f={})),r.ILogService=(0,l.createDecorator)("LogService"),r.IOptionsService=(0,l.createDecorator)("OptionsService"),r.IOscLinkService=(0,l.createDecorator)("OscLinkService"),r.IUnicodeService=(0,l.createDecorator)("UnicodeService"),r.IDecorationService=(0,l.createDecorator)("DecorationService")},1480:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const l=a(8460),f=a(225);class o{static extractShouldJoin(v){return(1&v)!=0}static extractWidth(v){return v>>1&3}static extractCharKind(v){return v>>3}static createPropertyValue(v,g,c=!1){return(16777215&v)<<3|(3&g)<<1|(c?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const v=new f.UnicodeV6;this.register(v),this._active=v.version,this._activeProvider=v}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(v){if(!this._providers[v])throw new Error(`unknown Unicode version "${v}"`);this._active=v,this._activeProvider=this._providers[v],this._onChange.fire(v)}register(v){this._providers[v.version]=v}wcwidth(v){return this._activeProvider.wcwidth(v)}getStringCellWidth(v){let g=0,c=0;const i=v.length;for(let s=0;s<i;++s){let e=v.charCodeAt(s);if(55296<=e&&e<=56319){if(++s>=i)return g+this.wcwidth(e);const u=v.charCodeAt(s);56320<=u&&u<=57343?e=1024*(e-55296)+u-56320+65536:g+=this.wcwidth(u)}const t=this.charProperties(e,c);let n=o.extractWidth(t);o.extractShouldJoin(t)&&(n-=o.extractWidth(c)),g+=n,c=t}return g}charProperties(v,g){return this._activeProvider.charProperties(v,g)}}r.UnicodeService=o}},X={};function K(M){var r=X[M];if(r!==void 0)return r.exports;var a=X[M]={exports:{}};return Z[M].call(a.exports,a,a.exports,K),a.exports}var J={};return(()=>{var M=J;Object.defineProperty(M,"__esModule",{value:!0}),M.Terminal=void 0;const r=K(9042),a=K(3236),l=K(844),f=K(5741),o=K(8285),d=K(7975),v=K(7090),g=["cols","rows"];class c extends l.Disposable{constructor(s){super(),this._core=this.register(new a.Terminal(s)),this._addonManager=this.register(new f.AddonManager),this._publicOptions={...this._core.options};const e=n=>this._core.options[n],t=(n,u)=>{this._checkReadonlyOptions(n),this._core.options[n]=u};for(const n in this._core.options){const u={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this._publicOptions,n,u)}}_checkReadonlyOptions(s){if(g.includes(s))throw new Error(`Option "${s}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new d.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new o.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const s=this._core.coreService.decPrivateModes;let e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any"}return{applicationCursorKeysMode:s.applicationCursorKeys,applicationKeypadMode:s.applicationKeypad,bracketedPasteMode:s.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:s.origin,reverseWraparoundMode:s.reverseWraparound,sendFocusMode:s.sendFocus,wraparoundMode:s.wraparound}}get options(){return this._publicOptions}set options(s){for(const e in s)this._publicOptions[e]=s[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(s,e=!0){this._core.input(s,e)}resize(s,e){this._verifyIntegers(s,e),this._core.resize(s,e)}open(s){this._core.open(s)}attachCustomKeyEventHandler(s){this._core.attachCustomKeyEventHandler(s)}attachCustomWheelEventHandler(s){this._core.attachCustomWheelEventHandler(s)}registerLinkProvider(s){return this._core.registerLinkProvider(s)}registerCharacterJoiner(s){return this._checkProposedApi(),this._core.registerCharacterJoiner(s)}deregisterCharacterJoiner(s){this._checkProposedApi(),this._core.deregisterCharacterJoiner(s)}registerMarker(s=0){return this._verifyIntegers(s),this._core.registerMarker(s)}registerDecoration(s){return this._checkProposedApi(),this._verifyPositiveIntegers(s.x??0,s.width??0,s.height??0),this._core.registerDecoration(s)}hasSelection(){return this._core.hasSelection()}select(s,e,t){this._verifyIntegers(s,e,t),this._core.select(s,e,t)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(s,e){this._verifyIntegers(s,e),this._core.selectLines(s,e)}dispose(){super.dispose()}scrollLines(s){this._verifyIntegers(s),this._core.scrollLines(s)}scrollPages(s){this._verifyIntegers(s),this._core.scrollPages(s)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(s){this._verifyIntegers(s),this._core.scrollToLine(s)}clear(){this._core.clear()}write(s,e){this._core.write(s,e)}writeln(s,e){this._core.write(s),this._core.write(`\r
9
- `,e)}paste(s){this._core.paste(s)}refresh(s,e){this._verifyIntegers(s,e),this._core.refresh(s,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(s){this._addonManager.loadAddon(this,s)}static get strings(){return r}_verifyIntegers(...s){for(const e of s)if(e===1/0||isNaN(e)||e%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...s){for(const e of s)if(e&&(e===1/0||isNaN(e)||e%1!=0||e<0))throw new Error("This API only accepts positive integers")}}M.Terminal=c})(),J})()))})(ge)),ge.exports}var xe=Re(),me={exports:{}},be;function Ae(){return be||(be=1,(function(se,ie){(function(Z,X){se.exports=X()})(self,(()=>(()=>{var Z={};return(()=>{var X=Z;Object.defineProperty(X,"__esModule",{value:!0}),X.FitAddon=void 0,X.FitAddon=class{activate(K){this._terminal=K}dispose(){}fit(){const K=this.proposeDimensions();if(!K||!this._terminal||isNaN(K.cols)||isNaN(K.rows))return;const J=this._terminal._core;this._terminal.rows===K.rows&&this._terminal.cols===K.cols||(J._renderService.clear(),this._terminal.resize(K.cols,K.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const K=this._terminal._core,J=K._renderService.dimensions;if(J.css.cell.width===0||J.css.cell.height===0)return;const M=this._terminal.options.scrollback===0?0:K.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(r.getPropertyValue("height")),l=Math.max(0,parseInt(r.getPropertyValue("width"))),f=window.getComputedStyle(this._terminal.element),o=a-(parseInt(f.getPropertyValue("padding-top"))+parseInt(f.getPropertyValue("padding-bottom"))),d=l-(parseInt(f.getPropertyValue("padding-right"))+parseInt(f.getPropertyValue("padding-left")))-M;return{cols:Math.max(2,Math.floor(d/J.css.cell.width)),rows:Math.max(1,Math.floor(o/J.css.cell.height))}}}})(),Z})()))})(me)),me.exports}var Be=Ae();const Te=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/terminal`,Se=6;function we(){var r;const se=getComputedStyle(document.documentElement),ie=(a,l)=>se.getPropertyValue(a).trim()||l,Z=ie("--color-bg","#0b0e14"),X=ie("--color-fg","#cdd6f4"),K=ie("--color-accent-primary",X),J=document.documentElement.dataset.theme;return{theme:(J?(r=Le[J])==null?void 0:r.terminal:void 0)??{background:Z,foreground:X,cursor:K,cursorAccent:Z},fontFamily:ie("--font-code","'JetBrains Mono', monospace")}}function Oe({sessionId:se,onCommandLine:ie,onExit:Z,onError:X,prefill:K,prefillNonce:J,onPrefillConsumed:M,onSelectionChange:r}){const a=ee.useRef(null),l=ee.useRef(null),f=ee.useRef(null),o=ke(t=>{var n;return(n=t.settings)==null?void 0:n.themeId}),d=ee.useRef({onCommandLine:ie,onExit:Z,onError:X,onPrefillConsumed:M,onSelectionChange:r});d.current={onCommandLine:ie,onExit:Z,onError:X,onPrefillConsumed:M,onSelectionChange:r};const v=ee.useRef(null),g=ee.useRef(!1),c=ee.useRef(null),[i,s]=ee.useState({kind:"connecting",text:"Connecting…"}),e=t=>{var u,_;const n=v.current;n&&n.readyState===WebSocket.OPEN&&g.current?(n.send(JSON.stringify({type:"prefill",data:t})),(_=(u=d.current).onPrefillConsumed)==null||_.call(u)):c.current=t};return ee.useEffect(()=>{K!=null&&K.length>0&&e(K)},[K,J]),ee.useEffect(()=>{const t=a.current;if(!t)return;let n=!1,u=0,_=null;const p=we(),h=new xe.Terminal({fontFamily:p.fontFamily,fontSize:13,cursorBlink:!0,theme:p.theme,scrollback:5e3}),S=new Be.FitAddon;h.loadAddon(S),l.current=h,f.current=S;const E=()=>{if(!n&&!(t.clientWidth<=0||t.clientHeight<=0))try{S.fit()}catch{}};let k="";const D=()=>{E();const m=v.current;m&&m.readyState===WebSocket.OPEN&&m.send(JSON.stringify({type:"resize",cols:h.cols,rows:h.rows}))},w=()=>{n||(u+=1,s({kind:"connecting",text:u>1?`Reconnecting… (attempt ${u}/${Se})`:"Connecting…"}),De().then(()=>{n||x()}))},x=()=>{const m=new WebSocket(Te);v.current=m,g.current=!1,m.onopen=()=>{var y,L;if(n)return;m.send(JSON.stringify({type:"attach",sessionId:se})),g.current=!0,D();const b=c.current;b!=null&&(c.current=null,m.send(JSON.stringify({type:"prefill",data:b})),(L=(y=d.current).onPrefillConsumed)==null||L.call(y))},m.onmessage=b=>{var L,T,H,U;let y;try{y=JSON.parse(b.data)}catch{return}if(y.type==="data"&&typeof y.bytes=="string"){s(null);try{h.write(y.bytes)}catch{}}else y.type==="exit"?(T=(L=d.current).onExit)==null||T.call(L,y.code??0):y.type==="error"&&(s({kind:"error",text:y.message??"terminal error"}),(U=(H=d.current).onError)==null||U.call(H,y.message??"terminal error"))},m.onerror=()=>{},m.onclose=()=>{if(!n)if(v.current=null,u<Se){const b=Math.min(2e3,250*u);s({kind:"connecting",text:`Connection lost: retrying in ${(b/1e3).toFixed(1)}s…`}),_=setTimeout(w,b)}else s({kind:"error",text:`Could not connect to the terminal channel after ${Se} attempts. The /terminal WebSocket isn't reaching the server: if you're on the Vite dev server, restart it so the WS proxy reloads.`})}},B=h.onData(m=>{var y,L;const b=v.current;b&&b.readyState===WebSocket.OPEN&&b.send(JSON.stringify({type:"input",data:m}));for(const T of m)if(T==="\r"||T===`
9
+ `,e)}paste(s){this._core.paste(s)}refresh(s,e){this._verifyIntegers(s,e),this._core.refresh(s,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(s){this._addonManager.loadAddon(this,s)}static get strings(){return r}_verifyIntegers(...s){for(const e of s)if(e===1/0||isNaN(e)||e%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...s){for(const e of s)if(e&&(e===1/0||isNaN(e)||e%1!=0||e<0))throw new Error("This API only accepts positive integers")}}M.Terminal=c})(),J})()))})(ge)),ge.exports}var xe=Re(),me={exports:{}},be;function Ae(){return be||(be=1,(function(se,ie){(function(Z,X){se.exports=X()})(self,(()=>(()=>{var Z={};return(()=>{var X=Z;Object.defineProperty(X,"__esModule",{value:!0}),X.FitAddon=void 0,X.FitAddon=class{activate(K){this._terminal=K}dispose(){}fit(){const K=this.proposeDimensions();if(!K||!this._terminal||isNaN(K.cols)||isNaN(K.rows))return;const J=this._terminal._core;this._terminal.rows===K.rows&&this._terminal.cols===K.cols||(J._renderService.clear(),this._terminal.resize(K.cols,K.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const K=this._terminal._core,J=K._renderService.dimensions;if(J.css.cell.width===0||J.css.cell.height===0)return;const M=this._terminal.options.scrollback===0?0:K.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(r.getPropertyValue("height")),l=Math.max(0,parseInt(r.getPropertyValue("width"))),f=window.getComputedStyle(this._terminal.element),o=a-(parseInt(f.getPropertyValue("padding-top"))+parseInt(f.getPropertyValue("padding-bottom"))),d=l-(parseInt(f.getPropertyValue("padding-right"))+parseInt(f.getPropertyValue("padding-left")))-M;return{cols:Math.max(2,Math.floor(d/J.css.cell.width)),rows:Math.max(1,Math.floor(o/J.css.cell.height))}}}})(),Z})()))})(me)),me.exports}var Be=Ae();const Te=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/terminal`,Se=6;function we(){var r;const se=getComputedStyle(document.documentElement),ie=(a,l)=>se.getPropertyValue(a).trim()||l,Z=ie("--color-bg","#0b0e14"),X=ie("--color-fg","#cdd6f4"),K=ie("--color-accent-primary",X),J=document.documentElement.dataset.theme;return{theme:(J?(r=Le[J])==null?void 0:r.terminal:void 0)??{background:Z,foreground:X,cursor:K,cursorAccent:Z},fontFamily:ie("--font-code","'JetBrains Mono', monospace")}}function Oe({sessionId:se,onCommandLine:ie,onExit:Z,onError:X,prefill:K,prefillNonce:J,onPrefillConsumed:M,onSelectionChange:r}){const a=ee.useRef(null),l=ee.useRef(null),f=ee.useRef(null),o=ke(t=>{var n;return(n=t.settings)==null?void 0:n.themeId}),d=ee.useRef({onCommandLine:ie,onExit:Z,onError:X,onPrefillConsumed:M,onSelectionChange:r});d.current={onCommandLine:ie,onExit:Z,onError:X,onPrefillConsumed:M,onSelectionChange:r};const v=ee.useRef(null),g=ee.useRef(!1),c=ee.useRef(null),[i,s]=ee.useState({kind:"connecting",text:"Connecting…"}),e=t=>{var u,_;const n=v.current;n&&n.readyState===WebSocket.OPEN&&g.current?(n.send(JSON.stringify({type:"prefill",data:t})),(_=(u=d.current).onPrefillConsumed)==null||_.call(u)):c.current=t};return ee.useEffect(()=>{K!=null&&K.length>0&&e(K)},[K,J]),ee.useEffect(()=>{const t=a.current;if(!t)return;let n=!1,u=0,_=null;const p=we(),h=new xe.Terminal({fontFamily:p.fontFamily,fontSize:13,cursorBlink:!0,theme:p.theme,scrollback:5e3}),S=new Be.FitAddon;h.loadAddon(S),l.current=h,f.current=S;const E=()=>{if(!n&&!(t.clientWidth<=0||t.clientHeight<=0))try{S.fit()}catch{}};let k="";const D=()=>{E();const m=v.current;m&&m.readyState===WebSocket.OPEN&&m.send(JSON.stringify({type:"resize",cols:h.cols,rows:h.rows}))},w=()=>{n||(u+=1,s({kind:"connecting",text:u>1?`Reconnecting… (attempt ${u}/${Se})`:"Connecting…"}),De().then(()=>{n||x()}))},x=()=>{const m=new WebSocket(Te);v.current=m,g.current=!1,m.onopen=()=>{var y,L;if(n)return;h.reset(),m.send(JSON.stringify({type:"attach",sessionId:se})),g.current=!0,D();const b=c.current;b!=null&&(c.current=null,m.send(JSON.stringify({type:"prefill",data:b})),(L=(y=d.current).onPrefillConsumed)==null||L.call(y))},m.onmessage=b=>{var L,T,H,U;let y;try{y=JSON.parse(b.data)}catch{return}if(y.type==="data"&&typeof y.bytes=="string"){s(null);try{h.write(y.bytes)}catch{}}else y.type==="exit"?(T=(L=d.current).onExit)==null||T.call(L,y.code??0):y.type==="error"&&(s({kind:"error",text:y.message??"terminal error"}),(U=(H=d.current).onError)==null||U.call(H,y.message??"terminal error"))},m.onerror=()=>{},m.onclose=()=>{if(!n)if(v.current=null,u<Se){const b=Math.min(2e3,250*u);s({kind:"connecting",text:`Connection lost: retrying in ${(b/1e3).toFixed(1)}s…`}),_=setTimeout(w,b)}else s({kind:"error",text:`Could not connect to the terminal channel after ${Se} attempts. The /terminal WebSocket isn't reaching the server: if you're on the Vite dev server, restart it so the WS proxy reloads.`})}},B=h.onData(m=>{var y,L;const b=v.current;b&&b.readyState===WebSocket.OPEN&&b.send(JSON.stringify({type:"input",data:m}));for(const T of m)if(T==="\r"||T===`
10
10
  `){const H=k.trim();H.length>0&&((L=(y=d.current).onCommandLine)==null||L.call(y,H)),k=""}else T===""?k=k.slice(0,-1):T>=" "&&(k+=T)}),P=h.onSelectionChange(()=>{var m,b;(b=(m=d.current).onSelectionChange)==null||b.call(m,h.hasSelection()?h.getSelection():"")});let F=!1;const I=new ResizeObserver(()=>{if(!n){if(!F&&t.clientWidth>0&&t.clientHeight>0){F=!0,h.open(t),E(),setTimeout(()=>{if(!n)try{h.focus()}catch{}},0),w();return}F&&D()}});return I.observe(t),requestAnimationFrame(()=>{n||F||t.clientWidth>0&&t.clientHeight>0&&(F=!0,h.open(t),E(),setTimeout(()=>{if(!n)try{h.focus()}catch{}},0),w())}),()=>{n=!0,_&&clearTimeout(_),I.disconnect(),B.dispose(),P.dispose(),g.current=!1;const m=v.current;v.current=null;try{m==null||m.close()}catch{}try{h.dispose()}catch{}l.current=null,f.current=null}},[se]),ee.useEffect(()=>{var u;const t=l.current;if(!t)return;const n=we();if(t.options.theme=n.theme,t.options.fontFamily!==n.fontFamily){t.options.fontFamily=n.fontFamily;try{(u=f.current)==null||u.fit()}catch{}}try{t.refresh(0,Math.max(0,t.rows-1))}catch{}},[o]),pe.jsxs("div",{style:{position:"relative",flex:1,minHeight:0,width:"100%",height:"100%"},children:[pe.jsx("div",{ref:a,style:{position:"absolute",inset:0,background:"var(--color-bg)",padding:"4px"}}),i&&pe.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",textAlign:"center",pointerEvents:"none",background:i.kind==="error"?"rgba(11,14,20,0.86)":"transparent",color:i.kind==="error"?"var(--color-danger, #e06c75)":"var(--color-fg-muted, #8a93a6)",fontFamily:"var(--font-code, monospace)",fontSize:"12px",lineHeight:1.5},children:i.text})]})}export{Oe as XtermView};