From 60c4416d0ffd68db406c37e7099f5f59487ffc11 Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Fri, 1 Aug 2025 22:37:28 +0800 Subject: [PATCH 1/5] feat(jmanus): move tool parameter and description to resources --- .../prompt/model/enums/PromptEnum.java | 86 +++++- .../prompt/model/enums/PromptType.java | 2 +- .../manus/planning/PlanningFactory.java | 25 +- .../ai/example/manus/tool/DocLoaderTool.java | 48 ++-- .../ai/example/manus/tool/TerminateTool.java | 18 +- .../example/manus/tool/ToolPromptManager.java | 140 ++++++++++ .../ai/example/manus/tool/bash/Bash.java | 40 +-- .../manus/tool/browser/BrowserUseTool.java | 246 +----------------- .../manus/tool/code/PythonExecute.java | 43 +-- .../ai/example/manus/tool/cron/CronTool.java | 41 +-- .../manus/tool/database/DatabaseUseTool.java | 86 +----- .../tool/innerStorage/FileMergeTool.java | 44 +--- .../innerStorage/InnerStorageContentTool.java | 88 +------ .../tool/textOperator/TextFileOperator.java | 143 +--------- .../prompts/en/descriptions.properties | 30 +++ .../prompts/en/tool/bash-tool-description.txt | 4 + .../prompts/en/tool/bash-tool-parameters.txt | 10 + .../en/tool/browser-use-tool-description.txt | 20 ++ .../en/tool/browser-use-tool-parameters.txt | 218 ++++++++++++++++ .../en/tool/cron-tool-tool-description.txt | 1 + .../en/tool/cron-tool-tool-parameters.txt | 18 ++ .../en/tool/data-split-tool-description.txt | 9 + .../en/tool/data-split-tool-parameters.txt | 18 ++ .../en/tool/database-use-tool-description.txt | 6 + .../en/tool/database-use-tool-parameters.txt | 53 ++++ .../en/tool/doc-loader-tool-description.txt | 3 + .../en/tool/doc-loader-tool-parameters.txt | 14 + .../en/tool/file-merge-tool-description.txt | 2 + .../en/tool/file-merge-tool-parameters.txt | 20 ++ .../en/tool/finalize-tool-description.txt | 9 + .../en/tool/finalize-tool-parameters.txt | 15 ++ ...-storage-content-tool-tool-description.txt | 6 + ...r-storage-content-tool-tool-parameters.txt | 58 +++++ .../en/tool/map-output-tool-description.txt | 10 + .../en/tool/map-output-tool-parameters.txt | 23 ++ .../tool/python-execute-tool-description.txt | 1 + .../tool/python-execute-tool-parameters.txt | 10 + .../reduce-operation-tool-description.txt | 11 + .../tool/reduce-operation-tool-parameters.txt | 19 ++ .../en/tool/terminate-tool-description.txt | 2 + .../en/tool/terminate-tool-parameters.txt | 24 ++ .../textfileoperator-tool-description.txt | 18 ++ .../tool/textfileoperator-tool-parameters.txt | 84 ++++++ .../prompts/zh/descriptions.properties | 30 +++ .../prompts/zh/tool/bash-tool-description.txt | 4 + .../prompts/zh/tool/bash-tool-parameters.txt | 10 + .../zh/tool/browser-use-tool-description.txt | 20 ++ .../zh/tool/browser-use-tool-parameters.txt | 218 ++++++++++++++++ .../zh/tool/cron-tool-tool-description.txt | 1 + .../zh/tool/cron-tool-tool-parameters.txt | 18 ++ .../zh/tool/data-split-tool-description.txt | 9 + .../zh/tool/data-split-tool-parameters.txt | 18 ++ .../zh/tool/database-use-tool-description.txt | 6 + .../zh/tool/database-use-tool-parameters.txt | 53 ++++ .../zh/tool/doc-loader-tool-description.txt | 3 + .../zh/tool/doc-loader-tool-parameters.txt | 14 + .../zh/tool/file-merge-tool-description.txt | 2 + .../zh/tool/file-merge-tool-parameters.txt | 20 ++ .../zh/tool/finalize-tool-description.txt | 9 + .../zh/tool/finalize-tool-parameters.txt | 15 ++ ...-storage-content-tool-tool-description.txt | 6 + ...r-storage-content-tool-tool-parameters.txt | 58 +++++ .../zh/tool/map-output-tool-description.txt | 10 + .../zh/tool/map-output-tool-parameters.txt | 23 ++ .../tool/python-execute-tool-description.txt | 1 + .../tool/python-execute-tool-parameters.txt | 10 + .../reduce-operation-tool-description.txt | 11 + .../tool/reduce-operation-tool-parameters.txt | 19 ++ .../zh/tool/terminate-tool-description.txt | 2 + .../zh/tool/terminate-tool-parameters.txt | 24 ++ .../textfileoperator-tool-description.txt | 18 ++ .../tool/textfileoperator-tool-parameters.txt | 84 ++++++ 72 files changed, 1768 insertions(+), 714 deletions(-) create mode 100644 spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/ToolPromptManager.java create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/bash-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/bash-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/browser-use-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/browser-use-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/cron-tool-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/cron-tool-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/data-split-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/data-split-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/database-use-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/database-use-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/doc-loader-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/doc-loader-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/file-merge-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/file-merge-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/finalize-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/finalize-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/inner-storage-content-tool-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/inner-storage-content-tool-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/map-output-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/map-output-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/python-execute-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/python-execute-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/reduce-operation-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/reduce-operation-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/terminate-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/terminate-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/textfileoperator-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/textfileoperator-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/bash-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/bash-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/browser-use-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/browser-use-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/cron-tool-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/cron-tool-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/data-split-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/data-split-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/database-use-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/database-use-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/doc-loader-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/doc-loader-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/file-merge-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/file-merge-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/finalize-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/finalize-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/inner-storage-content-tool-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/inner-storage-content-tool-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/map-output-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/map-output-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/python-execute-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/python-execute-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/reduce-operation-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/reduce-operation-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/terminate-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/terminate-tool-parameters.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/textfileoperator-tool-description.txt create mode 100644 spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/textfileoperator-tool-parameters.txt diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/dynamic/prompt/model/enums/PromptEnum.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/dynamic/prompt/model/enums/PromptEnum.java index 888a90f576..5340853e77 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/dynamic/prompt/model/enums/PromptEnum.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/dynamic/prompt/model/enums/PromptEnum.java @@ -43,7 +43,91 @@ public enum PromptEnum { FORM_INPUT_TOOL_DESCRIPTION("FORM_INPUT_TOOL_DESCRIPTION", MessageType.SYSTEM, PromptType.AGENT, true, "tool/form-input-tool-description.txt"), FORM_INPUT_TOOL_PARAMETERS("FORM_INPUT_TOOL_PARAMETERS", MessageType.SYSTEM, PromptType.AGENT, true, - "tool/form-input-tool-parameters.txt"); + "tool/form-input-tool-parameters.txt"), + + // Bash Tool + BASH_TOOL_DESCRIPTION("BASH_TOOL_DESCRIPTION", MessageType.SYSTEM, PromptType.TOOL_DESCRIPTION, true, + "tool/bash-tool-description.txt"), + BASH_TOOL_PARAMETERS("BASH_TOOL_PARAMETERS", MessageType.SYSTEM, PromptType.TOOL_PARAMETER, true, + "tool/bash-tool-parameters.txt"), + + // Text File Operator Tool + TEXTFILEOPERATOR_TOOL_DESCRIPTION("TEXTFILEOPERATOR_TOOL_DESCRIPTION", MessageType.SYSTEM, + PromptType.TOOL_DESCRIPTION, true, "tool/textfileoperator-tool-description.txt"), + TEXTFILEOPERATOR_TOOL_PARAMETERS("TEXTFILEOPERATOR_TOOL_PARAMETERS", MessageType.SYSTEM, PromptType.TOOL_PARAMETER, + true, "tool/textfileoperator-tool-parameters.txt"), + + // Browser Use Tool + BROWSER_USE_TOOL_DESCRIPTION("BROWSER_USE_TOOL_DESCRIPTION", MessageType.SYSTEM, PromptType.TOOL_DESCRIPTION, true, + "tool/browser-use-tool-description.txt"), + BROWSER_USE_TOOL_PARAMETERS("BROWSER_USE_TOOL_PARAMETERS", MessageType.SYSTEM, PromptType.TOOL_PARAMETER, true, + "tool/browser-use-tool-parameters.txt"), + + // Python Execute Tool + PYTHON_EXECUTE_TOOL_DESCRIPTION("PYTHON_EXECUTE_TOOL_DESCRIPTION", MessageType.SYSTEM, PromptType.TOOL_DESCRIPTION, + true, "tool/python-execute-tool-description.txt"), + PYTHON_EXECUTE_TOOL_PARAMETERS("PYTHON_EXECUTE_TOOL_PARAMETERS", MessageType.SYSTEM, PromptType.TOOL_PARAMETER, + true, "tool/python-execute-tool-parameters.txt"), + + // Database Use Tool + DATABASE_USE_TOOL_DESCRIPTION("DATABASE_USE_TOOL_DESCRIPTION", MessageType.SYSTEM, PromptType.TOOL_DESCRIPTION, + true, "tool/database-use-tool-description.txt"), + DATABASE_USE_TOOL_PARAMETERS("DATABASE_USE_TOOL_PARAMETERS", MessageType.SYSTEM, PromptType.TOOL_PARAMETER, true, + "tool/database-use-tool-parameters.txt"), + + // Cron Tool + CRON_TOOL_TOOL_DESCRIPTION("CRON_TOOL_TOOL_DESCRIPTION", MessageType.SYSTEM, PromptType.TOOL_DESCRIPTION, true, + "tool/cron-tool-tool-description.txt"), + CRON_TOOL_TOOL_PARAMETERS("CRON_TOOL_TOOL_PARAMETERS", MessageType.SYSTEM, PromptType.TOOL_PARAMETER, true, + "tool/cron-tool-tool-parameters.txt"), + + // Inner Storage Content Tool + INNER_STORAGE_CONTENT_TOOL_TOOL_DESCRIPTION("INNER_STORAGE_CONTENT_TOOL_TOOL_DESCRIPTION", MessageType.SYSTEM, + PromptType.TOOL_DESCRIPTION, true, "tool/inner-storage-content-tool-tool-description.txt"), + INNER_STORAGE_CONTENT_TOOL_TOOL_PARAMETERS("INNER_STORAGE_CONTENT_TOOL_TOOL_PARAMETERS", MessageType.SYSTEM, + PromptType.TOOL_PARAMETER, true, "tool/inner-storage-content-tool-tool-parameters.txt"), + + // Doc Loader Tool + DOC_LOADER_TOOL_DESCRIPTION("DOC_LOADER_TOOL_DESCRIPTION", MessageType.SYSTEM, PromptType.TOOL_DESCRIPTION, true, + "tool/doc-loader-tool-description.txt"), + DOC_LOADER_TOOL_PARAMETERS("DOC_LOADER_TOOL_PARAMETERS", MessageType.SYSTEM, PromptType.TOOL_PARAMETER, true, + "tool/doc-loader-tool-parameters.txt"), + + // File Merge Tool + FILE_MERGE_TOOL_DESCRIPTION("FILE_MERGE_TOOL_DESCRIPTION", MessageType.SYSTEM, PromptType.TOOL_DESCRIPTION, true, + "tool/file-merge-tool-description.txt"), + FILE_MERGE_TOOL_PARAMETERS("FILE_MERGE_TOOL_PARAMETERS", MessageType.SYSTEM, PromptType.TOOL_PARAMETER, true, + "tool/file-merge-tool-parameters.txt"), + + // Data Split Tool + DATA_SPLIT_TOOL_DESCRIPTION("DATA_SPLIT_TOOL_DESCRIPTION", MessageType.SYSTEM, PromptType.TOOL_DESCRIPTION, true, + "tool/data-split-tool-description.txt"), + DATA_SPLIT_TOOL_PARAMETERS("DATA_SPLIT_TOOL_PARAMETERS", MessageType.SYSTEM, PromptType.TOOL_PARAMETER, true, + "tool/data-split-tool-parameters.txt"), + + // Map Output Tool + MAP_OUTPUT_TOOL_DESCRIPTION("MAP_OUTPUT_TOOL_DESCRIPTION", MessageType.SYSTEM, PromptType.TOOL_DESCRIPTION, true, + "tool/map-output-tool-description.txt"), + MAP_OUTPUT_TOOL_PARAMETERS("MAP_OUTPUT_TOOL_PARAMETERS", MessageType.SYSTEM, PromptType.TOOL_PARAMETER, true, + "tool/map-output-tool-parameters.txt"), + + // Reduce Operation Tool + REDUCE_OPERATION_TOOL_DESCRIPTION("REDUCE_OPERATION_TOOL_DESCRIPTION", MessageType.SYSTEM, + PromptType.TOOL_DESCRIPTION, true, "tool/reduce-operation-tool-description.txt"), + REDUCE_OPERATION_TOOL_PARAMETERS("REDUCE_OPERATION_TOOL_PARAMETERS", MessageType.SYSTEM, PromptType.TOOL_PARAMETER, + true, "tool/reduce-operation-tool-parameters.txt"), + + // Finalize Tool + FINALIZE_TOOL_DESCRIPTION("FINALIZE_TOOL_DESCRIPTION", MessageType.SYSTEM, PromptType.TOOL_DESCRIPTION, true, + "tool/finalize-tool-description.txt"), + FINALIZE_TOOL_PARAMETERS("FINALIZE_TOOL_PARAMETERS", MessageType.SYSTEM, PromptType.TOOL_PARAMETER, true, + "tool/finalize-tool-parameters.txt"), + + // Terminate Tool + TERMINATE_TOOL_DESCRIPTION("TERMINATE_TOOL_DESCRIPTION", MessageType.SYSTEM, PromptType.TOOL_DESCRIPTION, true, + "tool/terminate-tool-description.txt"), + TERMINATE_TOOL_PARAMETERS("TERMINATE_TOOL_PARAMETERS", MessageType.SYSTEM, PromptType.TOOL_PARAMETER, true, + "tool/terminate-tool-parameters.txt"); private String promptName; diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/dynamic/prompt/model/enums/PromptType.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/dynamic/prompt/model/enums/PromptType.java index 5f9f342006..99e008ebcd 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/dynamic/prompt/model/enums/PromptType.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/dynamic/prompt/model/enums/PromptType.java @@ -17,6 +17,6 @@ public enum PromptType { - LLM, PLANNING, AGENT + LLM, PLANNING, AGENT, TOOL_DESCRIPTION, TOOL_PARAMETER } diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/planning/PlanningFactory.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/planning/PlanningFactory.java index 99a04525b3..334c55d2cd 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/planning/PlanningFactory.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/planning/PlanningFactory.java @@ -22,6 +22,7 @@ import java.util.Map; import java.util.concurrent.TimeUnit; +import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; import org.apache.hc.client5.http.classic.HttpClient; import org.apache.hc.client5.http.config.RequestConfig; import org.apache.hc.client5.http.impl.classic.HttpClients; @@ -142,6 +143,9 @@ public class PlanningFactory implements IPlanningFactory { @Autowired private StreamingResponseHandler streamingResponseHandler; + @Autowired + private ToolPromptManager toolPromptManager; + @Autowired @Lazy private CronService cronService; @@ -214,15 +218,18 @@ public Map toolCallbackMap(String planId, String ro return toolCallbackMap; } // Add all tool definitions - toolDefinitions.add(BrowserUseTool.getInstance(chromeDriverService, innerStorageService, objectMapper)); - toolDefinitions.add(DatabaseUseTool.getInstance(dataSourceService, objectMapper)); - toolDefinitions.add(new TerminateTool(planId, terminateColumns)); - toolDefinitions.add(new Bash(unifiedDirectoryManager, objectMapper)); - toolDefinitions.add(new DocLoaderTool()); - toolDefinitions.add(new TextFileOperator(textFileService, innerStorageService, objectMapper)); + toolDefinitions + .add(BrowserUseTool.getInstance(chromeDriverService, innerStorageService, objectMapper, toolPromptManager)); + toolDefinitions.add(DatabaseUseTool.getInstance(dataSourceService, objectMapper, toolPromptManager)); + toolDefinitions.add(new TerminateTool(planId, terminateColumns, toolPromptManager)); + toolDefinitions.add(new Bash(unifiedDirectoryManager, objectMapper, toolPromptManager)); + toolDefinitions.add(new DocLoaderTool(toolPromptManager)); + toolDefinitions + .add(new TextFileOperator(textFileService, innerStorageService, objectMapper, toolPromptManager)); // toolDefinitions.add(new InnerStorageTool(unifiedDirectoryManager)); - toolDefinitions.add(new InnerStorageContentTool(unifiedDirectoryManager, summaryWorkflow, recorder)); - toolDefinitions.add(new FileMergeTool(unifiedDirectoryManager)); + toolDefinitions + .add(new InnerStorageContentTool(unifiedDirectoryManager, summaryWorkflow, recorder, toolPromptManager)); + toolDefinitions.add(new FileMergeTool(unifiedDirectoryManager, toolPromptManager)); // toolDefinitions.add(new GoogleSearch()); // toolDefinitions.add(new PythonExecute()); toolDefinitions.add(new FormInputTool(objectMapper, promptService)); @@ -233,7 +240,7 @@ public Map toolCallbackMap(String planId, String ro toolDefinitions.add(new ReduceOperationTool(planId, manusProperties, sharedStateManager, unifiedDirectoryManager, terminateColumns)); toolDefinitions.add(new FinalizeTool(planId, manusProperties, sharedStateManager, unifiedDirectoryManager)); - toolDefinitions.add(new CronTool(cronService, objectMapper)); + toolDefinitions.add(new CronTool(cronService, objectMapper, toolPromptManager)); List functionCallbacks = mcpService.getFunctionCallbacks(planId); for (McpServiceEntity toolCallback : functionCallbacks) { diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/DocLoaderTool.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/DocLoaderTool.java index 00912c1ecc..d68f82140f 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/DocLoaderTool.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/DocLoaderTool.java @@ -16,6 +16,7 @@ package com.alibaba.cloud.ai.example.manus.tool; import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; +import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; import org.apache.commons.lang3.StringUtils; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.text.PDFTextStripper; @@ -68,33 +69,14 @@ public void setFilePath(String filePath) { } - private static String PARAMETERS = """ - { - "type": "object", - "properties": { - "file_type": { - "type": "string", - "description": "(required) File type, only support pdf file." - }, - "file_path": { - "type": "string", - "description": "(required) Get the absolute path of the file from the user request." - } - }, - "required": ["file_type","file_path"] - } - """; - private static final String name = "doc_loader"; - private static final String description = """ - Get the content information of a local file at a specified path. - Use this tool when you want to get some related information asked by the user. - This tool accepts the file path and gets the related information content. - """; + private final ToolPromptManager toolPromptManager; - public static OpenAiApi.FunctionTool getToolDefinition() { - OpenAiApi.FunctionTool.Function function = new OpenAiApi.FunctionTool.Function(description, name, PARAMETERS); + public OpenAiApi.FunctionTool getToolDefinition() { + String description = getDescription(); + String parameters = getParameters(); + OpenAiApi.FunctionTool.Function function = new OpenAiApi.FunctionTool.Function(description, name, parameters); OpenAiApi.FunctionTool functionTool = new OpenAiApi.FunctionTool(function); return functionTool; } @@ -102,17 +84,21 @@ public static OpenAiApi.FunctionTool getToolDefinition() { /** * Get FunctionToolCallback for Spring AI */ - public static FunctionToolCallback getFunctionToolCallback() { + public static FunctionToolCallback getFunctionToolCallback( + ToolPromptManager toolPromptManager) { return FunctionToolCallback .builder(name, - (DocLoaderInput input, org.springframework.ai.chat.model.ToolContext context) -> new DocLoaderTool() - .run(input)) - .description(description) + (DocLoaderInput input, + org.springframework.ai.chat.model.ToolContext context) -> new DocLoaderTool( + toolPromptManager) + .run(input)) + .description(toolPromptManager.getToolDescription("doc_loader")) .inputType(DocLoaderInput.class) .build(); } - public DocLoaderTool() { + public DocLoaderTool(ToolPromptManager toolPromptManager) { + this.toolPromptManager = toolPromptManager; } private String lastFilePath = ""; @@ -161,12 +147,12 @@ public String getName() { @Override public String getDescription() { - return description; + return toolPromptManager.getToolDescription("doc_loader"); } @Override public String getParameters() { - return PARAMETERS; + return toolPromptManager.getToolParameters("doc_loader"); } @Override diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/TerminateTool.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/TerminateTool.java index cd502e9d88..5ea4d1da40 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/TerminateTool.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/TerminateTool.java @@ -16,6 +16,7 @@ package com.alibaba.cloud.ai.example.manus.tool; import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; +import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,25 +33,21 @@ public class TerminateTool extends AbstractBaseTool> impleme private final List columns; + private final ToolPromptManager toolPromptManager; + private String lastTerminationMessage = ""; private boolean isTerminated = false; private String terminationTimestamp = ""; - public static OpenAiApi.FunctionTool getToolDefinition(List columns) { + public static OpenAiApi.FunctionTool getToolDefinition(List columns, ToolPromptManager toolPromptManager) { String parameters = generateParametersJson(columns); - String description = getDescriptions(columns); + String description = toolPromptManager.getToolDescription("terminate"); OpenAiApi.FunctionTool.Function function = new OpenAiApi.FunctionTool.Function(description, name, parameters); return new OpenAiApi.FunctionTool(function); } - private static String getDescriptions(List columns) { - // Simple description to avoid generating overly long content - return "Terminate the current execution step with structured data. " - + "Provide data in JSON format with 'columns' array and 'data' array containing rows of values."; - } - private static String generateParametersJson(List columns) { String template = """ { @@ -94,10 +91,11 @@ public String getCurrentToolStateString() { currentPlanId != null ? currentPlanId : "N/A", columns != null ? String.join(", ", columns) : "N/A"); } - public TerminateTool(String planId, List columns) { + public TerminateTool(String planId, List columns, ToolPromptManager toolPromptManager) { this.currentPlanId = planId; // If columns is null or empty, use "message" as default column this.columns = (columns == null || columns.isEmpty()) ? List.of("message") : columns; + this.toolPromptManager = toolPromptManager; } @Override @@ -143,7 +141,7 @@ public String getName() { @Override public String getDescription() { - return getDescriptions(this.columns); + return toolPromptManager.getToolDescription("terminate"); } @Override diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/ToolPromptManager.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/ToolPromptManager.java new file mode 100644 index 0000000000..6a2ddef6fa --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/ToolPromptManager.java @@ -0,0 +1,140 @@ +/* + * Copyright 2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.alibaba.cloud.ai.example.manus.tool; + +import com.alibaba.cloud.ai.example.manus.dynamic.prompt.service.PromptService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; + +import java.util.Locale; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Tool Prompt Manager that manages tool descriptions and parameters using PromptService + * pattern. Each tool has two prompts: Description and Parameters. Supports real-time + * updates and language-based versioning through prompt management backend. + * + * @author spring-ai-alibaba + */ +@Component +public class ToolPromptManager { + + private static final Logger log = LoggerFactory.getLogger(ToolPromptManager.class); + + private final PromptService promptService; + + public ToolPromptManager(PromptService promptService) { + this.promptService = promptService; + } + + /** + * Get tool description from prompt service + * @param toolName the tool name + * @param args optional arguments for template variables + * @return the tool description + */ + public String getToolDescription(String toolName, Object... args) { + try { + String promptName = buildDescriptionPromptName(toolName); + String template = promptService.getPromptByName(promptName).getPromptContent(); + + if (args != null && args.length > 0) { + return String.format(template, args); + } + return template; + } + catch (Exception e) { + log.warn("Failed to load prompt-based tool description for {}, using fallback", toolName, e); + return getDefaultDescription(toolName); + } + } + + /** + * Get tool parameters from prompt service + * @param toolName the tool name + * @return the tool parameters JSON schema + */ + public String getToolParameters(String toolName) { + try { + String promptName = buildParametersPromptName(toolName); + return promptService.getPromptByName(promptName).getPromptContent(); + } + catch (Exception e) { + log.warn("Failed to load prompt-based tool parameters for {}, using fallback", toolName, e); + return getDefaultParameters(toolName); + } + } + + /** + * Build description prompt name for PromptService + * @param toolName the tool name + * @return the prompt name + */ + private String buildDescriptionPromptName(String toolName) { + return String.format("%s_TOOL_DESCRIPTION", toolName.toUpperCase()); + } + + /** + * Build parameters prompt name for PromptService + * @param toolName the tool name + * @return the prompt name + */ + private String buildParametersPromptName(String toolName) { + return String.format("%s_TOOL_PARAMETERS", toolName.toUpperCase()); + } + + /** + * Get default description when prompt is not found + * @param toolName the tool name + * @return default description + */ + private String getDefaultDescription(String toolName) { + return String.format("Tool: %s", toolName); + } + + /** + * Get default parameters when prompt is not found + * @param toolName the tool name + * @return default parameters + */ + private String getDefaultParameters(String toolName) { + return """ + { + "type": "object", + "properties": {}, + "required": [] + } + """; + } + + /** + * Refresh prompts from PromptService This will trigger PromptService to reload + * prompts from database + */ + public void refreshPrompts() { + try { + promptService.reinitializePrompts(); + log.info("Tool prompts refreshed from PromptService"); + } + catch (Exception e) { + log.error("Failed to refresh tool prompts", e); + } + } + +} diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/bash/Bash.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/bash/Bash.java index 9ec7a10a1d..9031d52148 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/bash/Bash.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/bash/Bash.java @@ -18,6 +18,7 @@ import com.alibaba.cloud.ai.example.manus.tool.AbstractBaseTool; import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; import com.alibaba.cloud.ai.example.manus.tool.filesystem.UnifiedDirectoryManager; +import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; import com.fasterxml.jackson.databind.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -31,6 +32,8 @@ public class Bash extends AbstractBaseTool { private final ObjectMapper objectMapper; + private final ToolPromptManager toolPromptManager; + private static final Logger log = LoggerFactory.getLogger(Bash.class); /** @@ -65,40 +68,13 @@ public void setCommand(String command) { // Add operating system information private static final String osName = System.getProperty("os.name"); - private static String PARAMETERS = """ - { - "type": "object", - "properties": { - "command": { - "type": "string", - "description": "The bash command to execute. Can be empty to view additional logs when previous exit code is `-1`. Can be `ctrl+c` to interrupt the currently running process." - } - }, - "required": ["command"] - } - """; - private final String name = "bash"; - private final String description = String.format( - """ - Execute bash commands in terminal (current OS: %s). - * Long-running commands: For commands that may run indefinitely, they should be run in background with output redirected to file, e.g.: command = `python3 app.py > server.log 2>&1 &`. - * Interactive commands: If bash command returns exit code `-1`, this means the process is not yet complete. Assistant must send a second terminal call with empty `command` (this will retrieve any additional logs), or can send additional text (set `command` to text) to the running process's STDIN, or can send command=`ctrl+c` to interrupt the process. - * Timeout handling: If command execution result shows "Command timed out. Sending SIGINT to the process", assistant should try to re-run the command in background. - - """, - osName); - - public OpenAiApi.FunctionTool getToolDefinition() { - OpenAiApi.FunctionTool.Function function = new OpenAiApi.FunctionTool.Function(description, name, PARAMETERS); - OpenAiApi.FunctionTool functionTool = new OpenAiApi.FunctionTool(function); - return functionTool; - } - - public Bash(UnifiedDirectoryManager unifiedDirectoryManager, ObjectMapper objectMapper) { + public Bash(UnifiedDirectoryManager unifiedDirectoryManager, ObjectMapper objectMapper, + ToolPromptManager toolPromptManager) { this.unifiedDirectoryManager = unifiedDirectoryManager; this.objectMapper = objectMapper; + this.toolPromptManager = toolPromptManager; } private String lastCommand = ""; @@ -137,12 +113,12 @@ public String getName() { @Override public String getDescription() { - return description; + return toolPromptManager.getToolDescription("bash", osName); } @Override public String getParameters() { - return PARAMETERS; + return toolPromptManager.getToolParameters("bash"); } @Override diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/browser/BrowserUseTool.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/browser/BrowserUseTool.java index fda17e13f9..f808000b84 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/browser/BrowserUseTool.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/browser/BrowserUseTool.java @@ -17,6 +17,7 @@ import com.alibaba.cloud.ai.example.manus.config.ManusProperties; import com.alibaba.cloud.ai.example.manus.tool.AbstractBaseTool; +import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; import com.alibaba.cloud.ai.example.manus.tool.browser.actions.BrowserRequestVO; import com.alibaba.cloud.ai.example.manus.tool.browser.actions.ClickByElementAction; import com.alibaba.cloud.ai.example.manus.tool.browser.actions.CloseTabAction; @@ -56,11 +57,14 @@ public class BrowserUseTool extends AbstractBaseTool { private final ObjectMapper objectMapper; + private final ToolPromptManager toolPromptManager; + public BrowserUseTool(ChromeDriverService chromeDriverService, SmartContentSavingService innerStorageService, - ObjectMapper objectMapper) { + ObjectMapper objectMapper, ToolPromptManager toolPromptManager) { this.chromeDriverService = chromeDriverService; this.innerStorageService = innerStorageService; this.objectMapper = objectMapper; + this.toolPromptManager = toolPromptManager; } public DriverWrapper getDriver() { @@ -76,241 +80,13 @@ private Integer getBrowserTimeout() { return timeout != null ? timeout : 30; // Default timeout is 30 seconds } - private final String PARAMETERS = """ - { - "oneOf": [ - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "navigate" - }, - "url": { - "type": "string", - "description": "URL to navigate to" - } - }, - "required": ["action", "url"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "click" - }, - "index": { - "type": "integer", - "description": "Element index to click" - } - }, - "required": ["action", "index"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "input_text" - }, - "index": { - "type": "integer", - "description": "Element index to input text" - }, - "text": { - "type": "string", - "description": "Text to input" - } - }, - "required": ["action", "index", "text"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "key_enter" - }, - "index": { - "type": "integer", - "description": "Element index to press enter" - } - }, - "required": ["action", "index"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "screenshot" - } - }, - "required": ["action"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "get_html" - } - }, - "required": ["action"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "get_text" - } - }, - "required": ["action"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "execute_js" - }, - "script": { - "type": "string", - "description": "JavaScript code to execute" - } - }, - "required": ["action", "script"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "switch_tab" - }, - "tab_id": { - "type": "integer", - "description": "Tab ID to switch to" - } - }, - "required": ["action", "tab_id"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "new_tab" - }, - "url": { - "type": "string", - "description": "URL to open in new tab" - } - }, - "required": ["action", "url"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "close_tab" - } - }, - "required": ["action"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "refresh" - } - }, - "required": ["action"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "get_element_position" - }, - "element_name": { - "type": "string", - "description": "Element name to get position" - } - }, - "required": ["action", "element_name"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "move_to_and_click" - }, - "position_x": { - "type": "integer", - "description": "X coordinate to move to and click" - }, - "position_y": { - "type": "integer", - "description": "Y coordinate to move to and click" - } - }, - "required": ["action", "position_x", "position_y"], - "additionalProperties": false - } - ] - } - """; - private final String name = "browser_use"; - private final String description = """ - Interact with web browser to perform various operations such as navigation, element interaction, content extraction and tab management. Prioritize this tool for search-related tasks. - Supported operations include: - - 'navigate': Visit specific URL - - 'click': Click element by index - - 'input_text': Input text in element - - 'key_enter': Press Enter key - - 'screenshot': Capture screenshot - - 'get_html': Get HTML content of current page - - 'get_text': Get text content of current page - - 'execute_js': Execute JavaScript code - - 'switch_tab': Switch to specific tab - - 'new_tab': Open new tab - - 'close_tab': Close current tab - - 'refresh': Refresh current page - - 'get_element_position': Get element position coordinates (x,y) by keyword - - 'move_to_and_click': Move to specified absolute position (x,y) and click - """; - - public OpenAiApi.FunctionTool getToolDefinition() { - OpenAiApi.FunctionTool.Function function = new OpenAiApi.FunctionTool.Function(description, name, PARAMETERS); - OpenAiApi.FunctionTool functionTool = new OpenAiApi.FunctionTool(function); - return functionTool; - } - public static synchronized BrowserUseTool getInstance(ChromeDriverService chromeDriverService, - SmartContentSavingService innerStorageService, ObjectMapper objectMapper) { - BrowserUseTool instance = new BrowserUseTool(chromeDriverService, innerStorageService, objectMapper); + SmartContentSavingService innerStorageService, ObjectMapper objectMapper, + ToolPromptManager toolPromptManager) { + BrowserUseTool instance = new BrowserUseTool(chromeDriverService, innerStorageService, objectMapper, + toolPromptManager); return instance; } @@ -473,12 +249,12 @@ public String getName() { @Override public String getDescription() { - return description; + return toolPromptManager.getToolDescription("browser_use"); } @Override public String getParameters() { - return PARAMETERS; + return toolPromptManager.getToolParameters("browser_use"); } @Override diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/code/PythonExecute.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/code/PythonExecute.java index 5d6d553d8a..5b63b2a6d4 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/code/PythonExecute.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/code/PythonExecute.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.core.type.TypeReference; import com.alibaba.cloud.ai.example.manus.tool.AbstractBaseTool; +import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,6 +31,8 @@ public class PythonExecute extends AbstractBaseTool { private final ObjectMapper objectMapper; + private final ToolPromptManager toolPromptManager; + private static final Logger log = LoggerFactory.getLogger(PythonExecute.class); /** @@ -58,41 +61,8 @@ public void setCode(String code) { private Boolean arm64 = true; - public static final String LLMMATH_PYTHON_CODE = """ - import sys - import math - import numpy as np - import numexpr as ne - input = '%s' - res = ne.evaluate(input) - print(res) - """; - - private static String PARAMETERS = """ - { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "The Python code to execute." - } - }, - "required": ["code"] - } - """; - private static final String name = "python_execute"; - private static final String description = """ - Executes Python code string. Note: Only print outputs are visible, function return values are not captured. Use print statements to see results. - """; - - public static OpenAiApi.FunctionTool getToolDefinition() { - OpenAiApi.FunctionTool.Function function = new OpenAiApi.FunctionTool.Function(description, name, PARAMETERS); - OpenAiApi.FunctionTool functionTool = new OpenAiApi.FunctionTool(function); - return functionTool; - } - private String lastCode = ""; private String lastExecutionResult = ""; @@ -103,8 +73,9 @@ public static OpenAiApi.FunctionTool getToolDefinition() { private boolean hasError = false; - public PythonExecute(ObjectMapper objectMapper) { + public PythonExecute(ObjectMapper objectMapper, ToolPromptManager toolPromptManager) { this.objectMapper = objectMapper; + this.toolPromptManager = toolPromptManager; } @Override @@ -202,12 +173,12 @@ public String getName() { @Override public String getDescription() { - return description; + return toolPromptManager.getToolDescription("python_execute"); } @Override public String getParameters() { - return PARAMETERS; + return toolPromptManager.getToolParameters("python_execute"); } @Override diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/cron/CronTool.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/cron/CronTool.java index 0ec61c65b1..97dd569327 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/cron/CronTool.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/cron/CronTool.java @@ -17,6 +17,7 @@ import com.alibaba.cloud.ai.example.manus.tool.AbstractBaseTool; import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; +import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; import com.alibaba.cloud.ai.example.manus.dynamic.cron.service.CronService; import com.alibaba.cloud.ai.example.manus.dynamic.cron.vo.CronConfig; import com.fasterxml.jackson.databind.ObjectMapper; @@ -28,13 +29,16 @@ public class CronTool extends AbstractBaseTool { private final ObjectMapper objectMapper; + private final ToolPromptManager toolPromptManager; + private static final Logger log = LoggerFactory.getLogger(CronTool.class); private final CronService cronService; - public CronTool(CronService cronService, ObjectMapper objectMapper) { + public CronTool(CronService cronService, ObjectMapper objectMapper, ToolPromptManager toolPromptManager) { this.cronService = cronService; this.objectMapper = objectMapper; + this.toolPromptManager = toolPromptManager; } public static class CronToolInput { @@ -80,39 +84,8 @@ public void setCronName(String cronName) { } - private static String PARAMETERS = """ - { - "type": "object", - "properties": { - "cronName": { - "type": "string", - "description": "Scheduled task name" - }, - "cronTime": { - "type": "string", - "description": "Cron format task scheduled execution time (6 digits), example: 0 0 0/2 * * ?" - }, - "planDesc": { - "type": "string", - "description": "Task content to execute, cannot contain time-related information" - } - }, - "required": ["cronTime","originTime","planDesc"] - } - """; - private final String name = "cron_tool"; - private final String description = """ - Scheduled task tool that can store scheduled tasks to database. - """; - - public OpenAiApi.FunctionTool getToolDefinition() { - OpenAiApi.FunctionTool.Function function = new OpenAiApi.FunctionTool.Function(description, name, PARAMETERS); - OpenAiApi.FunctionTool functionTool = new OpenAiApi.FunctionTool(function); - return functionTool; - } - @Override public ToolExecuteResult run(CronToolInput input) { try { @@ -146,12 +119,12 @@ public String getName() { @Override public String getDescription() { - return description; + return toolPromptManager.getToolDescription("cron_tool"); } @Override public String getParameters() { - return PARAMETERS; + return toolPromptManager.getToolParameters("cron_tool"); } @Override diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/database/DatabaseUseTool.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/database/DatabaseUseTool.java index 6029973877..24f7722634 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/database/DatabaseUseTool.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/database/DatabaseUseTool.java @@ -22,6 +22,7 @@ import com.alibaba.cloud.ai.example.manus.config.ManusProperties; import com.alibaba.cloud.ai.example.manus.tool.AbstractBaseTool; import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; +import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; import com.alibaba.cloud.ai.example.manus.tool.database.action.ExecuteSqlAction; import com.alibaba.cloud.ai.example.manus.tool.database.action.GetTableNameAction; import com.fasterxml.jackson.databind.ObjectMapper; @@ -41,90 +42,22 @@ public class DatabaseUseTool extends AbstractBaseTool { private final ObjectMapper objectMapper; + private final ToolPromptManager toolPromptManager; + public DatabaseUseTool(ManusProperties manusProperties, DataSourceService dataSourceService, - ObjectMapper objectMapper) { + ObjectMapper objectMapper, ToolPromptManager toolPromptManager) { this.manusProperties = manusProperties; this.dataSourceService = dataSourceService; this.objectMapper = objectMapper; + this.toolPromptManager = toolPromptManager; } public DataSourceService getDataSourceService() { return dataSourceService; } - private final String PARAMETERS = """ - { - "oneOf": [ - { - "type": "object", - "properties": { - "action": { "type": "string", "const": "execute_sql" }, - "query": { "type": "string", "description": "SQL statement to execute" }, - "datasourceName": { "type": "string", "description": "Data source name, optional" } - }, - "required": ["action", "query"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { "type": "string", "const": "get_table_name" }, - "text": { "type": "string", "description": "Chinese table name or table description to search, supports single query only" }, - "datasourceName": { "type": "string", "description": "Data source name, optional" } - }, - "required": ["action", "text"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { "type": "string", "const": "get_table_index" }, - "text": { "type": "string", "description": "Table name to search" }, - "datasourceName": { "type": "string", "description": "Data source name, optional" } - }, - "required": ["action", "text"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { "type": "string", "const": "get_table_meta" }, - "text": { "type": "string", "description": "Fuzzy search table description, leave empty to get all tables" }, - "datasourceName": { "type": "string", "description": "Data source name, optional" } - }, - "required": ["action"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { "type": "string", "const": "get_datasource_info" }, - "datasourceName": { "type": "string", "description": "Data source name, leave empty to get all available data sources" } - }, - "required": ["action"], - "additionalProperties": false - } - ] - } - """; - private final String name = "database_use"; - private final String description = """ - Interact with database, execute SQL, table structure, index, health status and other operations. Supported operations include: - - 'execute_sql': Execute SQL statements - - 'get_table_name': Find table names based on table comments - - 'get_table_index': Get table index information - - 'get_table_meta': Get complete metadata of table structure, fields, indexes - - 'get_datasource_info': Get data source information - """; - - public OpenAiApi.FunctionTool getToolDefinition() { - OpenAiApi.FunctionTool.Function function = new OpenAiApi.FunctionTool.Function(description, name, PARAMETERS); - OpenAiApi.FunctionTool functionTool = new OpenAiApi.FunctionTool(function); - return functionTool; - } - @Override public String getServiceGroup() { return "default-service-group"; @@ -137,12 +70,12 @@ public String getName() { @Override public String getDescription() { - return description; + return toolPromptManager.getToolDescription("database_use"); } @Override public String getParameters() { - return PARAMETERS; + return toolPromptManager.getToolParameters("database_use"); } @Override @@ -260,8 +193,9 @@ public String getCurrentToolStateString() { } } - public static DatabaseUseTool getInstance(DataSourceService dataSourceService, ObjectMapper objectMapper) { - return new DatabaseUseTool(null, dataSourceService, objectMapper); + public static DatabaseUseTool getInstance(DataSourceService dataSourceService, ObjectMapper objectMapper, + ToolPromptManager toolPromptManager) { + return new DatabaseUseTool(null, dataSourceService, objectMapper, toolPromptManager); } } diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/innerStorage/FileMergeTool.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/innerStorage/FileMergeTool.java index 8c87ebd55c..4c6d9406b6 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/innerStorage/FileMergeTool.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/innerStorage/FileMergeTool.java @@ -23,6 +23,7 @@ import com.alibaba.cloud.ai.example.manus.tool.AbstractBaseTool; import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; +import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; import com.alibaba.cloud.ai.example.manus.tool.filesystem.UnifiedDirectoryManager; import org.slf4j.Logger; @@ -81,40 +82,15 @@ public void setTargetFolder(String targetFolder) { private final UnifiedDirectoryManager directoryManager; - public FileMergeTool(UnifiedDirectoryManager directoryManager) { + private final ToolPromptManager toolPromptManager; + + public FileMergeTool(UnifiedDirectoryManager directoryManager, ToolPromptManager toolPromptManager) { this.directoryManager = directoryManager; + this.toolPromptManager = toolPromptManager; } private static final String TOOL_NAME = "file_merge_tool"; - private static final String TOOL_DESCRIPTION = """ - File merge tool for merging single files into specified target folders. - Each call merges one file to the target folder, supports fuzzy filename matching. - """; - - private static final String PARAMETERS = """ - { - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": ["merge_file"], - "description": "Operation type, currently supports merge_file" - }, - "file_name": { - "type": "string", - "description": "Filename to merge (supports fuzzy matching)" - }, - "target_folder": { - "type": "string", - "description": "Target folder path where the file will be copied" - } - }, - "required": ["action", "file_name", "target_folder"], - "additionalProperties": false - } - """; - @Override public String getName() { return TOOL_NAME; @@ -122,12 +98,12 @@ public String getName() { @Override public String getDescription() { - return TOOL_DESCRIPTION; + return toolPromptManager.getToolDescription("file_merge_tool"); } @Override public String getParameters() { - return PARAMETERS; + return toolPromptManager.getToolParameters("file_merge_tool"); } @Override @@ -140,12 +116,6 @@ public String getServiceGroup() { return "default-service-group"; } - public static OpenAiApi.FunctionTool getToolDefinition() { - OpenAiApi.FunctionTool.Function function = new OpenAiApi.FunctionTool.Function(TOOL_DESCRIPTION, TOOL_NAME, - PARAMETERS); - return new OpenAiApi.FunctionTool(function); - } - /** * Execute file merge operation */ diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/innerStorage/InnerStorageContentTool.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/innerStorage/InnerStorageContentTool.java index 2b76437d7f..3a06002491 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/innerStorage/InnerStorageContentTool.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/innerStorage/InnerStorageContentTool.java @@ -23,6 +23,7 @@ import com.alibaba.cloud.ai.example.manus.recorder.PlanExecutionRecorder; import com.alibaba.cloud.ai.example.manus.tool.AbstractBaseTool; import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; +import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; import com.alibaba.cloud.ai.example.manus.tool.filesystem.UnifiedDirectoryManager; import com.alibaba.cloud.ai.example.manus.workflow.SummaryWorkflow; @@ -129,85 +130,18 @@ public void setEndLine(Integer endLine) { private final PlanExecutionRecorder planExecutionRecorder; + private final ToolPromptManager toolPromptManager; + public InnerStorageContentTool(UnifiedDirectoryManager directoryManager, SummaryWorkflow summaryWorkflow, - PlanExecutionRecorder planExecutionRecorder) { + PlanExecutionRecorder planExecutionRecorder, ToolPromptManager toolPromptManager) { this.directoryManager = directoryManager; this.summaryWorkflow = summaryWorkflow; this.planExecutionRecorder = planExecutionRecorder; + this.toolPromptManager = toolPromptManager; } private static final String TOOL_NAME = "inner_storage_content_tool"; - private static final String TOOL_DESCRIPTION = """ - Internal storage content retrieval tool specialized for intelligent content extraction and structured output. - Intelligent content extraction mode: Get detailed content based on file name, **must provide** query_key and columns parameters for intelligent extraction and structured output - - Supports two operation modes: - 1. get_content: Get content from single file (exact filename match or relative path) - 2. get_folder_content: Get content from all files in specified folder - """; - - private static final String PARAMETERS = """ - { - "oneOf": [ - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "get_content", - "description": "Get content from single file" - }, - "file_name": { - "type": "string", - "description": "Filename (with extension) or relative path, supports exact matching" - }, - "query_key": { - "type": "string", - "description": "Related questions or content keywords to extract, must be provided" - }, - "columns": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Column names for return results, used for structured output, must be provided. The returned result can be a list" - } - }, - "required": ["action", "file_name", "query_key", "columns"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "get_folder_content", - "description": "Get content from all files in specified folder" - }, - "folder_name": { - "type": "string", - "description": "Folder name or relative path" - }, - "query_key": { - "type": "string", - "description": "Related questions or content keywords to extract, must be provided" - }, - "columns": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Column names for return results, used for structured output, must be provided. The returned result can be a list" - } - }, - "required": ["action", "folder_name", "query_key", "columns"], - "additionalProperties": false - } - ] - } - """; - @Override public String getName() { return TOOL_NAME; @@ -215,12 +149,12 @@ public String getName() { @Override public String getDescription() { - return TOOL_DESCRIPTION; + return toolPromptManager.getToolDescription("inner_storage_content_tool"); } @Override public String getParameters() { - return PARAMETERS; + return toolPromptManager.getToolParameters("inner_storage_content_tool"); } @Override @@ -233,9 +167,11 @@ public String getServiceGroup() { return "default-service-group"; } - public static OpenAiApi.FunctionTool getToolDefinition() { - OpenAiApi.FunctionTool.Function function = new OpenAiApi.FunctionTool.Function(TOOL_DESCRIPTION, TOOL_NAME, - PARAMETERS); + public OpenAiApi.FunctionTool getToolDefinition() { + String description = getDescription(); + String parameters = getParameters(); + OpenAiApi.FunctionTool.Function function = new OpenAiApi.FunctionTool.Function(description, TOOL_NAME, + parameters); return new OpenAiApi.FunctionTool(function); } diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/textOperator/TextFileOperator.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/textOperator/TextFileOperator.java index adb9795ae6..84f3ec1982 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/textOperator/TextFileOperator.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/textOperator/TextFileOperator.java @@ -23,6 +23,7 @@ import com.alibaba.cloud.ai.example.manus.tool.AbstractBaseTool; import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; import com.alibaba.cloud.ai.example.manus.tool.innerStorage.SmartContentSavingService; +import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.core.type.TypeReference; @@ -125,148 +126,18 @@ public void setEndLine(Integer endLine) { private final ObjectMapper objectMapper; + private final ToolPromptManager toolPromptManager; + public TextFileOperator(TextFileService textFileService, SmartContentSavingService innerStorageService, - ObjectMapper objectMapper) { + ObjectMapper objectMapper, ToolPromptManager toolPromptManager) { this.textFileService = textFileService; this.innerStorageService = innerStorageService; this.objectMapper = objectMapper; + this.toolPromptManager = toolPromptManager; } - private final String PARAMETERS = """ - { - "oneOf": [ - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "replace" - }, - "file_path": { - "type": "string", - "description": "File path to operate on" - }, - "source_text": { - "type": "string", - "description": "Text to be replaced" - }, - "target_text": { - "type": "string", - "description": "Replacement text" - } - }, - "required": ["action", "file_path", "source_text", "target_text"], - "additionalProperties": false - }, { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "get_text" - }, - "file_path": { - "type": "string", - "description": "File path to read" - }, - "start_line": { - "type": "integer", - "description": "Starting line number (starts from 1)" - }, - "end_line": { - "type": "integer", - "description": "Ending line number (inclusive). Note: Maximum 500 lines per call, use multiple calls for more content" - } - }, - "required": ["action", "file_path", "start_line", "end_line"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "get_all_text" - }, - "file_path": { - "type": "string", - "description": "File path to read all content. Note: If file is too long, content will be stored in temporary file and return file path" - } - }, - "required": ["action", "file_path"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "append" - }, - "file_path": { - "type": "string", - "description": "File path to append content to" - }, - "content": { - "type": "string", - "description": "Content to append" - } - }, - "required": ["action", "file_path", "content"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "count_words" - }, - "file_path": { - "type": "string", - "description": "File path to count words" - } - }, - "required": ["action", "file_path"], - "additionalProperties": false - } - ] - } - """; - private static final String TOOL_NAME = "text_file_operator"; - private final String TOOL_DESCRIPTION = """ - Perform various operations on text files (including md, html, css, java, etc.). - Supported operations: - - replace: Replace specific text in file, requires source_text and target_text parameters - - get_text: Get content from specified line range in file, requires start_line and end_line parameters - Limitation: Maximum 500 lines per call, use multiple calls for more content - - get_all_text: Get all content from file - Note: If file content is too long, it will be automatically stored in temporary file and return file path - - append: Append content to file, requires content parameter - - count_words: Count words in current file - - Supported file types include: - - Text files (.txt) - - Markdown files (.md, .markdown) - - Web files (.html, .css, .scss, .sass, .less) - - Programming files (.java, .py, .js, .ts, .jsx, .tsx) - - Configuration files (.xml, .json, .yaml, .yml, .properties) - - Script files (.sh, .bat, .cmd) - - Log files (.log) - - And more text-based file types - - Note: File operations automatically handle file opening and saving, users do not need to manually perform these operations. - Each operation has strict parameter requirements to ensure accuracy and security of operations. - """; - - public OpenAiApi.FunctionTool getToolDefinition() { - OpenAiApi.FunctionTool.Function function = new OpenAiApi.FunctionTool.Function(TOOL_DESCRIPTION, TOOL_NAME, - PARAMETERS); - OpenAiApi.FunctionTool functionTool = new OpenAiApi.FunctionTool(function); - return functionTool; - } - public ToolExecuteResult run(String toolInput) { log.info("TextFileOperator toolInput:{}", toolInput); try { @@ -658,12 +529,12 @@ public String getName() { @Override public String getDescription() { - return TOOL_DESCRIPTION; + return toolPromptManager.getToolDescription("textFileOperator"); } @Override public String getParameters() { - return PARAMETERS; + return toolPromptManager.getToolParameters("textFileOperator"); } @Override diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/descriptions.properties b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/descriptions.properties index 1e357eddee..3a5c35ce61 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/descriptions.properties +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/descriptions.properties @@ -12,3 +12,33 @@ AGENT_NORMAL_OUTPUT=Output requirements for agent normal mode AGENT_PARALLEL_TOOL_CALLS_RESPONSE=Response rules for agent parallel tool calls FORM_INPUT_TOOL_DESCRIPTION=Description for form input tool FORM_INPUT_TOOL_PARAMETERS=Parameter definition JSON for form input tool + +# Tool Descriptions +BASH_TOOL_DESCRIPTION=Description for bash command execution tool +BASH_TOOL_PARAMETERS=Parameter definition JSON for bash command execution tool +TEXTFILEOPERATOR_TOOL_DESCRIPTION=Description for text file operation tool +TEXTFILEOPERATOR_TOOL_PARAMETERS=Parameter definition JSON for text file operation tool +BROWSER_USE_TOOL_DESCRIPTION=Description for browser automation tool +BROWSER_USE_TOOL_PARAMETERS=Parameter definition JSON for browser automation tool +PYTHON_EXECUTE_TOOL_DESCRIPTION=Description for Python code execution tool +PYTHON_EXECUTE_TOOL_PARAMETERS=Parameter definition JSON for Python code execution tool +DATABASE_USE_TOOL_DESCRIPTION=Description for database operation tool +DATABASE_USE_TOOL_PARAMETERS=Parameter definition JSON for database operation tool +CRON_TOOL_TOOL_DESCRIPTION=Description for scheduled task tool +CRON_TOOL_TOOL_PARAMETERS=Parameter definition JSON for scheduled task tool +INNER_STORAGE_CONTENT_TOOL_TOOL_DESCRIPTION=Description for internal storage content tool +INNER_STORAGE_CONTENT_TOOL_TOOL_PARAMETERS=Parameter definition JSON for internal storage content tool +DOC_LOADER_TOOL_DESCRIPTION=Description for document loader tool +DOC_LOADER_TOOL_PARAMETERS=Parameter definition JSON for document loader tool +FILE_MERGE_TOOL_DESCRIPTION=Description for file merge tool +FILE_MERGE_TOOL_PARAMETERS=Parameter definition JSON for file merge tool +DATA_SPLIT_TOOL_DESCRIPTION=Description for data split tool +DATA_SPLIT_TOOL_PARAMETERS=Parameter definition JSON for data split tool +MAP_OUTPUT_TOOL_DESCRIPTION=Description for map output tool +MAP_OUTPUT_TOOL_PARAMETERS=Parameter definition JSON for map output tool +REDUCE_OPERATION_TOOL_DESCRIPTION=Description for reduce operation tool +REDUCE_OPERATION_TOOL_PARAMETERS=Parameter definition JSON for reduce operation tool +FINALIZE_TOOL_DESCRIPTION=Description for finalize tool +FINALIZE_TOOL_PARAMETERS=Parameter definition JSON for finalize tool +TERMINATE_TOOL_DESCRIPTION=Description for terminate tool +TERMINATE_TOOL_PARAMETERS=Parameter definition JSON for terminate tool diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/bash-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/bash-tool-description.txt new file mode 100644 index 0000000000..c2ac3fee62 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/bash-tool-description.txt @@ -0,0 +1,4 @@ +Execute bash commands in terminal (current OS: %s). +* Long-running commands: For commands that may run indefinitely, they should be run in background with output redirected to file, e.g.: command = `python3 app.py > server.log 2>&1 &`. +* Interactive commands: If bash command returns exit code `-1`, this means the process is not yet complete. Assistant must send a second terminal call with empty `command` (this will retrieve any additional logs), or can send additional text (set `command` to text) to the running process's STDIN, or can send command=`ctrl+c` to interrupt the process. +* Timeout handling: If command execution result shows "Command timed out. Sending SIGINT to the process", assistant should try to re-run the command in background. diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/bash-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/bash-tool-parameters.txt new file mode 100644 index 0000000000..16b5b7e5c8 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/bash-tool-parameters.txt @@ -0,0 +1,10 @@ +{ + "type": "object", + "properties": { + "command": { + "type": "string", + "description": "The bash command to execute. Can be empty to view additional logs when previous exit code is `-1`. Can be `ctrl+c` to interrupt the currently running process." + } + }, + "required": ["command"] +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/browser-use-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/browser-use-tool-description.txt new file mode 100644 index 0000000000..c58552e205 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/browser-use-tool-description.txt @@ -0,0 +1,20 @@ +Interact with web browser to perform various operations such as navigation, element interaction, content extraction and tab management. Prioritize this tool for search-related tasks. + +Supported operations include: +- 'navigate': Visit specific URL +- 'click': Click element by index +- 'input_text': Input text in element +- 'key_enter': Press Enter key +- 'screenshot': Capture screenshot +- 'get_html': Get HTML content of current page +- 'get_text': Get text content of current page +- 'execute_js': Execute JavaScript code +- 'scroll': Scroll page up/down +- 'refresh': Refresh current page +- 'new_tab': Open new tab +- 'close_tab': Close current tab +- 'switch_tab': Switch to specific tab +- 'get_element_position_by_name': Get element position by name +- 'move_to_and_click': Move to coordinates and click + +Note: Browser operations have timeout configuration, default is 30 seconds. diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/browser-use-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/browser-use-tool-parameters.txt new file mode 100644 index 0000000000..15f4d3e67d --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/browser-use-tool-parameters.txt @@ -0,0 +1,218 @@ +{ + "oneOf": [ + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "navigate" + }, + "url": { + "type": "string", + "description": "URL to navigate to" + } + }, + "required": ["action", "url"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "click" + }, + "index": { + "type": "integer", + "description": "Element index to click" + } + }, + "required": ["action", "index"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "input_text" + }, + "index": { + "type": "integer", + "description": "Element index to input text" + }, + "text": { + "type": "string", + "description": "Text to input" + } + }, + "required": ["action", "index", "text"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "key_enter" + }, + "index": { + "type": "integer", + "description": "Element index to press enter" + } + }, + "required": ["action", "index"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "screenshot" + } + }, + "required": ["action"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "get_html" + } + }, + "required": ["action"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "get_text" + } + }, + "required": ["action"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "execute_js" + }, + "script": { + "type": "string", + "description": "JavaScript code to execute" + } + }, + "required": ["action", "script"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "scroll" + }, + "direction": { + "type": "string", + "enum": ["up", "down"], + "description": "Scroll direction" + } + }, + "required": ["action", "direction"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "switch_tab" + }, + "tab_id": { + "type": "integer", + "description": "Tab ID to switch to" + } + }, + "required": ["action", "tab_id"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "new_tab" + }, + "url": { + "type": "string", + "description": "URL to open in new tab" + } + }, + "required": ["action", "url"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "close_tab" + } + }, + "required": ["action"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "refresh" + } + }, + "required": ["action"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "get_element_position" + }, + "element_name": { + "type": "string", + "description": "Element name to get position" + } + }, + "required": ["action", "element_name"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "move_to_and_click" + }, + "position_x": { + "type": "integer", + "description": "X coordinate to move to and click" + }, + "position_y": { + "type": "integer", + "description": "Y coordinate to move to and click" + } + }, + "required": ["action", "position_x", "position_y"], + "additionalProperties": false + } + ] +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/cron-tool-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/cron-tool-tool-description.txt new file mode 100644 index 0000000000..ece5cee581 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/cron-tool-tool-description.txt @@ -0,0 +1 @@ +Scheduled task tool that can store scheduled tasks to database. diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/cron-tool-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/cron-tool-tool-parameters.txt new file mode 100644 index 0000000000..34e31c5842 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/cron-tool-tool-parameters.txt @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "cronName": { + "type": "string", + "description": "Scheduled task name" + }, + "cronTime": { + "type": "string", + "description": "Cron format task scheduled execution time (6 digits), example: 0 0 0/2 * * ?" + }, + "planDesc": { + "type": "string", + "description": "Task content to execute, cannot contain time-related information" + } + }, + "required": ["cronTime", "planDesc"] +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/data-split-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/data-split-tool-description.txt new file mode 100644 index 0000000000..3b95977a2b --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/data-split-tool-description.txt @@ -0,0 +1,9 @@ +Data split tool for MapReduce workflow data preparation phase. +Automatically validates file existence and performs data split processing. +Supports CSV, TSV, TXT and other text format data files. + +Key features: +- File and directory existence validation +- Automatic text file detection and processing +- Task directory structure creation with metadata +- Support for both single files and directories diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/data-split-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/data-split-tool-parameters.txt new file mode 100644 index 0000000000..aa936bcd57 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/data-split-tool-parameters.txt @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "file_path": { + "type": "string", + "description": "File or folder path to process" + }, + "terminate_columns": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Column names for termination results, used for structured output" + } + }, + "required": ["file_path"], + "additionalProperties": false +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/database-use-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/database-use-tool-description.txt new file mode 100644 index 0000000000..bd3b763a2a --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/database-use-tool-description.txt @@ -0,0 +1,6 @@ +Interact with database, execute SQL, table structure, index, health status and other operations. Supported operations include: +- 'execute_sql': Execute SQL statements +- 'get_table_name': Find table names based on table comments +- 'get_table_index': Get table index information +- 'get_table_meta': Get complete metadata of table structure, fields, indexes +- 'get_datasource_info': Get data source information diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/database-use-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/database-use-tool-parameters.txt new file mode 100644 index 0000000000..d82a00b85b --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/database-use-tool-parameters.txt @@ -0,0 +1,53 @@ +{ + "oneOf": [ + { + "type": "object", + "properties": { + "action": { "type": "string", "const": "execute_sql" }, + "query": { "type": "string", "description": "SQL statement to execute" }, + "datasourceName": { "type": "string", "description": "Data source name, optional" } + }, + "required": ["action", "query"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { "type": "string", "const": "get_table_name" }, + "text": { "type": "string", "description": "Chinese table name or table description to search, supports single query only" }, + "datasourceName": { "type": "string", "description": "Data source name, optional" } + }, + "required": ["action", "text"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { "type": "string", "const": "get_table_index" }, + "text": { "type": "string", "description": "Table name to search" }, + "datasourceName": { "type": "string", "description": "Data source name, optional" } + }, + "required": ["action", "text"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { "type": "string", "const": "get_table_meta" }, + "text": { "type": "string", "description": "Fuzzy search table description, leave empty to get all tables" }, + "datasourceName": { "type": "string", "description": "Data source name, optional" } + }, + "required": ["action"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { "type": "string", "const": "get_datasource_info" }, + "datasourceName": { "type": "string", "description": "Data source name, leave empty to get all available data sources" } + }, + "required": ["action"], + "additionalProperties": false + } + ] +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/doc-loader-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/doc-loader-tool-description.txt new file mode 100644 index 0000000000..8d1e7ef27a --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/doc-loader-tool-description.txt @@ -0,0 +1,3 @@ +Get the content information of a local file at a specified path. +Use this tool when you want to get some related information asked by the user. +This tool accepts the file path and gets the related information content. diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/doc-loader-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/doc-loader-tool-parameters.txt new file mode 100644 index 0000000000..951a401e47 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/doc-loader-tool-parameters.txt @@ -0,0 +1,14 @@ +{ + "type": "object", + "properties": { + "file_type": { + "type": "string", + "description": "(required) File type, only support pdf file." + }, + "file_path": { + "type": "string", + "description": "(required) Get the absolute path of the file from the user request." + } + }, + "required": ["file_type", "file_path"] +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/file-merge-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/file-merge-tool-description.txt new file mode 100644 index 0000000000..cc6d972bb7 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/file-merge-tool-description.txt @@ -0,0 +1,2 @@ +File merge tool for merging single files into specified target folders. +Each call merges one file to the target folder, supports fuzzy filename matching. diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/file-merge-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/file-merge-tool-parameters.txt new file mode 100644 index 0000000000..22734beba5 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/file-merge-tool-parameters.txt @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": ["merge_file"], + "description": "Operation type, currently supports merge_file" + }, + "file_name": { + "type": "string", + "description": "Filename to merge (supports fuzzy matching)" + }, + "target_folder": { + "type": "string", + "description": "Target folder path where the file will be copied" + } + }, + "required": ["action", "file_name", "target_folder"], + "additionalProperties": false +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/finalize-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/finalize-tool-description.txt new file mode 100644 index 0000000000..e296b7725d --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/finalize-tool-description.txt @@ -0,0 +1,9 @@ +Finalize tool for MapReduce workflow output processing. +Supports copying the reduce output file to a new file with user-specified name. +Supported operations: +- export: Copy the reduce output file to a new file with the specified name in the same directory. + +This tool is specifically designed for finalizing MapReduce workflow results by: +- Creating a final output file with a meaningful name +- Preserving the original reduce output file +- Ensuring the final result is properly named and accessible diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/finalize-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/finalize-tool-parameters.txt new file mode 100644 index 0000000000..92fd7ac228 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/finalize-tool-parameters.txt @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "export" + }, + "new_file_name": { + "type": "string", + "description": "New file name (with extension), used to save the final output result" + } + }, + "required": ["action", "new_file_name"], + "additionalProperties": false +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/inner-storage-content-tool-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/inner-storage-content-tool-tool-description.txt new file mode 100644 index 0000000000..1175ef567c --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/inner-storage-content-tool-tool-description.txt @@ -0,0 +1,6 @@ +Internal storage content retrieval tool specialized for intelligent content extraction and structured output. +Intelligent content extraction mode: Get detailed content based on file name, **must provide** query_key and columns parameters for intelligent extraction and structured output + +Supports two operation modes: +1. get_content: Get content from single file (exact filename match or relative path) +2. get_folder_content: Get content from all files in specified folder diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/inner-storage-content-tool-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/inner-storage-content-tool-tool-parameters.txt new file mode 100644 index 0000000000..350ca4aea7 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/inner-storage-content-tool-tool-parameters.txt @@ -0,0 +1,58 @@ +{ + "oneOf": [ + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "get_content", + "description": "Get content from single file" + }, + "file_name": { + "type": "string", + "description": "Filename (with extension) or relative path, supports exact matching" + }, + "query_key": { + "type": "string", + "description": "Related questions or content keywords to extract, must be provided" + }, + "columns": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Column names for return results, used for structured output, must be provided. The returned result can be a list" + } + }, + "required": ["action", "file_name", "query_key", "columns"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "get_folder_content", + "description": "Get content from all files in specified folder" + }, + "folder_name": { + "type": "string", + "description": "Folder name or relative path" + }, + "query_key": { + "type": "string", + "description": "Related questions or content keywords to extract, must be provided" + }, + "columns": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Column names for return results, used for structured output, must be provided. The returned result can be a list" + } + }, + "required": ["action", "folder_name", "query_key", "columns"], + "additionalProperties": false + } + ] +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/map-output-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/map-output-tool-description.txt new file mode 100644 index 0000000000..b7c539b831 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/map-output-tool-description.txt @@ -0,0 +1,10 @@ +Map output recording tool for MapReduce workflow. +Accept content after Map phase processing completion, automatically generate filename and create output file. +Record task status and manage structured data output. + +**Important Parameter Description:** +- task_id: String, task ID identifier for identifying the currently processing Map task (required) +- has_value: Boolean value indicating whether there is valid data + - If no valid data is found, set to false + - If there is data to output, set to true +- data: Must provide data when has_value is true diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/map-output-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/map-output-tool-parameters.txt new file mode 100644 index 0000000000..4c3b9365cd --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/map-output-tool-parameters.txt @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "task_id": { + "type": "string", + "description": "Task ID identifier for identifying the currently processing Map task" + }, + "has_value": { + "type": "boolean", + "description": "Whether there is valid data. Set to false if no valid data is found, set to true when there is data" + }, + "data": { + "type": "array", + "items": { + "type": "array", + "items": {"type": "string"} + }, + "description": "data row list (only required when has_value is true)" + } + }, + "required": ["task_id", "has_value"], + "additionalProperties": false +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/python-execute-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/python-execute-tool-description.txt new file mode 100644 index 0000000000..1b1f332af5 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/python-execute-tool-description.txt @@ -0,0 +1 @@ +Executes Python code string. Note: Only print outputs are visible, function return values are not captured. Use print statements to see results. diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/python-execute-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/python-execute-tool-parameters.txt new file mode 100644 index 0000000000..7a13d21b6c --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/python-execute-tool-parameters.txt @@ -0,0 +1,10 @@ +{ + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The Python code to execute." + } + }, + "required": ["code"] +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/reduce-operation-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/reduce-operation-tool-description.txt new file mode 100644 index 0000000000..a6a6137809 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/reduce-operation-tool-description.txt @@ -0,0 +1,11 @@ +Reduce operation tool for MapReduce workflow file manipulation. +Aggregates and merges data from multiple Map tasks and generates final consolidated output. + +**Important Parameter Description:** +- has_value: Boolean value indicating whether there is valid data to write + - If no valid data is found, set to false + - If there is data to output, set to true +- data: Must provide data when has_value is true + +**IMPORTANT**: Tool will automatically terminate after operation completion. +Please complete all content output in a single call. diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/reduce-operation-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/reduce-operation-tool-parameters.txt new file mode 100644 index 0000000000..378f8b4e4b --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/reduce-operation-tool-parameters.txt @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "has_value": { + "type": "boolean", + "description": "Whether there is valid data to write. Set to false if no valid data is found, set to true when there is data" + }, + "data": { + "type": "array", + "items": { + "type": "array", + "items": {"type": "string"} + }, + "description": "data row list (only required when has_value is true)" + } + }, + "required": ["has_value"], + "additionalProperties": false +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/terminate-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/terminate-tool-description.txt new file mode 100644 index 0000000000..2973e1a41b --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/terminate-tool-description.txt @@ -0,0 +1,2 @@ +Terminate the current execution step with structured data. +Provide data in JSON format with 'columns' array and 'data' array containing rows of values. diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/terminate-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/terminate-tool-parameters.txt new file mode 100644 index 0000000000..cca7a16004 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/terminate-tool-parameters.txt @@ -0,0 +1,24 @@ +{ + "type": "object", + "properties": { + "columns": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Column names for the data structure" + }, + "data": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Data rows, each row should match the columns structure" + } + }, + "required": ["columns", "data"], + "additionalProperties": false +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/textfileoperator-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/textfileoperator-tool-description.txt new file mode 100644 index 0000000000..eb959f47d7 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/textfileoperator-tool-description.txt @@ -0,0 +1,18 @@ +Perform various operations on text files (including md, html, css, java, etc.). + +Supported operations: +- replace: Replace specific text in file, requires source_text and target_text parameters +- get_text: Get content from specified line range in file, requires start_line and end_line parameters + Limitation: Maximum 500 lines per call, use multiple calls for more content +- get_all_text: Get all content from file + Note: If file content is too long, it will be automatically stored in temporary file and return file path +- append: Append content to file, requires content parameter +- count_words: Count words in current file + +Supported file types include: +- Text files (.txt) +- Markdown files (.md, .markdown) +- Web files (.html, .css, .scss, .sass, .less) +- Programming files (.java, .py, .js, .ts, .cpp, .c, .h, .go, .rs, .php, .rb, .swift, .kt, .scala) +- Configuration files (.json, .xml, .yaml, .yml, .toml, .ini, .conf) +- Documentation files (.rst, .adoc) diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/textfileoperator-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/textfileoperator-tool-parameters.txt new file mode 100644 index 0000000000..9c628adb91 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/en/tool/textfileoperator-tool-parameters.txt @@ -0,0 +1,84 @@ +{ + "oneOf": [ + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "replace" + }, + "file_path": { + "type": "string", + "description": "File path to operate on" + }, + "source_text": { + "type": "string", + "description": "Text to be replaced" + }, + "target_text": { + "type": "string", + "description": "Replacement text" + } + }, + "required": ["action", "file_path", "source_text", "target_text"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "get_text" + }, + "file_path": { + "type": "string", + "description": "File path to read" + }, + "start_line": { + "type": "integer", + "description": "Starting line number (starts from 1)" + }, + "end_line": { + "type": "integer", + "description": "Ending line number (inclusive). Note: Maximum 500 lines per call, use multiple calls for more content" + } + }, + "required": ["action", "file_path", "start_line", "end_line"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "get_all_text" + }, + "file_path": { + "type": "string", + "description": "File path to read all content. Note: If file is too long, content will be stored in temporary file and return file path" + } + }, + "required": ["action", "file_path"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "append" + }, + "file_path": { + "type": "string", + "description": "File path to operate on" + }, + "content": { + "type": "string", + "description": "Content to append to the file" + } + }, + "required": ["action", "file_path", "content"], + "additionalProperties": false + } + ] +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/descriptions.properties b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/descriptions.properties index a760c70f8f..3281b7ff1f 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/descriptions.properties +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/descriptions.properties @@ -12,3 +12,33 @@ AGENT_NORMAL_OUTPUT=Agent\u6B63\u5E38\u6A21\u5F0F\u4E0B\u7684\u8F93\u51FA\u8981\ AGENT_PARALLEL_TOOL_CALLS_RESPONSE=Agent\u5E76\u884C\u5DE5\u5177\u8C03\u7528\u7684\u54CD\u5E94\u89C4\u5219 FORM_INPUT_TOOL_DESCRIPTION=\u8868\u5355\u8F93\u5165\u5DE5\u5177\u7684\u63CF\u8FF0\u4FE1\u606F FORM_INPUT_TOOL_PARAMETERS=\u8868\u5355\u8F93\u5165\u5DE5\u5177\u7684\u53C2\u6570\u5B9A\u4E49JSON + +# \u5DE5\u5177\u63CF\u8FF0 +BASH_TOOL_DESCRIPTION=Bash\u547D\u4EE4\u6267\u884C\u5DE5\u5177\u7684\u63CF\u8FF0\u4FE1\u606F +BASH_TOOL_PARAMETERS=Bash\u547D\u4EE4\u6267\u884C\u5DE5\u5177\u7684\u53C2\u6570\u5B9A\u4E49JSON +TEXTFILEOPERATOR_TOOL_DESCRIPTION=\u6587\u672C\u6587\u4EF6\u64CD\u4F5C\u5DE5\u5177\u7684\u63CF\u8FF0\u4FE1\u606F +TEXTFILEOPERATOR_TOOL_PARAMETERS=\u6587\u672C\u6587\u4EF6\u64CD\u4F5C\u5DE5\u5177\u7684\u53C2\u6570\u5B9A\u4E49JSON +BROWSER_USE_TOOL_DESCRIPTION=\u6D4F\u89C8\u5668\u81EA\u52A8\u5316\u5DE5\u5177\u7684\u63CF\u8FF0\u4FE1\u606F +BROWSER_USE_TOOL_PARAMETERS=\u6D4F\u89C8\u5668\u81EA\u52A8\u5316\u5DE5\u5177\u7684\u53C2\u6570\u5B9A\u4E49JSON +PYTHON_EXECUTE_TOOL_DESCRIPTION=Python\u4EE3\u7801\u6267\u884C\u5DE5\u5177\u7684\u63CF\u8FF0\u4FE1\u606F +PYTHON_EXECUTE_TOOL_PARAMETERS=Python\u4EE3\u7801\u6267\u884C\u5DE5\u5177\u7684\u53C2\u6570\u5B9A\u4E49JSON +DATABASE_USE_TOOL_DESCRIPTION=\u6570\u636E\u5E93\u64CD\u4F5C\u5DE5\u5177\u7684\u63CF\u8FF0\u4FE1\u606F +DATABASE_USE_TOOL_PARAMETERS=\u6570\u636E\u5E93\u64CD\u4F5C\u5DE5\u5177\u7684\u53C2\u6570\u5B9A\u4E49JSON +CRON_TOOL_TOOL_DESCRIPTION=\u5B9A\u65F6\u4EFB\u52A1\u5DE5\u5177\u7684\u63CF\u8FF0\u4FE1\u606F +CRON_TOOL_TOOL_PARAMETERS=\u5B9A\u65F6\u4EFB\u52A1\u5DE5\u5177\u7684\u53C2\u6570\u5B9A\u4E49JSON +INNER_STORAGE_CONTENT_TOOL_TOOL_DESCRIPTION=\u5185\u90E8\u5B58\u50A8\u5185\u5BB9\u5DE5\u5177\u7684\u63CF\u8FF0\u4FE1\u606F +INNER_STORAGE_CONTENT_TOOL_TOOL_PARAMETERS=\u5185\u90E8\u5B58\u50A8\u5185\u5BB9\u5DE5\u5177\u7684\u53C2\u6570\u5B9A\u4E49JSON +DOC_LOADER_TOOL_DESCRIPTION=\u6587\u6863\u52A0\u8F7D\u5DE5\u5177\u7684\u63CF\u8FF0\u4FE1\u606F +DOC_LOADER_TOOL_PARAMETERS=\u6587\u6863\u52A0\u8F7D\u5DE5\u5177\u7684\u53C2\u6570\u5B9A\u4E49JSON +FILE_MERGE_TOOL_DESCRIPTION=\u6587\u4EF6\u5408\u5E76\u5DE5\u5177\u7684\u63CF\u8FF0\u4FE1\u606F +FILE_MERGE_TOOL_PARAMETERS=\u6587\u4EF6\u5408\u5E76\u5DE5\u5177\u7684\u53C2\u6570\u5B9A\u4E49JSON +DATA_SPLIT_TOOL_DESCRIPTION=\u6570\u636E\u5206\u5272\u5DE5\u5177\u7684\u63CF\u8FF0\u4FE1\u606F +DATA_SPLIT_TOOL_PARAMETERS=\u6570\u636E\u5206\u5272\u5DE5\u5177\u7684\u53C2\u6570\u5B9A\u4E49JSON +MAP_OUTPUT_TOOL_DESCRIPTION=\u6620\u5C04\u8F93\u51FA\u5DE5\u5177\u7684\u63CF\u8FF0\u4FE1\u606F +MAP_OUTPUT_TOOL_PARAMETERS=\u6620\u5C04\u8F93\u51FA\u5DE5\u5177\u7684\u53C2\u6570\u5B9A\u4E49JSON +REDUCE_OPERATION_TOOL_DESCRIPTION=\u5F52\u7EA6\u64CD\u4F5C\u5DE5\u5177\u7684\u63CF\u8FF0\u4FE1\u606F +REDUCE_OPERATION_TOOL_PARAMETERS=\u5F52\u7EA6\u64CD\u4F5C\u5DE5\u5177\u7684\u53C2\u6570\u5B9A\u4E49JSON +FINALIZE_TOOL_DESCRIPTION=\u5B8C\u6210\u5DE5\u5177\u7684\u63CF\u8FF0\u4FE1\u606F +FINALIZE_TOOL_PARAMETERS=\u5B8C\u6210\u5DE5\u5177\u7684\u53C2\u6570\u5B9A\u4E49JSON +TERMINATE_TOOL_DESCRIPTION=\u7EC8\u6B62\u5DE5\u5177\u7684\u63CF\u8FF0\u4FE1\u606F +TERMINATE_TOOL_PARAMETERS=\u7EC8\u6B62\u5DE5\u5177\u7684\u53C2\u6570\u5B9A\u4E49JSON diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/bash-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/bash-tool-description.txt new file mode 100644 index 0000000000..4b9cc79a06 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/bash-tool-description.txt @@ -0,0 +1,4 @@ +在终端中执行bash命令(当前操作系统:%s)。 +* 长时间运行的命令:对于可能无限期运行的命令,应该在后台运行并将输出重定向到文件,例如:command = `python3 app.py > server.log 2>&1 &`。 +* 交互式命令:如果bash命令返回退出代码`-1`,这意味着进程尚未完成。助手必须发送第二个终端调用,使用空的`command`(这将检索任何额外的日志),或者可以发送额外的文本(将`command`设置为文本)到正在运行的进程的STDIN,或者可以发送command=`ctrl+c`来中断进程。 +* 超时处理:如果命令执行结果显示"命令超时。向进程发送SIGINT",助手应该尝试在后台重新运行命令。 diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/bash-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/bash-tool-parameters.txt new file mode 100644 index 0000000000..6815ca8d65 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/bash-tool-parameters.txt @@ -0,0 +1,10 @@ +{ + "type": "object", + "properties": { + "command": { + "type": "string", + "description": "要执行的bash命令。当前一个退出代码为`-1`时,可以为空以查看额外的日志。可以是`ctrl+c`来中断当前正在运行的进程。" + } + }, + "required": ["command"] +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/browser-use-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/browser-use-tool-description.txt new file mode 100644 index 0000000000..117e5fbed4 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/browser-use-tool-description.txt @@ -0,0 +1,20 @@ +与网页浏览器交互,执行各种操作,如导航、元素交互、内容提取和标签页管理。优先使用此工具进行搜索相关任务。 + +支持的操作包括: +- 'navigate': 访问指定URL +- 'click': 通过索引点击元素 +- 'input_text': 在元素中输入文本 +- 'key_enter': 按回车键 +- 'screenshot': 截取屏幕截图 +- 'get_html': 获取当前页面的HTML内容 +- 'get_text': 获取当前页面的文本内容 +- 'execute_js': 执行JavaScript代码 +- 'scroll': 页面上下滚动 +- 'refresh': 刷新当前页面 +- 'new_tab': 打开新标签页 +- 'close_tab': 关闭当前标签页 +- 'switch_tab': 切换到指定标签页 +- 'get_element_position_by_name': 通过名称获取元素位置 +- 'move_to_and_click': 移动到坐标并点击 + +注意:浏览器操作有超时配置,默认为30秒。 diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/browser-use-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/browser-use-tool-parameters.txt new file mode 100644 index 0000000000..6578c081a6 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/browser-use-tool-parameters.txt @@ -0,0 +1,218 @@ +{ + "oneOf": [ + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "navigate" + }, + "url": { + "type": "string", + "description": "要导航到的URL" + } + }, + "required": ["action", "url"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "click" + }, + "index": { + "type": "integer", + "description": "要点击的元素索引" + } + }, + "required": ["action", "index"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "input_text" + }, + "index": { + "type": "integer", + "description": "要输入文本的元素索引" + }, + "text": { + "type": "string", + "description": "要输入的文本" + } + }, + "required": ["action", "index", "text"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "key_enter" + }, + "index": { + "type": "integer", + "description": "要按回车键的元素索引" + } + }, + "required": ["action", "index"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "screenshot" + } + }, + "required": ["action"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "get_html" + } + }, + "required": ["action"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "get_text" + } + }, + "required": ["action"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "execute_js" + }, + "script": { + "type": "string", + "description": "要执行的JavaScript代码" + } + }, + "required": ["action", "script"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "scroll" + }, + "direction": { + "type": "string", + "enum": ["up", "down"], + "description": "滚动方向" + } + }, + "required": ["action", "direction"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "switch_tab" + }, + "tab_id": { + "type": "integer", + "description": "要切换到的标签页ID" + } + }, + "required": ["action", "tab_id"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "new_tab" + }, + "url": { + "type": "string", + "description": "在新标签页中打开的URL" + } + }, + "required": ["action", "url"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "close_tab" + } + }, + "required": ["action"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "refresh" + } + }, + "required": ["action"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "get_element_position" + }, + "element_name": { + "type": "string", + "description": "要获取位置的元素名称" + } + }, + "required": ["action", "element_name"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "move_to_and_click" + }, + "position_x": { + "type": "integer", + "description": "要移动并点击的X坐标" + }, + "position_y": { + "type": "integer", + "description": "要移动并点击的Y坐标" + } + }, + "required": ["action", "position_x", "position_y"], + "additionalProperties": false + } + ] +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/cron-tool-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/cron-tool-tool-description.txt new file mode 100644 index 0000000000..fd6d77cec5 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/cron-tool-tool-description.txt @@ -0,0 +1 @@ +定时任务工具,可以将定时任务存储到数据库中。 diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/cron-tool-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/cron-tool-tool-parameters.txt new file mode 100644 index 0000000000..f643103fb1 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/cron-tool-tool-parameters.txt @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "cronName": { + "type": "string", + "description": "定时任务名称" + }, + "cronTime": { + "type": "string", + "description": "Cron格式的任务定时执行时间(6位数),示例:0 0 0/2 * * ?" + }, + "planDesc": { + "type": "string", + "description": "要执行的任务内容,不能包含时间相关信息" + } + }, + "required": ["cronTime", "planDesc"] +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/data-split-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/data-split-tool-description.txt new file mode 100644 index 0000000000..712e623b67 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/data-split-tool-description.txt @@ -0,0 +1,9 @@ +MapReduce工作流数据准备阶段的数据分割工具。 +自动验证文件存在性并执行数据分割处理。 +支持CSV、TSV、TXT和其他文本格式数据文件。 + +主要功能: +- 文件和目录存在性验证 +- 自动文本文件检测和处理 +- 创建带有元数据的任务目录结构 +- 支持单个文件和目录 diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/data-split-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/data-split-tool-parameters.txt new file mode 100644 index 0000000000..a39ffaf16d --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/data-split-tool-parameters.txt @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "file_path": { + "type": "string", + "description": "要处理的文件或文件夹路径" + }, + "terminate_columns": { + "type": "array", + "items": { + "type": "string" + }, + "description": "终止结果的列名,用于结构化输出" + } + }, + "required": ["file_path"], + "additionalProperties": false +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/database-use-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/database-use-tool-description.txt new file mode 100644 index 0000000000..b9f996dc2c --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/database-use-tool-description.txt @@ -0,0 +1,6 @@ +与数据库交互,执行SQL、表结构、索引、健康状态等操作。支持的操作包括: +- 'execute_sql': 执行SQL语句 +- 'get_table_name': 根据表注释查找表名 +- 'get_table_index': 获取表索引信息 +- 'get_table_meta': 获取表结构、字段、索引的完整元数据 +- 'get_datasource_info': 获取数据源信息 diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/database-use-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/database-use-tool-parameters.txt new file mode 100644 index 0000000000..425ef67743 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/database-use-tool-parameters.txt @@ -0,0 +1,53 @@ +{ + "oneOf": [ + { + "type": "object", + "properties": { + "action": { "type": "string", "const": "execute_sql" }, + "query": { "type": "string", "description": "要执行的SQL语句" }, + "datasourceName": { "type": "string", "description": "数据源名称,可选" } + }, + "required": ["action", "query"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { "type": "string", "const": "get_table_name" }, + "text": { "type": "string", "description": "要搜索的中文表名或表描述,仅支持单个查询" }, + "datasourceName": { "type": "string", "description": "数据源名称,可选" } + }, + "required": ["action", "text"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { "type": "string", "const": "get_table_index" }, + "text": { "type": "string", "description": "要搜索的表名" }, + "datasourceName": { "type": "string", "description": "数据源名称,可选" } + }, + "required": ["action", "text"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { "type": "string", "const": "get_table_meta" }, + "text": { "type": "string", "description": "模糊搜索表描述,留空获取所有表" }, + "datasourceName": { "type": "string", "description": "数据源名称,可选" } + }, + "required": ["action"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { "type": "string", "const": "get_datasource_info" }, + "datasourceName": { "type": "string", "description": "数据源名称,留空获取所有可用数据源" } + }, + "required": ["action"], + "additionalProperties": false + } + ] +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/doc-loader-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/doc-loader-tool-description.txt new file mode 100644 index 0000000000..cc2d9ed552 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/doc-loader-tool-description.txt @@ -0,0 +1,3 @@ +获取指定路径本地文件的内容信息。 +当您想要获取用户询问的相关信息时使用此工具。 +此工具接受文件路径并获取相关信息内容。 diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/doc-loader-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/doc-loader-tool-parameters.txt new file mode 100644 index 0000000000..f03865b9b9 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/doc-loader-tool-parameters.txt @@ -0,0 +1,14 @@ +{ + "type": "object", + "properties": { + "file_type": { + "type": "string", + "description": "(必需)文件类型,仅支持pdf文件。" + }, + "file_path": { + "type": "string", + "description": "(必需)从用户请求中获取文件的绝对路径。" + } + }, + "required": ["file_type", "file_path"] +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/file-merge-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/file-merge-tool-description.txt new file mode 100644 index 0000000000..fa93567d5f --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/file-merge-tool-description.txt @@ -0,0 +1,2 @@ +文件合并工具,用于将单个文件合并到指定的目标文件夹中。 +每次调用将一个文件合并到目标文件夹,支持模糊文件名匹配。 diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/file-merge-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/file-merge-tool-parameters.txt new file mode 100644 index 0000000000..9cb3d96d68 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/file-merge-tool-parameters.txt @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": ["merge_file"], + "description": "操作类型,目前支持merge_file" + }, + "file_name": { + "type": "string", + "description": "要合并的文件名(支持模糊匹配)" + }, + "target_folder": { + "type": "string", + "description": "文件将被复制到的目标文件夹路径" + } + }, + "required": ["action", "file_name", "target_folder"], + "additionalProperties": false +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/finalize-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/finalize-tool-description.txt new file mode 100644 index 0000000000..e5bd6b0231 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/finalize-tool-description.txt @@ -0,0 +1,9 @@ +MapReduce工作流输出处理的完成工具。 +支持将reduce输出文件复制到用户指定名称的新文件。 +支持的操作: +- export:将reduce输出文件复制到同一目录中指定名称的新文件。 + +此工具专门设计用于完成MapReduce工作流结果: +- 创建具有有意义名称的最终输出文件 +- 保留原始reduce输出文件 +- 确保最终结果正确命名且可访问 diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/finalize-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/finalize-tool-parameters.txt new file mode 100644 index 0000000000..5338fee3bc --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/finalize-tool-parameters.txt @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "export" + }, + "new_file_name": { + "type": "string", + "description": "新文件名(带扩展名),用于保存最终输出结果" + } + }, + "required": ["action", "new_file_name"], + "additionalProperties": false +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/inner-storage-content-tool-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/inner-storage-content-tool-tool-description.txt new file mode 100644 index 0000000000..00297fd707 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/inner-storage-content-tool-tool-description.txt @@ -0,0 +1,6 @@ +内部存储内容检索工具,专门用于智能内容提取和结构化输出。 +智能内容提取模式:根据文件名获取详细内容,**必须提供** query_key 和 columns 参数进行智能提取和结构化输出 + +支持两种操作模式: +1. get_content:从单个文件获取内容(精确文件名匹配或相对路径) +2. get_folder_content:从指定文件夹中的所有文件获取内容 diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/inner-storage-content-tool-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/inner-storage-content-tool-tool-parameters.txt new file mode 100644 index 0000000000..59dce9f899 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/inner-storage-content-tool-tool-parameters.txt @@ -0,0 +1,58 @@ +{ + "oneOf": [ + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "get_content", + "description": "从单个文件获取内容" + }, + "file_name": { + "type": "string", + "description": "文件名(带扩展名)或相对路径,支持精确匹配" + }, + "query_key": { + "type": "string", + "description": "要提取的相关问题或内容关键词,必须提供" + }, + "columns": { + "type": "array", + "items": { + "type": "string" + }, + "description": "返回结果的列名,用于结构化输出,必须提供。返回结果可以是列表" + } + }, + "required": ["action", "file_name", "query_key", "columns"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "get_folder_content", + "description": "从指定文件夹中的所有文件获取内容" + }, + "folder_name": { + "type": "string", + "description": "文件夹名称或相对路径" + }, + "query_key": { + "type": "string", + "description": "要提取的相关问题或内容关键词,必须提供" + }, + "columns": { + "type": "array", + "items": { + "type": "string" + }, + "description": "返回结果的列名,用于结构化输出,必须提供。返回结果可以是列表" + } + }, + "required": ["action", "folder_name", "query_key", "columns"], + "additionalProperties": false + } + ] +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/map-output-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/map-output-tool-description.txt new file mode 100644 index 0000000000..7d6630db41 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/map-output-tool-description.txt @@ -0,0 +1,10 @@ +MapReduce工作流的Map输出记录工具。 +接受Map阶段处理完成后的内容,自动生成文件名并创建输出文件。 +记录任务状态并管理结构化数据输出。 + +**重要参数说明:** +- task_id:字符串,用于标识当前正在处理的Map任务的任务ID标识符(必需) +- has_value:布尔值,表示是否有有效数据 + - 如果没有找到有效数据,设置为false + - 如果有数据要输出,设置为true +- data:当has_value为true时必须提供数据 diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/map-output-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/map-output-tool-parameters.txt new file mode 100644 index 0000000000..68e49f420d --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/map-output-tool-parameters.txt @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "task_id": { + "type": "string", + "description": "用于标识当前正在处理的Map任务的任务ID标识符" + }, + "has_value": { + "type": "boolean", + "description": "是否有有效数据。如果没有找到有效数据设置为false,有数据时设置为true" + }, + "data": { + "type": "array", + "items": { + "type": "array", + "items": {"type": "string"} + }, + "description": "数据行列表(仅在has_value为true时需要)" + } + }, + "required": ["task_id", "has_value"], + "additionalProperties": false +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/python-execute-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/python-execute-tool-description.txt new file mode 100644 index 0000000000..f8a0242cee --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/python-execute-tool-description.txt @@ -0,0 +1 @@ +执行Python代码字符串。注意:只有print输出是可见的,函数返回值不会被捕获。使用print语句来查看结果。 diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/python-execute-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/python-execute-tool-parameters.txt new file mode 100644 index 0000000000..f2e7d1b1ff --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/python-execute-tool-parameters.txt @@ -0,0 +1,10 @@ +{ + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "要执行的Python代码。" + } + }, + "required": ["code"] +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/reduce-operation-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/reduce-operation-tool-description.txt new file mode 100644 index 0000000000..4c10e99877 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/reduce-operation-tool-description.txt @@ -0,0 +1,11 @@ +MapReduce工作流文件操作的Reduce操作工具。 +聚合和合并来自多个Map任务的数据,生成最终的合并输出。 + +**重要参数说明:** +- has_value:布尔值,表示是否有有效数据要写入 + - 如果没有找到有效数据,设置为false + - 如果有数据要输出,设置为true +- data:当has_value为true时必须提供数据 + +**重要提示**:工具将在操作完成后自动终止。 +请在单次调用中完成所有内容输出。 diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/reduce-operation-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/reduce-operation-tool-parameters.txt new file mode 100644 index 0000000000..7fbbec1026 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/reduce-operation-tool-parameters.txt @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "has_value": { + "type": "boolean", + "description": "是否有有效数据要写入。如果没有找到有效数据设置为false,有数据时设置为true" + }, + "data": { + "type": "array", + "items": { + "type": "array", + "items": {"type": "string"} + }, + "description": "数据行列表(仅在has_value为true时需要)" + } + }, + "required": ["has_value"], + "additionalProperties": false +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/terminate-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/terminate-tool-description.txt new file mode 100644 index 0000000000..11e96be17e --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/terminate-tool-description.txt @@ -0,0 +1,2 @@ +使用结构化数据终止当前执行步骤。 +以JSON格式提供数据,包含'columns'数组和包含值行的'data'数组。 diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/terminate-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/terminate-tool-parameters.txt new file mode 100644 index 0000000000..5767e9eec4 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/terminate-tool-parameters.txt @@ -0,0 +1,24 @@ +{ + "type": "object", + "properties": { + "columns": { + "type": "array", + "items": { + "type": "string" + }, + "description": "数据结构的列名" + }, + "data": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "数据行,每行应匹配列结构" + } + }, + "required": ["columns", "data"], + "additionalProperties": false +} diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/textfileoperator-tool-description.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/textfileoperator-tool-description.txt new file mode 100644 index 0000000000..1e347f6759 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/textfileoperator-tool-description.txt @@ -0,0 +1,18 @@ +对文本文件执行各种操作(包括md、html、css、java等)。 + +支持的操作: +- replace:替换文件中的特定文本,需要source_text和target_text参数 +- get_text:从文件的指定行范围获取内容,需要start_line和end_line参数 + 限制:每次调用最多500行,如需更多内容请使用多次调用 +- get_all_text:获取文件的所有内容 + 注意:如果文件内容过长,将自动存储在临时文件中并返回文件路径 +- append:向文件追加内容,需要content参数 +- count_words:统计当前文件的字数 + +支持的文件类型包括: +- 文本文件(.txt) +- Markdown文件(.md、.markdown) +- 网页文件(.html、.css、.scss、.sass、.less) +- 编程文件(.java、.py、.js、.ts、.cpp、.c、.h、.go、.rs、.php、.rb、.swift、.kt、.scala) +- 配置文件(.json、.xml、.yaml、.yml、.toml、.ini、.conf) +- 文档文件(.rst、.adoc) diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/textfileoperator-tool-parameters.txt b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/textfileoperator-tool-parameters.txt new file mode 100644 index 0000000000..5cc23cfda7 --- /dev/null +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/zh/tool/textfileoperator-tool-parameters.txt @@ -0,0 +1,84 @@ +{ + "oneOf": [ + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "replace" + }, + "file_path": { + "type": "string", + "description": "要操作的文件路径" + }, + "source_text": { + "type": "string", + "description": "要被替换的文本" + }, + "target_text": { + "type": "string", + "description": "替换文本" + } + }, + "required": ["action", "file_path", "source_text", "target_text"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "get_text" + }, + "file_path": { + "type": "string", + "description": "要读取的文件路径" + }, + "start_line": { + "type": "integer", + "description": "起始行号(从1开始)" + }, + "end_line": { + "type": "integer", + "description": "结束行号(包含)。注意:每次调用最多500行,如需更多内容请使用多次调用" + } + }, + "required": ["action", "file_path", "start_line", "end_line"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "get_all_text" + }, + "file_path": { + "type": "string", + "description": "要读取全部内容的文件路径。注意:如果文件过长,内容将存储在临时文件中并返回文件路径" + } + }, + "required": ["action", "file_path"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "append" + }, + "file_path": { + "type": "string", + "description": "要操作的文件路径" + }, + "content": { + "type": "string", + "description": "要追加到文件的内容" + } + }, + "required": ["action", "file_path", "content"], + "additionalProperties": false + } + ] +} From d4d785eff5b50a12b770b45770b51e35bf4f19f7 Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Fri, 1 Aug 2025 22:40:34 +0800 Subject: [PATCH 2/5] feat(jmanus): move tool parameter and description to resources --- .../prompts/startup-agents/en/default_agent/agent-config.yml | 2 -- .../prompts/startup-agents/zh/default_agent/agent-config.yml | 3 --- 2 files changed, 5 deletions(-) diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/startup-agents/en/default_agent/agent-config.yml b/spring-ai-alibaba-jmanus/src/main/resources/prompts/startup-agents/en/default_agent/agent-config.yml index 4ab80b277f..ac6d1fef9f 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/prompts/startup-agents/en/default_agent/agent-config.yml +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/startup-agents/en/default_agent/agent-config.yml @@ -4,7 +4,6 @@ agentDescription: A versatile default agent that can handle various user request availableToolKeys: - text_file_operator - terminate - - bash # Next Step Prompt Configuration nextStepPrompt: | @@ -27,7 +26,6 @@ nextStepPrompt: | Please remember: 1. Validate all inputs and paths before operations 2. Choose the most appropriate tool for each task: - - Use bash for system operations - Use text_file_operator for file operations - Use terminate when task is complete 3. Handle errors gracefully diff --git a/spring-ai-alibaba-jmanus/src/main/resources/prompts/startup-agents/zh/default_agent/agent-config.yml b/spring-ai-alibaba-jmanus/src/main/resources/prompts/startup-agents/zh/default_agent/agent-config.yml index 5875988241..680e5fe517 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/prompts/startup-agents/zh/default_agent/agent-config.yml +++ b/spring-ai-alibaba-jmanus/src/main/resources/prompts/startup-agents/zh/default_agent/agent-config.yml @@ -4,8 +4,6 @@ agentDescription: 一个多功能默认代理,可以使用文件操作和shell availableToolKeys: - text_file_operator - terminate - - bash - # 下一步提示配置 nextStepPrompt: | 你是一位专业的系统操作员,能够处理文件操作并执行shell命令。 @@ -27,7 +25,6 @@ nextStepPrompt: | 请记住: 1. 在操作前验证所有输入和路径 2. 为每个任务选择最合适的工具: - - 使用bash进行系统操作 - 使用text_file_operator进行文件操作 - 任务完成时使用terminate 3. 优雅地处理错误 From c4a667a0b23fce46d370bd81ccf4e462872d2442 Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Fri, 1 Aug 2025 22:43:43 +0800 Subject: [PATCH 3/5] feat(jmanus): move tool parameter and description to resources --- .../ai/example/manus/tool/TerminateTool.java | 2 -- .../example/manus/tool/ToolPromptManager.java | 5 ----- .../cloud/ai/example/manus/tool/bash/Bash.java | 4 +--- .../manus/tool/browser/BrowserUseTool.java | 8 +++----- .../example/manus/tool/code/PythonExecute.java | 6 ++---- .../ai/example/manus/tool/cron/CronTool.java | 7 +++---- .../manus/tool/database/DatabaseUseTool.java | 14 ++++++-------- .../manus/tool/innerStorage/FileMergeTool.java | 16 +++++++--------- .../tool/textOperator/TextFileOperator.java | 18 +++++++++--------- 9 files changed, 31 insertions(+), 49 deletions(-) diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/TerminateTool.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/TerminateTool.java index 5ea4d1da40..aade5634fc 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/TerminateTool.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/TerminateTool.java @@ -16,10 +16,8 @@ package com.alibaba.cloud.ai.example.manus.tool; import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; -import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import org.springframework.ai.openai.api.OpenAiApi; import java.util.List; diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/ToolPromptManager.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/ToolPromptManager.java index 6a2ddef6fa..17a1667402 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/ToolPromptManager.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/ToolPromptManager.java @@ -19,11 +19,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; -import org.springframework.util.StringUtils; - -import java.util.Locale; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; /** * Tool Prompt Manager that manages tool descriptions and parameters using PromptService diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/bash/Bash.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/bash/Bash.java index 9031d52148..76043929fe 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/bash/Bash.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/bash/Bash.java @@ -16,9 +16,9 @@ package com.alibaba.cloud.ai.example.manus.tool.bash; import com.alibaba.cloud.ai.example.manus.tool.AbstractBaseTool; +import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; import com.alibaba.cloud.ai.example.manus.tool.filesystem.UnifiedDirectoryManager; -import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; import com.fasterxml.jackson.databind.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -26,8 +26,6 @@ import java.util.ArrayList; import java.util.List; -import org.springframework.ai.openai.api.OpenAiApi; - public class Bash extends AbstractBaseTool { private final ObjectMapper objectMapper; diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/browser/BrowserUseTool.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/browser/BrowserUseTool.java index f808000b84..4d892b9109 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/browser/BrowserUseTool.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/browser/BrowserUseTool.java @@ -22,18 +22,18 @@ import com.alibaba.cloud.ai.example.manus.tool.browser.actions.ClickByElementAction; import com.alibaba.cloud.ai.example.manus.tool.browser.actions.CloseTabAction; import com.alibaba.cloud.ai.example.manus.tool.browser.actions.ExecuteJsAction; +import com.alibaba.cloud.ai.example.manus.tool.browser.actions.GetElementPositionByNameAction; import com.alibaba.cloud.ai.example.manus.tool.browser.actions.GetHtmlAction; import com.alibaba.cloud.ai.example.manus.tool.browser.actions.GetTextAction; import com.alibaba.cloud.ai.example.manus.tool.browser.actions.InputTextAction; import com.alibaba.cloud.ai.example.manus.tool.browser.actions.KeyEnterAction; +import com.alibaba.cloud.ai.example.manus.tool.browser.actions.MoveToAndClickAction; import com.alibaba.cloud.ai.example.manus.tool.browser.actions.NavigateAction; import com.alibaba.cloud.ai.example.manus.tool.browser.actions.NewTabAction; import com.alibaba.cloud.ai.example.manus.tool.browser.actions.RefreshAction; import com.alibaba.cloud.ai.example.manus.tool.browser.actions.ScreenShotAction; import com.alibaba.cloud.ai.example.manus.tool.browser.actions.ScrollAction; import com.alibaba.cloud.ai.example.manus.tool.browser.actions.SwitchTabAction; -import com.alibaba.cloud.ai.example.manus.tool.browser.actions.GetElementPositionByNameAction; -import com.alibaba.cloud.ai.example.manus.tool.browser.actions.MoveToAndClickAction; import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; import com.alibaba.cloud.ai.example.manus.tool.innerStorage.SmartContentSavingService; import com.fasterxml.jackson.databind.ObjectMapper; @@ -41,11 +41,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.HashMap; - -import org.springframework.ai.openai.api.OpenAiApi; public class BrowserUseTool extends AbstractBaseTool { diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/code/PythonExecute.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/code/PythonExecute.java index 5b63b2a6d4..99ff78db35 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/code/PythonExecute.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/code/PythonExecute.java @@ -15,17 +15,15 @@ */ package com.alibaba.cloud.ai.example.manus.tool.code; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.core.type.TypeReference; import com.alibaba.cloud.ai.example.manus.tool.AbstractBaseTool; import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; - +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.HashMap; import java.util.Map; -import org.springframework.ai.openai.api.OpenAiApi; public class PythonExecute extends AbstractBaseTool { diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/cron/CronTool.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/cron/CronTool.java index 97dd569327..fd0fcb6c14 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/cron/CronTool.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/cron/CronTool.java @@ -15,15 +15,14 @@ */ package com.alibaba.cloud.ai.example.manus.tool.cron; -import com.alibaba.cloud.ai.example.manus.tool.AbstractBaseTool; -import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; -import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; import com.alibaba.cloud.ai.example.manus.dynamic.cron.service.CronService; import com.alibaba.cloud.ai.example.manus.dynamic.cron.vo.CronConfig; +import com.alibaba.cloud.ai.example.manus.tool.AbstractBaseTool; +import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; +import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; import com.fasterxml.jackson.databind.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.ai.openai.api.OpenAiApi; public class CronTool extends AbstractBaseTool { diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/database/DatabaseUseTool.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/database/DatabaseUseTool.java index 24f7722634..ad0ef4bc89 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/database/DatabaseUseTool.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/database/DatabaseUseTool.java @@ -15,20 +15,18 @@ */ package com.alibaba.cloud.ai.example.manus.tool.database; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.ai.openai.api.OpenAiApi; - import com.alibaba.cloud.ai.example.manus.config.ManusProperties; import com.alibaba.cloud.ai.example.manus.tool.AbstractBaseTool; -import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; +import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; import com.alibaba.cloud.ai.example.manus.tool.database.action.ExecuteSqlAction; -import com.alibaba.cloud.ai.example.manus.tool.database.action.GetTableNameAction; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.alibaba.cloud.ai.example.manus.tool.database.action.GetDatasourceInfoAction; import com.alibaba.cloud.ai.example.manus.tool.database.action.GetTableIndexAction; import com.alibaba.cloud.ai.example.manus.tool.database.action.GetTableMetaAction; -import com.alibaba.cloud.ai.example.manus.tool.database.action.GetDatasourceInfoAction; +import com.alibaba.cloud.ai.example.manus.tool.database.action.GetTableNameAction; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.Map; diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/innerStorage/FileMergeTool.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/innerStorage/FileMergeTool.java index 4c6d9406b6..a7296320e6 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/innerStorage/FileMergeTool.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/innerStorage/FileMergeTool.java @@ -15,20 +15,18 @@ */ package com.alibaba.cloud.ai.example.manus.tool.innerStorage; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; -import java.util.List; - import com.alibaba.cloud.ai.example.manus.tool.AbstractBaseTool; -import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; +import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; import com.alibaba.cloud.ai.example.manus.tool.filesystem.UnifiedDirectoryManager; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.ai.openai.api.OpenAiApi; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.List; /** * File merge tool for merging single files into specified target folders, merging one diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/textOperator/TextFileOperator.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/textOperator/TextFileOperator.java index 84f3ec1982..3e2a5a1b4f 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/textOperator/TextFileOperator.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/textOperator/TextFileOperator.java @@ -15,21 +15,21 @@ */ package com.alibaba.cloud.ai.example.manus.tool.textOperator; -import java.io.*; -import java.nio.channels.FileChannel; -import java.nio.file.*; -import java.util.Map; - import com.alibaba.cloud.ai.example.manus.tool.AbstractBaseTool; +import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; import com.alibaba.cloud.ai.example.manus.tool.innerStorage.SmartContentSavingService; -import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; -import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.core.type.TypeReference; - +import com.fasterxml.jackson.databind.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.ai.openai.api.OpenAiApi; + +import java.io.IOException; +import java.nio.channels.FileChannel; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.Map; public class TextFileOperator extends AbstractBaseTool { From f947ba5441c1604da922ce59b98ed77c5641ea4d Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Fri, 1 Aug 2025 22:58:16 +0800 Subject: [PATCH 4/5] feat(jmanus): move tool parameter and description to resources --- .../ai/example/manus/tool/DocLoaderTool.java | 6 ++-- ...ssMode-DM_jsbIE.js => cssMode-CAKGNCPU.js} | 2 +- ...r2-D-w9PHYx.js => freemarker2-CmSOYFZj.js} | 2 +- ...ars-CU3IGK7R.js => handlebars-BLXzbXZR.js} | 2 +- .../{html-DM9_zIre.js => html-DO2OTq4R.js} | 2 +- ...lMode-DVekKSY6.js => htmlMode-BTRUnrkS.js} | 2 +- ...conify-CyasjfC7.js => iconify-B3l7reUz.js} | 2 +- .../{index-Dqcw8yKQ.js => index-BGKqtLX6.js} | 14 +++++----- .../{index-B35pCJSJ.js => index-C3sb7NYv.js} | 2 +- .../{index-DA9oYm7y.js => index-CNsQoPg8.js} | 6 ++-- .../{index-DXRRTLTq.js => index-CuGql25I.js} | 2 +- .../{index-CzTAyhzl.js => index-QLIAiQL6.js} | 2 +- .../{index-D2fTT4wr.js => index-rqS3tjXd.js} | 2 +- ...ipt-DNnN4kEa.js => javascript-C0XxeR-n.js} | 2 +- ...nMode-B8CiFQ0R.js => jsonMode-BNPGVg0I.js} | 2 +- ...{liquid-B5j_7Uvh.js => liquid-BFayS-os.js} | 2 +- .../{mdx-CDRD_3NO.js => mdx-DeQweMxo.js} | 2 +- ...Found-BSR8IgwZ.js => notFound-CVrU7YVW.js} | 2 +- ...{python-CM3gi6vP.js => python-a9hcFcOH.js} | 2 +- .../{razor-Bu5fGBlQ.js => razor-1sBWwWa2.js} | 2 +- ...idebar-BtIzguw3.js => sidebar-ON4PvQzg.js} | 2 +- ...{tsMode-xq1wJwnt.js => tsMode-_F3d8JBS.js} | 2 +- ...ipt-BEZDUO2m.js => typescript-Cfb9k-qV.js} | 2 +- ...age-fgXJFj_8.js => useMessage-BR4qCw-P.js} | 2 +- .../{xml-IzzTFP6G.js => xml-CXoMhdUk.js} | 2 +- .../{yaml-C27Xr4Pr.js => yaml-D4773nTm.js} | 2 +- .../src/main/resources/static/ui/index.html | 2 +- .../ui-vue3/src/base/i18n/index.ts | 28 +++++++++++++++---- 28 files changed, 58 insertions(+), 44 deletions(-) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{cssMode-DM_jsbIE.js => cssMode-CAKGNCPU.js} (99%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{freemarker2-D-w9PHYx.js => freemarker2-CmSOYFZj.js} (98%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{handlebars-CU3IGK7R.js => handlebars-BLXzbXZR.js} (96%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{html-DM9_zIre.js => html-DO2OTq4R.js} (95%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{htmlMode-DVekKSY6.js => htmlMode-BTRUnrkS.js} (99%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{iconify-CyasjfC7.js => iconify-B3l7reUz.js} (99%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{index-Dqcw8yKQ.js => index-BGKqtLX6.js} (99%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{index-B35pCJSJ.js => index-C3sb7NYv.js} (96%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{index-DA9oYm7y.js => index-CNsQoPg8.js} (97%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{index-DXRRTLTq.js => index-CuGql25I.js} (99%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{index-CzTAyhzl.js => index-QLIAiQL6.js} (99%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{index-D2fTT4wr.js => index-rqS3tjXd.js} (94%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{javascript-DNnN4kEa.js => javascript-C0XxeR-n.js} (81%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{jsonMode-B8CiFQ0R.js => jsonMode-BNPGVg0I.js} (99%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{liquid-B5j_7Uvh.js => liquid-BFayS-os.js} (94%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{mdx-CDRD_3NO.js => mdx-DeQweMxo.js} (95%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{notFound-BSR8IgwZ.js => notFound-CVrU7YVW.js} (84%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{python-CM3gi6vP.js => python-a9hcFcOH.js} (93%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{razor-Bu5fGBlQ.js => razor-1sBWwWa2.js} (97%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{sidebar-BtIzguw3.js => sidebar-ON4PvQzg.js} (99%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{tsMode-xq1wJwnt.js => tsMode-_F3d8JBS.js} (99%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{typescript-BEZDUO2m.js => typescript-Cfb9k-qV.js} (95%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{useMessage-fgXJFj_8.js => useMessage-BR4qCw-P.js} (95%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{xml-IzzTFP6G.js => xml-CXoMhdUk.js} (90%) rename spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/{yaml-C27Xr4Pr.js => yaml-D4773nTm.js} (94%) diff --git a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/DocLoaderTool.java b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/DocLoaderTool.java index d68f82140f..4fceeb8dd5 100644 --- a/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/DocLoaderTool.java +++ b/spring-ai-alibaba-jmanus/src/main/java/com/alibaba/cloud/ai/example/manus/tool/DocLoaderTool.java @@ -16,18 +16,16 @@ package com.alibaba.cloud.ai.example.manus.tool; import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; -import com.alibaba.cloud.ai.example.manus.tool.ToolPromptManager; import org.apache.commons.lang3.StringUtils; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.text.PDFTextStripper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - -import java.io.File; - import org.springframework.ai.openai.api.OpenAiApi; import org.springframework.ai.tool.function.FunctionToolCallback; +import java.io.File; + public class DocLoaderTool extends AbstractBaseTool { private static final Logger log = LoggerFactory.getLogger(DocLoaderTool.class); diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/cssMode-DM_jsbIE.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/cssMode-CAKGNCPU.js similarity index 99% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/cssMode-DM_jsbIE.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/cssMode-CAKGNCPU.js index d3814710a7..de090d296e 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/cssMode-DM_jsbIE.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/cssMode-CAKGNCPU.js @@ -1,4 +1,4 @@ -var Fe=Object.defineProperty;var Le=(e,n,i)=>n in e?Fe(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var k=(e,n,i)=>Le(e,typeof n!="symbol"?n+"":n,i);import{m as je}from"./index-Dqcw8yKQ.js";import"./index-DA9oYm7y.js";import"./iconify-CyasjfC7.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-fgXJFj_8.js";import"./index-D2fTT4wr.js";/*!----------------------------------------------------------------------------- +var Fe=Object.defineProperty;var Le=(e,n,i)=>n in e?Fe(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var k=(e,n,i)=>Le(e,typeof n!="symbol"?n+"":n,i);import{m as je}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/freemarker2-D-w9PHYx.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/freemarker2-CmSOYFZj.js similarity index 98% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/freemarker2-D-w9PHYx.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/freemarker2-CmSOYFZj.js index 3dc7066fb6..3ca31756bb 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/freemarker2-D-w9PHYx.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/freemarker2-CmSOYFZj.js @@ -1,4 +1,4 @@ -import{m as f}from"./index-Dqcw8yKQ.js";import"./index-DA9oYm7y.js";import"./iconify-CyasjfC7.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-fgXJFj_8.js";import"./index-D2fTT4wr.js";/*!----------------------------------------------------------------------------- +import{m as f}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/handlebars-CU3IGK7R.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/handlebars-BLXzbXZR.js similarity index 96% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/handlebars-CU3IGK7R.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/handlebars-BLXzbXZR.js index 7c0fc8e6fc..2b18a7aa29 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/handlebars-CU3IGK7R.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/handlebars-BLXzbXZR.js @@ -1,4 +1,4 @@ -import{m as i}from"./index-Dqcw8yKQ.js";import"./index-DA9oYm7y.js";import"./iconify-CyasjfC7.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-fgXJFj_8.js";import"./index-D2fTT4wr.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/html-DM9_zIre.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/html-DO2OTq4R.js similarity index 95% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/html-DM9_zIre.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/html-DO2OTq4R.js index 6d35ef6571..dfc31f6cb0 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/html-DM9_zIre.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/html-DO2OTq4R.js @@ -1,4 +1,4 @@ -import{m as s}from"./index-Dqcw8yKQ.js";import"./index-DA9oYm7y.js";import"./iconify-CyasjfC7.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-fgXJFj_8.js";import"./index-D2fTT4wr.js";/*!----------------------------------------------------------------------------- +import{m as s}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/htmlMode-DVekKSY6.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/htmlMode-BTRUnrkS.js similarity index 99% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/htmlMode-DVekKSY6.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/htmlMode-BTRUnrkS.js index cf6441d7b6..f5e28ed176 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/htmlMode-DVekKSY6.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/htmlMode-BTRUnrkS.js @@ -1,4 +1,4 @@ -var Be=Object.defineProperty;var $e=(e,n,i)=>n in e?Be(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var k=(e,n,i)=>$e(e,typeof n!="symbol"?n+"":n,i);import{m as qe}from"./index-Dqcw8yKQ.js";import"./index-DA9oYm7y.js";import"./iconify-CyasjfC7.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-fgXJFj_8.js";import"./index-D2fTT4wr.js";/*!----------------------------------------------------------------------------- +var Be=Object.defineProperty;var $e=(e,n,i)=>n in e?Be(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var k=(e,n,i)=>$e(e,typeof n!="symbol"?n+"":n,i);import{m as qe}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/iconify-CyasjfC7.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/iconify-B3l7reUz.js similarity index 99% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/iconify-CyasjfC7.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/iconify-B3l7reUz.js index 41495efd28..a14bc1e389 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/iconify-CyasjfC7.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/iconify-B3l7reUz.js @@ -1 +1 @@ -import{d as me,R as G}from"./index-DA9oYm7y.js";const se=/^[a-z0-9]+(-[a-z0-9]+)*$/,M=(e,n,o,i="")=>{const t=e.split(":");if(e.slice(0,1)==="@"){if(t.length<2||t.length>3)return null;i=t.shift().slice(1)}if(t.length>3||!t.length)return null;if(t.length>1){const c=t.pop(),l=t.pop(),f={provider:t.length>0?t[0]:i,prefix:l,name:c};return n&&!L(f)?null:f}const s=t[0],r=s.split("-");if(r.length>1){const c={provider:i,prefix:r.shift(),name:r.join("-")};return n&&!L(c)?null:c}if(o&&i===""){const c={provider:i,prefix:"",name:s};return n&&!L(c,o)?null:c}return null},L=(e,n)=>e?!!((n&&e.prefix===""||e.prefix)&&e.name):!1,re=Object.freeze({left:0,top:0,width:16,height:16}),A=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),N=Object.freeze({...re,...A}),z=Object.freeze({...N,body:"",hidden:!1});function ye(e,n){const o={};!e.hFlip!=!n.hFlip&&(o.hFlip=!0),!e.vFlip!=!n.vFlip&&(o.vFlip=!0);const i=((e.rotate||0)+(n.rotate||0))%4;return i&&(o.rotate=i),o}function B(e,n){const o=ye(e,n);for(const i in z)i in A?i in e&&!(i in o)&&(o[i]=A[i]):i in n?o[i]=n[i]:i in e&&(o[i]=e[i]);return o}function be(e,n){const o=e.icons,i=e.aliases||Object.create(null),t=Object.create(null);function s(r){if(o[r])return t[r]=[];if(!(r in t)){t[r]=null;const c=i[r]&&i[r].parent,l=c&&s(c);l&&(t[r]=[c].concat(l))}return t[r]}return Object.keys(o).concat(Object.keys(i)).forEach(s),t}function xe(e,n,o){const i=e.icons,t=e.aliases||Object.create(null);let s={};function r(c){s=B(i[c]||t[c],s)}return r(n),o.forEach(r),B(e,s)}function ce(e,n){const o=[];if(typeof e!="object"||typeof e.icons!="object")return o;e.not_found instanceof Array&&e.not_found.forEach(t=>{n(t,null),o.push(t)});const i=be(e);for(const t in i){const s=i[t];s&&(n(t,xe(e,t,s)),o.push(t))}return o}const Ie={provider:"",aliases:{},not_found:{},...re};function _(e,n){for(const o in n)if(o in e&&typeof e[o]!=typeof n[o])return!1;return!0}function le(e){if(typeof e!="object"||e===null)return null;const n=e;if(typeof n.prefix!="string"||!e.icons||typeof e.icons!="object"||!_(e,Ie))return null;const o=n.icons;for(const t in o){const s=o[t];if(!t||typeof s.body!="string"||!_(s,z))return null}const i=n.aliases||Object.create(null);for(const t in i){const s=i[t],r=s.parent;if(!t||typeof r!="string"||!o[r]&&!i[r]||!_(s,z))return null}return n}const K=Object.create(null);function we(e,n){return{provider:e,prefix:n,icons:Object.create(null),missing:new Set}}function k(e,n){const o=K[e]||(K[e]=Object.create(null));return o[n]||(o[n]=we(e,n))}function fe(e,n){return le(n)?ce(n,(o,i)=>{i?e.icons[o]=i:e.missing.add(o)}):[]}function ve(e,n,o){try{if(typeof o.body=="string")return e.icons[n]={...o},!0}catch{}return!1}let j=!1;function ue(e){return typeof e=="boolean"&&(j=e),j}function Se(e){const n=typeof e=="string"?M(e,!0,j):e;if(n){const o=k(n.provider,n.prefix),i=n.name;return o.icons[i]||(o.missing.has(i)?null:void 0)}}function ke(e,n){const o=M(e,!0,j);if(!o)return!1;const i=k(o.provider,o.prefix);return n?ve(i,o.name,n):(i.missing.add(o.name),!0)}function Te(e,n){if(typeof e!="object")return!1;if(typeof n!="string"&&(n=e.provider||""),j&&!n&&!e.prefix){let t=!1;return le(e)&&(e.prefix="",ce(e,(s,r)=>{ke(s,r)&&(t=!0)})),t}const o=e.prefix;if(!L({prefix:o,name:"a"}))return!1;const i=k(n,o);return!!fe(i,e)}const ae=Object.freeze({width:null,height:null}),de=Object.freeze({...ae,...A}),Ce=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Pe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function W(e,n,o){if(n===1)return e;if(o=o||100,typeof e=="number")return Math.ceil(e*n*o)/o;if(typeof e!="string")return e;const i=e.split(Ce);if(i===null||!i.length)return e;const t=[];let s=i.shift(),r=Pe.test(s);for(;;){if(r){const c=parseFloat(s);isNaN(c)?t.push(s):t.push(Math.ceil(c*n*o)/o)}else t.push(s);if(s=i.shift(),s===void 0)return t.join("");r=!r}}function je(e,n="defs"){let o="";const i=e.indexOf("<"+n);for(;i>=0;){const t=e.indexOf(">",i),s=e.indexOf("",s);if(r===-1)break;o+=e.slice(t+1,s).trim(),e=e.slice(0,i).trim()+e.slice(r+1)}return{defs:o,content:e}}function Ee(e,n){return e?""+e+""+n:n}function Le(e,n,o){const i=je(e);return Ee(i.defs,n+i.content+o)}const Fe=e=>e==="unset"||e==="undefined"||e==="none";function Oe(e,n){const o={...N,...e},i={...de,...n},t={left:o.left,top:o.top,width:o.width,height:o.height};let s=o.body;[o,i].forEach(g=>{const u=[],S=g.hFlip,w=g.vFlip;let x=g.rotate;S?w?x+=2:(u.push("translate("+(t.width+t.left).toString()+" "+(0-t.top).toString()+")"),u.push("scale(-1 1)"),t.top=t.left=0):w&&(u.push("translate("+(0-t.left).toString()+" "+(t.height+t.top).toString()+")"),u.push("scale(1 -1)"),t.top=t.left=0);let y;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:y=t.height/2+t.top,u.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:u.unshift("rotate(180 "+(t.width/2+t.left).toString()+" "+(t.height/2+t.top).toString()+")");break;case 3:y=t.width/2+t.left,u.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}x%2===1&&(t.left!==t.top&&(y=t.left,t.left=t.top,t.top=y),t.width!==t.height&&(y=t.width,t.width=t.height,t.height=y)),u.length&&(s=Le(s,'',""))});const r=i.width,c=i.height,l=t.width,f=t.height;let a,d;r===null?(d=c===null?"1em":c==="auto"?f:c,a=W(d,l/f)):(a=r==="auto"?l:r,d=c===null?W(a,f/l):c==="auto"?f:c);const p={},m=(g,u)=>{Fe(u)||(p[g]=u.toString())};m("width",a),m("height",d);const I=[t.left,t.top,l,f];return p.viewBox=I.join(" "),{attributes:p,viewBox:I,body:s}}const Ae=/\sid="(\S+)"/g,Me="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Ne=0;function Re(e,n=Me){const o=[];let i;for(;i=Ae.exec(e);)o.push(i[1]);if(!o.length)return e;const t="suffix"+(Math.random()*16777216|Date.now()).toString(16);return o.forEach(s=>{const r=typeof n=="function"?n(s):n+(Ne++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+r+t+"$3")}),e=e.replace(new RegExp(t,"g"),""),e}const Q=Object.create(null);function _e(e,n){Q[e]=n}function $(e){return Q[e]||Q[""]}function U(e){let n;if(typeof e.resources=="string")n=[e.resources];else if(n=e.resources,!(n instanceof Array)||!n.length)return null;return{resources:n,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const H=Object.create(null),C=["https://api.simplesvg.com","https://api.unisvg.com"],F=[];for(;C.length>0;)C.length===1||Math.random()>.5?F.push(C.shift()):F.push(C.pop());H[""]=U({resources:["https://api.iconify.design"].concat(F)});function De(e,n){const o=U(n);return o===null?!1:(H[e]=o,!0)}function V(e){return H[e]}const ze=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let J=ze();function Qe(e,n){const o=V(e);if(!o)return 0;let i;if(!o.maxURL)i=0;else{let t=0;o.resources.forEach(r=>{t=Math.max(t,r.length)});const s=n+".json?icons=";i=o.maxURL-t-o.path.length-s.length}return i}function $e(e){return e===404}const qe=(e,n,o)=>{const i=[],t=Qe(e,n),s="icons";let r={type:s,provider:e,prefix:n,icons:[]},c=0;return o.forEach((l,f)=>{c+=l.length+1,c>=t&&f>0&&(i.push(r),r={type:s,provider:e,prefix:n,icons:[]},c=l.length),r.icons.push(l)}),i.push(r),i};function Ue(e){if(typeof e=="string"){const n=V(e);if(n)return n.path}return"/"}const He=(e,n,o)=>{if(!J){o("abort",424);return}let i=Ue(n.provider);switch(n.type){case"icons":{const s=n.prefix,c=n.icons.join(","),l=new URLSearchParams({icons:c});i+=s+".json?"+l.toString();break}case"custom":{const s=n.uri;i+=s.slice(0,1)==="/"?s.slice(1):s;break}default:o("abort",400);return}let t=503;J(e+i).then(s=>{const r=s.status;if(r!==200){setTimeout(()=>{o($e(r)?"abort":"next",r)});return}return t=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?o("abort",s):o("next",t)});return}setTimeout(()=>{o("success",s)})}).catch(()=>{o("next",t)})},Ve={prepare:qe,send:He};function Ge(e){const n={loaded:[],missing:[],pending:[]},o=Object.create(null);e.sort((t,s)=>t.provider!==s.provider?t.provider.localeCompare(s.provider):t.prefix!==s.prefix?t.prefix.localeCompare(s.prefix):t.name.localeCompare(s.name));let i={provider:"",prefix:"",name:""};return e.forEach(t=>{if(i.name===t.name&&i.prefix===t.prefix&&i.provider===t.provider)return;i=t;const s=t.provider,r=t.prefix,c=t.name,l=o[s]||(o[s]=Object.create(null)),f=l[r]||(l[r]=k(s,r));let a;c in f.icons?a=n.loaded:r===""||f.missing.has(c)?a=n.missing:a=n.pending;const d={provider:s,prefix:r,name:c};a.push(d)}),n}function he(e,n){e.forEach(o=>{const i=o.loaderCallbacks;i&&(o.loaderCallbacks=i.filter(t=>t.id!==n))})}function Be(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const n=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!n.length)return;let o=!1;const i=e.provider,t=e.prefix;n.forEach(s=>{const r=s.icons,c=r.pending.length;r.pending=r.pending.filter(l=>{if(l.prefix!==t)return!0;const f=l.name;if(e.icons[f])r.loaded.push({provider:i,prefix:t,name:f});else if(e.missing.has(f))r.missing.push({provider:i,prefix:t,name:f});else return o=!0,!0;return!1}),r.pending.length!==c&&(o||he([e],s.id),s.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),s.abort))})}))}let Ke=0;function We(e,n,o){const i=Ke++,t=he.bind(null,o,i);if(!n.pending.length)return t;const s={id:i,icons:n,callback:e,abort:t};return o.forEach(r=>{(r.loaderCallbacks||(r.loaderCallbacks=[])).push(s)}),t}function Je(e,n=!0,o=!1){const i=[];return e.forEach(t=>{const s=typeof t=="string"?M(t,n,o):t;s&&i.push(s)}),i}var Xe={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Ye(e,n,o,i){const t=e.resources.length,s=e.random?Math.floor(Math.random()*t):e.index;let r;if(e.random){let h=e.resources.slice(0);for(r=[];h.length>1;){const b=Math.floor(Math.random()*h.length);r.push(h[b]),h=h.slice(0,b).concat(h.slice(b+1))}r=r.concat(h)}else r=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let l="pending",f=0,a,d=null,p=[],m=[];typeof i=="function"&&m.push(i);function I(){d&&(clearTimeout(d),d=null)}function g(){l==="pending"&&(l="aborted"),I(),p.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),p=[]}function u(h,b){b&&(m=[]),typeof h=="function"&&m.push(h)}function S(){return{startTime:c,payload:n,status:l,queriesSent:f,queriesPending:p.length,subscribe:u,abort:g}}function w(){l="failed",m.forEach(h=>{h(void 0,a)})}function x(){p.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),p=[]}function y(h,b,T){const E=b!=="success";switch(p=p.filter(v=>v!==h),l){case"pending":break;case"failed":if(E||!e.dataAfterTimeout)return;break;default:return}if(b==="abort"){a=T,w();return}if(E){a=T,p.length||(r.length?R():w());return}if(I(),x(),!e.random){const v=e.resources.indexOf(h.resource);v!==-1&&v!==e.index&&(e.index=v)}l="completed",m.forEach(v=>{v(T)})}function R(){if(l!=="pending")return;I();const h=r.shift();if(h===void 0){if(p.length){d=setTimeout(()=>{I(),l==="pending"&&(x(),w())},e.timeout);return}w();return}const b={status:"pending",resource:h,callback:(T,E)=>{y(b,T,E)}};p.push(b),f++,d=setTimeout(R,e.rotate),o(h,n,b.callback)}return setTimeout(R),S}function pe(e){const n={...Xe,...e};let o=[];function i(){o=o.filter(c=>c().status==="pending")}function t(c,l,f){const a=Ye(n,c,l,(d,p)=>{i(),f&&f(d,p)});return o.push(a),a}function s(c){return o.find(l=>c(l))||null}return{query:t,find:s,setIndex:c=>{n.index=c},getIndex:()=>n.index,cleanup:i}}function X(){}const D=Object.create(null);function Ze(e){if(!D[e]){const n=V(e);if(!n)return;const o=pe(n),i={config:n,redundancy:o};D[e]=i}return D[e]}function et(e,n,o){let i,t;if(typeof e=="string"){const s=$(e);if(!s)return o(void 0,424),X;t=s.send;const r=Ze(e);r&&(i=r.redundancy)}else{const s=U(e);if(s){i=pe(s);const r=e.resources?e.resources[0]:"",c=$(r);c&&(t=c.send)}}return!i||!t?(o(void 0,424),X):i.query(n,t,o)().abort}function Y(){}function tt(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Be(e)}))}function nt(e){const n=[],o=[];return e.forEach(i=>{(i.match(se)?n:o).push(i)}),{valid:n,invalid:o}}function P(e,n,o){function i(){const t=e.pendingIcons;n.forEach(s=>{t&&t.delete(s),e.icons[s]||e.missing.add(s)})}if(o&&typeof o=="object")try{if(!fe(e,o).length){i();return}}catch(t){console.error(t)}i(),tt(e)}function Z(e,n){e instanceof Promise?e.then(o=>{n(o)}).catch(()=>{n(null)}):n(e)}function ot(e,n){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(n).sort():e.iconsToLoad=n,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:o,prefix:i}=e,t=e.iconsToLoad;if(delete e.iconsToLoad,!t||!t.length)return;const s=e.loadIcon;if(e.loadIcons&&(t.length>1||!s)){Z(e.loadIcons(t,i,o),a=>{P(e,t,a)});return}if(s){t.forEach(a=>{const d=s(a,i,o);Z(d,p=>{const m=p?{prefix:i,icons:{[a]:p}}:null;P(e,[a],m)})});return}const{valid:r,invalid:c}=nt(t);if(c.length&&P(e,c,null),!r.length)return;const l=i.match(se)?$(o):null;if(!l){P(e,r,null);return}l.prepare(o,i,r).forEach(a=>{et(o,a,d=>{P(e,a.icons,d)})})}))}const it=(e,n)=>{const o=Je(e,!0,ue()),i=Ge(o);if(!i.pending.length){let l=!0;return n&&setTimeout(()=>{l&&n(i.loaded,i.missing,i.pending,Y)}),()=>{l=!1}}const t=Object.create(null),s=[];let r,c;return i.pending.forEach(l=>{const{provider:f,prefix:a}=l;if(a===c&&f===r)return;r=f,c=a,s.push(k(f,a));const d=t[f]||(t[f]=Object.create(null));d[a]||(d[a]=[])}),i.pending.forEach(l=>{const{provider:f,prefix:a,name:d}=l,p=k(f,a),m=p.pendingIcons||(p.pendingIcons=new Set);m.has(d)||(m.add(d),t[f][a].push(d))}),s.forEach(l=>{const f=t[l.provider][l.prefix];f.length&&ot(l,f)}),n?We(n,i,s):Y};function st(e,n){const o={...e};for(const i in n){const t=n[i],s=typeof t;i in ae?(t===null||t&&(s==="string"||s==="number"))&&(o[i]=t):s===typeof o[i]&&(o[i]=i==="rotate"?t%4:t)}return o}const rt=/[\s,]+/;function ct(e,n){n.split(rt).forEach(o=>{switch(o.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function lt(e,n=0){const o=e.replace(/^-?[0-9.]*/,"");function i(t){for(;t<0;)t+=4;return t%4}if(o===""){const t=parseInt(e);return isNaN(t)?0:i(t)}else if(o!==e){let t=0;switch(o){case"%":t=25;break;case"deg":t=90}if(t){let s=parseFloat(e.slice(0,e.length-o.length));return isNaN(s)?0:(s=s/t,s%1===0?i(s):0)}}return n}function ft(e,n){let o=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in n)o+=" "+i+'="'+n[i]+'"';return'"+e+""}function ut(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function at(e){return"data:image/svg+xml,"+ut(e)}function dt(e){return'url("'+at(e)+'")'}const ee={...de,inline:!1},ht={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},pt={display:"inline-block"},q={backgroundColor:"currentColor"},ge={backgroundColor:"transparent"},te={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},ne={webkitMask:q,mask:q,background:ge};for(const e in ne){const n=ne[e];for(const o in te)n[e+o]=te[o]}const O={};["horizontal","vertical"].forEach(e=>{const n=e.slice(0,1)+"Flip";O[e+"-flip"]=n,O[e.slice(0,1)+"-flip"]=n,O[e+"Flip"]=n});function oe(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const ie=(e,n)=>{const o=st(ee,n),i={...ht},t=n.mode||"svg",s={},r=n.style,c=typeof r=="object"&&!(r instanceof Array)?r:{};for(let g in n){const u=n[g];if(u!==void 0)switch(g){case"icon":case"style":case"onLoad":case"mode":case"ssr":break;case"inline":case"hFlip":case"vFlip":o[g]=u===!0||u==="true"||u===1;break;case"flip":typeof u=="string"&&ct(o,u);break;case"color":s.color=u;break;case"rotate":typeof u=="string"?o[g]=lt(u):typeof u=="number"&&(o[g]=u);break;case"ariaHidden":case"aria-hidden":u!==!0&&u!=="true"&&delete i["aria-hidden"];break;default:{const S=O[g];S?(u===!0||u==="true"||u===1)&&(o[S]=!0):ee[g]===void 0&&(i[g]=u)}}}const l=Oe(e,o),f=l.attributes;if(o.inline&&(s.verticalAlign="-0.125em"),t==="svg"){i.style={...s,...c},Object.assign(i,f);let g=0,u=n.id;return typeof u=="string"&&(u=u.replace(/-/g,"_")),i.innerHTML=Re(l.body,u?()=>u+"ID"+g++:"iconifyVue"),G("svg",i)}const{body:a,width:d,height:p}=e,m=t==="mask"||(t==="bg"?!1:a.indexOf("currentColor")!==-1),I=ft(a,{...f,width:d+"",height:p+""});return i.style={...s,"--svg":dt(I),width:oe(f.width),height:oe(f.height),...pt,...m?q:ge,...c},G("span",i)};ue(!0);_e("",Ve);if(typeof document<"u"&&typeof window<"u"){const e=window;if(e.IconifyPreload!==void 0){const n=e.IconifyPreload,o="Invalid IconifyPreload syntax.";typeof n=="object"&&n!==null&&(n instanceof Array?n:[n]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!Te(i))&&console.error(o)}catch{console.error(o)}})}if(e.IconifyProviders!==void 0){const n=e.IconifyProviders;if(typeof n=="object"&&n!==null)for(let o in n){const i="IconifyProviders["+o+"] is invalid.";try{const t=n[o];if(typeof t!="object"||!t||t.resources===void 0)continue;De(o,t)||console.error(i)}catch{console.error(i)}}}}const gt={...N,body:""},yt=me({inheritAttrs:!1,data(){return{_name:"",_loadingIcon:null,iconMounted:!1,counter:0}},mounted(){this.iconMounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(e,n,o){if(typeof e=="object"&&e!==null&&typeof e.body=="string")return this._name="",this.abortLoading(),{data:e};let i;if(typeof e!="string"||(i=M(e,!1,!0))===null)return this.abortLoading(),null;let t=Se(i);if(!t)return(!this._loadingIcon||this._loadingIcon.name!==e)&&(this.abortLoading(),this._name="",t!==null&&(this._loadingIcon={name:e,abort:it([i],()=>{this.counter++})})),null;if(this.abortLoading(),this._name!==e&&(this._name=e,n&&n(e)),o){t=Object.assign({},t);const r=o(t.body,i.name,i.prefix,i.provider);typeof r=="string"&&(t.body=r)}const s=["iconify"];return i.prefix!==""&&s.push("iconify--"+i.prefix),i.provider!==""&&s.push("iconify--"+i.provider),{data:t,classes:s}}},render(){this.counter;const e=this.$attrs,n=this.iconMounted||e.ssr?this.getIcon(e.icon,e.onLoad,e.customise):null;if(!n)return ie(gt,e);let o=e;return n.classes&&(o={...e,class:(typeof e.class=="string"?e.class+" ":"")+n.classes.join(" ")}),ie({...N,...n.data},o)}});export{yt as I}; +import{d as me,R as G}from"./index-CNsQoPg8.js";const se=/^[a-z0-9]+(-[a-z0-9]+)*$/,M=(e,n,o,i="")=>{const t=e.split(":");if(e.slice(0,1)==="@"){if(t.length<2||t.length>3)return null;i=t.shift().slice(1)}if(t.length>3||!t.length)return null;if(t.length>1){const c=t.pop(),l=t.pop(),f={provider:t.length>0?t[0]:i,prefix:l,name:c};return n&&!L(f)?null:f}const s=t[0],r=s.split("-");if(r.length>1){const c={provider:i,prefix:r.shift(),name:r.join("-")};return n&&!L(c)?null:c}if(o&&i===""){const c={provider:i,prefix:"",name:s};return n&&!L(c,o)?null:c}return null},L=(e,n)=>e?!!((n&&e.prefix===""||e.prefix)&&e.name):!1,re=Object.freeze({left:0,top:0,width:16,height:16}),A=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),N=Object.freeze({...re,...A}),z=Object.freeze({...N,body:"",hidden:!1});function ye(e,n){const o={};!e.hFlip!=!n.hFlip&&(o.hFlip=!0),!e.vFlip!=!n.vFlip&&(o.vFlip=!0);const i=((e.rotate||0)+(n.rotate||0))%4;return i&&(o.rotate=i),o}function B(e,n){const o=ye(e,n);for(const i in z)i in A?i in e&&!(i in o)&&(o[i]=A[i]):i in n?o[i]=n[i]:i in e&&(o[i]=e[i]);return o}function be(e,n){const o=e.icons,i=e.aliases||Object.create(null),t=Object.create(null);function s(r){if(o[r])return t[r]=[];if(!(r in t)){t[r]=null;const c=i[r]&&i[r].parent,l=c&&s(c);l&&(t[r]=[c].concat(l))}return t[r]}return Object.keys(o).concat(Object.keys(i)).forEach(s),t}function xe(e,n,o){const i=e.icons,t=e.aliases||Object.create(null);let s={};function r(c){s=B(i[c]||t[c],s)}return r(n),o.forEach(r),B(e,s)}function ce(e,n){const o=[];if(typeof e!="object"||typeof e.icons!="object")return o;e.not_found instanceof Array&&e.not_found.forEach(t=>{n(t,null),o.push(t)});const i=be(e);for(const t in i){const s=i[t];s&&(n(t,xe(e,t,s)),o.push(t))}return o}const Ie={provider:"",aliases:{},not_found:{},...re};function _(e,n){for(const o in n)if(o in e&&typeof e[o]!=typeof n[o])return!1;return!0}function le(e){if(typeof e!="object"||e===null)return null;const n=e;if(typeof n.prefix!="string"||!e.icons||typeof e.icons!="object"||!_(e,Ie))return null;const o=n.icons;for(const t in o){const s=o[t];if(!t||typeof s.body!="string"||!_(s,z))return null}const i=n.aliases||Object.create(null);for(const t in i){const s=i[t],r=s.parent;if(!t||typeof r!="string"||!o[r]&&!i[r]||!_(s,z))return null}return n}const K=Object.create(null);function we(e,n){return{provider:e,prefix:n,icons:Object.create(null),missing:new Set}}function k(e,n){const o=K[e]||(K[e]=Object.create(null));return o[n]||(o[n]=we(e,n))}function fe(e,n){return le(n)?ce(n,(o,i)=>{i?e.icons[o]=i:e.missing.add(o)}):[]}function ve(e,n,o){try{if(typeof o.body=="string")return e.icons[n]={...o},!0}catch{}return!1}let j=!1;function ue(e){return typeof e=="boolean"&&(j=e),j}function Se(e){const n=typeof e=="string"?M(e,!0,j):e;if(n){const o=k(n.provider,n.prefix),i=n.name;return o.icons[i]||(o.missing.has(i)?null:void 0)}}function ke(e,n){const o=M(e,!0,j);if(!o)return!1;const i=k(o.provider,o.prefix);return n?ve(i,o.name,n):(i.missing.add(o.name),!0)}function Te(e,n){if(typeof e!="object")return!1;if(typeof n!="string"&&(n=e.provider||""),j&&!n&&!e.prefix){let t=!1;return le(e)&&(e.prefix="",ce(e,(s,r)=>{ke(s,r)&&(t=!0)})),t}const o=e.prefix;if(!L({prefix:o,name:"a"}))return!1;const i=k(n,o);return!!fe(i,e)}const ae=Object.freeze({width:null,height:null}),de=Object.freeze({...ae,...A}),Ce=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Pe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function W(e,n,o){if(n===1)return e;if(o=o||100,typeof e=="number")return Math.ceil(e*n*o)/o;if(typeof e!="string")return e;const i=e.split(Ce);if(i===null||!i.length)return e;const t=[];let s=i.shift(),r=Pe.test(s);for(;;){if(r){const c=parseFloat(s);isNaN(c)?t.push(s):t.push(Math.ceil(c*n*o)/o)}else t.push(s);if(s=i.shift(),s===void 0)return t.join("");r=!r}}function je(e,n="defs"){let o="";const i=e.indexOf("<"+n);for(;i>=0;){const t=e.indexOf(">",i),s=e.indexOf("",s);if(r===-1)break;o+=e.slice(t+1,s).trim(),e=e.slice(0,i).trim()+e.slice(r+1)}return{defs:o,content:e}}function Ee(e,n){return e?""+e+""+n:n}function Le(e,n,o){const i=je(e);return Ee(i.defs,n+i.content+o)}const Fe=e=>e==="unset"||e==="undefined"||e==="none";function Oe(e,n){const o={...N,...e},i={...de,...n},t={left:o.left,top:o.top,width:o.width,height:o.height};let s=o.body;[o,i].forEach(g=>{const u=[],S=g.hFlip,w=g.vFlip;let x=g.rotate;S?w?x+=2:(u.push("translate("+(t.width+t.left).toString()+" "+(0-t.top).toString()+")"),u.push("scale(-1 1)"),t.top=t.left=0):w&&(u.push("translate("+(0-t.left).toString()+" "+(t.height+t.top).toString()+")"),u.push("scale(1 -1)"),t.top=t.left=0);let y;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:y=t.height/2+t.top,u.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:u.unshift("rotate(180 "+(t.width/2+t.left).toString()+" "+(t.height/2+t.top).toString()+")");break;case 3:y=t.width/2+t.left,u.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}x%2===1&&(t.left!==t.top&&(y=t.left,t.left=t.top,t.top=y),t.width!==t.height&&(y=t.width,t.width=t.height,t.height=y)),u.length&&(s=Le(s,'',""))});const r=i.width,c=i.height,l=t.width,f=t.height;let a,d;r===null?(d=c===null?"1em":c==="auto"?f:c,a=W(d,l/f)):(a=r==="auto"?l:r,d=c===null?W(a,f/l):c==="auto"?f:c);const p={},m=(g,u)=>{Fe(u)||(p[g]=u.toString())};m("width",a),m("height",d);const I=[t.left,t.top,l,f];return p.viewBox=I.join(" "),{attributes:p,viewBox:I,body:s}}const Ae=/\sid="(\S+)"/g,Me="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Ne=0;function Re(e,n=Me){const o=[];let i;for(;i=Ae.exec(e);)o.push(i[1]);if(!o.length)return e;const t="suffix"+(Math.random()*16777216|Date.now()).toString(16);return o.forEach(s=>{const r=typeof n=="function"?n(s):n+(Ne++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+r+t+"$3")}),e=e.replace(new RegExp(t,"g"),""),e}const Q=Object.create(null);function _e(e,n){Q[e]=n}function $(e){return Q[e]||Q[""]}function U(e){let n;if(typeof e.resources=="string")n=[e.resources];else if(n=e.resources,!(n instanceof Array)||!n.length)return null;return{resources:n,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const H=Object.create(null),C=["https://api.simplesvg.com","https://api.unisvg.com"],F=[];for(;C.length>0;)C.length===1||Math.random()>.5?F.push(C.shift()):F.push(C.pop());H[""]=U({resources:["https://api.iconify.design"].concat(F)});function De(e,n){const o=U(n);return o===null?!1:(H[e]=o,!0)}function V(e){return H[e]}const ze=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let J=ze();function Qe(e,n){const o=V(e);if(!o)return 0;let i;if(!o.maxURL)i=0;else{let t=0;o.resources.forEach(r=>{t=Math.max(t,r.length)});const s=n+".json?icons=";i=o.maxURL-t-o.path.length-s.length}return i}function $e(e){return e===404}const qe=(e,n,o)=>{const i=[],t=Qe(e,n),s="icons";let r={type:s,provider:e,prefix:n,icons:[]},c=0;return o.forEach((l,f)=>{c+=l.length+1,c>=t&&f>0&&(i.push(r),r={type:s,provider:e,prefix:n,icons:[]},c=l.length),r.icons.push(l)}),i.push(r),i};function Ue(e){if(typeof e=="string"){const n=V(e);if(n)return n.path}return"/"}const He=(e,n,o)=>{if(!J){o("abort",424);return}let i=Ue(n.provider);switch(n.type){case"icons":{const s=n.prefix,c=n.icons.join(","),l=new URLSearchParams({icons:c});i+=s+".json?"+l.toString();break}case"custom":{const s=n.uri;i+=s.slice(0,1)==="/"?s.slice(1):s;break}default:o("abort",400);return}let t=503;J(e+i).then(s=>{const r=s.status;if(r!==200){setTimeout(()=>{o($e(r)?"abort":"next",r)});return}return t=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?o("abort",s):o("next",t)});return}setTimeout(()=>{o("success",s)})}).catch(()=>{o("next",t)})},Ve={prepare:qe,send:He};function Ge(e){const n={loaded:[],missing:[],pending:[]},o=Object.create(null);e.sort((t,s)=>t.provider!==s.provider?t.provider.localeCompare(s.provider):t.prefix!==s.prefix?t.prefix.localeCompare(s.prefix):t.name.localeCompare(s.name));let i={provider:"",prefix:"",name:""};return e.forEach(t=>{if(i.name===t.name&&i.prefix===t.prefix&&i.provider===t.provider)return;i=t;const s=t.provider,r=t.prefix,c=t.name,l=o[s]||(o[s]=Object.create(null)),f=l[r]||(l[r]=k(s,r));let a;c in f.icons?a=n.loaded:r===""||f.missing.has(c)?a=n.missing:a=n.pending;const d={provider:s,prefix:r,name:c};a.push(d)}),n}function he(e,n){e.forEach(o=>{const i=o.loaderCallbacks;i&&(o.loaderCallbacks=i.filter(t=>t.id!==n))})}function Be(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const n=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!n.length)return;let o=!1;const i=e.provider,t=e.prefix;n.forEach(s=>{const r=s.icons,c=r.pending.length;r.pending=r.pending.filter(l=>{if(l.prefix!==t)return!0;const f=l.name;if(e.icons[f])r.loaded.push({provider:i,prefix:t,name:f});else if(e.missing.has(f))r.missing.push({provider:i,prefix:t,name:f});else return o=!0,!0;return!1}),r.pending.length!==c&&(o||he([e],s.id),s.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),s.abort))})}))}let Ke=0;function We(e,n,o){const i=Ke++,t=he.bind(null,o,i);if(!n.pending.length)return t;const s={id:i,icons:n,callback:e,abort:t};return o.forEach(r=>{(r.loaderCallbacks||(r.loaderCallbacks=[])).push(s)}),t}function Je(e,n=!0,o=!1){const i=[];return e.forEach(t=>{const s=typeof t=="string"?M(t,n,o):t;s&&i.push(s)}),i}var Xe={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Ye(e,n,o,i){const t=e.resources.length,s=e.random?Math.floor(Math.random()*t):e.index;let r;if(e.random){let h=e.resources.slice(0);for(r=[];h.length>1;){const b=Math.floor(Math.random()*h.length);r.push(h[b]),h=h.slice(0,b).concat(h.slice(b+1))}r=r.concat(h)}else r=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let l="pending",f=0,a,d=null,p=[],m=[];typeof i=="function"&&m.push(i);function I(){d&&(clearTimeout(d),d=null)}function g(){l==="pending"&&(l="aborted"),I(),p.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),p=[]}function u(h,b){b&&(m=[]),typeof h=="function"&&m.push(h)}function S(){return{startTime:c,payload:n,status:l,queriesSent:f,queriesPending:p.length,subscribe:u,abort:g}}function w(){l="failed",m.forEach(h=>{h(void 0,a)})}function x(){p.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),p=[]}function y(h,b,T){const E=b!=="success";switch(p=p.filter(v=>v!==h),l){case"pending":break;case"failed":if(E||!e.dataAfterTimeout)return;break;default:return}if(b==="abort"){a=T,w();return}if(E){a=T,p.length||(r.length?R():w());return}if(I(),x(),!e.random){const v=e.resources.indexOf(h.resource);v!==-1&&v!==e.index&&(e.index=v)}l="completed",m.forEach(v=>{v(T)})}function R(){if(l!=="pending")return;I();const h=r.shift();if(h===void 0){if(p.length){d=setTimeout(()=>{I(),l==="pending"&&(x(),w())},e.timeout);return}w();return}const b={status:"pending",resource:h,callback:(T,E)=>{y(b,T,E)}};p.push(b),f++,d=setTimeout(R,e.rotate),o(h,n,b.callback)}return setTimeout(R),S}function pe(e){const n={...Xe,...e};let o=[];function i(){o=o.filter(c=>c().status==="pending")}function t(c,l,f){const a=Ye(n,c,l,(d,p)=>{i(),f&&f(d,p)});return o.push(a),a}function s(c){return o.find(l=>c(l))||null}return{query:t,find:s,setIndex:c=>{n.index=c},getIndex:()=>n.index,cleanup:i}}function X(){}const D=Object.create(null);function Ze(e){if(!D[e]){const n=V(e);if(!n)return;const o=pe(n),i={config:n,redundancy:o};D[e]=i}return D[e]}function et(e,n,o){let i,t;if(typeof e=="string"){const s=$(e);if(!s)return o(void 0,424),X;t=s.send;const r=Ze(e);r&&(i=r.redundancy)}else{const s=U(e);if(s){i=pe(s);const r=e.resources?e.resources[0]:"",c=$(r);c&&(t=c.send)}}return!i||!t?(o(void 0,424),X):i.query(n,t,o)().abort}function Y(){}function tt(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Be(e)}))}function nt(e){const n=[],o=[];return e.forEach(i=>{(i.match(se)?n:o).push(i)}),{valid:n,invalid:o}}function P(e,n,o){function i(){const t=e.pendingIcons;n.forEach(s=>{t&&t.delete(s),e.icons[s]||e.missing.add(s)})}if(o&&typeof o=="object")try{if(!fe(e,o).length){i();return}}catch(t){console.error(t)}i(),tt(e)}function Z(e,n){e instanceof Promise?e.then(o=>{n(o)}).catch(()=>{n(null)}):n(e)}function ot(e,n){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(n).sort():e.iconsToLoad=n,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:o,prefix:i}=e,t=e.iconsToLoad;if(delete e.iconsToLoad,!t||!t.length)return;const s=e.loadIcon;if(e.loadIcons&&(t.length>1||!s)){Z(e.loadIcons(t,i,o),a=>{P(e,t,a)});return}if(s){t.forEach(a=>{const d=s(a,i,o);Z(d,p=>{const m=p?{prefix:i,icons:{[a]:p}}:null;P(e,[a],m)})});return}const{valid:r,invalid:c}=nt(t);if(c.length&&P(e,c,null),!r.length)return;const l=i.match(se)?$(o):null;if(!l){P(e,r,null);return}l.prepare(o,i,r).forEach(a=>{et(o,a,d=>{P(e,a.icons,d)})})}))}const it=(e,n)=>{const o=Je(e,!0,ue()),i=Ge(o);if(!i.pending.length){let l=!0;return n&&setTimeout(()=>{l&&n(i.loaded,i.missing,i.pending,Y)}),()=>{l=!1}}const t=Object.create(null),s=[];let r,c;return i.pending.forEach(l=>{const{provider:f,prefix:a}=l;if(a===c&&f===r)return;r=f,c=a,s.push(k(f,a));const d=t[f]||(t[f]=Object.create(null));d[a]||(d[a]=[])}),i.pending.forEach(l=>{const{provider:f,prefix:a,name:d}=l,p=k(f,a),m=p.pendingIcons||(p.pendingIcons=new Set);m.has(d)||(m.add(d),t[f][a].push(d))}),s.forEach(l=>{const f=t[l.provider][l.prefix];f.length&&ot(l,f)}),n?We(n,i,s):Y};function st(e,n){const o={...e};for(const i in n){const t=n[i],s=typeof t;i in ae?(t===null||t&&(s==="string"||s==="number"))&&(o[i]=t):s===typeof o[i]&&(o[i]=i==="rotate"?t%4:t)}return o}const rt=/[\s,]+/;function ct(e,n){n.split(rt).forEach(o=>{switch(o.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function lt(e,n=0){const o=e.replace(/^-?[0-9.]*/,"");function i(t){for(;t<0;)t+=4;return t%4}if(o===""){const t=parseInt(e);return isNaN(t)?0:i(t)}else if(o!==e){let t=0;switch(o){case"%":t=25;break;case"deg":t=90}if(t){let s=parseFloat(e.slice(0,e.length-o.length));return isNaN(s)?0:(s=s/t,s%1===0?i(s):0)}}return n}function ft(e,n){let o=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in n)o+=" "+i+'="'+n[i]+'"';return'"+e+""}function ut(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function at(e){return"data:image/svg+xml,"+ut(e)}function dt(e){return'url("'+at(e)+'")'}const ee={...de,inline:!1},ht={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},pt={display:"inline-block"},q={backgroundColor:"currentColor"},ge={backgroundColor:"transparent"},te={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},ne={webkitMask:q,mask:q,background:ge};for(const e in ne){const n=ne[e];for(const o in te)n[e+o]=te[o]}const O={};["horizontal","vertical"].forEach(e=>{const n=e.slice(0,1)+"Flip";O[e+"-flip"]=n,O[e.slice(0,1)+"-flip"]=n,O[e+"Flip"]=n});function oe(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const ie=(e,n)=>{const o=st(ee,n),i={...ht},t=n.mode||"svg",s={},r=n.style,c=typeof r=="object"&&!(r instanceof Array)?r:{};for(let g in n){const u=n[g];if(u!==void 0)switch(g){case"icon":case"style":case"onLoad":case"mode":case"ssr":break;case"inline":case"hFlip":case"vFlip":o[g]=u===!0||u==="true"||u===1;break;case"flip":typeof u=="string"&&ct(o,u);break;case"color":s.color=u;break;case"rotate":typeof u=="string"?o[g]=lt(u):typeof u=="number"&&(o[g]=u);break;case"ariaHidden":case"aria-hidden":u!==!0&&u!=="true"&&delete i["aria-hidden"];break;default:{const S=O[g];S?(u===!0||u==="true"||u===1)&&(o[S]=!0):ee[g]===void 0&&(i[g]=u)}}}const l=Oe(e,o),f=l.attributes;if(o.inline&&(s.verticalAlign="-0.125em"),t==="svg"){i.style={...s,...c},Object.assign(i,f);let g=0,u=n.id;return typeof u=="string"&&(u=u.replace(/-/g,"_")),i.innerHTML=Re(l.body,u?()=>u+"ID"+g++:"iconifyVue"),G("svg",i)}const{body:a,width:d,height:p}=e,m=t==="mask"||(t==="bg"?!1:a.indexOf("currentColor")!==-1),I=ft(a,{...f,width:d+"",height:p+""});return i.style={...s,"--svg":dt(I),width:oe(f.width),height:oe(f.height),...pt,...m?q:ge,...c},G("span",i)};ue(!0);_e("",Ve);if(typeof document<"u"&&typeof window<"u"){const e=window;if(e.IconifyPreload!==void 0){const n=e.IconifyPreload,o="Invalid IconifyPreload syntax.";typeof n=="object"&&n!==null&&(n instanceof Array?n:[n]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!Te(i))&&console.error(o)}catch{console.error(o)}})}if(e.IconifyProviders!==void 0){const n=e.IconifyProviders;if(typeof n=="object"&&n!==null)for(let o in n){const i="IconifyProviders["+o+"] is invalid.";try{const t=n[o];if(typeof t!="object"||!t||t.resources===void 0)continue;De(o,t)||console.error(i)}catch{console.error(i)}}}}const gt={...N,body:""},yt=me({inheritAttrs:!1,data(){return{_name:"",_loadingIcon:null,iconMounted:!1,counter:0}},mounted(){this.iconMounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(e,n,o){if(typeof e=="object"&&e!==null&&typeof e.body=="string")return this._name="",this.abortLoading(),{data:e};let i;if(typeof e!="string"||(i=M(e,!1,!0))===null)return this.abortLoading(),null;let t=Se(i);if(!t)return(!this._loadingIcon||this._loadingIcon.name!==e)&&(this.abortLoading(),this._name="",t!==null&&(this._loadingIcon={name:e,abort:it([i],()=>{this.counter++})})),null;if(this.abortLoading(),this._name!==e&&(this._name=e,n&&n(e)),o){t=Object.assign({},t);const r=o(t.body,i.name,i.prefix,i.provider);typeof r=="string"&&(t.body=r)}const s=["iconify"];return i.prefix!==""&&s.push("iconify--"+i.prefix),i.provider!==""&&s.push("iconify--"+i.provider),{data:t,classes:s}}},render(){this.counter;const e=this.$attrs,n=this.iconMounted||e.ssr?this.getIcon(e.icon,e.onLoad,e.customise):null;if(!n)return ie(gt,e);let o=e;return n.classes&&(o={...e,class:(typeof e.class=="string"?e.class+" ":"")+n.classes.join(" ")}),ie({...N,...n.data},o)}});export{yt as I}; diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-Dqcw8yKQ.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-BGKqtLX6.js similarity index 99% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-Dqcw8yKQ.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-BGKqtLX6.js index c6ead02c81..02890cbc0c 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-Dqcw8yKQ.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-BGKqtLX6.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/freemarker2-D-w9PHYx.js","assets/index-DA9oYm7y.js","assets/index-DN-vOy2S.css","assets/iconify-CyasjfC7.js","assets/_plugin-vue_export-helper-DlAUqK2U.js","assets/useMessage-fgXJFj_8.js","assets/useMessage-B772OobR.css","assets/index-D2fTT4wr.js","assets/index-CxnUfhp1.css","assets/handlebars-CU3IGK7R.js","assets/html-DM9_zIre.js","assets/javascript-DNnN4kEa.js","assets/typescript-BEZDUO2m.js","assets/liquid-B5j_7Uvh.js","assets/mdx-CDRD_3NO.js","assets/python-CM3gi6vP.js","assets/razor-Bu5fGBlQ.js","assets/xml-IzzTFP6G.js","assets/yaml-C27Xr4Pr.js","assets/cssMode-DM_jsbIE.js","assets/htmlMode-DVekKSY6.js","assets/jsonMode-B8CiFQ0R.js","assets/tsMode-xq1wJwnt.js"])))=>i.map(i=>d[i]); -var xz=Object.defineProperty;var kz=(o,e,t)=>e in o?xz(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var ri=(o,e,t)=>kz(o,typeof e!="symbol"?e+"":e,t);import{d as Ss,a as ue,b as ne,e as L,t as B,u as Pa,r as Ye,z as ar,c as Xn,o as Kd,g as xe,f as at,i as Pe,w as Vt,j as ti,F as Ji,l as ln,n as Nn,E as ny,s as In,k as Zt,T as qb,J as Gf,C as Iz,x as P,h as Zh,B as cr,D as X1,y as I9,H as Ez,K as K2,q as Nz,A as E9,_ as Oe,M as Tz,p as N9,G as T9,N as Mz}from"./index-DA9oYm7y.js";import{I as Re}from"./iconify-CyasjfC7.js";import{_ as us}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{a as Az,u as M9}from"./useMessage-fgXJFj_8.js";import{L as Rz}from"./index-D2fTT4wr.js";const Pz={class:"switch"},Oz=["checked"],Fz={class:"switch-label"},Bz=Ss({__name:"index",props:{enabled:{type:Boolean},label:{}},emits:["update:switchValue"],setup(o,{emit:e}){const t=e,i=n=>{const s=n.target.checked;t("update:switchValue",s)};return(n,s)=>(ne(),ue("label",Pz,[L("input",{type:"checkbox",checked:n.enabled,onChange:i},null,40,Oz),s[0]||(s[0]=L("span",{class:"slider"},null,-1)),L("span",Fz,B(n.label),1)]))}}),Wz=us(Bz,[["__scopeId","data-v-d484b4a3"]]);class u_{static async getConfigsByGroup(e){try{const t=await fetch(`${this.BASE_URL}/group/${e}`);if(!t.ok)throw new Error(`Failed to get ${e} group configuration: ${t.status}`);return await t.json()}catch(t){throw console.error(`Failed to get ${e} group configuration:`,t),t}}static async batchUpdateConfigs(e){if(e.length===0)return{success:!0,message:"No configuration needs to be updated"};try{const t=await fetch(`${this.BASE_URL}/batch-update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`Batch update configuration failed: ${t.status}`);return{success:!0,message:"Configuration saved successfully"}}catch(t){return console.error("Batch update configuration failed:",t),{success:!1,message:t instanceof Error?t.message:"Update failed, please try again"}}}static async getConfigById(e){try{const t=await fetch(`${this.BASE_URL}/${e}`);if(!t.ok)throw new Error(`Failed to get configuration item: ${t.status}`);return await t.json()}catch(t){throw console.error(`Failed to get configuration item[${e}]:`,t),t}}static async updateConfig(e){try{const t=await fetch(`${this.BASE_URL}/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`Failed to update configuration item: ${t.status}`);return{success:!0,message:"Configuration updated successfully"}}catch(t){return console.error("Failed to update configuration item:",t),{success:!1,message:t instanceof Error?t.message:"Update failed, please try again"}}}}ri(u_,"BASE_URL","/api/config");const Vz={class:"config-panel"},Hz={class:"config-header"},zz={class:"header-left"},$z={class:"config-stats"},Uz={class:"stat-item"},jz={class:"stat-label"},Kz={class:"stat-value"},qz={key:0,class:"stat-item"},Gz={class:"stat-label"},Zz={class:"stat-value modified"},Yz={class:"header-right"},Xz={class:"import-export-actions"},Qz=["title"],Jz=["title"],e$={class:"search-box"},t$=["placeholder"],i$={key:0,class:"loading-container"},n$={key:1,class:"config-groups"},s$={class:"group-header"},o$={class:"group-info"},r$={class:"group-icon"},a$={class:"group-actions"},l$=["onClick","disabled","title"],d$={class:"sub-groups"},c$=["onClick"],u$={class:"sub-group-info"},h$={class:"sub-group-title"},g$={class:"item-count"},f$={class:"config-items"},p$={key:0,class:"config-item-content vertical-layout"},m$={class:"config-item-info"},_$={class:"config-item-header"},v$={class:"config-label"},b$={class:"type-badge boolean"},C$={key:0,class:"modified-badge"},w$=["title"],S$={class:"config-control"},y$=["value","onChange"],L$=["value"],D$={key:1,class:"config-item-content vertical-layout"},x$={class:"config-item-info"},k$={class:"config-item-header"},I$={class:"config-label"},E$={class:"type-badge select"},N$={key:0,class:"modified-badge"},T$=["title"],M$={class:"config-control"},A$=["value","onChange"],R$=["value"],P$={key:2,class:"config-item-content vertical-layout"},O$={class:"config-item-info"},F$={class:"config-item-header"},B$={class:"config-label"},W$={class:"type-badge textarea"},V$={key:0,class:"modified-badge"},H$=["title"],z$={class:"config-control"},$$=["value","onInput"],U$={key:3,class:"config-item-content vertical-layout"},j$={class:"config-item-info"},K$={class:"config-item-header"},q$={class:"config-label"},G$={class:"type-badge number"},Z$={key:0,class:"modified-badge"},Y$=["title"],X$={key:0,class:"config-meta"},Q$={class:"range-info"},J$={class:"config-control"},eU=["value","onInput","min","max"],tU={key:4,class:"config-item-content vertical-layout"},iU={class:"config-item-info"},nU={class:"config-item-header"},sU={class:"config-label"},oU={class:"type-badge string"},rU={key:0,class:"modified-badge"},aU=["title"],lU={class:"config-control"},dU=["value","onInput"],cU={key:2,class:"empty-state"},uU=Ss({__name:"basicConfig",setup(o){const{t:e}=Pa(),t=Ye(!0),i=Ye(!1),n=Ye([]),s=Ye(new Map),r=Ye(new Set),a=ar({show:!1,text:"",type:"success"}),l=Ye(""),d={headless:"config.basicConfig.browserSettings.headless",requestTimeout:"config.basicConfig.browserSettings.requestTimeout",debugDetail:"config.basicConfig.general.debugDetail",baseDir:"config.basicConfig.general.baseDir",openBrowser:"config.basicConfig.interactionSettings.openBrowser",maxSteps:"config.basicConfig.agentSettings.maxSteps",userInputTimeout:"config.basicConfig.agentSettings.userInputTimeout",maxMemory:"config.basicConfig.agentSettings.maxMemory",parallelToolCalls:"config.basicConfig.agentSettings.parallelToolCalls",forceOverrideFromYaml:"config.basicConfig.agents.forceOverrideFromYaml",enabled:"config.basicConfig.infiniteContext.enabled",parallelThreads:"config.basicConfig.infiniteContext.parallelThreads",taskContextSize:"config.basicConfig.infiniteContext.taskContextSize",allowExternalAccess:"config.basicConfig.fileSystem.allowExternalAccess",connectionTimeoutSeconds:"config.basicConfig.mcpServiceLoader.connectionTimeoutSeconds",maxRetryCount:"config.basicConfig.mcpServiceLoader.maxRetryCount",maxConcurrentConnections:"config.basicConfig.mcpServiceLoader.maxConcurrentConnections"},c={manus:"config.basicConfig.groupDisplayNames.manus"},u={manus:"🤖",browser:"🌐",interaction:"🖥️",system:"⚙️",performance:"⚡"},h={agent:"config.subGroupDisplayNames.agent",browser:"config.subGroupDisplayNames.browser",interaction:"config.subGroupDisplayNames.interaction",agents:"config.subGroupDisplayNames.agents",infiniteContext:"config.subGroupDisplayNames.infiniteContext",general:"config.subGroupDisplayNames.general",filesystem:"config.subGroupDisplayNames.filesystem",mcpServiceLoader:"config.subGroupDisplayNames.mcpServiceLoader"},g=Xn(()=>n.value.some(V=>V.subGroups.some(Q=>Q.items.some(H=>s.value.get(H.id)!==H.configValue)))),f=V=>V==="true",m=V=>parseFloat(V)||0,v=V=>({maxSteps:1,browserTimeout:1,maxThreads:1,timeoutSeconds:5,maxMemory:1})[V]||1,_=V=>({maxSteps:100,browserTimeout:600,maxThreads:32,timeoutSeconds:300,maxMemory:1e3})[V]||1e4,b=V=>typeof V=="string"?V:V.value,C=V=>typeof V=="string"?V:V.label,w=(V,Q)=>{if(typeof Q=="boolean")return Q.toString();if(typeof Q=="string"){if(V.options&&V.options.length>0){const H=V.options.find(G=>(typeof G=="string"?G:G.label)===Q||(typeof G=="string"?G:G.value)===Q);if(H)return typeof H=="string"?H:H.value}return Q}return String(Q)},S=(V,Q,H=!1)=>{let G;V.inputType==="BOOLEAN"||V.inputType==="CHECKBOX"?G=w(V,Q):G=String(Q),V.configValue!==G&&(V.configValue=G,V._modified=!0,(H||V.inputType==="BOOLEAN"||V.inputType==="CHECKBOX"||V.inputType==="SELECT")&&y())};let x=null;const y=()=>{x&&clearTimeout(x),x=window.setTimeout(()=>{R()},500)},I=(V,Q="success")=>{a.text=V,a.type=Q,a.show=!0,setTimeout(()=>{a.show=!1},3e3)},E=async()=>{try{t.value=!0;const Q=["manus"].map(async G=>{try{const Z=await u_.getConfigsByGroup(G);if(Z.length===0)return null;const $e=Z.map(Ce=>({...Ce,displayName:d[Ce.configKey]||Ce.configKey,min:v(Ce.configKey),max:_(Ce.configKey)}));$e.forEach(Ce=>{s.value.set(Ce.id,Ce.configValue)});const ft=new Map;$e.forEach(Ce=>{const re=Ce.configSubGroup??"general";ft.has(re)||ft.set(re,[]),ft.get(re).push(Ce)});const Bt=Array.from(ft.entries()).map(([Ce,re])=>({name:Ce,displayName:h[Ce]||Ce,items:re}));return{name:G,displayName:c[G]||G,subGroups:Bt}}catch(Z){return console.warn(`Failed to load config group ${G}, skipping:`,Z),null}}),H=await Promise.all(Q);n.value=H.filter(G=>G!==null),console.log(e("config.basicConfig.loadConfigSuccess"),n.value)}catch(V){console.error(e("config.basicConfig.loadConfigFailed"),V),I(e("config.basicConfig.loadConfigFailed"),"error")}finally{t.value=!1}},R=async()=>{if(!(i.value||!g.value))try{i.value=!0;const V=[];if(n.value.forEach(H=>{H.subGroups.forEach(G=>{const Z=G.items.filter($e=>$e._modified);V.push(...Z)})}),V.length===0){I(e("config.basicConfig.noModified"));return}const Q=await u_.batchUpdateConfigs(V);Q.success?(V.forEach(H=>{s.value.set(H.id,H.configValue),H._modified=!1}),I(e("config.basicConfig.saveSuccess"))):I(Q.message||e("config.basicConfig.saveFailed"),"error")}catch(V){console.error(e("config.basicConfig.saveFailed"),V),I(e("config.basicConfig.saveFailed"),"error")}finally{i.value=!1}},j=async V=>{if(confirm(e("config.basicConfig.resetGroupConfirm",c[V]||V)))try{i.value=!0;const H=n.value.find($e=>$e.name===V);if(!H)return;const G=[];if(H.subGroups.forEach($e=>{$e.items.forEach(ft=>{const Bt=O(ft.configKey);Bt!==ft.configValue&&G.push({...ft,configValue:Bt})})}),G.length===0){I(e("config.basicConfig.isDefault"));return}const Z=await u_.batchUpdateConfigs(G);Z.success?(await E(),I(e("config.basicConfig.resetSuccess",G.length))):I(Z.message||e("config.basicConfig.resetFailed"),"error")}catch(H){console.error(e("config.basicConfig.resetFailed"),H),I(e("config.basicConfig.resetFailed"),"error")}finally{i.value=!1}},O=V=>({systemName:"JManus",language:"zh-CN",maxThreads:"8",timeoutSeconds:"60",autoOpenBrowser:"false",headlessBrowser:"true",maxMemory:"1000"})[V]||"",$=(V,Q)=>{const H=`${V}-${Q}`;r.value.has(H)?r.value.delete(H):r.value.add(H)},K=(V,Q)=>r.value.has(`${V}-${Q}`),oe=Xn(()=>{const V=n.value.reduce((H,G)=>H+G.subGroups.reduce((Z,$e)=>Z+$e.items.length,0),0),Q=n.value.reduce((H,G)=>H+G.subGroups.reduce((Z,$e)=>Z+$e.items.filter(ft=>s.value.get(ft.id)!==ft.configValue).length,0),0);return{total:V,modified:Q}}),Le=Xn(()=>{if(!l.value.trim())return n.value;const V=l.value.toLowerCase();return n.value.map(Q=>({...Q,subGroups:Q.subGroups.map(H=>({...H,items:H.items.filter(G=>G.displayName.toLowerCase().includes(V)||G.configKey.toLowerCase().includes(V)||G.description&&G.description.toLowerCase().includes(V))})).filter(H=>H.items.length>0)})).filter(Q=>Q.subGroups.length>0)}),he=()=>{try{const V={timestamp:new Date().toISOString(),version:"1.0",configs:n.value.reduce((Z,$e)=>($e.subGroups.forEach(ft=>{ft.items.forEach(Bt=>{Z[Bt.configKey]=Bt.configValue})}),Z),{})},Q=JSON.stringify(V,null,2),H=new Blob([Q],{type:"application/json"}),G=document.createElement("a");G.href=URL.createObjectURL(H),G.download=`config-export-${new Date().toISOString().split("T")[0]}.json`,G.click(),I(e("config.basicConfig.exportSuccess"))}catch(V){console.error(e("config.basicConfig.exportFailed"),V),I(e("config.basicConfig.exportFailed"),"error")}},se=V=>{var Z;const Q=V.target,H=(Z=Q.files)==null?void 0:Z[0];if(!H)return;const G=new FileReader;G.onload=async $e=>{var ft;try{const Bt=JSON.parse((ft=$e.target)==null?void 0:ft.result);if(!Bt.configs)throw new Error(e("config.basicConfig.invalidFormat"));if(!confirm(e("config.importConfirm")))return;i.value=!0;const re=[];if(n.value.forEach(ce=>{ce.subGroups.forEach(Ie=>{Ie.items.forEach(mt=>{Object.prototype.hasOwnProperty.call(Bt.configs,mt.configKey)&&re.push({...mt,configValue:Bt.configs[mt.configKey]})})})}),re.length===0){I(e("config.basicConfig.notFound"));return}const ke=await u_.batchUpdateConfigs(re);ke.success?(await E(),I(e("config.basicConfig.importSuccess"))):I(ke.message||e("config.basicConfig.importFailed"),"error")}catch(Bt){console.error(e("config.basicConfig.importFailed"),Bt),I(e("config.basicConfig.importFailed"),"error")}finally{i.value=!1,Q.value=""}},G.readAsText(H)};return Kd(()=>{E()}),(V,Q)=>(ne(),ue("div",Vz,[L("div",Hz,[L("div",zz,[L("h2",null,B(V.$t("config.basicConfig.title")),1),L("div",$z,[L("span",Uz,[L("span",jz,B(V.$t("config.basicConfig.totalConfigs"))+":",1),L("span",Kz,B(oe.value.total),1)]),oe.value.modified>0?(ne(),ue("span",qz,[L("span",Gz,B(V.$t("config.basicConfig.modified"))+":",1),L("span",Zz,B(oe.value.modified),1)])):at("",!0)])]),L("div",Yz,[L("div",Xz,[L("button",{onClick:he,class:"action-btn",title:V.$t("config.basicConfig.exportConfigs")}," 📤 ",8,Qz),L("label",{class:"action-btn",title:V.$t("config.basicConfig.importConfigs")},[Q[1]||(Q[1]=Pe(" 📥 ")),L("input",{type:"file",accept:".json",onChange:se,style:{display:"none"}},null,32)],8,Jz)]),L("div",e$,[Vt(L("input",{"onUpdate:modelValue":Q[0]||(Q[0]=H=>l.value=H),type:"text",placeholder:V.$t("config.search"),class:"search-input"},null,8,t$),[[ti,l.value]]),Q[2]||(Q[2]=L("span",{class:"search-icon"},"🔍",-1))])])]),t.value?(ne(),ue("div",i$,[Q[3]||(Q[3]=L("div",{class:"loading-spinner"},null,-1)),L("p",null,B(V.$t("config.loading")),1)])):Le.value.length>0?(ne(),ue("div",n$,[(ne(!0),ue(Ji,null,ln(Le.value,H=>(ne(),ue("div",{key:H.name,class:"config-group"},[L("div",s$,[L("div",o$,[L("span",r$,B(u[H.name]||"⚙️"),1)]),L("div",a$,[L("button",{onClick:G=>j(H.name),class:"reset-btn",disabled:i.value,title:V.$t("config.resetGroupConfirm")},B(V.$t("config.reset")),9,l$)]),Q[4]||(Q[4]=L("div",{class:"group-divider"},null,-1))]),L("div",d$,[(ne(!0),ue(Ji,null,ln(H.subGroups,G=>(ne(),ue("div",{key:G.name,class:"sub-group"},[L("div",{class:"sub-group-header",onClick:Z=>$(H.name,G.name)},[L("div",u$,[Q[5]||(Q[5]=L("span",{class:"sub-group-icon"},"📁",-1)),L("h4",h$,B(V.$t(G.displayName)),1),L("span",g$,"("+B(G.items.length)+")",1)]),L("span",{class:Nn(["collapse-icon",{collapsed:K(H.name,G.name)}])}," ▼ ",2)],8,c$),Vt(L("div",f$,[(ne(!0),ue(Ji,null,ln(G.items,Z=>(ne(),ue("div",{key:Z.id,class:Nn(["config-item",{modified:s.value.get(Z.id)!==Z.configValue}])},[Z.inputType==="BOOLEAN"||Z.inputType==="CHECKBOX"?(ne(),ue("div",p$,[L("div",m$,[L("div",_$,[L("label",v$,[Pe(B(V.$t(Z.displayName)||Z.description)+" ",1),L("span",b$,B(Z.inputType==="CHECKBOX"?V.$t("config.types.checkbox"):V.$t("config.types.boolean")),1),s.value.get(Z.id)!==Z.configValue?(ne(),ue("span",C$,B(V.$t("config.modified")),1)):at("",!0)]),L("span",{class:"config-key",title:Z.configKey},B(Z.configKey),9,w$)])]),L("div",S$,[Z.options&&Z.options.length>0?(ne(),ue("select",{key:0,class:"config-input select-input",value:Z.configValue,onChange:$e=>{var ft;return S(Z,((ft=$e.target)==null?void 0:ft.value)||"")}},[(ne(!0),ue(Ji,null,ln(Z.options,$e=>(ne(),ue("option",{key:b($e),value:b($e)},B(C($e)),9,L$))),128))],40,y$)):(ne(),In(Wz,{key:1,enabled:f(Z.configValue),label:"","onUpdate:switchValue":$e=>S(Z,$e)},null,8,["enabled","onUpdate:switchValue"]))])])):Z.inputType==="SELECT"?(ne(),ue("div",D$,[L("div",x$,[L("div",k$,[L("label",I$,[Pe(B(V.$t(Z.displayName)||Z.description)+" ",1),L("span",E$,B(V.$t("config.types.select")),1),s.value.get(Z.id)!==Z.configValue?(ne(),ue("span",N$,B(V.$t("config.modified")),1)):at("",!0)]),L("span",{class:"config-key",title:Z.configKey},B(Z.configKey),9,T$)])]),L("div",M$,[L("select",{class:"config-input select-input",value:Z.configValue,onChange:$e=>{var ft;return S(Z,((ft=$e.target)==null?void 0:ft.value)||"")}},[(ne(!0),ue(Ji,null,ln(Z.options||[],$e=>(ne(),ue("option",{key:b($e),value:b($e)},B(C($e)),9,R$))),128))],40,A$)])])):Z.inputType==="TEXTAREA"?(ne(),ue("div",P$,[L("div",O$,[L("div",F$,[L("label",B$,[Pe(B(V.$t(Z.displayName)||Z.description)+" ",1),L("span",W$,B(V.$t("config.types.textarea")),1),s.value.get(Z.id)!==Z.configValue?(ne(),ue("span",V$,B(V.$t("config.modified")),1)):at("",!0)]),L("span",{class:"config-key",title:Z.configKey},B(Z.configKey),9,H$)])]),L("div",z$,[L("textarea",{class:"config-input textarea-input",value:Z.configValue,onInput:$e=>{var ft;return S(Z,((ft=$e.target)==null?void 0:ft.value)||"")},onBlur:y,rows:"3"},null,40,$$)])])):Z.inputType==="NUMBER"?(ne(),ue("div",U$,[L("div",j$,[L("div",K$,[L("label",q$,[Pe(B(V.$t(Z.displayName)||Z.description)+" ",1),L("span",G$,B(V.$t("config.types.number")),1),s.value.get(Z.id)!==Z.configValue?(ne(),ue("span",Z$,B(V.$t("config.modified")),1)):at("",!0)]),L("span",{class:"config-key",title:Z.configKey},B(Z.configKey),9,Y$),Z.min||Z.max?(ne(),ue("div",X$,[L("span",Q$,B(V.$t("config.range"))+": "+B(Z.min||0)+" - "+B(Z.max||"∞"),1)])):at("",!0)])]),L("div",J$,[L("input",{type:"number",class:"config-input number-input",value:m(Z.configValue),onInput:$e=>{var ft;return S(Z,((ft=$e.target)==null?void 0:ft.value)||"")},onBlur:y,min:Z.min||1,max:Z.max||1e4},null,40,eU)])])):(ne(),ue("div",tU,[L("div",iU,[L("div",nU,[L("label",sU,[Pe(B(V.$t(Z.displayName)||Z.description)+" ",1),L("span",oU,B(Z.inputType==="TEXT"?V.$t("config.types.text"):V.$t("config.types.string")),1),s.value.get(Z.id)!==Z.configValue?(ne(),ue("span",rU,B(V.$t("config.modified")),1)):at("",!0)]),L("span",{class:"config-key",title:Z.configKey},B(Z.configKey),9,aU)])]),L("div",lU,[L("input",{type:"text",class:"config-input text-input",value:Z.configValue,onInput:$e=>{var ft;return S(Z,((ft=$e.target)==null?void 0:ft.value)||"")},onBlur:y},null,40,dU)])]))],2))),128))],512),[[ny,!K(H.name,G.name)]])]))),128))])]))),128))])):(ne(),ue("div",cU,[L("p",null,B(V.$t("config.notFound")),1)])),xe(qb,{name:"message-fade"},{default:Zt(()=>[a.show?(ne(),ue("div",{key:0,class:Nn(["message-toast",a.type])},B(a.text),3)):at("",!0)]),_:1})]))}}),xP=us(uU,[["__scopeId","data-v-cf54ca62"]]),hU={},gU={class:"config-config"},fU={class:"panel-header"},pU={class:"panel-actions"};function mU(o,e){return ne(),ue("div",gU,[L("div",fU,[Gf(o.$slots,"title",{},void 0),L("div",pU,[Gf(o.$slots,"actions",{},void 0)])]),Gf(o.$slots,"default",{},void 0)])}const Gb=us(hU,[["render",mU],["__scopeId","data-v-c91688e7"]]),_U={class:"modal-header"},vU={class:"modal-content"},bU={class:"modal-footer"},CU=Ss({__name:"index",props:{modelValue:{type:Boolean,required:!0},title:{type:String,default:""}},emits:["update:modelValue","confirm"],setup(o){const e=t=>{t.target===t.currentTarget&&(t.stopPropagation(),t.preventDefault())};return(t,i)=>(ne(),In(Iz,{to:"body"},[xe(qb,{name:"modal"},{default:Zt(()=>[o.modelValue?(ne(),ue("div",{key:0,class:"modal-overlay",onClick:e},[L("div",{class:"modal-container",onClick:i[3]||(i[3]=Zh(()=>{},["stop"]))},[L("div",_U,[L("h3",null,B(o.title),1),L("button",{class:"close-btn",onClick:i[0]||(i[0]=n=>t.$emit("update:modelValue",!1))},[xe(P(Re),{icon:"carbon:close"})])]),L("div",vU,[Gf(t.$slots,"default",{},void 0,!0)]),L("div",bU,[Gf(t.$slots,"footer",{},()=>[L("button",{class:"cancel-btn",onClick:i[1]||(i[1]=n=>t.$emit("update:modelValue",!1))},B(t.$t("common.cancel")),1),L("button",{class:"confirm-btn",onClick:i[2]||(i[2]=n=>t.$emit("confirm"))},B(t.$t("common.confirm")),1)],!0)])])])):at("",!0)]),_:3})]))}}),Wo=us(CU,[["__scopeId","data-v-baaf1c89"]]),wU={class:"tool-selection-content"},SU={class:"tool-controls"},yU={class:"search-container"},LU=["placeholder"],DU={class:"sort-container"},xU={value:"group"},kU={value:"name"},IU={value:"enabled"},EU={class:"tool-summary"},NU={class:"summary-text"},TU={key:0,class:"tool-groups"},MU=["onClick"],AU={class:"group-title-area"},RU={class:"group-name"},PU={class:"group-count"},OU={class:"group-enable-all"},FU=["checked","onChange","data-group"],BU={class:"enable-label"},WU={class:"tool-info"},VU={class:"tool-selection-name"},HU={key:0,class:"tool-selection-desc"},zU={class:"tool-actions"},$U=["checked","onChange"],UU={key:1,class:"empty-state"},jU=Ss({__name:"index",props:{modelValue:{type:Boolean},tools:{},selectedToolIds:{}},emits:["update:modelValue","confirm"],setup(o,{emit:e}){const t=o,i=e,n=Xn({get:()=>t.modelValue,set:x=>i("update:modelValue",x)}),s=Ye(""),r=Ye("group"),a=Ye(new Set),l=Ye([]),d=(x,y)=>{const I=document.querySelector(`input[data-group="${x}"]`);I&&(I.indeterminate=_(y))};cr(()=>t.selectedToolIds,x=>{l.value=[...x]},{immediate:!0});const c=Xn(()=>{let x=t.tools.filter(y=>y.key);if(s.value){const y=s.value.toLowerCase();x=x.filter(I=>{var E;return I.name.toLowerCase().includes(y)||I.description.toLowerCase().includes(y)||(((E=I.serviceGroup)==null?void 0:E.toLowerCase().includes(y))??!1)})}switch(r.value){case"name":x=[...x].sort((y,I)=>y.name.localeCompare(I.name));break;case"enabled":x=[...x].sort((y,I)=>{const E=l.value.includes(y.key),R=l.value.includes(I.key);return E&&!R?-1:!E&&R?1:y.name.localeCompare(I.name)});break;case"group":default:x=[...x].sort((y,I)=>{const E=y.serviceGroup??"Ungrouped",R=I.serviceGroup??"Ungrouped";return E!==R?E.localeCompare(R):y.name.localeCompare(I.name)});break}return x}),u=Xn(()=>{const x=new Map;return c.value.forEach(y=>{const I=y.serviceGroup??"Ungrouped";x.has(I)||x.set(I,[]),x.get(I).push(y)}),new Map([...x.entries()].sort())}),h=Xn(()=>c.value.length);cr([l,u],()=>{I9(()=>{for(const[x,y]of u.value)d(x,y)})},{flush:"post",deep:!1});const g=x=>l.value.includes(x),f=(x,y)=>{y.stopPropagation();const E=y.target.checked;if(!x){console.error("toolKey is undefined, cannot proceed");return}E?l.value.includes(x)||(l.value=[...l.value,x]):l.value=l.value.filter(R=>R!==x)},m=x=>x.filter(y=>l.value.includes(y.key)),v=x=>x.length>0&&x.every(y=>l.value.includes(y.key)),_=x=>{const y=m(x).length;return y>0&&y{y.stopPropagation();const E=y.target.checked,R=x.map(j=>j.key);if(E){const j=[...l.value];R.forEach(O=>{j.includes(O)||j.push(O)}),l.value=j}else l.value=l.value.filter(j=>!R.includes(j))},C=x=>{a.value.has(x)?a.value.delete(x):a.value.add(x)},w=()=>{i("confirm",[...l.value]),i("update:modelValue",!1)},S=()=>{l.value=[...t.selectedToolIds],i("update:modelValue",!1)};return cr(n,x=>{if(x){a.value.clear();const y=Array.from(u.value.keys());y.length>1&&y.slice(1).forEach(I=>{a.value.add(I)})}}),(x,y)=>(ne(),In(Wo,{modelValue:n.value,"onUpdate:modelValue":[y[4]||(y[4]=I=>n.value=I),S],title:x.$t("toolSelection.title"),onConfirm:w},{default:Zt(()=>[L("div",wU,[L("div",SU,[L("div",yU,[Vt(L("input",{"onUpdate:modelValue":y[0]||(y[0]=I=>s.value=I),type:"text",class:"search-input",placeholder:x.$t("toolSelection.searchPlaceholder")},null,8,LU),[[ti,s.value]])]),L("div",DU,[Vt(L("select",{"onUpdate:modelValue":y[1]||(y[1]=I=>r.value=I),class:"sort-select"},[L("option",xU,B(x.$t("toolSelection.sortByGroup")),1),L("option",kU,B(x.$t("toolSelection.sortByName")),1),L("option",IU,B(x.$t("toolSelection.sortByStatus")),1)],512),[[X1,r.value]])])]),L("div",EU,[L("span",NU,B(x.$t("toolSelection.summary",{groups:u.value.size,tools:h.value,selected:l.value.length})),1)]),u.value.size>0?(ne(),ue("div",TU,[(ne(!0),ue(Ji,null,ln(u.value,([I,E])=>(ne(),ue("div",{key:I,class:"tool-group"},[L("div",{class:Nn(["tool-group-header",{collapsed:a.value.has(I)}]),onClick:R=>C(I)},[L("div",AU,[xe(P(Re),{icon:a.value.has(I)?"carbon:chevron-right":"carbon:chevron-down",class:"collapse-icon"},null,8,["icon"]),xe(P(Re),{icon:"carbon:folder",class:"group-icon"}),L("span",RU,B(I),1),L("span",PU," ("+B(m(E).length)+"/"+B(E.length)+") ",1)]),L("div",{class:"group-actions",onClick:y[2]||(y[2]=Zh(()=>{},["stop"]))},[L("label",OU,[L("input",{type:"checkbox",class:"group-enable-checkbox",checked:v(E),onChange:R=>b(E,R),"data-group":I},null,40,FU),L("span",BU,B(x.$t("toolSelection.enableAll")),1)])])],10,MU),L("div",{class:Nn(["tool-group-content",{collapsed:a.value.has(I)}])},[(ne(!0),ue(Ji,null,ln(E.filter(R=>R&&R.key),R=>(ne(),ue("div",{key:R.key,class:"tool-selection-item"},[L("div",WU,[L("div",VU,B(R.name),1),R.description?(ne(),ue("div",HU,B(R.description),1)):at("",!0)]),L("div",zU,[L("label",{class:"tool-enable-switch",onClick:y[3]||(y[3]=Zh(()=>{},["stop"]))},[L("input",{type:"checkbox",class:"tool-enable-checkbox",checked:g(R.key),onChange:j=>f(R.key,j)},null,40,$U),y[5]||(y[5]=L("span",{class:"tool-enable-slider"},null,-1))])])]))),128))],2)]))),128))])):(ne(),ue("div",UU,[xe(P(Re),{icon:"carbon:tools",class:"empty-icon"}),L("p",null,B(x.$t("toolSelection.noToolsFound")),1)]))])]),_:1},8,["modelValue","title"]))}}),KU=us(jU,[["__scopeId","data-v-0237b039"]]);class ac{static async handleResponse(e){if(!e.ok)try{const t=await e.json();throw new Error(t.message||`API request failed: ${e.status}`)}catch{throw new Error(`API request failed: ${e.status} ${e.statusText}`)}return e}static async getAllAgents(e){try{if(e){const t=await fetch(`${this.BASE_URL}/namespace/${e}`);return await(await this.handleResponse(t)).json()}else{const t=await fetch(`${this.BASE_URL}`);return await(await this.handleResponse(t)).json()}}catch(t){throw console.error("Failed to get Agent list:",t),t}}static async getAgentById(e){try{const t=await fetch(`${this.BASE_URL}/${e}`);return await(await this.handleResponse(t)).json()}catch(t){throw console.error(`Failed to get Agent[${e}] details:`,t),t}}static async createAgent(e){try{const t=await fetch(this.BASE_URL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await(await this.handleResponse(t)).json()}catch(t){throw console.error("Failed to create Agent:",t),t}}static async updateAgent(e,t){try{const i=await fetch(`${this.BASE_URL}/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await(await this.handleResponse(i)).json()}catch(i){throw console.error(`Failed to update Agent[${e}]:`,i),i}}static async deleteAgent(e){try{const t=await fetch(`${this.BASE_URL}/${e}`,{method:"DELETE"});if(t.status===400)throw new Error("Cannot delete default Agent");await this.handleResponse(t)}catch(t){throw console.error(`Failed to delete Agent[${e}]:`,t),t}}static async getAvailableTools(){try{const e=await fetch(`${this.BASE_URL}/tools`);return await(await this.handleResponse(e)).json()}catch(e){throw console.error("Failed to get available tools list:",e),e}}}ri(ac,"BASE_URL","/api/agents");class ko{static async handleResponse(e){if(!e.ok)try{const t=await e.json();throw new Error(t.message||`API request failed: ${e.status}`)}catch{throw new Error(`API request failed: ${e.status} ${e.statusText}`)}return e}static async getAllModels(){try{const e=await fetch(this.BASE_URL);return await(await this.handleResponse(e)).json()}catch(e){throw console.error("Failed to get Model list:",e),e}}static async getAllTypes(){try{const e=await fetch(`${this.BASE_URL}/types`);return await(await this.handleResponse(e)).json()}catch(e){throw console.error("Failed to get Model list:",e),e}}static async getModelById(e){try{const t=await fetch(`${this.BASE_URL}/${e}`);return await(await this.handleResponse(t)).json()}catch(t){throw console.error(`Failed to get Model[${e}] details:`,t),t}}static async createModel(e){try{const t=JSON.stringify(e,(s,r)=>(s==="temperature"||s==="topP")&&r===void 0?null:r),i=await fetch(this.BASE_URL,{method:"POST",headers:{"Content-Type":"application/json"},body:t});return await(await this.handleResponse(i)).json()}catch(t){throw console.error("Failed to create Model:",t),t}}static async updateModel(e,t){try{const i=JSON.stringify(t,(r,a)=>(r==="temperature"||r==="topP")&&a===void 0?null:a),n=await fetch(`${this.BASE_URL}/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:i});if(n.status===499)throw new Error("Request rejected, please modify the model configuration in the configuration file");return await(await this.handleResponse(n)).json()}catch(i){throw console.error(`Failed to update Model[${e}]:`,i),i}}static async deleteModel(e){try{const t=await fetch(`${this.BASE_URL}/${e}`,{method:"DELETE"});if(t.status===400)throw new Error("Cannot delete default Model");if(t.status===499)throw new Error("Request rejected, please modify the model configuration in the configuration file");await this.handleResponse(t)}catch(t){throw console.error(`Failed to delete Model[${e}]:`,t),t}}static async validateConfig(e){try{const t=await fetch(`${this.BASE_URL}/validate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await(await this.handleResponse(t)).json()}catch(t){throw console.error("Failed to validate model configuration:",t),t}}static async setDefaultModel(e){try{const t=await fetch(`${this.BASE_URL}/${e}/set-default`,{method:"POST",headers:{"Content-Type":"application/json"}});return await(await this.handleResponse(t)).json()}catch(t){throw console.error(`Failed to set model[${e}] as default:`,t),t}}}ri(ko,"BASE_URL","/api/models");const sy=Ez("namespace",()=>{const o=Ye("default");function e(n){o.value=n}const t=Ye([]);function i(n){t.value=n}return{namespace:o,namespaces:t,setCurrentNs:e,setNamespaces:i}}),q2=async o=>{if(!o.ok){const e=await o.json().catch(()=>({message:"Network error"}));throw new Error(e.message||`HTTP error! status: ${o.status}`)}return o.json()},qU=async()=>{const o=await fetch("/api/agent-management/languages");return q2(o)},GU=async o=>{const e=await fetch("/api/agent-management/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});return q2(e)},ZU=async()=>{const o=await fetch("/api/agent-management/stats");return q2(o)},YU=["disabled"],XU={class:"agent-layout"},QU={class:"agent-list"},JU={class:"list-header"},ej={class:"agent-count"},tj={key:0,class:"agents-container"},ij=["onClick"],nj={class:"agent-card-header"},sj={class:"agent-name"},oj={class:"agent-desc"},rj={key:0,class:"agent-model"},aj={class:"model-tag"},lj={class:"model-tag"},dj={key:1,class:"agent-tools"},cj={key:0,class:"tool-more"},uj={key:1,class:"loading-state"},hj={key:2,class:"empty-state"},gj={key:0,class:"agent-detail"},fj={class:"detail-header"},pj={class:"detail-actions"},mj={class:"form-item"},_j=["placeholder"],vj={class:"form-item"},bj=["placeholder"],Cj={class:"form-item"},wj=["value","placeholder"],Sj={class:"model-section"},yj={class:"form-item"},Lj={class:"model-chooser"},Dj=["title"],xj={key:0,class:"current-model"},kj={class:"model-type"},Ij={class:"model-name"},Ej={key:1,class:"current-model"},Nj={class:"current-model"},Tj={class:"dropdown-header"},Mj={class:"model-options"},Aj=["onClick"],Rj={class:"model-type"},Pj={class:"model-name"},Oj={class:"tools-section"},Fj={class:"assigned-tools"},Bj={class:"section-header"},Wj={class:"tools-grid"},Vj={class:"tool-info"},Hj={class:"tool-name"},zj={class:"tool-desc"},$j={key:0,class:"no-tools"},Uj={key:1,class:"no-selection"},jj={class:"modal-form"},Kj={class:"form-item"},qj=["placeholder"],Gj={class:"form-item"},Zj=["placeholder"],Yj={class:"form-item"},Xj=["value","placeholder"],Qj={class:"delete-confirm"},Jj={class:"warning-text"},eK={class:"multi-language-content"},tK={class:"stats-section"},iK={class:"stat-item"},nK={class:"stat-label"},sK={class:"stat-value"},oK={class:"stat-item"},rK={class:"stat-label"},aK={class:"stat-value"},lK={class:"language-selection"},dK={class:"selection-label"},cK={value:""},uK=["value"],hK={class:"warning-section"},gK={class:"warning-box"},fK={class:"warning-text"},pK=Ss({__name:"agentConfig",setup(o){const{t:e}=Pa(),t=sy(),{namespace:i}=K2(t),n=Ye(!1),s=Ye(""),r=Ye(""),a=ar([]),l=Ye(null),d=ar([]),c=Ye(!1),u=Ye(!1),h=Ye(!1),g=Ye(!1),f=Ye(null),m=ar([]),v=Ye(!1),_=Ye([]),b=Ye(""),C=Ye(!1),w=Ye({total:0,namespace:"",supportedLanguages:[]}),S=()=>{g.value=!g.value},x=Ce=>{f.value=Ce,g.value=!1},y=ar({name:"",description:"",nextStepPrompt:""}),I=Ce=>{const re=d.find(ke=>ke.key===Ce);return re?re.name:Ce},E=Ce=>{const re=d.find(ke=>ke.key===Ce);return re?re.description:""},R=(Ce,re)=>{re==="success"?(r.value=Ce,setTimeout(()=>{r.value=""},3e3)):(s.value=Ce,setTimeout(()=>{s.value=""},5e3))},j=async()=>{n.value=!0;try{const[Ce,re,ke]=await Promise.all([ac.getAllAgents(i.value),ac.getAvailableTools(),ko.getAllModels()]),ce=Ce.map(Ie=>({...Ie,availableTools:Ie.availableTools,...ke}));a.splice(0,a.length,...ce),d.splice(0,d.length,...re),m.splice(0,m.length,...ke),ce.length>0&&await O(ce[0])}catch(Ce){console.error("Failed to load data:",Ce),R(e("config.agentConfig.loadDataFailed")+": "+Ce.message,"error");const re=[{key:"search-web",name:"Web Search",description:"Search for information on the internet",enabled:!0,serviceGroup:"Search Services"},{key:"search-local",name:"Local Search",description:"Search content in local files",enabled:!0,serviceGroup:"Search Services"},{key:"file-read",name:"Read File",description:"Read local or remote file content",enabled:!0,serviceGroup:"File Services"},{key:"file-write",name:"Write File",description:"Create or modify file content",enabled:!0,serviceGroup:"File Services"},{key:"file-delete",name:"Delete File",description:"Delete specified file",enabled:!1,serviceGroup:"File Services"},{key:"calculator",name:"Calculator",description:"Perform mathematical calculations",enabled:!0,serviceGroup:"Computing Services"},{key:"code-execute",name:"Code Execution",description:"Execute Python or JavaScript code",enabled:!0,serviceGroup:"Computing Services"},{key:"weather",name:"Weather Query",description:"Get weather information for specified regions",enabled:!0,serviceGroup:"Information Services"},{key:"currency",name:"Exchange Rate Query",description:"Query currency exchange rate information",enabled:!0,serviceGroup:"Information Services"},{key:"email",name:"Send Email",description:"Send electronic mail",enabled:!1,serviceGroup:"Communication Services"},{key:"sms",name:"Send SMS",description:"Send SMS messages",enabled:!1,serviceGroup:"Communication Services"}],ke=[{id:"demo-1",name:"General Assistant",description:"An intelligent assistant capable of handling various tasks",nextStepPrompt:"You are a helpful assistant that can answer questions and help with various tasks. What would you like me to help you with next?",availableTools:["search-web","calculator","weather"]},{id:"demo-2",name:"Data Analyst",description:"Agent specialized in data analysis and visualization",nextStepPrompt:"You are a data analyst assistant specialized in analyzing data and creating visualizations. Please provide the data you would like me to analyze.",availableTools:["file-read","file-write","calculator","code-execute"]}];d.splice(0,d.length,...re),a.splice(0,a.length,...ke),ke.length>0&&(l.value=ke[0])}finally{n.value=!1}},O=async Ce=>{try{const re=await ac.getAgentById(Ce.id);l.value={...re,availableTools:re.availableTools},f.value=re.model??null}catch(re){console.error("Failed to load Agent details:",re),R(e("config.agentConfig.loadDetailsFailed")+": "+re.message,"error"),l.value={...Ce,availableTools:Ce.availableTools}}},$=()=>{y.name="",y.description="",y.nextStepPrompt="",c.value=!0},K=async()=>{var Ce;if(!y.name.trim()||!y.description.trim()){R(e("config.agentConfig.requiredFields"),"error");return}try{const re={name:y.name.trim(),description:y.description.trim(),nextStepPrompt:((Ce=y.nextStepPrompt)==null?void 0:Ce.trim())??"",availableTools:[],namespace:i.value},ke=await ac.createAgent(re);a.push(ke),l.value=ke,c.value=!1,R(e("config.agentConfig.createSuccess"),"success")}catch(re){R(e("config.agentConfig.createFailed")+": "+re.message,"error")}},oe=()=>{h.value=!0},Le=Ce=>{l.value&&(l.value.availableTools=[...Ce])},he=async()=>{if(l.value){if(!l.value.name.trim()||!l.value.description.trim()){R(e("config.agentConfig.requiredFields"),"error");return}try{l.value.model=f.value;const Ce=await ac.updateAgent(l.value.id,l.value),re=a.findIndex(ke=>ke.id===Ce.id);re!==-1&&(a[re]=Ce),l.value=Ce,l.value.model=f.value,R(e("config.agentConfig.saveSuccess"),"success")}catch(Ce){R(e("config.agentConfig.saveFailed")+": "+Ce.message,"error")}}},se=()=>{u.value=!0},V=async()=>{if(l.value)try{await ac.deleteAgent(l.value.id);const Ce=a.findIndex(re=>re.id===l.value.id);Ce!==-1&&a.splice(Ce,1),l.value=a.length>0?a[0]:null,u.value=!1,R(e("config.agentConfig.deleteSuccess"),"success")}catch(Ce){R(e("config.agentConfig.deleteFailed")+": "+Ce.message,"error")}},Q=()=>{const Ce=document.createElement("input");Ce.type="file",Ce.accept=".json",Ce.onchange=re=>{var ce;const ke=(ce=re.target.files)==null?void 0:ce[0];if(ke){const Ie=new FileReader;Ie.onload=async mt=>{var Ct;try{const Mt=JSON.parse((Ct=mt.target)==null?void 0:Ct.result);if(!Mt.name||!Mt.description)throw new Error(e("config.agentConfig.invalidFormat"));const{id:ci,...yn}=Mt,Qs=await ac.createAgent(yn);a.push(Qs),l.value=Qs,R(e("config.agentConfig.importSuccess"),"success")}catch(Mt){R(e("config.agentConfig.importFailed")+": "+Mt.message,"error")}},Ie.readAsText(ke)}},Ce.click()},H=()=>{if(l.value)try{const Ce=JSON.stringify(l.value,null,2),re=new Blob([Ce],{type:"application/json"}),ke=URL.createObjectURL(re),ce=document.createElement("a");ce.href=ke,ce.download=`agent-${l.value.name}-${new Date().toISOString().split("T")[0]}.json`,ce.click(),URL.revokeObjectURL(ke),R(e("config.agentConfig.exportSuccess"),"success")}catch(Ce){R(e("config.agentConfig.exportFailed")+": "+Ce.message,"error")}},G=Ce=>({zh:e("language.zh"),en:"English"})[Ce]||Ce,Z=async()=>{try{const Ce=await qU();_.value=Ce.languages,!b.value&&Ce.default&&(b.value=Ce.default)}catch(Ce){console.error("Failed to load supported languages:",Ce),R(e("common.loadFailed"),"error")}},$e=async()=>{try{const Ce=await ZU();w.value=Ce}catch(Ce){console.error("Failed to load agent stats:",Ce)}},ft=async()=>{await Promise.all([Z(),$e()]),v.value=!0},Bt=async()=>{if(!b.value){R(e("agent.multiLanguage.selectLanguage"),"error");return}C.value=!0;try{await GU({language:b.value}),R(e("agent.multiLanguage.resetSuccess"),"success"),v.value=!1,await Promise.all([j(),$e()])}catch(Ce){console.error("Failed to reset agents:",Ce),R(Ce.message||e("agent.multiLanguage.resetFailed"),"error")}finally{C.value=!1}};return Kd(()=>{j()}),cr(()=>i.value,(Ce,re)=>{Ce!==re&&(a.splice(0),l.value=null,j())}),(Ce,re)=>(ne(),In(Gb,null,{title:Zt(()=>[L("h2",null,B(P(e)("config.agentConfig.title")),1)]),actions:Zt(()=>[L("button",{class:"action-btn",onClick:ft},[xe(P(Re),{icon:"carbon:language"}),Pe(" "+B(P(e)("agent.multiLanguage.title")),1)]),L("button",{class:"action-btn",onClick:Q},[xe(P(Re),{icon:"carbon:upload"}),Pe(" "+B(P(e)("config.agentConfig.import")),1)]),L("button",{class:"action-btn",onClick:H,disabled:!l.value},[xe(P(Re),{icon:"carbon:download"}),Pe(" "+B(P(e)("config.agentConfig.export")),1)],8,YU)]),default:Zt(()=>{var ke;return[L("div",XU,[L("div",QU,[L("div",JU,[L("h3",null,B(P(e)("config.agentConfig.configuredAgents")),1),L("span",ej,"("+B(a.length)+B(P(e)("config.agentConfig.agentCount"))+")",1)]),n.value?at("",!0):(ne(),ue("div",tj,[(ne(!0),ue(Ji,null,ln(a,ce=>{var Ie,mt;return ne(),ue("div",{key:ce.id,class:Nn(["agent-card",{active:((Ie=l.value)==null?void 0:Ie.id)===ce.id}]),onClick:Ct=>O(ce)},[L("div",nj,[L("span",sj,B(ce.name),1),xe(P(Re),{icon:"carbon:chevron-right"})]),L("p",oj,B(ce.description),1),ce.model?(ne(),ue("div",rj,[L("span",aj,B(ce.model.type),1),L("span",lj,B(ce.model.modelName),1)])):at("",!0),((mt=ce.availableTools)==null?void 0:mt.length)>0?(ne(),ue("div",dj,[(ne(!0),ue(Ji,null,ln(ce.availableTools.slice(0,3),Ct=>(ne(),ue("span",{key:Ct,class:"tool-tag"},B(I(Ct)),1))),128)),ce.availableTools.length>3?(ne(),ue("span",cj," +"+B(ce.availableTools.length-3),1)):at("",!0)])):at("",!0)],10,ij)}),128))])),n.value?(ne(),ue("div",uj,[xe(P(Re),{icon:"carbon:loading",class:"loading-icon"}),Pe(" "+B(P(e)("common.loading")),1)])):at("",!0),!n.value&&a.length===0?(ne(),ue("div",hj,[xe(P(Re),{icon:"carbon:bot",class:"empty-icon"}),L("p",null,B(P(e)("config.agentConfig.noAgent")),1)])):at("",!0),L("button",{class:"add-btn",onClick:$},[xe(P(Re),{icon:"carbon:add"}),Pe(" "+B(P(e)("config.agentConfig.createNew")),1)])]),l.value?(ne(),ue("div",gj,[L("div",fj,[L("h3",null,B(l.value.name),1),L("div",pj,[L("button",{class:"action-btn primary",onClick:he},[xe(P(Re),{icon:"carbon:save"}),Pe(" "+B(P(e)("common.save")),1)]),L("button",{class:"action-btn danger",onClick:se},[xe(P(Re),{icon:"carbon:trash-can"}),Pe(" "+B(P(e)("common.delete")),1)])])]),L("div",mj,[L("label",null,[Pe(B(P(e)("config.agentConfig.agentName"))+" ",1),re[17]||(re[17]=L("span",{class:"required"},"*",-1))]),Vt(L("input",{type:"text","onUpdate:modelValue":re[0]||(re[0]=ce=>l.value.name=ce),placeholder:P(e)("config.agentConfig.agentNamePlaceholder"),required:""},null,8,_j),[[ti,l.value.name]])]),L("div",vj,[L("label",null,[Pe(B(P(e)("config.agentConfig.description"))+" ",1),re[18]||(re[18]=L("span",{class:"required"},"*",-1))]),Vt(L("textarea",{"onUpdate:modelValue":re[1]||(re[1]=ce=>l.value.description=ce),rows:"3",placeholder:P(e)("config.agentConfig.descriptionPlaceholder"),required:""},null,8,bj),[[ti,l.value.description]])]),L("div",Cj,[L("label",null,B(P(e)("config.agentConfig.nextStepPrompt")),1),L("textarea",{value:l.value.nextStepPrompt||"",onInput:re[2]||(re[2]=ce=>l.value.nextStepPrompt=ce.target.value),rows:"8",placeholder:P(e)("config.agentConfig.nextStepPromptPlaceholder")},null,40,wj)]),L("div",Sj,[L("h4",null,B(P(e)("config.agentConfig.modelConfiguration")),1),L("div",yj,[L("div",Lj,[L("button",{class:"model-btn",onClick:S,title:Ce.$t("model.switch")},[xe(P(Re),{icon:"carbon:build-run",width:"18"}),f.value?(ne(),ue("span",xj,[L("span",kj,B(f.value.type),1),re[19]||(re[19]=L("span",{class:"spacer"},null,-1)),L("span",Ij,B(f.value.modelName),1)])):(ne(),ue("span",Ej,[L("span",Nj,B(P(e)("config.agentConfig.modelConfigurationLabel")),1)])),xe(P(Re),{icon:g.value?"carbon:chevron-up":"carbon:chevron-down",width:"14",class:"chevron"},null,8,["icon"])],8,Dj),g.value?(ne(),ue("div",{key:0,class:"model-dropdown",onClick:re[4]||(re[4]=Zh(()=>{},["stop"]))},[L("div",Tj,[L("span",null,B(P(e)("config.agentConfig.modelConfigurationLabel")),1),L("button",{class:"close-btn",onClick:re[3]||(re[3]=ce=>g.value=!1)},[xe(P(Re),{icon:"carbon:close",width:"16"})])]),L("div",Mj,[(ne(!0),ue(Ji,null,ln(m,ce=>{var Ie,mt;return ne(),ue("button",{key:ce.id,class:Nn(["model-option",{active:((Ie=f.value)==null?void 0:Ie.id)===ce.id}]),onClick:Ct=>x(ce)},[L("span",Rj,B(ce.type),1),L("span",Pj,B(ce.modelName),1),((mt=f.value)==null?void 0:mt.id)===ce.id?(ne(),In(P(Re),{key:0,icon:"carbon:checkmark",width:"16",class:"check-icon"})):at("",!0)],10,Aj)}),128))])])):at("",!0),g.value?(ne(),ue("div",{key:1,class:"backdrop",onClick:re[5]||(re[5]=ce=>g.value=!1)})):at("",!0)])])]),L("div",Oj,[L("h4",null,B(P(e)("config.agentConfig.toolConfiguration")),1),L("div",Fj,[L("div",Bj,[L("span",null,B(P(e)("config.agentConfig.assignedTools"))+" ("+B((l.value.availableTools||[]).length)+")",1),d.length>0?(ne(),ue("button",{key:0,class:"action-btn small",onClick:oe},[xe(P(Re),{icon:"carbon:add"}),Pe(" "+B(P(e)("config.agentConfig.addRemoveTools")),1)])):at("",!0)]),L("div",Wj,[(ne(!0),ue(Ji,null,ln(l.value.availableTools||[],ce=>(ne(),ue("div",{key:ce,class:"tool-item assigned"},[L("div",Vj,[L("span",Hj,B(I(ce)),1),L("span",zj,B(E(ce)),1)])]))),128)),l.value.availableTools.length===0?(ne(),ue("div",$j,[xe(P(Re),{icon:"carbon:tool-box"}),L("span",null,B(P(e)("config.agentConfig.noAssignedTools")),1)])):at("",!0)])])])])):(ne(),ue("div",Uj,[xe(P(Re),{icon:"carbon:bot",class:"placeholder-icon"}),L("p",null,B(P(e)("config.agentConfig.selectAgentHint")),1)]))]),xe(Wo,{modelValue:c.value,"onUpdate:modelValue":re[9]||(re[9]=ce=>c.value=ce),title:P(e)("config.agentConfig.newAgent"),onConfirm:K},{default:Zt(()=>[L("div",jj,[L("div",Kj,[L("label",null,[Pe(B(P(e)("config.agentConfig.agentName"))+" ",1),re[20]||(re[20]=L("span",{class:"required"},"*",-1))]),Vt(L("input",{type:"text","onUpdate:modelValue":re[6]||(re[6]=ce=>y.name=ce),placeholder:P(e)("config.agentConfig.agentNamePlaceholder"),required:""},null,8,qj),[[ti,y.name]])]),L("div",Gj,[L("label",null,[Pe(B(P(e)("config.agentConfig.description"))+" ",1),re[21]||(re[21]=L("span",{class:"required"},"*",-1))]),Vt(L("textarea",{"onUpdate:modelValue":re[7]||(re[7]=ce=>y.description=ce),rows:"3",placeholder:P(e)("config.agentConfig.descriptionPlaceholder"),required:""},null,8,Zj),[[ti,y.description]])]),L("div",Yj,[L("label",null,B(P(e)("config.agentConfig.nextStepPrompt")),1),L("textarea",{value:y.nextStepPrompt||"",onInput:re[8]||(re[8]=ce=>y.nextStepPrompt=ce.target.value),rows:"8",placeholder:P(e)("config.agentConfig.nextStepPromptPlaceholder")},null,40,Xj)])])]),_:1},8,["modelValue","title"]),xe(KU,{modelValue:h.value,"onUpdate:modelValue":re[10]||(re[10]=ce=>h.value=ce),tools:d,"selected-tool-ids":((ke=l.value)==null?void 0:ke.availableTools)||[],onConfirm:Le},null,8,["modelValue","tools","selected-tool-ids"]),xe(Wo,{modelValue:u.value,"onUpdate:modelValue":re[12]||(re[12]=ce=>u.value=ce),title:P(e)("config.agentConfig.deleteConfirm")},{footer:Zt(()=>[L("button",{class:"cancel-btn",onClick:re[11]||(re[11]=ce=>u.value=!1)},B(P(e)("common.cancel")),1),L("button",{class:"confirm-btn danger",onClick:V},B(P(e)("common.delete")),1)]),default:Zt(()=>{var ce;return[L("div",Qj,[xe(P(Re),{icon:"carbon:warning",class:"warning-icon"}),L("p",null,[Pe(B(P(e)("config.agentConfig.deleteConfirmText"))+" ",1),L("strong",null,B((ce=l.value)==null?void 0:ce.name),1),Pe(" "+B(P(e)("common.confirm"))+"? ",1)]),L("p",Jj,B(P(e)("config.agentConfig.deleteWarning")),1)])]}),_:1},8,["modelValue","title"]),s.value?(ne(),ue("div",{key:0,class:"error-toast",onClick:re[13]||(re[13]=ce=>s.value="")},[xe(P(Re),{icon:"carbon:error"}),Pe(" "+B(s.value),1)])):at("",!0),r.value?(ne(),ue("div",{key:1,class:"success-toast",onClick:re[14]||(re[14]=ce=>r.value="")},[xe(P(Re),{icon:"carbon:checkmark"}),Pe(" "+B(r.value),1)])):at("",!0),xe(Wo,{modelValue:v.value,"onUpdate:modelValue":re[16]||(re[16]=ce=>v.value=ce),title:P(e)("agent.multiLanguage.title"),onConfirm:Bt},{title:Zt(()=>[Pe(B(P(e)("agent.multiLanguage.title")),1)]),default:Zt(()=>[L("div",eK,[L("div",tK,[L("div",iK,[L("span",nK,B(P(e)("agent.multiLanguage.currentLanguage"))+":",1),L("span",sK,B(G(Ce.$i18n.locale)),1)]),L("div",oK,[L("span",rK,B(P(e)("common.total"))+":",1),L("span",aK,B(w.value.total),1)])]),L("div",lK,[L("label",dK,B(P(e)("agent.multiLanguage.selectLanguage"))+":",1),Vt(L("select",{"onUpdate:modelValue":re[15]||(re[15]=ce=>b.value=ce),class:"language-select"},[L("option",cK,B(P(e)("agent.multiLanguage.selectLanguage")),1),(ne(!0),ue(Ji,null,ln(_.value,ce=>(ne(),ue("option",{key:ce,value:ce},B(G(ce)),9,uK))),128))],512),[[X1,b.value]])]),L("div",hK,[L("div",gK,[xe(P(Re),{icon:"carbon:warning",class:"warning-icon"}),L("div",fK,[L("p",null,B(P(e)("agent.multiLanguage.resetAllWarning")),1)])])])])]),_:1},8,["modelValue","title"])]}),_:1}))}}),mK=us(pK,[["__scopeId","data-v-c305016e"]]),_K={class:"custom-select"},vK=["title"],bK={key:0,class:"current-option"},CK={class:"option-name"},wK={key:1,class:"current-option"},SK={class:"dropdown-header"},yK={class:"select-options"},LK=["onClick"],DK={class:"option-name"},xK=Ss({__name:"index",props:{modelValue:{},options:{},placeholder:{},dropdownTitle:{},icon:{},direction:{},dropStyles:{},onChange:{type:Function}},emits:["update:modelValue"],setup(o,{emit:e}){const t=o,i=e,n=Ye(!1),s=Ye("bottom"),r=Xn(()=>t.options.find(u=>u.id===t.modelValue)),a=u=>u.id===t.modelValue,l=()=>{n.value||d(),n.value=!n.value},d=()=>{const u=document.querySelector(".custom-select");if(!u)return;const h=u.getBoundingClientRect(),g=window.innerHeight;h.bottom+200>g?s.value="top":s.value="bottom"},c=u=>{t.onChange?t.onChange(u.id,u):i("update:modelValue",u.id),n.value=!1};return(u,h)=>(ne(),ue("div",_K,[L("button",{class:"select-btn",onClick:l,title:u.placeholder},[xe(P(Re),{icon:t.icon||"carbon:select-01",width:"18"},null,8,["icon"]),r.value?(ne(),ue("span",bK,[r.value.icon?(ne(),In(P(Re),{key:0,icon:r.value.icon,width:"16",class:"option-icon"},null,8,["icon"])):at("",!0),L("span",CK,B(r.value.name),1)])):(ne(),ue("span",wK,B(u.placeholder),1)),xe(P(Re),{icon:n.value?"carbon:chevron-up":"carbon:chevron-down",width:"14",class:"chevron"},null,8,["icon"])],8,vK),xe(qb,{name:"slideDown"},{default:Zt(()=>[Vt(L("div",{class:Nn(["select-dropdown",{"dropdown-top":s.value==="top"}]),style:Nz({...u.dropStyles,...t.direction==="right"?{right:0}:{left:0}}),onClick:h[1]||(h[1]=Zh(()=>{},["stop"]))},[L("div",SK,[L("span",null,B(u.dropdownTitle),1),L("button",{class:"close-btn",onClick:h[0]||(h[0]=g=>n.value=!1)},[xe(P(Re),{icon:"carbon:close",width:"16"})])]),L("div",yK,[(ne(!0),ue(Ji,null,ln(u.options,g=>(ne(),ue("button",{key:g.id,class:Nn(["select-option",{active:a(g)}]),onClick:f=>c(g)},[g.icon?(ne(),In(P(Re),{key:0,icon:g.icon,width:"16",class:"option-icon"},null,8,["icon"])):at("",!0),L("span",DK,B(g.name),1),a(g)?(ne(),In(P(Re),{key:1,icon:"carbon:checkmark",width:"16",class:"check-icon"})):at("",!0)],10,LK))),128))])],6),[[ny,n.value]])]),_:1}),n.value?(ne(),ue("div",{key:0,class:"backdrop",onClick:h[2]||(h[2]=g=>n.value=!1)})):at("",!0)]))}}),Q1=us(xK,[["__scopeId","data-v-579d8359"]]),kK={class:"grouped-select"},IK=["title"],EK={key:0,class:"selected-text"},NK={class:"model-category"},TK={key:1,class:"placeholder-text"},MK={key:1,class:"dropdown-content"},AK={class:"dropdown-header"},RK={class:"search-container"},PK=["placeholder"],OK={class:"groups-container"},FK={class:"group-header"},BK={class:"group-title"},WK={class:"group-count"},VK={class:"models-grid"},HK=["onClick","title"],zK={class:"model-info"},$K={class:"model-name"},UK={class:"model-description"},jK={class:"model-category-tag"},KK=Ss({__name:"GroupedSelect",props:{modelValue:{},options:{},placeholder:{default:"Please select a model"},dropdownTitle:{default:"Available Models"}},emits:["update:modelValue"],setup(o,{emit:e}){const t=o,i=e,{t:n}=Pa(),s=Ye(!1),r=Ye(""),a=Xn(()=>{const f={};return t.options.forEach(v=>{f[v.category]||(f[v.category]=[]),f[v.category].push(v)}),["Turbo","Plus","Max","Coder","Math","Vision","TTS","Standard"].filter(v=>f[v]).map(v=>({category:v,models:f[v].sort((_,b)=>_.name.localeCompare(b.name))}))}),l=Xn(()=>r.value?a.value.map(f=>({...f,models:f.models.filter(m=>m.name.toLowerCase().includes(r.value.toLowerCase())||m.description.toLowerCase().includes(r.value.toLowerCase())||m.category.toLowerCase().includes(r.value.toLowerCase()))})).filter(f=>f.models.length>0):a.value),d=Xn(()=>t.options.find(f=>f.id===t.modelValue)),c=()=>{s.value=!s.value,s.value&&(r.value="")},u=()=>{s.value=!1,r.value=""},h=f=>{i("update:modelValue",f.id),u()},g=f=>{f.target.closest(".grouped-select")||u()};return Kd(()=>{document.addEventListener("click",g)}),E9(()=>{document.removeEventListener("click",g)}),(f,m)=>(ne(),ue("div",kK,[L("button",{class:"select-btn",onClick:c,title:f.placeholder||""},[d.value?(ne(),ue("span",EK,[Pe(B(d.value.name)+" ",1),L("span",NK,"["+B(d.value.category)+"]",1)])):(ne(),ue("span",TK,B(f.placeholder),1)),xe(P(Re),{icon:"carbon:chevron-down",class:Nn(["chevron",{rotated:s.value}])},null,8,["class"])],8,IK),s.value?(ne(),ue("div",{key:0,class:"dropdown-overlay",onClick:u})):at("",!0),s.value?(ne(),ue("div",MK,[L("div",AK,[L("h3",null,B(f.dropdownTitle),1),L("button",{class:"close-btn",onClick:u},[xe(P(Re),{icon:"carbon:close"})])]),L("div",RK,[Vt(L("input",{"onUpdate:modelValue":m[0]||(m[0]=v=>r.value=v),type:"text",placeholder:P(n)("config.modelConfig.searchModels"),class:"search-input"},null,8,PK),[[ti,r.value]]),xe(P(Re),{icon:"carbon:search",class:"search-icon"})]),L("div",OK,[(ne(!0),ue(Ji,null,ln(l.value,v=>(ne(),ue("div",{key:v.category,class:"model-group"},[L("div",FK,[L("span",BK,B(v.category),1),L("span",WK,"("+B(v.models.length)+")",1)]),L("div",VK,[(ne(!0),ue(Ji,null,ln(v.models,_=>(ne(),ue("button",{key:_.id,class:Nn(["model-option",{selected:_.id===f.modelValue}]),onClick:b=>h(_),title:_.description},[L("div",zK,[L("div",$K,B(_.name),1),L("div",UK,B(_.description),1)]),L("div",jK,"["+B(_.category)+"]",1)],10,HK))),128))])]))),128))])])):at("",!0)]))}}),kP=us(KK,[["__scopeId","data-v-08a99d28"]]),qK=["disabled"],GK={class:"model-layout"},ZK={class:"model-list"},YK={class:"list-header"},XK={class:"model-count"},QK={key:0,class:"models-container"},JK=["onClick"],eq={class:"model-card-header"},tq={class:"model-name"},iq={class:"model-status"},nq={key:0,class:"default-badge"},sq={class:"model-desc"},oq={key:0,class:"model-type"},rq={class:"model-tag"},aq={key:1,class:"loading-state"},lq={key:2,class:"empty-state"},dq={key:0,class:"model-detail"},cq={class:"detail-header"},uq={class:"detail-actions"},hq=["disabled"],gq={key:1,class:"current-default"},fq={class:"form-item"},pq={class:"form-item"},mq=["placeholder"],_q={class:"form-item"},vq=["placeholder"],bq={class:"form-item"},Cq={class:"api-key-container"},wq=["placeholder"],Sq=["disabled","title"],yq={class:"form-item"},Lq={key:1,class:"readonly-field"},Dq={class:"form-item"},xq=["placeholder"],kq={class:"form-item"},Iq=["placeholder"],Eq={class:"form-item"},Nq=["placeholder"],Tq={key:1,class:"no-selection"},Mq={class:"modal-form"},Aq={class:"form-item"},Rq={class:"form-item"},Pq=["placeholder"],Oq={class:"form-item"},Fq=["placeholder"],Bq={class:"form-item"},Wq={class:"api-key-container"},Vq=["placeholder"],Hq=["disabled","title"],zq={class:"form-item"},$q={key:1,class:"readonly-field"},Uq={class:"form-item"},jq=["placeholder"],Kq={class:"form-item"},qq=["placeholder"],Gq={class:"form-item"},Zq=["placeholder"],Yq={class:"delete-confirm"},Xq={class:"warning-text"},Qq=Ss({__name:"modelConfig",setup(o){const{t:e}=Pa(),t=Ye(!1),i=Ye(""),n=Ye(""),s=ar([]),r=ar([]),a=Ye(null),l=Ye(!1),d=Ye(!1),c=Ye(!1),u=Ye(!1),h=Ye(new Map),g=Ye(!1),f=Ye([]),m=Xn({get(){var Q;return(Q=a.value)!=null&&Q.headers?JSON.stringify(a.value.headers,null,2):""},set(Q){a.value&&(a.value.headers=Q.trim()?JSON.parse(Q):null)}}),v=Xn({get(){return _.headers?JSON.stringify(_.headers,null,2):""},set(Q){_.headers=Q.trim()?JSON.parse(Q):null}}),_=ar({baseUrl:"",headers:null,apiKey:"",modelName:"",modelDescription:"",type:""}),b=(Q,H)=>{H==="success"?(n.value=Q,setTimeout(()=>{n.value=""},3e3)):H==="error"?(i.value=Q,setTimeout(()=>{i.value=""},5e3)):H==="info"&&(n.value=Q,setTimeout(()=>{n.value=""},2e3))},C=async()=>{t.value=!0;try{const[Q,H]=await Promise.all([ko.getAllModels(),ko.getAllTypes()]),G=Q.map(Z=>({...Z}));s.splice(0,s.length,...G),r.splice(0,r.length,...H),G.length>0&&await w(G[0])}catch(Q){console.error("Failed to load data:",Q),b(e("config.modelConfig.loadDataFailed")+": "+Q.message,"error")}finally{t.value=!1}},w=async Q=>{try{const H=await ko.getModelById(Q.id);a.value={...H},c.value=!1}catch(H){console.error("Failed to load Model details:",H),b(e("config.modelConfig.loadDetailsFailed")+": "+H.message,"error"),a.value={...Q}}},S=()=>{_.baseUrl="",_.headers=null,_.apiKey="",_.modelName="",_.modelDescription="",_.type="",delete _.temperature,delete _.topP,g.value=!1,f.value=[],l.value=!0},x=async()=>{var Q,H,G,Z;if(!((Q=a.value)!=null&&Q.baseUrl)||!((H=a.value)!=null&&H.apiKey)){b(e("config.modelConfig.pleaseEnterBaseUrlAndApiKey"),"error");return}c.value=!0;try{const $e=await ko.validateConfig({baseUrl:a.value.baseUrl,apiKey:a.value.apiKey});$e.valid?(b(e("config.modelConfig.validationSuccess")+` - ${e("config.modelConfig.getModelsCount",{count:((G=$e.availableModels)==null?void 0:G.length)||0})}`,"success"),(Z=a.value)!=null&&Z.id&&h.value.set(a.value.id,$e.availableModels||[]),$e.availableModels&&$e.availableModels.length>0&&(a.value.modelName=$e.availableModels[0].modelName,a.value.modelDescription=I($e.availableModels[0].modelName))):b(e("config.modelConfig.validationFailed")+": "+$e.message,"error")}catch($e){b(e("config.modelConfig.validationFailed")+": "+$e.message,"error")}finally{c.value=!1}},y=Q=>{const H=Q.toLowerCase();return H.includes("turbo")?"Turbo":H.includes("plus")?"Plus":H.includes("max")?"Max":H.includes("coder")||H.includes("code")?"Coder":H.includes("math")?"Math":H.includes("vision")||H.includes("vl")?"Vision":H.includes("tts")?"TTS":"Standard"},I=Q=>{const H=Q.toLowerCase();return H.includes("turbo")?"Turbo model, fast response":H.includes("plus")?"Plus model, balanced performance":H.includes("max")?"Max model, strongest performance":H.includes("coder")||H.includes("code")?"Coder model, specialized for code generation":H.includes("math")?"Math model, specialized for mathematical calculations":H.includes("vision")||H.includes("vl")?"Vision model, specialized for visual understanding":H.includes("tts")?"TTS model, specialized for text-to-speech":"Standard model"},E=()=>{var Q;return(Q=a.value)!=null&&Q.id?h.value.get(a.value.id)||[]:[]},R=Q=>{a.value&&Q&&E().find(Z=>Z.modelName===Q)&&(a.value.modelDescription=I(Q))},j=async()=>{var Q;if(!_.baseUrl||!_.apiKey){b(e("config.modelConfig.pleaseEnterBaseUrlAndApiKey"),"error");return}g.value=!0;try{const H=await ko.validateConfig({baseUrl:_.baseUrl,apiKey:_.apiKey});H.valid?(b(e("config.modelConfig.validationSuccess")+` - ${e("config.modelConfig.getModelsCount",{count:((Q=H.availableModels)==null?void 0:Q.length)||0})}`,"success"),f.value=H.availableModels||[],H.availableModels&&H.availableModels.length>0&&(_.modelName=H.availableModels[0].modelName,_.modelDescription=I(H.availableModels[0].modelName))):b(e("config.modelConfig.validationFailed")+": "+H.message,"error")}catch(H){b(e("config.modelConfig.validationFailed")+": "+H.message,"error")}finally{g.value=!1}},O=Q=>{Q&&f.value.find(G=>G.modelName===Q)&&(_.modelDescription=I(Q))},$=async()=>{if(!_.modelName.trim()||!_.modelDescription.trim()){b(e("config.modelConfig.requiredFields"),"error");return}if(!_.baseUrl.trim()||!_.apiKey.trim()){b(e("config.modelConfig.pleaseEnterBaseUrlAndApiKey"),"error");return}b(e("config.modelConfig.validatingBeforeSave"),"info");try{const Q=await ko.validateConfig({baseUrl:_.baseUrl.trim(),apiKey:_.apiKey.trim()});if(!Q.valid){b(e("config.modelConfig.validationFailedCannotSave")+": "+Q.message,"error");return}}catch(Q){b(e("config.modelConfig.validationFailedCannotSave")+": "+Q.message,"error");return}try{const Q={baseUrl:_.baseUrl.trim(),headers:_.headers,apiKey:_.apiKey.trim(),modelName:_.modelName.trim(),modelDescription:_.modelDescription.trim(),type:_.type.trim(),temperature:isNaN(_.temperature)?null:_.temperature,topP:isNaN(_.topP)?null:_.topP},H=await ko.createModel(Q);s.push(H),a.value=H,l.value=!1,b(e("config.modelConfig.createSuccess"),"success")}catch(Q){b(e("config.modelConfig.createFailed")+": "+Q.message,"error")}},K=async()=>{if(!a.value)return;if(!a.value.modelName.trim()||!a.value.modelDescription.trim()){b(e("config.modelConfig.requiredFields"),"error");return}if(!a.value.baseUrl||!a.value.apiKey){b(e("config.modelConfig.pleaseEnterBaseUrlAndApiKey"),"error");return}if(!a.value.apiKey.includes("*")||!h.value.has(a.value.id)){b(e("config.modelConfig.validatingBeforeSave"),"info");try{const H=await ko.validateConfig({baseUrl:a.value.baseUrl,apiKey:a.value.apiKey});if(!H.valid){b(e("config.modelConfig.validationFailedCannotSave")+": "+H.message,"error");return}h.value.set(a.value.id,H.availableModels||[])}catch(H){b(e("config.modelConfig.validationFailedCannotSave")+": "+H.message,"error");return}}try{const H={...a.value,temperature:isNaN(a.value.temperature)?null:a.value.temperature,topP:isNaN(a.value.topP)?null:a.value.topP},G=await ko.updateModel(a.value.id,H),Z=s.findIndex($e=>$e.id===G.id);Z!==-1&&(s[Z]=G),a.value=G,b(e("config.modelConfig.saveSuccess"),"success")}catch(H){b(e("config.modelConfig.saveFailed")+": "+H.message,"error")}},oe=()=>{d.value=!0},Le=async()=>{if(a.value){u.value=!0;try{await ko.setDefaultModel(a.value.id),s.forEach(Q=>{Q.isDefault=Q.id===a.value.id}),a.value.isDefault=!0,b(e("config.modelConfig.setDefaultSuccess"),"success")}catch(Q){b(e("config.modelConfig.setDefaultFailed")+": "+Q.message,"error")}finally{u.value=!1}}},he=async()=>{if(a.value)try{await ko.deleteModel(a.value.id);const Q=s.findIndex(H=>H.id===a.value.id);Q!==-1&&s.splice(Q,1),a.value=s.length>0?s[0]:null,d.value=!1,b(e("config.modelConfig.deleteSuccess"),"success")}catch(Q){b(e("config.modelConfig.deleteFailed")+": "+Q.message,"error")}},se=()=>{const Q=document.createElement("input");Q.type="file",Q.accept=".json",Q.onchange=H=>{var Z;const G=(Z=H.target.files)==null?void 0:Z[0];if(G){const $e=new FileReader;$e.onload=async ft=>{var Bt;try{const Ce=JSON.parse((Bt=ft.target)==null?void 0:Bt.result);if(!Ce.modelName||!Ce.modelDescription)throw new Error(e("config.modelConfig.invalidFormat"));const{id:re,...ke}=Ce,ce=await ko.createModel(ke);s.push(ce),a.value=ce,b(e("config.modelConfig.importSuccess"),"success")}catch(Ce){b(e("config.modelConfig.importFailed")+": "+Ce.message,"error")}},$e.readAsText(G)}},Q.click()},V=()=>{if(a.value)try{const Q=JSON.stringify(a.value,null,2),H=new Blob([Q],{type:"application/json"}),G=URL.createObjectURL(H),Z=document.createElement("a");Z.href=G,Z.download=`model-${a.value.modelName}-${new Date().toISOString().split("T")[0]}.json`,Z.click(),URL.revokeObjectURL(G),b(e("config.modelConfig.exportSuccess"),"success")}catch(Q){b(e("config.modelConfig.exportFailed")+": "+Q.message,"error")}};return Kd(()=>{C()}),(Q,H)=>(ne(),In(Gb,null,{title:Zt(()=>[L("h2",null,B(P(e)("config.modelConfig.title")),1)]),actions:Zt(()=>[L("button",{class:"action-btn",onClick:se},[xe(P(Re),{icon:"carbon:upload"}),Pe(" "+B(P(e)("config.modelConfig.import")),1)]),L("button",{class:"action-btn",onClick:V,disabled:!a.value},[xe(P(Re),{icon:"carbon:download"}),Pe(" "+B(P(e)("config.modelConfig.export")),1)],8,qK)]),default:Zt(()=>[L("div",GK,[L("div",ZK,[L("div",YK,[L("h3",null,B(P(e)("config.modelConfig.configuredModels")),1),L("span",XK,"("+B(s.length)+")",1)]),t.value?at("",!0):(ne(),ue("div",QK,[(ne(!0),ue(Ji,null,ln(s,G=>{var Z;return ne(),ue("div",{key:G.id,class:Nn(["model-card",{active:((Z=a.value)==null?void 0:Z.id)===G.id}]),onClick:$e=>w(G)},[L("div",eq,[L("span",tq,B(G.modelName),1),L("div",iq,[G.isDefault?(ne(),ue("span",nq,[xe(P(Re),{icon:"carbon:star-filled"}),Pe(" "+B(P(e)("config.modelConfig.default")),1)])):at("",!0),xe(P(Re),{icon:"carbon:chevron-right"})])]),L("p",sq,B(G.modelDescription),1),G.type?(ne(),ue("div",oq,[L("span",rq,B(G.type),1)])):at("",!0)],10,JK)}),128))])),t.value?(ne(),ue("div",aq,[xe(P(Re),{icon:"carbon:loading",class:"loading-icon"}),Pe(" "+B(P(e)("common.loading")),1)])):at("",!0),!t.value&&s.length===0?(ne(),ue("div",lq,[xe(P(Re),{icon:"carbon:bot",class:"empty-icon"}),L("p",null,B(P(e)("config.modelConfig.noModel")),1)])):at("",!0),L("button",{class:"add-btn",onClick:S},[xe(P(Re),{icon:"carbon:add"}),Pe(" "+B(P(e)("config.modelConfig.createNew")),1)])]),a.value?(ne(),ue("div",dq,[L("div",cq,[L("h3",null,B(a.value.modelName),1),L("div",uq,[a.value.isDefault?(ne(),ue("span",gq,[xe(P(Re),{icon:"carbon:star-filled"}),Pe(" "+B(P(e)("config.modelConfig.currentDefault")),1)])):(ne(),ue("button",{key:0,class:"action-btn default",onClick:Le,disabled:u.value},[xe(P(Re),{icon:"carbon:star"}),Pe(" "+B(P(e)("config.modelConfig.setAsDefault")),1)],8,hq)),L("button",{class:"action-btn primary",onClick:K},[xe(P(Re),{icon:"carbon:save"}),Pe(" "+B(P(e)("common.save")),1)]),L("button",{class:"action-btn danger",onClick:oe},[xe(P(Re),{icon:"carbon:trash-can"}),Pe(" "+B(P(e)("common.delete")),1)])])]),L("div",fq,[L("label",null,[Pe(B(P(e)("config.modelConfig.type"))+" ",1),H[21]||(H[21]=L("span",{class:"required"},"*",-1))]),xe(Q1,{modelValue:a.value.type,"onUpdate:modelValue":H[0]||(H[0]=G=>a.value.type=G),options:r.map(G=>({id:G,name:G})),placeholder:P(e)("config.modelConfig.typePlaceholder"),"dropdown-title":P(e)("config.modelConfig.typePlaceholder"),icon:"carbon:types"},null,8,["modelValue","options","placeholder","dropdown-title"])]),L("div",pq,[L("label",null,[Pe(B(P(e)("config.modelConfig.baseUrl"))+" ",1),H[22]||(H[22]=L("span",{class:"required"},"*",-1))]),Vt(L("input",{type:"text","onUpdate:modelValue":H[1]||(H[1]=G=>a.value.baseUrl=G),placeholder:P(e)("config.modelConfig.baseUrlPlaceholder"),required:""},null,8,mq),[[ti,a.value.baseUrl]])]),L("div",_q,[L("label",null,B(P(e)("config.modelConfig.headers")),1),Vt(L("input",{type:"text","onUpdate:modelValue":H[2]||(H[2]=G=>m.value=G),placeholder:P(e)("config.modelConfig.headersPlaceholder")},null,8,vq),[[ti,m.value]])]),L("div",bq,[L("label",null,[Pe(B(P(e)("config.modelConfig.apiKey"))+" ",1),H[23]||(H[23]=L("span",{class:"required"},"*",-1))]),L("div",Cq,[Vt(L("input",{type:"text","onUpdate:modelValue":H[3]||(H[3]=G=>a.value.apiKey=G),placeholder:P(e)("config.modelConfig.apiKeyPlaceholder"),required:""},null,8,wq),[[ti,a.value.apiKey]]),L("button",{class:"check-btn",onClick:x,disabled:c.value||!a.value.baseUrl||!a.value.apiKey,title:P(e)("config.modelConfig.validateConfig")},[c.value?(ne(),In(P(Re),{key:1,icon:"carbon:loading",class:"loading-icon"})):(ne(),In(P(Re),{key:0,icon:"carbon:checkmark"}))],8,Sq)])]),L("div",yq,[L("label",null,[Pe(B(P(e)("config.modelConfig.modelName"))+" ",1),H[24]||(H[24]=L("span",{class:"required"},"*",-1))]),E().length>0?(ne(),In(kP,{key:0,modelValue:a.value.modelName,"onUpdate:modelValue":[H[4]||(H[4]=G=>a.value.modelName=G),R],options:E().map(G=>({id:G.modelName,name:G.modelName,description:I(G.modelName),category:y(G.modelName)})),placeholder:P(e)("config.modelConfig.selectModel"),"dropdown-title":P(e)("config.modelConfig.availableModels")},null,8,["modelValue","options","placeholder","dropdown-title"])):(ne(),ue("div",Lq,B(a.value.modelName||P(e)("config.modelConfig.modelNamePlaceholder")),1))]),L("div",Dq,[L("label",null,[Pe(B(P(e)("config.modelConfig.description"))+" ",1),H[25]||(H[25]=L("span",{class:"required"},"*",-1))]),Vt(L("textarea",{"onUpdate:modelValue":H[5]||(H[5]=G=>a.value.modelDescription=G),placeholder:P(e)("config.modelConfig.descriptionPlaceholder"),class:"description-field",rows:"3"},null,8,xq),[[ti,a.value.modelDescription]])]),L("div",kq,[L("label",null,B(P(e)("config.modelConfig.temperature")),1),Vt(L("input",{type:"number","onUpdate:modelValue":H[6]||(H[6]=G=>a.value.temperature=G),placeholder:P(e)("config.modelConfig.temperaturePlaceholder"),step:"0.1",min:"0",max:"2"},null,8,Iq),[[ti,a.value.temperature,void 0,{number:!0}]])]),L("div",Eq,[L("label",null,B(P(e)("config.modelConfig.topP")),1),Vt(L("input",{type:"number","onUpdate:modelValue":H[7]||(H[7]=G=>a.value.topP=G),placeholder:P(e)("config.modelConfig.topPPlaceholder"),step:"0.1",min:"0",max:"1"},null,8,Nq),[[ti,a.value.topP,void 0,{number:!0}]])])])):(ne(),ue("div",Tq,[xe(P(Re),{icon:"carbon:bot",class:"placeholder-icon"}),L("p",null,B(P(e)("config.modelConfig.selectModelHint")),1)]))]),xe(Wo,{modelValue:l.value,"onUpdate:modelValue":H[16]||(H[16]=G=>l.value=G),title:P(e)("config.modelConfig.newModel"),onConfirm:$},{default:Zt(()=>[L("div",Mq,[L("div",Aq,[L("label",null,[Pe(B(P(e)("config.modelConfig.type"))+" ",1),H[26]||(H[26]=L("span",{class:"required"},"*",-1))]),xe(Q1,{modelValue:_.type,"onUpdate:modelValue":H[8]||(H[8]=G=>_.type=G),options:r.map(G=>({id:G,name:G})),placeholder:P(e)("config.modelConfig.typePlaceholder"),"dropdown-title":P(e)("config.modelConfig.typePlaceholder"),icon:"carbon:types"},null,8,["modelValue","options","placeholder","dropdown-title"])]),L("div",Rq,[L("label",null,[Pe(B(P(e)("config.modelConfig.baseUrl"))+" ",1),H[27]||(H[27]=L("span",{class:"required"},"*",-1))]),Vt(L("input",{type:"text","onUpdate:modelValue":H[9]||(H[9]=G=>_.baseUrl=G),placeholder:P(e)("config.modelConfig.baseUrlPlaceholder"),required:""},null,8,Pq),[[ti,_.baseUrl]])]),L("div",Oq,[L("label",null,B(P(e)("config.modelConfig.headers")),1),Vt(L("input",{type:"text","onUpdate:modelValue":H[10]||(H[10]=G=>v.value=G),placeholder:P(e)("config.modelConfig.headersPlaceholder")},null,8,Fq),[[ti,v.value]])]),L("div",Bq,[L("label",null,[Pe(B(P(e)("config.modelConfig.apiKey"))+" ",1),H[28]||(H[28]=L("span",{class:"required"},"*",-1))]),L("div",Wq,[Vt(L("input",{type:"text","onUpdate:modelValue":H[11]||(H[11]=G=>_.apiKey=G),placeholder:P(e)("config.modelConfig.apiKeyPlaceholder"),required:""},null,8,Vq),[[ti,_.apiKey]]),L("button",{class:"check-btn",onClick:j,disabled:g.value||!_.baseUrl||!_.apiKey,title:P(e)("config.modelConfig.validateConfig")},[g.value?(ne(),In(P(Re),{key:1,icon:"carbon:loading",class:"loading-icon"})):(ne(),In(P(Re),{key:0,icon:"carbon:checkmark"}))],8,Hq)])]),L("div",zq,[L("label",null,[Pe(B(P(e)("config.modelConfig.modelName"))+" ",1),H[29]||(H[29]=L("span",{class:"required"},"*",-1))]),f.value.length>0?(ne(),In(kP,{key:0,modelValue:_.modelName,"onUpdate:modelValue":[H[12]||(H[12]=G=>_.modelName=G),O],options:f.value.map(G=>({id:G.modelName,name:G.modelName,description:I(G.modelName),category:y(G.modelName)})),placeholder:P(e)("config.modelConfig.selectModel"),"dropdown-title":P(e)("config.modelConfig.availableModels")},null,8,["modelValue","options","placeholder","dropdown-title"])):(ne(),ue("div",$q,B(_.modelName||P(e)("config.modelConfig.modelNamePlaceholder")),1))]),L("div",Uq,[L("label",null,[Pe(B(P(e)("config.modelConfig.description"))+" ",1),H[30]||(H[30]=L("span",{class:"required"},"*",-1))]),Vt(L("textarea",{"onUpdate:modelValue":H[13]||(H[13]=G=>_.modelDescription=G),placeholder:P(e)("config.modelConfig.descriptionPlaceholder"),class:"description-field",rows:"3"},null,8,jq),[[ti,_.modelDescription]])]),L("div",Kq,[L("label",null,B(P(e)("config.modelConfig.temperature")),1),Vt(L("input",{type:"number","onUpdate:modelValue":H[14]||(H[14]=G=>_.temperature=G),placeholder:P(e)("config.modelConfig.temperaturePlaceholder"),step:"0.1",min:"0",max:"2"},null,8,qq),[[ti,_.temperature,void 0,{number:!0}]])]),L("div",Gq,[L("label",null,B(P(e)("config.modelConfig.topP")),1),Vt(L("input",{type:"number","onUpdate:modelValue":H[15]||(H[15]=G=>_.topP=G),placeholder:P(e)("config.modelConfig.topPPlaceholder"),step:"0.1",min:"0",max:"1"},null,8,Zq),[[ti,_.topP,void 0,{number:!0}]])])])]),_:1},8,["modelValue","title"]),xe(Wo,{modelValue:d.value,"onUpdate:modelValue":H[18]||(H[18]=G=>d.value=G),title:"Delete confirmation"},{footer:Zt(()=>[L("button",{class:"cancel-btn",onClick:H[17]||(H[17]=G=>d.value=!1)},B(P(e)("common.cancel")),1),L("button",{class:"confirm-btn danger",onClick:he},B(P(e)("common.delete")),1)]),default:Zt(()=>{var G;return[L("div",Yq,[xe(P(Re),{icon:"carbon:warning",class:"warning-icon"}),L("p",null,[Pe(B(P(e)("config.modelConfig.deleteConfirmText"))+" ",1),L("strong",null,B((G=a.value)==null?void 0:G.modelName),1),Pe(" "+B(P(e)("common.confirm"))+"? ",1)]),L("p",Xq,B(P(e)("config.modelConfig.deleteWarning")),1)])]}),_:1},8,["modelValue"]),i.value?(ne(),ue("div",{key:0,class:"error-toast",onClick:H[19]||(H[19]=G=>i.value="")},[xe(P(Re),{icon:"carbon:error"}),Pe(" "+B(i.value),1)])):at("",!0),n.value?(ne(),ue("div",{key:1,class:"success-toast",onClick:H[20]||(H[20]=G=>n.value="")},[xe(P(Re),{icon:"carbon:checkmark"}),Pe(" "+B(n.value),1)])):at("",!0)]),_:1}))}}),Jq=us(Qq,[["__scopeId","data-v-be6fda70"]]);class od{static async getAllMcpServers(){const e=await fetch(`${this.BASE_URL}/list`);if(!e.ok)throw new Error(`Failed to get MCP server list: ${e.status}`);return await e.json()}static async addMcpServer(e){try{const t=await fetch(`${this.BASE_URL}/add`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const i=await t.text();throw new Error(`Failed to add MCP server: ${t.status} - ${i}`)}return{success:!0,message:"Successfully added MCP server"}}catch(t){return console.error("Failed to add MCP server:",t),{success:!1,message:t instanceof Error?t.message:"Failed to add, please retry"}}}static async importMcpServers(e){try{const t=await fetch(`${this.BASE_URL}/batch-import`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({configJson:JSON.stringify(e),overwrite:!1})});if(!t.ok){const i=await t.text();throw new Error(`Failed to import MCP servers: ${t.status} - ${i}`)}return{success:!0,message:"Successfully imported MCP servers"}}catch(t){return console.error("Failed to import MCP servers:",t),{success:!1,message:t instanceof Error?t.message:"Failed to import, please retry"}}}static async saveMcpServer(e){try{const t=await fetch(`${this.BASE_URL}/server`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.text(),s=e.id!==void 0?"update":"add";throw new Error(`Failed to ${s} MCP server: ${t.status} - ${n}`)}return{success:!0,message:`Successfully ${e.id!==void 0?"updated":"added"} MCP server`}}catch(t){return console.error("Failed to save MCP server:",t),{success:!1,message:t instanceof Error?t.message:"Failed to save, please retry"}}}static async updateMcpServer(e,t){return this.saveMcpServer({...t,id:e})}static async removeMcpServer(e){try{const t=await fetch(`${this.BASE_URL}/remove?id=${e}`);if(!t.ok)throw new Error(`Failed to delete MCP server: ${t.status}`);return{success:!0,message:"Successfully deleted MCP server"}}catch(t){return console.error(`Failed to delete MCP server[${e}]:`,t),{success:!1,message:t instanceof Error?t.message:"Failed to delete, please retry"}}}static async enableMcpServer(e){try{const t=await fetch(`${this.BASE_URL}/enable/${e}`,{method:"POST"});if(!t.ok){const i=await t.text();throw new Error(`Failed to enable MCP server: ${t.status} - ${i}`)}return{success:!0,message:"Successfully enabled MCP server"}}catch(t){return console.error(`Failed to enable MCP server[${e}]:`,t),{success:!1,message:t instanceof Error?t.message:"Failed to enable, please retry"}}}static async disableMcpServer(e){try{const t=await fetch(`${this.BASE_URL}/disable/${e}`,{method:"POST"});if(!t.ok){const i=await t.text();throw new Error(`Failed to disable MCP server: ${t.status} - ${i}`)}return{success:!0,message:"Successfully disabled MCP server"}}catch(t){return console.error(`Failed to disable MCP server[${e}]:`,t),{success:!1,message:t instanceof Error?t.message:"Failed to disable, please retry"}}}}ri(od,"BASE_URL","/api/mcp");function er(o,e=0){return o[o.length-(1+e)]}function eG(o){if(o.length===0)throw new Error("Invalid tail call");return[o.slice(0,o.length-1),o[o.length-1]]}function Bi(o,e,t=(i,n)=>i===n){if(o===e)return!0;if(!o||!e||o.length!==e.length)return!1;for(let i=0,n=o.length;it(o[i],e))}function iG(o,e){let t=0,i=o-1;for(;t<=i;){const n=(t+i)/2|0,s=e(n);if(s<0)t=n+1;else if(s>0)i=n-1;else return n}return-(t+1)}function Mk(o,e,t){if(o=o|0,o>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],n=[],s=[],r=[];for(const a of e){const l=t(a,i);l<0?n.push(a):l>0?s.push(a):r.push(a)}return o!!e)}function EP(o){let e=0;for(let t=0;t0}function iu(o,e=t=>t){const t=new Set;return o.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function G2(o,e){return o.length>0?o[0]:e}function Ls(o,e){let t=typeof e=="number"?o:0;typeof e=="number"?t=o:(t=0,e=o);const i=[];if(t<=e)for(let n=t;ne;n--)i.push(n);return i}function oy(o,e,t){const i=o.slice(0,e),n=o.slice(e);return i.concat(t,n)}function DD(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.unshift(e))}function $0(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.push(e))}function Ak(o,e){for(const t of e)o.push(t)}function Z2(o){return Array.isArray(o)?o:[o]}function sG(o,e,t){const i=O9(o,e),n=o.length,s=t.length;o.length=n+s;for(let r=n-1;r>=i;r--)o[r+s]=o[r];for(let r=0;r0}o.isGreaterThan=i;function n(s){return s===0}o.isNeitherLessOrGreaterThan=n,o.greaterThan=1,o.lessThan=-1,o.neitherLessOrGreaterThan=0})(pv||(pv={}));function ur(o,e){return(t,i)=>e(o(t),o(i))}function oG(...o){return(e,t)=>{for(const i of o){const n=i(e,t);if(!pv.isNeitherLessOrGreaterThan(n))return n}return pv.neitherLessOrGreaterThan}}const Md=(o,e)=>o-e,rG=(o,e)=>Md(o?1:0,e?1:0);function F9(o){return(e,t)=>-o(e,t)}class Hd{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class Dl{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new Dl(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new Dl(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(n=>((i||pv.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0)),t}}Dl.empty=new Dl(o=>{});function As(o){return typeof o=="string"}function Es(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&!(o instanceof RegExp)&&!(o instanceof Date)}function aG(o){const e=Object.getPrototypeOf(Uint8Array);return typeof o=="object"&&o instanceof e}function nu(o){return typeof o=="number"&&!isNaN(o)}function TP(o){return!!o&&typeof o[Symbol.iterator]=="function"}function B9(o){return o===!0||o===!1}function ro(o){return typeof o>"u"}function mv(o){return!Ro(o)}function Ro(o){return ro(o)||o===null}function qt(o,e){if(!o)throw new Error("Unexpected type")}function Lc(o){if(Ro(o))throw new Error("Assertion Failed: argument is undefined or null");return o}function _v(o){return typeof o=="function"}function lG(o,e){const t=Math.min(o.length,e.length);for(let i=0;i{e[t]=i&&typeof i=="object"?gd(i):i}),e}function cG(o){if(!o||typeof o!="object")return o;const e=[o];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(W9.call(t,i)){const n=t[i];typeof n=="object"&&!Object.isFrozen(n)&&!aG(n)&&e.push(n)}}return o}const W9=Object.prototype.hasOwnProperty;function V9(o,e){return Rk(o,e,new Set)}function Rk(o,e,t){if(Ro(o))return o;const i=e(o);if(typeof i<"u")return i;if(Array.isArray(o)){const n=[];for(const s of o)n.push(Rk(s,e,t));return n}if(Es(o)){if(t.has(o))throw new Error("Cannot clone recursive data-structure");t.add(o);const n={};for(const s in o)W9.call(o,s)&&(n[s]=Rk(o[s],e,t));return t.delete(o),n}return o}function ry(o,e,t=!0){return Es(o)?(Es(e)&&Object.keys(e).forEach(i=>{i in o?t&&(Es(o[i])&&Es(e[i])?ry(o[i],e[i],t):o[i]=e[i]):o[i]=e[i]}),o):e}function Uo(o,e){if(o===e)return!0;if(o==null||e===null||e===void 0||typeof o!=typeof e||typeof o!="object"||Array.isArray(o)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(o)){if(o.length!==e.length)return!1;for(t=0;tfunction(){const s=Array.prototype.slice.call(arguments,0);return e(n,s)},i={};for(const n of o)i[n]=t(n);return i}let gG=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function H9(o,e){let t;return e.length===0?t=o:t=o.replace(/\{(\d+)\}/g,(i,n)=>{const s=n[0],r=e[s];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),gG&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function p(o,e,...t){return H9(e,t)}function fG(o,e,...t){const i=H9(e,t);return{value:i,original:i}}var xD;const wf="en";let J1=!1,ew=!1,h1=!1,z9=!1,X2=!1,Q2=!1,$9=!1,U0,g1=wf,MP=wf,pG,ia;const Ad=globalThis;let Ds;typeof Ad.vscode<"u"&&typeof Ad.vscode.process<"u"?Ds=Ad.vscode.process:typeof process<"u"&&(Ds=process);const mG=typeof((xD=Ds==null?void 0:Ds.versions)===null||xD===void 0?void 0:xD.electron)=="string",_G=mG&&(Ds==null?void 0:Ds.type)==="renderer";if(typeof navigator=="object"&&!_G)ia=navigator.userAgent,J1=ia.indexOf("Windows")>=0,ew=ia.indexOf("Macintosh")>=0,Q2=(ia.indexOf("Macintosh")>=0||ia.indexOf("iPad")>=0||ia.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,h1=ia.indexOf("Linux")>=0,$9=(ia==null?void 0:ia.indexOf("Mobi"))>=0,X2=!0,p({},"_"),U0=wf,g1=U0,MP=navigator.language;else if(typeof Ds=="object"){J1=Ds.platform==="win32",ew=Ds.platform==="darwin",h1=Ds.platform==="linux",h1&&Ds.env.SNAP&&Ds.env.SNAP_REVISION,Ds.env.CI||Ds.env.BUILD_ARTIFACTSTAGINGDIRECTORY,U0=wf,g1=wf;const o=Ds.env.VSCODE_NLS_CONFIG;if(o)try{const e=JSON.parse(o),t=e.availableLanguages["*"];U0=e.locale,MP=e.osLocale,g1=t||wf,pG=e._translationsConfigFile}catch{}z9=!0}else console.error("Unable to resolve platform.");const is=J1,It=ew,ws=h1,Ml=z9,Tu=X2,vG=X2&&typeof Ad.importScripts=="function",bG=vG?Ad.origin:void 0,Ea=Q2,CG=$9,Al=ia,wG=g1,SG=typeof Ad.postMessage=="function"&&!Ad.importScripts,U9=(()=>{if(SG){const o=[];Ad.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=o.length;i{const i=++e;o.push({id:i,callback:t}),Ad.postMessage({vscodeScheduleAsyncWork:i},"*")}}return o=>setTimeout(o)})(),Vo=ew||Q2?2:J1?1:3;let AP=!0,RP=!1;function j9(){if(!RP){RP=!0;const o=new Uint8Array(2);o[0]=1,o[1]=2,AP=new Uint16Array(o.buffer)[0]===513}return AP}const K9=!!(Al&&Al.indexOf("Chrome")>=0),yG=!!(Al&&Al.indexOf("Firefox")>=0),LG=!!(!K9&&Al&&Al.indexOf("Safari")>=0),DG=!!(Al&&Al.indexOf("Edg/")>=0);Al&&Al.indexOf("Android")>=0;const rs={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var wt;(function(o){function e(b){return b&&typeof b=="object"&&typeof b[Symbol.iterator]=="function"}o.is=e;const t=Object.freeze([]);function i(){return t}o.empty=i;function*n(b){yield b}o.single=n;function s(b){return e(b)?b:n(b)}o.wrap=s;function r(b){return b||t}o.from=r;function*a(b){for(let C=b.length-1;C>=0;C--)yield b[C]}o.reverse=a;function l(b){return!b||b[Symbol.iterator]().next().done===!0}o.isEmpty=l;function d(b){return b[Symbol.iterator]().next().value}o.first=d;function c(b,C){for(const w of b)if(C(w))return!0;return!1}o.some=c;function u(b,C){for(const w of b)if(C(w))return w}o.find=u;function*h(b,C){for(const w of b)C(w)&&(yield w)}o.filter=h;function*g(b,C){let w=0;for(const S of b)yield C(S,w++)}o.map=g;function*f(...b){for(const C of b)yield*C}o.concat=f;function m(b,C,w){let S=w;for(const x of b)S=C(S,x);return S}o.reduce=m;function*v(b,C,w=b.length){for(C<0&&(C+=b.length),w<0?w+=b.length:w>b.length&&(w=b.length);C{n||(n=!0,this._remove(i))}}shift(){if(this._first!==cn.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==cn.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==cn.Undefined&&e.next!==cn.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===cn.Undefined&&e.next===cn.Undefined?(this._first=cn.Undefined,this._last=cn.Undefined):e.next===cn.Undefined?(this._last=this._last.prev,this._last.next=cn.Undefined):e.prev===cn.Undefined&&(this._first=this._first.next,this._first.prev=cn.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==cn.Undefined;)yield e.element,e=e.next}}const q9="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function xG(o=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of q9)o.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const J2=xG();function eM(o){let e=J2;if(o&&o instanceof RegExp)if(o.global)e=o;else{let t="g";o.ignoreCase&&(t+="i"),o.multiline&&(t+="m"),o.unicode&&(t+="u"),e=new RegExp(o.source,t)}return e.lastIndex=0,e}const G9=new Ns;G9.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function vv(o,e,t,i,n){if(e=eM(e),n||(n=wt.first(G9)),t.length>n.maxLen){let d=o-n.maxLen/2;return d<0?d=0:i+=d,t=t.substring(d,o+n.maxLen/2),vv(o,e,t,i,n)}const s=Date.now(),r=o-1-i;let a=-1,l=null;for(let d=1;!(Date.now()-s>=n.timeBudget);d++){const c=r-n.windowSize*d;e.lastIndex=Math.max(0,c);const u=kG(e,t,r,a);if(!u&&l||(l=u,c<=0))break;a=c}if(l){const d={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,d}return null}function kG(o,e,t,i){let n;for(;n=o.exec(e);){const s=n.index||0;if(s<=t&&o.lastIndex>=t)return n;if(i>0&&s>i)return null}return null}const lc=8;class Z9{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class Y9{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Di{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return ay(e,t)}compute(e,t,i){return i}}class P_{constructor(e,t){this.newValue=e,this.didChange=t}}function ay(o,e){if(typeof o!="object"||typeof e!="object"||!o||!e)return new P_(e,o!==e);if(Array.isArray(o)||Array.isArray(e)){const i=Array.isArray(o)&&Array.isArray(e)&&Bi(o,e);return new P_(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const n=ay(o[i],e[i]);n.didChange&&(o[i]=n.newValue,t=!0)}return new P_(o,t)}class Zb{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return ay(e,t)}validate(e){return this.defaultValue}}class um{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return ay(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function Be(o,e){return typeof o>"u"?e:o==="false"?!1:!!o}class Nt extends um{constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return Be(e,this.defaultValue)}}function ah(o,e,t,i){if(typeof o>"u")return e;let n=parseInt(o,10);return isNaN(n)?e:(n=Math.max(t,n),n=Math.min(i,n),n|0)}class Jt extends um{static clampedInt(e,t,i,n){return ah(e,t,i,n)}constructor(e,t,i,n,s,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=n,r.maximum=s),super(e,t,i,r),this.minimum=n,this.maximum=s}validate(e){return Jt.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function IG(o,e,t,i){if(typeof o>"u")return e;const n=Rr.float(o,e);return Rr.clamp(n,t,i)}class Rr extends um{static clamp(e,t,i){return ei?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,n,s){typeof s<"u"&&(s.type="number",s.default=i),super(e,t,i,s),this.validationFn=n}validate(e){return this.validationFn(Rr.float(e,this.defaultValue))}}class no extends um{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return no.string(e,this.defaultValue)}}function Ki(o,e,t,i){return typeof o!="string"?e:i&&o in i?i[o]:t.indexOf(o)===-1?e:o}class ki extends um{constructor(e,t,i,n,s=void 0){typeof s<"u"&&(s.type="string",s.enum=n,s.default=i),super(e,t,i,s),this._allowedValues=n}validate(e){return Ki(e,this.defaultValue,this._allowedValues)}}class j0 extends Di{constructor(e,t,i,n,s,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=s,a.default=n),super(e,t,i,a),this._allowedValues=s,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function EG(o){switch(o){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class NG extends Di{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[p("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached."),p("accessibilitySupport.on","Optimize for usage with a Screen Reader."),p("accessibilitySupport.off","Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:p("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class TG extends Di{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:p("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:p("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:Be(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Be(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function MG(o){switch(o){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Vn;(function(o){o[o.Line=1]="Line",o[o.Block=2]="Block",o[o.Underline=3]="Underline",o[o.LineThin=4]="LineThin",o[o.BlockOutline=5]="BlockOutline",o[o.UnderlineThin=6]="UnderlineThin"})(Vn||(Vn={}));function AG(o){switch(o){case"line":return Vn.Line;case"block":return Vn.Block;case"underline":return Vn.Underline;case"line-thin":return Vn.LineThin;case"block-outline":return Vn.BlockOutline;case"underline-thin":return Vn.UnderlineThin}}class RG extends Zb{constructor(){super(140)}compute(e,t,i){const n=["monaco-editor"];return t.get(39)&&n.push(t.get(39)),e.extraEditorClassName&&n.push(e.extraEditorClassName),t.get(73)==="default"?n.push("mouse-default"):t.get(73)==="copy"&&n.push("mouse-copy"),t.get(110)&&n.push("showUnused"),t.get(138)&&n.push("showDeprecated"),n.join(" ")}}class PG extends Nt{constructor(){super(37,"emptySelectionClipboard",!0,{description:p("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class OG extends Di{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:p("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[p("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),p("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),p("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:p("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[p("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),p("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),p("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:p("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:p("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:It},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:p("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:p("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:Be(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":Ki(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":Ki(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Be(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Be(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Be(t.loop,this.defaultValue.loop)}}}class Po extends Di{constructor(){super(51,"fontLigatures",Po.OFF,{anyOf:[{type:"boolean",description:p("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:p("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:p("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?Po.OFF:e==="true"?Po.ON:e:e?Po.ON:Po.OFF}}Po.OFF='"liga" off, "calt" off';Po.ON='"liga" on, "calt" on';class _a extends Di{constructor(){super(54,"fontVariations",_a.OFF,{anyOf:[{type:"boolean",description:p("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:p("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:p("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?_a.OFF:e==="true"?_a.TRANSLATE:e:e?_a.TRANSLATE:_a.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}_a.OFF="normal";_a.TRANSLATE="translate";class FG extends Zb{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class BG extends um{constructor(){super(52,"fontSize",co.fontSize,{type:"number",minimum:6,maximum:100,default:co.fontSize,description:p("fontSize","Controls the font size in pixels.")})}validate(e){const t=Rr.float(e,this.defaultValue);return t===0?co.fontSize:Rr.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class ol extends Di{constructor(){super(53,"fontWeight",co.fontWeight,{anyOf:[{type:"number",minimum:ol.MINIMUM_VALUE,maximum:ol.MAXIMUM_VALUE,errorMessage:p("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:ol.SUGGESTION_VALUES}],default:co.fontWeight,description:p("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(Jt.clampedInt(e,co.fontWeight,ol.MINIMUM_VALUE,ol.MAXIMUM_VALUE))}}ol.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];ol.MINIMUM_VALUE=1;ol.MAXIMUM_VALUE=1e3;class WG extends Di{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[p("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),p("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),p("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:p("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:p("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:p("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:p("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:p("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:p("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:p("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:p("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:p("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:p("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:p("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,n,s,r;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:Ki(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:Ki(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:Ki(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(n=a.multipleDeclarations)!==null&&n!==void 0?n:Ki(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(s=a.multipleImplementations)!==null&&s!==void 0?s:Ki(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(r=a.multipleReferences)!==null&&r!==void 0?r:Ki(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:no.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:no.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:no.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:no.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:no.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class VG extends Di{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:p("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:p("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:p("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:p("hover.hidingDelay","Controls the delay in milliseconds after which the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:p("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Be(t.enabled,this.defaultValue.enabled),delay:Jt.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Be(t.sticky,this.defaultValue.sticky),hidingDelay:Jt.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Be(t.above,this.defaultValue.above)}}}class Zf extends Zb{constructor(){super(143)}compute(e,t,i){return Zf.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let n=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(n=Math.max(n,t-1));const s=(i+e.viewLineCount+n)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/s);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:s,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,s=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(s*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.paddingTop===r.paddingTop&&e.paddingBottom===r.paddingBottom&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,d=e.typicalHalfwidthCharacterWidth,c=e.scrollBeyondLastLine,u=e.minimap.renderCharacters;let h=s>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const g=e.minimap.maxColumn,f=e.minimap.size,m=e.minimap.side,v=e.verticalScrollbarWidth,_=e.viewLineCount,b=e.remainingWidth,C=e.isViewportWrapping,w=u?2:3;let S=Math.floor(s*n);const x=S/s;let y=!1,I=!1,E=w*h,R=h/s,j=1;if(f==="fill"||f==="fit"){const{typicalViewportLineCount:se,extraLinesBeforeFirstLine:V,extraLinesBeyondLastLine:Q,desiredRatio:H,minimapLineCount:G}=Zf.computeContainedMinimapLineCount({viewLineCount:_,scrollBeyondLastLine:c,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:n,lineHeight:l,pixelRatio:s});if(_/G>1)y=!0,I=!0,h=1,E=1,R=h/s;else{let $e=!1,ft=h+1;if(f==="fit"){const Bt=Math.ceil((V+_+Q)*E);C&&a&&b<=t.stableFitRemainingWidth?($e=!0,ft=t.stableFitMaxMinimapScale):$e=Bt>S}if(f==="fill"||$e){y=!0;const Bt=h;E=Math.min(l*s,Math.max(1,Math.floor(1/H))),C&&a&&b<=t.stableFitRemainingWidth&&(ft=t.stableFitMaxMinimapScale),h=Math.min(ft,Math.max(1,Math.floor(E/w))),h>Bt&&(j=Math.min(2,h/Bt)),R=h/s/j,S=Math.ceil(Math.max(se,V+_+Q)*E),C?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const O=Math.floor(g*R),$=Math.min(O,Math.max(0,Math.floor((b-v-2)*R/(d+R)))+lc);let K=Math.floor(s*$);const oe=K/s;K=Math.floor(K*j);const Le=u?1:2,he=m==="left"?0:i-$-v;return{renderMinimap:Le,minimapLeft:he,minimapWidth:$,minimapHeightIsEditorHeight:y,minimapIsSampling:I,minimapScale:h,minimapLineHeight:E,minimapCanvasInnerWidth:K,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:oe,minimapCanvasOuterHeight:x}}static computeLayout(e,t){const i=t.outerWidth|0,n=t.outerHeight|0,s=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,d=t.pixelRatio,c=t.viewLineCount,u=e.get(135),h=u==="inherit"?e.get(134):u,g=h==="inherit"?e.get(130):h,f=e.get(133),m=t.isDominatedByLongLines,v=e.get(57),_=e.get(67).renderType!==0,b=e.get(68),C=e.get(104),w=e.get(83),S=e.get(72),x=e.get(102),y=x.verticalScrollbarSize,I=x.verticalHasArrows,E=x.arrowSize,R=x.horizontalScrollbarSize,j=e.get(43),O=e.get(109)!=="never";let $=e.get(65);j&&O&&($+=16);let K=0;if(_){const re=Math.max(r,b);K=Math.round(re*l)}let oe=0;v&&(oe=s*t.glyphMarginDecorationLaneCount);let Le=0,he=Le+oe,se=he+K,V=se+$;const Q=i-oe-K-$;let H=!1,G=!1,Z=-1;h==="inherit"&&m?(H=!0,G=!0):g==="on"||g==="bounded"?G=!0:g==="wordWrapColumn"&&(Z=f);const $e=Zf._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:s,typicalHalfwidthCharacterWidth:a,pixelRatio:d,scrollBeyondLastLine:C,paddingTop:w.top,paddingBottom:w.bottom,minimap:S,verticalScrollbarWidth:y,viewLineCount:c,remainingWidth:Q,isViewportWrapping:G},t.memory||new Y9);$e.renderMinimap!==0&&$e.minimapLeft===0&&(Le+=$e.minimapWidth,he+=$e.minimapWidth,se+=$e.minimapWidth,V+=$e.minimapWidth);const ft=Q-$e.minimapWidth,Bt=Math.max(1,Math.floor((ft-y-2)/a)),Ce=I?E:0;return G&&(Z=Math.max(1,Bt),g==="bounded"&&(Z=Math.min(Z,f))),{width:i,height:n,glyphMarginLeft:Le,glyphMarginWidth:oe,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:he,lineNumbersWidth:K,decorationsLeft:se,decorationsWidth:$,contentLeft:V,contentWidth:ft,minimap:$e,viewportColumn:Bt,isWordWrapMinified:H,isViewportWrapping:G,wrappingColumn:Z,verticalScrollbarWidth:y,horizontalScrollbarHeight:R,overviewRuler:{top:Ce,width:y,height:n-2*Ce,right:0}}}}class HG extends Di{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[p("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),p("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:p("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return Ki(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}var so;(function(o){o.Off="off",o.OnCode="onCode",o.On="on"})(so||(so={}));class zG extends Di{constructor(){const e={enabled:!0,experimental:{showAiIcon:so.Off}};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:p("codeActions","Enables the Code Action lightbulb in the editor.")},"editor.lightbulb.experimental.showAiIcon":{type:"string",enum:[so.Off,so.OnCode,so.On],default:e.experimental.showAiIcon,enumDescriptions:[p("editor.lightbulb.showAiIcon.off","Don not show the AI icon."),p("editor.lightbulb.showAiIcon.onCode","Show an AI icon when the code action menu contains an AI action, but only on code."),p("editor.lightbulb.showAiIcon.on","Show an AI icon when the code action menu contains an AI action, on code and empty lines.")],description:p("showAiIcons","Show an AI icon along with the lightbulb when the code action menu contains an AI action.")}})}validate(e){var t,i;if(!e||typeof e!="object")return this.defaultValue;const n=e;return{enabled:Be(n.enabled,this.defaultValue.enabled),experimental:{showAiIcon:Ki((t=n.experimental)===null||t===void 0?void 0:t.showAiIcon,(i=this.defaultValue.experimental)===null||i===void 0?void 0:i.showAiIcon,[so.Off,so.OnCode,so.On])}}}}class $G extends Di{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:p("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:10,description:p("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:p("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:p("editor.stickyScroll.scrollWithEditor","Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Be(t.enabled,this.defaultValue.enabled),maxLineCount:Jt.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:Ki(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:Be(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class UG extends Di{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:p("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[p("editor.inlayHints.on","Inlay hints are enabled"),p("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",It?"Ctrl+Option":"Ctrl+Alt"),p("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",It?"Ctrl+Option":"Ctrl+Alt"),p("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:p("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:p("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:p("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:Ki(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:Jt.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:no.string(t.fontFamily,this.defaultValue.fontFamily),padding:Be(t.padding,this.defaultValue.padding)}}}class jG extends Di{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):Jt.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?Jt.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class KG extends Rr{constructor(){super(66,"lineHeight",co.lineHeight,e=>Rr.clamp(e,0,150),{markdownDescription:p("lineHeight",`Controls the line height. +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/freemarker2-CmSOYFZj.js","assets/index-CNsQoPg8.js","assets/index-DN-vOy2S.css","assets/iconify-B3l7reUz.js","assets/_plugin-vue_export-helper-DlAUqK2U.js","assets/useMessage-BR4qCw-P.js","assets/useMessage-B772OobR.css","assets/index-rqS3tjXd.js","assets/index-CxnUfhp1.css","assets/handlebars-BLXzbXZR.js","assets/html-DO2OTq4R.js","assets/javascript-C0XxeR-n.js","assets/typescript-Cfb9k-qV.js","assets/liquid-BFayS-os.js","assets/mdx-DeQweMxo.js","assets/python-a9hcFcOH.js","assets/razor-1sBWwWa2.js","assets/xml-CXoMhdUk.js","assets/yaml-D4773nTm.js","assets/cssMode-CAKGNCPU.js","assets/htmlMode-BTRUnrkS.js","assets/jsonMode-BNPGVg0I.js","assets/tsMode-_F3d8JBS.js"])))=>i.map(i=>d[i]); +var xz=Object.defineProperty;var kz=(o,e,t)=>e in o?xz(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var ri=(o,e,t)=>kz(o,typeof e!="symbol"?e+"":e,t);import{d as Ss,a as ue,b as ne,e as L,t as B,u as Pa,r as Ye,z as ar,c as Xn,o as Kd,g as xe,f as at,i as Pe,w as Vt,j as ti,F as Ji,l as ln,n as Nn,E as ny,s as In,k as Zt,T as qb,J as Gf,C as Iz,x as P,h as Zh,B as cr,D as X1,y as I9,H as Ez,K as K2,q as Nz,A as E9,_ as Oe,M as Tz,p as N9,G as T9,N as Mz}from"./index-CNsQoPg8.js";import{I as Re}from"./iconify-B3l7reUz.js";import{_ as us}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{a as Az,u as M9}from"./useMessage-BR4qCw-P.js";import{L as Rz}from"./index-rqS3tjXd.js";const Pz={class:"switch"},Oz=["checked"],Fz={class:"switch-label"},Bz=Ss({__name:"index",props:{enabled:{type:Boolean},label:{}},emits:["update:switchValue"],setup(o,{emit:e}){const t=e,i=n=>{const s=n.target.checked;t("update:switchValue",s)};return(n,s)=>(ne(),ue("label",Pz,[L("input",{type:"checkbox",checked:n.enabled,onChange:i},null,40,Oz),s[0]||(s[0]=L("span",{class:"slider"},null,-1)),L("span",Fz,B(n.label),1)]))}}),Wz=us(Bz,[["__scopeId","data-v-d484b4a3"]]);class u_{static async getConfigsByGroup(e){try{const t=await fetch(`${this.BASE_URL}/group/${e}`);if(!t.ok)throw new Error(`Failed to get ${e} group configuration: ${t.status}`);return await t.json()}catch(t){throw console.error(`Failed to get ${e} group configuration:`,t),t}}static async batchUpdateConfigs(e){if(e.length===0)return{success:!0,message:"No configuration needs to be updated"};try{const t=await fetch(`${this.BASE_URL}/batch-update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`Batch update configuration failed: ${t.status}`);return{success:!0,message:"Configuration saved successfully"}}catch(t){return console.error("Batch update configuration failed:",t),{success:!1,message:t instanceof Error?t.message:"Update failed, please try again"}}}static async getConfigById(e){try{const t=await fetch(`${this.BASE_URL}/${e}`);if(!t.ok)throw new Error(`Failed to get configuration item: ${t.status}`);return await t.json()}catch(t){throw console.error(`Failed to get configuration item[${e}]:`,t),t}}static async updateConfig(e){try{const t=await fetch(`${this.BASE_URL}/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`Failed to update configuration item: ${t.status}`);return{success:!0,message:"Configuration updated successfully"}}catch(t){return console.error("Failed to update configuration item:",t),{success:!1,message:t instanceof Error?t.message:"Update failed, please try again"}}}}ri(u_,"BASE_URL","/api/config");const Vz={class:"config-panel"},Hz={class:"config-header"},zz={class:"header-left"},$z={class:"config-stats"},Uz={class:"stat-item"},jz={class:"stat-label"},Kz={class:"stat-value"},qz={key:0,class:"stat-item"},Gz={class:"stat-label"},Zz={class:"stat-value modified"},Yz={class:"header-right"},Xz={class:"import-export-actions"},Qz=["title"],Jz=["title"],e$={class:"search-box"},t$=["placeholder"],i$={key:0,class:"loading-container"},n$={key:1,class:"config-groups"},s$={class:"group-header"},o$={class:"group-info"},r$={class:"group-icon"},a$={class:"group-actions"},l$=["onClick","disabled","title"],d$={class:"sub-groups"},c$=["onClick"],u$={class:"sub-group-info"},h$={class:"sub-group-title"},g$={class:"item-count"},f$={class:"config-items"},p$={key:0,class:"config-item-content vertical-layout"},m$={class:"config-item-info"},_$={class:"config-item-header"},v$={class:"config-label"},b$={class:"type-badge boolean"},C$={key:0,class:"modified-badge"},w$=["title"],S$={class:"config-control"},y$=["value","onChange"],L$=["value"],D$={key:1,class:"config-item-content vertical-layout"},x$={class:"config-item-info"},k$={class:"config-item-header"},I$={class:"config-label"},E$={class:"type-badge select"},N$={key:0,class:"modified-badge"},T$=["title"],M$={class:"config-control"},A$=["value","onChange"],R$=["value"],P$={key:2,class:"config-item-content vertical-layout"},O$={class:"config-item-info"},F$={class:"config-item-header"},B$={class:"config-label"},W$={class:"type-badge textarea"},V$={key:0,class:"modified-badge"},H$=["title"],z$={class:"config-control"},$$=["value","onInput"],U$={key:3,class:"config-item-content vertical-layout"},j$={class:"config-item-info"},K$={class:"config-item-header"},q$={class:"config-label"},G$={class:"type-badge number"},Z$={key:0,class:"modified-badge"},Y$=["title"],X$={key:0,class:"config-meta"},Q$={class:"range-info"},J$={class:"config-control"},eU=["value","onInput","min","max"],tU={key:4,class:"config-item-content vertical-layout"},iU={class:"config-item-info"},nU={class:"config-item-header"},sU={class:"config-label"},oU={class:"type-badge string"},rU={key:0,class:"modified-badge"},aU=["title"],lU={class:"config-control"},dU=["value","onInput"],cU={key:2,class:"empty-state"},uU=Ss({__name:"basicConfig",setup(o){const{t:e}=Pa(),t=Ye(!0),i=Ye(!1),n=Ye([]),s=Ye(new Map),r=Ye(new Set),a=ar({show:!1,text:"",type:"success"}),l=Ye(""),d={headless:"config.basicConfig.browserSettings.headless",requestTimeout:"config.basicConfig.browserSettings.requestTimeout",debugDetail:"config.basicConfig.general.debugDetail",baseDir:"config.basicConfig.general.baseDir",openBrowser:"config.basicConfig.interactionSettings.openBrowser",maxSteps:"config.basicConfig.agentSettings.maxSteps",userInputTimeout:"config.basicConfig.agentSettings.userInputTimeout",maxMemory:"config.basicConfig.agentSettings.maxMemory",parallelToolCalls:"config.basicConfig.agentSettings.parallelToolCalls",forceOverrideFromYaml:"config.basicConfig.agents.forceOverrideFromYaml",enabled:"config.basicConfig.infiniteContext.enabled",parallelThreads:"config.basicConfig.infiniteContext.parallelThreads",taskContextSize:"config.basicConfig.infiniteContext.taskContextSize",allowExternalAccess:"config.basicConfig.fileSystem.allowExternalAccess",connectionTimeoutSeconds:"config.basicConfig.mcpServiceLoader.connectionTimeoutSeconds",maxRetryCount:"config.basicConfig.mcpServiceLoader.maxRetryCount",maxConcurrentConnections:"config.basicConfig.mcpServiceLoader.maxConcurrentConnections"},c={manus:"config.basicConfig.groupDisplayNames.manus"},u={manus:"🤖",browser:"🌐",interaction:"🖥️",system:"⚙️",performance:"⚡"},h={agent:"config.subGroupDisplayNames.agent",browser:"config.subGroupDisplayNames.browser",interaction:"config.subGroupDisplayNames.interaction",agents:"config.subGroupDisplayNames.agents",infiniteContext:"config.subGroupDisplayNames.infiniteContext",general:"config.subGroupDisplayNames.general",filesystem:"config.subGroupDisplayNames.filesystem",mcpServiceLoader:"config.subGroupDisplayNames.mcpServiceLoader"},g=Xn(()=>n.value.some(V=>V.subGroups.some(Q=>Q.items.some(H=>s.value.get(H.id)!==H.configValue)))),f=V=>V==="true",m=V=>parseFloat(V)||0,v=V=>({maxSteps:1,browserTimeout:1,maxThreads:1,timeoutSeconds:5,maxMemory:1})[V]||1,_=V=>({maxSteps:100,browserTimeout:600,maxThreads:32,timeoutSeconds:300,maxMemory:1e3})[V]||1e4,b=V=>typeof V=="string"?V:V.value,C=V=>typeof V=="string"?V:V.label,w=(V,Q)=>{if(typeof Q=="boolean")return Q.toString();if(typeof Q=="string"){if(V.options&&V.options.length>0){const H=V.options.find(G=>(typeof G=="string"?G:G.label)===Q||(typeof G=="string"?G:G.value)===Q);if(H)return typeof H=="string"?H:H.value}return Q}return String(Q)},S=(V,Q,H=!1)=>{let G;V.inputType==="BOOLEAN"||V.inputType==="CHECKBOX"?G=w(V,Q):G=String(Q),V.configValue!==G&&(V.configValue=G,V._modified=!0,(H||V.inputType==="BOOLEAN"||V.inputType==="CHECKBOX"||V.inputType==="SELECT")&&y())};let x=null;const y=()=>{x&&clearTimeout(x),x=window.setTimeout(()=>{R()},500)},I=(V,Q="success")=>{a.text=V,a.type=Q,a.show=!0,setTimeout(()=>{a.show=!1},3e3)},E=async()=>{try{t.value=!0;const Q=["manus"].map(async G=>{try{const Z=await u_.getConfigsByGroup(G);if(Z.length===0)return null;const $e=Z.map(Ce=>({...Ce,displayName:d[Ce.configKey]||Ce.configKey,min:v(Ce.configKey),max:_(Ce.configKey)}));$e.forEach(Ce=>{s.value.set(Ce.id,Ce.configValue)});const ft=new Map;$e.forEach(Ce=>{const re=Ce.configSubGroup??"general";ft.has(re)||ft.set(re,[]),ft.get(re).push(Ce)});const Bt=Array.from(ft.entries()).map(([Ce,re])=>({name:Ce,displayName:h[Ce]||Ce,items:re}));return{name:G,displayName:c[G]||G,subGroups:Bt}}catch(Z){return console.warn(`Failed to load config group ${G}, skipping:`,Z),null}}),H=await Promise.all(Q);n.value=H.filter(G=>G!==null),console.log(e("config.basicConfig.loadConfigSuccess"),n.value)}catch(V){console.error(e("config.basicConfig.loadConfigFailed"),V),I(e("config.basicConfig.loadConfigFailed"),"error")}finally{t.value=!1}},R=async()=>{if(!(i.value||!g.value))try{i.value=!0;const V=[];if(n.value.forEach(H=>{H.subGroups.forEach(G=>{const Z=G.items.filter($e=>$e._modified);V.push(...Z)})}),V.length===0){I(e("config.basicConfig.noModified"));return}const Q=await u_.batchUpdateConfigs(V);Q.success?(V.forEach(H=>{s.value.set(H.id,H.configValue),H._modified=!1}),I(e("config.basicConfig.saveSuccess"))):I(Q.message||e("config.basicConfig.saveFailed"),"error")}catch(V){console.error(e("config.basicConfig.saveFailed"),V),I(e("config.basicConfig.saveFailed"),"error")}finally{i.value=!1}},j=async V=>{if(confirm(e("config.basicConfig.resetGroupConfirm",c[V]||V)))try{i.value=!0;const H=n.value.find($e=>$e.name===V);if(!H)return;const G=[];if(H.subGroups.forEach($e=>{$e.items.forEach(ft=>{const Bt=O(ft.configKey);Bt!==ft.configValue&&G.push({...ft,configValue:Bt})})}),G.length===0){I(e("config.basicConfig.isDefault"));return}const Z=await u_.batchUpdateConfigs(G);Z.success?(await E(),I(e("config.basicConfig.resetSuccess",G.length))):I(Z.message||e("config.basicConfig.resetFailed"),"error")}catch(H){console.error(e("config.basicConfig.resetFailed"),H),I(e("config.basicConfig.resetFailed"),"error")}finally{i.value=!1}},O=V=>({systemName:"JManus",language:"zh-CN",maxThreads:"8",timeoutSeconds:"60",autoOpenBrowser:"false",headlessBrowser:"true",maxMemory:"1000"})[V]||"",$=(V,Q)=>{const H=`${V}-${Q}`;r.value.has(H)?r.value.delete(H):r.value.add(H)},K=(V,Q)=>r.value.has(`${V}-${Q}`),oe=Xn(()=>{const V=n.value.reduce((H,G)=>H+G.subGroups.reduce((Z,$e)=>Z+$e.items.length,0),0),Q=n.value.reduce((H,G)=>H+G.subGroups.reduce((Z,$e)=>Z+$e.items.filter(ft=>s.value.get(ft.id)!==ft.configValue).length,0),0);return{total:V,modified:Q}}),Le=Xn(()=>{if(!l.value.trim())return n.value;const V=l.value.toLowerCase();return n.value.map(Q=>({...Q,subGroups:Q.subGroups.map(H=>({...H,items:H.items.filter(G=>G.displayName.toLowerCase().includes(V)||G.configKey.toLowerCase().includes(V)||G.description&&G.description.toLowerCase().includes(V))})).filter(H=>H.items.length>0)})).filter(Q=>Q.subGroups.length>0)}),he=()=>{try{const V={timestamp:new Date().toISOString(),version:"1.0",configs:n.value.reduce((Z,$e)=>($e.subGroups.forEach(ft=>{ft.items.forEach(Bt=>{Z[Bt.configKey]=Bt.configValue})}),Z),{})},Q=JSON.stringify(V,null,2),H=new Blob([Q],{type:"application/json"}),G=document.createElement("a");G.href=URL.createObjectURL(H),G.download=`config-export-${new Date().toISOString().split("T")[0]}.json`,G.click(),I(e("config.basicConfig.exportSuccess"))}catch(V){console.error(e("config.basicConfig.exportFailed"),V),I(e("config.basicConfig.exportFailed"),"error")}},se=V=>{var Z;const Q=V.target,H=(Z=Q.files)==null?void 0:Z[0];if(!H)return;const G=new FileReader;G.onload=async $e=>{var ft;try{const Bt=JSON.parse((ft=$e.target)==null?void 0:ft.result);if(!Bt.configs)throw new Error(e("config.basicConfig.invalidFormat"));if(!confirm(e("config.importConfirm")))return;i.value=!0;const re=[];if(n.value.forEach(ce=>{ce.subGroups.forEach(Ie=>{Ie.items.forEach(mt=>{Object.prototype.hasOwnProperty.call(Bt.configs,mt.configKey)&&re.push({...mt,configValue:Bt.configs[mt.configKey]})})})}),re.length===0){I(e("config.basicConfig.notFound"));return}const ke=await u_.batchUpdateConfigs(re);ke.success?(await E(),I(e("config.basicConfig.importSuccess"))):I(ke.message||e("config.basicConfig.importFailed"),"error")}catch(Bt){console.error(e("config.basicConfig.importFailed"),Bt),I(e("config.basicConfig.importFailed"),"error")}finally{i.value=!1,Q.value=""}},G.readAsText(H)};return Kd(()=>{E()}),(V,Q)=>(ne(),ue("div",Vz,[L("div",Hz,[L("div",zz,[L("h2",null,B(V.$t("config.basicConfig.title")),1),L("div",$z,[L("span",Uz,[L("span",jz,B(V.$t("config.basicConfig.totalConfigs"))+":",1),L("span",Kz,B(oe.value.total),1)]),oe.value.modified>0?(ne(),ue("span",qz,[L("span",Gz,B(V.$t("config.basicConfig.modified"))+":",1),L("span",Zz,B(oe.value.modified),1)])):at("",!0)])]),L("div",Yz,[L("div",Xz,[L("button",{onClick:he,class:"action-btn",title:V.$t("config.basicConfig.exportConfigs")}," 📤 ",8,Qz),L("label",{class:"action-btn",title:V.$t("config.basicConfig.importConfigs")},[Q[1]||(Q[1]=Pe(" 📥 ")),L("input",{type:"file",accept:".json",onChange:se,style:{display:"none"}},null,32)],8,Jz)]),L("div",e$,[Vt(L("input",{"onUpdate:modelValue":Q[0]||(Q[0]=H=>l.value=H),type:"text",placeholder:V.$t("config.search"),class:"search-input"},null,8,t$),[[ti,l.value]]),Q[2]||(Q[2]=L("span",{class:"search-icon"},"🔍",-1))])])]),t.value?(ne(),ue("div",i$,[Q[3]||(Q[3]=L("div",{class:"loading-spinner"},null,-1)),L("p",null,B(V.$t("config.loading")),1)])):Le.value.length>0?(ne(),ue("div",n$,[(ne(!0),ue(Ji,null,ln(Le.value,H=>(ne(),ue("div",{key:H.name,class:"config-group"},[L("div",s$,[L("div",o$,[L("span",r$,B(u[H.name]||"⚙️"),1)]),L("div",a$,[L("button",{onClick:G=>j(H.name),class:"reset-btn",disabled:i.value,title:V.$t("config.resetGroupConfirm")},B(V.$t("config.reset")),9,l$)]),Q[4]||(Q[4]=L("div",{class:"group-divider"},null,-1))]),L("div",d$,[(ne(!0),ue(Ji,null,ln(H.subGroups,G=>(ne(),ue("div",{key:G.name,class:"sub-group"},[L("div",{class:"sub-group-header",onClick:Z=>$(H.name,G.name)},[L("div",u$,[Q[5]||(Q[5]=L("span",{class:"sub-group-icon"},"📁",-1)),L("h4",h$,B(V.$t(G.displayName)),1),L("span",g$,"("+B(G.items.length)+")",1)]),L("span",{class:Nn(["collapse-icon",{collapsed:K(H.name,G.name)}])}," ▼ ",2)],8,c$),Vt(L("div",f$,[(ne(!0),ue(Ji,null,ln(G.items,Z=>(ne(),ue("div",{key:Z.id,class:Nn(["config-item",{modified:s.value.get(Z.id)!==Z.configValue}])},[Z.inputType==="BOOLEAN"||Z.inputType==="CHECKBOX"?(ne(),ue("div",p$,[L("div",m$,[L("div",_$,[L("label",v$,[Pe(B(V.$t(Z.displayName)||Z.description)+" ",1),L("span",b$,B(Z.inputType==="CHECKBOX"?V.$t("config.types.checkbox"):V.$t("config.types.boolean")),1),s.value.get(Z.id)!==Z.configValue?(ne(),ue("span",C$,B(V.$t("config.modified")),1)):at("",!0)]),L("span",{class:"config-key",title:Z.configKey},B(Z.configKey),9,w$)])]),L("div",S$,[Z.options&&Z.options.length>0?(ne(),ue("select",{key:0,class:"config-input select-input",value:Z.configValue,onChange:$e=>{var ft;return S(Z,((ft=$e.target)==null?void 0:ft.value)||"")}},[(ne(!0),ue(Ji,null,ln(Z.options,$e=>(ne(),ue("option",{key:b($e),value:b($e)},B(C($e)),9,L$))),128))],40,y$)):(ne(),In(Wz,{key:1,enabled:f(Z.configValue),label:"","onUpdate:switchValue":$e=>S(Z,$e)},null,8,["enabled","onUpdate:switchValue"]))])])):Z.inputType==="SELECT"?(ne(),ue("div",D$,[L("div",x$,[L("div",k$,[L("label",I$,[Pe(B(V.$t(Z.displayName)||Z.description)+" ",1),L("span",E$,B(V.$t("config.types.select")),1),s.value.get(Z.id)!==Z.configValue?(ne(),ue("span",N$,B(V.$t("config.modified")),1)):at("",!0)]),L("span",{class:"config-key",title:Z.configKey},B(Z.configKey),9,T$)])]),L("div",M$,[L("select",{class:"config-input select-input",value:Z.configValue,onChange:$e=>{var ft;return S(Z,((ft=$e.target)==null?void 0:ft.value)||"")}},[(ne(!0),ue(Ji,null,ln(Z.options||[],$e=>(ne(),ue("option",{key:b($e),value:b($e)},B(C($e)),9,R$))),128))],40,A$)])])):Z.inputType==="TEXTAREA"?(ne(),ue("div",P$,[L("div",O$,[L("div",F$,[L("label",B$,[Pe(B(V.$t(Z.displayName)||Z.description)+" ",1),L("span",W$,B(V.$t("config.types.textarea")),1),s.value.get(Z.id)!==Z.configValue?(ne(),ue("span",V$,B(V.$t("config.modified")),1)):at("",!0)]),L("span",{class:"config-key",title:Z.configKey},B(Z.configKey),9,H$)])]),L("div",z$,[L("textarea",{class:"config-input textarea-input",value:Z.configValue,onInput:$e=>{var ft;return S(Z,((ft=$e.target)==null?void 0:ft.value)||"")},onBlur:y,rows:"3"},null,40,$$)])])):Z.inputType==="NUMBER"?(ne(),ue("div",U$,[L("div",j$,[L("div",K$,[L("label",q$,[Pe(B(V.$t(Z.displayName)||Z.description)+" ",1),L("span",G$,B(V.$t("config.types.number")),1),s.value.get(Z.id)!==Z.configValue?(ne(),ue("span",Z$,B(V.$t("config.modified")),1)):at("",!0)]),L("span",{class:"config-key",title:Z.configKey},B(Z.configKey),9,Y$),Z.min||Z.max?(ne(),ue("div",X$,[L("span",Q$,B(V.$t("config.range"))+": "+B(Z.min||0)+" - "+B(Z.max||"∞"),1)])):at("",!0)])]),L("div",J$,[L("input",{type:"number",class:"config-input number-input",value:m(Z.configValue),onInput:$e=>{var ft;return S(Z,((ft=$e.target)==null?void 0:ft.value)||"")},onBlur:y,min:Z.min||1,max:Z.max||1e4},null,40,eU)])])):(ne(),ue("div",tU,[L("div",iU,[L("div",nU,[L("label",sU,[Pe(B(V.$t(Z.displayName)||Z.description)+" ",1),L("span",oU,B(Z.inputType==="TEXT"?V.$t("config.types.text"):V.$t("config.types.string")),1),s.value.get(Z.id)!==Z.configValue?(ne(),ue("span",rU,B(V.$t("config.modified")),1)):at("",!0)]),L("span",{class:"config-key",title:Z.configKey},B(Z.configKey),9,aU)])]),L("div",lU,[L("input",{type:"text",class:"config-input text-input",value:Z.configValue,onInput:$e=>{var ft;return S(Z,((ft=$e.target)==null?void 0:ft.value)||"")},onBlur:y},null,40,dU)])]))],2))),128))],512),[[ny,!K(H.name,G.name)]])]))),128))])]))),128))])):(ne(),ue("div",cU,[L("p",null,B(V.$t("config.notFound")),1)])),xe(qb,{name:"message-fade"},{default:Zt(()=>[a.show?(ne(),ue("div",{key:0,class:Nn(["message-toast",a.type])},B(a.text),3)):at("",!0)]),_:1})]))}}),xP=us(uU,[["__scopeId","data-v-cf54ca62"]]),hU={},gU={class:"config-config"},fU={class:"panel-header"},pU={class:"panel-actions"};function mU(o,e){return ne(),ue("div",gU,[L("div",fU,[Gf(o.$slots,"title",{},void 0),L("div",pU,[Gf(o.$slots,"actions",{},void 0)])]),Gf(o.$slots,"default",{},void 0)])}const Gb=us(hU,[["render",mU],["__scopeId","data-v-c91688e7"]]),_U={class:"modal-header"},vU={class:"modal-content"},bU={class:"modal-footer"},CU=Ss({__name:"index",props:{modelValue:{type:Boolean,required:!0},title:{type:String,default:""}},emits:["update:modelValue","confirm"],setup(o){const e=t=>{t.target===t.currentTarget&&(t.stopPropagation(),t.preventDefault())};return(t,i)=>(ne(),In(Iz,{to:"body"},[xe(qb,{name:"modal"},{default:Zt(()=>[o.modelValue?(ne(),ue("div",{key:0,class:"modal-overlay",onClick:e},[L("div",{class:"modal-container",onClick:i[3]||(i[3]=Zh(()=>{},["stop"]))},[L("div",_U,[L("h3",null,B(o.title),1),L("button",{class:"close-btn",onClick:i[0]||(i[0]=n=>t.$emit("update:modelValue",!1))},[xe(P(Re),{icon:"carbon:close"})])]),L("div",vU,[Gf(t.$slots,"default",{},void 0,!0)]),L("div",bU,[Gf(t.$slots,"footer",{},()=>[L("button",{class:"cancel-btn",onClick:i[1]||(i[1]=n=>t.$emit("update:modelValue",!1))},B(t.$t("common.cancel")),1),L("button",{class:"confirm-btn",onClick:i[2]||(i[2]=n=>t.$emit("confirm"))},B(t.$t("common.confirm")),1)],!0)])])])):at("",!0)]),_:3})]))}}),Wo=us(CU,[["__scopeId","data-v-baaf1c89"]]),wU={class:"tool-selection-content"},SU={class:"tool-controls"},yU={class:"search-container"},LU=["placeholder"],DU={class:"sort-container"},xU={value:"group"},kU={value:"name"},IU={value:"enabled"},EU={class:"tool-summary"},NU={class:"summary-text"},TU={key:0,class:"tool-groups"},MU=["onClick"],AU={class:"group-title-area"},RU={class:"group-name"},PU={class:"group-count"},OU={class:"group-enable-all"},FU=["checked","onChange","data-group"],BU={class:"enable-label"},WU={class:"tool-info"},VU={class:"tool-selection-name"},HU={key:0,class:"tool-selection-desc"},zU={class:"tool-actions"},$U=["checked","onChange"],UU={key:1,class:"empty-state"},jU=Ss({__name:"index",props:{modelValue:{type:Boolean},tools:{},selectedToolIds:{}},emits:["update:modelValue","confirm"],setup(o,{emit:e}){const t=o,i=e,n=Xn({get:()=>t.modelValue,set:x=>i("update:modelValue",x)}),s=Ye(""),r=Ye("group"),a=Ye(new Set),l=Ye([]),d=(x,y)=>{const I=document.querySelector(`input[data-group="${x}"]`);I&&(I.indeterminate=_(y))};cr(()=>t.selectedToolIds,x=>{l.value=[...x]},{immediate:!0});const c=Xn(()=>{let x=t.tools.filter(y=>y.key);if(s.value){const y=s.value.toLowerCase();x=x.filter(I=>{var E;return I.name.toLowerCase().includes(y)||I.description.toLowerCase().includes(y)||(((E=I.serviceGroup)==null?void 0:E.toLowerCase().includes(y))??!1)})}switch(r.value){case"name":x=[...x].sort((y,I)=>y.name.localeCompare(I.name));break;case"enabled":x=[...x].sort((y,I)=>{const E=l.value.includes(y.key),R=l.value.includes(I.key);return E&&!R?-1:!E&&R?1:y.name.localeCompare(I.name)});break;case"group":default:x=[...x].sort((y,I)=>{const E=y.serviceGroup??"Ungrouped",R=I.serviceGroup??"Ungrouped";return E!==R?E.localeCompare(R):y.name.localeCompare(I.name)});break}return x}),u=Xn(()=>{const x=new Map;return c.value.forEach(y=>{const I=y.serviceGroup??"Ungrouped";x.has(I)||x.set(I,[]),x.get(I).push(y)}),new Map([...x.entries()].sort())}),h=Xn(()=>c.value.length);cr([l,u],()=>{I9(()=>{for(const[x,y]of u.value)d(x,y)})},{flush:"post",deep:!1});const g=x=>l.value.includes(x),f=(x,y)=>{y.stopPropagation();const E=y.target.checked;if(!x){console.error("toolKey is undefined, cannot proceed");return}E?l.value.includes(x)||(l.value=[...l.value,x]):l.value=l.value.filter(R=>R!==x)},m=x=>x.filter(y=>l.value.includes(y.key)),v=x=>x.length>0&&x.every(y=>l.value.includes(y.key)),_=x=>{const y=m(x).length;return y>0&&y{y.stopPropagation();const E=y.target.checked,R=x.map(j=>j.key);if(E){const j=[...l.value];R.forEach(O=>{j.includes(O)||j.push(O)}),l.value=j}else l.value=l.value.filter(j=>!R.includes(j))},C=x=>{a.value.has(x)?a.value.delete(x):a.value.add(x)},w=()=>{i("confirm",[...l.value]),i("update:modelValue",!1)},S=()=>{l.value=[...t.selectedToolIds],i("update:modelValue",!1)};return cr(n,x=>{if(x){a.value.clear();const y=Array.from(u.value.keys());y.length>1&&y.slice(1).forEach(I=>{a.value.add(I)})}}),(x,y)=>(ne(),In(Wo,{modelValue:n.value,"onUpdate:modelValue":[y[4]||(y[4]=I=>n.value=I),S],title:x.$t("toolSelection.title"),onConfirm:w},{default:Zt(()=>[L("div",wU,[L("div",SU,[L("div",yU,[Vt(L("input",{"onUpdate:modelValue":y[0]||(y[0]=I=>s.value=I),type:"text",class:"search-input",placeholder:x.$t("toolSelection.searchPlaceholder")},null,8,LU),[[ti,s.value]])]),L("div",DU,[Vt(L("select",{"onUpdate:modelValue":y[1]||(y[1]=I=>r.value=I),class:"sort-select"},[L("option",xU,B(x.$t("toolSelection.sortByGroup")),1),L("option",kU,B(x.$t("toolSelection.sortByName")),1),L("option",IU,B(x.$t("toolSelection.sortByStatus")),1)],512),[[X1,r.value]])])]),L("div",EU,[L("span",NU,B(x.$t("toolSelection.summary",{groups:u.value.size,tools:h.value,selected:l.value.length})),1)]),u.value.size>0?(ne(),ue("div",TU,[(ne(!0),ue(Ji,null,ln(u.value,([I,E])=>(ne(),ue("div",{key:I,class:"tool-group"},[L("div",{class:Nn(["tool-group-header",{collapsed:a.value.has(I)}]),onClick:R=>C(I)},[L("div",AU,[xe(P(Re),{icon:a.value.has(I)?"carbon:chevron-right":"carbon:chevron-down",class:"collapse-icon"},null,8,["icon"]),xe(P(Re),{icon:"carbon:folder",class:"group-icon"}),L("span",RU,B(I),1),L("span",PU," ("+B(m(E).length)+"/"+B(E.length)+") ",1)]),L("div",{class:"group-actions",onClick:y[2]||(y[2]=Zh(()=>{},["stop"]))},[L("label",OU,[L("input",{type:"checkbox",class:"group-enable-checkbox",checked:v(E),onChange:R=>b(E,R),"data-group":I},null,40,FU),L("span",BU,B(x.$t("toolSelection.enableAll")),1)])])],10,MU),L("div",{class:Nn(["tool-group-content",{collapsed:a.value.has(I)}])},[(ne(!0),ue(Ji,null,ln(E.filter(R=>R&&R.key),R=>(ne(),ue("div",{key:R.key,class:"tool-selection-item"},[L("div",WU,[L("div",VU,B(R.name),1),R.description?(ne(),ue("div",HU,B(R.description),1)):at("",!0)]),L("div",zU,[L("label",{class:"tool-enable-switch",onClick:y[3]||(y[3]=Zh(()=>{},["stop"]))},[L("input",{type:"checkbox",class:"tool-enable-checkbox",checked:g(R.key),onChange:j=>f(R.key,j)},null,40,$U),y[5]||(y[5]=L("span",{class:"tool-enable-slider"},null,-1))])])]))),128))],2)]))),128))])):(ne(),ue("div",UU,[xe(P(Re),{icon:"carbon:tools",class:"empty-icon"}),L("p",null,B(x.$t("toolSelection.noToolsFound")),1)]))])]),_:1},8,["modelValue","title"]))}}),KU=us(jU,[["__scopeId","data-v-0237b039"]]);class ac{static async handleResponse(e){if(!e.ok)try{const t=await e.json();throw new Error(t.message||`API request failed: ${e.status}`)}catch{throw new Error(`API request failed: ${e.status} ${e.statusText}`)}return e}static async getAllAgents(e){try{if(e){const t=await fetch(`${this.BASE_URL}/namespace/${e}`);return await(await this.handleResponse(t)).json()}else{const t=await fetch(`${this.BASE_URL}`);return await(await this.handleResponse(t)).json()}}catch(t){throw console.error("Failed to get Agent list:",t),t}}static async getAgentById(e){try{const t=await fetch(`${this.BASE_URL}/${e}`);return await(await this.handleResponse(t)).json()}catch(t){throw console.error(`Failed to get Agent[${e}] details:`,t),t}}static async createAgent(e){try{const t=await fetch(this.BASE_URL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await(await this.handleResponse(t)).json()}catch(t){throw console.error("Failed to create Agent:",t),t}}static async updateAgent(e,t){try{const i=await fetch(`${this.BASE_URL}/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await(await this.handleResponse(i)).json()}catch(i){throw console.error(`Failed to update Agent[${e}]:`,i),i}}static async deleteAgent(e){try{const t=await fetch(`${this.BASE_URL}/${e}`,{method:"DELETE"});if(t.status===400)throw new Error("Cannot delete default Agent");await this.handleResponse(t)}catch(t){throw console.error(`Failed to delete Agent[${e}]:`,t),t}}static async getAvailableTools(){try{const e=await fetch(`${this.BASE_URL}/tools`);return await(await this.handleResponse(e)).json()}catch(e){throw console.error("Failed to get available tools list:",e),e}}}ri(ac,"BASE_URL","/api/agents");class ko{static async handleResponse(e){if(!e.ok)try{const t=await e.json();throw new Error(t.message||`API request failed: ${e.status}`)}catch{throw new Error(`API request failed: ${e.status} ${e.statusText}`)}return e}static async getAllModels(){try{const e=await fetch(this.BASE_URL);return await(await this.handleResponse(e)).json()}catch(e){throw console.error("Failed to get Model list:",e),e}}static async getAllTypes(){try{const e=await fetch(`${this.BASE_URL}/types`);return await(await this.handleResponse(e)).json()}catch(e){throw console.error("Failed to get Model list:",e),e}}static async getModelById(e){try{const t=await fetch(`${this.BASE_URL}/${e}`);return await(await this.handleResponse(t)).json()}catch(t){throw console.error(`Failed to get Model[${e}] details:`,t),t}}static async createModel(e){try{const t=JSON.stringify(e,(s,r)=>(s==="temperature"||s==="topP")&&r===void 0?null:r),i=await fetch(this.BASE_URL,{method:"POST",headers:{"Content-Type":"application/json"},body:t});return await(await this.handleResponse(i)).json()}catch(t){throw console.error("Failed to create Model:",t),t}}static async updateModel(e,t){try{const i=JSON.stringify(t,(r,a)=>(r==="temperature"||r==="topP")&&a===void 0?null:a),n=await fetch(`${this.BASE_URL}/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:i});if(n.status===499)throw new Error("Request rejected, please modify the model configuration in the configuration file");return await(await this.handleResponse(n)).json()}catch(i){throw console.error(`Failed to update Model[${e}]:`,i),i}}static async deleteModel(e){try{const t=await fetch(`${this.BASE_URL}/${e}`,{method:"DELETE"});if(t.status===400)throw new Error("Cannot delete default Model");if(t.status===499)throw new Error("Request rejected, please modify the model configuration in the configuration file");await this.handleResponse(t)}catch(t){throw console.error(`Failed to delete Model[${e}]:`,t),t}}static async validateConfig(e){try{const t=await fetch(`${this.BASE_URL}/validate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await(await this.handleResponse(t)).json()}catch(t){throw console.error("Failed to validate model configuration:",t),t}}static async setDefaultModel(e){try{const t=await fetch(`${this.BASE_URL}/${e}/set-default`,{method:"POST",headers:{"Content-Type":"application/json"}});return await(await this.handleResponse(t)).json()}catch(t){throw console.error(`Failed to set model[${e}] as default:`,t),t}}}ri(ko,"BASE_URL","/api/models");const sy=Ez("namespace",()=>{const o=Ye("default");function e(n){o.value=n}const t=Ye([]);function i(n){t.value=n}return{namespace:o,namespaces:t,setCurrentNs:e,setNamespaces:i}}),q2=async o=>{if(!o.ok){const e=await o.json().catch(()=>({message:"Network error"}));throw new Error(e.message||`HTTP error! status: ${o.status}`)}return o.json()},qU=async()=>{const o=await fetch("/api/agent-management/languages");return q2(o)},GU=async o=>{const e=await fetch("/api/agent-management/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});return q2(e)},ZU=async()=>{const o=await fetch("/api/agent-management/stats");return q2(o)},YU=["disabled"],XU={class:"agent-layout"},QU={class:"agent-list"},JU={class:"list-header"},ej={class:"agent-count"},tj={key:0,class:"agents-container"},ij=["onClick"],nj={class:"agent-card-header"},sj={class:"agent-name"},oj={class:"agent-desc"},rj={key:0,class:"agent-model"},aj={class:"model-tag"},lj={class:"model-tag"},dj={key:1,class:"agent-tools"},cj={key:0,class:"tool-more"},uj={key:1,class:"loading-state"},hj={key:2,class:"empty-state"},gj={key:0,class:"agent-detail"},fj={class:"detail-header"},pj={class:"detail-actions"},mj={class:"form-item"},_j=["placeholder"],vj={class:"form-item"},bj=["placeholder"],Cj={class:"form-item"},wj=["value","placeholder"],Sj={class:"model-section"},yj={class:"form-item"},Lj={class:"model-chooser"},Dj=["title"],xj={key:0,class:"current-model"},kj={class:"model-type"},Ij={class:"model-name"},Ej={key:1,class:"current-model"},Nj={class:"current-model"},Tj={class:"dropdown-header"},Mj={class:"model-options"},Aj=["onClick"],Rj={class:"model-type"},Pj={class:"model-name"},Oj={class:"tools-section"},Fj={class:"assigned-tools"},Bj={class:"section-header"},Wj={class:"tools-grid"},Vj={class:"tool-info"},Hj={class:"tool-name"},zj={class:"tool-desc"},$j={key:0,class:"no-tools"},Uj={key:1,class:"no-selection"},jj={class:"modal-form"},Kj={class:"form-item"},qj=["placeholder"],Gj={class:"form-item"},Zj=["placeholder"],Yj={class:"form-item"},Xj=["value","placeholder"],Qj={class:"delete-confirm"},Jj={class:"warning-text"},eK={class:"multi-language-content"},tK={class:"stats-section"},iK={class:"stat-item"},nK={class:"stat-label"},sK={class:"stat-value"},oK={class:"stat-item"},rK={class:"stat-label"},aK={class:"stat-value"},lK={class:"language-selection"},dK={class:"selection-label"},cK={value:""},uK=["value"],hK={class:"warning-section"},gK={class:"warning-box"},fK={class:"warning-text"},pK=Ss({__name:"agentConfig",setup(o){const{t:e}=Pa(),t=sy(),{namespace:i}=K2(t),n=Ye(!1),s=Ye(""),r=Ye(""),a=ar([]),l=Ye(null),d=ar([]),c=Ye(!1),u=Ye(!1),h=Ye(!1),g=Ye(!1),f=Ye(null),m=ar([]),v=Ye(!1),_=Ye([]),b=Ye(""),C=Ye(!1),w=Ye({total:0,namespace:"",supportedLanguages:[]}),S=()=>{g.value=!g.value},x=Ce=>{f.value=Ce,g.value=!1},y=ar({name:"",description:"",nextStepPrompt:""}),I=Ce=>{const re=d.find(ke=>ke.key===Ce);return re?re.name:Ce},E=Ce=>{const re=d.find(ke=>ke.key===Ce);return re?re.description:""},R=(Ce,re)=>{re==="success"?(r.value=Ce,setTimeout(()=>{r.value=""},3e3)):(s.value=Ce,setTimeout(()=>{s.value=""},5e3))},j=async()=>{n.value=!0;try{const[Ce,re,ke]=await Promise.all([ac.getAllAgents(i.value),ac.getAvailableTools(),ko.getAllModels()]),ce=Ce.map(Ie=>({...Ie,availableTools:Ie.availableTools,...ke}));a.splice(0,a.length,...ce),d.splice(0,d.length,...re),m.splice(0,m.length,...ke),ce.length>0&&await O(ce[0])}catch(Ce){console.error("Failed to load data:",Ce),R(e("config.agentConfig.loadDataFailed")+": "+Ce.message,"error");const re=[{key:"search-web",name:"Web Search",description:"Search for information on the internet",enabled:!0,serviceGroup:"Search Services"},{key:"search-local",name:"Local Search",description:"Search content in local files",enabled:!0,serviceGroup:"Search Services"},{key:"file-read",name:"Read File",description:"Read local or remote file content",enabled:!0,serviceGroup:"File Services"},{key:"file-write",name:"Write File",description:"Create or modify file content",enabled:!0,serviceGroup:"File Services"},{key:"file-delete",name:"Delete File",description:"Delete specified file",enabled:!1,serviceGroup:"File Services"},{key:"calculator",name:"Calculator",description:"Perform mathematical calculations",enabled:!0,serviceGroup:"Computing Services"},{key:"code-execute",name:"Code Execution",description:"Execute Python or JavaScript code",enabled:!0,serviceGroup:"Computing Services"},{key:"weather",name:"Weather Query",description:"Get weather information for specified regions",enabled:!0,serviceGroup:"Information Services"},{key:"currency",name:"Exchange Rate Query",description:"Query currency exchange rate information",enabled:!0,serviceGroup:"Information Services"},{key:"email",name:"Send Email",description:"Send electronic mail",enabled:!1,serviceGroup:"Communication Services"},{key:"sms",name:"Send SMS",description:"Send SMS messages",enabled:!1,serviceGroup:"Communication Services"}],ke=[{id:"demo-1",name:"General Assistant",description:"An intelligent assistant capable of handling various tasks",nextStepPrompt:"You are a helpful assistant that can answer questions and help with various tasks. What would you like me to help you with next?",availableTools:["search-web","calculator","weather"]},{id:"demo-2",name:"Data Analyst",description:"Agent specialized in data analysis and visualization",nextStepPrompt:"You are a data analyst assistant specialized in analyzing data and creating visualizations. Please provide the data you would like me to analyze.",availableTools:["file-read","file-write","calculator","code-execute"]}];d.splice(0,d.length,...re),a.splice(0,a.length,...ke),ke.length>0&&(l.value=ke[0])}finally{n.value=!1}},O=async Ce=>{try{const re=await ac.getAgentById(Ce.id);l.value={...re,availableTools:re.availableTools},f.value=re.model??null}catch(re){console.error("Failed to load Agent details:",re),R(e("config.agentConfig.loadDetailsFailed")+": "+re.message,"error"),l.value={...Ce,availableTools:Ce.availableTools}}},$=()=>{y.name="",y.description="",y.nextStepPrompt="",c.value=!0},K=async()=>{var Ce;if(!y.name.trim()||!y.description.trim()){R(e("config.agentConfig.requiredFields"),"error");return}try{const re={name:y.name.trim(),description:y.description.trim(),nextStepPrompt:((Ce=y.nextStepPrompt)==null?void 0:Ce.trim())??"",availableTools:[],namespace:i.value},ke=await ac.createAgent(re);a.push(ke),l.value=ke,c.value=!1,R(e("config.agentConfig.createSuccess"),"success")}catch(re){R(e("config.agentConfig.createFailed")+": "+re.message,"error")}},oe=()=>{h.value=!0},Le=Ce=>{l.value&&(l.value.availableTools=[...Ce])},he=async()=>{if(l.value){if(!l.value.name.trim()||!l.value.description.trim()){R(e("config.agentConfig.requiredFields"),"error");return}try{l.value.model=f.value;const Ce=await ac.updateAgent(l.value.id,l.value),re=a.findIndex(ke=>ke.id===Ce.id);re!==-1&&(a[re]=Ce),l.value=Ce,l.value.model=f.value,R(e("config.agentConfig.saveSuccess"),"success")}catch(Ce){R(e("config.agentConfig.saveFailed")+": "+Ce.message,"error")}}},se=()=>{u.value=!0},V=async()=>{if(l.value)try{await ac.deleteAgent(l.value.id);const Ce=a.findIndex(re=>re.id===l.value.id);Ce!==-1&&a.splice(Ce,1),l.value=a.length>0?a[0]:null,u.value=!1,R(e("config.agentConfig.deleteSuccess"),"success")}catch(Ce){R(e("config.agentConfig.deleteFailed")+": "+Ce.message,"error")}},Q=()=>{const Ce=document.createElement("input");Ce.type="file",Ce.accept=".json",Ce.onchange=re=>{var ce;const ke=(ce=re.target.files)==null?void 0:ce[0];if(ke){const Ie=new FileReader;Ie.onload=async mt=>{var Ct;try{const Mt=JSON.parse((Ct=mt.target)==null?void 0:Ct.result);if(!Mt.name||!Mt.description)throw new Error(e("config.agentConfig.invalidFormat"));const{id:ci,...yn}=Mt,Qs=await ac.createAgent(yn);a.push(Qs),l.value=Qs,R(e("config.agentConfig.importSuccess"),"success")}catch(Mt){R(e("config.agentConfig.importFailed")+": "+Mt.message,"error")}},Ie.readAsText(ke)}},Ce.click()},H=()=>{if(l.value)try{const Ce=JSON.stringify(l.value,null,2),re=new Blob([Ce],{type:"application/json"}),ke=URL.createObjectURL(re),ce=document.createElement("a");ce.href=ke,ce.download=`agent-${l.value.name}-${new Date().toISOString().split("T")[0]}.json`,ce.click(),URL.revokeObjectURL(ke),R(e("config.agentConfig.exportSuccess"),"success")}catch(Ce){R(e("config.agentConfig.exportFailed")+": "+Ce.message,"error")}},G=Ce=>({zh:e("language.zh"),en:"English"})[Ce]||Ce,Z=async()=>{try{const Ce=await qU();_.value=Ce.languages,!b.value&&Ce.default&&(b.value=Ce.default)}catch(Ce){console.error("Failed to load supported languages:",Ce),R(e("common.loadFailed"),"error")}},$e=async()=>{try{const Ce=await ZU();w.value=Ce}catch(Ce){console.error("Failed to load agent stats:",Ce)}},ft=async()=>{await Promise.all([Z(),$e()]),v.value=!0},Bt=async()=>{if(!b.value){R(e("agent.multiLanguage.selectLanguage"),"error");return}C.value=!0;try{await GU({language:b.value}),R(e("agent.multiLanguage.resetSuccess"),"success"),v.value=!1,await Promise.all([j(),$e()])}catch(Ce){console.error("Failed to reset agents:",Ce),R(Ce.message||e("agent.multiLanguage.resetFailed"),"error")}finally{C.value=!1}};return Kd(()=>{j()}),cr(()=>i.value,(Ce,re)=>{Ce!==re&&(a.splice(0),l.value=null,j())}),(Ce,re)=>(ne(),In(Gb,null,{title:Zt(()=>[L("h2",null,B(P(e)("config.agentConfig.title")),1)]),actions:Zt(()=>[L("button",{class:"action-btn",onClick:ft},[xe(P(Re),{icon:"carbon:language"}),Pe(" "+B(P(e)("agent.multiLanguage.title")),1)]),L("button",{class:"action-btn",onClick:Q},[xe(P(Re),{icon:"carbon:upload"}),Pe(" "+B(P(e)("config.agentConfig.import")),1)]),L("button",{class:"action-btn",onClick:H,disabled:!l.value},[xe(P(Re),{icon:"carbon:download"}),Pe(" "+B(P(e)("config.agentConfig.export")),1)],8,YU)]),default:Zt(()=>{var ke;return[L("div",XU,[L("div",QU,[L("div",JU,[L("h3",null,B(P(e)("config.agentConfig.configuredAgents")),1),L("span",ej,"("+B(a.length)+B(P(e)("config.agentConfig.agentCount"))+")",1)]),n.value?at("",!0):(ne(),ue("div",tj,[(ne(!0),ue(Ji,null,ln(a,ce=>{var Ie,mt;return ne(),ue("div",{key:ce.id,class:Nn(["agent-card",{active:((Ie=l.value)==null?void 0:Ie.id)===ce.id}]),onClick:Ct=>O(ce)},[L("div",nj,[L("span",sj,B(ce.name),1),xe(P(Re),{icon:"carbon:chevron-right"})]),L("p",oj,B(ce.description),1),ce.model?(ne(),ue("div",rj,[L("span",aj,B(ce.model.type),1),L("span",lj,B(ce.model.modelName),1)])):at("",!0),((mt=ce.availableTools)==null?void 0:mt.length)>0?(ne(),ue("div",dj,[(ne(!0),ue(Ji,null,ln(ce.availableTools.slice(0,3),Ct=>(ne(),ue("span",{key:Ct,class:"tool-tag"},B(I(Ct)),1))),128)),ce.availableTools.length>3?(ne(),ue("span",cj," +"+B(ce.availableTools.length-3),1)):at("",!0)])):at("",!0)],10,ij)}),128))])),n.value?(ne(),ue("div",uj,[xe(P(Re),{icon:"carbon:loading",class:"loading-icon"}),Pe(" "+B(P(e)("common.loading")),1)])):at("",!0),!n.value&&a.length===0?(ne(),ue("div",hj,[xe(P(Re),{icon:"carbon:bot",class:"empty-icon"}),L("p",null,B(P(e)("config.agentConfig.noAgent")),1)])):at("",!0),L("button",{class:"add-btn",onClick:$},[xe(P(Re),{icon:"carbon:add"}),Pe(" "+B(P(e)("config.agentConfig.createNew")),1)])]),l.value?(ne(),ue("div",gj,[L("div",fj,[L("h3",null,B(l.value.name),1),L("div",pj,[L("button",{class:"action-btn primary",onClick:he},[xe(P(Re),{icon:"carbon:save"}),Pe(" "+B(P(e)("common.save")),1)]),L("button",{class:"action-btn danger",onClick:se},[xe(P(Re),{icon:"carbon:trash-can"}),Pe(" "+B(P(e)("common.delete")),1)])])]),L("div",mj,[L("label",null,[Pe(B(P(e)("config.agentConfig.agentName"))+" ",1),re[17]||(re[17]=L("span",{class:"required"},"*",-1))]),Vt(L("input",{type:"text","onUpdate:modelValue":re[0]||(re[0]=ce=>l.value.name=ce),placeholder:P(e)("config.agentConfig.agentNamePlaceholder"),required:""},null,8,_j),[[ti,l.value.name]])]),L("div",vj,[L("label",null,[Pe(B(P(e)("config.agentConfig.description"))+" ",1),re[18]||(re[18]=L("span",{class:"required"},"*",-1))]),Vt(L("textarea",{"onUpdate:modelValue":re[1]||(re[1]=ce=>l.value.description=ce),rows:"3",placeholder:P(e)("config.agentConfig.descriptionPlaceholder"),required:""},null,8,bj),[[ti,l.value.description]])]),L("div",Cj,[L("label",null,B(P(e)("config.agentConfig.nextStepPrompt")),1),L("textarea",{value:l.value.nextStepPrompt||"",onInput:re[2]||(re[2]=ce=>l.value.nextStepPrompt=ce.target.value),rows:"8",placeholder:P(e)("config.agentConfig.nextStepPromptPlaceholder")},null,40,wj)]),L("div",Sj,[L("h4",null,B(P(e)("config.agentConfig.modelConfiguration")),1),L("div",yj,[L("div",Lj,[L("button",{class:"model-btn",onClick:S,title:Ce.$t("model.switch")},[xe(P(Re),{icon:"carbon:build-run",width:"18"}),f.value?(ne(),ue("span",xj,[L("span",kj,B(f.value.type),1),re[19]||(re[19]=L("span",{class:"spacer"},null,-1)),L("span",Ij,B(f.value.modelName),1)])):(ne(),ue("span",Ej,[L("span",Nj,B(P(e)("config.agentConfig.modelConfigurationLabel")),1)])),xe(P(Re),{icon:g.value?"carbon:chevron-up":"carbon:chevron-down",width:"14",class:"chevron"},null,8,["icon"])],8,Dj),g.value?(ne(),ue("div",{key:0,class:"model-dropdown",onClick:re[4]||(re[4]=Zh(()=>{},["stop"]))},[L("div",Tj,[L("span",null,B(P(e)("config.agentConfig.modelConfigurationLabel")),1),L("button",{class:"close-btn",onClick:re[3]||(re[3]=ce=>g.value=!1)},[xe(P(Re),{icon:"carbon:close",width:"16"})])]),L("div",Mj,[(ne(!0),ue(Ji,null,ln(m,ce=>{var Ie,mt;return ne(),ue("button",{key:ce.id,class:Nn(["model-option",{active:((Ie=f.value)==null?void 0:Ie.id)===ce.id}]),onClick:Ct=>x(ce)},[L("span",Rj,B(ce.type),1),L("span",Pj,B(ce.modelName),1),((mt=f.value)==null?void 0:mt.id)===ce.id?(ne(),In(P(Re),{key:0,icon:"carbon:checkmark",width:"16",class:"check-icon"})):at("",!0)],10,Aj)}),128))])])):at("",!0),g.value?(ne(),ue("div",{key:1,class:"backdrop",onClick:re[5]||(re[5]=ce=>g.value=!1)})):at("",!0)])])]),L("div",Oj,[L("h4",null,B(P(e)("config.agentConfig.toolConfiguration")),1),L("div",Fj,[L("div",Bj,[L("span",null,B(P(e)("config.agentConfig.assignedTools"))+" ("+B((l.value.availableTools||[]).length)+")",1),d.length>0?(ne(),ue("button",{key:0,class:"action-btn small",onClick:oe},[xe(P(Re),{icon:"carbon:add"}),Pe(" "+B(P(e)("config.agentConfig.addRemoveTools")),1)])):at("",!0)]),L("div",Wj,[(ne(!0),ue(Ji,null,ln(l.value.availableTools||[],ce=>(ne(),ue("div",{key:ce,class:"tool-item assigned"},[L("div",Vj,[L("span",Hj,B(I(ce)),1),L("span",zj,B(E(ce)),1)])]))),128)),l.value.availableTools.length===0?(ne(),ue("div",$j,[xe(P(Re),{icon:"carbon:tool-box"}),L("span",null,B(P(e)("config.agentConfig.noAssignedTools")),1)])):at("",!0)])])])])):(ne(),ue("div",Uj,[xe(P(Re),{icon:"carbon:bot",class:"placeholder-icon"}),L("p",null,B(P(e)("config.agentConfig.selectAgentHint")),1)]))]),xe(Wo,{modelValue:c.value,"onUpdate:modelValue":re[9]||(re[9]=ce=>c.value=ce),title:P(e)("config.agentConfig.newAgent"),onConfirm:K},{default:Zt(()=>[L("div",jj,[L("div",Kj,[L("label",null,[Pe(B(P(e)("config.agentConfig.agentName"))+" ",1),re[20]||(re[20]=L("span",{class:"required"},"*",-1))]),Vt(L("input",{type:"text","onUpdate:modelValue":re[6]||(re[6]=ce=>y.name=ce),placeholder:P(e)("config.agentConfig.agentNamePlaceholder"),required:""},null,8,qj),[[ti,y.name]])]),L("div",Gj,[L("label",null,[Pe(B(P(e)("config.agentConfig.description"))+" ",1),re[21]||(re[21]=L("span",{class:"required"},"*",-1))]),Vt(L("textarea",{"onUpdate:modelValue":re[7]||(re[7]=ce=>y.description=ce),rows:"3",placeholder:P(e)("config.agentConfig.descriptionPlaceholder"),required:""},null,8,Zj),[[ti,y.description]])]),L("div",Yj,[L("label",null,B(P(e)("config.agentConfig.nextStepPrompt")),1),L("textarea",{value:y.nextStepPrompt||"",onInput:re[8]||(re[8]=ce=>y.nextStepPrompt=ce.target.value),rows:"8",placeholder:P(e)("config.agentConfig.nextStepPromptPlaceholder")},null,40,Xj)])])]),_:1},8,["modelValue","title"]),xe(KU,{modelValue:h.value,"onUpdate:modelValue":re[10]||(re[10]=ce=>h.value=ce),tools:d,"selected-tool-ids":((ke=l.value)==null?void 0:ke.availableTools)||[],onConfirm:Le},null,8,["modelValue","tools","selected-tool-ids"]),xe(Wo,{modelValue:u.value,"onUpdate:modelValue":re[12]||(re[12]=ce=>u.value=ce),title:P(e)("config.agentConfig.deleteConfirm")},{footer:Zt(()=>[L("button",{class:"cancel-btn",onClick:re[11]||(re[11]=ce=>u.value=!1)},B(P(e)("common.cancel")),1),L("button",{class:"confirm-btn danger",onClick:V},B(P(e)("common.delete")),1)]),default:Zt(()=>{var ce;return[L("div",Qj,[xe(P(Re),{icon:"carbon:warning",class:"warning-icon"}),L("p",null,[Pe(B(P(e)("config.agentConfig.deleteConfirmText"))+" ",1),L("strong",null,B((ce=l.value)==null?void 0:ce.name),1),Pe(" "+B(P(e)("common.confirm"))+"? ",1)]),L("p",Jj,B(P(e)("config.agentConfig.deleteWarning")),1)])]}),_:1},8,["modelValue","title"]),s.value?(ne(),ue("div",{key:0,class:"error-toast",onClick:re[13]||(re[13]=ce=>s.value="")},[xe(P(Re),{icon:"carbon:error"}),Pe(" "+B(s.value),1)])):at("",!0),r.value?(ne(),ue("div",{key:1,class:"success-toast",onClick:re[14]||(re[14]=ce=>r.value="")},[xe(P(Re),{icon:"carbon:checkmark"}),Pe(" "+B(r.value),1)])):at("",!0),xe(Wo,{modelValue:v.value,"onUpdate:modelValue":re[16]||(re[16]=ce=>v.value=ce),title:P(e)("agent.multiLanguage.title"),onConfirm:Bt},{title:Zt(()=>[Pe(B(P(e)("agent.multiLanguage.title")),1)]),default:Zt(()=>[L("div",eK,[L("div",tK,[L("div",iK,[L("span",nK,B(P(e)("agent.multiLanguage.currentLanguage"))+":",1),L("span",sK,B(G(Ce.$i18n.locale)),1)]),L("div",oK,[L("span",rK,B(P(e)("common.total"))+":",1),L("span",aK,B(w.value.total),1)])]),L("div",lK,[L("label",dK,B(P(e)("agent.multiLanguage.selectLanguage"))+":",1),Vt(L("select",{"onUpdate:modelValue":re[15]||(re[15]=ce=>b.value=ce),class:"language-select"},[L("option",cK,B(P(e)("agent.multiLanguage.selectLanguage")),1),(ne(!0),ue(Ji,null,ln(_.value,ce=>(ne(),ue("option",{key:ce,value:ce},B(G(ce)),9,uK))),128))],512),[[X1,b.value]])]),L("div",hK,[L("div",gK,[xe(P(Re),{icon:"carbon:warning",class:"warning-icon"}),L("div",fK,[L("p",null,B(P(e)("agent.multiLanguage.resetAllWarning")),1)])])])])]),_:1},8,["modelValue","title"])]}),_:1}))}}),mK=us(pK,[["__scopeId","data-v-c305016e"]]),_K={class:"custom-select"},vK=["title"],bK={key:0,class:"current-option"},CK={class:"option-name"},wK={key:1,class:"current-option"},SK={class:"dropdown-header"},yK={class:"select-options"},LK=["onClick"],DK={class:"option-name"},xK=Ss({__name:"index",props:{modelValue:{},options:{},placeholder:{},dropdownTitle:{},icon:{},direction:{},dropStyles:{},onChange:{type:Function}},emits:["update:modelValue"],setup(o,{emit:e}){const t=o,i=e,n=Ye(!1),s=Ye("bottom"),r=Xn(()=>t.options.find(u=>u.id===t.modelValue)),a=u=>u.id===t.modelValue,l=()=>{n.value||d(),n.value=!n.value},d=()=>{const u=document.querySelector(".custom-select");if(!u)return;const h=u.getBoundingClientRect(),g=window.innerHeight;h.bottom+200>g?s.value="top":s.value="bottom"},c=u=>{t.onChange?t.onChange(u.id,u):i("update:modelValue",u.id),n.value=!1};return(u,h)=>(ne(),ue("div",_K,[L("button",{class:"select-btn",onClick:l,title:u.placeholder},[xe(P(Re),{icon:t.icon||"carbon:select-01",width:"18"},null,8,["icon"]),r.value?(ne(),ue("span",bK,[r.value.icon?(ne(),In(P(Re),{key:0,icon:r.value.icon,width:"16",class:"option-icon"},null,8,["icon"])):at("",!0),L("span",CK,B(r.value.name),1)])):(ne(),ue("span",wK,B(u.placeholder),1)),xe(P(Re),{icon:n.value?"carbon:chevron-up":"carbon:chevron-down",width:"14",class:"chevron"},null,8,["icon"])],8,vK),xe(qb,{name:"slideDown"},{default:Zt(()=>[Vt(L("div",{class:Nn(["select-dropdown",{"dropdown-top":s.value==="top"}]),style:Nz({...u.dropStyles,...t.direction==="right"?{right:0}:{left:0}}),onClick:h[1]||(h[1]=Zh(()=>{},["stop"]))},[L("div",SK,[L("span",null,B(u.dropdownTitle),1),L("button",{class:"close-btn",onClick:h[0]||(h[0]=g=>n.value=!1)},[xe(P(Re),{icon:"carbon:close",width:"16"})])]),L("div",yK,[(ne(!0),ue(Ji,null,ln(u.options,g=>(ne(),ue("button",{key:g.id,class:Nn(["select-option",{active:a(g)}]),onClick:f=>c(g)},[g.icon?(ne(),In(P(Re),{key:0,icon:g.icon,width:"16",class:"option-icon"},null,8,["icon"])):at("",!0),L("span",DK,B(g.name),1),a(g)?(ne(),In(P(Re),{key:1,icon:"carbon:checkmark",width:"16",class:"check-icon"})):at("",!0)],10,LK))),128))])],6),[[ny,n.value]])]),_:1}),n.value?(ne(),ue("div",{key:0,class:"backdrop",onClick:h[2]||(h[2]=g=>n.value=!1)})):at("",!0)]))}}),Q1=us(xK,[["__scopeId","data-v-579d8359"]]),kK={class:"grouped-select"},IK=["title"],EK={key:0,class:"selected-text"},NK={class:"model-category"},TK={key:1,class:"placeholder-text"},MK={key:1,class:"dropdown-content"},AK={class:"dropdown-header"},RK={class:"search-container"},PK=["placeholder"],OK={class:"groups-container"},FK={class:"group-header"},BK={class:"group-title"},WK={class:"group-count"},VK={class:"models-grid"},HK=["onClick","title"],zK={class:"model-info"},$K={class:"model-name"},UK={class:"model-description"},jK={class:"model-category-tag"},KK=Ss({__name:"GroupedSelect",props:{modelValue:{},options:{},placeholder:{default:"Please select a model"},dropdownTitle:{default:"Available Models"}},emits:["update:modelValue"],setup(o,{emit:e}){const t=o,i=e,{t:n}=Pa(),s=Ye(!1),r=Ye(""),a=Xn(()=>{const f={};return t.options.forEach(v=>{f[v.category]||(f[v.category]=[]),f[v.category].push(v)}),["Turbo","Plus","Max","Coder","Math","Vision","TTS","Standard"].filter(v=>f[v]).map(v=>({category:v,models:f[v].sort((_,b)=>_.name.localeCompare(b.name))}))}),l=Xn(()=>r.value?a.value.map(f=>({...f,models:f.models.filter(m=>m.name.toLowerCase().includes(r.value.toLowerCase())||m.description.toLowerCase().includes(r.value.toLowerCase())||m.category.toLowerCase().includes(r.value.toLowerCase()))})).filter(f=>f.models.length>0):a.value),d=Xn(()=>t.options.find(f=>f.id===t.modelValue)),c=()=>{s.value=!s.value,s.value&&(r.value="")},u=()=>{s.value=!1,r.value=""},h=f=>{i("update:modelValue",f.id),u()},g=f=>{f.target.closest(".grouped-select")||u()};return Kd(()=>{document.addEventListener("click",g)}),E9(()=>{document.removeEventListener("click",g)}),(f,m)=>(ne(),ue("div",kK,[L("button",{class:"select-btn",onClick:c,title:f.placeholder||""},[d.value?(ne(),ue("span",EK,[Pe(B(d.value.name)+" ",1),L("span",NK,"["+B(d.value.category)+"]",1)])):(ne(),ue("span",TK,B(f.placeholder),1)),xe(P(Re),{icon:"carbon:chevron-down",class:Nn(["chevron",{rotated:s.value}])},null,8,["class"])],8,IK),s.value?(ne(),ue("div",{key:0,class:"dropdown-overlay",onClick:u})):at("",!0),s.value?(ne(),ue("div",MK,[L("div",AK,[L("h3",null,B(f.dropdownTitle),1),L("button",{class:"close-btn",onClick:u},[xe(P(Re),{icon:"carbon:close"})])]),L("div",RK,[Vt(L("input",{"onUpdate:modelValue":m[0]||(m[0]=v=>r.value=v),type:"text",placeholder:P(n)("config.modelConfig.searchModels"),class:"search-input"},null,8,PK),[[ti,r.value]]),xe(P(Re),{icon:"carbon:search",class:"search-icon"})]),L("div",OK,[(ne(!0),ue(Ji,null,ln(l.value,v=>(ne(),ue("div",{key:v.category,class:"model-group"},[L("div",FK,[L("span",BK,B(v.category),1),L("span",WK,"("+B(v.models.length)+")",1)]),L("div",VK,[(ne(!0),ue(Ji,null,ln(v.models,_=>(ne(),ue("button",{key:_.id,class:Nn(["model-option",{selected:_.id===f.modelValue}]),onClick:b=>h(_),title:_.description},[L("div",zK,[L("div",$K,B(_.name),1),L("div",UK,B(_.description),1)]),L("div",jK,"["+B(_.category)+"]",1)],10,HK))),128))])]))),128))])])):at("",!0)]))}}),kP=us(KK,[["__scopeId","data-v-08a99d28"]]),qK=["disabled"],GK={class:"model-layout"},ZK={class:"model-list"},YK={class:"list-header"},XK={class:"model-count"},QK={key:0,class:"models-container"},JK=["onClick"],eq={class:"model-card-header"},tq={class:"model-name"},iq={class:"model-status"},nq={key:0,class:"default-badge"},sq={class:"model-desc"},oq={key:0,class:"model-type"},rq={class:"model-tag"},aq={key:1,class:"loading-state"},lq={key:2,class:"empty-state"},dq={key:0,class:"model-detail"},cq={class:"detail-header"},uq={class:"detail-actions"},hq=["disabled"],gq={key:1,class:"current-default"},fq={class:"form-item"},pq={class:"form-item"},mq=["placeholder"],_q={class:"form-item"},vq=["placeholder"],bq={class:"form-item"},Cq={class:"api-key-container"},wq=["placeholder"],Sq=["disabled","title"],yq={class:"form-item"},Lq={key:1,class:"readonly-field"},Dq={class:"form-item"},xq=["placeholder"],kq={class:"form-item"},Iq=["placeholder"],Eq={class:"form-item"},Nq=["placeholder"],Tq={key:1,class:"no-selection"},Mq={class:"modal-form"},Aq={class:"form-item"},Rq={class:"form-item"},Pq=["placeholder"],Oq={class:"form-item"},Fq=["placeholder"],Bq={class:"form-item"},Wq={class:"api-key-container"},Vq=["placeholder"],Hq=["disabled","title"],zq={class:"form-item"},$q={key:1,class:"readonly-field"},Uq={class:"form-item"},jq=["placeholder"],Kq={class:"form-item"},qq=["placeholder"],Gq={class:"form-item"},Zq=["placeholder"],Yq={class:"delete-confirm"},Xq={class:"warning-text"},Qq=Ss({__name:"modelConfig",setup(o){const{t:e}=Pa(),t=Ye(!1),i=Ye(""),n=Ye(""),s=ar([]),r=ar([]),a=Ye(null),l=Ye(!1),d=Ye(!1),c=Ye(!1),u=Ye(!1),h=Ye(new Map),g=Ye(!1),f=Ye([]),m=Xn({get(){var Q;return(Q=a.value)!=null&&Q.headers?JSON.stringify(a.value.headers,null,2):""},set(Q){a.value&&(a.value.headers=Q.trim()?JSON.parse(Q):null)}}),v=Xn({get(){return _.headers?JSON.stringify(_.headers,null,2):""},set(Q){_.headers=Q.trim()?JSON.parse(Q):null}}),_=ar({baseUrl:"",headers:null,apiKey:"",modelName:"",modelDescription:"",type:""}),b=(Q,H)=>{H==="success"?(n.value=Q,setTimeout(()=>{n.value=""},3e3)):H==="error"?(i.value=Q,setTimeout(()=>{i.value=""},5e3)):H==="info"&&(n.value=Q,setTimeout(()=>{n.value=""},2e3))},C=async()=>{t.value=!0;try{const[Q,H]=await Promise.all([ko.getAllModels(),ko.getAllTypes()]),G=Q.map(Z=>({...Z}));s.splice(0,s.length,...G),r.splice(0,r.length,...H),G.length>0&&await w(G[0])}catch(Q){console.error("Failed to load data:",Q),b(e("config.modelConfig.loadDataFailed")+": "+Q.message,"error")}finally{t.value=!1}},w=async Q=>{try{const H=await ko.getModelById(Q.id);a.value={...H},c.value=!1}catch(H){console.error("Failed to load Model details:",H),b(e("config.modelConfig.loadDetailsFailed")+": "+H.message,"error"),a.value={...Q}}},S=()=>{_.baseUrl="",_.headers=null,_.apiKey="",_.modelName="",_.modelDescription="",_.type="",delete _.temperature,delete _.topP,g.value=!1,f.value=[],l.value=!0},x=async()=>{var Q,H,G,Z;if(!((Q=a.value)!=null&&Q.baseUrl)||!((H=a.value)!=null&&H.apiKey)){b(e("config.modelConfig.pleaseEnterBaseUrlAndApiKey"),"error");return}c.value=!0;try{const $e=await ko.validateConfig({baseUrl:a.value.baseUrl,apiKey:a.value.apiKey});$e.valid?(b(e("config.modelConfig.validationSuccess")+` - ${e("config.modelConfig.getModelsCount",{count:((G=$e.availableModels)==null?void 0:G.length)||0})}`,"success"),(Z=a.value)!=null&&Z.id&&h.value.set(a.value.id,$e.availableModels||[]),$e.availableModels&&$e.availableModels.length>0&&(a.value.modelName=$e.availableModels[0].modelName,a.value.modelDescription=I($e.availableModels[0].modelName))):b(e("config.modelConfig.validationFailed")+": "+$e.message,"error")}catch($e){b(e("config.modelConfig.validationFailed")+": "+$e.message,"error")}finally{c.value=!1}},y=Q=>{const H=Q.toLowerCase();return H.includes("turbo")?"Turbo":H.includes("plus")?"Plus":H.includes("max")?"Max":H.includes("coder")||H.includes("code")?"Coder":H.includes("math")?"Math":H.includes("vision")||H.includes("vl")?"Vision":H.includes("tts")?"TTS":"Standard"},I=Q=>{const H=Q.toLowerCase();return H.includes("turbo")?"Turbo model, fast response":H.includes("plus")?"Plus model, balanced performance":H.includes("max")?"Max model, strongest performance":H.includes("coder")||H.includes("code")?"Coder model, specialized for code generation":H.includes("math")?"Math model, specialized for mathematical calculations":H.includes("vision")||H.includes("vl")?"Vision model, specialized for visual understanding":H.includes("tts")?"TTS model, specialized for text-to-speech":"Standard model"},E=()=>{var Q;return(Q=a.value)!=null&&Q.id?h.value.get(a.value.id)||[]:[]},R=Q=>{a.value&&Q&&E().find(Z=>Z.modelName===Q)&&(a.value.modelDescription=I(Q))},j=async()=>{var Q;if(!_.baseUrl||!_.apiKey){b(e("config.modelConfig.pleaseEnterBaseUrlAndApiKey"),"error");return}g.value=!0;try{const H=await ko.validateConfig({baseUrl:_.baseUrl,apiKey:_.apiKey});H.valid?(b(e("config.modelConfig.validationSuccess")+` - ${e("config.modelConfig.getModelsCount",{count:((Q=H.availableModels)==null?void 0:Q.length)||0})}`,"success"),f.value=H.availableModels||[],H.availableModels&&H.availableModels.length>0&&(_.modelName=H.availableModels[0].modelName,_.modelDescription=I(H.availableModels[0].modelName))):b(e("config.modelConfig.validationFailed")+": "+H.message,"error")}catch(H){b(e("config.modelConfig.validationFailed")+": "+H.message,"error")}finally{g.value=!1}},O=Q=>{Q&&f.value.find(G=>G.modelName===Q)&&(_.modelDescription=I(Q))},$=async()=>{if(!_.modelName.trim()||!_.modelDescription.trim()){b(e("config.modelConfig.requiredFields"),"error");return}if(!_.baseUrl.trim()||!_.apiKey.trim()){b(e("config.modelConfig.pleaseEnterBaseUrlAndApiKey"),"error");return}b(e("config.modelConfig.validatingBeforeSave"),"info");try{const Q=await ko.validateConfig({baseUrl:_.baseUrl.trim(),apiKey:_.apiKey.trim()});if(!Q.valid){b(e("config.modelConfig.validationFailedCannotSave")+": "+Q.message,"error");return}}catch(Q){b(e("config.modelConfig.validationFailedCannotSave")+": "+Q.message,"error");return}try{const Q={baseUrl:_.baseUrl.trim(),headers:_.headers,apiKey:_.apiKey.trim(),modelName:_.modelName.trim(),modelDescription:_.modelDescription.trim(),type:_.type.trim(),temperature:isNaN(_.temperature)?null:_.temperature,topP:isNaN(_.topP)?null:_.topP},H=await ko.createModel(Q);s.push(H),a.value=H,l.value=!1,b(e("config.modelConfig.createSuccess"),"success")}catch(Q){b(e("config.modelConfig.createFailed")+": "+Q.message,"error")}},K=async()=>{if(!a.value)return;if(!a.value.modelName.trim()||!a.value.modelDescription.trim()){b(e("config.modelConfig.requiredFields"),"error");return}if(!a.value.baseUrl||!a.value.apiKey){b(e("config.modelConfig.pleaseEnterBaseUrlAndApiKey"),"error");return}if(!a.value.apiKey.includes("*")||!h.value.has(a.value.id)){b(e("config.modelConfig.validatingBeforeSave"),"info");try{const H=await ko.validateConfig({baseUrl:a.value.baseUrl,apiKey:a.value.apiKey});if(!H.valid){b(e("config.modelConfig.validationFailedCannotSave")+": "+H.message,"error");return}h.value.set(a.value.id,H.availableModels||[])}catch(H){b(e("config.modelConfig.validationFailedCannotSave")+": "+H.message,"error");return}}try{const H={...a.value,temperature:isNaN(a.value.temperature)?null:a.value.temperature,topP:isNaN(a.value.topP)?null:a.value.topP},G=await ko.updateModel(a.value.id,H),Z=s.findIndex($e=>$e.id===G.id);Z!==-1&&(s[Z]=G),a.value=G,b(e("config.modelConfig.saveSuccess"),"success")}catch(H){b(e("config.modelConfig.saveFailed")+": "+H.message,"error")}},oe=()=>{d.value=!0},Le=async()=>{if(a.value){u.value=!0;try{await ko.setDefaultModel(a.value.id),s.forEach(Q=>{Q.isDefault=Q.id===a.value.id}),a.value.isDefault=!0,b(e("config.modelConfig.setDefaultSuccess"),"success")}catch(Q){b(e("config.modelConfig.setDefaultFailed")+": "+Q.message,"error")}finally{u.value=!1}}},he=async()=>{if(a.value)try{await ko.deleteModel(a.value.id);const Q=s.findIndex(H=>H.id===a.value.id);Q!==-1&&s.splice(Q,1),a.value=s.length>0?s[0]:null,d.value=!1,b(e("config.modelConfig.deleteSuccess"),"success")}catch(Q){b(e("config.modelConfig.deleteFailed")+": "+Q.message,"error")}},se=()=>{const Q=document.createElement("input");Q.type="file",Q.accept=".json",Q.onchange=H=>{var Z;const G=(Z=H.target.files)==null?void 0:Z[0];if(G){const $e=new FileReader;$e.onload=async ft=>{var Bt;try{const Ce=JSON.parse((Bt=ft.target)==null?void 0:Bt.result);if(!Ce.modelName||!Ce.modelDescription)throw new Error(e("config.modelConfig.invalidFormat"));const{id:re,...ke}=Ce,ce=await ko.createModel(ke);s.push(ce),a.value=ce,b(e("config.modelConfig.importSuccess"),"success")}catch(Ce){b(e("config.modelConfig.importFailed")+": "+Ce.message,"error")}},$e.readAsText(G)}},Q.click()},V=()=>{if(a.value)try{const Q=JSON.stringify(a.value,null,2),H=new Blob([Q],{type:"application/json"}),G=URL.createObjectURL(H),Z=document.createElement("a");Z.href=G,Z.download=`model-${a.value.modelName}-${new Date().toISOString().split("T")[0]}.json`,Z.click(),URL.revokeObjectURL(G),b(e("config.modelConfig.exportSuccess"),"success")}catch(Q){b(e("config.modelConfig.exportFailed")+": "+Q.message,"error")}};return Kd(()=>{C()}),(Q,H)=>(ne(),In(Gb,null,{title:Zt(()=>[L("h2",null,B(P(e)("config.modelConfig.title")),1)]),actions:Zt(()=>[L("button",{class:"action-btn",onClick:se},[xe(P(Re),{icon:"carbon:upload"}),Pe(" "+B(P(e)("config.modelConfig.import")),1)]),L("button",{class:"action-btn",onClick:V,disabled:!a.value},[xe(P(Re),{icon:"carbon:download"}),Pe(" "+B(P(e)("config.modelConfig.export")),1)],8,qK)]),default:Zt(()=>[L("div",GK,[L("div",ZK,[L("div",YK,[L("h3",null,B(P(e)("config.modelConfig.configuredModels")),1),L("span",XK,"("+B(s.length)+")",1)]),t.value?at("",!0):(ne(),ue("div",QK,[(ne(!0),ue(Ji,null,ln(s,G=>{var Z;return ne(),ue("div",{key:G.id,class:Nn(["model-card",{active:((Z=a.value)==null?void 0:Z.id)===G.id}]),onClick:$e=>w(G)},[L("div",eq,[L("span",tq,B(G.modelName),1),L("div",iq,[G.isDefault?(ne(),ue("span",nq,[xe(P(Re),{icon:"carbon:star-filled"}),Pe(" "+B(P(e)("config.modelConfig.default")),1)])):at("",!0),xe(P(Re),{icon:"carbon:chevron-right"})])]),L("p",sq,B(G.modelDescription),1),G.type?(ne(),ue("div",oq,[L("span",rq,B(G.type),1)])):at("",!0)],10,JK)}),128))])),t.value?(ne(),ue("div",aq,[xe(P(Re),{icon:"carbon:loading",class:"loading-icon"}),Pe(" "+B(P(e)("common.loading")),1)])):at("",!0),!t.value&&s.length===0?(ne(),ue("div",lq,[xe(P(Re),{icon:"carbon:bot",class:"empty-icon"}),L("p",null,B(P(e)("config.modelConfig.noModel")),1)])):at("",!0),L("button",{class:"add-btn",onClick:S},[xe(P(Re),{icon:"carbon:add"}),Pe(" "+B(P(e)("config.modelConfig.createNew")),1)])]),a.value?(ne(),ue("div",dq,[L("div",cq,[L("h3",null,B(a.value.modelName),1),L("div",uq,[a.value.isDefault?(ne(),ue("span",gq,[xe(P(Re),{icon:"carbon:star-filled"}),Pe(" "+B(P(e)("config.modelConfig.currentDefault")),1)])):(ne(),ue("button",{key:0,class:"action-btn default",onClick:Le,disabled:u.value},[xe(P(Re),{icon:"carbon:star"}),Pe(" "+B(P(e)("config.modelConfig.setAsDefault")),1)],8,hq)),L("button",{class:"action-btn primary",onClick:K},[xe(P(Re),{icon:"carbon:save"}),Pe(" "+B(P(e)("common.save")),1)]),L("button",{class:"action-btn danger",onClick:oe},[xe(P(Re),{icon:"carbon:trash-can"}),Pe(" "+B(P(e)("common.delete")),1)])])]),L("div",fq,[L("label",null,[Pe(B(P(e)("config.modelConfig.type"))+" ",1),H[21]||(H[21]=L("span",{class:"required"},"*",-1))]),xe(Q1,{modelValue:a.value.type,"onUpdate:modelValue":H[0]||(H[0]=G=>a.value.type=G),options:r.map(G=>({id:G,name:G})),placeholder:P(e)("config.modelConfig.typePlaceholder"),"dropdown-title":P(e)("config.modelConfig.typePlaceholder"),icon:"carbon:types"},null,8,["modelValue","options","placeholder","dropdown-title"])]),L("div",pq,[L("label",null,[Pe(B(P(e)("config.modelConfig.baseUrl"))+" ",1),H[22]||(H[22]=L("span",{class:"required"},"*",-1))]),Vt(L("input",{type:"text","onUpdate:modelValue":H[1]||(H[1]=G=>a.value.baseUrl=G),placeholder:P(e)("config.modelConfig.baseUrlPlaceholder"),required:""},null,8,mq),[[ti,a.value.baseUrl]])]),L("div",_q,[L("label",null,B(P(e)("config.modelConfig.headers")),1),Vt(L("input",{type:"text","onUpdate:modelValue":H[2]||(H[2]=G=>m.value=G),placeholder:P(e)("config.modelConfig.headersPlaceholder")},null,8,vq),[[ti,m.value]])]),L("div",bq,[L("label",null,[Pe(B(P(e)("config.modelConfig.apiKey"))+" ",1),H[23]||(H[23]=L("span",{class:"required"},"*",-1))]),L("div",Cq,[Vt(L("input",{type:"text","onUpdate:modelValue":H[3]||(H[3]=G=>a.value.apiKey=G),placeholder:P(e)("config.modelConfig.apiKeyPlaceholder"),required:""},null,8,wq),[[ti,a.value.apiKey]]),L("button",{class:"check-btn",onClick:x,disabled:c.value||!a.value.baseUrl||!a.value.apiKey,title:P(e)("config.modelConfig.validateConfig")},[c.value?(ne(),In(P(Re),{key:1,icon:"carbon:loading",class:"loading-icon"})):(ne(),In(P(Re),{key:0,icon:"carbon:checkmark"}))],8,Sq)])]),L("div",yq,[L("label",null,[Pe(B(P(e)("config.modelConfig.modelName"))+" ",1),H[24]||(H[24]=L("span",{class:"required"},"*",-1))]),E().length>0?(ne(),In(kP,{key:0,modelValue:a.value.modelName,"onUpdate:modelValue":[H[4]||(H[4]=G=>a.value.modelName=G),R],options:E().map(G=>({id:G.modelName,name:G.modelName,description:I(G.modelName),category:y(G.modelName)})),placeholder:P(e)("config.modelConfig.selectModel"),"dropdown-title":P(e)("config.modelConfig.availableModels")},null,8,["modelValue","options","placeholder","dropdown-title"])):(ne(),ue("div",Lq,B(a.value.modelName||P(e)("config.modelConfig.modelNamePlaceholder")),1))]),L("div",Dq,[L("label",null,[Pe(B(P(e)("config.modelConfig.description"))+" ",1),H[25]||(H[25]=L("span",{class:"required"},"*",-1))]),Vt(L("textarea",{"onUpdate:modelValue":H[5]||(H[5]=G=>a.value.modelDescription=G),placeholder:P(e)("config.modelConfig.descriptionPlaceholder"),class:"description-field",rows:"3"},null,8,xq),[[ti,a.value.modelDescription]])]),L("div",kq,[L("label",null,B(P(e)("config.modelConfig.temperature")),1),Vt(L("input",{type:"number","onUpdate:modelValue":H[6]||(H[6]=G=>a.value.temperature=G),placeholder:P(e)("config.modelConfig.temperaturePlaceholder"),step:"0.1",min:"0",max:"2"},null,8,Iq),[[ti,a.value.temperature,void 0,{number:!0}]])]),L("div",Eq,[L("label",null,B(P(e)("config.modelConfig.topP")),1),Vt(L("input",{type:"number","onUpdate:modelValue":H[7]||(H[7]=G=>a.value.topP=G),placeholder:P(e)("config.modelConfig.topPPlaceholder"),step:"0.1",min:"0",max:"1"},null,8,Nq),[[ti,a.value.topP,void 0,{number:!0}]])])])):(ne(),ue("div",Tq,[xe(P(Re),{icon:"carbon:bot",class:"placeholder-icon"}),L("p",null,B(P(e)("config.modelConfig.selectModelHint")),1)]))]),xe(Wo,{modelValue:l.value,"onUpdate:modelValue":H[16]||(H[16]=G=>l.value=G),title:P(e)("config.modelConfig.newModel"),onConfirm:$},{default:Zt(()=>[L("div",Mq,[L("div",Aq,[L("label",null,[Pe(B(P(e)("config.modelConfig.type"))+" ",1),H[26]||(H[26]=L("span",{class:"required"},"*",-1))]),xe(Q1,{modelValue:_.type,"onUpdate:modelValue":H[8]||(H[8]=G=>_.type=G),options:r.map(G=>({id:G,name:G})),placeholder:P(e)("config.modelConfig.typePlaceholder"),"dropdown-title":P(e)("config.modelConfig.typePlaceholder"),icon:"carbon:types"},null,8,["modelValue","options","placeholder","dropdown-title"])]),L("div",Rq,[L("label",null,[Pe(B(P(e)("config.modelConfig.baseUrl"))+" ",1),H[27]||(H[27]=L("span",{class:"required"},"*",-1))]),Vt(L("input",{type:"text","onUpdate:modelValue":H[9]||(H[9]=G=>_.baseUrl=G),placeholder:P(e)("config.modelConfig.baseUrlPlaceholder"),required:""},null,8,Pq),[[ti,_.baseUrl]])]),L("div",Oq,[L("label",null,B(P(e)("config.modelConfig.headers")),1),Vt(L("input",{type:"text","onUpdate:modelValue":H[10]||(H[10]=G=>v.value=G),placeholder:P(e)("config.modelConfig.headersPlaceholder")},null,8,Fq),[[ti,v.value]])]),L("div",Bq,[L("label",null,[Pe(B(P(e)("config.modelConfig.apiKey"))+" ",1),H[28]||(H[28]=L("span",{class:"required"},"*",-1))]),L("div",Wq,[Vt(L("input",{type:"text","onUpdate:modelValue":H[11]||(H[11]=G=>_.apiKey=G),placeholder:P(e)("config.modelConfig.apiKeyPlaceholder"),required:""},null,8,Vq),[[ti,_.apiKey]]),L("button",{class:"check-btn",onClick:j,disabled:g.value||!_.baseUrl||!_.apiKey,title:P(e)("config.modelConfig.validateConfig")},[g.value?(ne(),In(P(Re),{key:1,icon:"carbon:loading",class:"loading-icon"})):(ne(),In(P(Re),{key:0,icon:"carbon:checkmark"}))],8,Hq)])]),L("div",zq,[L("label",null,[Pe(B(P(e)("config.modelConfig.modelName"))+" ",1),H[29]||(H[29]=L("span",{class:"required"},"*",-1))]),f.value.length>0?(ne(),In(kP,{key:0,modelValue:_.modelName,"onUpdate:modelValue":[H[12]||(H[12]=G=>_.modelName=G),O],options:f.value.map(G=>({id:G.modelName,name:G.modelName,description:I(G.modelName),category:y(G.modelName)})),placeholder:P(e)("config.modelConfig.selectModel"),"dropdown-title":P(e)("config.modelConfig.availableModels")},null,8,["modelValue","options","placeholder","dropdown-title"])):(ne(),ue("div",$q,B(_.modelName||P(e)("config.modelConfig.modelNamePlaceholder")),1))]),L("div",Uq,[L("label",null,[Pe(B(P(e)("config.modelConfig.description"))+" ",1),H[30]||(H[30]=L("span",{class:"required"},"*",-1))]),Vt(L("textarea",{"onUpdate:modelValue":H[13]||(H[13]=G=>_.modelDescription=G),placeholder:P(e)("config.modelConfig.descriptionPlaceholder"),class:"description-field",rows:"3"},null,8,jq),[[ti,_.modelDescription]])]),L("div",Kq,[L("label",null,B(P(e)("config.modelConfig.temperature")),1),Vt(L("input",{type:"number","onUpdate:modelValue":H[14]||(H[14]=G=>_.temperature=G),placeholder:P(e)("config.modelConfig.temperaturePlaceholder"),step:"0.1",min:"0",max:"2"},null,8,qq),[[ti,_.temperature,void 0,{number:!0}]])]),L("div",Gq,[L("label",null,B(P(e)("config.modelConfig.topP")),1),Vt(L("input",{type:"number","onUpdate:modelValue":H[15]||(H[15]=G=>_.topP=G),placeholder:P(e)("config.modelConfig.topPPlaceholder"),step:"0.1",min:"0",max:"1"},null,8,Zq),[[ti,_.topP,void 0,{number:!0}]])])])]),_:1},8,["modelValue","title"]),xe(Wo,{modelValue:d.value,"onUpdate:modelValue":H[18]||(H[18]=G=>d.value=G),title:"Delete confirmation"},{footer:Zt(()=>[L("button",{class:"cancel-btn",onClick:H[17]||(H[17]=G=>d.value=!1)},B(P(e)("common.cancel")),1),L("button",{class:"confirm-btn danger",onClick:he},B(P(e)("common.delete")),1)]),default:Zt(()=>{var G;return[L("div",Yq,[xe(P(Re),{icon:"carbon:warning",class:"warning-icon"}),L("p",null,[Pe(B(P(e)("config.modelConfig.deleteConfirmText"))+" ",1),L("strong",null,B((G=a.value)==null?void 0:G.modelName),1),Pe(" "+B(P(e)("common.confirm"))+"? ",1)]),L("p",Xq,B(P(e)("config.modelConfig.deleteWarning")),1)])]}),_:1},8,["modelValue"]),i.value?(ne(),ue("div",{key:0,class:"error-toast",onClick:H[19]||(H[19]=G=>i.value="")},[xe(P(Re),{icon:"carbon:error"}),Pe(" "+B(i.value),1)])):at("",!0),n.value?(ne(),ue("div",{key:1,class:"success-toast",onClick:H[20]||(H[20]=G=>n.value="")},[xe(P(Re),{icon:"carbon:checkmark"}),Pe(" "+B(n.value),1)])):at("",!0)]),_:1}))}}),Jq=us(Qq,[["__scopeId","data-v-be6fda70"]]);class od{static async getAllMcpServers(){const e=await fetch(`${this.BASE_URL}/list`);if(!e.ok)throw new Error(`Failed to get MCP server list: ${e.status}`);return await e.json()}static async addMcpServer(e){try{const t=await fetch(`${this.BASE_URL}/add`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const i=await t.text();throw new Error(`Failed to add MCP server: ${t.status} - ${i}`)}return{success:!0,message:"Successfully added MCP server"}}catch(t){return console.error("Failed to add MCP server:",t),{success:!1,message:t instanceof Error?t.message:"Failed to add, please retry"}}}static async importMcpServers(e){try{const t=await fetch(`${this.BASE_URL}/batch-import`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({configJson:JSON.stringify(e),overwrite:!1})});if(!t.ok){const i=await t.text();throw new Error(`Failed to import MCP servers: ${t.status} - ${i}`)}return{success:!0,message:"Successfully imported MCP servers"}}catch(t){return console.error("Failed to import MCP servers:",t),{success:!1,message:t instanceof Error?t.message:"Failed to import, please retry"}}}static async saveMcpServer(e){try{const t=await fetch(`${this.BASE_URL}/server`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.text(),s=e.id!==void 0?"update":"add";throw new Error(`Failed to ${s} MCP server: ${t.status} - ${n}`)}return{success:!0,message:`Successfully ${e.id!==void 0?"updated":"added"} MCP server`}}catch(t){return console.error("Failed to save MCP server:",t),{success:!1,message:t instanceof Error?t.message:"Failed to save, please retry"}}}static async updateMcpServer(e,t){return this.saveMcpServer({...t,id:e})}static async removeMcpServer(e){try{const t=await fetch(`${this.BASE_URL}/remove?id=${e}`);if(!t.ok)throw new Error(`Failed to delete MCP server: ${t.status}`);return{success:!0,message:"Successfully deleted MCP server"}}catch(t){return console.error(`Failed to delete MCP server[${e}]:`,t),{success:!1,message:t instanceof Error?t.message:"Failed to delete, please retry"}}}static async enableMcpServer(e){try{const t=await fetch(`${this.BASE_URL}/enable/${e}`,{method:"POST"});if(!t.ok){const i=await t.text();throw new Error(`Failed to enable MCP server: ${t.status} - ${i}`)}return{success:!0,message:"Successfully enabled MCP server"}}catch(t){return console.error(`Failed to enable MCP server[${e}]:`,t),{success:!1,message:t instanceof Error?t.message:"Failed to enable, please retry"}}}static async disableMcpServer(e){try{const t=await fetch(`${this.BASE_URL}/disable/${e}`,{method:"POST"});if(!t.ok){const i=await t.text();throw new Error(`Failed to disable MCP server: ${t.status} - ${i}`)}return{success:!0,message:"Successfully disabled MCP server"}}catch(t){return console.error(`Failed to disable MCP server[${e}]:`,t),{success:!1,message:t instanceof Error?t.message:"Failed to disable, please retry"}}}}ri(od,"BASE_URL","/api/mcp");function er(o,e=0){return o[o.length-(1+e)]}function eG(o){if(o.length===0)throw new Error("Invalid tail call");return[o.slice(0,o.length-1),o[o.length-1]]}function Bi(o,e,t=(i,n)=>i===n){if(o===e)return!0;if(!o||!e||o.length!==e.length)return!1;for(let i=0,n=o.length;it(o[i],e))}function iG(o,e){let t=0,i=o-1;for(;t<=i;){const n=(t+i)/2|0,s=e(n);if(s<0)t=n+1;else if(s>0)i=n-1;else return n}return-(t+1)}function Mk(o,e,t){if(o=o|0,o>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],n=[],s=[],r=[];for(const a of e){const l=t(a,i);l<0?n.push(a):l>0?s.push(a):r.push(a)}return o!!e)}function EP(o){let e=0;for(let t=0;t0}function iu(o,e=t=>t){const t=new Set;return o.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function G2(o,e){return o.length>0?o[0]:e}function Ls(o,e){let t=typeof e=="number"?o:0;typeof e=="number"?t=o:(t=0,e=o);const i=[];if(t<=e)for(let n=t;ne;n--)i.push(n);return i}function oy(o,e,t){const i=o.slice(0,e),n=o.slice(e);return i.concat(t,n)}function DD(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.unshift(e))}function $0(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.push(e))}function Ak(o,e){for(const t of e)o.push(t)}function Z2(o){return Array.isArray(o)?o:[o]}function sG(o,e,t){const i=O9(o,e),n=o.length,s=t.length;o.length=n+s;for(let r=n-1;r>=i;r--)o[r+s]=o[r];for(let r=0;r0}o.isGreaterThan=i;function n(s){return s===0}o.isNeitherLessOrGreaterThan=n,o.greaterThan=1,o.lessThan=-1,o.neitherLessOrGreaterThan=0})(pv||(pv={}));function ur(o,e){return(t,i)=>e(o(t),o(i))}function oG(...o){return(e,t)=>{for(const i of o){const n=i(e,t);if(!pv.isNeitherLessOrGreaterThan(n))return n}return pv.neitherLessOrGreaterThan}}const Md=(o,e)=>o-e,rG=(o,e)=>Md(o?1:0,e?1:0);function F9(o){return(e,t)=>-o(e,t)}class Hd{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class Dl{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new Dl(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new Dl(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(n=>((i||pv.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0)),t}}Dl.empty=new Dl(o=>{});function As(o){return typeof o=="string"}function Es(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&!(o instanceof RegExp)&&!(o instanceof Date)}function aG(o){const e=Object.getPrototypeOf(Uint8Array);return typeof o=="object"&&o instanceof e}function nu(o){return typeof o=="number"&&!isNaN(o)}function TP(o){return!!o&&typeof o[Symbol.iterator]=="function"}function B9(o){return o===!0||o===!1}function ro(o){return typeof o>"u"}function mv(o){return!Ro(o)}function Ro(o){return ro(o)||o===null}function qt(o,e){if(!o)throw new Error("Unexpected type")}function Lc(o){if(Ro(o))throw new Error("Assertion Failed: argument is undefined or null");return o}function _v(o){return typeof o=="function"}function lG(o,e){const t=Math.min(o.length,e.length);for(let i=0;i{e[t]=i&&typeof i=="object"?gd(i):i}),e}function cG(o){if(!o||typeof o!="object")return o;const e=[o];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(W9.call(t,i)){const n=t[i];typeof n=="object"&&!Object.isFrozen(n)&&!aG(n)&&e.push(n)}}return o}const W9=Object.prototype.hasOwnProperty;function V9(o,e){return Rk(o,e,new Set)}function Rk(o,e,t){if(Ro(o))return o;const i=e(o);if(typeof i<"u")return i;if(Array.isArray(o)){const n=[];for(const s of o)n.push(Rk(s,e,t));return n}if(Es(o)){if(t.has(o))throw new Error("Cannot clone recursive data-structure");t.add(o);const n={};for(const s in o)W9.call(o,s)&&(n[s]=Rk(o[s],e,t));return t.delete(o),n}return o}function ry(o,e,t=!0){return Es(o)?(Es(e)&&Object.keys(e).forEach(i=>{i in o?t&&(Es(o[i])&&Es(e[i])?ry(o[i],e[i],t):o[i]=e[i]):o[i]=e[i]}),o):e}function Uo(o,e){if(o===e)return!0;if(o==null||e===null||e===void 0||typeof o!=typeof e||typeof o!="object"||Array.isArray(o)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(o)){if(o.length!==e.length)return!1;for(t=0;tfunction(){const s=Array.prototype.slice.call(arguments,0);return e(n,s)},i={};for(const n of o)i[n]=t(n);return i}let gG=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function H9(o,e){let t;return e.length===0?t=o:t=o.replace(/\{(\d+)\}/g,(i,n)=>{const s=n[0],r=e[s];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),gG&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function p(o,e,...t){return H9(e,t)}function fG(o,e,...t){const i=H9(e,t);return{value:i,original:i}}var xD;const wf="en";let J1=!1,ew=!1,h1=!1,z9=!1,X2=!1,Q2=!1,$9=!1,U0,g1=wf,MP=wf,pG,ia;const Ad=globalThis;let Ds;typeof Ad.vscode<"u"&&typeof Ad.vscode.process<"u"?Ds=Ad.vscode.process:typeof process<"u"&&(Ds=process);const mG=typeof((xD=Ds==null?void 0:Ds.versions)===null||xD===void 0?void 0:xD.electron)=="string",_G=mG&&(Ds==null?void 0:Ds.type)==="renderer";if(typeof navigator=="object"&&!_G)ia=navigator.userAgent,J1=ia.indexOf("Windows")>=0,ew=ia.indexOf("Macintosh")>=0,Q2=(ia.indexOf("Macintosh")>=0||ia.indexOf("iPad")>=0||ia.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,h1=ia.indexOf("Linux")>=0,$9=(ia==null?void 0:ia.indexOf("Mobi"))>=0,X2=!0,p({},"_"),U0=wf,g1=U0,MP=navigator.language;else if(typeof Ds=="object"){J1=Ds.platform==="win32",ew=Ds.platform==="darwin",h1=Ds.platform==="linux",h1&&Ds.env.SNAP&&Ds.env.SNAP_REVISION,Ds.env.CI||Ds.env.BUILD_ARTIFACTSTAGINGDIRECTORY,U0=wf,g1=wf;const o=Ds.env.VSCODE_NLS_CONFIG;if(o)try{const e=JSON.parse(o),t=e.availableLanguages["*"];U0=e.locale,MP=e.osLocale,g1=t||wf,pG=e._translationsConfigFile}catch{}z9=!0}else console.error("Unable to resolve platform.");const is=J1,It=ew,ws=h1,Ml=z9,Tu=X2,vG=X2&&typeof Ad.importScripts=="function",bG=vG?Ad.origin:void 0,Ea=Q2,CG=$9,Al=ia,wG=g1,SG=typeof Ad.postMessage=="function"&&!Ad.importScripts,U9=(()=>{if(SG){const o=[];Ad.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=o.length;i{const i=++e;o.push({id:i,callback:t}),Ad.postMessage({vscodeScheduleAsyncWork:i},"*")}}return o=>setTimeout(o)})(),Vo=ew||Q2?2:J1?1:3;let AP=!0,RP=!1;function j9(){if(!RP){RP=!0;const o=new Uint8Array(2);o[0]=1,o[1]=2,AP=new Uint16Array(o.buffer)[0]===513}return AP}const K9=!!(Al&&Al.indexOf("Chrome")>=0),yG=!!(Al&&Al.indexOf("Firefox")>=0),LG=!!(!K9&&Al&&Al.indexOf("Safari")>=0),DG=!!(Al&&Al.indexOf("Edg/")>=0);Al&&Al.indexOf("Android")>=0;const rs={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var wt;(function(o){function e(b){return b&&typeof b=="object"&&typeof b[Symbol.iterator]=="function"}o.is=e;const t=Object.freeze([]);function i(){return t}o.empty=i;function*n(b){yield b}o.single=n;function s(b){return e(b)?b:n(b)}o.wrap=s;function r(b){return b||t}o.from=r;function*a(b){for(let C=b.length-1;C>=0;C--)yield b[C]}o.reverse=a;function l(b){return!b||b[Symbol.iterator]().next().done===!0}o.isEmpty=l;function d(b){return b[Symbol.iterator]().next().value}o.first=d;function c(b,C){for(const w of b)if(C(w))return!0;return!1}o.some=c;function u(b,C){for(const w of b)if(C(w))return w}o.find=u;function*h(b,C){for(const w of b)C(w)&&(yield w)}o.filter=h;function*g(b,C){let w=0;for(const S of b)yield C(S,w++)}o.map=g;function*f(...b){for(const C of b)yield*C}o.concat=f;function m(b,C,w){let S=w;for(const x of b)S=C(S,x);return S}o.reduce=m;function*v(b,C,w=b.length){for(C<0&&(C+=b.length),w<0?w+=b.length:w>b.length&&(w=b.length);C{n||(n=!0,this._remove(i))}}shift(){if(this._first!==cn.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==cn.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==cn.Undefined&&e.next!==cn.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===cn.Undefined&&e.next===cn.Undefined?(this._first=cn.Undefined,this._last=cn.Undefined):e.next===cn.Undefined?(this._last=this._last.prev,this._last.next=cn.Undefined):e.prev===cn.Undefined&&(this._first=this._first.next,this._first.prev=cn.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==cn.Undefined;)yield e.element,e=e.next}}const q9="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function xG(o=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of q9)o.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const J2=xG();function eM(o){let e=J2;if(o&&o instanceof RegExp)if(o.global)e=o;else{let t="g";o.ignoreCase&&(t+="i"),o.multiline&&(t+="m"),o.unicode&&(t+="u"),e=new RegExp(o.source,t)}return e.lastIndex=0,e}const G9=new Ns;G9.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function vv(o,e,t,i,n){if(e=eM(e),n||(n=wt.first(G9)),t.length>n.maxLen){let d=o-n.maxLen/2;return d<0?d=0:i+=d,t=t.substring(d,o+n.maxLen/2),vv(o,e,t,i,n)}const s=Date.now(),r=o-1-i;let a=-1,l=null;for(let d=1;!(Date.now()-s>=n.timeBudget);d++){const c=r-n.windowSize*d;e.lastIndex=Math.max(0,c);const u=kG(e,t,r,a);if(!u&&l||(l=u,c<=0))break;a=c}if(l){const d={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,d}return null}function kG(o,e,t,i){let n;for(;n=o.exec(e);){const s=n.index||0;if(s<=t&&o.lastIndex>=t)return n;if(i>0&&s>i)return null}return null}const lc=8;class Z9{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class Y9{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Di{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return ay(e,t)}compute(e,t,i){return i}}class P_{constructor(e,t){this.newValue=e,this.didChange=t}}function ay(o,e){if(typeof o!="object"||typeof e!="object"||!o||!e)return new P_(e,o!==e);if(Array.isArray(o)||Array.isArray(e)){const i=Array.isArray(o)&&Array.isArray(e)&&Bi(o,e);return new P_(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const n=ay(o[i],e[i]);n.didChange&&(o[i]=n.newValue,t=!0)}return new P_(o,t)}class Zb{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return ay(e,t)}validate(e){return this.defaultValue}}class um{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return ay(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function Be(o,e){return typeof o>"u"?e:o==="false"?!1:!!o}class Nt extends um{constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return Be(e,this.defaultValue)}}function ah(o,e,t,i){if(typeof o>"u")return e;let n=parseInt(o,10);return isNaN(n)?e:(n=Math.max(t,n),n=Math.min(i,n),n|0)}class Jt extends um{static clampedInt(e,t,i,n){return ah(e,t,i,n)}constructor(e,t,i,n,s,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=n,r.maximum=s),super(e,t,i,r),this.minimum=n,this.maximum=s}validate(e){return Jt.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function IG(o,e,t,i){if(typeof o>"u")return e;const n=Rr.float(o,e);return Rr.clamp(n,t,i)}class Rr extends um{static clamp(e,t,i){return ei?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,n,s){typeof s<"u"&&(s.type="number",s.default=i),super(e,t,i,s),this.validationFn=n}validate(e){return this.validationFn(Rr.float(e,this.defaultValue))}}class no extends um{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return no.string(e,this.defaultValue)}}function Ki(o,e,t,i){return typeof o!="string"?e:i&&o in i?i[o]:t.indexOf(o)===-1?e:o}class ki extends um{constructor(e,t,i,n,s=void 0){typeof s<"u"&&(s.type="string",s.enum=n,s.default=i),super(e,t,i,s),this._allowedValues=n}validate(e){return Ki(e,this.defaultValue,this._allowedValues)}}class j0 extends Di{constructor(e,t,i,n,s,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=s,a.default=n),super(e,t,i,a),this._allowedValues=s,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function EG(o){switch(o){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class NG extends Di{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[p("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached."),p("accessibilitySupport.on","Optimize for usage with a Screen Reader."),p("accessibilitySupport.off","Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:p("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class TG extends Di{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:p("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:p("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:Be(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Be(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function MG(o){switch(o){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Vn;(function(o){o[o.Line=1]="Line",o[o.Block=2]="Block",o[o.Underline=3]="Underline",o[o.LineThin=4]="LineThin",o[o.BlockOutline=5]="BlockOutline",o[o.UnderlineThin=6]="UnderlineThin"})(Vn||(Vn={}));function AG(o){switch(o){case"line":return Vn.Line;case"block":return Vn.Block;case"underline":return Vn.Underline;case"line-thin":return Vn.LineThin;case"block-outline":return Vn.BlockOutline;case"underline-thin":return Vn.UnderlineThin}}class RG extends Zb{constructor(){super(140)}compute(e,t,i){const n=["monaco-editor"];return t.get(39)&&n.push(t.get(39)),e.extraEditorClassName&&n.push(e.extraEditorClassName),t.get(73)==="default"?n.push("mouse-default"):t.get(73)==="copy"&&n.push("mouse-copy"),t.get(110)&&n.push("showUnused"),t.get(138)&&n.push("showDeprecated"),n.join(" ")}}class PG extends Nt{constructor(){super(37,"emptySelectionClipboard",!0,{description:p("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class OG extends Di{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:p("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[p("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),p("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),p("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:p("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[p("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),p("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),p("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:p("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:p("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:It},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:p("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:p("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:Be(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":Ki(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":Ki(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Be(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Be(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Be(t.loop,this.defaultValue.loop)}}}class Po extends Di{constructor(){super(51,"fontLigatures",Po.OFF,{anyOf:[{type:"boolean",description:p("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:p("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:p("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?Po.OFF:e==="true"?Po.ON:e:e?Po.ON:Po.OFF}}Po.OFF='"liga" off, "calt" off';Po.ON='"liga" on, "calt" on';class _a extends Di{constructor(){super(54,"fontVariations",_a.OFF,{anyOf:[{type:"boolean",description:p("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:p("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:p("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?_a.OFF:e==="true"?_a.TRANSLATE:e:e?_a.TRANSLATE:_a.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}_a.OFF="normal";_a.TRANSLATE="translate";class FG extends Zb{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class BG extends um{constructor(){super(52,"fontSize",co.fontSize,{type:"number",minimum:6,maximum:100,default:co.fontSize,description:p("fontSize","Controls the font size in pixels.")})}validate(e){const t=Rr.float(e,this.defaultValue);return t===0?co.fontSize:Rr.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class ol extends Di{constructor(){super(53,"fontWeight",co.fontWeight,{anyOf:[{type:"number",minimum:ol.MINIMUM_VALUE,maximum:ol.MAXIMUM_VALUE,errorMessage:p("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:ol.SUGGESTION_VALUES}],default:co.fontWeight,description:p("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(Jt.clampedInt(e,co.fontWeight,ol.MINIMUM_VALUE,ol.MAXIMUM_VALUE))}}ol.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];ol.MINIMUM_VALUE=1;ol.MAXIMUM_VALUE=1e3;class WG extends Di{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[p("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),p("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),p("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:p("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:p("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:p("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:p("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:p("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:p("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:p("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:p("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:p("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:p("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:p("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,n,s,r;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:Ki(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:Ki(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:Ki(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(n=a.multipleDeclarations)!==null&&n!==void 0?n:Ki(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(s=a.multipleImplementations)!==null&&s!==void 0?s:Ki(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(r=a.multipleReferences)!==null&&r!==void 0?r:Ki(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:no.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:no.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:no.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:no.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:no.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class VG extends Di{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:p("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:p("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:p("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:p("hover.hidingDelay","Controls the delay in milliseconds after which the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:p("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Be(t.enabled,this.defaultValue.enabled),delay:Jt.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Be(t.sticky,this.defaultValue.sticky),hidingDelay:Jt.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Be(t.above,this.defaultValue.above)}}}class Zf extends Zb{constructor(){super(143)}compute(e,t,i){return Zf.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let n=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(n=Math.max(n,t-1));const s=(i+e.viewLineCount+n)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/s);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:s,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,s=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(s*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.paddingTop===r.paddingTop&&e.paddingBottom===r.paddingBottom&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,d=e.typicalHalfwidthCharacterWidth,c=e.scrollBeyondLastLine,u=e.minimap.renderCharacters;let h=s>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const g=e.minimap.maxColumn,f=e.minimap.size,m=e.minimap.side,v=e.verticalScrollbarWidth,_=e.viewLineCount,b=e.remainingWidth,C=e.isViewportWrapping,w=u?2:3;let S=Math.floor(s*n);const x=S/s;let y=!1,I=!1,E=w*h,R=h/s,j=1;if(f==="fill"||f==="fit"){const{typicalViewportLineCount:se,extraLinesBeforeFirstLine:V,extraLinesBeyondLastLine:Q,desiredRatio:H,minimapLineCount:G}=Zf.computeContainedMinimapLineCount({viewLineCount:_,scrollBeyondLastLine:c,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:n,lineHeight:l,pixelRatio:s});if(_/G>1)y=!0,I=!0,h=1,E=1,R=h/s;else{let $e=!1,ft=h+1;if(f==="fit"){const Bt=Math.ceil((V+_+Q)*E);C&&a&&b<=t.stableFitRemainingWidth?($e=!0,ft=t.stableFitMaxMinimapScale):$e=Bt>S}if(f==="fill"||$e){y=!0;const Bt=h;E=Math.min(l*s,Math.max(1,Math.floor(1/H))),C&&a&&b<=t.stableFitRemainingWidth&&(ft=t.stableFitMaxMinimapScale),h=Math.min(ft,Math.max(1,Math.floor(E/w))),h>Bt&&(j=Math.min(2,h/Bt)),R=h/s/j,S=Math.ceil(Math.max(se,V+_+Q)*E),C?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const O=Math.floor(g*R),$=Math.min(O,Math.max(0,Math.floor((b-v-2)*R/(d+R)))+lc);let K=Math.floor(s*$);const oe=K/s;K=Math.floor(K*j);const Le=u?1:2,he=m==="left"?0:i-$-v;return{renderMinimap:Le,minimapLeft:he,minimapWidth:$,minimapHeightIsEditorHeight:y,minimapIsSampling:I,minimapScale:h,minimapLineHeight:E,minimapCanvasInnerWidth:K,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:oe,minimapCanvasOuterHeight:x}}static computeLayout(e,t){const i=t.outerWidth|0,n=t.outerHeight|0,s=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,d=t.pixelRatio,c=t.viewLineCount,u=e.get(135),h=u==="inherit"?e.get(134):u,g=h==="inherit"?e.get(130):h,f=e.get(133),m=t.isDominatedByLongLines,v=e.get(57),_=e.get(67).renderType!==0,b=e.get(68),C=e.get(104),w=e.get(83),S=e.get(72),x=e.get(102),y=x.verticalScrollbarSize,I=x.verticalHasArrows,E=x.arrowSize,R=x.horizontalScrollbarSize,j=e.get(43),O=e.get(109)!=="never";let $=e.get(65);j&&O&&($+=16);let K=0;if(_){const re=Math.max(r,b);K=Math.round(re*l)}let oe=0;v&&(oe=s*t.glyphMarginDecorationLaneCount);let Le=0,he=Le+oe,se=he+K,V=se+$;const Q=i-oe-K-$;let H=!1,G=!1,Z=-1;h==="inherit"&&m?(H=!0,G=!0):g==="on"||g==="bounded"?G=!0:g==="wordWrapColumn"&&(Z=f);const $e=Zf._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:s,typicalHalfwidthCharacterWidth:a,pixelRatio:d,scrollBeyondLastLine:C,paddingTop:w.top,paddingBottom:w.bottom,minimap:S,verticalScrollbarWidth:y,viewLineCount:c,remainingWidth:Q,isViewportWrapping:G},t.memory||new Y9);$e.renderMinimap!==0&&$e.minimapLeft===0&&(Le+=$e.minimapWidth,he+=$e.minimapWidth,se+=$e.minimapWidth,V+=$e.minimapWidth);const ft=Q-$e.minimapWidth,Bt=Math.max(1,Math.floor((ft-y-2)/a)),Ce=I?E:0;return G&&(Z=Math.max(1,Bt),g==="bounded"&&(Z=Math.min(Z,f))),{width:i,height:n,glyphMarginLeft:Le,glyphMarginWidth:oe,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:he,lineNumbersWidth:K,decorationsLeft:se,decorationsWidth:$,contentLeft:V,contentWidth:ft,minimap:$e,viewportColumn:Bt,isWordWrapMinified:H,isViewportWrapping:G,wrappingColumn:Z,verticalScrollbarWidth:y,horizontalScrollbarHeight:R,overviewRuler:{top:Ce,width:y,height:n-2*Ce,right:0}}}}class HG extends Di{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[p("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),p("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:p("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return Ki(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}var so;(function(o){o.Off="off",o.OnCode="onCode",o.On="on"})(so||(so={}));class zG extends Di{constructor(){const e={enabled:!0,experimental:{showAiIcon:so.Off}};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:p("codeActions","Enables the Code Action lightbulb in the editor.")},"editor.lightbulb.experimental.showAiIcon":{type:"string",enum:[so.Off,so.OnCode,so.On],default:e.experimental.showAiIcon,enumDescriptions:[p("editor.lightbulb.showAiIcon.off","Don not show the AI icon."),p("editor.lightbulb.showAiIcon.onCode","Show an AI icon when the code action menu contains an AI action, but only on code."),p("editor.lightbulb.showAiIcon.on","Show an AI icon when the code action menu contains an AI action, on code and empty lines.")],description:p("showAiIcons","Show an AI icon along with the lightbulb when the code action menu contains an AI action.")}})}validate(e){var t,i;if(!e||typeof e!="object")return this.defaultValue;const n=e;return{enabled:Be(n.enabled,this.defaultValue.enabled),experimental:{showAiIcon:Ki((t=n.experimental)===null||t===void 0?void 0:t.showAiIcon,(i=this.defaultValue.experimental)===null||i===void 0?void 0:i.showAiIcon,[so.Off,so.OnCode,so.On])}}}}class $G extends Di{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:p("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:10,description:p("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:p("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:p("editor.stickyScroll.scrollWithEditor","Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Be(t.enabled,this.defaultValue.enabled),maxLineCount:Jt.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:Ki(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:Be(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class UG extends Di{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:p("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[p("editor.inlayHints.on","Inlay hints are enabled"),p("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",It?"Ctrl+Option":"Ctrl+Alt"),p("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",It?"Ctrl+Option":"Ctrl+Alt"),p("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:p("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:p("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:p("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:Ki(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:Jt.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:no.string(t.fontFamily,this.defaultValue.fontFamily),padding:Be(t.padding,this.defaultValue.padding)}}}class jG extends Di{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):Jt.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?Jt.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class KG extends Rr{constructor(){super(66,"lineHeight",co.lineHeight,e=>Rr.clamp(e,0,150),{markdownDescription:p("lineHeight",`Controls the line height. - Use 0 to automatically compute the line height from the font size. - Values between 0 and 8 will be used as a multiplier with the font size. - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class qG extends Di{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(72,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:p("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:p("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[p("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),p("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),p("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:p("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:p("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:p("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:p("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:p("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:p("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Be(t.enabled,this.defaultValue.enabled),autohide:Be(t.autohide,this.defaultValue.autohide),size:Ki(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Ki(t.side,this.defaultValue.side,["right","left"]),showSlider:Ki(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:Be(t.renderCharacters,this.defaultValue.renderCharacters),scale:Jt.clampedInt(t.scale,1,1,3),maxColumn:Jt.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function GG(o){return o==="ctrlCmd"?It?"metaKey":"ctrlKey":"altKey"}class ZG extends Di{constructor(){super(83,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:p("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:p("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:Jt.clampedInt(t.top,0,0,1e3),bottom:Jt.clampedInt(t.bottom,0,0,1e3)}}}class YG extends Di{constructor(){const e={enabled:!0,cycle:!0};super(85,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:p("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:p("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Be(t.enabled,this.defaultValue.enabled),cycle:Be(t.cycle,this.defaultValue.cycle)}}}class XG extends Zb{constructor(){super(141)}compute(e,t,i){return e.pixelRatio}}class QG extends Di{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[p("on","Quick suggestions show inside the suggest widget"),p("inline","Quick suggestions show as ghost text"),p("off","Quick suggestions are disabled")]}];super(88,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:p("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:p("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:p("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:p("quickSuggestions","Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.","#editor.suggestOnTriggerCharacters#")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const d=e?"on":"off";return{comments:d,strings:d,other:d}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:i,strings:n}=e,s=["on","inline","off"];let r,a,l;return typeof t=="boolean"?r=t?"on":"off":r=Ki(t,this.defaultValue.other,s),typeof i=="boolean"?a=i?"on":"off":a=Ki(i,this.defaultValue.comments,s),typeof n=="boolean"?l=n?"on":"off":l=Ki(n,this.defaultValue.strings,s),{other:r,comments:a,strings:l}}}class JG extends Di{constructor(){super(67,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[p("lineNumbers.off","Line numbers are not rendered."),p("lineNumbers.on","Line numbers are rendered as absolute number."),p("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),p("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:p("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,i=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:i}}}function tw(o){const e=o.get(97);return e==="editable"?o.get(90):e!=="on"}class eZ extends Di{constructor(){const e=[],t={type:"number",description:p("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(101,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:p("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:p("rulers","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="number")t.push({column:Jt.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const n=i;t.push({column:Jt.clampedInt(n.column,0,0,1e4),color:n.color})}return t.sort((i,n)=>i.column-n.column),t}return this.defaultValue}}class tZ extends Di{constructor(){super(91,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function PP(o,e){if(typeof o!="string")return e;switch(o){case"hidden":return 2;case"visible":return 3;default:return 1}}let iZ=class extends Di{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(102,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[p("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),p("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),p("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:p("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[p("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),p("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),p("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:p("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:p("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:p("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:p("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:p("scrollbar.ignoreHorizontalScrollbarInContentHeight","When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=Jt.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=Jt.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:Jt.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:PP(t.vertical,this.defaultValue.vertical),horizontal:PP(t.horizontal,this.defaultValue.horizontal),useShadows:Be(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:Be(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:Be(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:Be(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:Be(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:Jt.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:Jt.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:Be(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:Be(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const Io="inUntrustedWorkspace",Us={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"};class nZ extends Di{constructor(){const e={nonBasicASCII:Io,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Io,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[Us.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Io],default:e.nonBasicASCII,description:p("unicodeHighlight.nonBasicASCII","Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[Us.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:p("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[Us.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:p("unicodeHighlight.ambiguousCharacters","Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[Us.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Io],default:e.includeComments,description:p("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[Us.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Io],default:e.includeStrings,description:p("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[Us.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:p("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Us.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:p("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(Uo(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(Uo(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));const n=super.applyUpdate(e,t);return i?new P_(n.newValue,!0):n}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:Yf(t.nonBasicASCII,Io,[!0,!1,Io]),invisibleCharacters:Be(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:Be(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:Yf(t.includeComments,Io,[!0,!1,Io]),includeStrings:Yf(t.includeStrings,Io,[!0,!1,Io]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const i={};for(const[n,s]of Object.entries(e))s===!0&&(i[n]=!0);return i}}class sZ extends Di{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:p("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[p("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),p("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion."),p("inlineSuggest.showToolbar.never","Never show the inline suggestion toolbar.")],description:p("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:p("inlineSuggest.suppressSuggestions","Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Be(t.enabled,this.defaultValue.enabled),mode:Ki(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:Ki(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:Be(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:Be(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class oZ extends Di{constructor(){const e={enabled:rs.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:rs.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:p("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:p("bracketPairColorization.independentColorPoolPerBracketType","Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Be(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:Be(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class rZ extends Di{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[p("editor.guides.bracketPairs.true","Enables bracket pair guides."),p("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),p("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:p("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[p("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),p("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),p("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:p("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:p("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:p("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[p("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),p("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),p("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:p("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:Yf(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:Yf(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:Be(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:Be(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:Yf(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function Yf(o,e,t){const i=t.indexOf(o);return i===-1?e:t[i]}class aZ extends Di{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(117,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[p("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),p("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:p("suggest.insertMode","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:p("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:p("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:p("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[p("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),p("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),p("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),p("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:p("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:p("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:p("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:p("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:p("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:p("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:p("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:p("deprecated","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.matchOnWordStartOnly","When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:Ki(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:Be(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:Be(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:Be(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:Be(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:Ki(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:Be(t.showIcons,this.defaultValue.showIcons),showStatusBar:Be(t.showStatusBar,this.defaultValue.showStatusBar),preview:Be(t.preview,this.defaultValue.preview),previewMode:Ki(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:Be(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:Be(t.showMethods,this.defaultValue.showMethods),showFunctions:Be(t.showFunctions,this.defaultValue.showFunctions),showConstructors:Be(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:Be(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:Be(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:Be(t.showFields,this.defaultValue.showFields),showVariables:Be(t.showVariables,this.defaultValue.showVariables),showClasses:Be(t.showClasses,this.defaultValue.showClasses),showStructs:Be(t.showStructs,this.defaultValue.showStructs),showInterfaces:Be(t.showInterfaces,this.defaultValue.showInterfaces),showModules:Be(t.showModules,this.defaultValue.showModules),showProperties:Be(t.showProperties,this.defaultValue.showProperties),showEvents:Be(t.showEvents,this.defaultValue.showEvents),showOperators:Be(t.showOperators,this.defaultValue.showOperators),showUnits:Be(t.showUnits,this.defaultValue.showUnits),showValues:Be(t.showValues,this.defaultValue.showValues),showConstants:Be(t.showConstants,this.defaultValue.showConstants),showEnums:Be(t.showEnums,this.defaultValue.showEnums),showEnumMembers:Be(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:Be(t.showKeywords,this.defaultValue.showKeywords),showWords:Be(t.showWords,this.defaultValue.showWords),showColors:Be(t.showColors,this.defaultValue.showColors),showFiles:Be(t.showFiles,this.defaultValue.showFiles),showReferences:Be(t.showReferences,this.defaultValue.showReferences),showFolders:Be(t.showFolders,this.defaultValue.showFolders),showTypeParameters:Be(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:Be(t.showSnippets,this.defaultValue.showSnippets),showUsers:Be(t.showUsers,this.defaultValue.showUsers),showIssues:Be(t.showIssues,this.defaultValue.showIssues)}}}class lZ extends Di{constructor(){super(112,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:p("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:p("selectSubwords","Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:Be(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:Be(e.selectSubwords,this.defaultValue.selectSubwords)}}}class dZ extends Di{constructor(){super(136,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[p("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),p("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),p("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),p("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:p("wrappingIndent","Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return t.get(2)===2?0:i}}class cZ extends Zb{constructor(){super(144)}compute(e,t,i){const n=t.get(143);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}class uZ extends Di{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:p("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down `Shift`-key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:p("dropIntoEditor.showDropSelector","Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[p("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),p("dropIntoEditor.showDropSelector.never","Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Be(t.enabled,this.defaultValue.enabled),showDropSelector:Ki(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class hZ extends Di{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(84,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:p("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:p("pasteAs.showPasteSelector","Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[p("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),p("pasteAs.showPasteSelector.never","Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Be(t.enabled,this.defaultValue.enabled),showPasteSelector:Ki(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const gZ="Consolas, 'Courier New', monospace",fZ="Menlo, Monaco, 'Courier New', monospace",pZ="'Droid Sans Mono', 'monospace', monospace",co={fontFamily:It?fZ:ws?pZ:gZ,fontWeight:"normal",fontSize:It?12:14,lineHeight:0,letterSpacing:0},Sf=[];function me(o){return Sf[o.id]=o,o}const Oa={acceptSuggestionOnCommitCharacter:me(new Nt(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:p("acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:me(new ki(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",p("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:p("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:me(new NG),accessibilityPageSize:me(new Jt(3,"accessibilityPageSize",10,1,1073741824,{description:p("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),ariaLabel:me(new no(4,"ariaLabel",p("editorViewAccessibleLabel","Editor content"))),ariaRequired:me(new Nt(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:me(new Nt(8,"screenReaderAnnounceInlineSuggestion",!0,{description:p("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:me(new ki(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",p("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),p("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:p("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:me(new ki(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",p("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),p("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:p("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:me(new ki(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",p("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:p("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:me(new ki(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",p("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:p("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:me(new ki(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",p("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),p("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:p("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:me(new j0(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],EG,{enumDescriptions:[p("editor.autoIndent.none","The editor will not insert indentation automatically."),p("editor.autoIndent.keep","The editor will keep the current line's indentation."),p("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),p("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),p("editor.autoIndent.full","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:p("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:me(new Nt(13,"automaticLayout",!1)),autoSurround:me(new ki(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[p("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),p("editor.autoSurround.quotes","Surround with quotes but not brackets."),p("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:p("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:me(new oZ),bracketPairGuides:me(new rZ),stickyTabStops:me(new Nt(115,"stickyTabStops",!1,{description:p("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:me(new Nt(17,"codeLens",!0,{description:p("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:me(new no(18,"codeLensFontFamily","",{description:p("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:me(new Jt(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:p("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:me(new Nt(20,"colorDecorators",!0,{description:p("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:me(new ki(146,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[p("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),p("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),p("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:p("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:me(new Jt(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:p("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:me(new Nt(22,"columnSelection",!1,{description:p("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:me(new TG),contextmenu:me(new Nt(24,"contextmenu",!0)),copyWithSyntaxHighlighting:me(new Nt(25,"copyWithSyntaxHighlighting",!0,{description:p("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:me(new j0(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],MG,{description:p("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:me(new ki(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[p("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),p("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),p("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:p("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:me(new j0(28,"cursorStyle",Vn.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],AG,{description:p("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:me(new Jt(29,"cursorSurroundingLines",0,0,1073741824,{description:p("cursorSurroundingLines","Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:me(new ki(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[p("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),p("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:p("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:me(new Jt(31,"cursorWidth",0,0,1073741824,{markdownDescription:p("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:me(new Nt(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:me(new Nt(33,"disableMonospaceOptimizations",!1)),domReadOnly:me(new Nt(34,"domReadOnly",!1)),dragAndDrop:me(new Nt(35,"dragAndDrop",!0,{description:p("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:me(new PG),dropIntoEditor:me(new uZ),stickyScroll:me(new $G),experimentalWhitespaceRendering:me(new ki(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[p("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),p("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),p("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:p("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:me(new no(39,"extraEditorClassName","")),fastScrollSensitivity:me(new Rr(40,"fastScrollSensitivity",5,o=>o<=0?5:o,{markdownDescription:p("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:me(new OG),fixedOverflowWidgets:me(new Nt(42,"fixedOverflowWidgets",!1)),folding:me(new Nt(43,"folding",!0,{description:p("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:me(new ki(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[p("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),p("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:p("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:me(new Nt(45,"foldingHighlight",!0,{description:p("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:me(new Nt(46,"foldingImportsByDefault",!1,{description:p("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:me(new Jt(47,"foldingMaximumRegions",5e3,10,65e3,{description:p("foldingMaximumRegions","The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:me(new Nt(48,"unfoldOnClickAfterEndOfLine",!1,{description:p("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:me(new no(49,"fontFamily",co.fontFamily,{description:p("fontFamily","Controls the font family.")})),fontInfo:me(new FG),fontLigatures2:me(new Po),fontSize:me(new BG),fontWeight:me(new ol),fontVariations:me(new _a),formatOnPaste:me(new Nt(55,"formatOnPaste",!1,{description:p("formatOnPaste","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:me(new Nt(56,"formatOnType",!1,{description:p("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:me(new Nt(57,"glyphMargin",!0,{description:p("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:me(new WG),hideCursorInOverviewRuler:me(new Nt(59,"hideCursorInOverviewRuler",!1,{description:p("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:me(new VG),inDiffEditor:me(new Nt(61,"inDiffEditor",!1)),letterSpacing:me(new Rr(63,"letterSpacing",co.letterSpacing,o=>Rr.clamp(o,-5,20),{description:p("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:me(new zG),lineDecorationsWidth:me(new jG),lineHeight:me(new KG),lineNumbers:me(new JG),lineNumbersMinChars:me(new Jt(68,"lineNumbersMinChars",5,1,300)),linkedEditing:me(new Nt(69,"linkedEditing",!1,{description:p("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:me(new Nt(70,"links",!0,{description:p("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:me(new ki(71,"matchBrackets","always",["always","near","never"],{description:p("matchBrackets","Highlight matching brackets.")})),minimap:me(new qG),mouseStyle:me(new ki(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:me(new Rr(74,"mouseWheelScrollSensitivity",1,o=>o===0?1:o,{markdownDescription:p("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:me(new Nt(75,"mouseWheelZoom",!1,{markdownDescription:p("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:me(new Nt(76,"multiCursorMergeOverlapping",!0,{description:p("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:me(new j0(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],GG,{markdownEnumDescriptions:[p("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),p("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:p({},"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:me(new ki(78,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[p("multiCursorPaste.spread","Each cursor pastes a single line of the text."),p("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:p("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:me(new Jt(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:p("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:me(new ki(80,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[p("occurrencesHighlight.off","Does not highlight occurrences."),p("occurrencesHighlight.singleFile","Highlights occurrences only in the current file."),p("occurrencesHighlight.multiFile","Experimental: Highlights occurrences across all valid open files.")],markdownDescription:p("occurrencesHighlight","Controls whether occurrences should be highlighted across open files.")})),overviewRulerBorder:me(new Nt(81,"overviewRulerBorder",!0,{description:p("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:me(new Jt(82,"overviewRulerLanes",3,0,3)),padding:me(new ZG),pasteAs:me(new hZ),parameterHints:me(new YG),peekWidgetDefaultFocus:me(new ki(86,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[p("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),p("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:p("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:me(new Nt(87,"definitionLinkOpensInPeek",!1,{description:p("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:me(new QG),quickSuggestionsDelay:me(new Jt(89,"quickSuggestionsDelay",10,0,1073741824,{description:p("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:me(new Nt(90,"readOnly",!1)),readOnlyMessage:me(new tZ),renameOnType:me(new Nt(92,"renameOnType",!1,{description:p("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:p("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:me(new Nt(93,"renderControlCharacters",!0,{description:p("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:me(new ki(94,"renderFinalNewline",ws?"dimmed":"on",["off","on","dimmed"],{description:p("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:me(new ki(95,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",p("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:p("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:me(new Nt(96,"renderLineHighlightOnlyWhenFocus",!1,{description:p("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:me(new ki(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:me(new ki(98,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",p("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),p("renderWhitespace.selection","Render whitespace characters only on selected text."),p("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:p("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:me(new Jt(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:me(new Nt(100,"roundedSelection",!0,{description:p("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:me(new eZ),scrollbar:me(new iZ),scrollBeyondLastColumn:me(new Jt(103,"scrollBeyondLastColumn",4,0,1073741824,{description:p("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:me(new Nt(104,"scrollBeyondLastLine",!0,{description:p("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:me(new Nt(105,"scrollPredominantAxis",!0,{description:p("scrollPredominantAxis","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:me(new Nt(106,"selectionClipboard",!0,{description:p("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:ws})),selectionHighlight:me(new Nt(107,"selectionHighlight",!0,{description:p("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:me(new Nt(108,"selectOnLineNumbers",!0)),showFoldingControls:me(new ki(109,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[p("showFoldingControls.always","Always show the folding controls."),p("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),p("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:p("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:me(new Nt(110,"showUnused",!0,{description:p("showUnused","Controls fading out of unused code.")})),showDeprecated:me(new Nt(138,"showDeprecated",!0,{description:p("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:me(new UG),snippetSuggestions:me(new ki(111,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[p("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),p("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),p("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),p("snippetSuggestions.none","Do not show snippet suggestions.")],description:p("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:me(new lZ),smoothScrolling:me(new Nt(113,"smoothScrolling",!1,{description:p("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:me(new Jt(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:me(new aZ),inlineSuggest:me(new sZ),inlineCompletionsAccessibilityVerbose:me(new Nt(147,"inlineCompletionsAccessibilityVerbose",!1,{description:p("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:me(new Jt(118,"suggestFontSize",0,0,1e3,{markdownDescription:p("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:me(new Jt(119,"suggestLineHeight",0,0,1e3,{markdownDescription:p("suggestLineHeight","Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:me(new Nt(120,"suggestOnTriggerCharacters",!0,{description:p("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:me(new ki(121,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[p("suggestSelection.first","Always select the first suggestion."),p("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),p("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:p("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:me(new ki(122,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[p("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),p("tabCompletion.off","Disable tab completions."),p("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:p("tabCompletion","Enables tab completions.")})),tabIndex:me(new Jt(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:me(new nZ),unusualLineTerminators:me(new ki(125,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[p("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),p("unusualLineTerminators.off","Unusual line terminators are ignored."),p("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:p("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:me(new Nt(126,"useShadowDOM",!0)),useTabStops:me(new Nt(127,"useTabStops",!0,{description:p("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:me(new ki(128,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[p("wordBreak.normal","Use the default line break rule."),p("wordBreak.keepAll","Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:p("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:me(new no(129,"wordSeparators",q9,{description:p("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:me(new ki(130,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[p("wordWrap.off","Lines will never wrap."),p("wordWrap.on","Lines will wrap at the viewport width."),p({},"Lines will wrap at `#editor.wordWrapColumn#`."),p({},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:p({},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:me(new no(131,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:me(new no(132,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:me(new Jt(133,"wordWrapColumn",80,1,1073741824,{markdownDescription:p({},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:me(new ki(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:me(new ki(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:me(new RG),defaultColorDecorators:me(new Nt(145,"defaultColorDecorators",!1,{markdownDescription:p("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:me(new XG),tabFocusMode:me(new Nt(142,"tabFocusMode",!1,{markdownDescription:p("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:me(new Zf),wrappingInfo:me(new cZ),wrappingIndent:me(new dZ),wrappingStrategy:me(new HG)};class mZ{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Sp.isErrorNoTelemetry(e)?new Sp(e.message+` @@ -639,27 +639,27 @@ ${e.toString()}`}}class bS{constructor(e=new h0,t=!1,i,n=pge){var s;this._servic * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var Wme=Object.defineProperty,Vme=Object.getOwnPropertyDescriptor,Hme=Object.getOwnPropertyNames,zme=Object.prototype.hasOwnProperty,$me=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Hme(e))!zme.call(o,n)&&n!==t&&Wme(o,n,{get:()=>e[n],enumerable:!(i=Vme(e,n))||i.enumerable});return o},Ume=(o,e,t)=>($me(o,e,"default"),t),I_={};Ume(I_,k0);var TW={},tk={},MW=class{constructor(o){ri(this,"_languageId");ri(this,"_loadingTriggered");ri(this,"_lazyLoadPromise");ri(this,"_lazyLoadPromiseResolve");ri(this,"_lazyLoadPromiseReject");this._languageId=o,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}static getOrCreate(o){return tk[o]||(tk[o]=new MW(o)),tk[o]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,TW[this._languageId].loader().then(o=>this._lazyLoadPromiseResolve(o),o=>this._lazyLoadPromiseReject(o))),this._lazyLoadPromise}};function Ve(o){const e=o.id;TW[e]=o,I_.languages.register(o);const t=MW.getOrCreate(e);I_.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),I_.languages.onLanguageEncountered(e,async()=>{const i=await t.load();I_.languages.setLanguageConfiguration(e,i.conf)})}Ve({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>Oe(()=>import("./abap-HeDQy6fh.js"),[])});Ve({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>Oe(()=>import("./apex-CbmXAvAW.js"),[])});Ve({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>Oe(()=>import("./azcli-BPy9tPO_.js"),[])});Ve({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>Oe(()=>import("./bat-C2kkMZXD.js"),[])});Ve({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>Oe(()=>import("./bicep-STK2XETz.js"),[])});Ve({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>Oe(()=>import("./cameligo-D88lnp7m.js"),[])});Ve({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>Oe(()=>import("./clojure-BVXjUq6W.js"),[])});Ve({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>Oe(()=>import("./coffee-BRG4GrUX.js"),[])});Ve({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>Oe(()=>import("./cpp-DeB58NaV.js"),[])});Ve({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>Oe(()=>import("./cpp-DeB58NaV.js"),[])});Ve({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>Oe(()=>import("./csharp-DWSjX1vK.js"),[])});Ve({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>Oe(()=>import("./csp-C2dP3GFv.js"),[])});Ve({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>Oe(()=>import("./css-1NjUY7wv.js"),[])});Ve({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>Oe(()=>import("./cypher-CvujjWtm.js"),[])});Ve({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>Oe(()=>import("./dart-BE_rHeGz.js"),[])});Ve({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>Oe(()=>import("./dockerfile-DU9BjHlP.js"),[])});Ve({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>Oe(()=>import("./ecl-hUW-QHbE.js"),[])});Ve({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>Oe(()=>import("./elixir-BAkJxX25.js"),[])});Ve({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>Oe(()=>import("./flow9-C5jFnEuB.js"),[])});Ve({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>Oe(()=>import("./fsharp-CCzPE5Ie.js"),[])});Ve({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Oe(()=>import("./freemarker2-D-w9PHYx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAutoInterpolationDollar)});Ve({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>Oe(()=>import("./freemarker2-D-w9PHYx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAngleInterpolationDollar)});Ve({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>Oe(()=>import("./freemarker2-D-w9PHYx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagBracketInterpolationDollar)});Ve({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>Oe(()=>import("./freemarker2-D-w9PHYx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAngleInterpolationBracket)});Ve({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>Oe(()=>import("./freemarker2-D-w9PHYx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagBracketInterpolationBracket)});Ve({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>Oe(()=>import("./freemarker2-D-w9PHYx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAutoInterpolationDollar)});Ve({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>Oe(()=>import("./freemarker2-D-w9PHYx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAutoInterpolationBracket)});Ve({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>Oe(()=>import("./go-BJDrqb1l.js"),[])});Ve({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>Oe(()=>import("./graphql-DeqjH8oo.js"),[])});Ve({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Oe(()=>import("./handlebars-CU3IGK7R.js"),__vite__mapDeps([9,1,2,3,4,5,6,7,8]))});Ve({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>Oe(()=>import("./hcl-fhYSe8Ik.js"),[])});Ve({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>Oe(()=>import("./html-DM9_zIre.js"),__vite__mapDeps([10,1,2,3,4,5,6,7,8]))});Ve({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>Oe(()=>import("./ini-bfKW7yAs.js"),[])});Ve({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>Oe(()=>import("./java-89tSEgoR.js"),[])});Ve({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Oe(()=>import("./javascript-DNnN4kEa.js"),__vite__mapDeps([11,12,1,2,3,4,5,6,7,8]))});Ve({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>Oe(()=>import("./julia-CULLjdBi.js"),[])});Ve({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>Oe(()=>import("./kotlin-bF-WLz8W.js"),[])});Ve({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>Oe(()=>import("./less-BcX_owYs.js"),[])});Ve({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>Oe(()=>import("./lexon-Bgb1VazO.js"),[])});Ve({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>Oe(()=>import("./lua-D4wIloCQ.js"),[])});Ve({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Oe(()=>import("./liquid-B5j_7Uvh.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8]))});Ve({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>Oe(()=>import("./m3-CIXVZ5K0.js"),[])});Ve({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>Oe(()=>import("./markdown-C2pIiAgT.js"),[])});Ve({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>Oe(()=>import("./mdx-CDRD_3NO.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8]))});Ve({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>Oe(()=>import("./mips-DDY3B9Me.js"),[])});Ve({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>Oe(()=>import("./msdax-BVGHujNV.js"),[])});Ve({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>Oe(()=>import("./mysql-wocE9kcw.js"),[])});Ve({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>Oe(()=>import("./objective-c-B7y1xvNi.js"),[])});Ve({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>Oe(()=>import("./pascal-6_Qmrcj5.js"),[])});Ve({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>Oe(()=>import("./pascaligo-Y4zGRFv3.js"),[])});Ve({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>Oe(()=>import("./perl-BvZxJ37z.js"),[])});Ve({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>Oe(()=>import("./pgsql-CHFmffvM.js"),[])});Ve({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>Oe(()=>import("./php-BIcBwoxY.js"),[])});Ve({id:"pla",extensions:[".pla"],loader:()=>Oe(()=>import("./pla-CjQQiOJm.js"),[])});Ve({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>Oe(()=>import("./postiats-B_GcsHt8.js"),[])});Ve({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>Oe(()=>import("./powerquery-y2EyZOlv.js"),[])});Ve({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>Oe(()=>import("./powershell-CIHf91ML.js"),[])});Ve({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>Oe(()=>import("./protobuf-COTbE6tN.js"),[])});Ve({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>Oe(()=>import("./pug-CIrW4JuG.js"),[])});Ve({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Oe(()=>import("./python-CM3gi6vP.js"),__vite__mapDeps([15,1,2,3,4,5,6,7,8]))});Ve({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>Oe(()=>import("./qsharp-BCyDeG3W.js"),[])});Ve({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>Oe(()=>import("./r-D_s1dKTl.js"),[])});Ve({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Oe(()=>import("./razor-Bu5fGBlQ.js"),__vite__mapDeps([16,1,2,3,4,5,6,7,8]))});Ve({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>Oe(()=>import("./redis-we8ROkDz.js"),[])});Ve({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>Oe(()=>import("./redshift-DQMg6JSq.js"),[])});Ve({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>Oe(()=>import("./restructuredtext-DoYentzJ.js"),[])});Ve({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>Oe(()=>import("./ruby-hSrJXfwP.js"),[])});Ve({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>Oe(()=>import("./rust-D5UdS7wL.js"),[])});Ve({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>Oe(()=>import("./sb-Bn2Vf2CV.js"),[])});Ve({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>Oe(()=>import("./scala-D-F3YBtN.js"),[])});Ve({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>Oe(()=>import("./scheme-CLt6TZUf.js"),[])});Ve({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>Oe(()=>import("./scss-Cn8qbFRi.js"),[])});Ve({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>Oe(()=>import("./shell-Bb53obFu.js"),[])});Ve({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>Oe(()=>import("./solidity-CNXlEMqq.js"),[])});Ve({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>Oe(()=>import("./sophia-BXWm5v_b.js"),[])});Ve({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>Oe(()=>import("./sparql-C3G7U7Rs.js"),[])});Ve({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>Oe(()=>import("./sql-D_PatrnJ.js"),[])});Ve({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>Oe(()=>import("./st-Brb-FAmL.js"),[])});Ve({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>Oe(()=>import("./swift-CEFhrl9k.js"),[])});Ve({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>Oe(()=>import("./systemverilog-BJexHUqq.js"),[])});Ve({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>Oe(()=>import("./systemverilog-BJexHUqq.js"),[])});Ve({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>Oe(()=>import("./tcl-Bf9L4G3H.js"),[])});Ve({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>Oe(()=>import("./twig-DdbCxuaz.js"),[])});Ve({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Oe(()=>import("./typescript-BEZDUO2m.js"),__vite__mapDeps([12,1,2,3,4,5,6,7,8]))});Ve({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>Oe(()=>import("./vb-CzTmPDQx.js"),[])});Ve({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>Oe(()=>import("./wgsl-Bt_avhfa.js"),[])});Ve({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\Oe(()=>import("./xml-IzzTFP6G.js"),__vite__mapDeps([17,1,2,3,4,5,6,7,8]))});Ve({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Oe(()=>import("./yaml-C27Xr4Pr.js"),__vite__mapDeps([18,1,2,3,4,5,6,7,8]))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Wme=Object.defineProperty,Vme=Object.getOwnPropertyDescriptor,Hme=Object.getOwnPropertyNames,zme=Object.prototype.hasOwnProperty,$me=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Hme(e))!zme.call(o,n)&&n!==t&&Wme(o,n,{get:()=>e[n],enumerable:!(i=Vme(e,n))||i.enumerable});return o},Ume=(o,e,t)=>($me(o,e,"default"),t),I_={};Ume(I_,k0);var TW={},tk={},MW=class{constructor(o){ri(this,"_languageId");ri(this,"_loadingTriggered");ri(this,"_lazyLoadPromise");ri(this,"_lazyLoadPromiseResolve");ri(this,"_lazyLoadPromiseReject");this._languageId=o,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}static getOrCreate(o){return tk[o]||(tk[o]=new MW(o)),tk[o]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,TW[this._languageId].loader().then(o=>this._lazyLoadPromiseResolve(o),o=>this._lazyLoadPromiseReject(o))),this._lazyLoadPromise}};function Ve(o){const e=o.id;TW[e]=o,I_.languages.register(o);const t=MW.getOrCreate(e);I_.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),I_.languages.onLanguageEncountered(e,async()=>{const i=await t.load();I_.languages.setLanguageConfiguration(e,i.conf)})}Ve({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>Oe(()=>import("./abap-HeDQy6fh.js"),[])});Ve({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>Oe(()=>import("./apex-CbmXAvAW.js"),[])});Ve({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>Oe(()=>import("./azcli-BPy9tPO_.js"),[])});Ve({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>Oe(()=>import("./bat-C2kkMZXD.js"),[])});Ve({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>Oe(()=>import("./bicep-STK2XETz.js"),[])});Ve({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>Oe(()=>import("./cameligo-D88lnp7m.js"),[])});Ve({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>Oe(()=>import("./clojure-BVXjUq6W.js"),[])});Ve({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>Oe(()=>import("./coffee-BRG4GrUX.js"),[])});Ve({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>Oe(()=>import("./cpp-DeB58NaV.js"),[])});Ve({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>Oe(()=>import("./cpp-DeB58NaV.js"),[])});Ve({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>Oe(()=>import("./csharp-DWSjX1vK.js"),[])});Ve({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>Oe(()=>import("./csp-C2dP3GFv.js"),[])});Ve({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>Oe(()=>import("./css-1NjUY7wv.js"),[])});Ve({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>Oe(()=>import("./cypher-CvujjWtm.js"),[])});Ve({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>Oe(()=>import("./dart-BE_rHeGz.js"),[])});Ve({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>Oe(()=>import("./dockerfile-DU9BjHlP.js"),[])});Ve({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>Oe(()=>import("./ecl-hUW-QHbE.js"),[])});Ve({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>Oe(()=>import("./elixir-BAkJxX25.js"),[])});Ve({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>Oe(()=>import("./flow9-C5jFnEuB.js"),[])});Ve({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>Oe(()=>import("./fsharp-CCzPE5Ie.js"),[])});Ve({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Oe(()=>import("./freemarker2-CmSOYFZj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAutoInterpolationDollar)});Ve({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>Oe(()=>import("./freemarker2-CmSOYFZj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAngleInterpolationDollar)});Ve({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>Oe(()=>import("./freemarker2-CmSOYFZj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagBracketInterpolationDollar)});Ve({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>Oe(()=>import("./freemarker2-CmSOYFZj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAngleInterpolationBracket)});Ve({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>Oe(()=>import("./freemarker2-CmSOYFZj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagBracketInterpolationBracket)});Ve({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>Oe(()=>import("./freemarker2-CmSOYFZj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAutoInterpolationDollar)});Ve({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>Oe(()=>import("./freemarker2-CmSOYFZj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAutoInterpolationBracket)});Ve({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>Oe(()=>import("./go-BJDrqb1l.js"),[])});Ve({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>Oe(()=>import("./graphql-DeqjH8oo.js"),[])});Ve({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Oe(()=>import("./handlebars-BLXzbXZR.js"),__vite__mapDeps([9,1,2,3,4,5,6,7,8]))});Ve({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>Oe(()=>import("./hcl-fhYSe8Ik.js"),[])});Ve({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>Oe(()=>import("./html-DO2OTq4R.js"),__vite__mapDeps([10,1,2,3,4,5,6,7,8]))});Ve({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>Oe(()=>import("./ini-bfKW7yAs.js"),[])});Ve({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>Oe(()=>import("./java-89tSEgoR.js"),[])});Ve({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Oe(()=>import("./javascript-C0XxeR-n.js"),__vite__mapDeps([11,12,1,2,3,4,5,6,7,8]))});Ve({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>Oe(()=>import("./julia-CULLjdBi.js"),[])});Ve({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>Oe(()=>import("./kotlin-bF-WLz8W.js"),[])});Ve({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>Oe(()=>import("./less-BcX_owYs.js"),[])});Ve({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>Oe(()=>import("./lexon-Bgb1VazO.js"),[])});Ve({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>Oe(()=>import("./lua-D4wIloCQ.js"),[])});Ve({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Oe(()=>import("./liquid-BFayS-os.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8]))});Ve({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>Oe(()=>import("./m3-CIXVZ5K0.js"),[])});Ve({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>Oe(()=>import("./markdown-C2pIiAgT.js"),[])});Ve({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>Oe(()=>import("./mdx-DeQweMxo.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8]))});Ve({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>Oe(()=>import("./mips-DDY3B9Me.js"),[])});Ve({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>Oe(()=>import("./msdax-BVGHujNV.js"),[])});Ve({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>Oe(()=>import("./mysql-wocE9kcw.js"),[])});Ve({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>Oe(()=>import("./objective-c-B7y1xvNi.js"),[])});Ve({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>Oe(()=>import("./pascal-6_Qmrcj5.js"),[])});Ve({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>Oe(()=>import("./pascaligo-Y4zGRFv3.js"),[])});Ve({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>Oe(()=>import("./perl-BvZxJ37z.js"),[])});Ve({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>Oe(()=>import("./pgsql-CHFmffvM.js"),[])});Ve({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>Oe(()=>import("./php-BIcBwoxY.js"),[])});Ve({id:"pla",extensions:[".pla"],loader:()=>Oe(()=>import("./pla-CjQQiOJm.js"),[])});Ve({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>Oe(()=>import("./postiats-B_GcsHt8.js"),[])});Ve({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>Oe(()=>import("./powerquery-y2EyZOlv.js"),[])});Ve({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>Oe(()=>import("./powershell-CIHf91ML.js"),[])});Ve({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>Oe(()=>import("./protobuf-COTbE6tN.js"),[])});Ve({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>Oe(()=>import("./pug-CIrW4JuG.js"),[])});Ve({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Oe(()=>import("./python-a9hcFcOH.js"),__vite__mapDeps([15,1,2,3,4,5,6,7,8]))});Ve({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>Oe(()=>import("./qsharp-BCyDeG3W.js"),[])});Ve({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>Oe(()=>import("./r-D_s1dKTl.js"),[])});Ve({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Oe(()=>import("./razor-1sBWwWa2.js"),__vite__mapDeps([16,1,2,3,4,5,6,7,8]))});Ve({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>Oe(()=>import("./redis-we8ROkDz.js"),[])});Ve({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>Oe(()=>import("./redshift-DQMg6JSq.js"),[])});Ve({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>Oe(()=>import("./restructuredtext-DoYentzJ.js"),[])});Ve({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>Oe(()=>import("./ruby-hSrJXfwP.js"),[])});Ve({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>Oe(()=>import("./rust-D5UdS7wL.js"),[])});Ve({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>Oe(()=>import("./sb-Bn2Vf2CV.js"),[])});Ve({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>Oe(()=>import("./scala-D-F3YBtN.js"),[])});Ve({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>Oe(()=>import("./scheme-CLt6TZUf.js"),[])});Ve({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>Oe(()=>import("./scss-Cn8qbFRi.js"),[])});Ve({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>Oe(()=>import("./shell-Bb53obFu.js"),[])});Ve({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>Oe(()=>import("./solidity-CNXlEMqq.js"),[])});Ve({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>Oe(()=>import("./sophia-BXWm5v_b.js"),[])});Ve({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>Oe(()=>import("./sparql-C3G7U7Rs.js"),[])});Ve({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>Oe(()=>import("./sql-D_PatrnJ.js"),[])});Ve({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>Oe(()=>import("./st-Brb-FAmL.js"),[])});Ve({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>Oe(()=>import("./swift-CEFhrl9k.js"),[])});Ve({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>Oe(()=>import("./systemverilog-BJexHUqq.js"),[])});Ve({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>Oe(()=>import("./systemverilog-BJexHUqq.js"),[])});Ve({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>Oe(()=>import("./tcl-Bf9L4G3H.js"),[])});Ve({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>Oe(()=>import("./twig-DdbCxuaz.js"),[])});Ve({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Oe(()=>import("./typescript-Cfb9k-qV.js"),__vite__mapDeps([12,1,2,3,4,5,6,7,8]))});Ve({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>Oe(()=>import("./vb-CzTmPDQx.js"),[])});Ve({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>Oe(()=>import("./wgsl-Bt_avhfa.js"),[])});Ve({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\Oe(()=>import("./xml-CXoMhdUk.js"),__vite__mapDeps([17,1,2,3,4,5,6,7,8]))});Ve({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Oe(()=>import("./yaml-D4773nTm.js"),__vite__mapDeps([18,1,2,3,4,5,6,7,8]))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var jme=Object.defineProperty,Kme=Object.getOwnPropertyDescriptor,qme=Object.getOwnPropertyNames,Gme=Object.prototype.hasOwnProperty,Zme=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qme(e))!Gme.call(o,n)&&n!==t&&jme(o,n,{get:()=>e[n],enumerable:!(i=Kme(e,n))||i.enumerable});return o},Yme=(o,e,t)=>(Zme(o,e,"default"),t),xm={};Yme(xm,k0);var LR=class{constructor(e,t,i){ri(this,"_onDidChange",new xm.Emitter);ri(this,"_options");ri(this,"_modeConfiguration");ri(this,"_languageId");this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},DR={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},xR={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},AW=new LR("css",DR,xR),RW=new LR("scss",DR,xR),PW=new LR("less",DR,xR);xm.languages.css={cssDefaults:AW,lessDefaults:PW,scssDefaults:RW};function kR(){return Oe(()=>import("./cssMode-DM_jsbIE.js"),__vite__mapDeps([19,1,2,3,4,5,6,7,8]))}xm.languages.onLanguage("less",()=>{kR().then(o=>o.setupMode(PW))});xm.languages.onLanguage("scss",()=>{kR().then(o=>o.setupMode(RW))});xm.languages.onLanguage("css",()=>{kR().then(o=>o.setupMode(AW))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var jme=Object.defineProperty,Kme=Object.getOwnPropertyDescriptor,qme=Object.getOwnPropertyNames,Gme=Object.prototype.hasOwnProperty,Zme=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qme(e))!Gme.call(o,n)&&n!==t&&jme(o,n,{get:()=>e[n],enumerable:!(i=Kme(e,n))||i.enumerable});return o},Yme=(o,e,t)=>(Zme(o,e,"default"),t),xm={};Yme(xm,k0);var LR=class{constructor(e,t,i){ri(this,"_onDidChange",new xm.Emitter);ri(this,"_options");ri(this,"_modeConfiguration");ri(this,"_languageId");this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},DR={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},xR={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},AW=new LR("css",DR,xR),RW=new LR("scss",DR,xR),PW=new LR("less",DR,xR);xm.languages.css={cssDefaults:AW,lessDefaults:PW,scssDefaults:RW};function kR(){return Oe(()=>import("./cssMode-CAKGNCPU.js"),__vite__mapDeps([19,1,2,3,4,5,6,7,8]))}xm.languages.onLanguage("less",()=>{kR().then(o=>o.setupMode(PW))});xm.languages.onLanguage("scss",()=>{kR().then(o=>o.setupMode(RW))});xm.languages.onLanguage("css",()=>{kR().then(o=>o.setupMode(AW))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var Xme=Object.defineProperty,Qme=Object.getOwnPropertyDescriptor,Jme=Object.getOwnPropertyNames,e_e=Object.prototype.hasOwnProperty,t_e=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Jme(e))!e_e.call(o,n)&&n!==t&&Xme(o,n,{get:()=>e[n],enumerable:!(i=Qme(e,n))||i.enumerable});return o},i_e=(o,e,t)=>(t_e(o,e,"default"),t),LL={};i_e(LL,k0);var n_e=class{constructor(e,t,i){ri(this,"_onDidChange",new LL.Emitter);ri(this,"_options");ri(this,"_modeConfiguration");ri(this,"_languageId");this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},s_e={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},DL={format:s_e,suggest:{},data:{useDefaultDataProvider:!0}};function xL(o){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:o===nv,documentFormattingEdits:o===nv,documentRangeFormattingEdits:o===nv}}var nv="html",J5="handlebars",e3="razor",OW=kL(nv,DL,xL(nv)),o_e=OW.defaults,FW=kL(J5,DL,xL(J5)),r_e=FW.defaults,BW=kL(e3,DL,xL(e3)),a_e=BW.defaults;LL.languages.html={htmlDefaults:o_e,razorDefaults:a_e,handlebarDefaults:r_e,htmlLanguageService:OW,handlebarLanguageService:FW,razorLanguageService:BW,registerHTMLLanguageService:kL};function l_e(){return Oe(()=>import("./htmlMode-DVekKSY6.js"),__vite__mapDeps([20,1,2,3,4,5,6,7,8]))}function kL(o,e=DL,t=xL(o)){const i=new n_e(o,e,t);let n;const s=LL.languages.onLanguage(o,async()=>{n=(await l_e()).setupMode(i)});return{defaults:i,dispose(){s.dispose(),n==null||n.dispose(),n=void 0}}}/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Xme=Object.defineProperty,Qme=Object.getOwnPropertyDescriptor,Jme=Object.getOwnPropertyNames,e_e=Object.prototype.hasOwnProperty,t_e=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Jme(e))!e_e.call(o,n)&&n!==t&&Xme(o,n,{get:()=>e[n],enumerable:!(i=Qme(e,n))||i.enumerable});return o},i_e=(o,e,t)=>(t_e(o,e,"default"),t),LL={};i_e(LL,k0);var n_e=class{constructor(e,t,i){ri(this,"_onDidChange",new LL.Emitter);ri(this,"_options");ri(this,"_modeConfiguration");ri(this,"_languageId");this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},s_e={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},DL={format:s_e,suggest:{},data:{useDefaultDataProvider:!0}};function xL(o){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:o===nv,documentFormattingEdits:o===nv,documentRangeFormattingEdits:o===nv}}var nv="html",J5="handlebars",e3="razor",OW=kL(nv,DL,xL(nv)),o_e=OW.defaults,FW=kL(J5,DL,xL(J5)),r_e=FW.defaults,BW=kL(e3,DL,xL(e3)),a_e=BW.defaults;LL.languages.html={htmlDefaults:o_e,razorDefaults:a_e,handlebarDefaults:r_e,htmlLanguageService:OW,handlebarLanguageService:FW,razorLanguageService:BW,registerHTMLLanguageService:kL};function l_e(){return Oe(()=>import("./htmlMode-BTRUnrkS.js"),__vite__mapDeps([20,1,2,3,4,5,6,7,8]))}function kL(o,e=DL,t=xL(o)){const i=new n_e(o,e,t);let n;const s=LL.languages.onLanguage(o,async()=>{n=(await l_e()).setupMode(i)});return{defaults:i,dispose(){s.dispose(),n==null||n.dispose(),n=void 0}}}/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var d_e=Object.defineProperty,c_e=Object.getOwnPropertyDescriptor,u_e=Object.getOwnPropertyNames,h_e=Object.prototype.hasOwnProperty,g_e=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of u_e(e))!h_e.call(o,n)&&n!==t&&d_e(o,n,{get:()=>e[n],enumerable:!(i=c_e(e,n))||i.enumerable});return o},f_e=(o,e,t)=>(g_e(o,e,"default"),t),I0={};f_e(I0,k0);var p_e=class{constructor(e,t,i){ri(this,"_onDidChange",new I0.Emitter);ri(this,"_diagnosticsOptions");ri(this,"_modeConfiguration");ri(this,"_languageId");this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},m_e={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},__e={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},WW=new p_e("json",m_e,__e);I0.languages.json={jsonDefaults:WW};function v_e(){return Oe(()=>import("./jsonMode-B8CiFQ0R.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,8]))}I0.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});I0.languages.onLanguage("json",()=>{v_e().then(o=>o.setupMode(WW))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var d_e=Object.defineProperty,c_e=Object.getOwnPropertyDescriptor,u_e=Object.getOwnPropertyNames,h_e=Object.prototype.hasOwnProperty,g_e=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of u_e(e))!h_e.call(o,n)&&n!==t&&d_e(o,n,{get:()=>e[n],enumerable:!(i=c_e(e,n))||i.enumerable});return o},f_e=(o,e,t)=>(g_e(o,e,"default"),t),I0={};f_e(I0,k0);var p_e=class{constructor(e,t,i){ri(this,"_onDidChange",new I0.Emitter);ri(this,"_diagnosticsOptions");ri(this,"_modeConfiguration");ri(this,"_languageId");this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},m_e={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},__e={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},WW=new p_e("json",m_e,__e);I0.languages.json={jsonDefaults:WW};function v_e(){return Oe(()=>import("./jsonMode-BNPGVg0I.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,8]))}I0.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});I0.languages.onLanguage("json",()=>{v_e().then(o=>o.setupMode(WW))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var b_e=Object.defineProperty,C_e=Object.getOwnPropertyDescriptor,w_e=Object.getOwnPropertyNames,S_e=Object.prototype.hasOwnProperty,y_e=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of w_e(e))!S_e.call(o,n)&&n!==t&&b_e(o,n,{get:()=>e[n],enumerable:!(i=C_e(e,n))||i.enumerable});return o},L_e=(o,e,t)=>(y_e(o,e,"default"),t),D_e="5.0.2",Qp={};L_e(Qp,k0);var VW=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(VW||{}),HW=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(HW||{}),zW=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(zW||{}),$W=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))($W||{}),UW=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(UW||{}),jW=class{constructor(o,e,t,i,n){ri(this,"_onDidChange",new Qp.Emitter);ri(this,"_onDidExtraLibsChange",new Qp.Emitter);ri(this,"_extraLibs");ri(this,"_removedExtraLibs");ri(this,"_eagerModelSync");ri(this,"_compilerOptions");ri(this,"_diagnosticsOptions");ri(this,"_workerOptions");ri(this,"_onDidExtraLibsChangeTimeout");ri(this,"_inlayHintsOptions");ri(this,"_modeConfiguration");this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(o),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(o,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===o)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:o,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(o){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),o&&o.length>0)for(const e of o){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(o){this._compilerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(o){this._workerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(o){this._inlayHintsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(o){}setEagerModelSync(o){this._eagerModelSync=o}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(void 0)}},x_e=D_e,KW={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},qW=new jW({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},KW),GW=new jW({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},KW),k_e=()=>IL().then(o=>o.getTypeScriptWorker()),I_e=()=>IL().then(o=>o.getJavaScriptWorker());Qp.languages.typescript={ModuleKind:VW,JsxEmit:HW,NewLineKind:zW,ScriptTarget:$W,ModuleResolutionKind:UW,typescriptVersion:x_e,typescriptDefaults:qW,javascriptDefaults:GW,getTypeScriptWorker:k_e,getJavaScriptWorker:I_e};function IL(){return Oe(()=>import("./tsMode-xq1wJwnt.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,8]))}Qp.languages.onLanguage("typescript",()=>IL().then(o=>o.setupTypeScript(qW)));Qp.languages.onLanguage("javascript",()=>IL().then(o=>o.setupJavaScript(GW)));class E_e extends Qo{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:p("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:ve.map,toggled:ae.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ae.has("isInDiffEditor"),menu:{when:ae.has("isInDiffEditor"),id:N.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Dt),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}mi(E_e);class ZW extends Qo{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:p("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:ae.has("isInDiffEditor")})}run(e,...t){const i=e.get(Dt),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}mi(ZW);class YW extends Qo{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:p("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:ae.has("isInDiffEditor")})}run(e,...t){const i=e.get(Dt),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}mi(YW);zn.appendMenuItem(N.EditorTitle,{command:{id:new YW().desc.id,title:p("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ae.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ae.has("isInDiffEditor")},order:11,group:"1_diff",when:ae.and(T.diffEditorRenderSideBySideInlineBreakpointReached,ae.has("isInDiffEditor"))});zn.appendMenuItem(N.EditorTitle,{command:{id:new ZW().desc.id,title:p("showMoves","Show Moved Code Blocks"),icon:ve.move,toggled:gm.create("config.diffEditor.experimental.showMoves",!0),precondition:ae.has("isInDiffEditor")},order:10,group:"1_diff",when:ae.has("isInDiffEditor")});const EL={value:p("diffEditor","Diff Editor"),original:"Diff Editor"};class N_e extends Wa{constructor(){super({id:"diffEditor.switchSide",title:{value:p("switchSide","Switch Side"),original:"Switch Side"},icon:ve.arrowSwap,precondition:ae.has("isInDiffEditor"),f1:!0,category:EL})}runEditorCommand(e,t,i){const n=Im(e);if(n instanceof vu){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}mi(N_e);class T_e extends Wa{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:p("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:ve.close,precondition:T.comparingMovedCode,f1:!1,category:EL,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Im(e);n instanceof vu&&n.exitCompareMove()}}mi(T_e);class M_e extends Wa{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:p("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:ve.fold,precondition:ae.has("isInDiffEditor"),f1:!0,category:EL})}runEditorCommand(e,t,...i){const n=Im(e);n instanceof vu&&n.collapseAllUnchangedRegions()}}mi(M_e);class A_e extends Wa{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:p("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:ve.unfold,precondition:ae.has("isInDiffEditor"),f1:!0,category:EL})}runEditorCommand(e,t,...i){const n=Im(e);n instanceof vu&&n.showAllUnchangedRegions()}}mi(A_e);const XW={value:p("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class km extends Qo{constructor(){super({id:km.id,title:{value:p("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:XW,precondition:ae.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Im(e);t==null||t.accessibleDiffViewerNext()}}km.id="editor.action.accessibleDiffViewer.next";zn.appendMenuItem(N.EditorTitle,{command:{id:km.id,title:p("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ae.has("isInDiffEditor")},order:10,group:"2_diff",when:ae.and(T.accessibleDiffViewerVisible.negate(),ae.has("isInDiffEditor"))});class E0 extends Qo{constructor(){super({id:E0.id,title:{value:p("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:XW,precondition:ae.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Im(e);t==null||t.accessibleDiffViewerPrev()}}E0.id="editor.action.accessibleDiffViewer.prev";function Im(o){var e;const t=o.get(Ot),i=t.listDiffEditors(),n=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!n)return null;for(let r=0,a=i.length;r=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},O_e=function(o,e){return function(t,i){e(t,i,o)}},oT;const NL=new De("selectionAnchorSet",!1);let $d=oT=class{static get(e){return e.getContribution(oT.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=NL.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(Ae.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new as().appendText(p("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),mo(p("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(Ae.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};$d.ID="editor.contrib.selectionAnchorController";$d=oT=P_e([O_e(1,Xe)],$d);class F_e extends Te{constructor(){super({id:"editor.action.setSelectionAnchor",label:p("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:fn(2089,2080),weight:100}})}async run(e,t){var i;(i=$d.get(t))===null||i===void 0||i.setSelectionAnchor()}}class B_e extends Te{constructor(){super({id:"editor.action.goToSelectionAnchor",label:p("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:NL})}async run(e,t){var i;(i=$d.get(t))===null||i===void 0||i.goToSelectionAnchor()}}class W_e extends Te{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:p("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:NL,kbOpts:{kbExpr:T.editorTextFocus,primary:fn(2089,2089),weight:100}})}async run(e,t){var i;(i=$d.get(t))===null||i===void 0||i.selectFromAnchorToCursor()}}class V_e extends Te{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:p("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:NL,kbOpts:{kbExpr:T.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=$d.get(t))===null||i===void 0||i.cancelSelectionAnchor()}}At($d.ID,$d,4);_e(F_e);_e(B_e);_e(W_e);_e(V_e);const H_e=M("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},p("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class z_e extends Te{constructor(){super({id:"editor.action.jumpToBracket",label:p("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=$r.get(t))===null||i===void 0||i.jumpToBracket()}}class $_e extends Te{constructor(){super({id:"editor.action.selectToBracket",label:p("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:fG("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var n;let s=!0;i&&i.selectBrackets===!1&&(s=!1),(n=$r.get(t))===null||n===void 0||n.selectToBracket(s)}}class U_e extends Te{constructor(){super({id:"editor.action.removeBrackets",label:p("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=$r.get(t))===null||i===void 0||i.removeBrackets(this.id)}}class j_e{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class $r extends q{static get(e){return e.getContribution($r.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Yt(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(71),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(71)&&(this._matchBrackets=this._editor.getOption(71),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(r=l.range.getStartPosition())}}return r?new Ae(r.lineNumber,r.column,r.lineNumber,r.column):new Ae(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const d=t.bracketPairs.findNextBracket(s);d&&d.range&&(r=t.bracketPairs.matchBracket(d.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(k.compareRangesUsingStarts);const[d,c]=r;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?c.getEndPosition():c.getStartPosition(),c.containsPosition(s)){const u=a;a=l,l=u}}a&&l&&i.push(new Ae(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let r=0;for(let u=0,h=e.length;u1&&s.sort(z.compare);const a=[];let l=0,d=0;const c=n.length;for(let u=0,h=s.length;u0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}_e(Z_e);const pg="9_cutcopypaste",Y_e=Ml||document.queryCommandSupported("cut"),JW=Ml||document.queryCommandSupported("copy"),X_e=typeof navigator.clipboard>"u"||pr?document.queryCommandSupported("paste"):!0;function IR(o){return o.register(),o}const Q_e=Y_e?IR(new pm({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Ml?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:N.MenubarEditMenu,group:"2_ccp",title:p({},"Cu&&t"),order:1},{menuId:N.EditorContext,group:pg,title:p("actions.clipboard.cutLabel","Cut"),when:T.writable,order:1},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.cutLabel","Cut"),order:1},{menuId:N.SimpleEditorContext,group:pg,title:p("actions.clipboard.cutLabel","Cut"),when:T.writable,order:1}]})):void 0,J_e=JW?IR(new pm({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Ml?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:N.MenubarEditMenu,group:"2_ccp",title:p({},"&&Copy"),order:2},{menuId:N.EditorContext,group:pg,title:p("actions.clipboard.copyLabel","Copy"),order:2},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.copyLabel","Copy"),order:1},{menuId:N.SimpleEditorContext,group:pg,title:p("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;zn.appendMenuItem(N.MenubarEditMenu,{submenu:N.MenubarCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});zn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:pg,order:3});zn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1,when:ae.and(ae.notEquals("resourceScheme","output"),T.editorTextFocus)});zn.appendMenuItem(N.EditorTitleContext,{submenu:N.EditorTitleContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1});zn.appendMenuItem(N.ExplorerContext,{submenu:N.ExplorerContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1});const ik=X_e?IR(new pm({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Ml?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:N.MenubarEditMenu,group:"2_ccp",title:p({},"&&Paste"),order:4},{menuId:N.EditorContext,group:pg,title:p("actions.clipboard.pasteLabel","Paste"),when:T.writable,order:4},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:N.SimpleEditorContext,group:pg,title:p("actions.clipboard.pasteLabel","Paste"),when:T.writable,order:4}]})):void 0;class eve extends Te{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:p("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:T.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(rE.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),rE.forceCopyWithSyntaxHighlighting=!1)}}function eV(o,e){o&&(o.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(Ot).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const s=n.getOption(37),r=n.getSelection();return r&&r.isEmpty()&&!s||n.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),o.addImplementation(0,"generic-dom",(t,i)=>(fm().execCommand(e),!0)))}eV(Q_e,"cut");eV(J_e,"copy");ik&&(ik.addImplementation(1e4,"code-editor",(o,e)=>{const t=o.get(Ot),i=o.get(Xd),n=t.getFocusedCodeEditor();return n&&n.hasTextFocus()?!n.getContainerDomNode().ownerDocument.execCommand("paste")&&Tu?(async()=>{const r=await i.readText();if(r!==""){const a=$v.INSTANCE.get(r);let l=!1,d=null,c=null;a&&(l=n.getOption(37)&&!!a.isFromEmptySelection,d=typeof a.multicursorText<"u"?a.multicursorText:null,c=a.mode),n.trigger("keyboard","paste",{text:r,pasteOnNewLine:l,multicursorText:d,mode:c})}})():!0:!1}),ik.addImplementation(0,"generic-dom",(o,e)=>(fm().execCommand("paste"),!0)));JW&&_e(eve);class Ze{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+Ze.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Ze(this.value+Ze.sep+e)}}Ze.sep=".";Ze.None=new Ze("@@none@@");Ze.Empty=new Ze("");Ze.QuickFix=new Ze("quickfix");Ze.Refactor=new Ze("refactor");Ze.RefactorExtract=Ze.Refactor.append("extract");Ze.RefactorInline=Ze.Refactor.append("inline");Ze.RefactorMove=Ze.Refactor.append("move");Ze.RefactorRewrite=Ze.Refactor.append("rewrite");Ze.Notebook=new Ze("notebook");Ze.Source=new Ze("source");Ze.SourceOrganizeImports=Ze.Source.append("organizeImports");Ze.SourceFixAll=Ze.Source.append("fixAll");Ze.SurroundWith=Ze.Refactor.append("surround");var _o;(function(o){o.Refactor="refactor",o.RefactorPreview="refactor preview",o.Lightbulb="lightbulb",o.Default="other (default)",o.SourceAction="source action",o.QuickFix="quick fix action",o.FixAll="fix all",o.OrganizeImports="organize imports",o.AutoFix="auto fix",o.QuickFixHover="quick fix hover window",o.OnSave="save participants",o.ProblemsView="problems view"})(_o||(_o={}));function tve(o,e){return!(o.include&&!o.include.intersects(e)||o.excludes&&o.excludes.some(t=>tV(e,t,o.include))||!o.includeSourceActions&&Ze.Source.contains(e))}function ive(o,e){const t=e.kind?new Ze(e.kind):void 0;return!(o.include&&(!t||!o.include.contains(t))||o.excludes&&t&&o.excludes.some(i=>tV(t,i,o.include))||!o.includeSourceActions&&t&&Ze.Source.contains(t)||o.onlyIncludePreferredActions&&!e.isPreferred)}function tV(o,e,t){return!(!e.contains(o)||t&&e.contains(t))}class gl{static fromUser(e,t){return!e||typeof e!="object"?new gl(t.kind,t.apply,!1):new gl(gl.getKindFromUser(e,t.kind),gl.getApplyFromUser(e,t.apply),gl.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Ze(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class nve{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){var t;if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let i;try{i=await this.provider.resolveCodeAction(this.action,e)}catch(n){en(n)}i&&(this.action.edit=i.edit)}return this}}const iV="editor.action.codeAction",ER="editor.action.quickFix",nV="editor.action.autoFix",sV="editor.action.refactor",oV="editor.action.sourceAction",NR="editor.action.organizeImports",TR="editor.action.fixAll";class sv extends q{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:ls(e.diagnostics)?ls(t.diagnostics)?sv.codeActionsPreferredComparator(e,t):-1:ls(t.diagnostics)?1:sv.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(sv.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Ze.QuickFix.contains(new Ze(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}}const t3={actions:[],documentation:void 0};async function ov(o,e,t,i,n,s){var r;const a=i.filter||{},l={...a,excludes:[...a.excludes||[],Ze.Notebook]},d={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:i.type},c=new SR(e,s),u=i.type===2,h=sve(o,e,u?l:a),g=new de,f=h.map(async v=>{try{n.report(v);const _=await v.provideCodeActions(e,t,d,c.token);if(_&&g.add(_),c.token.isCancellationRequested)return t3;const b=((_==null?void 0:_.actions)||[]).filter(w=>w&&ive(a,w)),C=rve(v,b,a.include);return{actions:b.map(w=>new nve(w,v)),documentation:C}}catch(_){if(Fa(_))throw _;return en(_),t3}}),m=o.onDidChange(()=>{const v=o.all(e);Bi(v,h)||c.cancel()});try{const v=await Promise.all(f),_=v.map(C=>C.actions).flat(),b=[...Ia(v.map(C=>C.documentation)),...ove(o,e,i,_)];return new sv(_,b,g)}finally{m.dispose(),c.dispose()}}function sve(o,e,t){return o.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>tve(t,new Ze(n))):!0)}function*ove(o,e,t,i){var n,s,r;if(e&&i.length)for(const a of o.all(e))a._getAdditionalMenuItems&&(yield*(n=a._getAdditionalMenuItems)===null||n===void 0?void 0:n.call(a,{trigger:t.type,only:(r=(s=t.filter)===null||s===void 0?void 0:s.include)===null||r===void 0?void 0:r.value},i.map(l=>l.action)))}function rve(o,e,t){if(!o.documentation)return;const i=o.documentation.map(n=>({kind:new Ze(n.kind),command:n.command}));if(t){let n;for(const s of i)s.kind.contains(t)&&(n?n.kind.contains(s.kind)&&(n=s):n=s);if(n)return n==null?void 0:n.command}for(const n of e)if(n.kind){for(const s of i)if(s.kind.contains(new Ze(n.kind)))return s.command}}var TS;(function(o){o.OnSave="onSave",o.FromProblemsView="fromProblemsView",o.FromCodeActions="fromCodeActions"})(TS||(TS={}));async function ave(o,e,t,i,n=vt.None){var s;const r=o.get(f0),a=o.get(Ri),l=o.get(vo),d=o.get(sn);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(n),!n.isCancellationRequested&&!(!((s=e.action.edit)===null||s===void 0)&&s.edits.length&&!(await r.apply(e.action.edit,{editor:i==null?void 0:i.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==TS.OnSave,showPreview:i==null?void 0:i.preview})).isApplied)&&e.action.command)try{await a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(c){const u=lve(c);d.error(typeof u=="string"?u:p("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function lve(o){return typeof o=="string"?o:o instanceof Error&&typeof o.message=="string"?o.message:void 0}Et.registerCommand("_executeCodeActionProvider",async function(o,e,t,i,n){if(!(e instanceof ze))throw hr();const{codeActionProvider:s}=o.get(Me),r=o.get(Si).getModel(e);if(!r)throw hr();const a=Ae.isISelection(t)?Ae.liftSelection(t):k.isIRange(t)?r.validateRange(t):void 0;if(!a)throw hr();const l=typeof i=="string"?new Ze(i):void 0,d=await ov(s,r,a,{type:1,triggerAction:_o.Default,filter:{includeSourceActions:!0,include:l}},Fd.None,vt.None),c=[],u=Math.min(d.validActions.length,typeof n=="number"?n:0);for(let h=0;hh.action)}finally{setTimeout(()=>d.dispose(),100)}});var dve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},cve=function(o,e){return function(t,i){e(t,i,o)}},rT;let MS=rT=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Ru(()=>this.keybindingService.getKeybindings().filter(t=>rT.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===NR?i={kind:Ze.SourceOrganizeImports.value}:t.command===TR&&(i={kind:Ze.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...gl.fromUser(i,{kind:Ze.None,apply:"never"})}}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i==null?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Ze(e.kind);return t.filter(n=>n.kind.contains(i)).filter(n=>n.preferred?e.isPreferred:!0).reduceRight((n,s)=>n?n.kind.contains(s.kind)?s:n:s,void 0)}};MS.codeActionCommands=[sV,iV,oV,NR,TR];MS=rT=dve([cve(0,Xt)],MS);M("symbolIcon.arrayForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.booleanForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.colorForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.constantForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.fileForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.folderForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.keyForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.keywordForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.moduleForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.namespaceForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.nullForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.numberForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.objectForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.operatorForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.packageForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.propertyForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.referenceForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.snippetForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.stringForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.structForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.textForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.typeParameterForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.unitForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const rV=Object.freeze({kind:Ze.Empty,title:p("codeAction.widget.id.more","More Actions...")}),uve=Object.freeze([{kind:Ze.QuickFix,title:p("codeAction.widget.id.quickfix","Quick Fix")},{kind:Ze.RefactorExtract,title:p("codeAction.widget.id.extract","Extract"),icon:ve.wrench},{kind:Ze.RefactorInline,title:p("codeAction.widget.id.inline","Inline"),icon:ve.wrench},{kind:Ze.RefactorRewrite,title:p("codeAction.widget.id.convert","Rewrite"),icon:ve.wrench},{kind:Ze.RefactorMove,title:p("codeAction.widget.id.move","Move"),icon:ve.wrench},{kind:Ze.SurroundWith,title:p("codeAction.widget.id.surround","Surround With"),icon:ve.symbolSnippet},{kind:Ze.Source,title:p("codeAction.widget.id.source","Source Action"),icon:ve.symbolFile},rV]);function hve(o,e,t){if(!e)return o.map(s=>{var r;return{kind:"action",item:s,group:rV,disabled:!!s.action.disabled,label:s.action.disabled||s.action.title,canPreview:!!(!((r=s.action.edit)===null||r===void 0)&&r.edits.length)}});const i=uve.map(s=>({group:s,actions:[]}));for(const s of o){const r=s.action.kind?new Ze(s.action.kind):Ze.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(s);break}}const n=[];for(const s of i)if(s.actions.length){n.push({kind:"header",group:s.group});for(const r of s.actions){const a=s.group;n.push({kind:"action",item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:ve.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return n}var gve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},i3=function(o,e){return function(t,i){e(t,i,o)}},aT,$f;(function(o){o.Hidden={type:0};class e{constructor(i,n,s,r){this.actions=i,this.trigger=n,this.editorPosition=s,this.widgetPosition=r,this.type=1}}o.Showing=e})($f||($f={}));let mg=aT=class extends q{constructor(e,t,i){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new W),this.onClick=this._onClick.event,this._state=$f.Hidden,this._iconClasses=[],this._domNode=pe("div.lightBulbWidget"),this._register(ei.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(n=>{const s=this._editor.getModel();(this.state.type!==1||!s||this.state.editorPosition.lineNumber>=s.getLineCount())&&this.hide()})),this._register(VX(this._domNode,n=>{var s;if(this.state.type!==1)return;const r=this._editor.getOption(64).experimental.showAiIcon;if((r===so.On||r===so.OnCode)&&this.state.actions.allAIFixes&&this.state.actions.validActions.length===1){const u=this.state.actions.validActions[0].action;if(!((s=u.command)===null||s===void 0)&&s.id){i.executeCommand(u.command.id,...u.command.arguments||[]),n.preventDefault();return}}this._editor.focus(),n.preventDefault();const{top:a,height:l}=gn(this._domNode),d=this._editor.getOption(66);let c=Math.floor(d/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(n.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(64)&&(this._editor.getOption(64).enabled||this.hide(),this._updateLightBulbTitleAndIcon())})),this._register(ye.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var n,s,r,a;this._preferredKbLabel=(s=(n=this._keybindingService.lookupKeybinding(nV))===null||n===void 0?void 0:n.getLabel())!==null&&s!==void 0?s:void 0,this._quickFixKbLabel=(a=(r=this._keybindingService.lookupKeybinding(ER))===null||r===void 0?void 0:r.getLabel())!==null&&a!==void 0?a:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();const n=this._editor.getOptions();if(!n.get(64).enabled)return this.hide();const s=this._editor.getModel();if(!s)return this.hide();const{lineNumber:r,column:a}=s.validatePosition(i),l=s.getOptions().tabSize,d=n.get(50),c=s.getLineContent(r),u=jy(c,l),h=d.spaceWidth*u>22,g=m=>m>2&&this._editor.getTopForLineNumber(m)===this._editor.getTopForLineNumber(m-1);let f=r;if(!h){if(r>1&&!g(r-1))f-=1;else if(!g(r+1))f+=1;else if(a*d.spaceWidth<22)return this.hide()}this.state=new $f.Showing(e,t,i,{position:{lineNumber:f,column:s.getLineContent(f).match(/^\S\s*$/)?2:1},preference:aT._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==$f.Hidden&&(this.state=$f.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){var e,t,i;if(this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],this.state.type!==1)return;const n=()=>{this._preferredKbLabel&&(this.title=p("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel))},s=()=>{this._quickFixKbLabel?this.title=p("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=p("codeAction","Show Code Actions")};let r;const a=this._editor.getOption(64).experimental.showAiIcon;if(a===so.On||a===so.OnCode)if(a===so.On&&this.state.actions.allAIFixes)if(r=ve.sparkleFilled,this.state.actions.allAIFixes&&this.state.actions.validActions.length===1)if(((e=this.state.actions.validActions[0].action.command)===null||e===void 0?void 0:e.id)==="inlineChat.start"){const l=(i=(t=this._keybindingService.lookupKeybinding("inlineChat.start"))===null||t===void 0?void 0:t.getLabel())!==null&&i!==void 0?i:void 0;this.title=l?p("codeActionStartInlineChatWithKb","Start Inline Chat ({0})",l):p("codeActionStartInlineChat","Start Inline Chat")}else this.title=p("codeActionTriggerAiAction","Trigger AI Action");else s();else this.state.actions.hasAutoFix?(this.state.actions.hasAIFix?r=ve.lightbulbSparkleAutofix:r=ve.lightbulbAutofix,n()):this.state.actions.hasAIFix?(r=ve.lightbulbSparkle,s()):(r=ve.lightBulb,s());else this.state.actions.hasAutoFix?(r=ve.lightbulbAutofix,n()):(r=ve.lightBulb,s());this._iconClasses=Ue.asClassNameArray(r),this._domNode.classList.add(...this._iconClasses)}set title(e){this._domNode.title=e}};mg.ID="editor.contrib.lightbulbWidget";mg._posPref=[0];mg=aT=gve([i3(1,Xt),i3(2,Ri)],mg);var fve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},n3=function(o,e){return function(t,i){e(t,i,o)}},lT;let Ud=lT=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new W,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const n=new de,s=n.add(iL(e,{...this._getRenderOptions(e,n),...t},i));return s.element.classList.add("rendered-markdown"),{element:s.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,n)=>{var s,r,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(s=this._options.editor.getModel())===null||s===void 0?void 0:s.getLanguageId()),l||(l=Ko);const d=await lae(this._languageService,n,l),c=document.createElement("span");if(c.innerHTML=(a=(r=lT._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(d))!==null&&a!==void 0?a:d,this._options.editor){const u=this._options.editor.getOption(50);Jn(c,u)}else this._options.codeBlockFontFamily&&(c.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(c.style.fontSize=this._options.codeBlockFontSize),c},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>aV(this._openerService,i,e.isTrusted),disposables:t}}}};Ud._ttpTokenizer=qd("tokenizeToString",{createHTML(o){return o}});Ud=lT=fve([n3(1,bi),n3(2,So)],Ud);async function aV(o,e,t){try{return await o.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:pve(t)})}catch(i){return nt(i),!1}}function pve(o){return o===!0?!0:o&&Array.isArray(o.enabledCommands)?o.enabledCommands:!1}var mve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},s3=function(o,e){return function(t,i){e(t,i,o)}},W1;let ho=W1=class{static get(e){return e.getContribution(W1.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new An,this._messageListeners=new de,this._mouseOverMessage=!1,this._editor=e,this._visible=W1.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){mo(jc(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=jc(e)?iL(e,{actionHandler:{callback:n=>aV(this._openerService,n,jc(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new o3(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(ye.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Qn(jo(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(J(this._messageWidget.value.getDomNode(),Se.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(J(this._messageWidget.value.getDomNode(),Se.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new k(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(o3.fadeOut(this._messageWidget.value))}};ho.ID="editor.contrib.messageController";ho.MESSAGE_VISIBLE=new De("messageVisible",!1,p("messageVisible","Whether the editor is currently showing an inline message"));ho=W1=mve([s3(1,Xe),s3(2,So)],ho);const _ve=Rn.bindToContribution(ho.get);we(new _ve({id:"leaveEditorMessage",precondition:ho.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let o3=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};At(ho.ID,ho,4);var lV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},dT=function(o,e){return function(t,i){e(t,i,o)}};const dV="acceptSelectedCodeAction",cV="previewSelectedCodeAction";class vve{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){var n,s;i.text.textContent=(s=(n=e.group)===null||n===void 0?void 0:n.title)!==null&&s!==void 0?s:""}disposeTemplate(e){}}let cT=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const n=new C0(e,Vo);return{container:e,icon:t,text:i,keybinding:n}}renderElement(e,t,i){var n,s,r;if(!((n=e.group)===null||n===void 0)&&n.icon?(i.icon.className=Ue.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=Ee(e.group.icon.color.id))):(i.icon.className=Ue.asClassName(ve.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=uV(e.label),i.keybinding.set(e.keybinding),iQ(!!e.keybinding,i.keybinding.element);const a=(s=this._keybindingService.lookupKeybinding(dV))===null||s===void 0?void 0:s.getLabel(),l=(r=this._keybindingService.lookupKeybinding(cV))===null||r===void 0?void 0:r.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?i.container.title=p({},"{0} to apply, {1} to preview",a,l):i.container.title=p({},"{0} to apply",a):i.container.title=""}disposeTemplate(e){}};cT=lV([dT(1,Xt)],cT);class bve extends UIEvent{constructor(){super("acceptSelectedAction")}}class r3 extends UIEvent{constructor(){super("previewSelectedAction")}}function Cve(o){if(o.kind==="action")return o.label}let uT=class extends q{constructor(e,t,i,n,s,r){super(),this._delegate=n,this._contextViewService=s,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new tn),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:l=>l.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:l=>l.kind};this._list=this._register(new Yr(e,this.domNode,a,[new cT(t,this._keybindingService),new vve],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:Cve},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let d=l.label?uV(l==null?void 0:l.label):"";return l.disabled&&(d=p({},"{0}, Disabled Reason: {1}",d,l.disabled)),d}return null},getWidgetAriaLabel:()=>p({},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(Fg),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(l=>l.kind==="header").length,n=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(n);let s=e;if(this._allMenuItems.length>=50)s=380;else{const l=this._allMenuItems.map((d,c)=>{const u=this.domNode.ownerDocument.getElementById(this._list.getElementID(c));if(u){u.style.width="auto";const h=u.getBoundingClientRect().width;return u.style.width="",h}return 0});s=Math.max(...l,e)}const a=Math.min(n,this.domNode.ownerDocument.body.clientHeight*.7);return this._list.layout(a,s),this.domNode.style.height=`${a}px`,this._list.domFocus(),s}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],n=this._list.element(i);if(!this.focusCondition(n))return;const s=e?new r3:new bve;this._list.setSelection([i],s)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof r3):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const i=this._list.getFocus();if(i.length===0)return;const n=i[0],s=this._list.element(n);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,s.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const i=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};uT=lV([dT(4,Gd),dT(5,Xt)],uT);function uV(o){return o.replace(/\r\n|\r|\n/g," ")}var wve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nk=function(o,e){return function(t,i){e(t,i,o)}};M("actionBar.toggledBackground",{dark:Ih,light:Ih,hcDark:Ih,hcLight:Ih},p("actionBar.toggledBackground","Background color for toggled action items in action bar."));const _g={Visible:new De("codeActionMenuVisible",!1,p("codeActionMenuVisible","Whether the action widget list is visible"))},Hg=bt("actionWidgetService");let vg=class extends q{get isVisible(){return _g.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new An)}show(e,t,i,n,s,r,a){const l=_g.Visible.bindTo(this._contextKeyService),d=this._instantiationService.createInstance(uT,e,t,i,n);this._contextViewService.showContextView({getAnchor:()=>s,render:c=>(l.set(!0),this._renderWidget(c,d,a??[])),onHide:c=>{l.reset(),this._onWidgetClosed(c)}},r,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,i){var n;const s=document.createElement("div");if(s.classList.add("action-widget"),e.appendChild(s),this._list.value=t,this._list.value)s.appendChild(this._list.value.domNode);else throw new Error("List has no value");const r=new de,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),r.add(J(l,Se.MOUSE_DOWN,f=>f.stopPropagation()));const d=document.createElement("div"),c=e.appendChild(d);c.classList.add("context-view-pointerBlock"),r.add(J(c,Se.POINTER_MOVE,()=>c.remove())),r.add(J(c,Se.MOUSE_DOWN,()=>c.remove()));let u=0;if(i.length){const f=this._createActionBar(".action-widget-action-bar",i);f&&(s.appendChild(f.getContainer().parentElement),r.add(f),u=f.getContainer().offsetWidth)}const h=(n=this._list.value)===null||n===void 0?void 0:n.layout(u);s.style.width=`${h}px`;const g=r.add(Pl(e));return r.add(g.onDidBlur(()=>this.hide())),r}_createActionBar(e,t){if(!t.length)return;const i=pe(e),n=new Cr(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};vg=wve([nk(0,Gd),nk(1,Xe),nk(2,qe)],vg);xt(Hg,vg,1);const N0=1100;mi(class extends Qo{constructor(){super({id:"hideCodeActionWidget",title:{value:p("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:_g.Visible,keybinding:{weight:N0,primary:9,secondary:[1033]}})}run(o){o.get(Hg).hide()}});mi(class extends Qo{constructor(){super({id:"selectPrevCodeAction",title:{value:p("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:_g.Visible,keybinding:{weight:N0,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(o){const e=o.get(Hg);e instanceof vg&&e.focusPrevious()}});mi(class extends Qo{constructor(){super({id:"selectNextCodeAction",title:{value:p("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:_g.Visible,keybinding:{weight:N0,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(o){const e=o.get(Hg);e instanceof vg&&e.focusNext()}});mi(class extends Qo{constructor(){super({id:dV,title:{value:p("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:_g.Visible,keybinding:{weight:N0,primary:3,secondary:[2137]}})}run(o){const e=o.get(Hg);e instanceof vg&&e.acceptSelected()}});mi(class extends Qo{constructor(){super({id:cV,title:{value:p("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:_g.Visible,keybinding:{weight:N0,primary:2051}})}run(o){const e=o.get(Hg);e instanceof vg&&e.acceptSelected(!0)}});const hV=new De("supportedCodeAction","");class Sve extends q{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new qr),this._register(this._markerService.onMarkerChanged(s=>this._onMarkerChanges(s))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>dA(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:_o.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){var t;if(!this._editor.hasModel())return;const i=this._editor.getModel(),n=this._editor.getSelection();if(n.isEmpty()&&e.type===2){const{lineNumber:s,column:r}=n.getPosition(),a=i.getLineContent(s);if(a.length===0){if(!(((t=this._editor.getOption(64).experimental)===null||t===void 0?void 0:t.showAiIcon)===so.On))return}else if(r===1){if(/\s/.test(a[0]))return}else if(r===i.getLineMaxColumn(s)){if(/\s/.test(a[a.length-1]))return}else if(/\s/.test(a[r-2])&&/\s/.test(a[r-1]))return}return n}}var Lh;(function(o){o.Empty={type:0};class e{constructor(i,n,s){this.trigger=i,this.position=n,this._cancellablePromise=s,this.type=1,this.actions=s.catch(r=>{if(Fa(r))return gV;throw r})}cancel(){this._cancellablePromise.cancel()}}o.Triggered=e})(Lh||(Lh={}));const gV=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class yve extends q{constructor(e,t,i,n,s,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=s,this._configurationService=r,this._codeActionOracle=this._register(new An),this._state=Lh.Empty,this._onDidChangeState=this._register(new W),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=hV.bindTo(n),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(Lh.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(Lh.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(i=>{var n;return(n=i.providedCodeActionKinds)!==null&&n!==void 0?n:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new Sve(this._editor,this._markerService,i=>{var n;if(!i){this.setState(Lh.Empty);return}const s=i.selection.getStartPosition(),r=_n(async a=>{var l,d,c,u,h,g;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===_o.QuickFix||!((d=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||d===void 0)&&d.contains(Ze.QuickFix))){const f=await ov(this._registry,e,i.selection,i.trigger,Fd.None,a),m=[...f.allActions];if(a.isCancellationRequested)return gV;if(!((c=f.validActions)===null||c===void 0?void 0:c.some(_=>_.action.kind?Ze.QuickFix.contains(new Ze(_.action.kind)):!1))){const _=this._markerService.read({resource:e.uri});if(_.length>0){const b=i.selection.getPosition();let C=b,w=Number.MAX_VALUE;const S=[...f.validActions];for(const y of _){const I=y.endColumn,E=y.endLineNumber,R=y.startLineNumber;if(E===b.lineNumber||R===b.lineNumber){C=new z(E,I);const j={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:!((u=i.trigger.filter)===null||u===void 0)&&u.include?(h=i.trigger.filter)===null||h===void 0?void 0:h.include:Ze.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((g=i.trigger.context)===null||g===void 0?void 0:g.notAvailableMessage)||"",position:C}},O=new Ae(C.lineNumber,C.column,C.lineNumber,C.column),$=await ov(this._registry,e,O,j,Fd.None,a);if($.validActions.length!==0){for(const K of $.validActions)K.highlightRange=K.action.isPreferred;f.allActions.length===0&&m.push(...$.allActions),Math.abs(b.column-I)E.findIndex(R=>R.action.title===y.action.title)===I);return x.sort((y,I)=>y.action.isPreferred&&!I.action.isPreferred?-1:!y.action.isPreferred&&I.action.isPreferred||y.action.isAI&&!I.action.isAI?1:!y.action.isAI&&I.action.isAI?-1:0),{validActions:x,allActions:m,documentation:f.documentation,hasAutoFix:f.hasAutoFix,hasAIFix:f.hasAIFix,allAIFixes:f.allAIFixes,dispose:()=>{f.dispose()}}}}}return ov(this._registry,e,i.selection,i.trigger,Fd.None,a)});i.trigger.type===1&&((n=this._progressService)===null||n===void 0||n.showWhile(r,250)),this.setState(new Lh.Triggered(i.trigger,s,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:_o.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var Lve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},id=function(o,e){return function(t,i){e(t,i,o)}},V1;const Dve="quickfix-edit-highlight";let Cu=V1=class extends q{static get(e){return e.getContribution(V1.ID)}constructor(e,t,i,n,s,r,a,l,d,c){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=d,this._instantiationService=c,this._activeCodeActions=this._register(new An),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new yve(this._editor,s.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new Ru(()=>{const u=this._editor.getContribution(mg.ID);return u&&this._register(u.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),u}),this._resolver=n.createInstance(MS),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,n){var s;if(!this._editor.hasModel())return;(s=ho.get(this._editor))===null||s===void 0||s.closeMessage();const r=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:r}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,i){try{await this._instantiationService.invokeFunction(ave,e,TS.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:_o.QuickFix,filter:{}})}}async update(e){var t,i,n,s,r,a,l;if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let d;try{d=await e.actions}catch(c){nt(c);return}if(!this._disposed)if((i=this._lightBulbWidget.value)===null||i===void 0||i.update(d,e.trigger,e.position),e.trigger.type===1){if(!((n=e.trigger.filter)===null||n===void 0)&&n.include){const u=this.tryGetValidActionToApply(e.trigger,d);if(u){try{(s=this._lightBulbWidget.value)===null||s===void 0||s.hide(),await this._applyCodeAction(u,!1,!1)}finally{d.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,d);if(h&&h.action.disabled){(r=ho.get(this._editor))===null||r===void 0||r.showMessage(h.action.disabled,e.trigger.context.position),d.dispose();return}}}const c=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!d.allActions.length||!c&&!d.validActions.length)){(l=ho.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=d,d.dispose();return}this._activeCodeActions.value=d,this.showCodeActionList(d,this.toCoords(e.position),{includeDisabledActions:c,fromLightbulb:!1})}else this._actionWidgetService.isVisible?d.dispose():this._activeCodeActions.value=d}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}async showCodeActionList(e,t,i){const n=this._editor.createDecorationsCollection(),s=this._editor.getDomNode();if(!s)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=z.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(d,c)=>{this._applyCodeAction(d,!0,!!c),this._actionWidgetService.hide(),n.clear()},onHide:()=>{var d;(d=this._editor)===null||d===void 0||d.focus(),n.clear()},onHover:async(d,c)=>{var u;if(await d.resolve(c),!c.isCancellationRequested)return{canPreview:!!(!((u=d.action.edit)===null||u===void 0)&&u.edits.length)}},onFocus:d=>{var c,u;if(d&&d.highlightRange&&d.action.diagnostics){const h=[{range:d.action.diagnostics[0],options:V1.DECORATION}];n.set(h);const g=d.action.diagnostics[0],f=(u=(c=this._editor.getModel())===null||c===void 0?void 0:c.getWordAtPosition({lineNumber:g.startLineNumber,column:g.startColumn}))===null||u===void 0?void 0:u.word;hu(p("editingNewSelection","Context: {0} at line {1} and column {2}.",f,g.startLineNumber,g.startColumn))}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,hve(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,s,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=gn(this._editor.getDomNode()),n=i.left+t.left,s=i.top+t.top+t.height;return{x:n,y:s}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const n=e.documentation.map(s=>{var r;return{id:s.id,label:s.title,tooltip:(r=s.tooltip)!==null&&r!==void 0?r:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(s.id,...(a=s.arguments)!==null&&a!==void 0?a:[])}}});return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&n.push(this._showDisabled?{id:"hideMoreActions",label:p("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:p("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}};Cu.ID="editor.contrib.codeActionController";Cu.DECORATION=st.register({description:"quickfix-highlight",className:Dve});Cu=V1=Lve([id(1,Yl),id(2,Xe),id(3,qe),id(4,Me),id(5,Bu),id(6,Ri),id(7,Dt),id(8,Hg),id(9,qe)],Cu);Zr((o,e)=>{((n,s)=>{s&&e.addRule(`.monaco-editor ${n} { background-color: ${s}; }`)})(".quickfix-edit-highlight",o.getColor(wl));const i=o.getColor(Ic);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${xa(o.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function T0(o){return ae.regex(hV.keys()[0],new RegExp("(\\s|^)"+qo(o.value)+"\\b"))}const MR={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:p("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:p("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[p("args.schema.apply.first","Always apply the first returned code action."),p("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),p("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:p("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function zg(o,e,t,i,n=_o.Default){if(o.hasModel()){const s=Cu.get(o);s==null||s.manualTriggerAtCurrentPosition(e,n,t,i)}}class xve extends Te{constructor(){super({id:ER,label:p("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:ae.and(T.writable,T.hasCodeActionsProvider),kbOpts:{kbExpr:T.textInputFocus,primary:2137,weight:100}})}run(e,t){return zg(t,p("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,_o.QuickFix)}}class kve extends Rn{constructor(){super({id:iV,precondition:ae.and(T.writable,T.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:MR}]}})}runEditorCommand(e,t,i){const n=gl.fromUser(i,{kind:Ze.Empty,apply:"ifSingle"});return zg(t,typeof(i==null?void 0:i.kind)=="string"?n.preferred?p("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):p("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):n.preferred?p("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):p("editor.action.codeAction.noneMessage","No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class Ive extends Te{constructor(){super({id:sV,label:p("refactor.label","Refactor..."),alias:"Refactor...",precondition:ae.and(T.writable,T.hasCodeActionsProvider),kbOpts:{kbExpr:T.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:ae.and(T.writable,T0(Ze.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:MR}]}})}run(e,t,i){const n=gl.fromUser(i,{kind:Ze.Refactor,apply:"never"});return zg(t,typeof(i==null?void 0:i.kind)=="string"?n.preferred?p("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):p("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):n.preferred?p("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):p("editor.action.refactor.noneMessage","No refactorings available"),{include:Ze.Refactor.contains(n.kind)?n.kind:Ze.None,onlyIncludePreferredActions:n.preferred},n.apply,_o.Refactor)}}class Eve extends Te{constructor(){super({id:oV,label:p("source.label","Source Action..."),alias:"Source Action...",precondition:ae.and(T.writable,T.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:ae.and(T.writable,T0(Ze.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:MR}]}})}run(e,t,i){const n=gl.fromUser(i,{kind:Ze.Source,apply:"never"});return zg(t,typeof(i==null?void 0:i.kind)=="string"?n.preferred?p("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):p("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):n.preferred?p("editor.action.source.noneMessage.preferred","No preferred source actions available"):p("editor.action.source.noneMessage","No source actions available"),{include:Ze.Source.contains(n.kind)?n.kind:Ze.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,_o.SourceAction)}}class Nve extends Te{constructor(){super({id:NR,label:p("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:ae.and(T.writable,T0(Ze.SourceOrganizeImports)),kbOpts:{kbExpr:T.textInputFocus,primary:1581,weight:100}})}run(e,t){return zg(t,p("editor.action.organize.noneMessage","No organize imports action available"),{include:Ze.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",_o.OrganizeImports)}}class Tve extends Te{constructor(){super({id:TR,label:p("fixAll.label","Fix All"),alias:"Fix All",precondition:ae.and(T.writable,T0(Ze.SourceFixAll))})}run(e,t){return zg(t,p("fixAll.noneMessage","No fix all action available"),{include:Ze.SourceFixAll,includeSourceActions:!0},"ifSingle",_o.FixAll)}}class Mve extends Te{constructor(){super({id:nV,label:p("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:ae.and(T.writable,T0(Ze.QuickFix)),kbOpts:{kbExpr:T.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return zg(t,p("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Ze.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",_o.AutoFix)}}At(Cu.ID,Cu,3);At(mg.ID,mg,4);_e(xve);_e(Ive);_e(Eve);_e(Nve);_e(Mve);_e(Tve);we(new kve);xi.as(Va.Configuration).registerConfiguration({...Xy,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:p("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});xi.as(Va.Configuration).registerConfiguration({...Xy,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:5,description:p("includeNearbyQuickFixes","Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});class hT{constructor(){this.lenses=[],this._disposables=new de}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}async function fV(o,e,t){const i=o.ordered(e),n=new Map,s=new hT,r=i.map(async(a,l)=>{n.set(a,l);try{const d=await Promise.resolve(a.provideCodeLenses(e,t));d&&s.add(d,a)}catch(d){en(d)}});return await Promise.all(r),s.lenses=s.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:n.get(a.provider)n.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),s}Et.registerCommand("_executeCodeLensProvider",function(o,...e){let[t,i]=e;qt(ze.isUri(t)),qt(typeof i=="number"||!i);const{codeLensProvider:n}=o.get(Me),s=o.get(Si).getModel(t);if(!s)throw hr();const r=[],a=new de;return fV(n,s,vt.None).then(l=>{a.add(l);const d=[];for(const c of l.lenses)i==null||c.symbol.command?r.push(c.symbol):i-- >0&&c.provider.resolveCodeLens&&d.push(Promise.resolve(c.provider.resolveCodeLens(s,c.symbol,vt.None)).then(u=>r.push(u||c.symbol)));return Promise.all(d)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var Ave=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Rve=function(o,e){return function(t,i){e(t,i,o)}};const pV=bt("ICodeLensCache");class a3{constructor(e,t){this.lineCount=e,this.data=t}}let gT=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Pu(20,.75);const t="codelens/cache";g_(Ai,()=>e.remove(t,1));const i="codelens/cache2",n=e.get(i,1,"{}");this._deserialize(n),ye.once(e.onWillSaveState)(s=>{s.reason===rb.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(r=>{var a;return{range:r.symbol.range,command:r.symbol.command&&{id:"",title:(a=r.symbol.command)===null||a===void 0?void 0:a.title}}}),n=new hT;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const s=new a3(e.getLineCount(),n);this._cache.set(e.uri.toString(),s)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const n=new Set;for(const s of i.data.lenses)n.add(s.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const n=t[i],s=[];for(const a of n.lines)s.push({range:new k(a,1,a,11)});const r=new hT;r.add({lenses:s,dispose(){}},this._fakeProvider),this._cache.set(i,new a3(n.lineCount,r))}}catch{}}};gT=Ave([Rve(0,Xr)],gT);xt(pV,gT,1);class Pve{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class TL{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${TL._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let n=!1;for(let s=0;s{d.symbol.command&&l.push(d.symbol),i.addDecoration({range:d.symbol.range,options:l3},u=>this._decorationIds[c]=u),a?a=k.plusRange(a,d.symbol.range):a=k.lift(d.symbol.range)}),this._viewZone=new Pve(a.startLineNumber-1,s,r),this._viewZoneId=n.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new TL(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),n=this._data[t].symbol;return!!(i&&k.isEmpty(n.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,n)=>{t.addDecoration({range:i.symbol.range,options:l3},s=>this._decorationIds[n]=s)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},i_=function(o,e){return function(t,i){e(t,i,o)}};let Jp=class{constructor(e,t,i,n,s,r){this._editor=e,this._languageFeaturesService=t,this._commandService=n,this._notificationService=s,this._codeLensCache=r,this._disposables=new de,this._localToDispose=new de,this._lenses=[],this._oldCodeLensModels=new de,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Yt(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=this._editor.getOption(52)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(18),n=this._editor.getOption(50),{style:s}=this._editor.getContainerDomNode();s.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),s.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),s.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(s.setProperty("--vscode-editorCodeLens-fontFamily",i),s.setProperty("--vscode-editorCodeLens-fontFamilyDefault",co.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)===null||i===void 0||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&lu(()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const n of this._languageFeaturesService.codeLensProvider.all(e))if(typeof n.onDidChange=="function"){const s=n.onDidChange(()=>i.schedule());this._localToDispose.add(s)}const i=new Yt(()=>{var n;const s=Date.now();(n=this._getCodeLensModelPromise)===null||n===void 0||n.cancel(),this._getCodeLensModelPromise=_n(r=>fV(this._languageFeaturesService.codeLensProvider,e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);const a=this._provideCodeLensDebounce.update(e,Date.now()-s);i.delay=a,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},nt)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(je(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var n;this._editor.changeDecorations(s=>{this._editor.changeViewZones(r=>{const a=[];let l=-1;this._lenses.forEach(c=>{!c.isValid()||l===c.getLineNumber()?a.push(c):(c.update(r),l=c.getLineNumber())});const d=new sk;a.forEach(c=>{c.dispose(d,r),this._lenses.splice(this._lenses.indexOf(c),1)}),d.commit(s)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(n=this._resolveCodeLensesPromise)===null||n===void 0||n.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(n=>{n.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(je(()=>{if(this._editor.getModel()){const n=Ra.capture(this._editor);this._editor.changeDecorations(s=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(s,r)})}),n.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(n=>{if(n.target.type!==9)return;let s=n.target.element;if((s==null?void 0:s.tagName)==="SPAN"&&(s=s.parentElement),(s==null?void 0:s.tagName)==="A")for(const r of this._lenses){const a=r.getCommand(s);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new sk;for(const n of this._lenses)n.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let n;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(n&&n[n.length-1].symbol.range.startLineNumber===l?n.push(a):(n=[a],i.push(n)))}if(!i.length&&!this._lenses.length)return;const s=Ra.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const d=new sk;let c=0,u=0;for(;uthis._resolveCodeLensesInViewportSoon())),c++,u++)}for(;cthis._resolveCodeLensesInViewportSoon())),u++;d.commit(a)})}),s.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],n=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(i.push(l),n.push(a))}),i.length===0)return;const s=Date.now(),r=_n(a=>{const l=i.map((d,c)=>{const u=new Array(d.length),h=d.map((g,f)=>!g.symbol.command&&typeof g.provider.resolveCodeLens=="function"?Promise.resolve(g.provider.resolveCodeLens(t,g.symbol,a)).then(m=>{u[f]=m},en):(u[f]=g.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!n[c].isDisposed()&&n[c].updateCommands(u)})});return Promise.all(l)});this._resolveCodeLensesPromise=r,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-s);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{nt(a),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var e;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel}};Jp.ID="css.editor.codeLens";Jp=Ove([i_(1,Me),i_(2,wr),i_(3,Ri),i_(4,sn),i_(5,pV)],Jp);At(Jp.ID,Jp,1);_e(class extends Te{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:T.hasCodeLensProvider,label:p("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;const i=e.get(Ha),n=e.get(Ri),s=e.get(sn),r=t.getSelection().positionLineNumber,a=t.getContribution(Jp.ID);if(!a)return;const l=await a.getModel();if(!l)return;const d=[];for(const h of l.lenses)h.symbol.command&&h.symbol.range.startLineNumber===r&&d.push({label:h.symbol.command.title,command:h.symbol.command});if(d.length===0)return;const c=await i.pick(d,{canPickMany:!1,placeHolder:p("placeHolder","Select a command")});if(!c)return;let u=c.command;if(l.isDisposed){const h=await a.getModel(),g=h==null?void 0:h.lenses.find(f=>{var m;return f.symbol.range.startLineNumber===r&&((m=f.symbol.command)===null||m===void 0?void 0:m.title)===u.title});if(!g||!g.symbol.command)return;u=g.symbol.command}try{await n.executeCommand(u.id,...u.arguments||[])}catch(h){s.error(h)}}});var Fve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ok=function(o,e){return function(t,i){e(t,i,o)}};class AR{constructor(e,t){this._editorWorkerClient=new BM(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const n=t.range,s=t.color,r=s.alpha,a=new Y(new kt(Math.round(255*s.red),Math.round(255*s.green),Math.round(255*s.blue),r)),l=r?Y.Format.CSS.formatRGB(a):Y.Format.CSS.formatRGBA(a),d=r?Y.Format.CSS.formatHSL(a):Y.Format.CSS.formatHSLA(a),c=r?Y.Format.CSS.formatHex(a):Y.Format.CSS.formatHexA(a),u=[];return u.push({label:l,textEdit:{range:n,text:l}}),u.push({label:d,textEdit:{range:n,text:d}}),u.push({label:c,textEdit:{range:n,text:c}}),u}}let fT=class extends q{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new AR(e,t)))}};fT=Fve([ok(0,Si),ok(1,si),ok(2,Me)],fT);_L(fT);async function mV(o,e,t,i=!0){return RR(new Bve,o,e,t,i)}function _V(o,e,t,i){return Promise.resolve(t.provideColorPresentations(o,e,i))}class Bve{constructor(){}async compute(e,t,i,n){const s=await e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({colorInfo:r,provider:e});return Array.isArray(s)}}class Wve{constructor(){}async compute(e,t,i,n){const s=await e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(s)}}class Vve{constructor(e){this.colorInfo=e}async compute(e,t,i,n){const s=await e.provideColorPresentations(t,this.colorInfo,vt.None);return Array.isArray(s)&&n.push(...s),Array.isArray(s)}}async function RR(o,e,t,i,n){let s=!1,r;const a=[],l=e.ordered(t);for(let d=l.length-1;d>=0;d--){const c=l[d];if(c instanceof AR)r=c;else try{await o.compute(c,t,i,a)&&(s=!0)}catch(u){en(u)}}return s?a:r&&n?(await o.compute(r,t,i,a),a):[]}function vV(o,e){const{colorProvider:t}=o.get(Me),i=o.get(Si).getModel(e);if(!i)throw hr();const n=o.get(Dt).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:n}}Et.registerCommand("_executeDocumentColorProvider",function(o,...e){const[t]=e;if(!(t instanceof ze))throw hr();const{model:i,colorProviderRegistry:n,isDefaultColorDecoratorsEnabled:s}=vV(o,t);return RR(new Wve,n,i,vt.None,s)});Et.registerCommand("_executeColorPresentationProvider",function(o,...e){const[t,i]=e,{uri:n,range:s}=i;if(!(n instanceof ze)||!Array.isArray(t)||t.length!==4||!k.isIRange(s))throw hr();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=vV(o,n),[d,c,u,h]=t;return RR(new Vve({range:s,color:{red:d,green:c,blue:u,alpha:h}}),a,r,vt.None,l)});var Hve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},rk=function(o,e){return function(t,i){e(t,i,o)}},pT;const bV=Object.create({});let wu=pT=class extends q{constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new de),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new o0(this._editor),this._decoratorLimitReporter=new zve,this._colorDecorationClassRefs=this._register(new de),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:pT.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(s=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const a=r!==this._isColorDecoratorsEnabled||s.hasChanged(21),l=s.hasChanged(145);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const n=i.colorDecorators;if(n&&n.enable!==void 0&&!n.enable)return n.enable}return this._editor.getOption(20)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new qr,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=_n(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new ds(!1),n=await mV(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),n});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){nt(e)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:st.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((n,s)=>this._colorDatas.set(n,e[s]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(21);for(let s=0;sthis._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};wu.ID="editor.contrib.colorDetector";wu.RECOMPUTE_TIME=1e3;wu=pT=Hve([rk(1,Dt),rk(2,Me),rk(3,wr)],wu);class zve{constructor(){this._onDidChange=new W,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}At(wu.ID,wu,1);class $ve{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new W,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new W,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new W,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let n=0;n{this.backgroundColor=r.getColor(xw)||Y.white})),this._register(J(this._pickedColorNode,Se.CLICK,()=>this.model.selectNextColorPresentation())),this._register(J(this._originalColorNode,Se.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=Y.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new jve(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=Y.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}class jve extends q{constructor(e){super(),this._onClicked=this._register(new W),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),le(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),le(this._button,t),le(t,Bo(".button"+Ue.asCSSSelector(Zi("color-picker-close",ve.close,p("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class Kve extends q{constructor(e,t,i,n=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=Bo(".colorpicker-body"),le(e,this._domNode),this._saturationBox=new qve(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new Gve(this._domNode,this.model,n),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new Zve(this._domNode,this.model,n),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),n&&(this._insertButton=this._register(new Yve(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new Y(new pl(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new Y(new pl(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new Y(new pl(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class qve extends q{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new W,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new W,this.onColorFlushed=this._onColorFlushed.event,this._domNode=Bo(".saturation-wrap"),le(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",le(this._domNode,this._canvas),this.selection=Bo(".saturation-selection"),le(this._domNode,this.selection),this.layout(),this._register(J(this._domNode,Se.POINTER_DOWN,n=>this.onPointerDown(n))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new vm);const t=gn(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>this.onDidChangePosition(n.pageX-t.left,n.pageY-t.top),()=>null);const i=J(e.target.ownerDocument,Se.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new Y(new pl(e.h,1,1,1)),i=this._canvas.getContext("2d"),n=i.createLinearGradient(0,0,this._canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)");const s=i.createLinearGradient(0,0,0,this._canvas.height);s.addColorStop(0,"rgba(0, 0, 0, 0)"),s.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=Y.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=s,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class CV extends q{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new W,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new W,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=le(e,Bo(".standalone-strip")),this.overlay=le(this.domNode,Bo(".standalone-overlay"))):(this.domNode=le(e,Bo(".strip")),this.overlay=le(this.domNode,Bo(".overlay"))),this.slider=le(this.domNode,Bo(".slider")),this.slider.style.top="0px",this._register(J(this.domNode,Se.POINTER_DOWN,n=>this.onPointerDown(n))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new vm),i=gn(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangeTop(s.pageY-i.top),()=>null);const n=J(e.target.ownerDocument,Se.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class Gve extends CV{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:n}=e.rgba,s=new Y(new kt(t,i,n,1)),r=new Y(new kt(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${s} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class Zve extends CV{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class Yve extends q{constructor(e){super(),this._onClicked=this._register(new W),this.onClicked=this._onClicked.event,this._button=le(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=t=>{this._onClicked.fire()}}get button(){return this._button}}class Xve extends Gr{constructor(e,t,i,n,s=!1){super(),this.model=t,this.pixelRatio=i,this._register(yv.onDidChange(()=>this.layout()));const r=Bo(".colorpicker-widget");e.appendChild(r),this.header=this._register(new Uve(r,this.model,n,s)),this.body=this._register(new Kve(r,this.model,this.pixelRatio,s))}layout(){this.body.layout()}}var wV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},SV=function(o,e){return function(t,i){e(t,i,o)}};class Qve{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let AS=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return rn.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const n=wu.get(this._editor);if(!n)return[];for(const s of t){if(!n.isColorDecoration(s))continue;const r=n.getColorData(s.range.getStartPosition());if(r)return[await yV(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]}renderHoverParts(e,t){return LV(this,this._editor,this._themeService,t,e)}};AS=wV([SV(1,Sn)],AS);class Jve{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}}let wb=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}async createColorHover(e,t,i){if(!this._editor.hasModel()||!wu.get(this._editor))return null;const s=await mV(i,this._editor.getModel(),vt.None);let r=null,a=null;for(const u of s){const h=u.colorInfo;k.containsRange(h.range,e.range)&&(r=h,a=u.provider)}const l=r??e,d=a??t,c=!!r;return{colorHover:await yV(this,this._editor.getModel(),l,d),foundInEditor:c}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new k(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await H1(this._editor.getModel(),t,this._color,i,e),i=DV(this._editor,i,t))}renderHoverParts(e,t){return LV(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};wb=wV([SV(1,Sn)],wb);async function yV(o,e,t,i){const n=e.getValueInRange(t.range),{red:s,green:r,blue:a,alpha:l}=t.color,d=new kt(Math.round(s*255),Math.round(r*255),Math.round(a*255),l),c=new Y(d),u=await _V(e,t,i,vt.None),h=new $ve(c,[],0);return h.colorPresentations=u||[],h.guessColorPresentation(c,n),o instanceof AS?new Qve(o,k.lift(t.range),h,i):new Jve(o,k.lift(t.range),h,i)}function LV(o,e,t,i,n){if(i.length===0||!e.hasModel())return q.None;if(n.setMinimumDimensions){const h=e.getOption(66)+8;n.setMinimumDimensions(new Rt(302,h))}const s=new de,r=i[0],a=e.getModel(),l=r.model,d=s.add(new Xve(n.fragment,l,e.getOption(141),t,o instanceof wb));n.setColorPicker(d);let c=!1,u=new k(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(o instanceof wb){const h=i[0].model.color;o.color=h,H1(a,l,h,u,r),s.add(l.onColorFlushed(g=>{o.color=g}))}else s.add(l.onColorFlushed(async h=>{await H1(a,l,h,u,r),c=!0,u=DV(e,u,l,n)}));return s.add(l.onDidChangeColor(h=>{H1(a,l,h,u,r)})),s.add(e.onDidChangeModelContent(h=>{c?c=!1:(n.hide(),e.focus())})),s}function DV(o,e,t,i){let n,s;if(t.presentation.textEdit){n=[t.presentation.textEdit],s=new k(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const r=o.getModel()._setTrackedRange(null,s,3);o.pushUndoStop(),o.executeEdits("colorpicker",n),s=o.getModel()._getTrackedRange(r)||s}else n=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],s=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),o.pushUndoStop(),o.executeEdits("colorpicker",n);return t.presentation.additionalTextEdits&&(n=[...t.presentation.additionalTextEdits],o.executeEdits("colorpicker",n),i&&i.hide()),o.pushUndoStop(),s}async function H1(o,e,t,i,n){const s=await _V(o,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},n.provider,vt.None);e.colorPresentations=s||[]}function mT(o,e){return!!o[e]}class ak{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=mT(e.event,t.triggerModifier),this.hasSideBySideModifier=mT(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class c3{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=mT(e,t.triggerModifier)}}class FC{constructor(e,t,i,n){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function u3(o){return o==="altKey"?It?new FC(57,"metaKey",6,"altKey"):new FC(5,"ctrlKey",6,"altKey"):It?new FC(6,"altKey",57,"metaKey"):new FC(6,"altKey",5,"ctrlKey")}class ML extends q{constructor(e,t){var i;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new W),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new W),this.onExecute=this._onExecute.event,this._onCancel=this._register(new W),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(i=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&i!==void 0?i:n=>n.target.position?n.target.position.lineNumber:0,this._opts=u3(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(n=>{if(n.hasChanged(77)){const s=u3(this._editor.getOption(77));if(this._opts.equals(s))return;this._opts=s,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(n=>this._onEditorMouseMove(new ak(n,this._opts)))),this._register(this._editor.onMouseDown(n=>this._onEditorMouseDown(new ak(n,this._opts)))),this._register(this._editor.onMouseUp(n=>this._onEditorMouseUp(new ak(n,this._opts)))),this._register(this._editor.onKeyDown(n=>this._onEditorKeyDown(new c3(n,this._opts)))),this._register(this._editor.onKeyUp(n=>this._onEditorKeyUp(new c3(n,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(n=>this._onDidChangeCursorSelection(n))),this._register(this._editor.onDidChangeModel(n=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(n=>{(n.scrollTopChanged||n.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var ebe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nd=function(o,e){return function(t,i){e(t,i,o)}};let Su=class extends Vp{constructor(e,t,i,n,s,r,a,l,d,c,u,h,g){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,s,r,a,l,d,c,u,h,g),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(f=>this._onParentConfigurationChanged(f)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){ry(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Su=ebe([nd(4,qe),nd(5,Ot),nd(6,Ri),nd(7,Xe),nd(8,Sn),nd(9,sn),nd(10,Zl),nd(11,si),nd(12,Me)],Su);const h3=new Y(new kt(0,122,204)),tbe={showArrow:!0,showFrame:!0,className:"",frameColor:h3,arrowColor:h3,keepEditorSelection:!1},ibe="vs.editor.contrib.zoneWidget";class nbe{constructor(e,t,i,n,s,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=s,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class sbe{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class AL{constructor(e){this._editor=e,this._ruleName=AL._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),VI(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){VI(this._ruleName),pw(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:k.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}AL._IdGenerator=new BA(".arrow-decoration-");class obe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new de,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=gd(t),ry(this.options,tbe,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const n=this._getWidth(i);this.domNode.style.width=n+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(n)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new AL(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;const n=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(n))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=k.isIRange(e)?k.lift(e):k.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:st.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),s=this._getWidth(n);this.domNode.style.width=`${s}px`,this.domNode.style.left=this._getLeft(n)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,d=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(a/9)),this.editor.changeViewZones(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new nbe(r,i.lineNumber,i.column,t,g=>this._onViewZoneTop(g),g=>this._onViewZoneHeight(g),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new sbe(ibe+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const c=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=c+"px",this.container.style.overflow="hidden"),this._doLayout(c,s),this.options.keepEditorSelection||this.editor.setSelection(e);const u=this.editor.getModel();if(u){const h=u.validateRange(new k(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===u.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new ss(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(66),n=i<0?Math.ceil(i):Math.floor(i),s=e.heightInLines+n;s>5&&s<35&&this._relayout(s)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var xV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},kV=function(o,e){return function(t,i){e(t,i,o)}};const IV=bt("IPeekViewService");xt(IV,class{constructor(){this._widgets=new Map}addExclusiveWidget(o,e){const t=this._widgets.get(o);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const n=this._widgets.get(o);n&&n.widget===e&&(n.listener.dispose(),this._widgets.delete(o))};this._widgets.set(o,{widget:e,listener:e.onDidClose(i)})}},1);var Zs;(function(o){o.inPeekEditor=new De("inReferenceSearchEditor",!0,p("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),o.notInPeekEditor=o.inPeekEditor.toNegated()})(Zs||(Zs={}));let Sb=class{constructor(e,t){e instanceof Su&&Zs.inPeekEditor.bindTo(t)}dispose(){}};Sb.ID="editor.contrib.referenceController";Sb=xV([kV(1,Xe)],Sb);At(Sb.ID,Sb,0);function rbe(o){const e=o.get(Ot).getFocusedCodeEditor();return e instanceof Su?e.getParentEditor():e}const abe={headerBackgroundColor:Y.white,primaryHeadingColor:Y.fromHex("#333333"),secondaryHeadingColor:Y.fromHex("#6c6c6cb3")};let RS=class extends obe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new W,this.onDidClose=this._onDidClose.event,ry(this.options,abe,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){const t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=pe(".head"),this._bodyElement=pe(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=pe(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Wi(this._titleElement,"click",s=>this._onTitleClick(s))),le(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=pe("span.filename"),this._secondaryHeading=pe("span.dirname"),this._metaHeading=pe("span.meta"),le(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=pe(".peekview-actions");le(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new Cr(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Rs("peekview.close",p("label.close","Close"),Ue.asClassName(ve.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:qce.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:$n(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,oo(this._metaHeading)):xs(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(66)*1.2),n=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(n,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};RS=xV([kV(2,qe)],RS);const lbe=M("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:Y.black,hcLight:Y.white},p("peekViewTitleBackground","Background color of the peek view title area.")),EV=M("peekViewTitleLabel.foreground",{dark:Y.white,light:Y.black,hcDark:Y.white,hcLight:Fr},p("peekViewTitleForeground","Color of the peek view title.")),NV=M("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},p("peekViewTitleInfoForeground","Color of the peek view title info.")),dbe=M("peekView.border",{dark:Ks,light:Ks,hcDark:Lt,hcLight:Lt},p("peekViewBorder","Color of the peek view borders and arrow.")),cbe=M("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:Y.black,hcLight:Y.white},p("peekViewResultsBackground","Background color of the peek view result list."));M("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:Y.white,hcLight:Fr},p("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));M("peekViewResult.fileForeground",{dark:Y.white,light:"#1E1E1E",hcDark:Y.white,hcLight:Fr},p("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));M("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},p("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));M("peekViewResult.selectionForeground",{dark:Y.white,light:"#6C6C6C",hcDark:Y.white,hcLight:Fr},p("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const Pc=M("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:Y.black,hcLight:Y.white},p("peekViewEditorBackground","Background color of the peek view editor."));M("peekViewEditorGutter.background",{dark:Pc,light:Pc,hcDark:Pc,hcLight:Pc},p("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));M("peekViewEditorStickyScroll.background",{dark:Pc,light:Pc,hcDark:Pc,hcLight:Pc},p("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));M("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},p("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));M("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},p("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));M("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:fi,hcLight:fi},p("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));class yu{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=ZE.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?p({},"{0} in {1} on line {2} at column {3}",t.value,br(this.uri),this.range.startLineNumber,this.range.startColumn):p("aria.oneReference","in {0} on line {1} at column {2}",br(this.uri),this.range.startLineNumber,this.range.startColumn)}}class ube{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:s,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:n,column:s-t}),d=new k(n,l.startColumn,n,s),c=new k(r,a,r,1073741824),u=i.getValueInRange(d).replace(/^\s+/,""),h=i.getValueInRange(e),g=i.getValueInRange(c).replace(/\s+$/,"");return{value:u+h+g,highlight:{start:u.length,end:u.length+h.length}}}}class yb{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Gi}dispose(){jt(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?p("aria.fileReferences.1","1 symbol in {0}, full path {1}",br(this.uri),this.uri.fsPath):p("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,br(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=await e.createModelReference(t.uri);this._previews.set(t.uri,new ube(i))}catch(i){nt(i)}return this}}class go{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new W,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(go._compareReferences);let n;for(const s of e)if((!n||!pi.isEqual(n.uri,s.uri,!0))&&(n=new yb(this,s.uri),this.groups.push(n)),n.children.length===0||go._compareReferences(s,n.children[n.children.length-1])!==0){const r=new yu(i===s,n,s,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),n.children.push(r)}}dispose(){jt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new go(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?p("aria.result.0","No results found"):this.references.length===1?p("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?p("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):p("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let n=i.children.indexOf(e);const s=i.children.length,r=i.parent.groups.length;return r===1||t&&n+10?(t?n=(n+1)%s:n=(n+s-1)%s,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%r,i.parent.groups[n].children[0]):(n=(n+r-1)%r,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((n,s)=>({idx:s,prefixLen:Qh(n.uri.toString(),e.toString()),offsetDist:Math.abs(n.range.startLineNumber-t.lineNumber)*100+Math.abs(n.range.startColumn-t.column)})).sort((n,s)=>n.prefixLen>s.prefixLen?-1:n.prefixLens.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&k.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return pi.compare(e.uri,t.uri)||k.compareRangesUsingStarts(e.range,t.range)}}var RL=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},PL=function(o,e){return function(t,i){e(t,i,o)}},_T;let vT=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof go||e instanceof yb}getChildren(e){if(e instanceof go)return e.groups;if(e instanceof yb)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};vT=RL([PL(0,Xs)],vT);class hbe{getHeight(){return 23}getTemplateId(e){return e instanceof yb?Lb.id:M0.id}}let bT=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof yu){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return br(e.uri)}};bT=RL([PL(0,Xt)],bT);class gbe{getId(e){return e instanceof yu?e.id:e.uri}}let CT=class extends q{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new _S(i,{supportHighlights:!0})),this.badge=new vN(le(i,pe(".count")),{},y6),e.appendChild(i)}set(e,t){const i=qy(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(p("referencesCount","{0} references",n)):this.badge.setTitleFormat(p("referenceCount","{0} reference",n))}};CT=RL([PL(1,Hp)],CT);let Lb=_T=class{constructor(e){this._instantiationService=e,this.templateId=_T.id}renderTemplate(e){return this._instantiationService.createInstance(CT,e)}renderElement(e,t,i){i.set(e.element,p0(e.filterData))}disposeTemplate(e){e.dispose()}};Lb.id="FileReferencesRenderer";Lb=_T=RL([PL(0,qe)],Lb);class fbe{constructor(e){this.label=new Gc(e)}set(e,t){var i;const n=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!n||!n.value)this.label.set(`${br(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:s,highlight:r}=n;t&&!ka.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(s,p0(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(s,[r]))}}}class M0{constructor(){this.templateId=M0.id}renderTemplate(e){return new fbe(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}M0.id="OneReferenceRenderer";class pbe{getWidgetAriaLabel(){return p("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var mbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},sd=function(o,e){return function(t,i){e(t,i,o)}};class OL{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new de,this._callOnModelChange=new de,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let n=0,s=e.children.length;n{const s=n.deltaDecorations([],t);for(let r=0;r{s.equals(9)&&(this._keybindingService.dispatchEvent(s,s.target),s.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(vbe,"ReferencesWidget",this._treeContainer,new hbe,[this._instantiationService.createInstance(Lb),this._instantiationService.createInstance(M0)],this._instantiationService.createInstance(vT),i),this._splitView.addView({onDidChange:ye.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:s=>{this._preview.layout({height:this._dim.height,width:s})}},cS.Distribute),this._splitView.addView({onDidChange:ye.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:s=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${s}px`,this._tree.layout(this._dim.height,s)}},cS.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(s,r)=>{s instanceof yu&&(r==="show"&&this._revealReference(s,!1),this._onDidSelectReference.fire({element:s,kind:r,source:"tree"}))};this._tree.onDidOpen(s=>{s.sideBySide?n(s.element,"side"):s.editorOptions.pinned?n(s.element,"goto"):n(s.element,"show")}),xs(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Rt(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=p("noResults","No results"),oo(this._messageContainer),Promise.resolve(void 0)):(xs(this._messageContainer),this._decorationsManager=new OL(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),oo(this._treeContainer),oo(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof yu)return e;if(e instanceof yb&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==ot.inMemory?this.setTitle(Ooe(e.uri),this._uriLabel.getUriLabel(qy(e.uri))):this.setTitle(p("peekView.alternateTitle","References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent),this._tree.reveal(e));const n=await i;if(!this._model){n.dispose();return}jt(this._previewModelReference);const s=n.object;if(s){const r=this._preview.getModel()===s.textEditorModel?0:1,a=k.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(s.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}};wT=mbe([sd(3,Sn),sd(4,Xs),sd(5,qe),sd(6,IV),sd(7,Hp),sd(8,Gy),sd(9,Xt),sd(10,bi),sd(11,si)],wT);var bbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},of=function(o,e){return function(t,i){e(t,i,o)}},z1;const $g=new De("referenceSearchVisible",!1,p("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Lu=z1=class{static get(e){return e.getContribution(z1.ID)}constructor(e,t,i,n,s,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=s,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new de,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=$g.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&e.containsPosition(n))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const s="peekViewLayout",r=_be.fromJSON(this._storageService.get(s,0,"{}"));this._widget=this._instantiationService.createInstance(wT,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(p("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(s,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:d,kind:c}=l;if(d)switch(c){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(d,!1,!1);break;case"side":this.openReference(d,!0,!1);break;case"goto":i?this._gotoReference(d,!0):this.openReference(d,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var d;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(d=this._model)===null||d===void 0||d.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(p("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const c=this._editor.getModel().uri,u=new z(e.startLineNumber,e.startColumn),h=this._model.nearestReference(c,u);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(86)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const n=this._model.nextOrPreviousReference(i,e),s=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();await this._widget.setSelection(n),await this._gotoReference(n,!1),s?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){var t,i;(t=this._widget)===null||t===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var i;(i=this._widget)===null||i===void 0||i.hide(),this._ignoreModelChangeEvent=!0;const n=k.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:n,selectionSource:"code.jump",pinned:t}},this._editor).then(s=>{var r;if(this._ignoreModelChangeEvent=!1,!s||!this._widget){this.closeWidget();return}if(this._editor===s)this._widget.show(n),this._widget.focusOnReferenceTree();else{const a=z1.get(s),l=this._model.clone();this.closeWidget(),s.focus(),a==null||a.toggleWidget(n,_n(d=>Promise.resolve(l)),(r=this._peekMode)!==null&&r!==void 0?r:!1)}},s=>{this._ignoreModelChangeEvent=!1,nt(s)})}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:s}=e;this._editorService.openCodeEditor({resource:n,options:{selection:s,selectionSource:"code.jump",pinned:i}},this._editor,t)}};Lu.ID="editor.contrib.referencesController";Lu=z1=bbe([of(2,Xe),of(3,Ot),of(4,sn),of(5,qe),of(6,Xr),of(7,Dt)],Lu);function Ug(o,e){const t=rbe(o);if(!t)return;const i=Lu.get(t);i&&e(i)}Gs.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:fn(2089,60),when:ae.or($g,Zs.inPeekEditor),handler(o){Ug(o,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Gs.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:ae.or($g,Zs.inPeekEditor),handler(o){Ug(o,e=>{e.goToNextOrPreviousReference(!0)})}});Gs.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:ae.or($g,Zs.inPeekEditor),handler(o){Ug(o,e=>{e.goToNextOrPreviousReference(!1)})}});Et.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Et.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Et.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Et.registerCommand("closeReferenceSearch",o=>Ug(o,e=>e.closeWidget()));Gs.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:ae.and(Zs.inPeekEditor,ae.not("config.editor.stablePeek"))});Gs.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:ae.and($g,ae.not("config.editor.stablePeek"))});Gs.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:ae.and($g,z6,tR.negate(),iR.negate()),handler(o){var e;const i=(e=o.get(Lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof yu&&Ug(o,n=>n.revealReference(i[0]))}});Gs.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:ae.and($g,z6,tR.negate(),iR.negate()),handler(o){var e;const i=(e=o.get(Lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof yu&&Ug(o,n=>n.openReference(i[0],!0,!0))}});Et.registerCommand("openReference",o=>{var e;const i=(e=o.get(Lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof yu&&Ug(o,n=>n.openReference(i[0],!1,!0))});var TV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},E_=function(o,e){return function(t,i){e(t,i,o)}};const PR=new De("hasSymbols",!1,p("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),FL=bt("ISymbolNavigationService");let ST=class{constructor(e,t,i,n){this._editorService=t,this._notificationService=i,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=PR.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new yT(this._editorService),n=i.onDidChange(s=>{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),l=r.getPosition();if(!a||!l)return;let d=!1,c=!1;for(const u of t.references)if(dA(u.uri,a.uri))d=!0,c=c||k.containsPosition(u.range,l);else if(d)break;(!d||!c)&&this.reset()});this._currentState=Hr(i,n)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:k.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?p("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):p("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};ST=TV([E_(0,Xe),E_(1,Ot),E_(2,sn),E_(3,Xt)],ST);xt(FL,ST,1);we(new class extends Rn{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:PR,kbOpts:{weight:100,primary:70}})}runEditorCommand(o,e){return o.get(FL).revealNext(e)}});Gs.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:PR,primary:9,handler(o){o.get(FL).reset()}});let yT=class{constructor(e){this._listener=new Map,this._disposables=new de,this._onDidChange=new W,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),jt(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Hr(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};yT=TV([E_(0,Ot)],yT);async function A0(o,e,t,i){const s=t.ordered(o).map(a=>Promise.resolve(i(a,o,e)).then(void 0,l=>{en(l)})),r=await Promise.all(s);return Ia(r.flat())}function BL(o,e,t,i){return A0(e,t,o,(n,s,r)=>n.provideDefinition(s,r,i))}function MV(o,e,t,i){return A0(e,t,o,(n,s,r)=>n.provideDeclaration(s,r,i))}function AV(o,e,t,i){return A0(e,t,o,(n,s,r)=>n.provideImplementation(s,r,i))}function RV(o,e,t,i){return A0(e,t,o,(n,s,r)=>n.provideTypeDefinition(s,r,i))}function WL(o,e,t,i,n){return A0(e,t,o,async(s,r,a)=>{const l=await s.provideReferences(r,a,{includeDeclaration:!0},n);if(!i||!l||l.length!==2)return l;const d=await s.provideReferences(r,a,{includeDeclaration:!1},n);return d&&d.length===1?d:l})}async function R0(o){const e=await o(),t=new go(e,""),i=t.references.map(n=>n.link);return t.dispose(),i}ql("_executeDefinitionProvider",(o,e,t)=>{const i=o.get(Me),n=BL(i.definitionProvider,e,t,vt.None);return R0(()=>n)});ql("_executeTypeDefinitionProvider",(o,e,t)=>{const i=o.get(Me),n=RV(i.typeDefinitionProvider,e,t,vt.None);return R0(()=>n)});ql("_executeDeclarationProvider",(o,e,t)=>{const i=o.get(Me),n=MV(i.declarationProvider,e,t,vt.None);return R0(()=>n)});ql("_executeReferenceProvider",(o,e,t)=>{const i=o.get(Me),n=WL(i.referenceProvider,e,t,!1,vt.None);return R0(()=>n)});ql("_executeImplementationProvider",(o,e,t)=>{const i=o.get(Me),n=AV(i.implementationProvider,e,t,vt.None);return R0(()=>n)});var n_,s_,o_,BC,WC,VC,HC,zC;zn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextPeek,title:p("peek.submenu","Peek"),group:"navigation",order:100});class em{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof em||z.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class bs extends Wa{static all(){return bs._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of wt.wrap(t.menu))(i.id===N.EditorContext||i.id===N.EditorContextPeek)&&(i.when=ae.and(e.precondition,i.when));return t}constructor(e,t){super(bs._patchConfig(t)),this.configuration=e,bs._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const s=e.get(sn),r=e.get(Ot),a=e.get(Bu),l=e.get(FL),d=e.get(Me),c=e.get(qe),u=t.getModel(),h=t.getPosition(),g=em.is(i)?i:new em(u,h),f=new bu(t,5),m=Cy(this._getLocationModel(d,g.model,g.position,f.token),f.token).then(async v=>{var _;if(!v||f.token.isCancellationRequested)return;mo(v.ariaMessage);let b;if(v.referenceAt(u.uri,h)){const w=this._getAlternativeCommand(t);!bs._activeAlternativeCommands.has(w)&&bs._allSymbolNavigationCommands.has(w)&&(b=bs._allSymbolNavigationCommands.get(w))}const C=v.references.length;if(C===0){if(!this.configuration.muteMessage){const w=u.getWordAtPosition(h);(_=ho.get(t))===null||_===void 0||_.showMessage(this._getNoResultFoundMessage(w),h)}}else if(C===1&&b)bs._activeAlternativeCommands.add(this.desc.id),c.invokeFunction(w=>b.runEditorCommand(w,t,i,n).finally(()=>{bs._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,v,n)},v=>{s.error(v)}).finally(()=>{f.dispose()});return a.showWhile(m,250),m}async _onResult(e,t,i,n,s){const r=this._getGoToPreference(i);if(!(i instanceof Su)&&(this.configuration.openInPeek||r==="peek"&&n.references.length>1))this._openInPeek(i,n,s);else{const a=n.firstReference(),l=n.references.length>1&&r==="gotoAndPeek",d=await this._openReference(i,e,a,this.configuration.openToSide,!l);l&&d?this._openInPeek(d,n,s):n.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,i,n,s){let r;if(XZ(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:k.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,n);if(a){if(s){const l=a.getModel(),d=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&d.clear()},350)}return a}}_openInPeek(e,t,i){const n=Lu.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),_n(s=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}bs._allSymbolNavigationCommands=new Map;bs._activeAlternativeCommands=new Set;class P0 extends bs{async _getLocationModel(e,t,i,n){return new go(await BL(e.definitionProvider,t,i,n),p("def.title","Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?p("noResultWord","No definition found for '{0}'",e.word):p("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}mi((n_=class extends P0{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:n_.id,title:{value:p("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:p({},"Go to &&Definition")},precondition:ae.and(T.hasDefinitionProvider,T.isInWalkThroughSnippet.toNegated()),keybinding:[{when:T.editorTextFocus,primary:70,weight:100},{when:ae.and(T.editorTextFocus,W6),primary:2118,weight:100}],menu:[{id:N.EditorContext,group:"navigation",order:1.1},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Et.registerCommandAlias("editor.action.goToDeclaration",n_.id)}},n_.id="editor.action.revealDefinition",n_));mi((s_=class extends P0{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:s_.id,title:{value:p("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:ae.and(T.hasDefinitionProvider,T.isInWalkThroughSnippet.toNegated()),keybinding:[{when:T.editorTextFocus,primary:fn(2089,70),weight:100},{when:ae.and(T.editorTextFocus,W6),primary:fn(2089,2118),weight:100}]}),Et.registerCommandAlias("editor.action.openDeclarationToTheSide",s_.id)}},s_.id="editor.action.revealDefinitionAside",s_));mi((o_=class extends P0{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:o_.id,title:{value:p("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:ae.and(T.hasDefinitionProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:N.EditorContextPeek,group:"peek",order:2}}),Et.registerCommandAlias("editor.action.previewDeclaration",o_.id)}},o_.id="editor.action.peekDefinition",o_));class PV extends bs{async _getLocationModel(e,t,i,n){return new go(await MV(e.declarationProvider,t,i,n),p("decl.title","Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?p("decl.noResultWord","No declaration found for '{0}'",e.word):p("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}mi((BC=class extends PV{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:BC.id,title:{value:p("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:p({},"Go to &&Declaration")},precondition:ae.and(T.hasDeclarationProvider,T.isInWalkThroughSnippet.toNegated()),menu:[{id:N.EditorContext,group:"navigation",order:1.3},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?p("decl.noResultWord","No declaration found for '{0}'",e.word):p("decl.generic.noResults","No declaration found")}},BC.id="editor.action.revealDeclaration",BC));mi(class extends PV{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:p("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:ae.and(T.hasDeclarationProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:3}})}});class OV extends bs{async _getLocationModel(e,t,i,n){return new go(await RV(e.typeDefinitionProvider,t,i,n),p("typedef.title","Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?p("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):p("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}mi((WC=class extends OV{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:WC.ID,title:{value:p("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:p({},"Go to &&Type Definition")},precondition:ae.and(T.hasTypeDefinitionProvider,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.editorTextFocus,primary:0,weight:100},menu:[{id:N.EditorContext,group:"navigation",order:1.4},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},WC.ID="editor.action.goToTypeDefinition",WC));mi((VC=class extends OV{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:VC.ID,title:{value:p("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:ae.and(T.hasTypeDefinitionProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:4}})}},VC.ID="editor.action.peekTypeDefinition",VC));class FV extends bs{async _getLocationModel(e,t,i,n){return new go(await AV(e.implementationProvider,t,i,n),p("impl.title","Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?p("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):p("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}mi((HC=class extends FV{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:HC.ID,title:{value:p("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:p({},"Go to &&Implementations")},precondition:ae.and(T.hasImplementationProvider,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.editorTextFocus,primary:2118,weight:100},menu:[{id:N.EditorContext,group:"navigation",order:1.45},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},HC.ID="editor.action.goToImplementation",HC));mi((zC=class extends FV{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:zC.ID,title:{value:p("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:ae.and(T.hasImplementationProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.editorTextFocus,primary:3142,weight:100},menu:{id:N.EditorContextPeek,group:"peek",order:5}})}},zC.ID="editor.action.peekImplementation",zC));class BV extends bs{_getNoResultFoundMessage(e){return e?p("references.no","No references found for '{0}'",e.word):p("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}mi(class extends BV{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:p("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:p({},"Go to &&References")},precondition:ae.and(T.hasReferenceProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.editorTextFocus,primary:1094,weight:100},menu:[{id:N.EditorContext,group:"navigation",order:1.45},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,n){return new go(await WL(e.referenceProvider,t,i,!0,n),p("ref.title","References"))}});mi(class extends BV{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:p("references.action.label","Peek References"),original:"Peek References"},precondition:ae.and(T.hasReferenceProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,n){return new go(await WL(e.referenceProvider,t,i,!1,n),p("ref.title","References"))}});class Cbe extends bs{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:p("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:ae.and(Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,n){return new go(this._references,p("generic.title","Locations"))}_getNoResultFoundMessage(e){return e&&p("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}Et.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:ze},{name:"position",description:"The position at which to start",constraint:z.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(o,e,t,i,n,s,r)=>{qt(ze.isUri(e)),qt(z.isIPosition(t)),qt(Array.isArray(i)),qt(typeof n>"u"||typeof n=="string"),qt(typeof r>"u"||typeof r=="boolean");const a=o.get(Ot),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if($l(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(d=>{const c=new class extends Cbe{_getNoResultFoundMessage(u){return s||super._getNoResultFoundMessage(u)}}({muteMessage:!s,openInPeek:!!r,openToSide:!1},i,n);d.get(qe).invokeFunction(c.run.bind(c),l)})}});Et.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:ze},{name:"position",description:"The position at which to start",constraint:z.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:async(o,e,t,i,n)=>{o.get(Ri).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)}});Et.registerCommand({id:"editor.action.findReferences",handler:(o,e,t)=>{qt(ze.isUri(e)),qt(z.isIPosition(t));const i=o.get(Me),n=o.get(Ot);return n.openCodeEditor({resource:e},n.getFocusedCodeEditor()).then(s=>{if(!$l(s)||!s.hasModel())return;const r=Lu.get(s);if(!r)return;const a=_n(d=>WL(i.referenceProvider,s.getModel(),z.lift(t),!1,d).then(c=>new go(c,p("ref.title","References")))),l=new k(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});Et.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var wbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},lk=function(o,e){return function(t,i){e(t,i,o)}},N_;let bg=N_=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new de,this.toUnhookForKeyboard=new de,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const s=new ML(e);this.toUnhook.add(s),this.toUnhook.add(s.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(s.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{nt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(s.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(N_.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}async startFindDefinition(e){var t;this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const n=new xW(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=_n(a=>this.findDefinition(e,a));let s;try{s=await this.previousPromise}catch(a){nt(a);return}if(!s||!s.length||!n.validate(this.editor)){this.removeLinkDecorations();return}const r=s[0].originSelectionRange?k.lift(s[0].originSelectionRange):new k(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(s.length>1){let a=r;for(const{originSelectionRange:l}of s)l&&(a=k.plusRange(a,l));this.addDecoration(a,new as().appendText(p("multipleResults","Click to show {0} definitions.",s.length)))}else{const a=s[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:d}}=l,{startLineNumber:c}=a.range;if(c<1||c>d.getLineCount()){l.dispose();return}const u=this.getPreviewValue(d,c,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(d.uri);this.addDecoration(r,u?new as().appendCodeblock(h||"",u):void 0),l.dispose()})}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=N_.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let s=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const n=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(i);return new P0({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Xe);return Zs.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};bg.ID="editor.contrib.gotodefinitionatposition";bg.MAX_SOURCE_PREVIEW_LINES=8;bg=N_=wbe([lk(1,Xs),lk(2,bi),lk(3,Me)],bg);At(bg.ID,bg,2);const $C=pe;class WV extends q{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new a0(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class OR extends q{static render(e,t,i){return new OR(e,t,i)}constructor(e,t,i){super(),this.actionContainer=le(e,$C("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=le(this.actionContainer,$C("a.action")),this.action.setAttribute("role","button"),t.iconClass&&le(this.action,$C(`span.icon.${t.iconClass}`));const n=le(this.action,$C("span"));n.textContent=i?`${t.label} (${i})`:t.label,this._register(J(this.actionContainer,Se.CLICK,s=>{s.stopPropagation(),s.preventDefault(),t.run(this.actionContainer)})),this._register(J(this.actionContainer,Se.KEY_DOWN,s=>{const r=new gi(s);(r.equals(3)||r.equals(10))&&(s.stopPropagation(),s.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function Sbe(o,e){return o&&e?p("acessibleViewHint","Inspect this in the accessible view with {0}.",e):o?p("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}let ybe=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class VV extends q{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new W),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Yt(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Yt(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Yt(()=>this._triggerLoadingMessage(),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(60).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=lX(e=>this._computer.computeAsync(e)),(async()=>{try{for await(const e of this._asyncIterable)e&&(this._result.push(e),this._fireResult());this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(e){nt(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){this._state===3&&this._setState(4)}_fireResult(){if(this._state===1||this._state===2)return;const e=this._state===0,t=this._state===4;this._onResult.fire(new ybe(this._result.slice(0),e,t))}start(e){if(e===0)this._state===0&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(0,!1)}}class dk{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class $1{constructor(e,t,i,n,s,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=s,this.supportsMarkerHover=r,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}const jg=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class FR{constructor(){this._onDidWillResize=new W,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new W,this.onDidResize=this._onDidResize.event,this._sashListener=new de,this._size=new Rt(0,0),this._minSize=new Rt(0,0),this._maxSize=new Rt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new ss(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new ss(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new ss(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:lS.North}),this._southSash=new ss(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:lS.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(ye.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(ye.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(n=>{e&&(i=n.currentX-n.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(n=>{e&&(i=-(n.currentX-n.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(n=>{e&&(t=-(n.currentY-n.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(ye.any(this._eastSash.onDidReset,this._westSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(ye.any(this._northSash.onDidReset,this._southSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,n){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=n?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:s,width:r}=this._maxSize;e=Math.max(i,Math.min(s,e)),t=Math.max(n,Math.min(r,t));const a=new Rt(t,e);Rt.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const Lbe=30,Dbe=24;class xbe extends q{constructor(e,t=new Rt(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new FR),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Rt.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new Rt(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?z.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:gn(t).top+i.top-Lbe}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=gn(t),s=ng(t.ownerDocument.body),r=n.top+i.top+i.height;return s.height-r-Dbe}_findPositionPreference(e,t){var i,n;const s=Math.min((i=this._availableVerticalSpaceBelow(t))!==null&&i!==void 0?i:1/0,e),r=Math.min((n=this._availableVerticalSpaceAbove(t))!==null&&n!==void 0?n:1/0,e),a=Math.min(Math.max(r,s),e),l=Math.min(e,a);let d;return this._editor.getOption(60).above?d=l<=r?1:2:d=l<=s?2:1,d===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),d}_resize(e){this._resizableNode.layout(e.height,e.width)}}var BR=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Oh=function(o,e){return function(t,i){e(t,i,o)}},U1,Xa;const g3=pe;let PS=U1=class extends q{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(Xc,this._editor)),this._participants=[];for(const n of jg.getAll())this._participants.push(this._instantiationService.createInstance(n,this._editor));this._participants.sort((n,s)=>n.hoverOrdinal-s.hoverOrdinal),this._computer=new FS(this._editor,this._participants),this._hoverOperation=this._register(new VV(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{if(!this._computer.anchor)return;const s=n.hasLoadingMessage?this._addLoadingMessage(n.value):n.value;this._withResult(new HV(this._computer.anchor,s,n.isComplete))})),this._register(Wi(this._widget.getDomNode(),"keydown",n=>{n.equals(9)&&this.hide()})),this._register(Ei.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;const t=[];for(const n of this._participants)if(n.suggestHoverAnchor){const s=n.suggestHoverAnchor(e);s&&t.push(s)}const i=e.target;if(i.type===6&&t.push(new dk(0,i.range,e.event.posx,e.event.posy)),i.type===7){const n=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexts.priority-n.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new dk(0,e,void 0,void 0),t,i,n,null)}_startShowingOrUpdateHover(e,t,i,n,s){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):!1:this._editor.getOption(60).sticky&&s&&this._widget.isMouseGettingCloser(s.event.posx,s.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,n,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,n,s){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=n,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=s,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:n,highlightRange:s}=U1.computeHoverRanges(this._editor,e.range,t),r=new de,a=r.add(new OS(this._keybindingService)),l=document.createDocumentFragment();let d=null;const c={fragment:l,statusBar:a,setColorPicker:h=>d=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const g=t.filter(f=>f.owner===h);g.length>0&&r.add(h.renderHoverParts(c,g))}const u=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(s){const h=this._editor.createDecorationsCollection();h.set([{range:s,options:U1._DECORATION_OPTIONS}]),r.add(je(()=>{h.clear()}))}this._widget.showAt(l,new Ibe(d,i,n,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,u,e.initialMousePosX,e.initialMousePosY,r))}else r.dispose()}static computeHoverRanges(e,t,i){let n=1;if(e.hasModel()){const d=e._getViewModel(),c=d.coordinatesConverter,u=c.convertModelRangeToViewRange(t),h=new z(u.startLineNumber,d.getLineMinColumn(u.startLineNumber));n=c.convertViewPositionToModelPosition(h).column}const s=t.startLineNumber;let r=t.startColumn,a=i[0].range,l=null;for(const d of i)a=k.plusRange(a,d.range),d.range.startLineNumber===s&&d.range.endLineNumber===s&&(r=Math.max(Math.min(r,d.range.startColumn),n)),d.forceShowAtRange&&(l=d.range);return{showAtPosition:l?l.getStartPosition():new z(s,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new z(s,r),highlightRange:a}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};PS._DECORATION_OPTIONS=st.register({description:"content-hover-highlight",className:"hoverHighlight"});PS=U1=BR([Oh(1,qe),Oh(2,Xt)],PS);class HV{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new kbe(this,this.anchor,t,this.isComplete)}}class kbe extends HV{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}class Ibe{constructor(e,t,i,n,s,r,a,l,d,c){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=n,this.stoleFocus=s,this.source=r,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=d,this.disposables=c,this.closestMouseDistance=void 0}}const f3=30,ck=10,Ebe=6;let Xc=Xa=class extends xbe{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,i,n,s){const r=e.getOption(66)+8,a=150,l=new Rt(a,r);super(e,l),this._configurationService=i,this._accessibilityService=n,this._keybindingService=s,this._hover=this._register(new WV),this._minimumSize=l,this._hoverVisibleKey=T.hoverVisible.bindTo(t),this._hoverFocusedKey=T.hoverFocused.bindTo(t),le(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(c=>{c.hasChanged(50)&&this._updateFont()}));const d=this._register(Pl(this._resizableNode.domNode));this._register(d.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(d.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return Xa.ID}static _applyDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.width=n,e.style.height=s}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return Xa._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return Xa._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=s}_setHoverWidgetMaxDimensions(e,t){Xa._applyMaxDimensions(this._hover.contentsDomNode,e,t),Xa._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,i-ck))}_updateResizableNodeMaxDimensions(){var e,t;const i=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,n=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new Rt(i,n),this._setHoverWidgetMaxDimensions(i,n)}_resize(e){var t,i;Xa._lastDimensions=new Rt(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(i=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||i===void 0||i.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=Ebe;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=ck),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=gn(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=p3(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const n=p3(e,t,i.left,i.top,i.width,i.height);return n>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,n),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(s=>this._editor.applyFontInfo(s))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,Xa._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,Xa._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var i,n,s,r;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=kh(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(i=this._findPositionPreference(a,l))!==null&&i!==void 0?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(n=t.colorPicker)===null||n===void 0||n.layout();const c=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&Sbe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(r=(s=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||s===void 0?void 0:s.getAriaLabel())!==null&&r!==void 0?r:"");c&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+c)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new Rt(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;const i=this._hover.containerDomNode,n=this._hover.contentsDomNode,s=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(zs(i),Math.min(s,e)),this._setContentsDomNodeDimensions(zs(n),Math.min(s,e-ck))}setMinimumDimensions(e){this._minimumSize=new Rt(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Rt(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=kh(t),n=zs(t);if(this._resizableNode.layout(i,n),this._setHoverWidgetDimensions(n,i),i=kh(t),n=zs(t),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(i,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(i)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const s=kh(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(s,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-f3})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+f3})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};Xc.ID="editor.contrib.resizableContentHoverWidget";Xc._lastDimensions=new Rt(0,0);Xc=Xa=BR([Oh(1,Xe),Oh(2,Dt),Oh(3,Zl),Oh(4,Xt)],Xc);let OS=class extends q{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=g3("div.hover-row.status-bar"),this.actionsElement=le(this.hoverElement,g3("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(OR.render(this.actionsElement,e,i))}append(e){const t=le(this.actionsElement,e);return this._hasContent=!0,t}};OS=BR([Oh(0,Xt)],OS);class FS{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const s=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===n?r.range.startColumn:1,l=r.range.endLineNumber===n?r.range.endColumn:s;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return rn.EMPTY;const i=FS._getLineDecorations(this._editor,t);return rn.merge(this._participants.map(n=>n.computeAsync?n.computeAsync(t,i,e):rn.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=FS._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Ia(t)}}function p3(o,e,t,i,n,s){const r=t+n/2,a=i+s/2,l=Math.max(Math.abs(o-r)-n/2,0),d=Math.max(Math.abs(e-a)-s/2,0);return Math.sqrt(l*l+d*d)}const m3=pe;class vp extends q{constructor(e,t,i){super(),this._renderDisposeables=this._register(new de),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new WV),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Ud({editor:this._editor},t,i)),this._computer=new Nbe(this._editor),this._hoverOperation=this._register(new VV(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{this._withResult(n.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return vp.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const n of t){const s=m3("div.hover-row.markdown-hover"),r=le(s,m3("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(n.value));r.appendChild(a.element),i.appendChild(s)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),n=this._editor.getScrollTop(),s=this._editor.getOption(66),r=this._hover.containerDomNode.clientHeight,a=i-n-(r-s)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}vp.ID="editor.contrib.modesGlyphHoverWidget";class Nbe{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=n=>({value:n}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const n of t){if(!n.options.glyphMarginClassName)continue;const s=n.options.glyphMarginHoverMessage;!s||Up(s)||i.push(...Z2(s).map(e))}return i}}class Tbe{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function Mbe(o,e,t,i,n){try{const s=await Promise.resolve(o.provideHover(t,i,n));if(s&&Rbe(s))return new Tbe(o,s,e)}catch(s){en(s)}}function WR(o,e,t,i){const s=o.ordered(e).map((r,a)=>Mbe(r,a,e,t,i));return rn.fromPromises(s).coalesce()}function Abe(o,e,t,i){return WR(o,e,t,i).map(n=>n.hover).toPromise()}ql("_executeHoverProvider",(o,e,t)=>{const i=o.get(Me);return Abe(i.hoverProvider,e,t,vt.None)});function Rbe(o){const e=typeof o.range<"u",t=typeof o.contents<"u"&&o.contents&&o.contents.length>0;return e&&t}var Pbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},UC=function(o,e){return function(t,i){e(t,i,o)}};const _3=pe;class ba{constructor(e,t,i,n,s){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=s}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let BS=class{constructor(e,t,i,n,s){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=n,this._languageFeaturesService=s,this.hoverOrdinal=3}createLoadingMessage(e){return new ba(this,e.range,[new as().appendText(p("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,s=i.getLineMaxColumn(n),r=[];let a=1e3;const l=i.getLineLength(n),d=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),c=this._editor.getOption(116),u=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:d});let h=!1;c>=0&&l>c&&e.range.startColumn>=c&&(h=!0,r.push(new ba(this,e.range,[{value:p("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof u=="number"&&l>=u&&r.push(new ba(this,e.range,[{value:p("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let g=!1;for(const f of t){const m=f.range.startLineNumber===n?f.range.startColumn:1,v=f.range.endLineNumber===n?f.range.endColumn:s,_=f.options.hoverMessage;if(!_||Up(_))continue;f.options.beforeContentClassName&&(g=!0);const b=new k(e.range.startLineNumber,m,e.range.startLineNumber,v);r.push(new ba(this,b,Z2(_),g,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return rn.EMPTY;const n=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(n))return rn.EMPTY;const s=new z(e.range.startLineNumber,e.range.startColumn);return WR(this._languageFeaturesService.hoverProvider,n,s,i).filter(r=>!Up(r.hover.contents)).map(r=>{const a=r.hover.range?k.lift(r.hover.range):e.range;return new ba(this,a,r.hover.contents,!1,r.ordinal)})}renderHoverParts(e,t){return zV(e,t,this._editor,this._languageService,this._openerService)}};BS=Pbe([UC(1,bi),UC(2,So),UC(3,Dt),UC(4,Me)],BS);function zV(o,e,t,i,n){e.sort((r,a)=>r.ordinal-a.ordinal);const s=new de;for(const r of e)for(const a of r.contents){if(Up(a))continue;const l=_3("div.hover-row.markdown-hover"),d=le(l,_3("div.hover-contents")),c=s.add(new Ud({editor:t},i,n));s.add(c.onDidRenderAsync(()=>{d.className="hover-contents code-hover-contents",o.onContentsChanged()}));const u=s.add(c.render(a));d.appendChild(u.element),o.fragment.appendChild(l)}return s}var $V=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},WS=function(o,e){return function(t,i){e(t,i,o)}};class v3{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let LT=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new W,this.onDidChange=this._onDidChange.event,this._dispoables=new de,this._markers=[],this._nextIdx=-1,ze.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),s=(a,l)=>{let d=Sv(a.resource.toString(),l.resource.toString());return d===0&&(n==="position"?d=k.compareRangesUsingStarts(a,l)||Mi.compare(a.severity,l.severity):d=Mi.compare(a.severity,l.severity)||k.compareRangesUsingStarts(a,l)),d},r=()=>{this._markers=this._markerService.read({resource:ze.isUri(e)?e:void 0,severities:Mi.Error|Mi.Warning|Mi.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(s)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(r(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new v3(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,s=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());s<0&&(s=fv(this._markers,{resource:e.uri},(r,a)=>Sv(r.resource.toString(),a.resource.toString())),s<0&&(s=~s));for(let r=s;rn.resource.toString()===e.toString());if(!(i<0)){for(;i=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},rf=function(o,e){return function(t,i){e(t,i,o)}},kT;class Fbe{constructor(e,t,i,n,s){this._openerService=n,this._labelService=s,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new de,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(Wi(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new K7(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){jt(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:s}=e;let r=((t==null?void 0:t.length)||0)+2;s&&(typeof s=="string"?r+=s.length:r+=s.value.length);const a=Rl(i);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+r,this._longestLineLength);$n(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||s){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const g=document.createElement("span");g.innerText=t,g.classList.add("source"),h.appendChild(g)}if(s)if(typeof s=="string"){const g=document.createElement("span");g.innerText=`(${s})`,g.classList.add("code"),h.appendChild(g)}else{this._codeLink=pe("a.code-link"),this._codeLink.setAttribute("href",`${s.target.toString()}`),this._codeLink.onclick=f=>{this._openerService.open(s.target,{allowCommands:!0}),f.preventDefault(),f.stopPropagation()};const g=le(this._codeLink,pe("span"));g.innerText=s.value,h.appendChild(this._codeLink)}}if($n(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),ls(n)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(const g of n){const f=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${this._labelService.getUriBasenameLabel(g.resource)}(${g.startLineNumber}, ${g.startColumn}): `,m.title=this._labelService.getUriLabel(g.resource),this._relatedDiagnostics.set(m,g);const v=document.createElement("span");v.innerText=g.message,f.appendChild(m),f.appendChild(v),this._lines+=1,h.appendChild(f)}}const d=this._editor.getOption(50),c=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),u=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:c,scrollHeight:u})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case Mi.Error:t=p("Error","Error");break;case Mi.Warning:t=p("Warning","Warning");break;case Mi.Info:t=p("Info","Info");break;case Mi.Hint:t=p("Hint","Hint");break}let i=p("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();return n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1&&(i=`${n.getLineContent(e.startLineNumber)}, ${i}`),i}}let tm=kT=class extends RS{constructor(e,t,i,n,s,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},s),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new de,this._onDidSelectRelatedInformation=new W,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Mi.Warning,this._backgroundColor=Y.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(Hbe);let t=IT,i=Bbe;this._severity===Mi.Warning?(t=j1,i=Wbe):this._severity===Mi.Info&&(t=ET,i=Vbe);const n=e.getColor(t),s=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:s,primaryHeadingColor:e.getColor(EV),secondaryHeadingColor:e.getColor(NV)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(n=>this.editor.focus()));const t=[],i=this._menuService.createMenu(kT.TitleMenu,this._contextKeyService);VA(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=le(e,pe(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new Fbe(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const n=k.lift(e),s=this.editor.getPosition(),r=s&&n.containsPosition(s)?s:n.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?p("problems","{0} of {1} problems",t,i):p("change","{0} of {1} problem",t,i);this.setTitle(br(a.uri),l)}this._icon.className=`codicon ${xT.className(Mi.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};tm.TitleMenu=new N("gotoErrorTitleMenu");tm=kT=Obe([rf(1,Sn),rf(2,So),rf(3,Ba),rf(4,qe),rf(5,Xe),rf(6,Hp)],tm);const b3=Vv(vl,vte),C3=Vv(zo,Bv),w3=Vv(Ks,Wv),IT=M("editorMarkerNavigationError.background",{dark:b3,light:b3,hcDark:Lt,hcLight:Lt},p("editorMarkerNavigationError","Editor marker navigation widget error color.")),Bbe=M("editorMarkerNavigationError.headerBackground",{dark:We(IT,.1),light:We(IT,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),j1=M("editorMarkerNavigationWarning.background",{dark:C3,light:C3,hcDark:Lt,hcLight:Lt},p("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),Wbe=M("editorMarkerNavigationWarning.headerBackground",{dark:We(j1,.1),light:We(j1,.1),hcDark:"#0C141F",hcLight:We(j1,.2)},p("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),ET=M("editorMarkerNavigationInfo.background",{dark:w3,light:w3,hcDark:Lt,hcLight:Lt},p("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),Vbe=M("editorMarkerNavigationInfo.headerBackground",{dark:We(ET,.1),light:We(ET,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),Hbe=M("editorMarkerNavigation.background",{dark:wn,light:wn,hcDark:wn,hcLight:wn},p("editorMarkerNavigationBackground","Editor marker navigation widget background."));var zbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},jC=function(o,e){return function(t,i){e(t,i,o)}},T_;let Du=T_=class{static get(e){return e.getContribution(T_.ID)}constructor(e,t,i,n,s){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=s,this._sessionDispoables=new de,this._editor=e,this._widgetVisible=jV.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(tm,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{var n,s,r;(!(!((n=this._model)===null||n===void 0)&&n.selected)||!k.containsPosition((s=this._model)===null||s===void 0?void 0:s.selected.marker,i.position))&&((r=this._model)===null||r===void 0||r.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:k.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new z(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){var i,n;if(this._editor.hasModel()){const s=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(s.move(e,this._editor.getModel(),this._editor.getPosition()),!s.selected)return;if(s.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const r=await this._editorService.openCodeEditor({resource:s.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:s.selected.marker}},this._editor);r&&((i=T_.get(r))===null||i===void 0||i.close(),(n=T_.get(r))===null||n===void 0||n.nagivate(e,t))}else this._widget.showAtMarker(s.selected.marker,s.selected.index,s.selected.total)}}};Du.ID="editor.contrib.markerController";Du=T_=zbe([jC(1,UV),jC(2,Xe),jC(3,Ot),jC(4,qe)],Du);class VL extends Te{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){var i;t.hasModel()&&((i=Du.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))}}class Qc extends VL{constructor(){super(!0,!1,{id:Qc.ID,label:Qc.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:578,weight:100},menuOpts:{menuId:tm.TitleMenu,title:Qc.LABEL,icon:Zi("marker-navigation-next",ve.arrowDown,p("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Qc.ID="editor.action.marker.next";Qc.LABEL=p("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class Kh extends VL{constructor(){super(!1,!1,{id:Kh.ID,label:Kh.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:1602,weight:100},menuOpts:{menuId:tm.TitleMenu,title:Kh.LABEL,icon:Zi("marker-navigation-previous",ve.arrowUp,p("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}Kh.ID="editor.action.marker.prev";Kh.LABEL=p("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class $be extends VL{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:p("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:66,weight:100},menuOpts:{menuId:N.MenubarGoMenu,title:p({},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class Ube extends VL{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:p("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:1090,weight:100},menuOpts:{menuId:N.MenubarGoMenu,title:p({},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}At(Du.ID,Du,4);_e(Qc);_e(Kh);_e($be);_e(Ube);const jV=new De("markersNavigationVisible",!1),jbe=Rn.bindToContribution(Du.get);we(new jbe({id:"closeMarkersNavigation",precondition:jV,handler:o=>o.close(),kbOpts:{weight:150,kbExpr:T.focus,primary:9,secondary:[1033]}}));var Kbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},uk=function(o,e){return function(t,i){e(t,i,o)}};const Ir=pe;class qbe{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const S3={type:1,filter:{include:Ze.QuickFix},triggerAction:_o.QuickFixHover};let NT=class{constructor(e,t,i,n){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=n,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,s=i.getLineMaxColumn(n),r=[];for(const a of t){const l=a.range.startLineNumber===n?a.range.startColumn:1,d=a.range.endLineNumber===n?a.range.endColumn:s,c=this._markerDecorationsService.getMarker(i.uri,a);if(!c)continue;const u=new k(e.range.startLineNumber,l,e.range.startLineNumber,d);r.push(new qbe(this,u,c))}return r}renderHoverParts(e,t){if(!t.length)return q.None;const i=new de;t.forEach(s=>e.fragment.appendChild(this.renderMarkerHover(s,i)));const n=t.length===1?t[0]:t.sort((s,r)=>Mi.compare(s.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,n,i),i}renderMarkerHover(e,t){const i=Ir("div.hover-row"),n=le(i,Ir("div.marker.hover-contents")),{source:s,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const d=le(n,Ir("span"));if(d.style.whiteSpace="pre-wrap",d.innerText=r,s||a)if(a&&typeof a!="string"){const c=Ir("span");if(s){const f=le(c,Ir("span"));f.innerText=s}const u=le(c,Ir("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(J(u,"click",f=>{this._openerService.open(a.target,{allowCommands:!0}),f.preventDefault(),f.stopPropagation()}));const h=le(u,Ir("span"));h.innerText=a.value;const g=le(n,c);g.style.opacity="0.6",g.style.paddingLeft="6px"}else{const c=le(n,Ir("span"));c.style.opacity="0.6",c.style.paddingLeft="6px",c.innerText=s&&a?`${s}(${a})`:s||`(${a})`}if(ls(l))for(const{message:c,resource:u,startLineNumber:h,startColumn:g}of l){const f=le(n,Ir("div"));f.style.marginTop="8px";const m=le(f,Ir("a"));m.innerText=`${br(u)}(${h}, ${g}): `,m.style.cursor="pointer",t.add(J(m,"click",_=>{_.stopPropagation(),_.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:g}}}).catch(nt)}));const v=le(f,Ir("span"));v.innerText=c,this._editor.applyFontInfo(v)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===Mi.Error||t.marker.severity===Mi.Warning||t.marker.severity===Mi.Info)&&e.statusBar.addAction({label:p("view problem","View Problem"),commandId:Qc.ID,run:()=>{var n;e.hide(),(n=Du.get(this._editor))===null||n===void 0||n.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const n=e.statusBar.append(Ir("div"));this.recentMarkerCodeActionsInfo&&(rS.makeKey(this.recentMarkerCodeActionsInfo.marker)===rS.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=p("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const s=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?q.None:i.add(lu(()=>n.textContent=p("checkingForQuickFixes","Checking for quick fixes..."),200));n.textContent||(n.textContent=" ");const r=this.getCodeActions(t.marker);i.add(je(()=>r.cancel())),r.then(a=>{if(s.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),n.textContent=p("noQuickFixes","No quick fixes available");return}n.style.display="none";let l=!1;i.add(je(()=>{l||a.dispose()})),e.statusBar.addAction({label:p("quick fixes","Quick Fix..."),commandId:ER,run:d=>{l=!0;const c=Cu.get(this._editor),u=gn(d);e.hide(),c==null||c.showCodeActions(S3,a,{x:u.left,y:u.top,width:u.width,height:u.height})}})},nt)}}getCodeActions(e){return _n(t=>ov(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new k(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),S3,Fd.None,t))}};NT=Kbe([uk(1,$M),uk(2,So),uk(3,Me)],NT);const KV="editor.action.inlineSuggest.commit",qV="editor.action.inlineSuggest.showPrevious",GV="editor.action.inlineSuggest.showNext";var VR=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ca=function(o,e){return function(t,i){e(t,i,o)}},K1;let TT=class extends q{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Oi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=rt(this,n=>{var s,r,a;const l=(s=this.model.read(n))===null||s===void 0?void 0:s.ghostText.read(n);if(!this.alwaysShowToolbar.read(n)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const d=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const c=new z(l.lineNumber,Math.min(d,(a=(r=this.sessionPosition)===null||r===void 0?void 0:r.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=c,c}),this._register(Qd((n,s)=>{const r=this.model.read(n);if(!r||!this.alwaysShowToolbar.read(n))return;const a=s.add(this.instantiationService.createInstance(xu,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.selectedInlineCompletion.map(l=>{var d;return(d=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&d!==void 0?d:[]})));e.addContentWidget(a),s.add(je(()=>e.removeContentWidget(a))),s.add(zt(l=>{this.position.read(l)&&r.lastTriggerKind.read(l)!==Rd.Explicit&&r.triggerExplicitly()}))}))}};TT=VR([Ca(2,qe)],TT);const Gbe=Zi("inline-suggestion-hints-next",ve.chevronRight,p("parameterHintsNextIcon","Icon for show next parameter hint.")),Zbe=Zi("inline-suggestion-hints-previous",ve.chevronLeft,p("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let xu=K1=class extends q{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new Rs(e,t,i,!0,()=>this._commandService.executeCommand(e)),s=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return s&&(r=p({},"{0} ({1})",t,s.getLabel())),n.tooltip=r,n}constructor(e,t,i,n,s,r,a,l,d,c,u){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=s,this._extraCommands=r,this._commandService=a,this.keybindingService=d,this._contextKeyService=c,this._menuService=u,this.id=`InlineSuggestionHintsContentWidget${K1.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=vi("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[vi("div@toolBar")]),this.previousAction=this.createCommandAction(qV,p("previous","Previous"),Ue.asClassName(Zbe)),this.availableSuggestionCountAction=new Rs("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(GV,p("next","Next"),Ue.asClassName(Gbe)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(N.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Yt(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Yt(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(MT,this.nodes.toolBar,N.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,g)=>{if(h instanceof Ur)return l.createInstance(Xbe,h,void 0);if(h===this.availableSuggestionCountAction){const f=new Ybe(void 0,h,{label:!0,icon:!1});return f.setClass("availableSuggestionCount"),f}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(h=>{K1._dropDownVisible=h})),this._register(zt(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(zt(h=>{const g=this._suggestionCount.read(h),f=this._currentSuggestionIdx.read(h);g!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${f+1}/${g}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),g!==void 0&&g>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(zt(h=>{const g=this._extraCommands.read(h);if(Bi(this.lastCommands,g))return;this.lastCommands=g;const f=g.map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:v=>this._commandService.executeCommand(m.id)}));for(const[m,v]of this.inlineCompletionsActionsMenus.getActions())for(const _ of v)_ instanceof Ur&&f.push(_);f.length>0&&f.unshift(new Mn),this.toolBar.setAdditionalSecondaryActions(f)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};xu._dropDownVisible=!1;xu.id=0;xu=K1=VR([Ca(6,Ri),Ca(7,qe),Ca(8,Xt),Ca(9,Xe),Ca(10,Ba)],xu);class Ybe extends jp{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}let Xbe=class extends dg{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=vi("div.keybinding").root;new C0(t,Vo,{disableTitle:!0,...whe}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},MT=class extends ES{constructor(e,t,i,n,s,r,a,l){super(e,{resetMenu:t,...i},n,s,r,a,l),this.menuId=t,this.options2=i,this.menuService=n,this.contextKeyService=s,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,i,n,s,r,a;const l=[],d=[];VA(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:d},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(s=(n=this.options2)===null||n===void 0?void 0:n.toolbarOptions)===null||s===void 0?void 0:s.shouldInlineSubmenu,(a=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),d.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,d)}setPrependedPrimaryActions(e){Bi(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Bi(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};MT=VR([Ca(3,Ba),Ca(4,Xe),Ca(5,Sr),Ca(6,Xt),Ca(7,vo)],MT);var Qbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},KC=function(o,e){return function(t,i){e(t,i,o)}},AT;let Ys=AT=class extends q{static get(e){return e.getContribution(AT.ID)}constructor(e,t,i,n,s){super(),this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=n,this._keybindingService=s,this._toUnhook=new de,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Yt(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())}))}_hookEvents(){const e=this._editor.getOption(60);this._isHoverEnabled=e.enabled,this._isHoverSticky=e.sticky,this._hidingDelay=e.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._toUnhook.add(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._toUnhook.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._toUnhook.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._toUnhook.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._toUnhook.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._toUnhook.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._toUnhook.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._toUnhook.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._toUnhook.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;const i=e.target;if(i.type===9&&i.detail===Xc.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===vp.ID||(i.type!==12&&(this._hoverClicked=!1),!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t,i;this._cancelScheduler();const n=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((i=this._contentWidget)===null||i===void 0)&&i.containsNode(n)||this._hideWidgets()}_isMouseOverWidget(e){var t,i,n,s,r;const a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===Xc.ID||this._isHoverSticky&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((i=e.event.browserEvent.view)===null||i===void 0?void 0:i.document.activeElement))&&!(!((s=(n=e.event.browserEvent.view)===null||n===void 0?void 0:n.getSelection())===null||s===void 0)&&s.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===Xc.ID&&(!((r=this._contentWidget)===null||r===void 0)&&r.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===vp.ID)}_onEditorMouseMove(e){var t,i,n,s;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((i=this._contentWidget)===null||i===void 0)&&i.isResizing||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&(!((n=this._contentWidget)===null||n===void 0)&&n.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(!((s=this._contentWidget)===null||s===void 0)&&s.isVisible&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,i,n;if(!e)return;const s=e.target,r=(t=s.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(r&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!r&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(i=this._glyphWidget)===null||i===void 0||i.hide();return}if(s.type===2&&s.position){(n=this._contentWidget)===null||n===void 0||n.hide(),this._glyphWidget||(this._glyphWidget=new vp(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(s.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),n=i.kind===1||i.kind===2&&i.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&!n&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||xu.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(PS,this._editor)),this._contentWidget}showContentHover(e,t,i,n,s=!1){this._hoverActivatedByColorDecoratorClick=s,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,n)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};Ys.ID="editor.contrib.hover";Ys=AT=Qbe([KC(1,qe),KC(2,So),KC(3,bi),KC(4,Xt)],Ys);var ra;(function(o){o.NoAutoFocus="noAutoFocus",o.FocusIfVisible="focusIfVisible",o.AutoFocusImmediately="autoFocusImmediately"})(ra||(ra={}));class Jbe extends Te{constructor(){super({id:"editor.action.showHover",label:p({},"Show or Focus Hover"),metadata:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[ra.NoAutoFocus,ra.FocusIfVisible,ra.AutoFocusImmediately],enumDescriptions:[p("showOrFocusHover.focus.noAutoFocus","The hover will not automatically take focus."),p("showOrFocusHover.focus.focusIfVisible","The hover will take focus only if it is already visible."),p("showOrFocusHover.focus.autoFocusImmediately","The hover will automatically take focus when it appears.")],default:ra.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:fn(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=Ys.get(t);if(!n)return;const s=i==null?void 0:i.focus;let r=ra.FocusIfVisible;s in ra?r=s:typeof s=="boolean"&&s&&(r=ra.AutoFocusImmediately);const a=d=>{const c=t.getPosition(),u=new k(c.lineNumber,c.column,c.lineNumber,c.column);n.showContentHover(u,1,1,d)},l=t.getOption(2)===2;n.isHoverVisible?r!==ra.NoAutoFocus?n.focus():a(l):a(l||r===ra.AutoFocusImmediately)}}class e0e extends Te{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:p({},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const i=Ys.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const s=new k(n.lineNumber,n.column,n.lineNumber,n.column),r=bg.get(t);if(!r)return;r.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(s,1,1,!0)})}}class t0e extends Te{constructor(){super({id:"editor.action.scrollUpHover",label:p({},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:16,weight:100}})}run(e,t){const i=Ys.get(t);i&&i.scrollUp()}}class i0e extends Te{constructor(){super({id:"editor.action.scrollDownHover",label:p({},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:18,weight:100}})}run(e,t){const i=Ys.get(t);i&&i.scrollDown()}}class n0e extends Te{constructor(){super({id:"editor.action.scrollLeftHover",label:p({},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:15,weight:100}})}run(e,t){const i=Ys.get(t);i&&i.scrollLeft()}}class s0e extends Te{constructor(){super({id:"editor.action.scrollRightHover",label:p({},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:17,weight:100}})}run(e,t){const i=Ys.get(t);i&&i.scrollRight()}}class o0e extends Te{constructor(){super({id:"editor.action.pageUpHover",label:p({},"Page Up Hover"),alias:"Page Up Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=Ys.get(t);i&&i.pageUp()}}class r0e extends Te{constructor(){super({id:"editor.action.pageDownHover",label:p({},"Page Down Hover"),alias:"Page Down Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=Ys.get(t);i&&i.pageDown()}}class a0e extends Te{constructor(){super({id:"editor.action.goToTopHover",label:p({},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=Ys.get(t);i&&i.goToTop()}}class l0e extends Te{constructor(){super({id:"editor.action.goToBottomHover",label:p({},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=Ys.get(t);i&&i.goToBottom()}}At(Ys.ID,Ys,2);_e(Jbe);_e(e0e);_e(t0e);_e(i0e);_e(n0e);_e(s0e);_e(o0e);_e(r0e);_e(a0e);_e(l0e);jg.register(BS);jg.register(NT);Zr((o,e)=>{const t=o.getColor(Ate);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});class RT extends q{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(146);if(t!=="click"&&t!=="clickAndHover")return;const i=e.target;if(i.type!==6||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==bV||!i.range)return;const n=this._editor.getContribution(Ys.ID);if(n&&!n.isColorPickerVisible){const s=new k(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);n.showContentHover(s,1,0,!1,!0)}}}RT.ID="editor.contrib.colorContribution";At(RT.ID,RT,2);jg.register(AS);var ZV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},pa=function(o,e){return function(t,i){e(t,i,o)}},PT,OT;let ku=PT=class extends q{constructor(e,t,i,n,s,r,a){super(),this._editor=e,this._modelService=i,this._keybindingService=n,this._instantiationService=s,this._languageFeatureService=r,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=T.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=T.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new VS(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(PT.ID)}};ku.ID="editor.contrib.standaloneColorPickerController";ku=PT=ZV([pa(1,Xe),pa(2,Si),pa(3,Xt),pa(4,qe),pa(5,Me),pa(6,si)],ku);At(ku.ID,ku,1);const y3=8,d0e=22;let VS=OT=class extends q{constructor(e,t,i,n,s,r,a,l){var d;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=s,this._keybindingService=r,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new W),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=n.createInstance(wb,this._editor),this._position=(d=this._editor._getViewModel())===null||d===void 0?void 0:d.getPrimaryCursorState().modelState.position;const c=this._editor.getSelection(),u=c?{startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(Pl(this._body));this._register(h.onDidBlur(g=>{this.hide()})),this._register(h.onDidFocus(g=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(g=>{var f;const m=(f=g.target.element)===null||f===void 0?void 0:f.classList;m&&m.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(g=>{this._render(g.value,g.foundInEditor)})),this._start(u),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return OT.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new c0e(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new AR(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment(),n=this._register(new OS(this._keybindingService));let s;const r={fragment:i,statusBar:n,setColorPicker:m=>s=m,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(r,[e])),s===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),s.layout();const a=s.body,l=a.saturationBox.domNode.clientWidth,d=a.domNode.clientWidth-l-d0e-y3,c=s.body.enterButton;c==null||c.onClicked(()=>{this.updateEditor(),this.hide()});const u=s.header,h=u.pickedColorNode;h.style.width=l+y3+"px";const g=u.originalColorNode;g.style.width=d+"px";const f=s.header.closeButton;f==null||f.onClicked(()=>{this.hide()}),t&&(c&&(c.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};VS.ID="editor.contrib.standaloneColorPickerWidget";VS=OT=ZV([pa(3,qe),pa(4,Si),pa(5,Xt),pa(6,Me),pa(7,si)],VS);class c0e{constructor(e,t){this.value=e,this.foundInEditor=t}}class u0e extends Wa{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:p("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:p({},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:N.CommandPalette}]})}runEditorCommand(e,t){var i;(i=ku.get(t))===null||i===void 0||i.showOrFocus()}}class h0e extends Te{constructor(){super({id:"editor.action.hideColorPicker",label:p({},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:T.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;(i=ku.get(t))===null||i===void 0||i.hide()}}class g0e extends Te{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:p({},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:T.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;(i=ku.get(t))===null||i===void 0||i.insertColor()}}_e(h0e);_e(g0e);mi(u0e);class Oc{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const n=t.length,s=e.length;if(i+n>s)return!1;for(let r=0;r=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,s,r){const a=e.startLineNumber,l=e.startColumn,d=e.endLineNumber,c=e.endColumn,u=s.getLineContent(a),h=s.getLineContent(d);let g=u.lastIndexOf(t,l-1+t.length),f=h.indexOf(i,c-1-i.length);if(g!==-1&&f!==-1)if(a===d)u.substring(g+t.length,f).indexOf(i)>=0&&(g=-1,f=-1);else{const v=u.substring(g+t.length),_=h.substring(0,f);(v.indexOf(i)>=0||_.indexOf(i)>=0)&&(g=-1,f=-1)}let m;g!==-1&&f!==-1?(n&&g+t.length0&&h.charCodeAt(f-1)===32&&(i=" "+i,f-=1),m=Oc._createRemoveBlockCommentOperations(new k(a,g+t.length+1,d,f+1),t,i)):(m=Oc._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const v of m)r.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return k.isEmpty(e)?n.push(Li.delete(new k(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(Li.delete(new k(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(Li.delete(new k(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const s=[];return k.isEmpty(e)?s.push(Li.replace(new k(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(s.push(Li.insert(new z(e.startLineNumber,e.startColumn),t+(n?" ":""))),s.push(Li.insert(new z(e.endLineNumber,e.endColumn),(n?" ":"")+i))),s}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const s=e.getLanguageIdAtPosition(i,n),r=this.languageConfigurationService.getLanguageConfiguration(s).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const n=i[0],s=i[1];return new Ae(n.range.endLineNumber,n.range.endColumn,s.range.startLineNumber,s.range.startColumn)}else{const n=i[0].range,s=this._usedEndToken?-this._usedEndToken.length-1:0;return new Ae(n.endLineNumber,n.endColumn+s,n.endLineNumber,n.endColumn+s)}}}class hd{constructor(e,t,i,n,s,r,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=n,this._insertSpace=s,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const s=e.getLanguageIdAtPosition(t,1),r=n.getLanguageConfiguration(s).comments,a=r?r.lineCommentToken:null;if(!a)return null;const l=[];for(let d=0,c=i-t+1;d{if(e&&typeof e=="object"||typeof e=="function")for(let n of w_e(e))!S_e.call(o,n)&&n!==t&&b_e(o,n,{get:()=>e[n],enumerable:!(i=C_e(e,n))||i.enumerable});return o},L_e=(o,e,t)=>(y_e(o,e,"default"),t),D_e="5.0.2",Qp={};L_e(Qp,k0);var VW=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(VW||{}),HW=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(HW||{}),zW=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(zW||{}),$W=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))($W||{}),UW=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(UW||{}),jW=class{constructor(o,e,t,i,n){ri(this,"_onDidChange",new Qp.Emitter);ri(this,"_onDidExtraLibsChange",new Qp.Emitter);ri(this,"_extraLibs");ri(this,"_removedExtraLibs");ri(this,"_eagerModelSync");ri(this,"_compilerOptions");ri(this,"_diagnosticsOptions");ri(this,"_workerOptions");ri(this,"_onDidExtraLibsChangeTimeout");ri(this,"_inlayHintsOptions");ri(this,"_modeConfiguration");this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(o),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(o,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===o)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:o,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(o){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),o&&o.length>0)for(const e of o){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(o){this._compilerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(o){this._workerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(o){this._inlayHintsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(o){}setEagerModelSync(o){this._eagerModelSync=o}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(void 0)}},x_e=D_e,KW={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},qW=new jW({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},KW),GW=new jW({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},KW),k_e=()=>IL().then(o=>o.getTypeScriptWorker()),I_e=()=>IL().then(o=>o.getJavaScriptWorker());Qp.languages.typescript={ModuleKind:VW,JsxEmit:HW,NewLineKind:zW,ScriptTarget:$W,ModuleResolutionKind:UW,typescriptVersion:x_e,typescriptDefaults:qW,javascriptDefaults:GW,getTypeScriptWorker:k_e,getJavaScriptWorker:I_e};function IL(){return Oe(()=>import("./tsMode-_F3d8JBS.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,8]))}Qp.languages.onLanguage("typescript",()=>IL().then(o=>o.setupTypeScript(qW)));Qp.languages.onLanguage("javascript",()=>IL().then(o=>o.setupJavaScript(GW)));class E_e extends Qo{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:p("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:ve.map,toggled:ae.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ae.has("isInDiffEditor"),menu:{when:ae.has("isInDiffEditor"),id:N.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Dt),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}mi(E_e);class ZW extends Qo{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:p("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:ae.has("isInDiffEditor")})}run(e,...t){const i=e.get(Dt),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}mi(ZW);class YW extends Qo{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:p("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:ae.has("isInDiffEditor")})}run(e,...t){const i=e.get(Dt),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}mi(YW);zn.appendMenuItem(N.EditorTitle,{command:{id:new YW().desc.id,title:p("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ae.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ae.has("isInDiffEditor")},order:11,group:"1_diff",when:ae.and(T.diffEditorRenderSideBySideInlineBreakpointReached,ae.has("isInDiffEditor"))});zn.appendMenuItem(N.EditorTitle,{command:{id:new ZW().desc.id,title:p("showMoves","Show Moved Code Blocks"),icon:ve.move,toggled:gm.create("config.diffEditor.experimental.showMoves",!0),precondition:ae.has("isInDiffEditor")},order:10,group:"1_diff",when:ae.has("isInDiffEditor")});const EL={value:p("diffEditor","Diff Editor"),original:"Diff Editor"};class N_e extends Wa{constructor(){super({id:"diffEditor.switchSide",title:{value:p("switchSide","Switch Side"),original:"Switch Side"},icon:ve.arrowSwap,precondition:ae.has("isInDiffEditor"),f1:!0,category:EL})}runEditorCommand(e,t,i){const n=Im(e);if(n instanceof vu){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}mi(N_e);class T_e extends Wa{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:p("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:ve.close,precondition:T.comparingMovedCode,f1:!1,category:EL,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Im(e);n instanceof vu&&n.exitCompareMove()}}mi(T_e);class M_e extends Wa{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:p("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:ve.fold,precondition:ae.has("isInDiffEditor"),f1:!0,category:EL})}runEditorCommand(e,t,...i){const n=Im(e);n instanceof vu&&n.collapseAllUnchangedRegions()}}mi(M_e);class A_e extends Wa{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:p("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:ve.unfold,precondition:ae.has("isInDiffEditor"),f1:!0,category:EL})}runEditorCommand(e,t,...i){const n=Im(e);n instanceof vu&&n.showAllUnchangedRegions()}}mi(A_e);const XW={value:p("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class km extends Qo{constructor(){super({id:km.id,title:{value:p("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:XW,precondition:ae.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Im(e);t==null||t.accessibleDiffViewerNext()}}km.id="editor.action.accessibleDiffViewer.next";zn.appendMenuItem(N.EditorTitle,{command:{id:km.id,title:p("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ae.has("isInDiffEditor")},order:10,group:"2_diff",when:ae.and(T.accessibleDiffViewerVisible.negate(),ae.has("isInDiffEditor"))});class E0 extends Qo{constructor(){super({id:E0.id,title:{value:p("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:XW,precondition:ae.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Im(e);t==null||t.accessibleDiffViewerPrev()}}E0.id="editor.action.accessibleDiffViewer.prev";function Im(o){var e;const t=o.get(Ot),i=t.listDiffEditors(),n=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!n)return null;for(let r=0,a=i.length;r=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},O_e=function(o,e){return function(t,i){e(t,i,o)}},oT;const NL=new De("selectionAnchorSet",!1);let $d=oT=class{static get(e){return e.getContribution(oT.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=NL.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(Ae.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new as().appendText(p("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),mo(p("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(Ae.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};$d.ID="editor.contrib.selectionAnchorController";$d=oT=P_e([O_e(1,Xe)],$d);class F_e extends Te{constructor(){super({id:"editor.action.setSelectionAnchor",label:p("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:fn(2089,2080),weight:100}})}async run(e,t){var i;(i=$d.get(t))===null||i===void 0||i.setSelectionAnchor()}}class B_e extends Te{constructor(){super({id:"editor.action.goToSelectionAnchor",label:p("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:NL})}async run(e,t){var i;(i=$d.get(t))===null||i===void 0||i.goToSelectionAnchor()}}class W_e extends Te{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:p("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:NL,kbOpts:{kbExpr:T.editorTextFocus,primary:fn(2089,2089),weight:100}})}async run(e,t){var i;(i=$d.get(t))===null||i===void 0||i.selectFromAnchorToCursor()}}class V_e extends Te{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:p("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:NL,kbOpts:{kbExpr:T.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=$d.get(t))===null||i===void 0||i.cancelSelectionAnchor()}}At($d.ID,$d,4);_e(F_e);_e(B_e);_e(W_e);_e(V_e);const H_e=M("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},p("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class z_e extends Te{constructor(){super({id:"editor.action.jumpToBracket",label:p("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=$r.get(t))===null||i===void 0||i.jumpToBracket()}}class $_e extends Te{constructor(){super({id:"editor.action.selectToBracket",label:p("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:fG("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var n;let s=!0;i&&i.selectBrackets===!1&&(s=!1),(n=$r.get(t))===null||n===void 0||n.selectToBracket(s)}}class U_e extends Te{constructor(){super({id:"editor.action.removeBrackets",label:p("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=$r.get(t))===null||i===void 0||i.removeBrackets(this.id)}}class j_e{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class $r extends q{static get(e){return e.getContribution($r.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Yt(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(71),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(71)&&(this._matchBrackets=this._editor.getOption(71),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(r=l.range.getStartPosition())}}return r?new Ae(r.lineNumber,r.column,r.lineNumber,r.column):new Ae(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const d=t.bracketPairs.findNextBracket(s);d&&d.range&&(r=t.bracketPairs.matchBracket(d.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(k.compareRangesUsingStarts);const[d,c]=r;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?c.getEndPosition():c.getStartPosition(),c.containsPosition(s)){const u=a;a=l,l=u}}a&&l&&i.push(new Ae(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let r=0;for(let u=0,h=e.length;u1&&s.sort(z.compare);const a=[];let l=0,d=0;const c=n.length;for(let u=0,h=s.length;u0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}_e(Z_e);const pg="9_cutcopypaste",Y_e=Ml||document.queryCommandSupported("cut"),JW=Ml||document.queryCommandSupported("copy"),X_e=typeof navigator.clipboard>"u"||pr?document.queryCommandSupported("paste"):!0;function IR(o){return o.register(),o}const Q_e=Y_e?IR(new pm({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Ml?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:N.MenubarEditMenu,group:"2_ccp",title:p({},"Cu&&t"),order:1},{menuId:N.EditorContext,group:pg,title:p("actions.clipboard.cutLabel","Cut"),when:T.writable,order:1},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.cutLabel","Cut"),order:1},{menuId:N.SimpleEditorContext,group:pg,title:p("actions.clipboard.cutLabel","Cut"),when:T.writable,order:1}]})):void 0,J_e=JW?IR(new pm({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Ml?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:N.MenubarEditMenu,group:"2_ccp",title:p({},"&&Copy"),order:2},{menuId:N.EditorContext,group:pg,title:p("actions.clipboard.copyLabel","Copy"),order:2},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.copyLabel","Copy"),order:1},{menuId:N.SimpleEditorContext,group:pg,title:p("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;zn.appendMenuItem(N.MenubarEditMenu,{submenu:N.MenubarCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});zn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:pg,order:3});zn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1,when:ae.and(ae.notEquals("resourceScheme","output"),T.editorTextFocus)});zn.appendMenuItem(N.EditorTitleContext,{submenu:N.EditorTitleContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1});zn.appendMenuItem(N.ExplorerContext,{submenu:N.ExplorerContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1});const ik=X_e?IR(new pm({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Ml?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:N.MenubarEditMenu,group:"2_ccp",title:p({},"&&Paste"),order:4},{menuId:N.EditorContext,group:pg,title:p("actions.clipboard.pasteLabel","Paste"),when:T.writable,order:4},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:N.SimpleEditorContext,group:pg,title:p("actions.clipboard.pasteLabel","Paste"),when:T.writable,order:4}]})):void 0;class eve extends Te{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:p("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:T.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(rE.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),rE.forceCopyWithSyntaxHighlighting=!1)}}function eV(o,e){o&&(o.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(Ot).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const s=n.getOption(37),r=n.getSelection();return r&&r.isEmpty()&&!s||n.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),o.addImplementation(0,"generic-dom",(t,i)=>(fm().execCommand(e),!0)))}eV(Q_e,"cut");eV(J_e,"copy");ik&&(ik.addImplementation(1e4,"code-editor",(o,e)=>{const t=o.get(Ot),i=o.get(Xd),n=t.getFocusedCodeEditor();return n&&n.hasTextFocus()?!n.getContainerDomNode().ownerDocument.execCommand("paste")&&Tu?(async()=>{const r=await i.readText();if(r!==""){const a=$v.INSTANCE.get(r);let l=!1,d=null,c=null;a&&(l=n.getOption(37)&&!!a.isFromEmptySelection,d=typeof a.multicursorText<"u"?a.multicursorText:null,c=a.mode),n.trigger("keyboard","paste",{text:r,pasteOnNewLine:l,multicursorText:d,mode:c})}})():!0:!1}),ik.addImplementation(0,"generic-dom",(o,e)=>(fm().execCommand("paste"),!0)));JW&&_e(eve);class Ze{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+Ze.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Ze(this.value+Ze.sep+e)}}Ze.sep=".";Ze.None=new Ze("@@none@@");Ze.Empty=new Ze("");Ze.QuickFix=new Ze("quickfix");Ze.Refactor=new Ze("refactor");Ze.RefactorExtract=Ze.Refactor.append("extract");Ze.RefactorInline=Ze.Refactor.append("inline");Ze.RefactorMove=Ze.Refactor.append("move");Ze.RefactorRewrite=Ze.Refactor.append("rewrite");Ze.Notebook=new Ze("notebook");Ze.Source=new Ze("source");Ze.SourceOrganizeImports=Ze.Source.append("organizeImports");Ze.SourceFixAll=Ze.Source.append("fixAll");Ze.SurroundWith=Ze.Refactor.append("surround");var _o;(function(o){o.Refactor="refactor",o.RefactorPreview="refactor preview",o.Lightbulb="lightbulb",o.Default="other (default)",o.SourceAction="source action",o.QuickFix="quick fix action",o.FixAll="fix all",o.OrganizeImports="organize imports",o.AutoFix="auto fix",o.QuickFixHover="quick fix hover window",o.OnSave="save participants",o.ProblemsView="problems view"})(_o||(_o={}));function tve(o,e){return!(o.include&&!o.include.intersects(e)||o.excludes&&o.excludes.some(t=>tV(e,t,o.include))||!o.includeSourceActions&&Ze.Source.contains(e))}function ive(o,e){const t=e.kind?new Ze(e.kind):void 0;return!(o.include&&(!t||!o.include.contains(t))||o.excludes&&t&&o.excludes.some(i=>tV(t,i,o.include))||!o.includeSourceActions&&t&&Ze.Source.contains(t)||o.onlyIncludePreferredActions&&!e.isPreferred)}function tV(o,e,t){return!(!e.contains(o)||t&&e.contains(t))}class gl{static fromUser(e,t){return!e||typeof e!="object"?new gl(t.kind,t.apply,!1):new gl(gl.getKindFromUser(e,t.kind),gl.getApplyFromUser(e,t.apply),gl.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Ze(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class nve{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){var t;if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let i;try{i=await this.provider.resolveCodeAction(this.action,e)}catch(n){en(n)}i&&(this.action.edit=i.edit)}return this}}const iV="editor.action.codeAction",ER="editor.action.quickFix",nV="editor.action.autoFix",sV="editor.action.refactor",oV="editor.action.sourceAction",NR="editor.action.organizeImports",TR="editor.action.fixAll";class sv extends q{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:ls(e.diagnostics)?ls(t.diagnostics)?sv.codeActionsPreferredComparator(e,t):-1:ls(t.diagnostics)?1:sv.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(sv.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Ze.QuickFix.contains(new Ze(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}}const t3={actions:[],documentation:void 0};async function ov(o,e,t,i,n,s){var r;const a=i.filter||{},l={...a,excludes:[...a.excludes||[],Ze.Notebook]},d={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:i.type},c=new SR(e,s),u=i.type===2,h=sve(o,e,u?l:a),g=new de,f=h.map(async v=>{try{n.report(v);const _=await v.provideCodeActions(e,t,d,c.token);if(_&&g.add(_),c.token.isCancellationRequested)return t3;const b=((_==null?void 0:_.actions)||[]).filter(w=>w&&ive(a,w)),C=rve(v,b,a.include);return{actions:b.map(w=>new nve(w,v)),documentation:C}}catch(_){if(Fa(_))throw _;return en(_),t3}}),m=o.onDidChange(()=>{const v=o.all(e);Bi(v,h)||c.cancel()});try{const v=await Promise.all(f),_=v.map(C=>C.actions).flat(),b=[...Ia(v.map(C=>C.documentation)),...ove(o,e,i,_)];return new sv(_,b,g)}finally{m.dispose(),c.dispose()}}function sve(o,e,t){return o.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>tve(t,new Ze(n))):!0)}function*ove(o,e,t,i){var n,s,r;if(e&&i.length)for(const a of o.all(e))a._getAdditionalMenuItems&&(yield*(n=a._getAdditionalMenuItems)===null||n===void 0?void 0:n.call(a,{trigger:t.type,only:(r=(s=t.filter)===null||s===void 0?void 0:s.include)===null||r===void 0?void 0:r.value},i.map(l=>l.action)))}function rve(o,e,t){if(!o.documentation)return;const i=o.documentation.map(n=>({kind:new Ze(n.kind),command:n.command}));if(t){let n;for(const s of i)s.kind.contains(t)&&(n?n.kind.contains(s.kind)&&(n=s):n=s);if(n)return n==null?void 0:n.command}for(const n of e)if(n.kind){for(const s of i)if(s.kind.contains(new Ze(n.kind)))return s.command}}var TS;(function(o){o.OnSave="onSave",o.FromProblemsView="fromProblemsView",o.FromCodeActions="fromCodeActions"})(TS||(TS={}));async function ave(o,e,t,i,n=vt.None){var s;const r=o.get(f0),a=o.get(Ri),l=o.get(vo),d=o.get(sn);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(n),!n.isCancellationRequested&&!(!((s=e.action.edit)===null||s===void 0)&&s.edits.length&&!(await r.apply(e.action.edit,{editor:i==null?void 0:i.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==TS.OnSave,showPreview:i==null?void 0:i.preview})).isApplied)&&e.action.command)try{await a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(c){const u=lve(c);d.error(typeof u=="string"?u:p("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function lve(o){return typeof o=="string"?o:o instanceof Error&&typeof o.message=="string"?o.message:void 0}Et.registerCommand("_executeCodeActionProvider",async function(o,e,t,i,n){if(!(e instanceof ze))throw hr();const{codeActionProvider:s}=o.get(Me),r=o.get(Si).getModel(e);if(!r)throw hr();const a=Ae.isISelection(t)?Ae.liftSelection(t):k.isIRange(t)?r.validateRange(t):void 0;if(!a)throw hr();const l=typeof i=="string"?new Ze(i):void 0,d=await ov(s,r,a,{type:1,triggerAction:_o.Default,filter:{includeSourceActions:!0,include:l}},Fd.None,vt.None),c=[],u=Math.min(d.validActions.length,typeof n=="number"?n:0);for(let h=0;hh.action)}finally{setTimeout(()=>d.dispose(),100)}});var dve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},cve=function(o,e){return function(t,i){e(t,i,o)}},rT;let MS=rT=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Ru(()=>this.keybindingService.getKeybindings().filter(t=>rT.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===NR?i={kind:Ze.SourceOrganizeImports.value}:t.command===TR&&(i={kind:Ze.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...gl.fromUser(i,{kind:Ze.None,apply:"never"})}}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i==null?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Ze(e.kind);return t.filter(n=>n.kind.contains(i)).filter(n=>n.preferred?e.isPreferred:!0).reduceRight((n,s)=>n?n.kind.contains(s.kind)?s:n:s,void 0)}};MS.codeActionCommands=[sV,iV,oV,NR,TR];MS=rT=dve([cve(0,Xt)],MS);M("symbolIcon.arrayForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.booleanForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.colorForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.constantForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.fileForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.folderForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.keyForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.keywordForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.moduleForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.namespaceForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.nullForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.numberForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.objectForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.operatorForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.packageForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.propertyForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.referenceForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.snippetForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.stringForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.structForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.textForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.typeParameterForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.unitForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const rV=Object.freeze({kind:Ze.Empty,title:p("codeAction.widget.id.more","More Actions...")}),uve=Object.freeze([{kind:Ze.QuickFix,title:p("codeAction.widget.id.quickfix","Quick Fix")},{kind:Ze.RefactorExtract,title:p("codeAction.widget.id.extract","Extract"),icon:ve.wrench},{kind:Ze.RefactorInline,title:p("codeAction.widget.id.inline","Inline"),icon:ve.wrench},{kind:Ze.RefactorRewrite,title:p("codeAction.widget.id.convert","Rewrite"),icon:ve.wrench},{kind:Ze.RefactorMove,title:p("codeAction.widget.id.move","Move"),icon:ve.wrench},{kind:Ze.SurroundWith,title:p("codeAction.widget.id.surround","Surround With"),icon:ve.symbolSnippet},{kind:Ze.Source,title:p("codeAction.widget.id.source","Source Action"),icon:ve.symbolFile},rV]);function hve(o,e,t){if(!e)return o.map(s=>{var r;return{kind:"action",item:s,group:rV,disabled:!!s.action.disabled,label:s.action.disabled||s.action.title,canPreview:!!(!((r=s.action.edit)===null||r===void 0)&&r.edits.length)}});const i=uve.map(s=>({group:s,actions:[]}));for(const s of o){const r=s.action.kind?new Ze(s.action.kind):Ze.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(s);break}}const n=[];for(const s of i)if(s.actions.length){n.push({kind:"header",group:s.group});for(const r of s.actions){const a=s.group;n.push({kind:"action",item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:ve.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return n}var gve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},i3=function(o,e){return function(t,i){e(t,i,o)}},aT,$f;(function(o){o.Hidden={type:0};class e{constructor(i,n,s,r){this.actions=i,this.trigger=n,this.editorPosition=s,this.widgetPosition=r,this.type=1}}o.Showing=e})($f||($f={}));let mg=aT=class extends q{constructor(e,t,i){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new W),this.onClick=this._onClick.event,this._state=$f.Hidden,this._iconClasses=[],this._domNode=pe("div.lightBulbWidget"),this._register(ei.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(n=>{const s=this._editor.getModel();(this.state.type!==1||!s||this.state.editorPosition.lineNumber>=s.getLineCount())&&this.hide()})),this._register(VX(this._domNode,n=>{var s;if(this.state.type!==1)return;const r=this._editor.getOption(64).experimental.showAiIcon;if((r===so.On||r===so.OnCode)&&this.state.actions.allAIFixes&&this.state.actions.validActions.length===1){const u=this.state.actions.validActions[0].action;if(!((s=u.command)===null||s===void 0)&&s.id){i.executeCommand(u.command.id,...u.command.arguments||[]),n.preventDefault();return}}this._editor.focus(),n.preventDefault();const{top:a,height:l}=gn(this._domNode),d=this._editor.getOption(66);let c=Math.floor(d/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(n.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(64)&&(this._editor.getOption(64).enabled||this.hide(),this._updateLightBulbTitleAndIcon())})),this._register(ye.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var n,s,r,a;this._preferredKbLabel=(s=(n=this._keybindingService.lookupKeybinding(nV))===null||n===void 0?void 0:n.getLabel())!==null&&s!==void 0?s:void 0,this._quickFixKbLabel=(a=(r=this._keybindingService.lookupKeybinding(ER))===null||r===void 0?void 0:r.getLabel())!==null&&a!==void 0?a:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();const n=this._editor.getOptions();if(!n.get(64).enabled)return this.hide();const s=this._editor.getModel();if(!s)return this.hide();const{lineNumber:r,column:a}=s.validatePosition(i),l=s.getOptions().tabSize,d=n.get(50),c=s.getLineContent(r),u=jy(c,l),h=d.spaceWidth*u>22,g=m=>m>2&&this._editor.getTopForLineNumber(m)===this._editor.getTopForLineNumber(m-1);let f=r;if(!h){if(r>1&&!g(r-1))f-=1;else if(!g(r+1))f+=1;else if(a*d.spaceWidth<22)return this.hide()}this.state=new $f.Showing(e,t,i,{position:{lineNumber:f,column:s.getLineContent(f).match(/^\S\s*$/)?2:1},preference:aT._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==$f.Hidden&&(this.state=$f.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){var e,t,i;if(this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],this.state.type!==1)return;const n=()=>{this._preferredKbLabel&&(this.title=p("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel))},s=()=>{this._quickFixKbLabel?this.title=p("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=p("codeAction","Show Code Actions")};let r;const a=this._editor.getOption(64).experimental.showAiIcon;if(a===so.On||a===so.OnCode)if(a===so.On&&this.state.actions.allAIFixes)if(r=ve.sparkleFilled,this.state.actions.allAIFixes&&this.state.actions.validActions.length===1)if(((e=this.state.actions.validActions[0].action.command)===null||e===void 0?void 0:e.id)==="inlineChat.start"){const l=(i=(t=this._keybindingService.lookupKeybinding("inlineChat.start"))===null||t===void 0?void 0:t.getLabel())!==null&&i!==void 0?i:void 0;this.title=l?p("codeActionStartInlineChatWithKb","Start Inline Chat ({0})",l):p("codeActionStartInlineChat","Start Inline Chat")}else this.title=p("codeActionTriggerAiAction","Trigger AI Action");else s();else this.state.actions.hasAutoFix?(this.state.actions.hasAIFix?r=ve.lightbulbSparkleAutofix:r=ve.lightbulbAutofix,n()):this.state.actions.hasAIFix?(r=ve.lightbulbSparkle,s()):(r=ve.lightBulb,s());else this.state.actions.hasAutoFix?(r=ve.lightbulbAutofix,n()):(r=ve.lightBulb,s());this._iconClasses=Ue.asClassNameArray(r),this._domNode.classList.add(...this._iconClasses)}set title(e){this._domNode.title=e}};mg.ID="editor.contrib.lightbulbWidget";mg._posPref=[0];mg=aT=gve([i3(1,Xt),i3(2,Ri)],mg);var fve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},n3=function(o,e){return function(t,i){e(t,i,o)}},lT;let Ud=lT=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new W,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const n=new de,s=n.add(iL(e,{...this._getRenderOptions(e,n),...t},i));return s.element.classList.add("rendered-markdown"),{element:s.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,n)=>{var s,r,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(s=this._options.editor.getModel())===null||s===void 0?void 0:s.getLanguageId()),l||(l=Ko);const d=await lae(this._languageService,n,l),c=document.createElement("span");if(c.innerHTML=(a=(r=lT._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(d))!==null&&a!==void 0?a:d,this._options.editor){const u=this._options.editor.getOption(50);Jn(c,u)}else this._options.codeBlockFontFamily&&(c.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(c.style.fontSize=this._options.codeBlockFontSize),c},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>aV(this._openerService,i,e.isTrusted),disposables:t}}}};Ud._ttpTokenizer=qd("tokenizeToString",{createHTML(o){return o}});Ud=lT=fve([n3(1,bi),n3(2,So)],Ud);async function aV(o,e,t){try{return await o.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:pve(t)})}catch(i){return nt(i),!1}}function pve(o){return o===!0?!0:o&&Array.isArray(o.enabledCommands)?o.enabledCommands:!1}var mve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},s3=function(o,e){return function(t,i){e(t,i,o)}},W1;let ho=W1=class{static get(e){return e.getContribution(W1.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new An,this._messageListeners=new de,this._mouseOverMessage=!1,this._editor=e,this._visible=W1.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){mo(jc(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=jc(e)?iL(e,{actionHandler:{callback:n=>aV(this._openerService,n,jc(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new o3(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(ye.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Qn(jo(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(J(this._messageWidget.value.getDomNode(),Se.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(J(this._messageWidget.value.getDomNode(),Se.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new k(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(o3.fadeOut(this._messageWidget.value))}};ho.ID="editor.contrib.messageController";ho.MESSAGE_VISIBLE=new De("messageVisible",!1,p("messageVisible","Whether the editor is currently showing an inline message"));ho=W1=mve([s3(1,Xe),s3(2,So)],ho);const _ve=Rn.bindToContribution(ho.get);we(new _ve({id:"leaveEditorMessage",precondition:ho.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let o3=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};At(ho.ID,ho,4);var lV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},dT=function(o,e){return function(t,i){e(t,i,o)}};const dV="acceptSelectedCodeAction",cV="previewSelectedCodeAction";class vve{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){var n,s;i.text.textContent=(s=(n=e.group)===null||n===void 0?void 0:n.title)!==null&&s!==void 0?s:""}disposeTemplate(e){}}let cT=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const n=new C0(e,Vo);return{container:e,icon:t,text:i,keybinding:n}}renderElement(e,t,i){var n,s,r;if(!((n=e.group)===null||n===void 0)&&n.icon?(i.icon.className=Ue.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=Ee(e.group.icon.color.id))):(i.icon.className=Ue.asClassName(ve.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=uV(e.label),i.keybinding.set(e.keybinding),iQ(!!e.keybinding,i.keybinding.element);const a=(s=this._keybindingService.lookupKeybinding(dV))===null||s===void 0?void 0:s.getLabel(),l=(r=this._keybindingService.lookupKeybinding(cV))===null||r===void 0?void 0:r.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?i.container.title=p({},"{0} to apply, {1} to preview",a,l):i.container.title=p({},"{0} to apply",a):i.container.title=""}disposeTemplate(e){}};cT=lV([dT(1,Xt)],cT);class bve extends UIEvent{constructor(){super("acceptSelectedAction")}}class r3 extends UIEvent{constructor(){super("previewSelectedAction")}}function Cve(o){if(o.kind==="action")return o.label}let uT=class extends q{constructor(e,t,i,n,s,r){super(),this._delegate=n,this._contextViewService=s,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new tn),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:l=>l.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:l=>l.kind};this._list=this._register(new Yr(e,this.domNode,a,[new cT(t,this._keybindingService),new vve],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:Cve},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let d=l.label?uV(l==null?void 0:l.label):"";return l.disabled&&(d=p({},"{0}, Disabled Reason: {1}",d,l.disabled)),d}return null},getWidgetAriaLabel:()=>p({},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(Fg),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(l=>l.kind==="header").length,n=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(n);let s=e;if(this._allMenuItems.length>=50)s=380;else{const l=this._allMenuItems.map((d,c)=>{const u=this.domNode.ownerDocument.getElementById(this._list.getElementID(c));if(u){u.style.width="auto";const h=u.getBoundingClientRect().width;return u.style.width="",h}return 0});s=Math.max(...l,e)}const a=Math.min(n,this.domNode.ownerDocument.body.clientHeight*.7);return this._list.layout(a,s),this.domNode.style.height=`${a}px`,this._list.domFocus(),s}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],n=this._list.element(i);if(!this.focusCondition(n))return;const s=e?new r3:new bve;this._list.setSelection([i],s)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof r3):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const i=this._list.getFocus();if(i.length===0)return;const n=i[0],s=this._list.element(n);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,s.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const i=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};uT=lV([dT(4,Gd),dT(5,Xt)],uT);function uV(o){return o.replace(/\r\n|\r|\n/g," ")}var wve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nk=function(o,e){return function(t,i){e(t,i,o)}};M("actionBar.toggledBackground",{dark:Ih,light:Ih,hcDark:Ih,hcLight:Ih},p("actionBar.toggledBackground","Background color for toggled action items in action bar."));const _g={Visible:new De("codeActionMenuVisible",!1,p("codeActionMenuVisible","Whether the action widget list is visible"))},Hg=bt("actionWidgetService");let vg=class extends q{get isVisible(){return _g.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new An)}show(e,t,i,n,s,r,a){const l=_g.Visible.bindTo(this._contextKeyService),d=this._instantiationService.createInstance(uT,e,t,i,n);this._contextViewService.showContextView({getAnchor:()=>s,render:c=>(l.set(!0),this._renderWidget(c,d,a??[])),onHide:c=>{l.reset(),this._onWidgetClosed(c)}},r,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,i){var n;const s=document.createElement("div");if(s.classList.add("action-widget"),e.appendChild(s),this._list.value=t,this._list.value)s.appendChild(this._list.value.domNode);else throw new Error("List has no value");const r=new de,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),r.add(J(l,Se.MOUSE_DOWN,f=>f.stopPropagation()));const d=document.createElement("div"),c=e.appendChild(d);c.classList.add("context-view-pointerBlock"),r.add(J(c,Se.POINTER_MOVE,()=>c.remove())),r.add(J(c,Se.MOUSE_DOWN,()=>c.remove()));let u=0;if(i.length){const f=this._createActionBar(".action-widget-action-bar",i);f&&(s.appendChild(f.getContainer().parentElement),r.add(f),u=f.getContainer().offsetWidth)}const h=(n=this._list.value)===null||n===void 0?void 0:n.layout(u);s.style.width=`${h}px`;const g=r.add(Pl(e));return r.add(g.onDidBlur(()=>this.hide())),r}_createActionBar(e,t){if(!t.length)return;const i=pe(e),n=new Cr(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};vg=wve([nk(0,Gd),nk(1,Xe),nk(2,qe)],vg);xt(Hg,vg,1);const N0=1100;mi(class extends Qo{constructor(){super({id:"hideCodeActionWidget",title:{value:p("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:_g.Visible,keybinding:{weight:N0,primary:9,secondary:[1033]}})}run(o){o.get(Hg).hide()}});mi(class extends Qo{constructor(){super({id:"selectPrevCodeAction",title:{value:p("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:_g.Visible,keybinding:{weight:N0,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(o){const e=o.get(Hg);e instanceof vg&&e.focusPrevious()}});mi(class extends Qo{constructor(){super({id:"selectNextCodeAction",title:{value:p("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:_g.Visible,keybinding:{weight:N0,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(o){const e=o.get(Hg);e instanceof vg&&e.focusNext()}});mi(class extends Qo{constructor(){super({id:dV,title:{value:p("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:_g.Visible,keybinding:{weight:N0,primary:3,secondary:[2137]}})}run(o){const e=o.get(Hg);e instanceof vg&&e.acceptSelected()}});mi(class extends Qo{constructor(){super({id:cV,title:{value:p("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:_g.Visible,keybinding:{weight:N0,primary:2051}})}run(o){const e=o.get(Hg);e instanceof vg&&e.acceptSelected(!0)}});const hV=new De("supportedCodeAction","");class Sve extends q{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new qr),this._register(this._markerService.onMarkerChanged(s=>this._onMarkerChanges(s))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>dA(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:_o.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){var t;if(!this._editor.hasModel())return;const i=this._editor.getModel(),n=this._editor.getSelection();if(n.isEmpty()&&e.type===2){const{lineNumber:s,column:r}=n.getPosition(),a=i.getLineContent(s);if(a.length===0){if(!(((t=this._editor.getOption(64).experimental)===null||t===void 0?void 0:t.showAiIcon)===so.On))return}else if(r===1){if(/\s/.test(a[0]))return}else if(r===i.getLineMaxColumn(s)){if(/\s/.test(a[a.length-1]))return}else if(/\s/.test(a[r-2])&&/\s/.test(a[r-1]))return}return n}}var Lh;(function(o){o.Empty={type:0};class e{constructor(i,n,s){this.trigger=i,this.position=n,this._cancellablePromise=s,this.type=1,this.actions=s.catch(r=>{if(Fa(r))return gV;throw r})}cancel(){this._cancellablePromise.cancel()}}o.Triggered=e})(Lh||(Lh={}));const gV=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class yve extends q{constructor(e,t,i,n,s,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=s,this._configurationService=r,this._codeActionOracle=this._register(new An),this._state=Lh.Empty,this._onDidChangeState=this._register(new W),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=hV.bindTo(n),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(Lh.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(Lh.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(i=>{var n;return(n=i.providedCodeActionKinds)!==null&&n!==void 0?n:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new Sve(this._editor,this._markerService,i=>{var n;if(!i){this.setState(Lh.Empty);return}const s=i.selection.getStartPosition(),r=_n(async a=>{var l,d,c,u,h,g;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===_o.QuickFix||!((d=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||d===void 0)&&d.contains(Ze.QuickFix))){const f=await ov(this._registry,e,i.selection,i.trigger,Fd.None,a),m=[...f.allActions];if(a.isCancellationRequested)return gV;if(!((c=f.validActions)===null||c===void 0?void 0:c.some(_=>_.action.kind?Ze.QuickFix.contains(new Ze(_.action.kind)):!1))){const _=this._markerService.read({resource:e.uri});if(_.length>0){const b=i.selection.getPosition();let C=b,w=Number.MAX_VALUE;const S=[...f.validActions];for(const y of _){const I=y.endColumn,E=y.endLineNumber,R=y.startLineNumber;if(E===b.lineNumber||R===b.lineNumber){C=new z(E,I);const j={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:!((u=i.trigger.filter)===null||u===void 0)&&u.include?(h=i.trigger.filter)===null||h===void 0?void 0:h.include:Ze.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((g=i.trigger.context)===null||g===void 0?void 0:g.notAvailableMessage)||"",position:C}},O=new Ae(C.lineNumber,C.column,C.lineNumber,C.column),$=await ov(this._registry,e,O,j,Fd.None,a);if($.validActions.length!==0){for(const K of $.validActions)K.highlightRange=K.action.isPreferred;f.allActions.length===0&&m.push(...$.allActions),Math.abs(b.column-I)E.findIndex(R=>R.action.title===y.action.title)===I);return x.sort((y,I)=>y.action.isPreferred&&!I.action.isPreferred?-1:!y.action.isPreferred&&I.action.isPreferred||y.action.isAI&&!I.action.isAI?1:!y.action.isAI&&I.action.isAI?-1:0),{validActions:x,allActions:m,documentation:f.documentation,hasAutoFix:f.hasAutoFix,hasAIFix:f.hasAIFix,allAIFixes:f.allAIFixes,dispose:()=>{f.dispose()}}}}}return ov(this._registry,e,i.selection,i.trigger,Fd.None,a)});i.trigger.type===1&&((n=this._progressService)===null||n===void 0||n.showWhile(r,250)),this.setState(new Lh.Triggered(i.trigger,s,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:_o.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var Lve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},id=function(o,e){return function(t,i){e(t,i,o)}},V1;const Dve="quickfix-edit-highlight";let Cu=V1=class extends q{static get(e){return e.getContribution(V1.ID)}constructor(e,t,i,n,s,r,a,l,d,c){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=d,this._instantiationService=c,this._activeCodeActions=this._register(new An),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new yve(this._editor,s.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new Ru(()=>{const u=this._editor.getContribution(mg.ID);return u&&this._register(u.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),u}),this._resolver=n.createInstance(MS),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,n){var s;if(!this._editor.hasModel())return;(s=ho.get(this._editor))===null||s===void 0||s.closeMessage();const r=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:r}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,i){try{await this._instantiationService.invokeFunction(ave,e,TS.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:_o.QuickFix,filter:{}})}}async update(e){var t,i,n,s,r,a,l;if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let d;try{d=await e.actions}catch(c){nt(c);return}if(!this._disposed)if((i=this._lightBulbWidget.value)===null||i===void 0||i.update(d,e.trigger,e.position),e.trigger.type===1){if(!((n=e.trigger.filter)===null||n===void 0)&&n.include){const u=this.tryGetValidActionToApply(e.trigger,d);if(u){try{(s=this._lightBulbWidget.value)===null||s===void 0||s.hide(),await this._applyCodeAction(u,!1,!1)}finally{d.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,d);if(h&&h.action.disabled){(r=ho.get(this._editor))===null||r===void 0||r.showMessage(h.action.disabled,e.trigger.context.position),d.dispose();return}}}const c=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!d.allActions.length||!c&&!d.validActions.length)){(l=ho.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=d,d.dispose();return}this._activeCodeActions.value=d,this.showCodeActionList(d,this.toCoords(e.position),{includeDisabledActions:c,fromLightbulb:!1})}else this._actionWidgetService.isVisible?d.dispose():this._activeCodeActions.value=d}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}async showCodeActionList(e,t,i){const n=this._editor.createDecorationsCollection(),s=this._editor.getDomNode();if(!s)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=z.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(d,c)=>{this._applyCodeAction(d,!0,!!c),this._actionWidgetService.hide(),n.clear()},onHide:()=>{var d;(d=this._editor)===null||d===void 0||d.focus(),n.clear()},onHover:async(d,c)=>{var u;if(await d.resolve(c),!c.isCancellationRequested)return{canPreview:!!(!((u=d.action.edit)===null||u===void 0)&&u.edits.length)}},onFocus:d=>{var c,u;if(d&&d.highlightRange&&d.action.diagnostics){const h=[{range:d.action.diagnostics[0],options:V1.DECORATION}];n.set(h);const g=d.action.diagnostics[0],f=(u=(c=this._editor.getModel())===null||c===void 0?void 0:c.getWordAtPosition({lineNumber:g.startLineNumber,column:g.startColumn}))===null||u===void 0?void 0:u.word;hu(p("editingNewSelection","Context: {0} at line {1} and column {2}.",f,g.startLineNumber,g.startColumn))}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,hve(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,s,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=gn(this._editor.getDomNode()),n=i.left+t.left,s=i.top+t.top+t.height;return{x:n,y:s}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const n=e.documentation.map(s=>{var r;return{id:s.id,label:s.title,tooltip:(r=s.tooltip)!==null&&r!==void 0?r:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(s.id,...(a=s.arguments)!==null&&a!==void 0?a:[])}}});return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&n.push(this._showDisabled?{id:"hideMoreActions",label:p("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:p("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}};Cu.ID="editor.contrib.codeActionController";Cu.DECORATION=st.register({description:"quickfix-highlight",className:Dve});Cu=V1=Lve([id(1,Yl),id(2,Xe),id(3,qe),id(4,Me),id(5,Bu),id(6,Ri),id(7,Dt),id(8,Hg),id(9,qe)],Cu);Zr((o,e)=>{((n,s)=>{s&&e.addRule(`.monaco-editor ${n} { background-color: ${s}; }`)})(".quickfix-edit-highlight",o.getColor(wl));const i=o.getColor(Ic);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${xa(o.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function T0(o){return ae.regex(hV.keys()[0],new RegExp("(\\s|^)"+qo(o.value)+"\\b"))}const MR={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:p("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:p("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[p("args.schema.apply.first","Always apply the first returned code action."),p("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),p("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:p("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function zg(o,e,t,i,n=_o.Default){if(o.hasModel()){const s=Cu.get(o);s==null||s.manualTriggerAtCurrentPosition(e,n,t,i)}}class xve extends Te{constructor(){super({id:ER,label:p("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:ae.and(T.writable,T.hasCodeActionsProvider),kbOpts:{kbExpr:T.textInputFocus,primary:2137,weight:100}})}run(e,t){return zg(t,p("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,_o.QuickFix)}}class kve extends Rn{constructor(){super({id:iV,precondition:ae.and(T.writable,T.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:MR}]}})}runEditorCommand(e,t,i){const n=gl.fromUser(i,{kind:Ze.Empty,apply:"ifSingle"});return zg(t,typeof(i==null?void 0:i.kind)=="string"?n.preferred?p("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):p("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):n.preferred?p("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):p("editor.action.codeAction.noneMessage","No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class Ive extends Te{constructor(){super({id:sV,label:p("refactor.label","Refactor..."),alias:"Refactor...",precondition:ae.and(T.writable,T.hasCodeActionsProvider),kbOpts:{kbExpr:T.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:ae.and(T.writable,T0(Ze.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:MR}]}})}run(e,t,i){const n=gl.fromUser(i,{kind:Ze.Refactor,apply:"never"});return zg(t,typeof(i==null?void 0:i.kind)=="string"?n.preferred?p("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):p("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):n.preferred?p("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):p("editor.action.refactor.noneMessage","No refactorings available"),{include:Ze.Refactor.contains(n.kind)?n.kind:Ze.None,onlyIncludePreferredActions:n.preferred},n.apply,_o.Refactor)}}class Eve extends Te{constructor(){super({id:oV,label:p("source.label","Source Action..."),alias:"Source Action...",precondition:ae.and(T.writable,T.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:ae.and(T.writable,T0(Ze.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:MR}]}})}run(e,t,i){const n=gl.fromUser(i,{kind:Ze.Source,apply:"never"});return zg(t,typeof(i==null?void 0:i.kind)=="string"?n.preferred?p("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):p("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):n.preferred?p("editor.action.source.noneMessage.preferred","No preferred source actions available"):p("editor.action.source.noneMessage","No source actions available"),{include:Ze.Source.contains(n.kind)?n.kind:Ze.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,_o.SourceAction)}}class Nve extends Te{constructor(){super({id:NR,label:p("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:ae.and(T.writable,T0(Ze.SourceOrganizeImports)),kbOpts:{kbExpr:T.textInputFocus,primary:1581,weight:100}})}run(e,t){return zg(t,p("editor.action.organize.noneMessage","No organize imports action available"),{include:Ze.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",_o.OrganizeImports)}}class Tve extends Te{constructor(){super({id:TR,label:p("fixAll.label","Fix All"),alias:"Fix All",precondition:ae.and(T.writable,T0(Ze.SourceFixAll))})}run(e,t){return zg(t,p("fixAll.noneMessage","No fix all action available"),{include:Ze.SourceFixAll,includeSourceActions:!0},"ifSingle",_o.FixAll)}}class Mve extends Te{constructor(){super({id:nV,label:p("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:ae.and(T.writable,T0(Ze.QuickFix)),kbOpts:{kbExpr:T.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return zg(t,p("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Ze.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",_o.AutoFix)}}At(Cu.ID,Cu,3);At(mg.ID,mg,4);_e(xve);_e(Ive);_e(Eve);_e(Nve);_e(Mve);_e(Tve);we(new kve);xi.as(Va.Configuration).registerConfiguration({...Xy,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:p("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});xi.as(Va.Configuration).registerConfiguration({...Xy,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:5,description:p("includeNearbyQuickFixes","Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});class hT{constructor(){this.lenses=[],this._disposables=new de}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}async function fV(o,e,t){const i=o.ordered(e),n=new Map,s=new hT,r=i.map(async(a,l)=>{n.set(a,l);try{const d=await Promise.resolve(a.provideCodeLenses(e,t));d&&s.add(d,a)}catch(d){en(d)}});return await Promise.all(r),s.lenses=s.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:n.get(a.provider)n.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),s}Et.registerCommand("_executeCodeLensProvider",function(o,...e){let[t,i]=e;qt(ze.isUri(t)),qt(typeof i=="number"||!i);const{codeLensProvider:n}=o.get(Me),s=o.get(Si).getModel(t);if(!s)throw hr();const r=[],a=new de;return fV(n,s,vt.None).then(l=>{a.add(l);const d=[];for(const c of l.lenses)i==null||c.symbol.command?r.push(c.symbol):i-- >0&&c.provider.resolveCodeLens&&d.push(Promise.resolve(c.provider.resolveCodeLens(s,c.symbol,vt.None)).then(u=>r.push(u||c.symbol)));return Promise.all(d)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var Ave=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Rve=function(o,e){return function(t,i){e(t,i,o)}};const pV=bt("ICodeLensCache");class a3{constructor(e,t){this.lineCount=e,this.data=t}}let gT=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Pu(20,.75);const t="codelens/cache";g_(Ai,()=>e.remove(t,1));const i="codelens/cache2",n=e.get(i,1,"{}");this._deserialize(n),ye.once(e.onWillSaveState)(s=>{s.reason===rb.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(r=>{var a;return{range:r.symbol.range,command:r.symbol.command&&{id:"",title:(a=r.symbol.command)===null||a===void 0?void 0:a.title}}}),n=new hT;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const s=new a3(e.getLineCount(),n);this._cache.set(e.uri.toString(),s)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const n=new Set;for(const s of i.data.lenses)n.add(s.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const n=t[i],s=[];for(const a of n.lines)s.push({range:new k(a,1,a,11)});const r=new hT;r.add({lenses:s,dispose(){}},this._fakeProvider),this._cache.set(i,new a3(n.lineCount,r))}}catch{}}};gT=Ave([Rve(0,Xr)],gT);xt(pV,gT,1);class Pve{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class TL{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${TL._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let n=!1;for(let s=0;s{d.symbol.command&&l.push(d.symbol),i.addDecoration({range:d.symbol.range,options:l3},u=>this._decorationIds[c]=u),a?a=k.plusRange(a,d.symbol.range):a=k.lift(d.symbol.range)}),this._viewZone=new Pve(a.startLineNumber-1,s,r),this._viewZoneId=n.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new TL(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),n=this._data[t].symbol;return!!(i&&k.isEmpty(n.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,n)=>{t.addDecoration({range:i.symbol.range,options:l3},s=>this._decorationIds[n]=s)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},i_=function(o,e){return function(t,i){e(t,i,o)}};let Jp=class{constructor(e,t,i,n,s,r){this._editor=e,this._languageFeaturesService=t,this._commandService=n,this._notificationService=s,this._codeLensCache=r,this._disposables=new de,this._localToDispose=new de,this._lenses=[],this._oldCodeLensModels=new de,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Yt(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=this._editor.getOption(52)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(18),n=this._editor.getOption(50),{style:s}=this._editor.getContainerDomNode();s.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),s.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),s.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(s.setProperty("--vscode-editorCodeLens-fontFamily",i),s.setProperty("--vscode-editorCodeLens-fontFamilyDefault",co.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)===null||i===void 0||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&lu(()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const n of this._languageFeaturesService.codeLensProvider.all(e))if(typeof n.onDidChange=="function"){const s=n.onDidChange(()=>i.schedule());this._localToDispose.add(s)}const i=new Yt(()=>{var n;const s=Date.now();(n=this._getCodeLensModelPromise)===null||n===void 0||n.cancel(),this._getCodeLensModelPromise=_n(r=>fV(this._languageFeaturesService.codeLensProvider,e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);const a=this._provideCodeLensDebounce.update(e,Date.now()-s);i.delay=a,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},nt)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(je(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var n;this._editor.changeDecorations(s=>{this._editor.changeViewZones(r=>{const a=[];let l=-1;this._lenses.forEach(c=>{!c.isValid()||l===c.getLineNumber()?a.push(c):(c.update(r),l=c.getLineNumber())});const d=new sk;a.forEach(c=>{c.dispose(d,r),this._lenses.splice(this._lenses.indexOf(c),1)}),d.commit(s)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(n=this._resolveCodeLensesPromise)===null||n===void 0||n.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(n=>{n.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(je(()=>{if(this._editor.getModel()){const n=Ra.capture(this._editor);this._editor.changeDecorations(s=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(s,r)})}),n.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(n=>{if(n.target.type!==9)return;let s=n.target.element;if((s==null?void 0:s.tagName)==="SPAN"&&(s=s.parentElement),(s==null?void 0:s.tagName)==="A")for(const r of this._lenses){const a=r.getCommand(s);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new sk;for(const n of this._lenses)n.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let n;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(n&&n[n.length-1].symbol.range.startLineNumber===l?n.push(a):(n=[a],i.push(n)))}if(!i.length&&!this._lenses.length)return;const s=Ra.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const d=new sk;let c=0,u=0;for(;uthis._resolveCodeLensesInViewportSoon())),c++,u++)}for(;cthis._resolveCodeLensesInViewportSoon())),u++;d.commit(a)})}),s.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],n=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(i.push(l),n.push(a))}),i.length===0)return;const s=Date.now(),r=_n(a=>{const l=i.map((d,c)=>{const u=new Array(d.length),h=d.map((g,f)=>!g.symbol.command&&typeof g.provider.resolveCodeLens=="function"?Promise.resolve(g.provider.resolveCodeLens(t,g.symbol,a)).then(m=>{u[f]=m},en):(u[f]=g.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!n[c].isDisposed()&&n[c].updateCommands(u)})});return Promise.all(l)});this._resolveCodeLensesPromise=r,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-s);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{nt(a),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var e;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel}};Jp.ID="css.editor.codeLens";Jp=Ove([i_(1,Me),i_(2,wr),i_(3,Ri),i_(4,sn),i_(5,pV)],Jp);At(Jp.ID,Jp,1);_e(class extends Te{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:T.hasCodeLensProvider,label:p("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;const i=e.get(Ha),n=e.get(Ri),s=e.get(sn),r=t.getSelection().positionLineNumber,a=t.getContribution(Jp.ID);if(!a)return;const l=await a.getModel();if(!l)return;const d=[];for(const h of l.lenses)h.symbol.command&&h.symbol.range.startLineNumber===r&&d.push({label:h.symbol.command.title,command:h.symbol.command});if(d.length===0)return;const c=await i.pick(d,{canPickMany:!1,placeHolder:p("placeHolder","Select a command")});if(!c)return;let u=c.command;if(l.isDisposed){const h=await a.getModel(),g=h==null?void 0:h.lenses.find(f=>{var m;return f.symbol.range.startLineNumber===r&&((m=f.symbol.command)===null||m===void 0?void 0:m.title)===u.title});if(!g||!g.symbol.command)return;u=g.symbol.command}try{await n.executeCommand(u.id,...u.arguments||[])}catch(h){s.error(h)}}});var Fve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ok=function(o,e){return function(t,i){e(t,i,o)}};class AR{constructor(e,t){this._editorWorkerClient=new BM(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const n=t.range,s=t.color,r=s.alpha,a=new Y(new kt(Math.round(255*s.red),Math.round(255*s.green),Math.round(255*s.blue),r)),l=r?Y.Format.CSS.formatRGB(a):Y.Format.CSS.formatRGBA(a),d=r?Y.Format.CSS.formatHSL(a):Y.Format.CSS.formatHSLA(a),c=r?Y.Format.CSS.formatHex(a):Y.Format.CSS.formatHexA(a),u=[];return u.push({label:l,textEdit:{range:n,text:l}}),u.push({label:d,textEdit:{range:n,text:d}}),u.push({label:c,textEdit:{range:n,text:c}}),u}}let fT=class extends q{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new AR(e,t)))}};fT=Fve([ok(0,Si),ok(1,si),ok(2,Me)],fT);_L(fT);async function mV(o,e,t,i=!0){return RR(new Bve,o,e,t,i)}function _V(o,e,t,i){return Promise.resolve(t.provideColorPresentations(o,e,i))}class Bve{constructor(){}async compute(e,t,i,n){const s=await e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({colorInfo:r,provider:e});return Array.isArray(s)}}class Wve{constructor(){}async compute(e,t,i,n){const s=await e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(s)}}class Vve{constructor(e){this.colorInfo=e}async compute(e,t,i,n){const s=await e.provideColorPresentations(t,this.colorInfo,vt.None);return Array.isArray(s)&&n.push(...s),Array.isArray(s)}}async function RR(o,e,t,i,n){let s=!1,r;const a=[],l=e.ordered(t);for(let d=l.length-1;d>=0;d--){const c=l[d];if(c instanceof AR)r=c;else try{await o.compute(c,t,i,a)&&(s=!0)}catch(u){en(u)}}return s?a:r&&n?(await o.compute(r,t,i,a),a):[]}function vV(o,e){const{colorProvider:t}=o.get(Me),i=o.get(Si).getModel(e);if(!i)throw hr();const n=o.get(Dt).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:n}}Et.registerCommand("_executeDocumentColorProvider",function(o,...e){const[t]=e;if(!(t instanceof ze))throw hr();const{model:i,colorProviderRegistry:n,isDefaultColorDecoratorsEnabled:s}=vV(o,t);return RR(new Wve,n,i,vt.None,s)});Et.registerCommand("_executeColorPresentationProvider",function(o,...e){const[t,i]=e,{uri:n,range:s}=i;if(!(n instanceof ze)||!Array.isArray(t)||t.length!==4||!k.isIRange(s))throw hr();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=vV(o,n),[d,c,u,h]=t;return RR(new Vve({range:s,color:{red:d,green:c,blue:u,alpha:h}}),a,r,vt.None,l)});var Hve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},rk=function(o,e){return function(t,i){e(t,i,o)}},pT;const bV=Object.create({});let wu=pT=class extends q{constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new de),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new o0(this._editor),this._decoratorLimitReporter=new zve,this._colorDecorationClassRefs=this._register(new de),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:pT.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(s=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const a=r!==this._isColorDecoratorsEnabled||s.hasChanged(21),l=s.hasChanged(145);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const n=i.colorDecorators;if(n&&n.enable!==void 0&&!n.enable)return n.enable}return this._editor.getOption(20)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new qr,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=_n(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new ds(!1),n=await mV(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),n});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){nt(e)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:st.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((n,s)=>this._colorDatas.set(n,e[s]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(21);for(let s=0;sthis._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};wu.ID="editor.contrib.colorDetector";wu.RECOMPUTE_TIME=1e3;wu=pT=Hve([rk(1,Dt),rk(2,Me),rk(3,wr)],wu);class zve{constructor(){this._onDidChange=new W,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}At(wu.ID,wu,1);class $ve{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new W,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new W,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new W,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let n=0;n{this.backgroundColor=r.getColor(xw)||Y.white})),this._register(J(this._pickedColorNode,Se.CLICK,()=>this.model.selectNextColorPresentation())),this._register(J(this._originalColorNode,Se.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=Y.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new jve(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=Y.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}class jve extends q{constructor(e){super(),this._onClicked=this._register(new W),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),le(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),le(this._button,t),le(t,Bo(".button"+Ue.asCSSSelector(Zi("color-picker-close",ve.close,p("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class Kve extends q{constructor(e,t,i,n=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=Bo(".colorpicker-body"),le(e,this._domNode),this._saturationBox=new qve(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new Gve(this._domNode,this.model,n),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new Zve(this._domNode,this.model,n),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),n&&(this._insertButton=this._register(new Yve(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new Y(new pl(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new Y(new pl(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new Y(new pl(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class qve extends q{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new W,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new W,this.onColorFlushed=this._onColorFlushed.event,this._domNode=Bo(".saturation-wrap"),le(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",le(this._domNode,this._canvas),this.selection=Bo(".saturation-selection"),le(this._domNode,this.selection),this.layout(),this._register(J(this._domNode,Se.POINTER_DOWN,n=>this.onPointerDown(n))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new vm);const t=gn(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>this.onDidChangePosition(n.pageX-t.left,n.pageY-t.top),()=>null);const i=J(e.target.ownerDocument,Se.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new Y(new pl(e.h,1,1,1)),i=this._canvas.getContext("2d"),n=i.createLinearGradient(0,0,this._canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)");const s=i.createLinearGradient(0,0,0,this._canvas.height);s.addColorStop(0,"rgba(0, 0, 0, 0)"),s.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=Y.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=s,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class CV extends q{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new W,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new W,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=le(e,Bo(".standalone-strip")),this.overlay=le(this.domNode,Bo(".standalone-overlay"))):(this.domNode=le(e,Bo(".strip")),this.overlay=le(this.domNode,Bo(".overlay"))),this.slider=le(this.domNode,Bo(".slider")),this.slider.style.top="0px",this._register(J(this.domNode,Se.POINTER_DOWN,n=>this.onPointerDown(n))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new vm),i=gn(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangeTop(s.pageY-i.top),()=>null);const n=J(e.target.ownerDocument,Se.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class Gve extends CV{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:n}=e.rgba,s=new Y(new kt(t,i,n,1)),r=new Y(new kt(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${s} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class Zve extends CV{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class Yve extends q{constructor(e){super(),this._onClicked=this._register(new W),this.onClicked=this._onClicked.event,this._button=le(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=t=>{this._onClicked.fire()}}get button(){return this._button}}class Xve extends Gr{constructor(e,t,i,n,s=!1){super(),this.model=t,this.pixelRatio=i,this._register(yv.onDidChange(()=>this.layout()));const r=Bo(".colorpicker-widget");e.appendChild(r),this.header=this._register(new Uve(r,this.model,n,s)),this.body=this._register(new Kve(r,this.model,this.pixelRatio,s))}layout(){this.body.layout()}}var wV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},SV=function(o,e){return function(t,i){e(t,i,o)}};class Qve{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let AS=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return rn.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const n=wu.get(this._editor);if(!n)return[];for(const s of t){if(!n.isColorDecoration(s))continue;const r=n.getColorData(s.range.getStartPosition());if(r)return[await yV(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]}renderHoverParts(e,t){return LV(this,this._editor,this._themeService,t,e)}};AS=wV([SV(1,Sn)],AS);class Jve{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}}let wb=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}async createColorHover(e,t,i){if(!this._editor.hasModel()||!wu.get(this._editor))return null;const s=await mV(i,this._editor.getModel(),vt.None);let r=null,a=null;for(const u of s){const h=u.colorInfo;k.containsRange(h.range,e.range)&&(r=h,a=u.provider)}const l=r??e,d=a??t,c=!!r;return{colorHover:await yV(this,this._editor.getModel(),l,d),foundInEditor:c}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new k(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await H1(this._editor.getModel(),t,this._color,i,e),i=DV(this._editor,i,t))}renderHoverParts(e,t){return LV(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};wb=wV([SV(1,Sn)],wb);async function yV(o,e,t,i){const n=e.getValueInRange(t.range),{red:s,green:r,blue:a,alpha:l}=t.color,d=new kt(Math.round(s*255),Math.round(r*255),Math.round(a*255),l),c=new Y(d),u=await _V(e,t,i,vt.None),h=new $ve(c,[],0);return h.colorPresentations=u||[],h.guessColorPresentation(c,n),o instanceof AS?new Qve(o,k.lift(t.range),h,i):new Jve(o,k.lift(t.range),h,i)}function LV(o,e,t,i,n){if(i.length===0||!e.hasModel())return q.None;if(n.setMinimumDimensions){const h=e.getOption(66)+8;n.setMinimumDimensions(new Rt(302,h))}const s=new de,r=i[0],a=e.getModel(),l=r.model,d=s.add(new Xve(n.fragment,l,e.getOption(141),t,o instanceof wb));n.setColorPicker(d);let c=!1,u=new k(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(o instanceof wb){const h=i[0].model.color;o.color=h,H1(a,l,h,u,r),s.add(l.onColorFlushed(g=>{o.color=g}))}else s.add(l.onColorFlushed(async h=>{await H1(a,l,h,u,r),c=!0,u=DV(e,u,l,n)}));return s.add(l.onDidChangeColor(h=>{H1(a,l,h,u,r)})),s.add(e.onDidChangeModelContent(h=>{c?c=!1:(n.hide(),e.focus())})),s}function DV(o,e,t,i){let n,s;if(t.presentation.textEdit){n=[t.presentation.textEdit],s=new k(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const r=o.getModel()._setTrackedRange(null,s,3);o.pushUndoStop(),o.executeEdits("colorpicker",n),s=o.getModel()._getTrackedRange(r)||s}else n=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],s=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),o.pushUndoStop(),o.executeEdits("colorpicker",n);return t.presentation.additionalTextEdits&&(n=[...t.presentation.additionalTextEdits],o.executeEdits("colorpicker",n),i&&i.hide()),o.pushUndoStop(),s}async function H1(o,e,t,i,n){const s=await _V(o,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},n.provider,vt.None);e.colorPresentations=s||[]}function mT(o,e){return!!o[e]}class ak{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=mT(e.event,t.triggerModifier),this.hasSideBySideModifier=mT(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class c3{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=mT(e,t.triggerModifier)}}class FC{constructor(e,t,i,n){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function u3(o){return o==="altKey"?It?new FC(57,"metaKey",6,"altKey"):new FC(5,"ctrlKey",6,"altKey"):It?new FC(6,"altKey",57,"metaKey"):new FC(6,"altKey",5,"ctrlKey")}class ML extends q{constructor(e,t){var i;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new W),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new W),this.onExecute=this._onExecute.event,this._onCancel=this._register(new W),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(i=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&i!==void 0?i:n=>n.target.position?n.target.position.lineNumber:0,this._opts=u3(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(n=>{if(n.hasChanged(77)){const s=u3(this._editor.getOption(77));if(this._opts.equals(s))return;this._opts=s,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(n=>this._onEditorMouseMove(new ak(n,this._opts)))),this._register(this._editor.onMouseDown(n=>this._onEditorMouseDown(new ak(n,this._opts)))),this._register(this._editor.onMouseUp(n=>this._onEditorMouseUp(new ak(n,this._opts)))),this._register(this._editor.onKeyDown(n=>this._onEditorKeyDown(new c3(n,this._opts)))),this._register(this._editor.onKeyUp(n=>this._onEditorKeyUp(new c3(n,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(n=>this._onDidChangeCursorSelection(n))),this._register(this._editor.onDidChangeModel(n=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(n=>{(n.scrollTopChanged||n.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var ebe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nd=function(o,e){return function(t,i){e(t,i,o)}};let Su=class extends Vp{constructor(e,t,i,n,s,r,a,l,d,c,u,h,g){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,s,r,a,l,d,c,u,h,g),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(f=>this._onParentConfigurationChanged(f)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){ry(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Su=ebe([nd(4,qe),nd(5,Ot),nd(6,Ri),nd(7,Xe),nd(8,Sn),nd(9,sn),nd(10,Zl),nd(11,si),nd(12,Me)],Su);const h3=new Y(new kt(0,122,204)),tbe={showArrow:!0,showFrame:!0,className:"",frameColor:h3,arrowColor:h3,keepEditorSelection:!1},ibe="vs.editor.contrib.zoneWidget";class nbe{constructor(e,t,i,n,s,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=s,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class sbe{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class AL{constructor(e){this._editor=e,this._ruleName=AL._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),VI(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){VI(this._ruleName),pw(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:k.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}AL._IdGenerator=new BA(".arrow-decoration-");class obe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new de,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=gd(t),ry(this.options,tbe,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const n=this._getWidth(i);this.domNode.style.width=n+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(n)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new AL(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;const n=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(n))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=k.isIRange(e)?k.lift(e):k.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:st.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),s=this._getWidth(n);this.domNode.style.width=`${s}px`,this.domNode.style.left=this._getLeft(n)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,d=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(a/9)),this.editor.changeViewZones(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new nbe(r,i.lineNumber,i.column,t,g=>this._onViewZoneTop(g),g=>this._onViewZoneHeight(g),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new sbe(ibe+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const c=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=c+"px",this.container.style.overflow="hidden"),this._doLayout(c,s),this.options.keepEditorSelection||this.editor.setSelection(e);const u=this.editor.getModel();if(u){const h=u.validateRange(new k(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===u.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new ss(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(66),n=i<0?Math.ceil(i):Math.floor(i),s=e.heightInLines+n;s>5&&s<35&&this._relayout(s)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var xV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},kV=function(o,e){return function(t,i){e(t,i,o)}};const IV=bt("IPeekViewService");xt(IV,class{constructor(){this._widgets=new Map}addExclusiveWidget(o,e){const t=this._widgets.get(o);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const n=this._widgets.get(o);n&&n.widget===e&&(n.listener.dispose(),this._widgets.delete(o))};this._widgets.set(o,{widget:e,listener:e.onDidClose(i)})}},1);var Zs;(function(o){o.inPeekEditor=new De("inReferenceSearchEditor",!0,p("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),o.notInPeekEditor=o.inPeekEditor.toNegated()})(Zs||(Zs={}));let Sb=class{constructor(e,t){e instanceof Su&&Zs.inPeekEditor.bindTo(t)}dispose(){}};Sb.ID="editor.contrib.referenceController";Sb=xV([kV(1,Xe)],Sb);At(Sb.ID,Sb,0);function rbe(o){const e=o.get(Ot).getFocusedCodeEditor();return e instanceof Su?e.getParentEditor():e}const abe={headerBackgroundColor:Y.white,primaryHeadingColor:Y.fromHex("#333333"),secondaryHeadingColor:Y.fromHex("#6c6c6cb3")};let RS=class extends obe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new W,this.onDidClose=this._onDidClose.event,ry(this.options,abe,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){const t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=pe(".head"),this._bodyElement=pe(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=pe(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Wi(this._titleElement,"click",s=>this._onTitleClick(s))),le(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=pe("span.filename"),this._secondaryHeading=pe("span.dirname"),this._metaHeading=pe("span.meta"),le(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=pe(".peekview-actions");le(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new Cr(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Rs("peekview.close",p("label.close","Close"),Ue.asClassName(ve.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:qce.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:$n(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,oo(this._metaHeading)):xs(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(66)*1.2),n=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(n,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};RS=xV([kV(2,qe)],RS);const lbe=M("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:Y.black,hcLight:Y.white},p("peekViewTitleBackground","Background color of the peek view title area.")),EV=M("peekViewTitleLabel.foreground",{dark:Y.white,light:Y.black,hcDark:Y.white,hcLight:Fr},p("peekViewTitleForeground","Color of the peek view title.")),NV=M("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},p("peekViewTitleInfoForeground","Color of the peek view title info.")),dbe=M("peekView.border",{dark:Ks,light:Ks,hcDark:Lt,hcLight:Lt},p("peekViewBorder","Color of the peek view borders and arrow.")),cbe=M("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:Y.black,hcLight:Y.white},p("peekViewResultsBackground","Background color of the peek view result list."));M("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:Y.white,hcLight:Fr},p("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));M("peekViewResult.fileForeground",{dark:Y.white,light:"#1E1E1E",hcDark:Y.white,hcLight:Fr},p("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));M("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},p("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));M("peekViewResult.selectionForeground",{dark:Y.white,light:"#6C6C6C",hcDark:Y.white,hcLight:Fr},p("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const Pc=M("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:Y.black,hcLight:Y.white},p("peekViewEditorBackground","Background color of the peek view editor."));M("peekViewEditorGutter.background",{dark:Pc,light:Pc,hcDark:Pc,hcLight:Pc},p("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));M("peekViewEditorStickyScroll.background",{dark:Pc,light:Pc,hcDark:Pc,hcLight:Pc},p("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));M("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},p("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));M("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},p("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));M("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:fi,hcLight:fi},p("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));class yu{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=ZE.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?p({},"{0} in {1} on line {2} at column {3}",t.value,br(this.uri),this.range.startLineNumber,this.range.startColumn):p("aria.oneReference","in {0} on line {1} at column {2}",br(this.uri),this.range.startLineNumber,this.range.startColumn)}}class ube{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:s,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:n,column:s-t}),d=new k(n,l.startColumn,n,s),c=new k(r,a,r,1073741824),u=i.getValueInRange(d).replace(/^\s+/,""),h=i.getValueInRange(e),g=i.getValueInRange(c).replace(/\s+$/,"");return{value:u+h+g,highlight:{start:u.length,end:u.length+h.length}}}}class yb{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Gi}dispose(){jt(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?p("aria.fileReferences.1","1 symbol in {0}, full path {1}",br(this.uri),this.uri.fsPath):p("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,br(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=await e.createModelReference(t.uri);this._previews.set(t.uri,new ube(i))}catch(i){nt(i)}return this}}class go{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new W,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(go._compareReferences);let n;for(const s of e)if((!n||!pi.isEqual(n.uri,s.uri,!0))&&(n=new yb(this,s.uri),this.groups.push(n)),n.children.length===0||go._compareReferences(s,n.children[n.children.length-1])!==0){const r=new yu(i===s,n,s,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),n.children.push(r)}}dispose(){jt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new go(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?p("aria.result.0","No results found"):this.references.length===1?p("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?p("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):p("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let n=i.children.indexOf(e);const s=i.children.length,r=i.parent.groups.length;return r===1||t&&n+10?(t?n=(n+1)%s:n=(n+s-1)%s,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%r,i.parent.groups[n].children[0]):(n=(n+r-1)%r,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((n,s)=>({idx:s,prefixLen:Qh(n.uri.toString(),e.toString()),offsetDist:Math.abs(n.range.startLineNumber-t.lineNumber)*100+Math.abs(n.range.startColumn-t.column)})).sort((n,s)=>n.prefixLen>s.prefixLen?-1:n.prefixLens.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&k.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return pi.compare(e.uri,t.uri)||k.compareRangesUsingStarts(e.range,t.range)}}var RL=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},PL=function(o,e){return function(t,i){e(t,i,o)}},_T;let vT=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof go||e instanceof yb}getChildren(e){if(e instanceof go)return e.groups;if(e instanceof yb)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};vT=RL([PL(0,Xs)],vT);class hbe{getHeight(){return 23}getTemplateId(e){return e instanceof yb?Lb.id:M0.id}}let bT=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof yu){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return br(e.uri)}};bT=RL([PL(0,Xt)],bT);class gbe{getId(e){return e instanceof yu?e.id:e.uri}}let CT=class extends q{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new _S(i,{supportHighlights:!0})),this.badge=new vN(le(i,pe(".count")),{},y6),e.appendChild(i)}set(e,t){const i=qy(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(p("referencesCount","{0} references",n)):this.badge.setTitleFormat(p("referenceCount","{0} reference",n))}};CT=RL([PL(1,Hp)],CT);let Lb=_T=class{constructor(e){this._instantiationService=e,this.templateId=_T.id}renderTemplate(e){return this._instantiationService.createInstance(CT,e)}renderElement(e,t,i){i.set(e.element,p0(e.filterData))}disposeTemplate(e){e.dispose()}};Lb.id="FileReferencesRenderer";Lb=_T=RL([PL(0,qe)],Lb);class fbe{constructor(e){this.label=new Gc(e)}set(e,t){var i;const n=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!n||!n.value)this.label.set(`${br(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:s,highlight:r}=n;t&&!ka.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(s,p0(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(s,[r]))}}}class M0{constructor(){this.templateId=M0.id}renderTemplate(e){return new fbe(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}M0.id="OneReferenceRenderer";class pbe{getWidgetAriaLabel(){return p("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var mbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},sd=function(o,e){return function(t,i){e(t,i,o)}};class OL{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new de,this._callOnModelChange=new de,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let n=0,s=e.children.length;n{const s=n.deltaDecorations([],t);for(let r=0;r{s.equals(9)&&(this._keybindingService.dispatchEvent(s,s.target),s.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(vbe,"ReferencesWidget",this._treeContainer,new hbe,[this._instantiationService.createInstance(Lb),this._instantiationService.createInstance(M0)],this._instantiationService.createInstance(vT),i),this._splitView.addView({onDidChange:ye.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:s=>{this._preview.layout({height:this._dim.height,width:s})}},cS.Distribute),this._splitView.addView({onDidChange:ye.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:s=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${s}px`,this._tree.layout(this._dim.height,s)}},cS.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(s,r)=>{s instanceof yu&&(r==="show"&&this._revealReference(s,!1),this._onDidSelectReference.fire({element:s,kind:r,source:"tree"}))};this._tree.onDidOpen(s=>{s.sideBySide?n(s.element,"side"):s.editorOptions.pinned?n(s.element,"goto"):n(s.element,"show")}),xs(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Rt(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=p("noResults","No results"),oo(this._messageContainer),Promise.resolve(void 0)):(xs(this._messageContainer),this._decorationsManager=new OL(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),oo(this._treeContainer),oo(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof yu)return e;if(e instanceof yb&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==ot.inMemory?this.setTitle(Ooe(e.uri),this._uriLabel.getUriLabel(qy(e.uri))):this.setTitle(p("peekView.alternateTitle","References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent),this._tree.reveal(e));const n=await i;if(!this._model){n.dispose();return}jt(this._previewModelReference);const s=n.object;if(s){const r=this._preview.getModel()===s.textEditorModel?0:1,a=k.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(s.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}};wT=mbe([sd(3,Sn),sd(4,Xs),sd(5,qe),sd(6,IV),sd(7,Hp),sd(8,Gy),sd(9,Xt),sd(10,bi),sd(11,si)],wT);var bbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},of=function(o,e){return function(t,i){e(t,i,o)}},z1;const $g=new De("referenceSearchVisible",!1,p("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Lu=z1=class{static get(e){return e.getContribution(z1.ID)}constructor(e,t,i,n,s,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=s,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new de,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=$g.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&e.containsPosition(n))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const s="peekViewLayout",r=_be.fromJSON(this._storageService.get(s,0,"{}"));this._widget=this._instantiationService.createInstance(wT,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(p("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(s,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:d,kind:c}=l;if(d)switch(c){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(d,!1,!1);break;case"side":this.openReference(d,!0,!1);break;case"goto":i?this._gotoReference(d,!0):this.openReference(d,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var d;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(d=this._model)===null||d===void 0||d.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(p("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const c=this._editor.getModel().uri,u=new z(e.startLineNumber,e.startColumn),h=this._model.nearestReference(c,u);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(86)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const n=this._model.nextOrPreviousReference(i,e),s=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();await this._widget.setSelection(n),await this._gotoReference(n,!1),s?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){var t,i;(t=this._widget)===null||t===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var i;(i=this._widget)===null||i===void 0||i.hide(),this._ignoreModelChangeEvent=!0;const n=k.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:n,selectionSource:"code.jump",pinned:t}},this._editor).then(s=>{var r;if(this._ignoreModelChangeEvent=!1,!s||!this._widget){this.closeWidget();return}if(this._editor===s)this._widget.show(n),this._widget.focusOnReferenceTree();else{const a=z1.get(s),l=this._model.clone();this.closeWidget(),s.focus(),a==null||a.toggleWidget(n,_n(d=>Promise.resolve(l)),(r=this._peekMode)!==null&&r!==void 0?r:!1)}},s=>{this._ignoreModelChangeEvent=!1,nt(s)})}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:s}=e;this._editorService.openCodeEditor({resource:n,options:{selection:s,selectionSource:"code.jump",pinned:i}},this._editor,t)}};Lu.ID="editor.contrib.referencesController";Lu=z1=bbe([of(2,Xe),of(3,Ot),of(4,sn),of(5,qe),of(6,Xr),of(7,Dt)],Lu);function Ug(o,e){const t=rbe(o);if(!t)return;const i=Lu.get(t);i&&e(i)}Gs.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:fn(2089,60),when:ae.or($g,Zs.inPeekEditor),handler(o){Ug(o,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Gs.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:ae.or($g,Zs.inPeekEditor),handler(o){Ug(o,e=>{e.goToNextOrPreviousReference(!0)})}});Gs.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:ae.or($g,Zs.inPeekEditor),handler(o){Ug(o,e=>{e.goToNextOrPreviousReference(!1)})}});Et.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Et.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Et.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Et.registerCommand("closeReferenceSearch",o=>Ug(o,e=>e.closeWidget()));Gs.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:ae.and(Zs.inPeekEditor,ae.not("config.editor.stablePeek"))});Gs.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:ae.and($g,ae.not("config.editor.stablePeek"))});Gs.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:ae.and($g,z6,tR.negate(),iR.negate()),handler(o){var e;const i=(e=o.get(Lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof yu&&Ug(o,n=>n.revealReference(i[0]))}});Gs.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:ae.and($g,z6,tR.negate(),iR.negate()),handler(o){var e;const i=(e=o.get(Lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof yu&&Ug(o,n=>n.openReference(i[0],!0,!0))}});Et.registerCommand("openReference",o=>{var e;const i=(e=o.get(Lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof yu&&Ug(o,n=>n.openReference(i[0],!1,!0))});var TV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},E_=function(o,e){return function(t,i){e(t,i,o)}};const PR=new De("hasSymbols",!1,p("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),FL=bt("ISymbolNavigationService");let ST=class{constructor(e,t,i,n){this._editorService=t,this._notificationService=i,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=PR.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new yT(this._editorService),n=i.onDidChange(s=>{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),l=r.getPosition();if(!a||!l)return;let d=!1,c=!1;for(const u of t.references)if(dA(u.uri,a.uri))d=!0,c=c||k.containsPosition(u.range,l);else if(d)break;(!d||!c)&&this.reset()});this._currentState=Hr(i,n)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:k.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?p("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):p("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};ST=TV([E_(0,Xe),E_(1,Ot),E_(2,sn),E_(3,Xt)],ST);xt(FL,ST,1);we(new class extends Rn{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:PR,kbOpts:{weight:100,primary:70}})}runEditorCommand(o,e){return o.get(FL).revealNext(e)}});Gs.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:PR,primary:9,handler(o){o.get(FL).reset()}});let yT=class{constructor(e){this._listener=new Map,this._disposables=new de,this._onDidChange=new W,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),jt(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Hr(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};yT=TV([E_(0,Ot)],yT);async function A0(o,e,t,i){const s=t.ordered(o).map(a=>Promise.resolve(i(a,o,e)).then(void 0,l=>{en(l)})),r=await Promise.all(s);return Ia(r.flat())}function BL(o,e,t,i){return A0(e,t,o,(n,s,r)=>n.provideDefinition(s,r,i))}function MV(o,e,t,i){return A0(e,t,o,(n,s,r)=>n.provideDeclaration(s,r,i))}function AV(o,e,t,i){return A0(e,t,o,(n,s,r)=>n.provideImplementation(s,r,i))}function RV(o,e,t,i){return A0(e,t,o,(n,s,r)=>n.provideTypeDefinition(s,r,i))}function WL(o,e,t,i,n){return A0(e,t,o,async(s,r,a)=>{const l=await s.provideReferences(r,a,{includeDeclaration:!0},n);if(!i||!l||l.length!==2)return l;const d=await s.provideReferences(r,a,{includeDeclaration:!1},n);return d&&d.length===1?d:l})}async function R0(o){const e=await o(),t=new go(e,""),i=t.references.map(n=>n.link);return t.dispose(),i}ql("_executeDefinitionProvider",(o,e,t)=>{const i=o.get(Me),n=BL(i.definitionProvider,e,t,vt.None);return R0(()=>n)});ql("_executeTypeDefinitionProvider",(o,e,t)=>{const i=o.get(Me),n=RV(i.typeDefinitionProvider,e,t,vt.None);return R0(()=>n)});ql("_executeDeclarationProvider",(o,e,t)=>{const i=o.get(Me),n=MV(i.declarationProvider,e,t,vt.None);return R0(()=>n)});ql("_executeReferenceProvider",(o,e,t)=>{const i=o.get(Me),n=WL(i.referenceProvider,e,t,!1,vt.None);return R0(()=>n)});ql("_executeImplementationProvider",(o,e,t)=>{const i=o.get(Me),n=AV(i.implementationProvider,e,t,vt.None);return R0(()=>n)});var n_,s_,o_,BC,WC,VC,HC,zC;zn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextPeek,title:p("peek.submenu","Peek"),group:"navigation",order:100});class em{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof em||z.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class bs extends Wa{static all(){return bs._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of wt.wrap(t.menu))(i.id===N.EditorContext||i.id===N.EditorContextPeek)&&(i.when=ae.and(e.precondition,i.when));return t}constructor(e,t){super(bs._patchConfig(t)),this.configuration=e,bs._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const s=e.get(sn),r=e.get(Ot),a=e.get(Bu),l=e.get(FL),d=e.get(Me),c=e.get(qe),u=t.getModel(),h=t.getPosition(),g=em.is(i)?i:new em(u,h),f=new bu(t,5),m=Cy(this._getLocationModel(d,g.model,g.position,f.token),f.token).then(async v=>{var _;if(!v||f.token.isCancellationRequested)return;mo(v.ariaMessage);let b;if(v.referenceAt(u.uri,h)){const w=this._getAlternativeCommand(t);!bs._activeAlternativeCommands.has(w)&&bs._allSymbolNavigationCommands.has(w)&&(b=bs._allSymbolNavigationCommands.get(w))}const C=v.references.length;if(C===0){if(!this.configuration.muteMessage){const w=u.getWordAtPosition(h);(_=ho.get(t))===null||_===void 0||_.showMessage(this._getNoResultFoundMessage(w),h)}}else if(C===1&&b)bs._activeAlternativeCommands.add(this.desc.id),c.invokeFunction(w=>b.runEditorCommand(w,t,i,n).finally(()=>{bs._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,v,n)},v=>{s.error(v)}).finally(()=>{f.dispose()});return a.showWhile(m,250),m}async _onResult(e,t,i,n,s){const r=this._getGoToPreference(i);if(!(i instanceof Su)&&(this.configuration.openInPeek||r==="peek"&&n.references.length>1))this._openInPeek(i,n,s);else{const a=n.firstReference(),l=n.references.length>1&&r==="gotoAndPeek",d=await this._openReference(i,e,a,this.configuration.openToSide,!l);l&&d?this._openInPeek(d,n,s):n.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,i,n,s){let r;if(XZ(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:k.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,n);if(a){if(s){const l=a.getModel(),d=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&d.clear()},350)}return a}}_openInPeek(e,t,i){const n=Lu.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),_n(s=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}bs._allSymbolNavigationCommands=new Map;bs._activeAlternativeCommands=new Set;class P0 extends bs{async _getLocationModel(e,t,i,n){return new go(await BL(e.definitionProvider,t,i,n),p("def.title","Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?p("noResultWord","No definition found for '{0}'",e.word):p("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}mi((n_=class extends P0{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:n_.id,title:{value:p("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:p({},"Go to &&Definition")},precondition:ae.and(T.hasDefinitionProvider,T.isInWalkThroughSnippet.toNegated()),keybinding:[{when:T.editorTextFocus,primary:70,weight:100},{when:ae.and(T.editorTextFocus,W6),primary:2118,weight:100}],menu:[{id:N.EditorContext,group:"navigation",order:1.1},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Et.registerCommandAlias("editor.action.goToDeclaration",n_.id)}},n_.id="editor.action.revealDefinition",n_));mi((s_=class extends P0{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:s_.id,title:{value:p("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:ae.and(T.hasDefinitionProvider,T.isInWalkThroughSnippet.toNegated()),keybinding:[{when:T.editorTextFocus,primary:fn(2089,70),weight:100},{when:ae.and(T.editorTextFocus,W6),primary:fn(2089,2118),weight:100}]}),Et.registerCommandAlias("editor.action.openDeclarationToTheSide",s_.id)}},s_.id="editor.action.revealDefinitionAside",s_));mi((o_=class extends P0{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:o_.id,title:{value:p("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:ae.and(T.hasDefinitionProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:N.EditorContextPeek,group:"peek",order:2}}),Et.registerCommandAlias("editor.action.previewDeclaration",o_.id)}},o_.id="editor.action.peekDefinition",o_));class PV extends bs{async _getLocationModel(e,t,i,n){return new go(await MV(e.declarationProvider,t,i,n),p("decl.title","Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?p("decl.noResultWord","No declaration found for '{0}'",e.word):p("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}mi((BC=class extends PV{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:BC.id,title:{value:p("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:p({},"Go to &&Declaration")},precondition:ae.and(T.hasDeclarationProvider,T.isInWalkThroughSnippet.toNegated()),menu:[{id:N.EditorContext,group:"navigation",order:1.3},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?p("decl.noResultWord","No declaration found for '{0}'",e.word):p("decl.generic.noResults","No declaration found")}},BC.id="editor.action.revealDeclaration",BC));mi(class extends PV{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:p("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:ae.and(T.hasDeclarationProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:3}})}});class OV extends bs{async _getLocationModel(e,t,i,n){return new go(await RV(e.typeDefinitionProvider,t,i,n),p("typedef.title","Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?p("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):p("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}mi((WC=class extends OV{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:WC.ID,title:{value:p("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:p({},"Go to &&Type Definition")},precondition:ae.and(T.hasTypeDefinitionProvider,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.editorTextFocus,primary:0,weight:100},menu:[{id:N.EditorContext,group:"navigation",order:1.4},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},WC.ID="editor.action.goToTypeDefinition",WC));mi((VC=class extends OV{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:VC.ID,title:{value:p("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:ae.and(T.hasTypeDefinitionProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:4}})}},VC.ID="editor.action.peekTypeDefinition",VC));class FV extends bs{async _getLocationModel(e,t,i,n){return new go(await AV(e.implementationProvider,t,i,n),p("impl.title","Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?p("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):p("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}mi((HC=class extends FV{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:HC.ID,title:{value:p("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:p({},"Go to &&Implementations")},precondition:ae.and(T.hasImplementationProvider,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.editorTextFocus,primary:2118,weight:100},menu:[{id:N.EditorContext,group:"navigation",order:1.45},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},HC.ID="editor.action.goToImplementation",HC));mi((zC=class extends FV{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:zC.ID,title:{value:p("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:ae.and(T.hasImplementationProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.editorTextFocus,primary:3142,weight:100},menu:{id:N.EditorContextPeek,group:"peek",order:5}})}},zC.ID="editor.action.peekImplementation",zC));class BV extends bs{_getNoResultFoundMessage(e){return e?p("references.no","No references found for '{0}'",e.word):p("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}mi(class extends BV{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:p("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:p({},"Go to &&References")},precondition:ae.and(T.hasReferenceProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.editorTextFocus,primary:1094,weight:100},menu:[{id:N.EditorContext,group:"navigation",order:1.45},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,n){return new go(await WL(e.referenceProvider,t,i,!0,n),p("ref.title","References"))}});mi(class extends BV{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:p("references.action.label","Peek References"),original:"Peek References"},precondition:ae.and(T.hasReferenceProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,n){return new go(await WL(e.referenceProvider,t,i,!1,n),p("ref.title","References"))}});class Cbe extends bs{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:p("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:ae.and(Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,n){return new go(this._references,p("generic.title","Locations"))}_getNoResultFoundMessage(e){return e&&p("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}Et.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:ze},{name:"position",description:"The position at which to start",constraint:z.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(o,e,t,i,n,s,r)=>{qt(ze.isUri(e)),qt(z.isIPosition(t)),qt(Array.isArray(i)),qt(typeof n>"u"||typeof n=="string"),qt(typeof r>"u"||typeof r=="boolean");const a=o.get(Ot),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if($l(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(d=>{const c=new class extends Cbe{_getNoResultFoundMessage(u){return s||super._getNoResultFoundMessage(u)}}({muteMessage:!s,openInPeek:!!r,openToSide:!1},i,n);d.get(qe).invokeFunction(c.run.bind(c),l)})}});Et.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:ze},{name:"position",description:"The position at which to start",constraint:z.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:async(o,e,t,i,n)=>{o.get(Ri).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)}});Et.registerCommand({id:"editor.action.findReferences",handler:(o,e,t)=>{qt(ze.isUri(e)),qt(z.isIPosition(t));const i=o.get(Me),n=o.get(Ot);return n.openCodeEditor({resource:e},n.getFocusedCodeEditor()).then(s=>{if(!$l(s)||!s.hasModel())return;const r=Lu.get(s);if(!r)return;const a=_n(d=>WL(i.referenceProvider,s.getModel(),z.lift(t),!1,d).then(c=>new go(c,p("ref.title","References")))),l=new k(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});Et.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var wbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},lk=function(o,e){return function(t,i){e(t,i,o)}},N_;let bg=N_=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new de,this.toUnhookForKeyboard=new de,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const s=new ML(e);this.toUnhook.add(s),this.toUnhook.add(s.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(s.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{nt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(s.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(N_.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}async startFindDefinition(e){var t;this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const n=new xW(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=_n(a=>this.findDefinition(e,a));let s;try{s=await this.previousPromise}catch(a){nt(a);return}if(!s||!s.length||!n.validate(this.editor)){this.removeLinkDecorations();return}const r=s[0].originSelectionRange?k.lift(s[0].originSelectionRange):new k(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(s.length>1){let a=r;for(const{originSelectionRange:l}of s)l&&(a=k.plusRange(a,l));this.addDecoration(a,new as().appendText(p("multipleResults","Click to show {0} definitions.",s.length)))}else{const a=s[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:d}}=l,{startLineNumber:c}=a.range;if(c<1||c>d.getLineCount()){l.dispose();return}const u=this.getPreviewValue(d,c,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(d.uri);this.addDecoration(r,u?new as().appendCodeblock(h||"",u):void 0),l.dispose()})}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=N_.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let s=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const n=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(i);return new P0({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Xe);return Zs.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};bg.ID="editor.contrib.gotodefinitionatposition";bg.MAX_SOURCE_PREVIEW_LINES=8;bg=N_=wbe([lk(1,Xs),lk(2,bi),lk(3,Me)],bg);At(bg.ID,bg,2);const $C=pe;class WV extends q{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new a0(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class OR extends q{static render(e,t,i){return new OR(e,t,i)}constructor(e,t,i){super(),this.actionContainer=le(e,$C("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=le(this.actionContainer,$C("a.action")),this.action.setAttribute("role","button"),t.iconClass&&le(this.action,$C(`span.icon.${t.iconClass}`));const n=le(this.action,$C("span"));n.textContent=i?`${t.label} (${i})`:t.label,this._register(J(this.actionContainer,Se.CLICK,s=>{s.stopPropagation(),s.preventDefault(),t.run(this.actionContainer)})),this._register(J(this.actionContainer,Se.KEY_DOWN,s=>{const r=new gi(s);(r.equals(3)||r.equals(10))&&(s.stopPropagation(),s.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function Sbe(o,e){return o&&e?p("acessibleViewHint","Inspect this in the accessible view with {0}.",e):o?p("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}let ybe=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class VV extends q{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new W),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Yt(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Yt(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Yt(()=>this._triggerLoadingMessage(),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(60).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=lX(e=>this._computer.computeAsync(e)),(async()=>{try{for await(const e of this._asyncIterable)e&&(this._result.push(e),this._fireResult());this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(e){nt(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){this._state===3&&this._setState(4)}_fireResult(){if(this._state===1||this._state===2)return;const e=this._state===0,t=this._state===4;this._onResult.fire(new ybe(this._result.slice(0),e,t))}start(e){if(e===0)this._state===0&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(0,!1)}}class dk{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class $1{constructor(e,t,i,n,s,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=s,this.supportsMarkerHover=r,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}const jg=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class FR{constructor(){this._onDidWillResize=new W,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new W,this.onDidResize=this._onDidResize.event,this._sashListener=new de,this._size=new Rt(0,0),this._minSize=new Rt(0,0),this._maxSize=new Rt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new ss(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new ss(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new ss(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:lS.North}),this._southSash=new ss(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:lS.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(ye.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(ye.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(n=>{e&&(i=n.currentX-n.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(n=>{e&&(i=-(n.currentX-n.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(n=>{e&&(t=-(n.currentY-n.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(ye.any(this._eastSash.onDidReset,this._westSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(ye.any(this._northSash.onDidReset,this._southSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,n){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=n?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:s,width:r}=this._maxSize;e=Math.max(i,Math.min(s,e)),t=Math.max(n,Math.min(r,t));const a=new Rt(t,e);Rt.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const Lbe=30,Dbe=24;class xbe extends q{constructor(e,t=new Rt(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new FR),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Rt.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new Rt(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?z.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:gn(t).top+i.top-Lbe}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=gn(t),s=ng(t.ownerDocument.body),r=n.top+i.top+i.height;return s.height-r-Dbe}_findPositionPreference(e,t){var i,n;const s=Math.min((i=this._availableVerticalSpaceBelow(t))!==null&&i!==void 0?i:1/0,e),r=Math.min((n=this._availableVerticalSpaceAbove(t))!==null&&n!==void 0?n:1/0,e),a=Math.min(Math.max(r,s),e),l=Math.min(e,a);let d;return this._editor.getOption(60).above?d=l<=r?1:2:d=l<=s?2:1,d===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),d}_resize(e){this._resizableNode.layout(e.height,e.width)}}var BR=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Oh=function(o,e){return function(t,i){e(t,i,o)}},U1,Xa;const g3=pe;let PS=U1=class extends q{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(Xc,this._editor)),this._participants=[];for(const n of jg.getAll())this._participants.push(this._instantiationService.createInstance(n,this._editor));this._participants.sort((n,s)=>n.hoverOrdinal-s.hoverOrdinal),this._computer=new FS(this._editor,this._participants),this._hoverOperation=this._register(new VV(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{if(!this._computer.anchor)return;const s=n.hasLoadingMessage?this._addLoadingMessage(n.value):n.value;this._withResult(new HV(this._computer.anchor,s,n.isComplete))})),this._register(Wi(this._widget.getDomNode(),"keydown",n=>{n.equals(9)&&this.hide()})),this._register(Ei.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;const t=[];for(const n of this._participants)if(n.suggestHoverAnchor){const s=n.suggestHoverAnchor(e);s&&t.push(s)}const i=e.target;if(i.type===6&&t.push(new dk(0,i.range,e.event.posx,e.event.posy)),i.type===7){const n=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexts.priority-n.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new dk(0,e,void 0,void 0),t,i,n,null)}_startShowingOrUpdateHover(e,t,i,n,s){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):!1:this._editor.getOption(60).sticky&&s&&this._widget.isMouseGettingCloser(s.event.posx,s.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,n,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,n,s){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=n,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=s,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:n,highlightRange:s}=U1.computeHoverRanges(this._editor,e.range,t),r=new de,a=r.add(new OS(this._keybindingService)),l=document.createDocumentFragment();let d=null;const c={fragment:l,statusBar:a,setColorPicker:h=>d=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const g=t.filter(f=>f.owner===h);g.length>0&&r.add(h.renderHoverParts(c,g))}const u=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(s){const h=this._editor.createDecorationsCollection();h.set([{range:s,options:U1._DECORATION_OPTIONS}]),r.add(je(()=>{h.clear()}))}this._widget.showAt(l,new Ibe(d,i,n,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,u,e.initialMousePosX,e.initialMousePosY,r))}else r.dispose()}static computeHoverRanges(e,t,i){let n=1;if(e.hasModel()){const d=e._getViewModel(),c=d.coordinatesConverter,u=c.convertModelRangeToViewRange(t),h=new z(u.startLineNumber,d.getLineMinColumn(u.startLineNumber));n=c.convertViewPositionToModelPosition(h).column}const s=t.startLineNumber;let r=t.startColumn,a=i[0].range,l=null;for(const d of i)a=k.plusRange(a,d.range),d.range.startLineNumber===s&&d.range.endLineNumber===s&&(r=Math.max(Math.min(r,d.range.startColumn),n)),d.forceShowAtRange&&(l=d.range);return{showAtPosition:l?l.getStartPosition():new z(s,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new z(s,r),highlightRange:a}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};PS._DECORATION_OPTIONS=st.register({description:"content-hover-highlight",className:"hoverHighlight"});PS=U1=BR([Oh(1,qe),Oh(2,Xt)],PS);class HV{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new kbe(this,this.anchor,t,this.isComplete)}}class kbe extends HV{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}class Ibe{constructor(e,t,i,n,s,r,a,l,d,c){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=n,this.stoleFocus=s,this.source=r,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=d,this.disposables=c,this.closestMouseDistance=void 0}}const f3=30,ck=10,Ebe=6;let Xc=Xa=class extends xbe{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,i,n,s){const r=e.getOption(66)+8,a=150,l=new Rt(a,r);super(e,l),this._configurationService=i,this._accessibilityService=n,this._keybindingService=s,this._hover=this._register(new WV),this._minimumSize=l,this._hoverVisibleKey=T.hoverVisible.bindTo(t),this._hoverFocusedKey=T.hoverFocused.bindTo(t),le(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(c=>{c.hasChanged(50)&&this._updateFont()}));const d=this._register(Pl(this._resizableNode.domNode));this._register(d.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(d.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return Xa.ID}static _applyDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.width=n,e.style.height=s}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return Xa._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return Xa._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=s}_setHoverWidgetMaxDimensions(e,t){Xa._applyMaxDimensions(this._hover.contentsDomNode,e,t),Xa._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,i-ck))}_updateResizableNodeMaxDimensions(){var e,t;const i=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,n=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new Rt(i,n),this._setHoverWidgetMaxDimensions(i,n)}_resize(e){var t,i;Xa._lastDimensions=new Rt(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(i=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||i===void 0||i.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=Ebe;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=ck),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=gn(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=p3(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const n=p3(e,t,i.left,i.top,i.width,i.height);return n>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,n),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(s=>this._editor.applyFontInfo(s))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,Xa._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,Xa._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var i,n,s,r;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=kh(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(i=this._findPositionPreference(a,l))!==null&&i!==void 0?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(n=t.colorPicker)===null||n===void 0||n.layout();const c=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&Sbe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(r=(s=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||s===void 0?void 0:s.getAriaLabel())!==null&&r!==void 0?r:"");c&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+c)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new Rt(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;const i=this._hover.containerDomNode,n=this._hover.contentsDomNode,s=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(zs(i),Math.min(s,e)),this._setContentsDomNodeDimensions(zs(n),Math.min(s,e-ck))}setMinimumDimensions(e){this._minimumSize=new Rt(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Rt(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=kh(t),n=zs(t);if(this._resizableNode.layout(i,n),this._setHoverWidgetDimensions(n,i),i=kh(t),n=zs(t),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(i,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(i)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const s=kh(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(s,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-f3})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+f3})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};Xc.ID="editor.contrib.resizableContentHoverWidget";Xc._lastDimensions=new Rt(0,0);Xc=Xa=BR([Oh(1,Xe),Oh(2,Dt),Oh(3,Zl),Oh(4,Xt)],Xc);let OS=class extends q{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=g3("div.hover-row.status-bar"),this.actionsElement=le(this.hoverElement,g3("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(OR.render(this.actionsElement,e,i))}append(e){const t=le(this.actionsElement,e);return this._hasContent=!0,t}};OS=BR([Oh(0,Xt)],OS);class FS{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const s=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===n?r.range.startColumn:1,l=r.range.endLineNumber===n?r.range.endColumn:s;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return rn.EMPTY;const i=FS._getLineDecorations(this._editor,t);return rn.merge(this._participants.map(n=>n.computeAsync?n.computeAsync(t,i,e):rn.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=FS._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Ia(t)}}function p3(o,e,t,i,n,s){const r=t+n/2,a=i+s/2,l=Math.max(Math.abs(o-r)-n/2,0),d=Math.max(Math.abs(e-a)-s/2,0);return Math.sqrt(l*l+d*d)}const m3=pe;class vp extends q{constructor(e,t,i){super(),this._renderDisposeables=this._register(new de),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new WV),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Ud({editor:this._editor},t,i)),this._computer=new Nbe(this._editor),this._hoverOperation=this._register(new VV(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{this._withResult(n.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return vp.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const n of t){const s=m3("div.hover-row.markdown-hover"),r=le(s,m3("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(n.value));r.appendChild(a.element),i.appendChild(s)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),n=this._editor.getScrollTop(),s=this._editor.getOption(66),r=this._hover.containerDomNode.clientHeight,a=i-n-(r-s)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}vp.ID="editor.contrib.modesGlyphHoverWidget";class Nbe{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=n=>({value:n}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const n of t){if(!n.options.glyphMarginClassName)continue;const s=n.options.glyphMarginHoverMessage;!s||Up(s)||i.push(...Z2(s).map(e))}return i}}class Tbe{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function Mbe(o,e,t,i,n){try{const s=await Promise.resolve(o.provideHover(t,i,n));if(s&&Rbe(s))return new Tbe(o,s,e)}catch(s){en(s)}}function WR(o,e,t,i){const s=o.ordered(e).map((r,a)=>Mbe(r,a,e,t,i));return rn.fromPromises(s).coalesce()}function Abe(o,e,t,i){return WR(o,e,t,i).map(n=>n.hover).toPromise()}ql("_executeHoverProvider",(o,e,t)=>{const i=o.get(Me);return Abe(i.hoverProvider,e,t,vt.None)});function Rbe(o){const e=typeof o.range<"u",t=typeof o.contents<"u"&&o.contents&&o.contents.length>0;return e&&t}var Pbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},UC=function(o,e){return function(t,i){e(t,i,o)}};const _3=pe;class ba{constructor(e,t,i,n,s){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=s}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let BS=class{constructor(e,t,i,n,s){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=n,this._languageFeaturesService=s,this.hoverOrdinal=3}createLoadingMessage(e){return new ba(this,e.range,[new as().appendText(p("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,s=i.getLineMaxColumn(n),r=[];let a=1e3;const l=i.getLineLength(n),d=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),c=this._editor.getOption(116),u=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:d});let h=!1;c>=0&&l>c&&e.range.startColumn>=c&&(h=!0,r.push(new ba(this,e.range,[{value:p("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof u=="number"&&l>=u&&r.push(new ba(this,e.range,[{value:p("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let g=!1;for(const f of t){const m=f.range.startLineNumber===n?f.range.startColumn:1,v=f.range.endLineNumber===n?f.range.endColumn:s,_=f.options.hoverMessage;if(!_||Up(_))continue;f.options.beforeContentClassName&&(g=!0);const b=new k(e.range.startLineNumber,m,e.range.startLineNumber,v);r.push(new ba(this,b,Z2(_),g,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return rn.EMPTY;const n=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(n))return rn.EMPTY;const s=new z(e.range.startLineNumber,e.range.startColumn);return WR(this._languageFeaturesService.hoverProvider,n,s,i).filter(r=>!Up(r.hover.contents)).map(r=>{const a=r.hover.range?k.lift(r.hover.range):e.range;return new ba(this,a,r.hover.contents,!1,r.ordinal)})}renderHoverParts(e,t){return zV(e,t,this._editor,this._languageService,this._openerService)}};BS=Pbe([UC(1,bi),UC(2,So),UC(3,Dt),UC(4,Me)],BS);function zV(o,e,t,i,n){e.sort((r,a)=>r.ordinal-a.ordinal);const s=new de;for(const r of e)for(const a of r.contents){if(Up(a))continue;const l=_3("div.hover-row.markdown-hover"),d=le(l,_3("div.hover-contents")),c=s.add(new Ud({editor:t},i,n));s.add(c.onDidRenderAsync(()=>{d.className="hover-contents code-hover-contents",o.onContentsChanged()}));const u=s.add(c.render(a));d.appendChild(u.element),o.fragment.appendChild(l)}return s}var $V=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},WS=function(o,e){return function(t,i){e(t,i,o)}};class v3{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let LT=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new W,this.onDidChange=this._onDidChange.event,this._dispoables=new de,this._markers=[],this._nextIdx=-1,ze.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),s=(a,l)=>{let d=Sv(a.resource.toString(),l.resource.toString());return d===0&&(n==="position"?d=k.compareRangesUsingStarts(a,l)||Mi.compare(a.severity,l.severity):d=Mi.compare(a.severity,l.severity)||k.compareRangesUsingStarts(a,l)),d},r=()=>{this._markers=this._markerService.read({resource:ze.isUri(e)?e:void 0,severities:Mi.Error|Mi.Warning|Mi.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(s)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(r(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new v3(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,s=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());s<0&&(s=fv(this._markers,{resource:e.uri},(r,a)=>Sv(r.resource.toString(),a.resource.toString())),s<0&&(s=~s));for(let r=s;rn.resource.toString()===e.toString());if(!(i<0)){for(;i=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},rf=function(o,e){return function(t,i){e(t,i,o)}},kT;class Fbe{constructor(e,t,i,n,s){this._openerService=n,this._labelService=s,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new de,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(Wi(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new K7(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){jt(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:s}=e;let r=((t==null?void 0:t.length)||0)+2;s&&(typeof s=="string"?r+=s.length:r+=s.value.length);const a=Rl(i);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+r,this._longestLineLength);$n(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||s){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const g=document.createElement("span");g.innerText=t,g.classList.add("source"),h.appendChild(g)}if(s)if(typeof s=="string"){const g=document.createElement("span");g.innerText=`(${s})`,g.classList.add("code"),h.appendChild(g)}else{this._codeLink=pe("a.code-link"),this._codeLink.setAttribute("href",`${s.target.toString()}`),this._codeLink.onclick=f=>{this._openerService.open(s.target,{allowCommands:!0}),f.preventDefault(),f.stopPropagation()};const g=le(this._codeLink,pe("span"));g.innerText=s.value,h.appendChild(this._codeLink)}}if($n(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),ls(n)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(const g of n){const f=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${this._labelService.getUriBasenameLabel(g.resource)}(${g.startLineNumber}, ${g.startColumn}): `,m.title=this._labelService.getUriLabel(g.resource),this._relatedDiagnostics.set(m,g);const v=document.createElement("span");v.innerText=g.message,f.appendChild(m),f.appendChild(v),this._lines+=1,h.appendChild(f)}}const d=this._editor.getOption(50),c=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),u=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:c,scrollHeight:u})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case Mi.Error:t=p("Error","Error");break;case Mi.Warning:t=p("Warning","Warning");break;case Mi.Info:t=p("Info","Info");break;case Mi.Hint:t=p("Hint","Hint");break}let i=p("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();return n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1&&(i=`${n.getLineContent(e.startLineNumber)}, ${i}`),i}}let tm=kT=class extends RS{constructor(e,t,i,n,s,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},s),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new de,this._onDidSelectRelatedInformation=new W,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Mi.Warning,this._backgroundColor=Y.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(Hbe);let t=IT,i=Bbe;this._severity===Mi.Warning?(t=j1,i=Wbe):this._severity===Mi.Info&&(t=ET,i=Vbe);const n=e.getColor(t),s=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:s,primaryHeadingColor:e.getColor(EV),secondaryHeadingColor:e.getColor(NV)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(n=>this.editor.focus()));const t=[],i=this._menuService.createMenu(kT.TitleMenu,this._contextKeyService);VA(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=le(e,pe(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new Fbe(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const n=k.lift(e),s=this.editor.getPosition(),r=s&&n.containsPosition(s)?s:n.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?p("problems","{0} of {1} problems",t,i):p("change","{0} of {1} problem",t,i);this.setTitle(br(a.uri),l)}this._icon.className=`codicon ${xT.className(Mi.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};tm.TitleMenu=new N("gotoErrorTitleMenu");tm=kT=Obe([rf(1,Sn),rf(2,So),rf(3,Ba),rf(4,qe),rf(5,Xe),rf(6,Hp)],tm);const b3=Vv(vl,vte),C3=Vv(zo,Bv),w3=Vv(Ks,Wv),IT=M("editorMarkerNavigationError.background",{dark:b3,light:b3,hcDark:Lt,hcLight:Lt},p("editorMarkerNavigationError","Editor marker navigation widget error color.")),Bbe=M("editorMarkerNavigationError.headerBackground",{dark:We(IT,.1),light:We(IT,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),j1=M("editorMarkerNavigationWarning.background",{dark:C3,light:C3,hcDark:Lt,hcLight:Lt},p("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),Wbe=M("editorMarkerNavigationWarning.headerBackground",{dark:We(j1,.1),light:We(j1,.1),hcDark:"#0C141F",hcLight:We(j1,.2)},p("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),ET=M("editorMarkerNavigationInfo.background",{dark:w3,light:w3,hcDark:Lt,hcLight:Lt},p("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),Vbe=M("editorMarkerNavigationInfo.headerBackground",{dark:We(ET,.1),light:We(ET,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),Hbe=M("editorMarkerNavigation.background",{dark:wn,light:wn,hcDark:wn,hcLight:wn},p("editorMarkerNavigationBackground","Editor marker navigation widget background."));var zbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},jC=function(o,e){return function(t,i){e(t,i,o)}},T_;let Du=T_=class{static get(e){return e.getContribution(T_.ID)}constructor(e,t,i,n,s){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=s,this._sessionDispoables=new de,this._editor=e,this._widgetVisible=jV.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(tm,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{var n,s,r;(!(!((n=this._model)===null||n===void 0)&&n.selected)||!k.containsPosition((s=this._model)===null||s===void 0?void 0:s.selected.marker,i.position))&&((r=this._model)===null||r===void 0||r.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:k.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new z(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){var i,n;if(this._editor.hasModel()){const s=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(s.move(e,this._editor.getModel(),this._editor.getPosition()),!s.selected)return;if(s.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const r=await this._editorService.openCodeEditor({resource:s.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:s.selected.marker}},this._editor);r&&((i=T_.get(r))===null||i===void 0||i.close(),(n=T_.get(r))===null||n===void 0||n.nagivate(e,t))}else this._widget.showAtMarker(s.selected.marker,s.selected.index,s.selected.total)}}};Du.ID="editor.contrib.markerController";Du=T_=zbe([jC(1,UV),jC(2,Xe),jC(3,Ot),jC(4,qe)],Du);class VL extends Te{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){var i;t.hasModel()&&((i=Du.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))}}class Qc extends VL{constructor(){super(!0,!1,{id:Qc.ID,label:Qc.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:578,weight:100},menuOpts:{menuId:tm.TitleMenu,title:Qc.LABEL,icon:Zi("marker-navigation-next",ve.arrowDown,p("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Qc.ID="editor.action.marker.next";Qc.LABEL=p("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class Kh extends VL{constructor(){super(!1,!1,{id:Kh.ID,label:Kh.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:1602,weight:100},menuOpts:{menuId:tm.TitleMenu,title:Kh.LABEL,icon:Zi("marker-navigation-previous",ve.arrowUp,p("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}Kh.ID="editor.action.marker.prev";Kh.LABEL=p("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class $be extends VL{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:p("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:66,weight:100},menuOpts:{menuId:N.MenubarGoMenu,title:p({},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class Ube extends VL{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:p("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:1090,weight:100},menuOpts:{menuId:N.MenubarGoMenu,title:p({},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}At(Du.ID,Du,4);_e(Qc);_e(Kh);_e($be);_e(Ube);const jV=new De("markersNavigationVisible",!1),jbe=Rn.bindToContribution(Du.get);we(new jbe({id:"closeMarkersNavigation",precondition:jV,handler:o=>o.close(),kbOpts:{weight:150,kbExpr:T.focus,primary:9,secondary:[1033]}}));var Kbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},uk=function(o,e){return function(t,i){e(t,i,o)}};const Ir=pe;class qbe{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const S3={type:1,filter:{include:Ze.QuickFix},triggerAction:_o.QuickFixHover};let NT=class{constructor(e,t,i,n){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=n,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,s=i.getLineMaxColumn(n),r=[];for(const a of t){const l=a.range.startLineNumber===n?a.range.startColumn:1,d=a.range.endLineNumber===n?a.range.endColumn:s,c=this._markerDecorationsService.getMarker(i.uri,a);if(!c)continue;const u=new k(e.range.startLineNumber,l,e.range.startLineNumber,d);r.push(new qbe(this,u,c))}return r}renderHoverParts(e,t){if(!t.length)return q.None;const i=new de;t.forEach(s=>e.fragment.appendChild(this.renderMarkerHover(s,i)));const n=t.length===1?t[0]:t.sort((s,r)=>Mi.compare(s.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,n,i),i}renderMarkerHover(e,t){const i=Ir("div.hover-row"),n=le(i,Ir("div.marker.hover-contents")),{source:s,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const d=le(n,Ir("span"));if(d.style.whiteSpace="pre-wrap",d.innerText=r,s||a)if(a&&typeof a!="string"){const c=Ir("span");if(s){const f=le(c,Ir("span"));f.innerText=s}const u=le(c,Ir("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(J(u,"click",f=>{this._openerService.open(a.target,{allowCommands:!0}),f.preventDefault(),f.stopPropagation()}));const h=le(u,Ir("span"));h.innerText=a.value;const g=le(n,c);g.style.opacity="0.6",g.style.paddingLeft="6px"}else{const c=le(n,Ir("span"));c.style.opacity="0.6",c.style.paddingLeft="6px",c.innerText=s&&a?`${s}(${a})`:s||`(${a})`}if(ls(l))for(const{message:c,resource:u,startLineNumber:h,startColumn:g}of l){const f=le(n,Ir("div"));f.style.marginTop="8px";const m=le(f,Ir("a"));m.innerText=`${br(u)}(${h}, ${g}): `,m.style.cursor="pointer",t.add(J(m,"click",_=>{_.stopPropagation(),_.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:g}}}).catch(nt)}));const v=le(f,Ir("span"));v.innerText=c,this._editor.applyFontInfo(v)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===Mi.Error||t.marker.severity===Mi.Warning||t.marker.severity===Mi.Info)&&e.statusBar.addAction({label:p("view problem","View Problem"),commandId:Qc.ID,run:()=>{var n;e.hide(),(n=Du.get(this._editor))===null||n===void 0||n.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const n=e.statusBar.append(Ir("div"));this.recentMarkerCodeActionsInfo&&(rS.makeKey(this.recentMarkerCodeActionsInfo.marker)===rS.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=p("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const s=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?q.None:i.add(lu(()=>n.textContent=p("checkingForQuickFixes","Checking for quick fixes..."),200));n.textContent||(n.textContent=" ");const r=this.getCodeActions(t.marker);i.add(je(()=>r.cancel())),r.then(a=>{if(s.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),n.textContent=p("noQuickFixes","No quick fixes available");return}n.style.display="none";let l=!1;i.add(je(()=>{l||a.dispose()})),e.statusBar.addAction({label:p("quick fixes","Quick Fix..."),commandId:ER,run:d=>{l=!0;const c=Cu.get(this._editor),u=gn(d);e.hide(),c==null||c.showCodeActions(S3,a,{x:u.left,y:u.top,width:u.width,height:u.height})}})},nt)}}getCodeActions(e){return _n(t=>ov(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new k(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),S3,Fd.None,t))}};NT=Kbe([uk(1,$M),uk(2,So),uk(3,Me)],NT);const KV="editor.action.inlineSuggest.commit",qV="editor.action.inlineSuggest.showPrevious",GV="editor.action.inlineSuggest.showNext";var VR=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ca=function(o,e){return function(t,i){e(t,i,o)}},K1;let TT=class extends q{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Oi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=rt(this,n=>{var s,r,a;const l=(s=this.model.read(n))===null||s===void 0?void 0:s.ghostText.read(n);if(!this.alwaysShowToolbar.read(n)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const d=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const c=new z(l.lineNumber,Math.min(d,(a=(r=this.sessionPosition)===null||r===void 0?void 0:r.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=c,c}),this._register(Qd((n,s)=>{const r=this.model.read(n);if(!r||!this.alwaysShowToolbar.read(n))return;const a=s.add(this.instantiationService.createInstance(xu,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.selectedInlineCompletion.map(l=>{var d;return(d=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&d!==void 0?d:[]})));e.addContentWidget(a),s.add(je(()=>e.removeContentWidget(a))),s.add(zt(l=>{this.position.read(l)&&r.lastTriggerKind.read(l)!==Rd.Explicit&&r.triggerExplicitly()}))}))}};TT=VR([Ca(2,qe)],TT);const Gbe=Zi("inline-suggestion-hints-next",ve.chevronRight,p("parameterHintsNextIcon","Icon for show next parameter hint.")),Zbe=Zi("inline-suggestion-hints-previous",ve.chevronLeft,p("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let xu=K1=class extends q{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new Rs(e,t,i,!0,()=>this._commandService.executeCommand(e)),s=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return s&&(r=p({},"{0} ({1})",t,s.getLabel())),n.tooltip=r,n}constructor(e,t,i,n,s,r,a,l,d,c,u){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=s,this._extraCommands=r,this._commandService=a,this.keybindingService=d,this._contextKeyService=c,this._menuService=u,this.id=`InlineSuggestionHintsContentWidget${K1.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=vi("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[vi("div@toolBar")]),this.previousAction=this.createCommandAction(qV,p("previous","Previous"),Ue.asClassName(Zbe)),this.availableSuggestionCountAction=new Rs("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(GV,p("next","Next"),Ue.asClassName(Gbe)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(N.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Yt(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Yt(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(MT,this.nodes.toolBar,N.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,g)=>{if(h instanceof Ur)return l.createInstance(Xbe,h,void 0);if(h===this.availableSuggestionCountAction){const f=new Ybe(void 0,h,{label:!0,icon:!1});return f.setClass("availableSuggestionCount"),f}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(h=>{K1._dropDownVisible=h})),this._register(zt(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(zt(h=>{const g=this._suggestionCount.read(h),f=this._currentSuggestionIdx.read(h);g!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${f+1}/${g}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),g!==void 0&&g>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(zt(h=>{const g=this._extraCommands.read(h);if(Bi(this.lastCommands,g))return;this.lastCommands=g;const f=g.map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:v=>this._commandService.executeCommand(m.id)}));for(const[m,v]of this.inlineCompletionsActionsMenus.getActions())for(const _ of v)_ instanceof Ur&&f.push(_);f.length>0&&f.unshift(new Mn),this.toolBar.setAdditionalSecondaryActions(f)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};xu._dropDownVisible=!1;xu.id=0;xu=K1=VR([Ca(6,Ri),Ca(7,qe),Ca(8,Xt),Ca(9,Xe),Ca(10,Ba)],xu);class Ybe extends jp{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}let Xbe=class extends dg{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=vi("div.keybinding").root;new C0(t,Vo,{disableTitle:!0,...whe}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},MT=class extends ES{constructor(e,t,i,n,s,r,a,l){super(e,{resetMenu:t,...i},n,s,r,a,l),this.menuId=t,this.options2=i,this.menuService=n,this.contextKeyService=s,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,i,n,s,r,a;const l=[],d=[];VA(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:d},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(s=(n=this.options2)===null||n===void 0?void 0:n.toolbarOptions)===null||s===void 0?void 0:s.shouldInlineSubmenu,(a=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),d.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,d)}setPrependedPrimaryActions(e){Bi(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Bi(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};MT=VR([Ca(3,Ba),Ca(4,Xe),Ca(5,Sr),Ca(6,Xt),Ca(7,vo)],MT);var Qbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},KC=function(o,e){return function(t,i){e(t,i,o)}},AT;let Ys=AT=class extends q{static get(e){return e.getContribution(AT.ID)}constructor(e,t,i,n,s){super(),this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=n,this._keybindingService=s,this._toUnhook=new de,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Yt(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())}))}_hookEvents(){const e=this._editor.getOption(60);this._isHoverEnabled=e.enabled,this._isHoverSticky=e.sticky,this._hidingDelay=e.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._toUnhook.add(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._toUnhook.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._toUnhook.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._toUnhook.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._toUnhook.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._toUnhook.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._toUnhook.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._toUnhook.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._toUnhook.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;const i=e.target;if(i.type===9&&i.detail===Xc.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===vp.ID||(i.type!==12&&(this._hoverClicked=!1),!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t,i;this._cancelScheduler();const n=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((i=this._contentWidget)===null||i===void 0)&&i.containsNode(n)||this._hideWidgets()}_isMouseOverWidget(e){var t,i,n,s,r;const a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===Xc.ID||this._isHoverSticky&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((i=e.event.browserEvent.view)===null||i===void 0?void 0:i.document.activeElement))&&!(!((s=(n=e.event.browserEvent.view)===null||n===void 0?void 0:n.getSelection())===null||s===void 0)&&s.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===Xc.ID&&(!((r=this._contentWidget)===null||r===void 0)&&r.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===vp.ID)}_onEditorMouseMove(e){var t,i,n,s;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((i=this._contentWidget)===null||i===void 0)&&i.isResizing||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&(!((n=this._contentWidget)===null||n===void 0)&&n.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(!((s=this._contentWidget)===null||s===void 0)&&s.isVisible&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,i,n;if(!e)return;const s=e.target,r=(t=s.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(r&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!r&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(i=this._glyphWidget)===null||i===void 0||i.hide();return}if(s.type===2&&s.position){(n=this._contentWidget)===null||n===void 0||n.hide(),this._glyphWidget||(this._glyphWidget=new vp(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(s.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),n=i.kind===1||i.kind===2&&i.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&!n&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||xu.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(PS,this._editor)),this._contentWidget}showContentHover(e,t,i,n,s=!1){this._hoverActivatedByColorDecoratorClick=s,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,n)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};Ys.ID="editor.contrib.hover";Ys=AT=Qbe([KC(1,qe),KC(2,So),KC(3,bi),KC(4,Xt)],Ys);var ra;(function(o){o.NoAutoFocus="noAutoFocus",o.FocusIfVisible="focusIfVisible",o.AutoFocusImmediately="autoFocusImmediately"})(ra||(ra={}));class Jbe extends Te{constructor(){super({id:"editor.action.showHover",label:p({},"Show or Focus Hover"),metadata:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[ra.NoAutoFocus,ra.FocusIfVisible,ra.AutoFocusImmediately],enumDescriptions:[p("showOrFocusHover.focus.noAutoFocus","The hover will not automatically take focus."),p("showOrFocusHover.focus.focusIfVisible","The hover will take focus only if it is already visible."),p("showOrFocusHover.focus.autoFocusImmediately","The hover will automatically take focus when it appears.")],default:ra.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:fn(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=Ys.get(t);if(!n)return;const s=i==null?void 0:i.focus;let r=ra.FocusIfVisible;s in ra?r=s:typeof s=="boolean"&&s&&(r=ra.AutoFocusImmediately);const a=d=>{const c=t.getPosition(),u=new k(c.lineNumber,c.column,c.lineNumber,c.column);n.showContentHover(u,1,1,d)},l=t.getOption(2)===2;n.isHoverVisible?r!==ra.NoAutoFocus?n.focus():a(l):a(l||r===ra.AutoFocusImmediately)}}class e0e extends Te{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:p({},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const i=Ys.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const s=new k(n.lineNumber,n.column,n.lineNumber,n.column),r=bg.get(t);if(!r)return;r.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(s,1,1,!0)})}}class t0e extends Te{constructor(){super({id:"editor.action.scrollUpHover",label:p({},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:16,weight:100}})}run(e,t){const i=Ys.get(t);i&&i.scrollUp()}}class i0e extends Te{constructor(){super({id:"editor.action.scrollDownHover",label:p({},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:18,weight:100}})}run(e,t){const i=Ys.get(t);i&&i.scrollDown()}}class n0e extends Te{constructor(){super({id:"editor.action.scrollLeftHover",label:p({},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:15,weight:100}})}run(e,t){const i=Ys.get(t);i&&i.scrollLeft()}}class s0e extends Te{constructor(){super({id:"editor.action.scrollRightHover",label:p({},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:17,weight:100}})}run(e,t){const i=Ys.get(t);i&&i.scrollRight()}}class o0e extends Te{constructor(){super({id:"editor.action.pageUpHover",label:p({},"Page Up Hover"),alias:"Page Up Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=Ys.get(t);i&&i.pageUp()}}class r0e extends Te{constructor(){super({id:"editor.action.pageDownHover",label:p({},"Page Down Hover"),alias:"Page Down Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=Ys.get(t);i&&i.pageDown()}}class a0e extends Te{constructor(){super({id:"editor.action.goToTopHover",label:p({},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=Ys.get(t);i&&i.goToTop()}}class l0e extends Te{constructor(){super({id:"editor.action.goToBottomHover",label:p({},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=Ys.get(t);i&&i.goToBottom()}}At(Ys.ID,Ys,2);_e(Jbe);_e(e0e);_e(t0e);_e(i0e);_e(n0e);_e(s0e);_e(o0e);_e(r0e);_e(a0e);_e(l0e);jg.register(BS);jg.register(NT);Zr((o,e)=>{const t=o.getColor(Ate);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});class RT extends q{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(146);if(t!=="click"&&t!=="clickAndHover")return;const i=e.target;if(i.type!==6||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==bV||!i.range)return;const n=this._editor.getContribution(Ys.ID);if(n&&!n.isColorPickerVisible){const s=new k(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);n.showContentHover(s,1,0,!1,!0)}}}RT.ID="editor.contrib.colorContribution";At(RT.ID,RT,2);jg.register(AS);var ZV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},pa=function(o,e){return function(t,i){e(t,i,o)}},PT,OT;let ku=PT=class extends q{constructor(e,t,i,n,s,r,a){super(),this._editor=e,this._modelService=i,this._keybindingService=n,this._instantiationService=s,this._languageFeatureService=r,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=T.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=T.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new VS(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(PT.ID)}};ku.ID="editor.contrib.standaloneColorPickerController";ku=PT=ZV([pa(1,Xe),pa(2,Si),pa(3,Xt),pa(4,qe),pa(5,Me),pa(6,si)],ku);At(ku.ID,ku,1);const y3=8,d0e=22;let VS=OT=class extends q{constructor(e,t,i,n,s,r,a,l){var d;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=s,this._keybindingService=r,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new W),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=n.createInstance(wb,this._editor),this._position=(d=this._editor._getViewModel())===null||d===void 0?void 0:d.getPrimaryCursorState().modelState.position;const c=this._editor.getSelection(),u=c?{startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(Pl(this._body));this._register(h.onDidBlur(g=>{this.hide()})),this._register(h.onDidFocus(g=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(g=>{var f;const m=(f=g.target.element)===null||f===void 0?void 0:f.classList;m&&m.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(g=>{this._render(g.value,g.foundInEditor)})),this._start(u),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return OT.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new c0e(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new AR(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment(),n=this._register(new OS(this._keybindingService));let s;const r={fragment:i,statusBar:n,setColorPicker:m=>s=m,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(r,[e])),s===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),s.layout();const a=s.body,l=a.saturationBox.domNode.clientWidth,d=a.domNode.clientWidth-l-d0e-y3,c=s.body.enterButton;c==null||c.onClicked(()=>{this.updateEditor(),this.hide()});const u=s.header,h=u.pickedColorNode;h.style.width=l+y3+"px";const g=u.originalColorNode;g.style.width=d+"px";const f=s.header.closeButton;f==null||f.onClicked(()=>{this.hide()}),t&&(c&&(c.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};VS.ID="editor.contrib.standaloneColorPickerWidget";VS=OT=ZV([pa(3,qe),pa(4,Si),pa(5,Xt),pa(6,Me),pa(7,si)],VS);class c0e{constructor(e,t){this.value=e,this.foundInEditor=t}}class u0e extends Wa{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:p("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:p({},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:N.CommandPalette}]})}runEditorCommand(e,t){var i;(i=ku.get(t))===null||i===void 0||i.showOrFocus()}}class h0e extends Te{constructor(){super({id:"editor.action.hideColorPicker",label:p({},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:T.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;(i=ku.get(t))===null||i===void 0||i.hide()}}class g0e extends Te{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:p({},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:T.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;(i=ku.get(t))===null||i===void 0||i.insertColor()}}_e(h0e);_e(g0e);mi(u0e);class Oc{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const n=t.length,s=e.length;if(i+n>s)return!1;for(let r=0;r=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,s,r){const a=e.startLineNumber,l=e.startColumn,d=e.endLineNumber,c=e.endColumn,u=s.getLineContent(a),h=s.getLineContent(d);let g=u.lastIndexOf(t,l-1+t.length),f=h.indexOf(i,c-1-i.length);if(g!==-1&&f!==-1)if(a===d)u.substring(g+t.length,f).indexOf(i)>=0&&(g=-1,f=-1);else{const v=u.substring(g+t.length),_=h.substring(0,f);(v.indexOf(i)>=0||_.indexOf(i)>=0)&&(g=-1,f=-1)}let m;g!==-1&&f!==-1?(n&&g+t.length0&&h.charCodeAt(f-1)===32&&(i=" "+i,f-=1),m=Oc._createRemoveBlockCommentOperations(new k(a,g+t.length+1,d,f+1),t,i)):(m=Oc._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const v of m)r.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return k.isEmpty(e)?n.push(Li.delete(new k(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(Li.delete(new k(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(Li.delete(new k(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const s=[];return k.isEmpty(e)?s.push(Li.replace(new k(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(s.push(Li.insert(new z(e.startLineNumber,e.startColumn),t+(n?" ":""))),s.push(Li.insert(new z(e.endLineNumber,e.endColumn),(n?" ":"")+i))),s}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const s=e.getLanguageIdAtPosition(i,n),r=this.languageConfigurationService.getLanguageConfiguration(s).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const n=i[0],s=i[1];return new Ae(n.range.endLineNumber,n.range.endColumn,s.range.startLineNumber,s.range.startColumn)}else{const n=i[0].range,s=this._usedEndToken?-this._usedEndToken.length-1:0;return new Ae(n.endLineNumber,n.endColumn+s,n.endLineNumber,n.endColumn+s)}}}class hd{constructor(e,t,i,n,s,r,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=n,this._insertSpace=s,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const s=e.getLanguageIdAtPosition(t,1),r=n.getLanguageConfiguration(s).comments,a=r?r.lineCommentToken:null;if(!a)return null;const l=[];for(let d=0,c=i-t+1;ds?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class HR extends Te{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(si);if(!t.hasModel())return;const n=t.getModel(),s=[],r=n.getOptions(),a=t.getOption(23),l=t.getSelections().map((c,u)=>({selection:c,index:u,ignoreFirstLine:!1}));l.sort((c,u)=>k.compareRangesUsingStarts(c.selection,u.selection));let d=l[0];for(let c=1;c=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},sh=function(o,e){return function(t,i){e(t,i,o)}},FT;let im=FT=class{static get(e){return e.getContribution(FT.ID)}constructor(e,t,i,n,s,r,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=s,this._menuService=r,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new de,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(d=>this._onContextMenu(d))),this._toDispose.add(this._editor.onMouseWheel(d=>{if(this._contextMenuIsBeingShownCount>0){const c=this._contextViewService.getContextViewElement(),u=d.srcElement;u.shadowRoot&&sg(c)===u.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(d=>{this._editor.getOption(24)&&d.keyCode===58&&(d.preventDefault(),d.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(24)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||e.target.type===6&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===11)return this._showScrollbarContextMenu(e.event);if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let i=!1;for(const n of this._editor.getSelections())if(n.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?N.SimpleEditorContext:N.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],n=this._menuService.createMenu(t,this._contextKeyService),s=n.getActions({arg:e.uri});n.dispose();for(const r of s){const[,a]=r;let l=0;for(const d of a)if(d instanceof xv){const c=this._getMenuActions(e,d.item.submenu);c.length>0&&(i.push(new xp(d.id,d.label,c)),l++)}else i.push(d),l++;l&&i.push(new Mn)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let n=t;if(!n){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const r=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=gn(this._editor.getDomNode()),l=a.left+r.left,d=a.top+r.top+r.height;n={x:l,y:d}}const s=this._editor.getOption(126)&&!Ea;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:s?this._editor.getDomNode():void 0,getAnchor:()=>n,getActions:()=>e,getActionViewItem:r=>{const a=this._keybindingFor(r);if(a)return new jp(r,r,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=r;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new jp(r,r,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:r=>this._keybindingFor(r),onHide:r=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||Kle(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(72);let i=0;const n=d=>({id:`menu-action-${++i}`,label:d.label,tooltip:"",class:void 0,enabled:typeof d.enabled>"u"?!0:d.enabled,checked:d.checked,run:d.run}),s=(d,c)=>new xp(`menu-action-${++i}`,d,c,void 0),r=(d,c,u,h,g)=>{if(!c)return n({label:d,enabled:c,run:()=>{}});const f=v=>()=>{this._configurationService.updateValue(u,v)},m=[];for(const v of g)m.push(n({label:v.label,checked:h===v.value,run:f(v.value)}));return s(d,m)},a=[];a.push(n({label:p("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new Mn),a.push(n({label:p("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(p("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:p("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:p("context.minimap.size.fill","Fill"),value:"fill"},{label:p("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(r(p("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:p("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:p("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(126)&&!Ea;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:d=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};im.ID="editor.contrib.contextmenu";im=FT=v0e([sh(1,Sr),sh(2,Gd),sh(3,Xe),sh(4,Xt),sh(5,Ba),sh(6,Dt),sh(7,ag)],im);class b0e extends Te{constructor(){super({id:"editor.action.showContextMenu",label:p("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:T.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=im.get(t))===null||i===void 0||i.showContextMenu()}}At(im.ID,im,2);_e(b0e);class hk{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let n=0;n{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new hk(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new gk(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new gk(new hk(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new gk(new hk(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}}Cg.ID="editor.contrib.cursorUndoRedoController";class C0e extends Te{constructor(){super({id:"cursorUndo",label:p("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:T.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var n;(n=Cg.get(t))===null||n===void 0||n.cursorUndo()}}class w0e extends Te{constructor(){super({id:"cursorRedo",label:p("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var n;(n=Cg.get(t))===null||n===void 0||n.cursorRedo()}}At(Cg.ID,Cg,0);_e(C0e);_e(w0e);class S0e{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new k(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new Ae(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new Ae(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumberthis._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(35)||this._editor.getOption(22)||(af(e)&&(this._modifierPressed=!0),this._mouseDown&&af(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(af(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===Bd.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const n=(this._editor.getSelections()||[]).filter(s=>t.position&&s.containsPosition(t.position));if(n.length===1)this._dragSelection=n[0];else return}af(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const t=new z(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const n=this._editor.getSelection();if(n){const{selectionStartLineNumber:s,selectionStartColumn:r}=n;i=[new Ae(s,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(n=>n.containsPosition(t)?new Ae(t.lineNumber,t.column,t.lineNumber,t.column):n);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(af(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(Bd.ID,new S0e(this._dragSelection,t,af(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new k(e.lineNumber,e.column,e.lineNumber,e.column),options:Bd._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}Bd.ID="editor.contrib.dragAndDrop";Bd.TRIGGER_KEY_VALUE=It?6:5;Bd._DECORATION_OPTIONS=st.register({description:"dnd-target",className:"dnd-target"});At(Bd.ID,Bd,2);const HL=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let o;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?o=crypto.getRandomValues.bind(crypto):o=function(i){for(let n=0;no,asFile:()=>{},value:typeof o=="string"?o:void 0}}function y0e(o,e,t){const i={id:HL(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class YV{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return wt.some(this,([i,n])=>n.asFile())&&t.push("files"),QV(HS(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return HS(e)}}function HS(o){return o.toLowerCase()}function XV(o,e){return QV(HS(o),e.map(HS))}function QV(o,e){if(o==="*/*")return e.length>0;if(e.includes(o))return!0;const t=o.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(r=>r.startsWith(n+"/")):!1}const zL=Object.freeze({create:o=>iu(o.map(e=>e.toString())).join(`\r `),split:o=>o.split(`\r `),parse:o=>zL.split(o).filter(e=>!e.startsWith("#"))}),L3={EDITORS:"CodeEditors",FILES:"CodeFiles"};class L0e{}const D0e={DragAndDropContribution:"workbench.contributions.dragAndDrop"};xi.add(D0e.DragAndDropContribution,new L0e);class Db{constructor(){}static getInstance(){return Db.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}Db.INSTANCE=new Db;function JV(o){const e=new YV;for(const t of o.items){const i=t.type;if(t.kind==="string"){const n=new Promise(s=>t.getAsString(s));e.append(i,zR(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,x0e(n))}}return e}function x0e(o){const e=o.path?ze.parse(o.path):void 0;return y0e(o.name,e,async()=>new Uint8Array(await o.arrayBuffer()))}const k0e=Object.freeze([L3.EDITORS,L3.FILES,sb.RESOURCES,sb.INTERNAL_URI_LIST]);function eH(o,e=!1){const t=JV(o),i=t.get(sb.INTERNAL_URI_LIST);if(i)t.replace(qi.uriList,i);else if(e||!t.has(qi.uriList)){const n=[];for(const s of o.items){const r=s.getAsFile();if(r){const a=r.path;try{a?n.push(ze.file(a).toString()):n.push(ze.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(qi.uriList,zR(zL.create(n)))}for(const n of k0e)t.delete(n);return t}function I0e(o,e,t){var i,n;return{edits:[...e.map(s=>new Od(o,typeof t.insertText=="string"?{range:s,text:t.insertText,insertAsSnippet:!1}:{range:s,text:t.insertText.snippet,insertAsSnippet:!0})),...(n=(i=t.additionalEdit)===null||i===void 0?void 0:i.edits)!==null&&n!==void 0?n:[]]}}function tH(o){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const i=new Map;for(const a of o)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const d of o)if(d!==a&&t(l,d)){let c=i.get(a);c||(c=[],i.set(a,c)),c.push(d)}if(!i.size)return Array.from(o);const n=new Set,s=[];function r(a){if(!a.length)return[];const l=a[0];if(s.includes(l))return console.warn(`Yield to cycle detected for ${l.providerId}`),a;if(n.has(l))return r(a.slice(1));let d=[];const c=i.get(l);return c&&(s.push(l),d=r(c),s.pop()),n.add(l),[...d,l,...r(a.slice(1))]}return r(Array.from(o))}var E0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},N0e=function(o,e){return function(t,i){e(t,i,o)}};const T0e=st.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:b8,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class $L extends q{constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=pe(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=pe("span.icon");this.domNode.append(t),t.classList.add(...Ue.asClassNameArray(ve.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(66);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(52)||n.hasChanged(66))&&i()})),this._register(J(this.domNode,Se.CLICK,n=>{this.delegate.cancel()}))}getId(){return $L.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}$L.baseId="editor.widget.inlineProgressWidget";let zS=class extends q{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new An),this._currentWidget=new An,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}async showWhile(e,t,i){const n=this._operationIdPool++;this._currentOperation=n,this.clear(),this._showPromise.value=lu(()=>{const s=k.fromPositions(e);this._currentDecorations.set([{range:s,options:T0e}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance($L,this.id,this._editor,s,t,i))},this._showDelay);try{return await i}finally{this._currentOperation===n&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};zS=E0e([N0e(2,qe)],zS);var iH=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},rv=function(o,e){return function(t,i){e(t,i,o)}},BT;let $S=BT=class extends q{constructor(e,t,i,n,s,r,a,l,d,c){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=c,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(d),this.visibleContext.set(!0),this._register(je(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(je(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(u=>{s.containsPosition(u.position)||this.dispose()})),this._register(ye.runAndSubscribe(c.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var e;const t=(e=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||e===void 0?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=pe(".post-edit-widget"),this.button=this._register(new mS(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(J(this.domNode,Se.CLICK,()=>this.showSelector()))}getId(){return BT.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=gn(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>Qf({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};$S.baseId="editor.widget.postEditWidget";$S=BT=iH([rv(7,Sr),rv(8,Xe),rv(9,Xt)],$S);let US=class extends q{constructor(e,t,i,n,s,r){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=s,this._bulkEditService=r,this._currentWidget=this._register(new An),this._register(ye.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n){var s,r;const a=this._editor.getModel();if(!a||!e.length)return;const l=t.allEdits[t.activeEditIndex];if(!l)return;let d=[];(typeof l.insertText=="string"?l.insertText==="":l.insertText.snippet==="")?d=[]:d=e.map(v=>new Od(a.uri,typeof l.insertText=="string"?{range:v,text:l.insertText,insertAsSnippet:!1}:{range:v,text:l.insertText.snippet,insertAsSnippet:!0}));const u={edits:[...d,...(r=(s=l.additionalEdit)===null||s===void 0?void 0:s.edits)!==null&&r!==void 0?r:[]]},h=e[0],g=a.deltaDecorations([],[{range:h,options:{description:"paste-line-suffix",stickiness:0}}]);let f,m;try{f=await this._bulkEditService.apply(u,{editor:this._editor,token:n}),m=a.getDecorationRange(g[0])}finally{a.deltaDecorations(g,[])}i&&f.isApplied&&t.allEdits.length>1&&this.show(m??h,t,async v=>{const _=this._editor.getModel();_&&(await _.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},i,n))})}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance($S,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};US=iH([rv(4,qe),rv(5,f0)],US);var M0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},lf=function(o,e){return function(t,i){e(t,i,o)}},WT;const nH="editor.changePasteType",sH=new De("pasteWidgetVisible",!1,p("pasteWidgetVisible","Whether the paste widget is showing")),fk="application/vnd.code.copyMetadata";let wg=WT=class extends q{static get(e){return e.getContribution(WT.ID)}constructor(e,t,i,n,s,r,a){super(),this._bulkEditService=i,this._clipboardService=n,this._languageFeaturesService=s,this._quickInputService=r,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(J(l,"copy",d=>this.handleCopy(d))),this._register(J(l,"cut",d=>this.handleCopy(d))),this._register(J(l,"paste",d=>this.handlePaste(d),!0)),this._pasteProgressManager=this._register(new zS("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(US,"pasteIntoEditor",e,sH,{id:nH,label:p("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},fm().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(84).enabled&&!this._editor.getOption(90)}handleCopy(e){var t,i;if(!this._editor.hasTextFocus()||(Tu&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const n=this._editor.getModel(),s=this._editor.getSelections();if(!n||!(s!=null&&s.length))return;const r=this._editor.getOption(37);let a=s;const l=s.length===1&&s[0].isEmpty();if(l){if(!r)return;a=[new k(a[0].startLineNumber,1,a[0].startLineNumber,1+n.getLineLength(a[0].startLineNumber))]}const d=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(s,r,is),u={multicursorText:Array.isArray(d)?d:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter(_=>!!_.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:u});return}const g=JV(e.clipboardData),f=h.flatMap(_=>{var b;return(b=_.copyMimeTypes)!==null&&b!==void 0?b:[]}),m=HL();this.setCopyMetadata(e.clipboardData,{id:m,providerCopyMimeTypes:f,defaultPastePayload:u});const v=_n(async _=>{const b=Ia(await Promise.all(h.map(async C=>{try{return await C.prepareDocumentPaste(n,a,g,_)}catch(w){console.error(w);return}})));b.reverse();for(const C of b)for(const[w,S]of C)g.replace(w,S);return g});(i=this._currentCopyOperation)===null||i===void 0||i.dataTransferPromise.cancel(),this._currentCopyOperation={handle:m,dataTransferPromise:v}}async handlePaste(e){var t,i;if(!e.clipboardData||!this._editor.hasTextFocus())return;(t=this._currentPasteOperation)===null||t===void 0||t.cancel(),this._currentPasteOperation=void 0;const n=this._editor.getModel(),s=this._editor.getSelections();if(!(s!=null&&s.length)||!n||!this.isPasteAsEnabled())return;const r=this.fetchCopyMetadata(e),a=eH(e.clipboardData);a.delete(fk);const l=[...e.clipboardData.types,...(i=r==null?void 0:r.providerCopyMimeTypes)!==null&&i!==void 0?i:[],qi.uriList],d=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter(c=>{var u;return(u=c.pasteMimeTypes)===null||u===void 0?void 0:u.some(h=>XV(h,l))});d.length&&(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,d,s,a,r):this.doPasteInline(d,s,a,r))}doPasteInline(e,t,i,n){const s=_n(async r=>{const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),d=new bu(a,3,void 0,r);try{if(await this.mergeInDataFromCopy(i,n,d.token),d.token.isCancellationRequested)return;const c=e.filter(h=>D3(h,i));if(!c.length||c.length===1&&c[0].id==="text"){await this.applyDefaultPasteHandler(i,n,d.token);return}const u=await this.getPasteEdits(c,i,l,t,d.token);if(d.token.isCancellationRequested)return;if(u.length===1&&u[0].providerId==="text"){await this.applyDefaultPasteHandler(i,n,d.token);return}if(u.length){const h=a.getOption(84).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:u},h,d.token)}await this.applyDefaultPasteHandler(i,n,d.token)}finally{d.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),p("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),s),this._currentPasteOperation=s}showPasteAsPick(e,t,i,n,s){const r=_n(async a=>{const l=this._editor;if(!l.hasModel())return;const d=l.getModel(),c=new bu(l,3,void 0,a);try{if(await this.mergeInDataFromCopy(n,s,c.token),c.token.isCancellationRequested)return;let u=t.filter(m=>D3(m,n));e&&(u=u.filter(m=>m.id===e));const h=await this.getPasteEdits(u,n,d,i,c.token);if(c.token.isCancellationRequested||!h.length)return;let g;if(e)g=h.at(0);else{const m=await this._quickInputService.pick(h.map(v=>({label:v.label,description:v.providerId,detail:v.detail,edit:v})),{placeHolder:p("pasteAsPickerPlaceholder","Select Paste Action")});g=m==null?void 0:m.edit}if(!g)return;const f=I0e(d.uri,i,g);await this._bulkEditService.apply(f,{editor:this._editor})}finally{c.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:p("pasteAsProgress","Running paste handlers")},()=>r)}setCopyMetadata(e,t){e.setData(fk,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const i=e.clipboardData.getData(fk);if(i)try{return JSON.parse(i)}catch{return}const[n,s]=lE.getTextData(e.clipboardData);if(s)return{defaultPastePayload:{mode:s.mode,multicursorText:(t=s.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!s.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,i){var n;if(t!=null&&t.id&&((n=this._currentCopyOperation)===null||n===void 0?void 0:n.handle)===t.id){const s=await this._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[r,a]of s)e.replace(r,a)}if(!e.has(qi.uriList)){const s=await this._clipboardService.readResources();if(i.isCancellationRequested)return;s.length&&e.append(qi.uriList,zR(zL.create(s)))}}async getPasteEdits(e,t,i,n,s){const r=await Cy(Promise.all(e.map(async l=>{var d;try{const c=await((d=l.provideDocumentPasteEdits)===null||d===void 0?void 0:d.call(l,i,n,t,s));if(c)return{...c,providerId:l.id}}catch(c){console.error(c)}})),s),a=Ia(r??[]);return tH(a)}async applyDefaultPasteHandler(e,t,i){var n,s,r;const a=(n=e.get(qi.text))!==null&&n!==void 0?n:e.get("text");if(!a)return;const l=await a.asString();if(i.isCancellationRequested)return;const d={text:l,pasteOnNewLine:(s=t==null?void 0:t.defaultPastePayload.pasteOnNewLine)!==null&&s!==void 0?s:!1,multicursorText:(r=t==null?void 0:t.defaultPastePayload.multicursorText)!==null&&r!==void 0?r:null,mode:null};this._editor.trigger("keyboard","paste",d)}};wg.ID="editor.contrib.copyPasteActionController";wg=WT=M0e([lf(1,qe),lf(2,f0),lf(3,Xd),lf(4,Me),lf(5,Ha),lf(6,JB)],wg);function D3(o,e){var t;return!!(!((t=o.pasteMimeTypes)===null||t===void 0)&&t.some(i=>e.matches(i)))}var $R=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},xb=function(o,e){return function(t,i){e(t,i,o)}};const UR=p("builtIn","Built-in");class jR{async provideDocumentPasteEdits(e,t,i,n){const s=await this.getEdit(i,n);return s?{insertText:s.insertText,label:s.label,detail:s.detail,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}:void 0}async provideDocumentOnDropEdits(e,t,i,n){const s=await this.getEdit(i,n);return s?{insertText:s.insertText,label:s.label,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}:void 0}}class oH extends jR{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[qi.text],this.pasteMimeTypes=[qi.text]}async getEdit(e,t){const i=e.get(qi.text);if(!i||e.has(qi.uriList))return;const n=await i.asString();return{handledMimeType:qi.text,label:p("text.label","Insert Plain Text"),detail:UR,insertText:n}}}class rH extends jR{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[qi.uriList],this.pasteMimeTypes=[qi.uriList]}async getEdit(e,t){const i=await aH(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:a,originalText:l})=>a.scheme===ot.file?a.fsPath:(n++,l)).join(" ");let r;return n>0?r=i.length>1?p("defaultDropProvider.uriList.uris","Insert Uris"):p("defaultDropProvider.uriList.uri","Insert Uri"):r=i.length>1?p("defaultDropProvider.uriList.paths","Insert Paths"):p("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:qi.uriList,insertText:s,label:r,detail:UR}}}let jS=class extends jR{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[qi.uriList],this.pasteMimeTypes=[qi.uriList]}async getEdit(e,t){const i=await aH(e);if(!i.length||t.isCancellationRequested)return;const n=Ia(i.map(({uri:s})=>{const r=this._workspaceContextService.getWorkspaceFolder(s);return r?Voe(r.uri,s):void 0}));if(n.length)return{handledMimeType:qi.uriList,insertText:n.join(" "),label:i.length>1?p("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):p("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:UR}}};jS=$R([xb(0,ag)],jS);async function aH(o){const e=o.get(qi.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of zL.parse(t))try{i.push({uri:ze.parse(n),originalText:n})}catch{}return i}let VT=class extends q{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new oH)),this._register(e.documentOnDropEditProvider.register("*",new rH)),this._register(e.documentOnDropEditProvider.register("*",new jS(t)))}};VT=$R([xb(0,Me),xb(1,ag)],VT);let HT=class extends q{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new oH)),this._register(e.documentPasteEditProvider.register("*",new rH)),this._register(e.documentPasteEditProvider.register("*",new jS(t)))}};HT=$R([xb(0,Me),xb(1,ag)],HT);At(wg.ID,wg,0);_L(HT);we(new class extends Rn{constructor(){super({id:nH,precondition:sH,kbOpts:{weight:100,primary:2137}})}runEditorCommand(o,e,t){var i;return(i=wg.get(e))===null||i===void 0?void 0:i.changePasteType()}});_e(class extends Te{constructor(){super({id:"editor.action.pasteAs",label:p("pasteAs","Paste As..."),alias:"Paste As...",precondition:void 0,metadata:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:p("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(o,e,t){var i;const n=typeof(t==null?void 0:t.id)=="string"?t.id:void 0;return(i=wg.get(e))===null||i===void 0?void 0:i.pasteAs(n)}});class A0e{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}}class x3{constructor(e){this.identifier=e}}const lH=bt("treeViewsDndService");xt(lH,A0e,1);var R0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},qC=function(o,e){return function(t,i){e(t,i,o)}},zT;const dH="editor.experimental.dropIntoEditor.defaultProvider",cH="editor.changeDropType",uH=new De("dropWidgetVisible",!1,p("dropWidgetVisible","Whether the drop widget is showing"));let nm=zT=class extends q{static get(e){return e.getContribution(zT.ID)}constructor(e,t,i,n,s){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=s,this.treeItemsTransfer=Db.getInstance(),this._dropProgressManager=this._register(t.createInstance(zS,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(US,"dropIntoEditor",e,uH,{id:cH,label:p("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(r=>this.onDropIntoEditor(e,r.position,r.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){var n;if(!i.dataTransfer||!e.hasModel())return;(n=this._currentOperation)===null||n===void 0||n.cancel(),e.focus(),e.setPosition(t);const s=_n(async r=>{const a=new bu(e,1,void 0,r);try{const l=await this.extractDataTransferData(i);if(l.size===0||a.token.isCancellationRequested)return;const d=e.getModel();if(!d)return;const c=this._languageFeaturesService.documentOnDropEditProvider.ordered(d).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(g=>l.matches(g)):!0),u=await this.getDropEdits(c,d,t,l,a);if(a.token.isCancellationRequested)return;if(u.length){const h=this.getInitialActiveEditIndex(d,u),g=e.getOption(36).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([k.fromPositions(t)],{activeEditIndex:h,allEdits:u},g,r)}}finally{a.dispose(),this._currentOperation===s&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,p("dropIntoEditorProgress","Running drop handlers. Click to cancel"),s),this._currentOperation=s}async getDropEdits(e,t,i,n,s){const r=await Cy(Promise.all(e.map(async l=>{try{const d=await l.provideDocumentOnDropEdits(t,i,n,s.token);if(d)return{...d,providerId:l.id}}catch(d){console.error(d)}})),s.token),a=Ia(r??[]);return tH(a)}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(dH,{resource:e.uri});for(const[n,s]of Object.entries(i)){const r=t.findIndex(a=>s===a.providerId&&a.handledMimeType&&XV(n,[a.handledMimeType]));if(r>=0)return r}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new YV;const t=eH(e.dataTransfer);if(this.treeItemsTransfer.hasData(x3.prototype)){const i=this.treeItemsTransfer.getData(x3.prototype);if(Array.isArray(i))for(const n of i){const s=await this._treeViewsDragAndDropService.removeDragOperationTransfer(n.identifier);if(s)for(const[r,a]of s)t.replace(r,a)}}return t}};nm.ID="editor.contrib.dropIntoEditorController";nm=zT=R0e([qC(1,qe),qC(2,Dt),qC(3,Me),qC(4,lH)],nm);At(nm.ID,nm,2);we(new class extends Rn{constructor(){super({id:cH,precondition:uH,kbOpts:{weight:100,primary:2137}})}runEditorCommand(o,e,t){var i;(i=nm.get(e))===null||i===void 0||i.changeDropType()}});_L(VT);xi.as(Va.Configuration).registerConfiguration({...Xy,properties:{[dH]:{type:"object",scope:5,description:p("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});class _s{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(n.changeDecorationOptions(this._highlightedDecorationId,_s._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,n.changeDecorationOptions(this._highlightedDecorationId,_s._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(n.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let s=this._editor.getModel().getDecorationRange(t);if(s.startLineNumber!==s.endLineNumber&&s.endColumn===1){const r=s.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);s=new k(s.startLineNumber,s.startColumn,r,a)}this._rangeHighlightDecorationId=n.addDecoration(s,_s._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let n=_s._FIND_MATCH_DECORATION;const s=[];if(e.length>1e3){n=_s._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),d=this._editor.getLayoutInfo().height/a,c=Math.max(2,Math.ceil(3/d));let u=e[0].range.startLineNumber,h=e[0].range.endLineNumber;for(let g=1,f=e.length;g=m.startLineNumber?m.endLineNumber>h&&(h=m.endLineNumber):(s.push({range:new k(u,1,h,1),options:_s._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),u=m.startLineNumber,h=m.endLineNumber)}s.push({range:new k(u,1,h,1),options:_s._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(e.length);for(let a=0,l=e.length;ai.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,_s._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],n=this._editor.getModel().getDecorationRange(i);if(!(!n||n.endLineNumber>e.lineNumber)){if(n.endLineNumbere.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return s;if(!(s.startColumn0){const i=[];for(let r=0;rk.compareRangesUsingStarts(r.range,a.range));const n=[];let s=i[0];for(let r=1;r0?e[0].toUpperCase()+e.substr(1):o[0][0].toUpperCase()!==o[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function k3(o,e,t){return o[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&o[0].split(t).length===e.split(t).length}function I3(o,e,t){const i=e.split(t),n=o[0].split(t);let s="";return i.forEach((r,a)=>{s+=hH([n[a]],r)+t}),s.slice(0,-1)}class E3{constructor(e){this.staticValue=e,this.kind=0}}class O0e{constructor(e){this.pieces=e,this.kind=1}}class sm{static fromStaticValue(e){return new sm([qh.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new E3(""):e.length===1&&e[0].staticValue!==null?this._state=new E3(e[0].staticValue):this._state=new O0e(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?hH(e,this._state.staticValue):this._state.staticValue;let i="";for(let n=0,s=this._state.pieces.length;n0){const l=[],d=r.caseOps.length;let c=0;for(let u=0,h=a.length;u=d){l.push(a.slice(u));break}switch(r.caseOps[c]){case"U":l.push(a[u].toUpperCase());break;case"u":l.push(a[u].toUpperCase()),c++;break;case"L":l.push(a[u].toLowerCase());break;case"l":l.push(a[u].toLowerCase()),c++;break;default:l.push(a[u])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e=n)break;const r=o.charCodeAt(i);switch(r){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(` diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-B35pCJSJ.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-C3sb7NYv.js similarity index 96% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-B35pCJSJ.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-C3sb7NYv.js index e32ba1d35f..9e85bf22de 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-B35pCJSJ.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-C3sb7NYv.js @@ -1 +1 @@ -import{d as I,a as u,b as m,q as $,s as j,f as C,x as q,e as s,t as c,r as T,u as M,c as _,o as L,g as f,w as O,j as V,F,l as K,p as R,y as H}from"./index-DA9oYm7y.js";import{_ as z}from"./Java-AI-BYpq8IxI.js";import{I as P}from"./iconify-CyasjfC7.js";import{_ as N}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{L as U}from"./index-D2fTT4wr.js";import{u as A,s as r}from"./sidebar-BtIzguw3.js";import"./llm-check-BVkAKrj3.js";const G={key:1,class:"blur-card-content"},Q=I({__name:"index",props:{content:{},wrapperStyle:{}},emits:["clickCard"],setup(x,{emit:p}){const n=x,l=p,i=()=>{console.log("[BlurCard] handleClick called with content:",n.content),l("clickCard",n.content),console.log("[BlurCard] clickCard event emitted")};return(e,S)=>{var d,h,g,v,b;return m(),u("button",{class:"blur-card",onClick:i,style:$(e.wrapperStyle)},[(d=e.content)!=null&&d.icon?(m(),j(q(P),{key:0,icon:e.content.icon,class:"blur-card-icon"},null,8,["icon"])):C("",!0),(h=e.content)!=null&&h.title||(g=e.content)!=null&&g.description?(m(),u("div",G,[s("h3",null,c((v=e.content)==null?void 0:v.title),1),s("p",null,c((b=e.content)==null?void 0:b.description),1)])):C("",!0)],4)}}}),W=N(Q,[["__scopeId","data-v-48da0039"]]),X={class:"home-page"},Y={class:"welcome-container"},Z={class:"header"},ee={class:"header-top"},oe={class:"logo-container"},te={class:"tagline"},se={class:"main-content"},ae={class:"conversation-container"},ne={class:"welcome-section"},le={class:"welcome-title"},re={class:"welcome-subtitle"},ie={class:"input-section"},ce={class:"input-container"},pe=["placeholder"],me=["disabled"],de={class:"examples-section"},ue={class:"examples-grid"},he={class:"card-type"},ge=I({__name:"index",setup(x){const p=R(),n=A(),l=T(""),i=T(),{t:e}=M(),S=()=>{const t=Date.now().toString();p.push({name:"direct",params:{id:t}}).then(()=>{console.log("[Home] jump to direct page"+e("common.success"))}).catch(o=>{console.error("[Home] jump to direct page"+e("common.error"),o)})},d=_(()=>[{title:e("home.examples.stockPrice.title"),type:"message",description:e("home.examples.stockPrice.description"),icon:"carbon:chart-line-data",prompt:e("home.examples.stockPrice.prompt")},{title:e("home.examples.weather.title"),type:"message",description:e("home.examples.weather.description"),icon:"carbon:partly-cloudy",prompt:e("home.examples.weather.prompt")}]),h=_(()=>[{title:e("home.examples.queryplan.title"),type:"plan-act",description:e("home.examples.queryplan.description"),icon:"carbon:plan",prompt:e("home.examples.queryplan.prompt"),planJson:{planType:"simple",title:e("home.examples.queryplan.planTitle"),steps:[{stepRequirement:e("home.examples.queryplan.step1"),terminateColumns:e("home.examples.queryplan.step1Output")},{stepRequirement:e("home.examples.queryplan.step2"),terminateColumns:e("home.examples.queryplan.step2Output")}],planId:"planTemplate-1749200517403"}},{title:e("home.examples.ainovel.title"),type:"plan-act",description:e("home.examples.ainovel.description"),icon:"carbon:document-tasks",prompt:e("home.examples.ainovel.prompt"),planJson:{planType:"simple",title:e("home.examples.ainovel.planTitle"),steps:[{stepRequirement:e("home.examples.ainovel.step1"),terminateColumns:e("home.examples.ainovel.step1Output")},{stepRequirement:e("home.examples.ainovel.step2"),terminateColumns:e("home.examples.ainovel.step2Output")}],planId:"planTemplate-1753622676988"}}]),g=_(()=>[...d.value,...h.value]),v=t=>{t.type==="message"?E(t):t.type==="plan-act"&&J(t)};L(()=>{console.log("[Home] onMounted called"),console.log("[Home] taskStore:",n),console.log("[Home] examples:",d),n.markHomeVisited(),console.log("[Home] Home visited marked")});const b=async t=>{try{r.createNewTemplate(),r.jsonContent=JSON.stringify(t);const o=await r.saveTemplate();o!=null&&o.duplicate?console.log("[Sidebar] "+e("sidebar.saveCompleted",{message:o.message,versionCount:o.versionCount})):o!=null&&o.saved?console.log("[Sidebar] "+e("sidebar.saveSuccess",{message:o.message,versionCount:o.versionCount})):o!=null&&o.message&&console.log("[Sidebar] "+e("sidebar.saveStatus",{message:o.message}))}catch(o){console.error("[Sidebar] Failed to save the plan to the template library:",o),alert(o.message||e("sidebar.saveFailed"))}},B=()=>{H(()=>{i.value&&(i.value.style.height="auto",i.value.style.height=Math.min(i.value.scrollHeight,200)+"px")})},D=t=>{console.log("[Home] handleKeydown called, key:",t.key),t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),console.log("[Home] Enter key pressed, calling handleSend"),w())},w=()=>{if(console.log("[Home] handleSend called, userInput:",l.value),!l.value.trim()){console.log("[Home] handleSend aborted - empty input");return}const t=l.value.trim();console.log("[Home] Setting task to store:",t),n.setTask(t),console.log("[Home] Task set to store, current task:",n.currentTask);const o=Date.now().toString();console.log("[Home] Navigating to direct page with chatId:",o),p.push({name:"direct",params:{id:o}}).then(()=>{console.log("[Home] Navigation to direct page completed")}).catch(a=>{console.error("[Home] Navigation error:",a)})},E=t=>{console.log("[Home] selectExample called with example:",t),console.log("[Home] Example prompt:",t.prompt),n.setTask(t.prompt),console.log("[Home] Task set to store from example, current task:",n.currentTask);const o=Date.now().toString();console.log("[Home] Navigating to direct page with chatId:",o),p.push({name:"direct",params:{id:o}}).then(()=>{console.log("[Home] Navigation to direct page completed (from example)")}).catch(a=>{console.error("[Home] Navigation error (from example):",a)})},J=async t=>{console.log("[Home] selectPlan called with plan:",t);try{await b(t.planJson),console.log("[Home] Plan saved to templates");const o=Date.now().toString();await p.push({name:"direct",params:{id:o}}),H(async()=>{await new Promise(k=>setTimeout(k,300)),r.isCollapsed?(await r.toggleSidebar(),console.log("[Sidebar] Sidebar toggled")):console.log("[Sidebar] Sidebar is already open"),await r.loadPlanTemplateList(),console.log("[Sidebar] Template list loaded");const a=r.planTemplateList.find(k=>k.id===t.planJson.planId);if(!a){console.error("[Sidebar] Template not found");return}await r.selectTemplate(a),console.log("[Sidebar] Template selected:",a.title);const y=document.querySelector(".execute-btn");y.disabled?console.error("[Sidebar] Execute button not found or disabled"):(console.log("[Sidebar] Triggering execute button click"),y.click())})}catch(o){console.error("[Home] Error in selectPlan:",o)}};return(t,o)=>(m(),u("div",X,[s("div",Y,[o[2]||(o[2]=s("div",{class:"background-effects"},[s("div",{class:"gradient-orb orb-1"}),s("div",{class:"gradient-orb orb-2"}),s("div",{class:"gradient-orb orb-3"})],-1)),s("header",Z,[s("div",ee,[f(U)]),s("div",oe,[o[1]||(o[1]=s("div",{class:"logo"},[s("img",{src:z,alt:"JManus",class:"java-logo"}),s("h1",null,"JManus")],-1)),s("span",te,c(t.$t("home.tagline")),1)])]),s("main",se,[s("div",ae,[s("div",ne,[s("h2",le,c(t.$t("home.welcomeTitle")),1),s("p",re,c(t.$t("home.welcomeSubtitle")),1),s("button",{class:"direct-button",onClick:S},c(t.$t("home.directButton")),1)]),s("div",ie,[s("div",ce,[O(s("textarea",{"onUpdate:modelValue":o[0]||(o[0]=a=>l.value=a),ref_key:"textareaRef",ref:i,class:"main-input",placeholder:t.$t("home.inputPlaceholder"),onKeydown:D,onInput:B},null,40,pe),[[V,l.value]]),s("button",{class:"send-button",disabled:!l.value.trim(),onClick:w},[f(q(P),{icon:"carbon:send-alt"})],8,me)])]),s("div",de,[s("div",ue,[(m(!0),u(F,null,K(g.value,a=>(m(),u("div",{key:a.title,class:"card-with-type"},[f(W,{content:a,onClickCard:y=>v(a)},null,8,["content","onClickCard"]),s("span",he,c(a.type),1)]))),128))])])])])])]))}}),Se=N(ge,[["__scopeId","data-v-5aee9964"]]);export{Se as default}; +import{d as I,a as u,b as m,q as $,s as j,f as C,x as q,e as s,t as c,r as T,u as M,c as _,o as L,g as f,w as O,j as V,F,l as K,p as R,y as H}from"./index-CNsQoPg8.js";import{_ as z}from"./Java-AI-BYpq8IxI.js";import{I as P}from"./iconify-B3l7reUz.js";import{_ as N}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{L as U}from"./index-rqS3tjXd.js";import{u as A,s as r}from"./sidebar-ON4PvQzg.js";import"./llm-check-BVkAKrj3.js";const G={key:1,class:"blur-card-content"},Q=I({__name:"index",props:{content:{},wrapperStyle:{}},emits:["clickCard"],setup(x,{emit:p}){const n=x,l=p,i=()=>{console.log("[BlurCard] handleClick called with content:",n.content),l("clickCard",n.content),console.log("[BlurCard] clickCard event emitted")};return(e,S)=>{var d,h,g,v,b;return m(),u("button",{class:"blur-card",onClick:i,style:$(e.wrapperStyle)},[(d=e.content)!=null&&d.icon?(m(),j(q(P),{key:0,icon:e.content.icon,class:"blur-card-icon"},null,8,["icon"])):C("",!0),(h=e.content)!=null&&h.title||(g=e.content)!=null&&g.description?(m(),u("div",G,[s("h3",null,c((v=e.content)==null?void 0:v.title),1),s("p",null,c((b=e.content)==null?void 0:b.description),1)])):C("",!0)],4)}}}),W=N(Q,[["__scopeId","data-v-48da0039"]]),X={class:"home-page"},Y={class:"welcome-container"},Z={class:"header"},ee={class:"header-top"},oe={class:"logo-container"},te={class:"tagline"},se={class:"main-content"},ae={class:"conversation-container"},ne={class:"welcome-section"},le={class:"welcome-title"},re={class:"welcome-subtitle"},ie={class:"input-section"},ce={class:"input-container"},pe=["placeholder"],me=["disabled"],de={class:"examples-section"},ue={class:"examples-grid"},he={class:"card-type"},ge=I({__name:"index",setup(x){const p=R(),n=A(),l=T(""),i=T(),{t:e}=M(),S=()=>{const t=Date.now().toString();p.push({name:"direct",params:{id:t}}).then(()=>{console.log("[Home] jump to direct page"+e("common.success"))}).catch(o=>{console.error("[Home] jump to direct page"+e("common.error"),o)})},d=_(()=>[{title:e("home.examples.stockPrice.title"),type:"message",description:e("home.examples.stockPrice.description"),icon:"carbon:chart-line-data",prompt:e("home.examples.stockPrice.prompt")},{title:e("home.examples.weather.title"),type:"message",description:e("home.examples.weather.description"),icon:"carbon:partly-cloudy",prompt:e("home.examples.weather.prompt")}]),h=_(()=>[{title:e("home.examples.queryplan.title"),type:"plan-act",description:e("home.examples.queryplan.description"),icon:"carbon:plan",prompt:e("home.examples.queryplan.prompt"),planJson:{planType:"simple",title:e("home.examples.queryplan.planTitle"),steps:[{stepRequirement:e("home.examples.queryplan.step1"),terminateColumns:e("home.examples.queryplan.step1Output")},{stepRequirement:e("home.examples.queryplan.step2"),terminateColumns:e("home.examples.queryplan.step2Output")}],planId:"planTemplate-1749200517403"}},{title:e("home.examples.ainovel.title"),type:"plan-act",description:e("home.examples.ainovel.description"),icon:"carbon:document-tasks",prompt:e("home.examples.ainovel.prompt"),planJson:{planType:"simple",title:e("home.examples.ainovel.planTitle"),steps:[{stepRequirement:e("home.examples.ainovel.step1"),terminateColumns:e("home.examples.ainovel.step1Output")},{stepRequirement:e("home.examples.ainovel.step2"),terminateColumns:e("home.examples.ainovel.step2Output")}],planId:"planTemplate-1753622676988"}}]),g=_(()=>[...d.value,...h.value]),v=t=>{t.type==="message"?E(t):t.type==="plan-act"&&J(t)};L(()=>{console.log("[Home] onMounted called"),console.log("[Home] taskStore:",n),console.log("[Home] examples:",d),n.markHomeVisited(),console.log("[Home] Home visited marked")});const b=async t=>{try{r.createNewTemplate(),r.jsonContent=JSON.stringify(t);const o=await r.saveTemplate();o!=null&&o.duplicate?console.log("[Sidebar] "+e("sidebar.saveCompleted",{message:o.message,versionCount:o.versionCount})):o!=null&&o.saved?console.log("[Sidebar] "+e("sidebar.saveSuccess",{message:o.message,versionCount:o.versionCount})):o!=null&&o.message&&console.log("[Sidebar] "+e("sidebar.saveStatus",{message:o.message}))}catch(o){console.error("[Sidebar] Failed to save the plan to the template library:",o),alert(o.message||e("sidebar.saveFailed"))}},B=()=>{H(()=>{i.value&&(i.value.style.height="auto",i.value.style.height=Math.min(i.value.scrollHeight,200)+"px")})},D=t=>{console.log("[Home] handleKeydown called, key:",t.key),t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),console.log("[Home] Enter key pressed, calling handleSend"),w())},w=()=>{if(console.log("[Home] handleSend called, userInput:",l.value),!l.value.trim()){console.log("[Home] handleSend aborted - empty input");return}const t=l.value.trim();console.log("[Home] Setting task to store:",t),n.setTask(t),console.log("[Home] Task set to store, current task:",n.currentTask);const o=Date.now().toString();console.log("[Home] Navigating to direct page with chatId:",o),p.push({name:"direct",params:{id:o}}).then(()=>{console.log("[Home] Navigation to direct page completed")}).catch(a=>{console.error("[Home] Navigation error:",a)})},E=t=>{console.log("[Home] selectExample called with example:",t),console.log("[Home] Example prompt:",t.prompt),n.setTask(t.prompt),console.log("[Home] Task set to store from example, current task:",n.currentTask);const o=Date.now().toString();console.log("[Home] Navigating to direct page with chatId:",o),p.push({name:"direct",params:{id:o}}).then(()=>{console.log("[Home] Navigation to direct page completed (from example)")}).catch(a=>{console.error("[Home] Navigation error (from example):",a)})},J=async t=>{console.log("[Home] selectPlan called with plan:",t);try{await b(t.planJson),console.log("[Home] Plan saved to templates");const o=Date.now().toString();await p.push({name:"direct",params:{id:o}}),H(async()=>{await new Promise(k=>setTimeout(k,300)),r.isCollapsed?(await r.toggleSidebar(),console.log("[Sidebar] Sidebar toggled")):console.log("[Sidebar] Sidebar is already open"),await r.loadPlanTemplateList(),console.log("[Sidebar] Template list loaded");const a=r.planTemplateList.find(k=>k.id===t.planJson.planId);if(!a){console.error("[Sidebar] Template not found");return}await r.selectTemplate(a),console.log("[Sidebar] Template selected:",a.title);const y=document.querySelector(".execute-btn");y.disabled?console.error("[Sidebar] Execute button not found or disabled"):(console.log("[Sidebar] Triggering execute button click"),y.click())})}catch(o){console.error("[Home] Error in selectPlan:",o)}};return(t,o)=>(m(),u("div",X,[s("div",Y,[o[2]||(o[2]=s("div",{class:"background-effects"},[s("div",{class:"gradient-orb orb-1"}),s("div",{class:"gradient-orb orb-2"}),s("div",{class:"gradient-orb orb-3"})],-1)),s("header",Z,[s("div",ee,[f(U)]),s("div",oe,[o[1]||(o[1]=s("div",{class:"logo"},[s("img",{src:z,alt:"JManus",class:"java-logo"}),s("h1",null,"JManus")],-1)),s("span",te,c(t.$t("home.tagline")),1)])]),s("main",se,[s("div",ae,[s("div",ne,[s("h2",le,c(t.$t("home.welcomeTitle")),1),s("p",re,c(t.$t("home.welcomeSubtitle")),1),s("button",{class:"direct-button",onClick:S},c(t.$t("home.directButton")),1)]),s("div",ie,[s("div",ce,[O(s("textarea",{"onUpdate:modelValue":o[0]||(o[0]=a=>l.value=a),ref_key:"textareaRef",ref:i,class:"main-input",placeholder:t.$t("home.inputPlaceholder"),onKeydown:D,onInput:B},null,40,pe),[[V,l.value]]),s("button",{class:"send-button",disabled:!l.value.trim(),onClick:w},[f(q(P),{icon:"carbon:send-alt"})],8,me)])]),s("div",de,[s("div",ue,[(m(!0),u(F,null,K(g.value,a=>(m(),u("div",{key:a.title,class:"card-with-type"},[f(W,{content:a,onClickCard:y=>v(a)},null,8,["content","onClickCard"]),s("span",he,c(a.type),1)]))),128))])])])])])]))}}),Se=N(ge,[["__scopeId","data-v-5aee9964"]]);export{Se as default}; diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-DA9oYm7y.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-CNsQoPg8.js similarity index 97% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-DA9oYm7y.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-CNsQoPg8.js index c297bf7d3c..f7a7405bfc 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-DA9oYm7y.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-CNsQoPg8.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DXRRTLTq.js","assets/llm-check-BVkAKrj3.js","assets/_plugin-vue_export-helper-DlAUqK2U.js","assets/index-DfXlok8T.css","assets/index-B35pCJSJ.js","assets/Java-AI-BYpq8IxI.js","assets/iconify-CyasjfC7.js","assets/index-D2fTT4wr.js","assets/index-CxnUfhp1.css","assets/sidebar-BtIzguw3.js","assets/index-Bve_wuYa.css","assets/index-CzTAyhzl.js","assets/useMessage-fgXJFj_8.js","assets/useMessage-B772OobR.css","assets/index-DuuEWc67.css","assets/index-Dqcw8yKQ.js","assets/index-Bve1G_0I.css","assets/notFound-BSR8IgwZ.js","assets/notFound-Ocgq36M9.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CuGql25I.js","assets/llm-check-BVkAKrj3.js","assets/_plugin-vue_export-helper-DlAUqK2U.js","assets/index-DfXlok8T.css","assets/index-C3sb7NYv.js","assets/Java-AI-BYpq8IxI.js","assets/iconify-B3l7reUz.js","assets/index-rqS3tjXd.js","assets/index-CxnUfhp1.css","assets/sidebar-ON4PvQzg.js","assets/index-Bve_wuYa.css","assets/index-QLIAiQL6.js","assets/useMessage-BR4qCw-P.js","assets/useMessage-B772OobR.css","assets/index-DuuEWc67.css","assets/index-BGKqtLX6.js","assets/index-Bve1G_0I.css","assets/notFound-CVrU7YVW.js","assets/notFound-Ocgq36M9.css"])))=>i.map(i=>d[i]); (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&o(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();/** * @vue/shared v3.5.17 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -499,7 +499,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * vue-router v4.5.1 * (c) 2025 Eduardo San Martin Morote * @license MIT - */const Hs=typeof document<"u";function r7(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function abe(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&r7(e.default)}const At=Object.assign;function wb(e,t){const n={};for(const o in t){const r=t[o];n[o]=Gr(r)?r.map(e):e(r)}return n}const fd=()=>{},Gr=Array.isArray,i7=/#/g,lbe=/&/g,sbe=/\//g,cbe=/=/g,ube=/\?/g,a7=/\+/g,dbe=/%5B/g,fbe=/%5D/g,l7=/%5E/g,pbe=/%60/g,s7=/%7B/g,gbe=/%7C/g,c7=/%7D/g,hbe=/%20/g;function N$(e){return encodeURI(""+e).replace(gbe,"|").replace(dbe,"[").replace(fbe,"]")}function vbe(e){return N$(e).replace(s7,"{").replace(c7,"}").replace(l7,"^")}function B1(e){return N$(e).replace(a7,"%2B").replace(hbe,"+").replace(i7,"%23").replace(lbe,"%26").replace(pbe,"`").replace(s7,"{").replace(c7,"}").replace(l7,"^")}function mbe(e){return B1(e).replace(cbe,"%3D")}function bbe(e){return N$(e).replace(i7,"%23").replace(ube,"%3F")}function ybe(e){return e==null?"":bbe(e).replace(sbe,"%2F")}function qd(e){try{return decodeURIComponent(""+e)}catch{}return""+e}const Sbe=/\/$/,Cbe=e=>e.replace(Sbe,"");function Pb(e,t,n="/"){let o,r={},i="",a="";const l=t.indexOf("#");let s=t.indexOf("?");return l=0&&(s=-1),s>-1&&(o=t.slice(0,s),i=t.slice(s+1,l>-1?l:t.length),r=e(i)),l>-1&&(o=o||t.slice(0,l),a=t.slice(l,t.length)),o=Pbe(o??t,n),{fullPath:o+(i&&"?")+i+a,path:o,query:r,hash:qd(a)}}function xbe(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function nE(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function $be(e,t,n){const o=t.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&Ec(t.matched[o],n.matched[r])&&u7(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Ec(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function u7(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!wbe(e[n],t[n]))return!1;return!0}function wbe(e,t){return Gr(e)?oE(e,t):Gr(t)?oE(t,e):e===t}function oE(e,t){return Gr(t)?e.length===t.length&&e.every((n,o)=>n===t[o]):e.length===1&&e[0]===t}function Pbe(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),o=e.split("/"),r=o[o.length-1];(r===".."||r===".")&&o.push("");let i=n.length-1,a,l;for(a=0;a1&&i--;else break;return n.slice(0,i).join("/")+"/"+o.slice(a).join("/")}const ga={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Jd;(function(e){e.pop="pop",e.push="push"})(Jd||(Jd={}));var pd;(function(e){e.back="back",e.forward="forward",e.unknown=""})(pd||(pd={}));function Obe(e){if(!e)if(Hs){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Cbe(e)}const Ibe=/^[^#]+#/;function Tbe(e,t){return e.replace(Ibe,"#")+t}function Ebe(e,t){const n=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-n.left-(t.left||0),top:o.top-n.top-(t.top||0)}}const Tm=()=>({left:window.scrollX,top:window.scrollY});function _be(e){let t;if("el"in e){const n=e.el,o=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=Ebe(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function rE(e,t){return(history.state?history.state.position-t:-1)+e}const H1=new Map;function Mbe(e,t){H1.set(e,t)}function Abe(e){const t=H1.get(e);return H1.delete(e),t}let Rbe=()=>location.protocol+"//"+location.host;function d7(e,t){const{pathname:n,search:o,hash:r}=t,i=e.indexOf("#");if(i>-1){let l=r.includes(e.slice(i))?e.slice(i).length:1,s=r.slice(l);return s[0]!=="/"&&(s="/"+s),nE(s,"")}return nE(n,e)+o+r}function Dbe(e,t,n,o){let r=[],i=[],a=null;const l=({state:f})=>{const p=d7(e,location),v=n.value,h=t.value;let m=0;if(f){if(n.value=p,t.value=f,a&&a===v){a=null;return}m=h?f.position-h.position:0}else o(p);r.forEach(b=>{b(n.value,v,{delta:m,type:Jd.pop,direction:m?m>0?pd.forward:pd.back:pd.unknown})})};function s(){a=n.value}function u(f){r.push(f);const p=()=>{const v=r.indexOf(f);v>-1&&r.splice(v,1)};return i.push(p),p}function c(){const{history:f}=window;f.state&&f.replaceState(At({},f.state,{scroll:Tm()}),"")}function d(){for(const f of i)f();i=[],window.removeEventListener("popstate",l),window.removeEventListener("beforeunload",c)}return window.addEventListener("popstate",l),window.addEventListener("beforeunload",c,{passive:!0}),{pauseListeners:s,listen:u,destroy:d}}function iE(e,t,n,o=!1,r=!1){return{back:e,current:t,forward:n,replaced:o,position:window.history.length,scroll:r?Tm():null}}function Nbe(e){const{history:t,location:n}=window,o={value:d7(e,n)},r={value:t.state};r.value||i(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(s,u,c){const d=e.indexOf("#"),f=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+s:Rbe()+e+s;try{t[c?"replaceState":"pushState"](u,"",f),r.value=u}catch(p){console.error(p),n[c?"replace":"assign"](f)}}function a(s,u){const c=At({},t.state,iE(r.value.back,s,r.value.forward,!0),u,{position:r.value.position});i(s,c,!0),o.value=s}function l(s,u){const c=At({},r.value,t.state,{forward:s,scroll:Tm()});i(c.current,c,!0);const d=At({},iE(o.value,s,null),{position:c.position+1},u);i(s,d,!1),o.value=s}return{location:o,state:r,push:l,replace:a}}function kbe(e){e=Obe(e);const t=Nbe(e),n=Dbe(e,t.state,t.location,t.replace);function o(i,a=!0){a||n.pauseListeners(),history.go(i)}const r=At({location:"",base:e,go:o,createHref:Tbe.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function Lbe(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),kbe(e)}function Fbe(e){return typeof e=="string"||e&&typeof e=="object"}function f7(e){return typeof e=="string"||typeof e=="symbol"}const p7=Symbol("");var aE;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(aE||(aE={}));function _c(e,t){return At(new Error,{type:e,[p7]:!0},t)}function Pi(e,t){return e instanceof Error&&p7 in e&&(t==null||!!(e.type&t))}const lE="[^/]+?",Bbe={sensitive:!1,strict:!1,start:!0,end:!0},Hbe=/[.+*?^${}()[\]/\\]/g;function zbe(e,t){const n=At({},Bbe,t),o=[];let r=n.start?"^":"";const i=[];for(const u of e){const c=u.length?[]:[90];n.strict&&!u.length&&(r+="/");for(let d=0;dt.length?t.length===1&&t[0]===80?1:-1:0}function g7(e,t){let n=0;const o=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const Wbe={type:0,value:""},Vbe=/[a-zA-Z0-9_]/;function Kbe(e){if(!e)return[[]];if(e==="/")return[[Wbe]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(p){throw new Error(`ERR (${n})/"${u}": ${p}`)}let n=0,o=n;const r=[];let i;function a(){i&&r.push(i),i=[]}let l=0,s,u="",c="";function d(){u&&(n===0?i.push({type:0,value:u}):n===1||n===2||n===3?(i.length>1&&(s==="*"||s==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),i.push({type:1,value:u,regexp:c,repeatable:s==="*"||s==="+",optional:s==="*"||s==="?"})):t("Invalid state to consume buffer"),u="")}function f(){u+=s}for(;l{a(C)}:fd}function a(d){if(f7(d)){const f=o.get(d);f&&(o.delete(d),n.splice(n.indexOf(f),1),f.children.forEach(a),f.alias.forEach(a))}else{const f=n.indexOf(d);f>-1&&(n.splice(f,1),d.record.name&&o.delete(d.record.name),d.children.forEach(a),d.alias.forEach(a))}}function l(){return n}function s(d){const f=qbe(d,n);n.splice(f,0,d),d.record.name&&!dE(d)&&o.set(d.record.name,d)}function u(d,f){let p,v={},h,m;if("name"in d&&d.name){if(p=o.get(d.name),!p)throw _c(1,{location:d});m=p.record.name,v=At(cE(f.params,p.keys.filter(C=>!C.optional).concat(p.parent?p.parent.keys.filter(C=>C.optional):[]).map(C=>C.name)),d.params&&cE(d.params,p.keys.map(C=>C.name))),h=p.stringify(v)}else if(d.path!=null)h=d.path,p=n.find(C=>C.re.test(h)),p&&(v=p.parse(h),m=p.record.name);else{if(p=f.name?o.get(f.name):n.find(C=>C.re.test(f.path)),!p)throw _c(1,{location:d,currentLocation:f});m=p.record.name,v=At({},f.params,d.params),h=p.stringify(v)}const b=[];let S=p;for(;S;)b.unshift(S.record),S=S.parent;return{name:m,path:h,params:v,matched:b,meta:Ybe(b)}}e.forEach(d=>i(d));function c(){n.length=0,o.clear()}return{addRoute:i,resolve:u,removeRoute:a,clearRoutes:c,getRoutes:l,getRecordMatcher:r}}function cE(e,t){const n={};for(const o of t)o in e&&(n[o]=e[o]);return n}function uE(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Xbe(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Xbe(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const o in e.components)t[o]=typeof n=="object"?n[o]:n;return t}function dE(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Ybe(e){return e.reduce((t,n)=>At(t,n.meta),{})}function fE(e,t){const n={};for(const o in e)n[o]=o in t?t[o]:e[o];return n}function qbe(e,t){let n=0,o=t.length;for(;n!==o;){const i=n+o>>1;g7(e,t[i])<0?o=i:n=i+1}const r=Jbe(e);return r&&(o=t.lastIndexOf(r,o-1)),o}function Jbe(e){let t=e;for(;t=t.parent;)if(h7(t)&&g7(e,t)===0)return t}function h7({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Zbe(e){const t={};if(e===""||e==="?")return t;const o=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;ri&&B1(i)):[o&&B1(o)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+n,i!=null&&(t+="="+i))})}return t}function Qbe(e){const t={};for(const n in e){const o=e[n];o!==void 0&&(t[n]=Gr(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return t}const eye=Symbol(""),gE=Symbol(""),Em=Symbol(""),k$=Symbol(""),z1=Symbol("");function Pu(){let e=[];function t(o){return e.push(o),()=>{const r=e.indexOf(o);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function $a(e,t,n,o,r,i=a=>a()){const a=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise((l,s)=>{const u=f=>{f===!1?s(_c(4,{from:n,to:t})):f instanceof Error?s(f):Fbe(f)?s(_c(2,{from:t,to:f})):(a&&o.enterCallbacks[r]===a&&typeof f=="function"&&a.push(f),l())},c=i(()=>e.call(o&&o.instances[r],t,n,u));let d=Promise.resolve(c);e.length<3&&(d=d.then(u)),d.catch(f=>s(f))})}function Ob(e,t,n,o,r=i=>i()){const i=[];for(const a of e)for(const l in a.components){let s=a.components[l];if(!(t!=="beforeRouteEnter"&&!a.instances[l]))if(r7(s)){const c=(s.__vccOpts||s)[t];c&&i.push($a(c,n,o,a,l,r))}else{let u=s();i.push(()=>u.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${l}" at "${a.path}"`);const d=abe(c)?c.default:c;a.mods[l]=c,a.components[l]=d;const p=(d.__vccOpts||d)[t];return p&&$a(p,n,o,a,l,r)()}))}}return i}function hE(e){const t=ze(Em),n=ze(k$),o=E(()=>{const s=Bt(e.to);return t.resolve(s)}),r=E(()=>{const{matched:s}=o.value,{length:u}=s,c=s[u-1],d=n.matched;if(!c||!d.length)return-1;const f=d.findIndex(Ec.bind(null,c));if(f>-1)return f;const p=vE(s[u-2]);return u>1&&vE(c)===p&&d[d.length-1].path!==p?d.findIndex(Ec.bind(null,s[u-2])):f}),i=E(()=>r.value>-1&&iye(n.params,o.value.params)),a=E(()=>r.value>-1&&r.value===n.matched.length-1&&u7(n.params,o.value.params));function l(s={}){if(rye(s)){const u=t[Bt(e.replace)?"replace":"push"](Bt(e.to)).catch(fd);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:o,href:E(()=>o.value.href),isActive:i,isExactActive:a,navigate:l}}function tye(e){return e.length===1?e[0]:e}const nye=le({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:hE,setup(e,{slots:t}){const n=rt(hE(e)),{options:o}=ze(Em),r=E(()=>({[mE(e.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[mE(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&tye(t.default(n));return e.custom?i:Vr("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),oye=nye;function rye(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function iye(e,t){for(const n in t){const o=t[n],r=e[n];if(typeof o=="string"){if(o!==r)return!1}else if(!Gr(r)||r.length!==o.length||o.some((i,a)=>i!==r[a]))return!1}return!0}function vE(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const mE=(e,t,n)=>e??t??n,aye=le({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const o=ze(z1),r=E(()=>e.route||o.value),i=ze(gE,0),a=E(()=>{let u=Bt(i);const{matched:c}=r.value;let d;for(;(d=c[u])&&!d.components;)u++;return u}),l=E(()=>r.value.matched[a.value]);Xe(gE,E(()=>a.value+1)),Xe(eye,l),Xe(z1,r);const s=ae();return be(()=>[s.value,l.value,e.name],([u,c,d],[f,p,v])=>{c&&(c.instances[d]=u,p&&p!==c&&u&&u===f&&(c.leaveGuards.size||(c.leaveGuards=p.leaveGuards),c.updateGuards.size||(c.updateGuards=p.updateGuards))),u&&c&&(!p||!Ec(c,p)||!f)&&(c.enterCallbacks[d]||[]).forEach(h=>h(u))},{flush:"post"}),()=>{const u=r.value,c=e.name,d=l.value,f=d&&d.components[c];if(!f)return bE(n.default,{Component:f,route:u});const p=d.props[c],v=p?p===!0?u.params:typeof p=="function"?p(u):p:null,m=Vr(f,At({},v,t,{onVnodeUnmounted:b=>{b.component.isUnmounted&&(d.instances[c]=null)},ref:s}));return bE(n.default,{Component:m,route:u})||m}}});function bE(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const v7=aye;function lye(e){const t=Gbe(e.routes,e),n=e.parseQuery||Zbe,o=e.stringifyQuery||pE,r=e.history,i=Pu(),a=Pu(),l=Pu(),s=se(ga);let u=ga;Hs&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=wb.bind(null,Z=>""+Z),d=wb.bind(null,ybe),f=wb.bind(null,qd);function p(Z,re){let ne,X;return f7(Z)?(ne=t.getRecordMatcher(Z),X=re):X=Z,t.addRoute(X,ne)}function v(Z){const re=t.getRecordMatcher(Z);re&&t.removeRoute(re)}function h(){return t.getRoutes().map(Z=>Z.record)}function m(Z){return!!t.getRecordMatcher(Z)}function b(Z,re){if(re=At({},re||s.value),typeof Z=="string"){const J=Pb(n,Z,re.path),de=t.resolve({path:J.path},re),fe=r.createHref(J.fullPath);return At(J,de,{params:f(de.params),hash:qd(J.hash),redirectedFrom:void 0,href:fe})}let ne;if(Z.path!=null)ne=At({},Z,{path:Pb(n,Z.path,re.path).path});else{const J=At({},Z.params);for(const de in J)J[de]==null&&delete J[de];ne=At({},Z,{params:d(J)}),re.params=d(re.params)}const X=t.resolve(ne,re),te=Z.hash||"";X.params=c(f(X.params));const W=xbe(o,At({},Z,{hash:vbe(te),path:X.path})),U=r.createHref(W);return At({fullPath:W,hash:te,query:o===pE?Qbe(Z.query):Z.query||{}},X,{redirectedFrom:void 0,href:U})}function S(Z){return typeof Z=="string"?Pb(n,Z,s.value.path):At({},Z)}function C(Z,re){if(u!==Z)return _c(8,{from:re,to:Z})}function $(Z){return w(Z)}function x(Z){return $(At(S(Z),{replace:!0}))}function P(Z){const re=Z.matched[Z.matched.length-1];if(re&&re.redirect){const{redirect:ne}=re;let X=typeof ne=="function"?ne(Z):ne;return typeof X=="string"&&(X=X.includes("?")||X.includes("#")?X=S(X):{path:X},X.params={}),At({query:Z.query,hash:Z.hash,params:X.path!=null?{}:Z.params},X)}}function w(Z,re){const ne=u=b(Z),X=s.value,te=Z.state,W=Z.force,U=Z.replace===!0,J=P(ne);if(J)return w(At(S(J),{state:typeof J=="object"?At({},te,J.state):te,force:W,replace:U}),re||ne);const de=ne;de.redirectedFrom=re;let fe;return!W&&$be(o,X,ne)&&(fe=_c(16,{to:de,from:X}),j(X,X,!0,!1)),(fe?Promise.resolve(fe):_(de,X)).catch(pe=>Pi(pe)?Pi(pe,2)?pe:B(pe):L(pe,de,X)).then(pe=>{if(pe){if(Pi(pe,2))return w(At({replace:U},S(pe.to),{state:typeof pe.to=="object"?At({},te,pe.to.state):te,force:W}),re||de)}else pe=A(de,X,!0,U,te);return T(de,X,pe),pe})}function O(Z,re){const ne=C(Z,re);return ne?Promise.reject(ne):Promise.resolve()}function I(Z){const re=Q.values().next().value;return re&&typeof re.runWithContext=="function"?re.runWithContext(Z):Z()}function _(Z,re){let ne;const[X,te,W]=sye(Z,re);ne=Ob(X.reverse(),"beforeRouteLeave",Z,re);for(const J of X)J.leaveGuards.forEach(de=>{ne.push($a(de,Z,re))});const U=O.bind(null,Z,re);return ne.push(U),oe(ne).then(()=>{ne=[];for(const J of i.list())ne.push($a(J,Z,re));return ne.push(U),oe(ne)}).then(()=>{ne=Ob(te,"beforeRouteUpdate",Z,re);for(const J of te)J.updateGuards.forEach(de=>{ne.push($a(de,Z,re))});return ne.push(U),oe(ne)}).then(()=>{ne=[];for(const J of W)if(J.beforeEnter)if(Gr(J.beforeEnter))for(const de of J.beforeEnter)ne.push($a(de,Z,re));else ne.push($a(J.beforeEnter,Z,re));return ne.push(U),oe(ne)}).then(()=>(Z.matched.forEach(J=>J.enterCallbacks={}),ne=Ob(W,"beforeRouteEnter",Z,re,I),ne.push(U),oe(ne))).then(()=>{ne=[];for(const J of a.list())ne.push($a(J,Z,re));return ne.push(U),oe(ne)}).catch(J=>Pi(J,8)?J:Promise.reject(J))}function T(Z,re,ne){l.list().forEach(X=>I(()=>X(Z,re,ne)))}function A(Z,re,ne,X,te){const W=C(Z,re);if(W)return W;const U=re===ga,J=Hs?history.state:{};ne&&(X||U?r.replace(Z.fullPath,At({scroll:U&&J&&J.scroll},te)):r.push(Z.fullPath,te)),s.value=Z,j(Z,re,ne,U),B()}let R;function H(){R||(R=r.listen((Z,re,ne)=>{if(!Y.listening)return;const X=b(Z),te=P(X);if(te){w(At(te,{replace:!0,force:!0}),X).catch(fd);return}u=X;const W=s.value;Hs&&Mbe(rE(W.fullPath,ne.delta),Tm()),_(X,W).catch(U=>Pi(U,12)?U:Pi(U,2)?(w(At(S(U.to),{force:!0}),X).then(J=>{Pi(J,20)&&!ne.delta&&ne.type===Jd.pop&&r.go(-1,!1)}).catch(fd),Promise.reject()):(ne.delta&&r.go(-ne.delta,!1),L(U,X,W))).then(U=>{U=U||A(X,W,!1),U&&(ne.delta&&!Pi(U,8)?r.go(-ne.delta,!1):ne.type===Jd.pop&&Pi(U,20)&&r.go(-1,!1)),T(X,W,U)}).catch(fd)}))}let M=Pu(),D=Pu(),N;function L(Z,re,ne){B(Z);const X=D.list();return X.length?X.forEach(te=>te(Z,re,ne)):console.error(Z),Promise.reject(Z)}function F(){return N&&s.value!==ga?Promise.resolve():new Promise((Z,re)=>{M.add([Z,re])})}function B(Z){return N||(N=!Z,H(),M.list().forEach(([re,ne])=>Z?ne(Z):re()),M.reset()),Z}function j(Z,re,ne,X){const{scrollBehavior:te}=e;if(!Hs||!te)return Promise.resolve();const W=!ne&&Abe(rE(Z.fullPath,0))||(X||!ne)&&history.state&&history.state.scroll||null;return ot().then(()=>te(Z,re,W)).then(U=>U&&_be(U)).catch(U=>L(U,Z,re))}const z=Z=>r.go(Z);let G;const Q=new Set,Y={currentRoute:s,listening:!0,addRoute:p,removeRoute:v,clearRoutes:t.clearRoutes,hasRoute:m,getRoutes:h,resolve:b,options:e,push:$,replace:x,go:z,back:()=>z(-1),forward:()=>z(1),beforeEach:i.add,beforeResolve:a.add,afterEach:l.add,onError:D.add,isReady:F,install(Z){const re=this;Z.component("RouterLink",oye),Z.component("RouterView",v7),Z.config.globalProperties.$router=re,Object.defineProperty(Z.config.globalProperties,"$route",{enumerable:!0,get:()=>Bt(s)}),Hs&&!G&&s.value===ga&&(G=!0,$(r.location).catch(te=>{}));const ne={};for(const te in ga)Object.defineProperty(ne,te,{get:()=>s.value[te],enumerable:!0});Z.provide(Em,re),Z.provide(k$,A_(ne)),Z.provide(z1,s);const X=Z.unmount;Q.add(Z),Z.unmount=function(){Q.delete(Z),Q.size<1&&(u=ga,R&&R(),R=null,s.value=ga,G=!1,N=!1),X()}}};function oe(Z){return Z.reduce((re,ne)=>re.then(()=>I(ne)),Promise.resolve())}return Y}function sye(e,t){const n=[],o=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let a=0;aEc(u,l))?o.push(l):n.push(l));const s=e.matched[a];s&&(t.matched.find(u=>Ec(u,s))||r.push(s))}return[n,o,r]}function iOe(){return ze(Em)}function aOe(e){return ze(k$)}const cye="modulepreload",uye=function(e){return"/ui/"+e},yE={},Ou=function(t,n,o){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));r=Promise.allSettled(n.map(s=>{if(s=uye(s),s in yE)return;yE[s]=!0;const u=s.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":cye,u||(d.as="script"),d.crossOrigin="",d.href=s,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${s}`)))})}))}function i(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return r.then(a=>{for(const l of a||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},m7=[{path:"/",name:"Root",redirect:()=>localStorage.getItem("hasInitialized")==="true"?localStorage.getItem("hasVisitedHome")==="true"?"/direct":"/home":"/init",meta:{skip:!0},children:[{path:"/init",name:"init",component:()=>Ou(()=>import("./index-DXRRTLTq.js"),__vite__mapDeps([0,1,2,3])),meta:{fullscreen:!0,skip:!0}},{path:"/home",name:"conversation",component:()=>Ou(()=>import("./index-B35pCJSJ.js"),__vite__mapDeps([4,5,6,2,7,8,9,1,10])),meta:{icon:"carbon:chat",fullscreen:!0}},{path:"/direct/:id?",name:"direct",component:()=>Ou(()=>import("./index-CzTAyhzl.js"),__vite__mapDeps([11,6,9,1,2,7,8,12,13,14])),meta:{icon:"carbon:chat",fullscreen:!0}},{path:"/configs/:category?",name:"configs",component:()=>Ou(()=>import("./index-Dqcw8yKQ.js").then(e=>e.i),__vite__mapDeps([15,6,2,12,13,7,8,16])),meta:{icon:"carbon:settings-adjust"}}]},{path:"/:catchAll(.*)",name:"notFound",component:()=>Ou(()=>import("./notFound-BSR8IgwZ.js"),__vite__mapDeps([17,5,6,2,18])),meta:{skip:!0}}];function SE(...e){return e.join("/").replace(/\/+/g,"/")}function b7(e,t){if(e)for(const n of e)t&&(n.path=SE(t.path,n.path)),n.redirect&&typeof n.redirect=="string"&&(n.redirect=SE(n.path,n.redirect||"")),b7(n.children,n)}b7(m7,void 0);const dye={history:Lbe("/ui"),routes:m7},y7=lye(dye);y7.beforeEach(async(e,t,n)=>{if(e.path==="/init"){n();return}try{const r=await(await fetch("/api/init/status")).json();if(r.success&&!r.initialized){localStorage.removeItem("hasInitialized"),n("/init");return}else r.success&&r.initialized&&localStorage.setItem("hasInitialized","true")}catch(o){if(console.warn("Failed to check initialization status:",o),!(localStorage.getItem("hasInitialized")==="true")){n("/init");return}}n()});const fye={id:"app"},pye=le({__name:"App",setup(e){return(t,n)=>(st(),_t("div",fye,[g(Bt(v7))]))}});/*! + */const Hs=typeof document<"u";function r7(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function abe(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&r7(e.default)}const At=Object.assign;function wb(e,t){const n={};for(const o in t){const r=t[o];n[o]=Gr(r)?r.map(e):e(r)}return n}const fd=()=>{},Gr=Array.isArray,i7=/#/g,lbe=/&/g,sbe=/\//g,cbe=/=/g,ube=/\?/g,a7=/\+/g,dbe=/%5B/g,fbe=/%5D/g,l7=/%5E/g,pbe=/%60/g,s7=/%7B/g,gbe=/%7C/g,c7=/%7D/g,hbe=/%20/g;function N$(e){return encodeURI(""+e).replace(gbe,"|").replace(dbe,"[").replace(fbe,"]")}function vbe(e){return N$(e).replace(s7,"{").replace(c7,"}").replace(l7,"^")}function B1(e){return N$(e).replace(a7,"%2B").replace(hbe,"+").replace(i7,"%23").replace(lbe,"%26").replace(pbe,"`").replace(s7,"{").replace(c7,"}").replace(l7,"^")}function mbe(e){return B1(e).replace(cbe,"%3D")}function bbe(e){return N$(e).replace(i7,"%23").replace(ube,"%3F")}function ybe(e){return e==null?"":bbe(e).replace(sbe,"%2F")}function qd(e){try{return decodeURIComponent(""+e)}catch{}return""+e}const Sbe=/\/$/,Cbe=e=>e.replace(Sbe,"");function Pb(e,t,n="/"){let o,r={},i="",a="";const l=t.indexOf("#");let s=t.indexOf("?");return l=0&&(s=-1),s>-1&&(o=t.slice(0,s),i=t.slice(s+1,l>-1?l:t.length),r=e(i)),l>-1&&(o=o||t.slice(0,l),a=t.slice(l,t.length)),o=Pbe(o??t,n),{fullPath:o+(i&&"?")+i+a,path:o,query:r,hash:qd(a)}}function xbe(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function nE(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function $be(e,t,n){const o=t.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&Ec(t.matched[o],n.matched[r])&&u7(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Ec(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function u7(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!wbe(e[n],t[n]))return!1;return!0}function wbe(e,t){return Gr(e)?oE(e,t):Gr(t)?oE(t,e):e===t}function oE(e,t){return Gr(t)?e.length===t.length&&e.every((n,o)=>n===t[o]):e.length===1&&e[0]===t}function Pbe(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),o=e.split("/"),r=o[o.length-1];(r===".."||r===".")&&o.push("");let i=n.length-1,a,l;for(a=0;a1&&i--;else break;return n.slice(0,i).join("/")+"/"+o.slice(a).join("/")}const ga={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Jd;(function(e){e.pop="pop",e.push="push"})(Jd||(Jd={}));var pd;(function(e){e.back="back",e.forward="forward",e.unknown=""})(pd||(pd={}));function Obe(e){if(!e)if(Hs){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Cbe(e)}const Ibe=/^[^#]+#/;function Tbe(e,t){return e.replace(Ibe,"#")+t}function Ebe(e,t){const n=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-n.left-(t.left||0),top:o.top-n.top-(t.top||0)}}const Tm=()=>({left:window.scrollX,top:window.scrollY});function _be(e){let t;if("el"in e){const n=e.el,o=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=Ebe(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function rE(e,t){return(history.state?history.state.position-t:-1)+e}const H1=new Map;function Mbe(e,t){H1.set(e,t)}function Abe(e){const t=H1.get(e);return H1.delete(e),t}let Rbe=()=>location.protocol+"//"+location.host;function d7(e,t){const{pathname:n,search:o,hash:r}=t,i=e.indexOf("#");if(i>-1){let l=r.includes(e.slice(i))?e.slice(i).length:1,s=r.slice(l);return s[0]!=="/"&&(s="/"+s),nE(s,"")}return nE(n,e)+o+r}function Dbe(e,t,n,o){let r=[],i=[],a=null;const l=({state:f})=>{const p=d7(e,location),v=n.value,h=t.value;let m=0;if(f){if(n.value=p,t.value=f,a&&a===v){a=null;return}m=h?f.position-h.position:0}else o(p);r.forEach(b=>{b(n.value,v,{delta:m,type:Jd.pop,direction:m?m>0?pd.forward:pd.back:pd.unknown})})};function s(){a=n.value}function u(f){r.push(f);const p=()=>{const v=r.indexOf(f);v>-1&&r.splice(v,1)};return i.push(p),p}function c(){const{history:f}=window;f.state&&f.replaceState(At({},f.state,{scroll:Tm()}),"")}function d(){for(const f of i)f();i=[],window.removeEventListener("popstate",l),window.removeEventListener("beforeunload",c)}return window.addEventListener("popstate",l),window.addEventListener("beforeunload",c,{passive:!0}),{pauseListeners:s,listen:u,destroy:d}}function iE(e,t,n,o=!1,r=!1){return{back:e,current:t,forward:n,replaced:o,position:window.history.length,scroll:r?Tm():null}}function Nbe(e){const{history:t,location:n}=window,o={value:d7(e,n)},r={value:t.state};r.value||i(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(s,u,c){const d=e.indexOf("#"),f=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+s:Rbe()+e+s;try{t[c?"replaceState":"pushState"](u,"",f),r.value=u}catch(p){console.error(p),n[c?"replace":"assign"](f)}}function a(s,u){const c=At({},t.state,iE(r.value.back,s,r.value.forward,!0),u,{position:r.value.position});i(s,c,!0),o.value=s}function l(s,u){const c=At({},r.value,t.state,{forward:s,scroll:Tm()});i(c.current,c,!0);const d=At({},iE(o.value,s,null),{position:c.position+1},u);i(s,d,!1),o.value=s}return{location:o,state:r,push:l,replace:a}}function kbe(e){e=Obe(e);const t=Nbe(e),n=Dbe(e,t.state,t.location,t.replace);function o(i,a=!0){a||n.pauseListeners(),history.go(i)}const r=At({location:"",base:e,go:o,createHref:Tbe.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function Lbe(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),kbe(e)}function Fbe(e){return typeof e=="string"||e&&typeof e=="object"}function f7(e){return typeof e=="string"||typeof e=="symbol"}const p7=Symbol("");var aE;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(aE||(aE={}));function _c(e,t){return At(new Error,{type:e,[p7]:!0},t)}function Pi(e,t){return e instanceof Error&&p7 in e&&(t==null||!!(e.type&t))}const lE="[^/]+?",Bbe={sensitive:!1,strict:!1,start:!0,end:!0},Hbe=/[.+*?^${}()[\]/\\]/g;function zbe(e,t){const n=At({},Bbe,t),o=[];let r=n.start?"^":"";const i=[];for(const u of e){const c=u.length?[]:[90];n.strict&&!u.length&&(r+="/");for(let d=0;dt.length?t.length===1&&t[0]===80?1:-1:0}function g7(e,t){let n=0;const o=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const Wbe={type:0,value:""},Vbe=/[a-zA-Z0-9_]/;function Kbe(e){if(!e)return[[]];if(e==="/")return[[Wbe]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(p){throw new Error(`ERR (${n})/"${u}": ${p}`)}let n=0,o=n;const r=[];let i;function a(){i&&r.push(i),i=[]}let l=0,s,u="",c="";function d(){u&&(n===0?i.push({type:0,value:u}):n===1||n===2||n===3?(i.length>1&&(s==="*"||s==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),i.push({type:1,value:u,regexp:c,repeatable:s==="*"||s==="+",optional:s==="*"||s==="?"})):t("Invalid state to consume buffer"),u="")}function f(){u+=s}for(;l{a(C)}:fd}function a(d){if(f7(d)){const f=o.get(d);f&&(o.delete(d),n.splice(n.indexOf(f),1),f.children.forEach(a),f.alias.forEach(a))}else{const f=n.indexOf(d);f>-1&&(n.splice(f,1),d.record.name&&o.delete(d.record.name),d.children.forEach(a),d.alias.forEach(a))}}function l(){return n}function s(d){const f=qbe(d,n);n.splice(f,0,d),d.record.name&&!dE(d)&&o.set(d.record.name,d)}function u(d,f){let p,v={},h,m;if("name"in d&&d.name){if(p=o.get(d.name),!p)throw _c(1,{location:d});m=p.record.name,v=At(cE(f.params,p.keys.filter(C=>!C.optional).concat(p.parent?p.parent.keys.filter(C=>C.optional):[]).map(C=>C.name)),d.params&&cE(d.params,p.keys.map(C=>C.name))),h=p.stringify(v)}else if(d.path!=null)h=d.path,p=n.find(C=>C.re.test(h)),p&&(v=p.parse(h),m=p.record.name);else{if(p=f.name?o.get(f.name):n.find(C=>C.re.test(f.path)),!p)throw _c(1,{location:d,currentLocation:f});m=p.record.name,v=At({},f.params,d.params),h=p.stringify(v)}const b=[];let S=p;for(;S;)b.unshift(S.record),S=S.parent;return{name:m,path:h,params:v,matched:b,meta:Ybe(b)}}e.forEach(d=>i(d));function c(){n.length=0,o.clear()}return{addRoute:i,resolve:u,removeRoute:a,clearRoutes:c,getRoutes:l,getRecordMatcher:r}}function cE(e,t){const n={};for(const o of t)o in e&&(n[o]=e[o]);return n}function uE(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Xbe(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Xbe(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const o in e.components)t[o]=typeof n=="object"?n[o]:n;return t}function dE(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Ybe(e){return e.reduce((t,n)=>At(t,n.meta),{})}function fE(e,t){const n={};for(const o in e)n[o]=o in t?t[o]:e[o];return n}function qbe(e,t){let n=0,o=t.length;for(;n!==o;){const i=n+o>>1;g7(e,t[i])<0?o=i:n=i+1}const r=Jbe(e);return r&&(o=t.lastIndexOf(r,o-1)),o}function Jbe(e){let t=e;for(;t=t.parent;)if(h7(t)&&g7(e,t)===0)return t}function h7({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Zbe(e){const t={};if(e===""||e==="?")return t;const o=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;ri&&B1(i)):[o&&B1(o)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+n,i!=null&&(t+="="+i))})}return t}function Qbe(e){const t={};for(const n in e){const o=e[n];o!==void 0&&(t[n]=Gr(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return t}const eye=Symbol(""),gE=Symbol(""),Em=Symbol(""),k$=Symbol(""),z1=Symbol("");function Pu(){let e=[];function t(o){return e.push(o),()=>{const r=e.indexOf(o);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function $a(e,t,n,o,r,i=a=>a()){const a=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise((l,s)=>{const u=f=>{f===!1?s(_c(4,{from:n,to:t})):f instanceof Error?s(f):Fbe(f)?s(_c(2,{from:t,to:f})):(a&&o.enterCallbacks[r]===a&&typeof f=="function"&&a.push(f),l())},c=i(()=>e.call(o&&o.instances[r],t,n,u));let d=Promise.resolve(c);e.length<3&&(d=d.then(u)),d.catch(f=>s(f))})}function Ob(e,t,n,o,r=i=>i()){const i=[];for(const a of e)for(const l in a.components){let s=a.components[l];if(!(t!=="beforeRouteEnter"&&!a.instances[l]))if(r7(s)){const c=(s.__vccOpts||s)[t];c&&i.push($a(c,n,o,a,l,r))}else{let u=s();i.push(()=>u.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${l}" at "${a.path}"`);const d=abe(c)?c.default:c;a.mods[l]=c,a.components[l]=d;const p=(d.__vccOpts||d)[t];return p&&$a(p,n,o,a,l,r)()}))}}return i}function hE(e){const t=ze(Em),n=ze(k$),o=E(()=>{const s=Bt(e.to);return t.resolve(s)}),r=E(()=>{const{matched:s}=o.value,{length:u}=s,c=s[u-1],d=n.matched;if(!c||!d.length)return-1;const f=d.findIndex(Ec.bind(null,c));if(f>-1)return f;const p=vE(s[u-2]);return u>1&&vE(c)===p&&d[d.length-1].path!==p?d.findIndex(Ec.bind(null,s[u-2])):f}),i=E(()=>r.value>-1&&iye(n.params,o.value.params)),a=E(()=>r.value>-1&&r.value===n.matched.length-1&&u7(n.params,o.value.params));function l(s={}){if(rye(s)){const u=t[Bt(e.replace)?"replace":"push"](Bt(e.to)).catch(fd);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:o,href:E(()=>o.value.href),isActive:i,isExactActive:a,navigate:l}}function tye(e){return e.length===1?e[0]:e}const nye=le({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:hE,setup(e,{slots:t}){const n=rt(hE(e)),{options:o}=ze(Em),r=E(()=>({[mE(e.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[mE(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&tye(t.default(n));return e.custom?i:Vr("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),oye=nye;function rye(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function iye(e,t){for(const n in t){const o=t[n],r=e[n];if(typeof o=="string"){if(o!==r)return!1}else if(!Gr(r)||r.length!==o.length||o.some((i,a)=>i!==r[a]))return!1}return!0}function vE(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const mE=(e,t,n)=>e??t??n,aye=le({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const o=ze(z1),r=E(()=>e.route||o.value),i=ze(gE,0),a=E(()=>{let u=Bt(i);const{matched:c}=r.value;let d;for(;(d=c[u])&&!d.components;)u++;return u}),l=E(()=>r.value.matched[a.value]);Xe(gE,E(()=>a.value+1)),Xe(eye,l),Xe(z1,r);const s=ae();return be(()=>[s.value,l.value,e.name],([u,c,d],[f,p,v])=>{c&&(c.instances[d]=u,p&&p!==c&&u&&u===f&&(c.leaveGuards.size||(c.leaveGuards=p.leaveGuards),c.updateGuards.size||(c.updateGuards=p.updateGuards))),u&&c&&(!p||!Ec(c,p)||!f)&&(c.enterCallbacks[d]||[]).forEach(h=>h(u))},{flush:"post"}),()=>{const u=r.value,c=e.name,d=l.value,f=d&&d.components[c];if(!f)return bE(n.default,{Component:f,route:u});const p=d.props[c],v=p?p===!0?u.params:typeof p=="function"?p(u):p:null,m=Vr(f,At({},v,t,{onVnodeUnmounted:b=>{b.component.isUnmounted&&(d.instances[c]=null)},ref:s}));return bE(n.default,{Component:m,route:u})||m}}});function bE(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const v7=aye;function lye(e){const t=Gbe(e.routes,e),n=e.parseQuery||Zbe,o=e.stringifyQuery||pE,r=e.history,i=Pu(),a=Pu(),l=Pu(),s=se(ga);let u=ga;Hs&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=wb.bind(null,Z=>""+Z),d=wb.bind(null,ybe),f=wb.bind(null,qd);function p(Z,re){let ne,X;return f7(Z)?(ne=t.getRecordMatcher(Z),X=re):X=Z,t.addRoute(X,ne)}function v(Z){const re=t.getRecordMatcher(Z);re&&t.removeRoute(re)}function h(){return t.getRoutes().map(Z=>Z.record)}function m(Z){return!!t.getRecordMatcher(Z)}function b(Z,re){if(re=At({},re||s.value),typeof Z=="string"){const J=Pb(n,Z,re.path),de=t.resolve({path:J.path},re),fe=r.createHref(J.fullPath);return At(J,de,{params:f(de.params),hash:qd(J.hash),redirectedFrom:void 0,href:fe})}let ne;if(Z.path!=null)ne=At({},Z,{path:Pb(n,Z.path,re.path).path});else{const J=At({},Z.params);for(const de in J)J[de]==null&&delete J[de];ne=At({},Z,{params:d(J)}),re.params=d(re.params)}const X=t.resolve(ne,re),te=Z.hash||"";X.params=c(f(X.params));const W=xbe(o,At({},Z,{hash:vbe(te),path:X.path})),U=r.createHref(W);return At({fullPath:W,hash:te,query:o===pE?Qbe(Z.query):Z.query||{}},X,{redirectedFrom:void 0,href:U})}function S(Z){return typeof Z=="string"?Pb(n,Z,s.value.path):At({},Z)}function C(Z,re){if(u!==Z)return _c(8,{from:re,to:Z})}function $(Z){return w(Z)}function x(Z){return $(At(S(Z),{replace:!0}))}function P(Z){const re=Z.matched[Z.matched.length-1];if(re&&re.redirect){const{redirect:ne}=re;let X=typeof ne=="function"?ne(Z):ne;return typeof X=="string"&&(X=X.includes("?")||X.includes("#")?X=S(X):{path:X},X.params={}),At({query:Z.query,hash:Z.hash,params:X.path!=null?{}:Z.params},X)}}function w(Z,re){const ne=u=b(Z),X=s.value,te=Z.state,W=Z.force,U=Z.replace===!0,J=P(ne);if(J)return w(At(S(J),{state:typeof J=="object"?At({},te,J.state):te,force:W,replace:U}),re||ne);const de=ne;de.redirectedFrom=re;let fe;return!W&&$be(o,X,ne)&&(fe=_c(16,{to:de,from:X}),j(X,X,!0,!1)),(fe?Promise.resolve(fe):_(de,X)).catch(pe=>Pi(pe)?Pi(pe,2)?pe:B(pe):L(pe,de,X)).then(pe=>{if(pe){if(Pi(pe,2))return w(At({replace:U},S(pe.to),{state:typeof pe.to=="object"?At({},te,pe.to.state):te,force:W}),re||de)}else pe=A(de,X,!0,U,te);return T(de,X,pe),pe})}function O(Z,re){const ne=C(Z,re);return ne?Promise.reject(ne):Promise.resolve()}function I(Z){const re=Q.values().next().value;return re&&typeof re.runWithContext=="function"?re.runWithContext(Z):Z()}function _(Z,re){let ne;const[X,te,W]=sye(Z,re);ne=Ob(X.reverse(),"beforeRouteLeave",Z,re);for(const J of X)J.leaveGuards.forEach(de=>{ne.push($a(de,Z,re))});const U=O.bind(null,Z,re);return ne.push(U),oe(ne).then(()=>{ne=[];for(const J of i.list())ne.push($a(J,Z,re));return ne.push(U),oe(ne)}).then(()=>{ne=Ob(te,"beforeRouteUpdate",Z,re);for(const J of te)J.updateGuards.forEach(de=>{ne.push($a(de,Z,re))});return ne.push(U),oe(ne)}).then(()=>{ne=[];for(const J of W)if(J.beforeEnter)if(Gr(J.beforeEnter))for(const de of J.beforeEnter)ne.push($a(de,Z,re));else ne.push($a(J.beforeEnter,Z,re));return ne.push(U),oe(ne)}).then(()=>(Z.matched.forEach(J=>J.enterCallbacks={}),ne=Ob(W,"beforeRouteEnter",Z,re,I),ne.push(U),oe(ne))).then(()=>{ne=[];for(const J of a.list())ne.push($a(J,Z,re));return ne.push(U),oe(ne)}).catch(J=>Pi(J,8)?J:Promise.reject(J))}function T(Z,re,ne){l.list().forEach(X=>I(()=>X(Z,re,ne)))}function A(Z,re,ne,X,te){const W=C(Z,re);if(W)return W;const U=re===ga,J=Hs?history.state:{};ne&&(X||U?r.replace(Z.fullPath,At({scroll:U&&J&&J.scroll},te)):r.push(Z.fullPath,te)),s.value=Z,j(Z,re,ne,U),B()}let R;function H(){R||(R=r.listen((Z,re,ne)=>{if(!Y.listening)return;const X=b(Z),te=P(X);if(te){w(At(te,{replace:!0,force:!0}),X).catch(fd);return}u=X;const W=s.value;Hs&&Mbe(rE(W.fullPath,ne.delta),Tm()),_(X,W).catch(U=>Pi(U,12)?U:Pi(U,2)?(w(At(S(U.to),{force:!0}),X).then(J=>{Pi(J,20)&&!ne.delta&&ne.type===Jd.pop&&r.go(-1,!1)}).catch(fd),Promise.reject()):(ne.delta&&r.go(-ne.delta,!1),L(U,X,W))).then(U=>{U=U||A(X,W,!1),U&&(ne.delta&&!Pi(U,8)?r.go(-ne.delta,!1):ne.type===Jd.pop&&Pi(U,20)&&r.go(-1,!1)),T(X,W,U)}).catch(fd)}))}let M=Pu(),D=Pu(),N;function L(Z,re,ne){B(Z);const X=D.list();return X.length?X.forEach(te=>te(Z,re,ne)):console.error(Z),Promise.reject(Z)}function F(){return N&&s.value!==ga?Promise.resolve():new Promise((Z,re)=>{M.add([Z,re])})}function B(Z){return N||(N=!Z,H(),M.list().forEach(([re,ne])=>Z?ne(Z):re()),M.reset()),Z}function j(Z,re,ne,X){const{scrollBehavior:te}=e;if(!Hs||!te)return Promise.resolve();const W=!ne&&Abe(rE(Z.fullPath,0))||(X||!ne)&&history.state&&history.state.scroll||null;return ot().then(()=>te(Z,re,W)).then(U=>U&&_be(U)).catch(U=>L(U,Z,re))}const z=Z=>r.go(Z);let G;const Q=new Set,Y={currentRoute:s,listening:!0,addRoute:p,removeRoute:v,clearRoutes:t.clearRoutes,hasRoute:m,getRoutes:h,resolve:b,options:e,push:$,replace:x,go:z,back:()=>z(-1),forward:()=>z(1),beforeEach:i.add,beforeResolve:a.add,afterEach:l.add,onError:D.add,isReady:F,install(Z){const re=this;Z.component("RouterLink",oye),Z.component("RouterView",v7),Z.config.globalProperties.$router=re,Object.defineProperty(Z.config.globalProperties,"$route",{enumerable:!0,get:()=>Bt(s)}),Hs&&!G&&s.value===ga&&(G=!0,$(r.location).catch(te=>{}));const ne={};for(const te in ga)Object.defineProperty(ne,te,{get:()=>s.value[te],enumerable:!0});Z.provide(Em,re),Z.provide(k$,A_(ne)),Z.provide(z1,s);const X=Z.unmount;Q.add(Z),Z.unmount=function(){Q.delete(Z),Q.size<1&&(u=ga,R&&R(),R=null,s.value=ga,G=!1,N=!1),X()}}};function oe(Z){return Z.reduce((re,ne)=>re.then(()=>I(ne)),Promise.resolve())}return Y}function sye(e,t){const n=[],o=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let a=0;aEc(u,l))?o.push(l):n.push(l));const s=e.matched[a];s&&(t.matched.find(u=>Ec(u,s))||r.push(s))}return[n,o,r]}function iOe(){return ze(Em)}function aOe(e){return ze(k$)}const cye="modulepreload",uye=function(e){return"/ui/"+e},yE={},Ou=function(t,n,o){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));r=Promise.allSettled(n.map(s=>{if(s=uye(s),s in yE)return;yE[s]=!0;const u=s.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":cye,u||(d.as="script"),d.crossOrigin="",d.href=s,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${s}`)))})}))}function i(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return r.then(a=>{for(const l of a||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},m7=[{path:"/",name:"Root",redirect:()=>localStorage.getItem("hasInitialized")==="true"?localStorage.getItem("hasVisitedHome")==="true"?"/direct":"/home":"/init",meta:{skip:!0},children:[{path:"/init",name:"init",component:()=>Ou(()=>import("./index-CuGql25I.js"),__vite__mapDeps([0,1,2,3])),meta:{fullscreen:!0,skip:!0}},{path:"/home",name:"conversation",component:()=>Ou(()=>import("./index-C3sb7NYv.js"),__vite__mapDeps([4,5,6,2,7,8,9,1,10])),meta:{icon:"carbon:chat",fullscreen:!0}},{path:"/direct/:id?",name:"direct",component:()=>Ou(()=>import("./index-QLIAiQL6.js"),__vite__mapDeps([11,6,9,1,2,7,8,12,13,14])),meta:{icon:"carbon:chat",fullscreen:!0}},{path:"/configs/:category?",name:"configs",component:()=>Ou(()=>import("./index-BGKqtLX6.js").then(e=>e.i),__vite__mapDeps([15,6,2,12,13,7,8,16])),meta:{icon:"carbon:settings-adjust"}}]},{path:"/:catchAll(.*)",name:"notFound",component:()=>Ou(()=>import("./notFound-CVrU7YVW.js"),__vite__mapDeps([17,5,6,2,18])),meta:{skip:!0}}];function SE(...e){return e.join("/").replace(/\/+/g,"/")}function b7(e,t){if(e)for(const n of e)t&&(n.path=SE(t.path,n.path)),n.redirect&&typeof n.redirect=="string"&&(n.redirect=SE(n.path,n.redirect||"")),b7(n.children,n)}b7(m7,void 0);const dye={history:Lbe("/ui"),routes:m7},y7=lye(dye);y7.beforeEach(async(e,t,n)=>{if(e.path==="/init"){n();return}try{const r=await(await fetch("/api/init/status")).json();if(r.success&&!r.initialized){localStorage.removeItem("hasInitialized"),n("/init");return}else r.success&&r.initialized&&localStorage.setItem("hasInitialized","true")}catch(o){if(console.warn("Failed to check initialization status:",o),!(localStorage.getItem("hasInitialized")==="true")){n("/init");return}}n()});const fye={id:"app"},pye=le({__name:"App",setup(e){return(t,n)=>(st(),_t("div",fye,[g(Bt(v7))]))}});/*! * shared v9.14.4 * (c) 2025 kazuya kawaguchi * Released under the MIT License. @@ -599,7 +599,7 @@ MYSQL_USER:root`,connectionTypePlaceholder:"请选择连接类型",argsFormatErr 当前版本数:{versionCount}`,saveSuccess:`保存成功:{message} -当前版本数:{versionCount}`,saveStatus:"保存状态:{message}",saveFailed:"保存计划修改失败",generateSuccess:"计划生成成功!模板ID: {templateId}",generateFailed:"生成计划失败",updateSuccess:"计划更新成功!",updateFailed:"更新计划失败",executeFailed:"执行计划失败",unknown:"未知",newTemplateName:"新建的执行计划",newTemplateDescription:"请使用计划生成器创建新的计划模板",generatedTemplateDescription:"通过生成器创建的计划模板",defaultExecutionPlanTitle:"执行计划"},toolSelection:{title:"选择工具",searchPlaceholder:"搜索工具...",sortByGroup:"按服务组排序",sortByName:"按名称排序",sortByStatus:"按启用状态排序",summary:"共 {groups} 个服务组,{tools} 个工具 (已选择 {selected} 个)",enableAll:"启用全部",noToolsFound:"没有找到工具"},direct:{planTemplateIdNotFound:"没有找到计划模板ID",executionFailedNoPlanId:"执行计划失败:未返回有效的计划ID",executionFailed:"执行计划失败"},modal:{close:"关闭",cancel:"取消",confirm:"确认",save:"保存",delete:"删除",edit:"编辑"},editor:{format:"格式化",undo:"撤销",redo:"重做",find:"查找",replace:"替换",gotoLine:"跳转到行",selectAll:"全选",toggleWordWrap:"切换自动换行",toggleMinimap:"切换迷你地图",increaseFontSize:"增大字体",decreaseFontSize:"减小字体",resetFontSize:"重置字体大小"},validation:{required:"内容不能为空"},theme:{switch:"切换主题",light:"浅色主题",dark:"深色主题",auto:"跟随系统"},error:{notFound:"页面未找到",notFoundDescription:"抱歉,您访问的页面不存在",serverError:"服务器错误",serverErrorDescription:"服务器出现了一些问题,请稍后再试",networkError:"网络错误",networkErrorDescription:"网络连接失败,请检查您的网络设置",backToHome:"返回首页",retry:"重试"},time:{now:"刚刚",unknown:"未知时间",minuteAgo:"{count} 分钟前",hourAgo:"{count} 小时前",dayAgo:"{count} 天前",weekAgo:"{count} 周前",monthAgo:"{count} 个月前",yearAgo:"{count} 年前",today:"今天",yesterday:"昨天",tomorrow:"明天",thisWeek:"本周",lastWeek:"上周",nextWeek:"下周",thisMonth:"本月",lastMonth:"上月",nextMonth:"下月",thisYear:"今年",lastYear:"去年",nextYear:"明年"},stats:{total:"总计",count:"数量",percentage:"百分比",average:"平均",median:"中位数",min:"最小值",max:"最大值",sum:"总和",growth:"增长",decline:"下降",noData:"暂无数据",loading:"数据加载中...",error:"数据加载失败"},home:{welcomeTitle:"欢迎使用 JManus!",welcomeSubtitle:"您的 Java AI 智能助手,帮助您构建和完成各种任务。",tagline:"Java AI 智能体",inputPlaceholder:"描述您想构建或完成的内容...",directButton:"直接进入工作台",examples:{stockPrice:{title:"查询股价",description:"获取今天阿里巴巴的最新股价(Agent可以使用浏览器工具)",prompt:"用浏览器基于百度,查询今天阿里巴巴的股价,并返回最新股价"},weather:{title:"查询天气",description:"获取北京今天的天气情况(Agent可以使用MCP工具服务)",prompt:"用浏览器,基于百度,查询北京今天的天气"},queryplan:{title:"查询一个人的信息",description:"查询 沈询 阿里的所有信息(用于展示无限上下文能力)",prompt:"用浏览器,基于百度,查询计划",planTitle:"查询 沈询 阿里的所有信息(用于展示无限上下文能力)",step1:"[BROWSER_AGENT] 通过 百度 查询 沈询 阿里 , 获取第一页的html 百度数据,合并聚拢 到 html_data 的目录里",step1Output:"存放的目录路径",step2:"[BROWSER_AGENT] 从 html_data 目录中找到所有的有效关于沈询 阿里 的网页链接,输出到 link.md里面",step2Output:"url地址,说明"},ainovel:{title:"AI小说创作",description:"人工智能逐步击败人类主题小说(用于展示超长内容的输出)",prompt:"创建一个关于人工智能逐步击败人类的小说,包含10个章节",planTitle:"人工智能逐步击败人类小说创作计划",step1:"[TEXT_FILE_AGENT] 创建小说的大标题和子章节标题的文件,期望是一有10个子章节的的小说,提纲输出到novel.md里,每一个子章节用二级标题,在当前步骤只需要写章节的标题即可,小说的大标题是《人工智能逐步击败人类》",step1Output:"文件的名字",step2:"[TEXT_FILE_AGENT] 从novel.md文件获取子标题信息,然后依次完善每一个章节的具体内容,每个轮次只完善一个子章节的内容,用replace来更新内容,每个章节要求有3000字的内容,不要每更新一个章节就查询一下文档的全部内容",step2Output:"文件的名字"}}},rightPanel:{stepExecutionDetails:"步骤执行详情",noStepSelected:"未选择执行步骤",selectStepHint:"请在左侧聊天区域选择一个执行步骤查看详情",stepExecuting:"步骤正在执行中,请稍候...",step:"步骤",executingAgent:"执行智能体",description:"描述",request:"请求",callingModel:"调用模型",executionResult:"执行结果",executing:"执行中...",thinkAndActionSteps:"思考与行动步骤",thinking:"思考",action:"行动",input:"输入",output:"输出",tool:"工具",toolParameters:"工具参数",noStepDetails:"暂无详细步骤信息",scrollToBottom:"滚动到底部",stepInfo:"步骤信息",stepName:"步骤名称",noExecutionInfo:"该步骤暂无详细执行信息",subPlan:"子执行计划",subStep:"子步骤",subPlanId:"子计划ID",title:"标题",stepNumber:"步骤 {number}",status:{label:"状态",completed:"已完成",executing:"执行中",pending:"待执行"},tabs:{details:"步骤执行详情",chat:"Chat",code:"Code"},chatBubbles:{analyzeRequirements:{title:"分析需求",content:"将您的请求分解为可操作的步骤:1) 创建用户实体,2) 实现用户服务,3) 构建 REST 端点,4) 添加验证和错误处理。"},generateCode:{title:"生成代码",content:"创建具有用户管理 CRUD 操作的 Spring Boot REST API。包括正确的 HTTP 状态代码和错误处理。"},codeGenerated:{title:"代码已生成",content:"成功生成具有所有 CRUD 操作的 UserController。代码包含正确的 REST 约定、错误处理,并遵循 Spring Boot 最佳实践。"}},timeAgo:{justNow:"刚刚",minutesAgo:"{n} 分钟前",hoursAgo:"{n} 小时前",daysAgo:"{n} 天前"},defaultStepTitle:"步骤 {number}"},cronTask:{title:"定时任务管理",addTask:"定时任务",noTasks:"暂无定时任务",taskName:"任务名称",taskNamePlaceholder:"请输入任务名称",cronExpression:"Cron表达式",cronExpressionPlaceholder:"例如: 0 0 12 * * ?",cronExpressionHelp:"格式: 秒 分 时 日 月 周 年",taskDescription:"任务描述",taskDescriptionPlaceholder:"请输入任务描述",taskStatus:"任务状态",taskDetail:"任务详情",executeOnce:"执行一次",edit:"编辑",operations:"操作",enable:"启用",disable:"禁用",delete:"删除",deleteConfirm:"确认删除",deleteConfirmMessage:'确定要删除任务 "{taskName}" 吗?此操作不可撤销。',nextExecution:"下次执行时间",createTime:"创建时间",updateTime:"更新时间",active:"启用",inactive:"禁用",template:"示例:每天帮我早上8点,帮我收集当天的AI新闻吧",planTemplate:"计划模板",linkTemplate:"关联模板",noTemplate:"不关联",selectTemplate:"请选择模板",templateHelpText:"选择后,定时任务将按照制定好的计划执行",createTask:"创建定时任务",selectCreateMethod:"请选择创建方式",createWithJmanus:"让Jmanus帮忙创建",createWithJmanusDesc:"通过AI助手引导创建定时任务",createManually:"手动创建",createManuallyDesc:"自己填写定时任务信息"}},ek="LOCAL_STORAGE_LOCALE",tk=rt({locale:localStorage.getItem(ek)??"en",opts:[{value:"en",title:"English"},{value:"zh",title:"中文"}]}),nk=uSe({legacy:!1,locale:tk.locale,fallbackLocale:"en",messages:{en:CSe,zh:xSe}}),$Se=async e=>{localStorage.setItem(ek,e),nk.global.locale.value=e,tk.locale=e,console.log(`Successfully switched frontend language to: ${e}`)},lOe=async e=>{await $Se(e);try{const t=await fetch("/api/agent-management/initialize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({language:e})});if(t.ok){const n=await t.json();console.log(`Successfully initialized agents with language: ${e}`,n)}else{const n=await t.json();throw console.error(`Failed to initialize agents with language: ${e}`,n),new Error(n.error||"Failed to initialize agents")}}catch(t){throw console.error("Error initializing agents during language change:",t),t}};function ok(e){return Qh()?(pS(e),!0):!1}function ql(e){return typeof e=="function"?e():Bt(e)}const Dm=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const wSe=Object.prototype.toString,PSe=e=>wSe.call(e)==="[object Object]",fc=()=>{},OSe=ISe();function ISe(){var e,t;return Dm&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function rk(e,t){function n(...o){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(r).catch(i)})}return n}const ik=e=>e();function TSe(e,t={}){let n,o,r=fc;const i=l=>{clearTimeout(l),r(),r=fc};return l=>{const s=ql(e),u=ql(t.maxWait);return n&&i(n),s<=0||u!==void 0&&u<=0?(o&&(i(o),o=null),Promise.resolve(l())):new Promise((c,d)=>{r=t.rejectOnCancel?d:c,u&&!o&&(o=setTimeout(()=>{n&&i(n),o=null,c(l())},u)),n=setTimeout(()=>{o&&i(o),o=null,c(l())},s)})}}function ESe(e=ik){const t=ae(!0);function n(){t.value=!1}function o(){t.value=!0}const r=(...i)=>{t.value&&e(...i)};return{isActive:tv(t),pause:n,resume:o,eventFilter:r}}function _Se(e){let t;function n(){return t||(t=e()),t}return n.reset=async()=>{const o=t;t=void 0,o&&await o},n}function MSe(e){return Jt()}function Ui(e,t=200,n={}){return rk(TSe(t,n),e)}function ASe(e,t,n={}){const{eventFilter:o=ik,...r}=n;return be(e,rk(o,t),r)}function RSe(e,t,n={}){const{eventFilter:o,...r}=n,{eventFilter:i,pause:a,resume:l,isActive:s}=ESe(o);return{stop:ASe(e,t,{...r,eventFilter:i}),pause:a,resume:l,isActive:s}}function gs(e,t=!0,n){MSe()?Ke(e,n):t?e():ot(e)}function DSe(e,t,n={}){const{immediate:o=!0}=n,r=ae(!1);let i=null;function a(){i&&(clearTimeout(i),i=null)}function l(){r.value=!1,a()}function s(...u){a(),r.value=!0,i=setTimeout(()=>{r.value=!1,i=null,e(...u)},ql(t))}return o&&(r.value=!0,Dm&&s()),ok(l),{isPending:tv(r),start:s,stop:l}}function io(e,t,n){const o=be(e,(r,i,a)=>{r&&(n!=null&&n.once&&ot(()=>o()),t(r,i,a))},{...n,once:!1});return o}function Fu(e){var t;const n=ql(e);return(t=n==null?void 0:n.$el)!=null?t:n}const tf=Dm?window:void 0,ak=Dm?window.navigator:void 0;function Fl(...e){let t,n,o,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,r]=e,t=tf):[t,n,o,r]=e,!t)return fc;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],a=()=>{i.forEach(c=>c()),i.length=0},l=(c,d,f,p)=>(c.addEventListener(d,f,p),()=>c.removeEventListener(d,f,p)),s=be(()=>[Fu(t),ql(r)],([c,d])=>{if(a(),!c)return;const f=PSe(d)?{...d}:d;i.push(...n.flatMap(p=>o.map(v=>l(c,p,v,f))))},{immediate:!0,flush:"post"}),u=()=>{s(),a()};return ok(u),u}let t3=!1;function NSe(e,t,n={}){const{window:o=tf,ignore:r=[],capture:i=!0,detectIframe:a=!1}=n;if(!o)return fc;OSe&&!t3&&(t3=!0,Array.from(o.document.body.children).forEach(f=>f.addEventListener("click",fc)),o.document.documentElement.addEventListener("click",fc));let l=!0;const s=f=>r.some(p=>{if(typeof p=="string")return Array.from(o.document.querySelectorAll(p)).some(v=>v===f.target||f.composedPath().includes(v));{const v=Fu(p);return v&&(f.target===v||f.composedPath().includes(v))}}),c=[Fl(o,"click",f=>{const p=Fu(e);if(!(!p||p===f.target||f.composedPath().includes(p))){if(f.detail===0&&(l=!s(f)),!l){l=!0;return}t(f)}},{passive:!0,capture:i}),Fl(o,"pointerdown",f=>{const p=Fu(e);l=!s(f)&&!!(p&&!f.composedPath().includes(p))},{passive:!0}),a&&Fl(o,"blur",f=>{setTimeout(()=>{var p;const v=Fu(e);((p=o.document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(v!=null&&v.contains(o.document.activeElement))&&t(f)},0)})].filter(Boolean);return()=>c.forEach(f=>f())}function kSe(){const e=ae(!1),t=Jt();return t&&Ke(()=>{e.value=!0},t),e}function lk(e){const t=kSe();return E(()=>(t.value,!!e()))}function n3(e,t={}){const{controls:n=!1,navigator:o=ak}=t,r=lk(()=>o&&"permissions"in o);let i;const a=typeof e=="string"?{name:e}:e,l=ae(),s=()=>{i&&(l.value=i.state)},u=_Se(async()=>{if(r.value){if(!i)try{i=await o.permissions.query(a),Fl(i,"change",s),s()}catch{l.value="prompt"}return i}});return u(),n?{state:l,isSupported:r,query:u}:l}function LSe(e={}){const{navigator:t=ak,read:n=!1,source:o,copiedDuring:r=1500,legacy:i=!1}=e,a=lk(()=>t&&"clipboard"in t),l=n3("clipboard-read"),s=n3("clipboard-write"),u=E(()=>a.value||i),c=ae(""),d=ae(!1),f=DSe(()=>d.value=!1,r);function p(){a.value&&b(l.value)?t.clipboard.readText().then(S=>{c.value=S}):c.value=m()}u.value&&n&&Fl(["copy","cut"],p);async function v(S=ql(o)){u.value&&S!=null&&(a.value&&b(s.value)?await t.clipboard.writeText(S):h(S),c.value=S,d.value=!0,f.start())}function h(S){const C=document.createElement("textarea");C.value=S??"",C.style.position="absolute",C.style.opacity="0",document.body.appendChild(C),C.select(),document.execCommand("copy"),C.remove()}function m(){var S,C,$;return($=(C=(S=document==null?void 0:document.getSelection)==null?void 0:S.call(document))==null?void 0:C.toString())!=null?$:""}function b(S){return S==="granted"||S==="prompt"}return{isSupported:u,text:c,copied:d,copy:v}}const Op=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ip="__vueuse_ssr_handlers__",FSe=BSe();function BSe(){return Ip in Op||(Op[Ip]=Op[Ip]||{}),Op[Ip]}function HSe(e,t){return FSe[e]||t}function zSe(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const jSe={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},o3="vueuse-storage";function WSe(e,t,n,o={}){var r;const{flush:i="pre",deep:a=!0,listenToStorageChanges:l=!0,writeDefaults:s=!0,mergeDefaults:u=!1,shallow:c,window:d=tf,eventFilter:f,onError:p=_=>{console.error(_)},initOnMounted:v}=o,h=(c?se:ae)(typeof t=="function"?t():t);if(!n)try{n=HSe("getDefaultStorage",()=>{var _;return(_=tf)==null?void 0:_.localStorage})()}catch(_){p(_)}if(!n)return h;const m=ql(t),b=zSe(m),S=(r=o.serializer)!=null?r:jSe[b],{pause:C,resume:$}=RSe(h,()=>P(h.value),{flush:i,deep:a,eventFilter:f});d&&l&&gs(()=>{Fl(d,"storage",O),Fl(d,o3,I),v&&O()}),v||O();function x(_,T){d&&d.dispatchEvent(new CustomEvent(o3,{detail:{key:e,oldValue:_,newValue:T,storageArea:n}}))}function P(_){try{const T=n.getItem(e);if(_==null)x(T,null),n.removeItem(e);else{const A=S.write(_);T!==A&&(n.setItem(e,A),x(T,A))}}catch(T){p(T)}}function w(_){const T=_?_.newValue:n.getItem(e);if(T==null)return s&&m!=null&&n.setItem(e,S.write(m)),m;if(!_&&u){const A=S.read(T);return typeof u=="function"?u(A,m):b==="object"&&!Array.isArray(A)?{...m,...A}:A}else return typeof T!="string"?T:S.read(T)}function O(_){if(!(_&&_.storageArea!==n)){if(_&&_.key==null){h.value=m;return}if(!(_&&_.key!==e)){C();try{(_==null?void 0:_.newValue)!==S.write(h.value)&&(h.value=w(_))}catch(T){p(T)}finally{_?ot($):$()}}}}function I(_){O(_.detail)}return h}function K$(e,t,n={}){const{window:o=tf}=n;return WSe(e,t,o==null?void 0:o.localStorage,n)}function Nh(e){"@babel/helpers - typeof";return Nh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nh(e)}var VSe=/^\s+/,KSe=/\s+$/;function ke(e,t){if(e=e||"",t=t||{},e instanceof ke)return e;if(!(this instanceof ke))return new ke(e,t);var n=USe(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}ke.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),n,o,r,i,a,l;return n=t.r/255,o=t.g/255,r=t.b/255,n<=.03928?i=n/12.92:i=Math.pow((n+.055)/1.055,2.4),o<=.03928?a=o/12.92:a=Math.pow((o+.055)/1.055,2.4),r<=.03928?l=r/12.92:l=Math.pow((r+.055)/1.055,2.4),.2126*i+.7152*a+.0722*l},setAlpha:function(t){return this._a=sk(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=i3(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=i3(this._r,this._g,this._b),n=Math.round(t.h*360),o=Math.round(t.s*100),r=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+o+"%, "+r+"%)":"hsva("+n+", "+o+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=r3(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=r3(this._r,this._g,this._b),n=Math.round(t.h*360),o=Math.round(t.s*100),r=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+o+"%, "+r+"%)":"hsla("+n+", "+o+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return a3(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return qSe(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Zt(this._r,255)*100)+"%",g:Math.round(Zt(this._g,255)*100)+"%",b:Math.round(Zt(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Zt(this._r,255)*100)+"%, "+Math.round(Zt(this._g,255)*100)+"%, "+Math.round(Zt(this._b,255)*100)+"%)":"rgba("+Math.round(Zt(this._r,255)*100)+"%, "+Math.round(Zt(this._g,255)*100)+"%, "+Math.round(Zt(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:sCe[a3(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+l3(this._r,this._g,this._b,this._a),o=n,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=ke(t);o="#"+l3(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+n+",endColorstr="+o+")"},toString:function(t){var n=!!t;t=t||this._format;var o=!1,r=this._a<1&&this._a>=0,i=!n&&r&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return i?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(o=this.toRgbString()),t==="prgb"&&(o=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(o=this.toHexString()),t==="hex3"&&(o=this.toHexString(!0)),t==="hex4"&&(o=this.toHex8String(!0)),t==="hex8"&&(o=this.toHex8String()),t==="name"&&(o=this.toName()),t==="hsl"&&(o=this.toHslString()),t==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},clone:function(){return ke(this.toString())},_applyModification:function(t,n){var o=t.apply(null,[this].concat([].slice.call(n)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function(){return this._applyModification(eCe,arguments)},brighten:function(){return this._applyModification(tCe,arguments)},darken:function(){return this._applyModification(nCe,arguments)},desaturate:function(){return this._applyModification(JSe,arguments)},saturate:function(){return this._applyModification(ZSe,arguments)},greyscale:function(){return this._applyModification(QSe,arguments)},spin:function(){return this._applyModification(oCe,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(aCe,arguments)},complement:function(){return this._applyCombination(rCe,arguments)},monochromatic:function(){return this._applyCombination(lCe,arguments)},splitcomplement:function(){return this._applyCombination(iCe,arguments)},triad:function(){return this._applyCombination(s3,[3])},tetrad:function(){return this._applyCombination(s3,[4])}};ke.fromRatio=function(e,t){if(Nh(e)=="object"){var n={};for(var o in e)e.hasOwnProperty(o)&&(o==="a"?n[o]=e[o]:n[o]=Bu(e[o]));e=n}return ke(e,t)};function USe(e){var t={r:0,g:0,b:0},n=1,o=null,r=null,i=null,a=!1,l=!1;return typeof e=="string"&&(e=fCe(e)),Nh(e)=="object"&&(Ti(e.r)&&Ti(e.g)&&Ti(e.b)?(t=GSe(e.r,e.g,e.b),a=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Ti(e.h)&&Ti(e.s)&&Ti(e.v)?(o=Bu(e.s),r=Bu(e.v),t=YSe(e.h,o,r),a=!0,l="hsv"):Ti(e.h)&&Ti(e.s)&&Ti(e.l)&&(o=Bu(e.s),i=Bu(e.l),t=XSe(e.h,o,i),a=!0,l="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=sk(n),{ok:a,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function GSe(e,t,n){return{r:Zt(e,255)*255,g:Zt(t,255)*255,b:Zt(n,255)*255}}function r3(e,t,n){e=Zt(e,255),t=Zt(t,255),n=Zt(n,255);var o=Math.max(e,t,n),r=Math.min(e,t,n),i,a,l=(o+r)/2;if(o==r)i=a=0;else{var s=o-r;switch(a=l>.5?s/(2-o-r):s/(o+r),o){case e:i=(t-n)/s+(t1&&(d-=1),d<1/6?u+(c-u)*6*d:d<1/2?c:d<2/3?u+(c-u)*(2/3-d)*6:u}if(t===0)o=r=i=n;else{var l=n<.5?n*(1+t):n+t-n*t,s=2*n-l;o=a(s,l,e+1/3),r=a(s,l,e),i=a(s,l,e-1/3)}return{r:o*255,g:r*255,b:i*255}}function i3(e,t,n){e=Zt(e,255),t=Zt(t,255),n=Zt(n,255);var o=Math.max(e,t,n),r=Math.min(e,t,n),i,a,l=o,s=o-r;if(a=o===0?0:s/o,o==r)i=0;else{switch(o){case e:i=(t-n)/s+(t>1)+720)%360;--t;)o.h=(o.h+r)%360,i.push(ke(o));return i}function lCe(e,t){t=t||6;for(var n=ke(e).toHsv(),o=n.h,r=n.s,i=n.v,a=[],l=1/t;t--;)a.push(ke({h:o,s:r,v:i})),i=(i+l)%1;return a}ke.mix=function(e,t,n){n=n===0?0:n||50;var o=ke(e).toRgb(),r=ke(t).toRgb(),i=n/100,a={r:(r.r-o.r)*i+o.r,g:(r.g-o.g)*i+o.g,b:(r.b-o.b)*i+o.b,a:(r.a-o.a)*i+o.a};return ke(a)};ke.readability=function(e,t){var n=ke(e),o=ke(t);return(Math.max(n.getLuminance(),o.getLuminance())+.05)/(Math.min(n.getLuminance(),o.getLuminance())+.05)};ke.isReadable=function(e,t,n){var o=ke.readability(e,t),r,i;switch(i=!1,r=pCe(n),r.level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7;break}return i};ke.mostReadable=function(e,t,n){var o=null,r=0,i,a,l,s;n=n||{},a=n.includeFallbackColors,l=n.level,s=n.size;for(var u=0;ur&&(r=i,o=ke(t[u]));return ke.isReadable(e,o,{level:l,size:s})||!a?o:(n.includeFallbackColors=!1,ke.mostReadable(e,["#fff","#000"],n))};var J1=ke.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},sCe=ke.hexNames=cCe(J1);function cCe(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function sk(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Zt(e,t){uCe(e)&&(e="100%");var n=dCe(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Nm(e){return Math.min(1,Math.max(0,e))}function Wo(e){return parseInt(e,16)}function uCe(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function dCe(e){return typeof e=="string"&&e.indexOf("%")!=-1}function kr(e){return e.length==1?"0"+e:""+e}function Bu(e){return e<=1&&(e=e*100+"%"),e}function ck(e){return Math.round(parseFloat(e)*255).toString(16)}function c3(e){return Wo(e)/255}var Ar=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",o="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+o),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+o),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+o),hsva:new RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Ti(e){return!!Ar.CSS_UNIT.exec(e)}function fCe(e){e=e.replace(VSe,"").replace(KSe,"").toLowerCase();var t=!1;if(J1[e])e=J1[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=Ar.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=Ar.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Ar.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=Ar.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Ar.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=Ar.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Ar.hex8.exec(e))?{r:Wo(n[1]),g:Wo(n[2]),b:Wo(n[3]),a:c3(n[4]),format:t?"name":"hex8"}:(n=Ar.hex6.exec(e))?{r:Wo(n[1]),g:Wo(n[2]),b:Wo(n[3]),format:t?"name":"hex"}:(n=Ar.hex4.exec(e))?{r:Wo(n[1]+""+n[1]),g:Wo(n[2]+""+n[2]),b:Wo(n[3]+""+n[3]),a:c3(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=Ar.hex3.exec(e))?{r:Wo(n[1]+""+n[1]),g:Wo(n[2]+""+n[2]),b:Wo(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function pCe(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}var hs=hs||{};hs.stringify=function(){var e={"visit_linear-gradient":function(t){return e.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return e.visit_gradient(t)},"visit_radial-gradient":function(t){return e.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return e.visit_gradient(t)},visit_gradient:function(t){var n=e.visit(t.orientation);return n&&(n+=", "),t.type+"("+n+e.visit(t.colorStops)+")"},visit_shape:function(t){var n=t.value,o=e.visit(t.at),r=e.visit(t.style);return r&&(n+=" "+r),o&&(n+=" at "+o),n},"visit_default-radial":function(t){var n="",o=e.visit(t.at);return o&&(n+=o),n},"visit_extent-keyword":function(t){var n=t.value,o=e.visit(t.at);return o&&(n+=" at "+o),n},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return e.visit(t.value.x)+" "+e.visit(t.value.y)},"visit_%":function(t){return t.value+"%"},visit_em:function(t){return t.value+"em"},visit_px:function(t){return t.value+"px"},visit_calc:function(t){return"calc("+t.value+")"},visit_literal:function(t){return e.visit_color(t.value,t)},visit_hex:function(t){return e.visit_color("#"+t.value,t)},visit_rgb:function(t){return e.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return e.visit_color("rgba("+t.value.join(", ")+")",t)},visit_hsl:function(t){return e.visit_color("hsl("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%)",t)},visit_hsla:function(t){return e.visit_color("hsla("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%, "+t.value[3]+")",t)},visit_var:function(t){return e.visit_color("var("+t.value+")",t)},visit_color:function(t,n){var o=t,r=e.visit(n.length);return r&&(o+=" "+r),o},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var n="",o=t.length;return t.forEach(function(r,i){n+=e.visit(r),i0&&n("Invalid input not EOF"),z}function r(){return C(i)}function i(){return a("linear-gradient",e.linearGradient,s)||a("repeating-linear-gradient",e.repeatingLinearGradient,s)||a("radial-gradient",e.radialGradient,d)||a("repeating-radial-gradient",e.repeatingRadialGradient,d)}function a(z,G,Q){return l(G,function(Y){var oe=Q();return oe&&(B(e.comma)||n("Missing comma before color stops")),{type:z,orientation:oe,colorStops:C($)}})}function l(z,G){var Q=B(z);if(Q){B(e.startCall)||n("Missing (");var Y=G(Q);return B(e.endCall)||n("Missing )"),Y}}function s(){var z=u();if(z)return z;var G=F("position-keyword",e.positionKeywords,1);return G?{type:"directional",value:G.value}:c()}function u(){return F("directional",e.sideOrCorner,1)}function c(){return F("angular",e.angleValue,1)||F("angular",e.radianValue,1)}function d(){var z,G=f(),Q;return G&&(z=[],z.push(G),Q=t,B(e.comma)&&(G=f(),G?z.push(G):t=Q)),z}function f(){var z=p()||v();if(z)z.at=m();else{var G=h();if(G){z=G;var Q=m();Q&&(z.at=Q)}else{var Y=m();if(Y)z={type:"default-radial",at:Y};else{var oe=b();oe&&(z={type:"default-radial",at:oe})}}}return z}function p(){var z=F("shape",/^(circle)/i,0);return z&&(z.style=L()||h()),z}function v(){var z=F("shape",/^(ellipse)/i,0);return z&&(z.style=b()||M()||h()),z}function h(){return F("extent-keyword",e.extentKeywords,1)}function m(){if(F("position",/^at/,0)){var z=b();return z||n("Missing positioning value"),z}}function b(){var z=S();if(z.x||z.y)return{type:"position",value:z}}function S(){return{x:M(),y:M()}}function C(z){var G=z(),Q=[];if(G)for(Q.push(G);B(e.comma);)G=z(),G?Q.push(G):n("One extra comma");return Q}function $(){var z=x();return z||n("Expected color definition"),z.length=M(),z}function x(){return w()||A()||T()||I()||O()||_()||P()}function P(){return F("literal",e.literalColor,0)}function w(){return F("hex",e.hexColor,1)}function O(){return l(e.rgbColor,function(){return{type:"rgb",value:C(H)}})}function I(){return l(e.rgbaColor,function(){return{type:"rgba",value:C(H)}})}function _(){return l(e.varColor,function(){return{type:"var",value:R()}})}function T(){return l(e.hslColor,function(){var z=B(e.percentageValue);z&&n("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");var G=H();B(e.comma);var Q=B(e.percentageValue),Y=Q?Q[1]:null;B(e.comma),Q=B(e.percentageValue);var oe=Q?Q[1]:null;return(!Y||!oe)&&n("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[G,Y,oe]}})}function A(){return l(e.hslaColor,function(){var z=H();B(e.comma);var G=B(e.percentageValue),Q=G?G[1]:null;B(e.comma),G=B(e.percentageValue);var Y=G?G[1]:null;B(e.comma);var oe=H();return(!Q||!Y)&&n("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[z,Q,Y,oe]}})}function R(){return B(e.variableName)[1]}function H(){return B(e.number)[1]}function M(){return F("%",e.percentageValue,1)||D()||N()||L()}function D(){return F("position-keyword",e.positionKeywords,1)}function N(){return l(e.calcValue,function(){for(var z=1,G=0;z>0&&G0&&n("Missing closing parenthesis in calc() expression");var Y=t.substring(0,G-1);return j(G-1),{type:"calc",value:Y}})}function L(){return F("px",e.pixelValue,1)||F("em",e.emValue,1)}function F(z,G,Q){var Y=B(G);if(Y)return{type:z,value:Y[Q]}}function B(z){var G,Q;return Q=/^[\n\r\t\s]+/.exec(t),Q&&j(Q[0].length),G=z.exec(t),G&&j(G[0].length),G}function j(z){t=t.substr(z)}return function(z){return t=z.toString().trim(),t.endsWith(";")&&(t=t.slice(0,-1)),o()}}();var gCe=hs.parse,hCe=hs.stringify,Do="top",xr="bottom",$r="right",No="left",U$="auto",Nf=[Do,xr,$r,No],Rc="start",nf="end",vCe="clippingParents",uk="viewport",Tu="popper",mCe="reference",u3=Nf.reduce(function(e,t){return e.concat([t+"-"+Rc,t+"-"+nf])},[]),dk=[].concat(Nf,[U$]).reduce(function(e,t){return e.concat([t,t+"-"+Rc,t+"-"+nf])},[]),bCe="beforeRead",yCe="read",SCe="afterRead",CCe="beforeMain",xCe="main",$Ce="afterMain",wCe="beforeWrite",PCe="write",OCe="afterWrite",ICe=[bCe,yCe,SCe,CCe,xCe,$Ce,wCe,PCe,OCe];function bi(e){return e?(e.nodeName||"").toLowerCase():null}function Zo(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Jl(e){var t=Zo(e).Element;return e instanceof t||e instanceof Element}function hr(e){var t=Zo(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function G$(e){if(typeof ShadowRoot>"u")return!1;var t=Zo(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function TCe(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var o=t.styles[n]||{},r=t.attributes[n]||{},i=t.elements[n];!hr(i)||!bi(i)||(Object.assign(i.style,o),Object.keys(r).forEach(function(a){var l=r[a];l===!1?i.removeAttribute(a):i.setAttribute(a,l===!0?"":l)}))})}function ECe(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(o){var r=t.elements[o],i=t.attributes[o]||{},a=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:n[o]),l=a.reduce(function(s,u){return s[u]="",s},{});!hr(r)||!bi(r)||(Object.assign(r.style,l),Object.keys(i).forEach(function(s){r.removeAttribute(s)}))})}}const _Ce={name:"applyStyles",enabled:!0,phase:"write",fn:TCe,effect:ECe,requires:["computeStyles"]};function pi(e){return e.split("-")[0]}var Bl=Math.max,kh=Math.min,Dc=Math.round;function Z1(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function fk(){return!/^((?!chrome|android).)*safari/i.test(Z1())}function Nc(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&hr(e)&&(r=e.offsetWidth>0&&Dc(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Dc(o.height)/e.offsetHeight||1);var a=Jl(e)?Zo(e):window,l=a.visualViewport,s=!fk()&&n,u=(o.left+(s&&l?l.offsetLeft:0))/r,c=(o.top+(s&&l?l.offsetTop:0))/i,d=o.width/r,f=o.height/i;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function X$(e){var t=Nc(e),n=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function pk(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&G$(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function Qi(e){return Zo(e).getComputedStyle(e)}function MCe(e){return["table","td","th"].indexOf(bi(e))>=0}function nl(e){return((Jl(e)?e.ownerDocument:e.document)||window.document).documentElement}function km(e){return bi(e)==="html"?e:e.assignedSlot||e.parentNode||(G$(e)?e.host:null)||nl(e)}function d3(e){return!hr(e)||Qi(e).position==="fixed"?null:e.offsetParent}function ACe(e){var t=/firefox/i.test(Z1()),n=/Trident/i.test(Z1());if(n&&hr(e)){var o=Qi(e);if(o.position==="fixed")return null}var r=km(e);for(G$(r)&&(r=r.host);hr(r)&&["html","body"].indexOf(bi(r))<0;){var i=Qi(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function kf(e){for(var t=Zo(e),n=d3(e);n&&MCe(n)&&Qi(n).position==="static";)n=d3(n);return n&&(bi(n)==="html"||bi(n)==="body"&&Qi(n).position==="static")?t:n||ACe(e)||t}function Y$(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function gd(e,t,n){return Bl(e,kh(t,n))}function RCe(e,t,n){var o=gd(e,t,n);return o>n?n:o}function gk(){return{top:0,right:0,bottom:0,left:0}}function hk(e){return Object.assign({},gk(),e)}function vk(e,t){return t.reduce(function(n,o){return n[o]=e,n},{})}var DCe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,hk(typeof t!="number"?t:vk(t,Nf))};function NCe(e){var t,n=e.state,o=e.name,r=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,l=pi(n.placement),s=Y$(l),u=[No,$r].indexOf(l)>=0,c=u?"height":"width";if(!(!i||!a)){var d=DCe(r.padding,n),f=X$(i),p=s==="y"?Do:No,v=s==="y"?xr:$r,h=n.rects.reference[c]+n.rects.reference[s]-a[s]-n.rects.popper[c],m=a[s]-n.rects.reference[s],b=kf(i),S=b?s==="y"?b.clientHeight||0:b.clientWidth||0:0,C=h/2-m/2,$=d[p],x=S-f[c]-d[v],P=S/2-f[c]/2+C,w=gd($,P,x),O=s;n.modifiersData[o]=(t={},t[O]=w,t.centerOffset=w-P,t)}}function kCe(e){var t=e.state,n=e.options,o=n.element,r=o===void 0?"[data-popper-arrow]":o;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||pk(t.elements.popper,r)&&(t.elements.arrow=r))}const LCe={name:"arrow",enabled:!0,phase:"main",fn:NCe,effect:kCe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function kc(e){return e.split("-")[1]}var FCe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function BCe(e,t){var n=e.x,o=e.y,r=t.devicePixelRatio||1;return{x:Dc(n*r)/r||0,y:Dc(o*r)/r||0}}function f3(e){var t,n=e.popper,o=e.popperRect,r=e.placement,i=e.variation,a=e.offsets,l=e.position,s=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=a.x,p=f===void 0?0:f,v=a.y,h=v===void 0?0:v,m=typeof c=="function"?c({x:p,y:h}):{x:p,y:h};p=m.x,h=m.y;var b=a.hasOwnProperty("x"),S=a.hasOwnProperty("y"),C=No,$=Do,x=window;if(u){var P=kf(n),w="clientHeight",O="clientWidth";if(P===Zo(n)&&(P=nl(n),Qi(P).position!=="static"&&l==="absolute"&&(w="scrollHeight",O="scrollWidth")),P=P,r===Do||(r===No||r===$r)&&i===nf){$=xr;var I=d&&P===x&&x.visualViewport?x.visualViewport.height:P[w];h-=I-o.height,h*=s?1:-1}if(r===No||(r===Do||r===xr)&&i===nf){C=$r;var _=d&&P===x&&x.visualViewport?x.visualViewport.width:P[O];p-=_-o.width,p*=s?1:-1}}var T=Object.assign({position:l},u&&FCe),A=c===!0?BCe({x:p,y:h},Zo(n)):{x:p,y:h};if(p=A.x,h=A.y,s){var R;return Object.assign({},T,(R={},R[$]=S?"0":"",R[C]=b?"0":"",R.transform=(x.devicePixelRatio||1)<=1?"translate("+p+"px, "+h+"px)":"translate3d("+p+"px, "+h+"px, 0)",R))}return Object.assign({},T,(t={},t[$]=S?h+"px":"",t[C]=b?p+"px":"",t.transform="",t))}function HCe(e){var t=e.state,n=e.options,o=n.gpuAcceleration,r=o===void 0?!0:o,i=n.adaptive,a=i===void 0?!0:i,l=n.roundOffsets,s=l===void 0?!0:l,u={placement:pi(t.placement),variation:kc(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,f3(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:s})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,f3(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const zCe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:HCe,data:{}};var Tp={passive:!0};function jCe(e){var t=e.state,n=e.instance,o=e.options,r=o.scroll,i=r===void 0?!0:r,a=o.resize,l=a===void 0?!0:a,s=Zo(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(c){c.addEventListener("scroll",n.update,Tp)}),l&&s.addEventListener("resize",n.update,Tp),function(){i&&u.forEach(function(c){c.removeEventListener("scroll",n.update,Tp)}),l&&s.removeEventListener("resize",n.update,Tp)}}const WCe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:jCe,data:{}};var VCe={left:"right",right:"left",bottom:"top",top:"bottom"};function $g(e){return e.replace(/left|right|bottom|top/g,function(t){return VCe[t]})}var KCe={start:"end",end:"start"};function p3(e){return e.replace(/start|end/g,function(t){return KCe[t]})}function q$(e){var t=Zo(e),n=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:n,scrollTop:o}}function J$(e){return Nc(nl(e)).left+q$(e).scrollLeft}function UCe(e,t){var n=Zo(e),o=nl(e),r=n.visualViewport,i=o.clientWidth,a=o.clientHeight,l=0,s=0;if(r){i=r.width,a=r.height;var u=fk();(u||!u&&t==="fixed")&&(l=r.offsetLeft,s=r.offsetTop)}return{width:i,height:a,x:l+J$(e),y:s}}function GCe(e){var t,n=nl(e),o=q$(e),r=(t=e.ownerDocument)==null?void 0:t.body,i=Bl(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Bl(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-o.scrollLeft+J$(e),s=-o.scrollTop;return Qi(r||n).direction==="rtl"&&(l+=Bl(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:l,y:s}}function Z$(e){var t=Qi(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function mk(e){return["html","body","#document"].indexOf(bi(e))>=0?e.ownerDocument.body:hr(e)&&Z$(e)?e:mk(km(e))}function hd(e,t){var n;t===void 0&&(t=[]);var o=mk(e),r=o===((n=e.ownerDocument)==null?void 0:n.body),i=Zo(o),a=r?[i].concat(i.visualViewport||[],Z$(o)?o:[]):o,l=t.concat(a);return r?l:l.concat(hd(km(a)))}function Q1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function XCe(e,t){var n=Nc(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function g3(e,t,n){return t===uk?Q1(UCe(e,n)):Jl(t)?XCe(t,n):Q1(GCe(nl(e)))}function YCe(e){var t=hd(km(e)),n=["absolute","fixed"].indexOf(Qi(e).position)>=0,o=n&&hr(e)?kf(e):e;return Jl(o)?t.filter(function(r){return Jl(r)&&pk(r,o)&&bi(r)!=="body"}):[]}function qCe(e,t,n,o){var r=t==="clippingParents"?YCe(e):[].concat(t),i=[].concat(r,[n]),a=i[0],l=i.reduce(function(s,u){var c=g3(e,u,o);return s.top=Bl(c.top,s.top),s.right=kh(c.right,s.right),s.bottom=kh(c.bottom,s.bottom),s.left=Bl(c.left,s.left),s},g3(e,a,o));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function bk(e){var t=e.reference,n=e.element,o=e.placement,r=o?pi(o):null,i=o?kc(o):null,a=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,s;switch(r){case Do:s={x:a,y:t.y-n.height};break;case xr:s={x:a,y:t.y+t.height};break;case $r:s={x:t.x+t.width,y:l};break;case No:s={x:t.x-n.width,y:l};break;default:s={x:t.x,y:t.y}}var u=r?Y$(r):null;if(u!=null){var c=u==="y"?"height":"width";switch(i){case Rc:s[u]=s[u]-(t[c]/2-n[c]/2);break;case nf:s[u]=s[u]+(t[c]/2-n[c]/2);break}}return s}function of(e,t){t===void 0&&(t={});var n=t,o=n.placement,r=o===void 0?e.placement:o,i=n.strategy,a=i===void 0?e.strategy:i,l=n.boundary,s=l===void 0?vCe:l,u=n.rootBoundary,c=u===void 0?uk:u,d=n.elementContext,f=d===void 0?Tu:d,p=n.altBoundary,v=p===void 0?!1:p,h=n.padding,m=h===void 0?0:h,b=hk(typeof m!="number"?m:vk(m,Nf)),S=f===Tu?mCe:Tu,C=e.rects.popper,$=e.elements[v?S:f],x=qCe(Jl($)?$:$.contextElement||nl(e.elements.popper),s,c,a),P=Nc(e.elements.reference),w=bk({reference:P,element:C,placement:r}),O=Q1(Object.assign({},C,w)),I=f===Tu?O:P,_={top:x.top-I.top+b.top,bottom:I.bottom-x.bottom+b.bottom,left:x.left-I.left+b.left,right:I.right-x.right+b.right},T=e.modifiersData.offset;if(f===Tu&&T){var A=T[r];Object.keys(_).forEach(function(R){var H=[$r,xr].indexOf(R)>=0?1:-1,M=[Do,xr].indexOf(R)>=0?"y":"x";_[R]+=A[M]*H})}return _}function JCe(e,t){t===void 0&&(t={});var n=t,o=n.placement,r=n.boundary,i=n.rootBoundary,a=n.padding,l=n.flipVariations,s=n.allowedAutoPlacements,u=s===void 0?dk:s,c=kc(o),d=c?l?u3:u3.filter(function(v){return kc(v)===c}):Nf,f=d.filter(function(v){return u.indexOf(v)>=0});f.length===0&&(f=d);var p=f.reduce(function(v,h){return v[h]=of(e,{placement:h,boundary:r,rootBoundary:i,padding:a})[pi(h)],v},{});return Object.keys(p).sort(function(v,h){return p[v]-p[h]})}function ZCe(e){if(pi(e)===U$)return[];var t=$g(e);return[p3(e),t,p3(t)]}function QCe(e){var t=e.state,n=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var r=n.mainAxis,i=r===void 0?!0:r,a=n.altAxis,l=a===void 0?!0:a,s=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,v=p===void 0?!0:p,h=n.allowedAutoPlacements,m=t.options.placement,b=pi(m),S=b===m,C=s||(S||!v?[$g(m)]:ZCe(m)),$=[m].concat(C).reduce(function(Q,Y){return Q.concat(pi(Y)===U$?JCe(t,{placement:Y,boundary:c,rootBoundary:d,padding:u,flipVariations:v,allowedAutoPlacements:h}):Y)},[]),x=t.rects.reference,P=t.rects.popper,w=new Map,O=!0,I=$[0],_=0;_<$.length;_++){var T=$[_],A=pi(T),R=kc(T)===Rc,H=[Do,xr].indexOf(A)>=0,M=H?"width":"height",D=of(t,{placement:T,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),N=H?R?$r:No:R?xr:Do;x[M]>P[M]&&(N=$g(N));var L=$g(N),F=[];if(i&&F.push(D[A]<=0),l&&F.push(D[N]<=0,D[L]<=0),F.every(function(Q){return Q})){I=T,O=!1;break}w.set(T,F)}if(O)for(var B=v?3:1,j=function(Y){var oe=$.find(function(Z){var re=w.get(Z);if(re)return re.slice(0,Y).every(function(ne){return ne})});if(oe)return I=oe,"break"},z=B;z>0;z--){var G=j(z);if(G==="break")break}t.placement!==I&&(t.modifiersData[o]._skip=!0,t.placement=I,t.reset=!0)}}const exe={name:"flip",enabled:!0,phase:"main",fn:QCe,requiresIfExists:["offset"],data:{_skip:!1}};function h3(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function v3(e){return[Do,$r,xr,No].some(function(t){return e[t]>=0})}function txe(e){var t=e.state,n=e.name,o=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,a=of(t,{elementContext:"reference"}),l=of(t,{altBoundary:!0}),s=h3(a,o),u=h3(l,r,i),c=v3(s),d=v3(u);t.modifiersData[n]={referenceClippingOffsets:s,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const nxe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:txe};function oxe(e,t,n){var o=pi(e),r=[No,Do].indexOf(o)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=i[0],l=i[1];return a=a||0,l=(l||0)*r,[No,$r].indexOf(o)>=0?{x:l,y:a}:{x:a,y:l}}function rxe(e){var t=e.state,n=e.options,o=e.name,r=n.offset,i=r===void 0?[0,0]:r,a=dk.reduce(function(c,d){return c[d]=oxe(d,t.rects,i),c},{}),l=a[t.placement],s=l.x,u=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=u),t.modifiersData[o]=a}const ixe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:rxe};function axe(e){var t=e.state,n=e.name;t.modifiersData[n]=bk({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const lxe={name:"popperOffsets",enabled:!0,phase:"read",fn:axe,data:{}};function sxe(e){return e==="x"?"y":"x"}function cxe(e){var t=e.state,n=e.options,o=e.name,r=n.mainAxis,i=r===void 0?!0:r,a=n.altAxis,l=a===void 0?!1:a,s=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,v=n.tetherOffset,h=v===void 0?0:v,m=of(t,{boundary:s,rootBoundary:u,padding:d,altBoundary:c}),b=pi(t.placement),S=kc(t.placement),C=!S,$=Y$(b),x=sxe($),P=t.modifiersData.popperOffsets,w=t.rects.reference,O=t.rects.popper,I=typeof h=="function"?h(Object.assign({},t.rects,{placement:t.placement})):h,_=typeof I=="number"?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,A={x:0,y:0};if(P){if(i){var R,H=$==="y"?Do:No,M=$==="y"?xr:$r,D=$==="y"?"height":"width",N=P[$],L=N+m[H],F=N-m[M],B=p?-O[D]/2:0,j=S===Rc?w[D]:O[D],z=S===Rc?-O[D]:-w[D],G=t.elements.arrow,Q=p&&G?X$(G):{width:0,height:0},Y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:gk(),oe=Y[H],Z=Y[M],re=gd(0,w[D],Q[D]),ne=C?w[D]/2-B-re-oe-_.mainAxis:j-re-oe-_.mainAxis,X=C?-w[D]/2+B+re+Z+_.mainAxis:z+re+Z+_.mainAxis,te=t.elements.arrow&&kf(t.elements.arrow),W=te?$==="y"?te.clientTop||0:te.clientLeft||0:0,U=(R=T==null?void 0:T[$])!=null?R:0,J=N+ne-U-W,de=N+X-U,fe=gd(p?kh(L,J):L,N,p?Bl(F,de):F);P[$]=fe,A[$]=fe-N}if(l){var pe,ve=$==="x"?Do:No,he=$==="x"?xr:$r,V=P[x],q=x==="y"?"height":"width",ie=V+m[ve],me=V-m[he],Se=[Do,No].indexOf(b)!==-1,ce=(pe=T==null?void 0:T[x])!=null?pe:0,ee=Se?ie:V-w[q]-O[q]-ce+_.altAxis,ue=Se?V+w[q]+O[q]-ce-_.altAxis:me,xe=p&&Se?RCe(ee,V,ue):gd(p?ee:ie,V,p?ue:me);P[x]=xe,A[x]=xe-V}t.modifiersData[o]=A}}const uxe={name:"preventOverflow",enabled:!0,phase:"main",fn:cxe,requiresIfExists:["offset"]};function dxe(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function fxe(e){return e===Zo(e)||!hr(e)?q$(e):dxe(e)}function pxe(e){var t=e.getBoundingClientRect(),n=Dc(t.width)/e.offsetWidth||1,o=Dc(t.height)/e.offsetHeight||1;return n!==1||o!==1}function gxe(e,t,n){n===void 0&&(n=!1);var o=hr(t),r=hr(t)&&pxe(t),i=nl(t),a=Nc(e,r,n),l={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(o||!o&&!n)&&((bi(t)!=="body"||Z$(i))&&(l=fxe(t)),hr(t)?(s=Nc(t,!0),s.x+=t.clientLeft,s.y+=t.clientTop):i&&(s.x=J$(i))),{x:a.left+l.scrollLeft-s.x,y:a.top+l.scrollTop-s.y,width:a.width,height:a.height}}function hxe(e){var t=new Map,n=new Set,o=[];e.forEach(function(i){t.set(i.name,i)});function r(i){n.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(l){if(!n.has(l)){var s=t.get(l);s&&r(s)}}),o.push(i)}return e.forEach(function(i){n.has(i.name)||r(i)}),o}function vxe(e){var t=hxe(e);return ICe.reduce(function(n,o){return n.concat(t.filter(function(r){return r.phase===o}))},[])}function mxe(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function bxe(e){var t=e.reduce(function(n,o){var r=n[o.name];return n[o.name]=r?Object.assign({},r,o,{options:Object.assign({},r.options,o.options),data:Object.assign({},r.data,o.data)}):o,n},{});return Object.keys(t).map(function(n){return t[n]})}var m3={placement:"bottom",modifiers:[],strategy:"absolute"};function b3(){for(var e=arguments.length,t=new Array(e),n=0;n{localStorage.setItem(ek,e),nk.global.locale.value=e,tk.locale=e,console.log(`Successfully switched frontend language to: ${e}`)},lOe=async e=>{await $Se(e);try{const t=await fetch(`/admin/prompts/switch-language?language=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}});if(t.ok)console.log(`Successfully reset prompts to language: ${e}`);else{const o=await t.text();console.error(`Failed to reset prompts to language: ${e}`,o)}const n=await fetch("/api/agent-management/initialize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({language:e})});if(n.ok){const o=await n.json();console.log(`Successfully initialized agents with language: ${e}`,o)}else{const o=await n.json();throw console.error(`Failed to initialize agents with language: ${e}`,o),new Error(o.error||"Failed to initialize agents")}}catch(t){throw console.error("Error initializing agents and prompts during language change:",t),t}};function ok(e){return Qh()?(pS(e),!0):!1}function ql(e){return typeof e=="function"?e():Bt(e)}const Dm=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const wSe=Object.prototype.toString,PSe=e=>wSe.call(e)==="[object Object]",fc=()=>{},OSe=ISe();function ISe(){var e,t;return Dm&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function rk(e,t){function n(...o){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(r).catch(i)})}return n}const ik=e=>e();function TSe(e,t={}){let n,o,r=fc;const i=l=>{clearTimeout(l),r(),r=fc};return l=>{const s=ql(e),u=ql(t.maxWait);return n&&i(n),s<=0||u!==void 0&&u<=0?(o&&(i(o),o=null),Promise.resolve(l())):new Promise((c,d)=>{r=t.rejectOnCancel?d:c,u&&!o&&(o=setTimeout(()=>{n&&i(n),o=null,c(l())},u)),n=setTimeout(()=>{o&&i(o),o=null,c(l())},s)})}}function ESe(e=ik){const t=ae(!0);function n(){t.value=!1}function o(){t.value=!0}const r=(...i)=>{t.value&&e(...i)};return{isActive:tv(t),pause:n,resume:o,eventFilter:r}}function _Se(e){let t;function n(){return t||(t=e()),t}return n.reset=async()=>{const o=t;t=void 0,o&&await o},n}function MSe(e){return Jt()}function Ui(e,t=200,n={}){return rk(TSe(t,n),e)}function ASe(e,t,n={}){const{eventFilter:o=ik,...r}=n;return be(e,rk(o,t),r)}function RSe(e,t,n={}){const{eventFilter:o,...r}=n,{eventFilter:i,pause:a,resume:l,isActive:s}=ESe(o);return{stop:ASe(e,t,{...r,eventFilter:i}),pause:a,resume:l,isActive:s}}function gs(e,t=!0,n){MSe()?Ke(e,n):t?e():ot(e)}function DSe(e,t,n={}){const{immediate:o=!0}=n,r=ae(!1);let i=null;function a(){i&&(clearTimeout(i),i=null)}function l(){r.value=!1,a()}function s(...u){a(),r.value=!0,i=setTimeout(()=>{r.value=!1,i=null,e(...u)},ql(t))}return o&&(r.value=!0,Dm&&s()),ok(l),{isPending:tv(r),start:s,stop:l}}function io(e,t,n){const o=be(e,(r,i,a)=>{r&&(n!=null&&n.once&&ot(()=>o()),t(r,i,a))},{...n,once:!1});return o}function Fu(e){var t;const n=ql(e);return(t=n==null?void 0:n.$el)!=null?t:n}const tf=Dm?window:void 0,ak=Dm?window.navigator:void 0;function Fl(...e){let t,n,o,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,r]=e,t=tf):[t,n,o,r]=e,!t)return fc;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],a=()=>{i.forEach(c=>c()),i.length=0},l=(c,d,f,p)=>(c.addEventListener(d,f,p),()=>c.removeEventListener(d,f,p)),s=be(()=>[Fu(t),ql(r)],([c,d])=>{if(a(),!c)return;const f=PSe(d)?{...d}:d;i.push(...n.flatMap(p=>o.map(v=>l(c,p,v,f))))},{immediate:!0,flush:"post"}),u=()=>{s(),a()};return ok(u),u}let t3=!1;function NSe(e,t,n={}){const{window:o=tf,ignore:r=[],capture:i=!0,detectIframe:a=!1}=n;if(!o)return fc;OSe&&!t3&&(t3=!0,Array.from(o.document.body.children).forEach(f=>f.addEventListener("click",fc)),o.document.documentElement.addEventListener("click",fc));let l=!0;const s=f=>r.some(p=>{if(typeof p=="string")return Array.from(o.document.querySelectorAll(p)).some(v=>v===f.target||f.composedPath().includes(v));{const v=Fu(p);return v&&(f.target===v||f.composedPath().includes(v))}}),c=[Fl(o,"click",f=>{const p=Fu(e);if(!(!p||p===f.target||f.composedPath().includes(p))){if(f.detail===0&&(l=!s(f)),!l){l=!0;return}t(f)}},{passive:!0,capture:i}),Fl(o,"pointerdown",f=>{const p=Fu(e);l=!s(f)&&!!(p&&!f.composedPath().includes(p))},{passive:!0}),a&&Fl(o,"blur",f=>{setTimeout(()=>{var p;const v=Fu(e);((p=o.document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(v!=null&&v.contains(o.document.activeElement))&&t(f)},0)})].filter(Boolean);return()=>c.forEach(f=>f())}function kSe(){const e=ae(!1),t=Jt();return t&&Ke(()=>{e.value=!0},t),e}function lk(e){const t=kSe();return E(()=>(t.value,!!e()))}function n3(e,t={}){const{controls:n=!1,navigator:o=ak}=t,r=lk(()=>o&&"permissions"in o);let i;const a=typeof e=="string"?{name:e}:e,l=ae(),s=()=>{i&&(l.value=i.state)},u=_Se(async()=>{if(r.value){if(!i)try{i=await o.permissions.query(a),Fl(i,"change",s),s()}catch{l.value="prompt"}return i}});return u(),n?{state:l,isSupported:r,query:u}:l}function LSe(e={}){const{navigator:t=ak,read:n=!1,source:o,copiedDuring:r=1500,legacy:i=!1}=e,a=lk(()=>t&&"clipboard"in t),l=n3("clipboard-read"),s=n3("clipboard-write"),u=E(()=>a.value||i),c=ae(""),d=ae(!1),f=DSe(()=>d.value=!1,r);function p(){a.value&&b(l.value)?t.clipboard.readText().then(S=>{c.value=S}):c.value=m()}u.value&&n&&Fl(["copy","cut"],p);async function v(S=ql(o)){u.value&&S!=null&&(a.value&&b(s.value)?await t.clipboard.writeText(S):h(S),c.value=S,d.value=!0,f.start())}function h(S){const C=document.createElement("textarea");C.value=S??"",C.style.position="absolute",C.style.opacity="0",document.body.appendChild(C),C.select(),document.execCommand("copy"),C.remove()}function m(){var S,C,$;return($=(C=(S=document==null?void 0:document.getSelection)==null?void 0:S.call(document))==null?void 0:C.toString())!=null?$:""}function b(S){return S==="granted"||S==="prompt"}return{isSupported:u,text:c,copied:d,copy:v}}const Op=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ip="__vueuse_ssr_handlers__",FSe=BSe();function BSe(){return Ip in Op||(Op[Ip]=Op[Ip]||{}),Op[Ip]}function HSe(e,t){return FSe[e]||t}function zSe(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const jSe={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},o3="vueuse-storage";function WSe(e,t,n,o={}){var r;const{flush:i="pre",deep:a=!0,listenToStorageChanges:l=!0,writeDefaults:s=!0,mergeDefaults:u=!1,shallow:c,window:d=tf,eventFilter:f,onError:p=_=>{console.error(_)},initOnMounted:v}=o,h=(c?se:ae)(typeof t=="function"?t():t);if(!n)try{n=HSe("getDefaultStorage",()=>{var _;return(_=tf)==null?void 0:_.localStorage})()}catch(_){p(_)}if(!n)return h;const m=ql(t),b=zSe(m),S=(r=o.serializer)!=null?r:jSe[b],{pause:C,resume:$}=RSe(h,()=>P(h.value),{flush:i,deep:a,eventFilter:f});d&&l&&gs(()=>{Fl(d,"storage",O),Fl(d,o3,I),v&&O()}),v||O();function x(_,T){d&&d.dispatchEvent(new CustomEvent(o3,{detail:{key:e,oldValue:_,newValue:T,storageArea:n}}))}function P(_){try{const T=n.getItem(e);if(_==null)x(T,null),n.removeItem(e);else{const A=S.write(_);T!==A&&(n.setItem(e,A),x(T,A))}}catch(T){p(T)}}function w(_){const T=_?_.newValue:n.getItem(e);if(T==null)return s&&m!=null&&n.setItem(e,S.write(m)),m;if(!_&&u){const A=S.read(T);return typeof u=="function"?u(A,m):b==="object"&&!Array.isArray(A)?{...m,...A}:A}else return typeof T!="string"?T:S.read(T)}function O(_){if(!(_&&_.storageArea!==n)){if(_&&_.key==null){h.value=m;return}if(!(_&&_.key!==e)){C();try{(_==null?void 0:_.newValue)!==S.write(h.value)&&(h.value=w(_))}catch(T){p(T)}finally{_?ot($):$()}}}}function I(_){O(_.detail)}return h}function K$(e,t,n={}){const{window:o=tf}=n;return WSe(e,t,o==null?void 0:o.localStorage,n)}function Nh(e){"@babel/helpers - typeof";return Nh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nh(e)}var VSe=/^\s+/,KSe=/\s+$/;function ke(e,t){if(e=e||"",t=t||{},e instanceof ke)return e;if(!(this instanceof ke))return new ke(e,t);var n=USe(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}ke.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),n,o,r,i,a,l;return n=t.r/255,o=t.g/255,r=t.b/255,n<=.03928?i=n/12.92:i=Math.pow((n+.055)/1.055,2.4),o<=.03928?a=o/12.92:a=Math.pow((o+.055)/1.055,2.4),r<=.03928?l=r/12.92:l=Math.pow((r+.055)/1.055,2.4),.2126*i+.7152*a+.0722*l},setAlpha:function(t){return this._a=sk(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=i3(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=i3(this._r,this._g,this._b),n=Math.round(t.h*360),o=Math.round(t.s*100),r=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+o+"%, "+r+"%)":"hsva("+n+", "+o+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=r3(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=r3(this._r,this._g,this._b),n=Math.round(t.h*360),o=Math.round(t.s*100),r=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+o+"%, "+r+"%)":"hsla("+n+", "+o+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return a3(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return qSe(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Zt(this._r,255)*100)+"%",g:Math.round(Zt(this._g,255)*100)+"%",b:Math.round(Zt(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Zt(this._r,255)*100)+"%, "+Math.round(Zt(this._g,255)*100)+"%, "+Math.round(Zt(this._b,255)*100)+"%)":"rgba("+Math.round(Zt(this._r,255)*100)+"%, "+Math.round(Zt(this._g,255)*100)+"%, "+Math.round(Zt(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:sCe[a3(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+l3(this._r,this._g,this._b,this._a),o=n,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=ke(t);o="#"+l3(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+n+",endColorstr="+o+")"},toString:function(t){var n=!!t;t=t||this._format;var o=!1,r=this._a<1&&this._a>=0,i=!n&&r&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return i?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(o=this.toRgbString()),t==="prgb"&&(o=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(o=this.toHexString()),t==="hex3"&&(o=this.toHexString(!0)),t==="hex4"&&(o=this.toHex8String(!0)),t==="hex8"&&(o=this.toHex8String()),t==="name"&&(o=this.toName()),t==="hsl"&&(o=this.toHslString()),t==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},clone:function(){return ke(this.toString())},_applyModification:function(t,n){var o=t.apply(null,[this].concat([].slice.call(n)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function(){return this._applyModification(eCe,arguments)},brighten:function(){return this._applyModification(tCe,arguments)},darken:function(){return this._applyModification(nCe,arguments)},desaturate:function(){return this._applyModification(JSe,arguments)},saturate:function(){return this._applyModification(ZSe,arguments)},greyscale:function(){return this._applyModification(QSe,arguments)},spin:function(){return this._applyModification(oCe,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(aCe,arguments)},complement:function(){return this._applyCombination(rCe,arguments)},monochromatic:function(){return this._applyCombination(lCe,arguments)},splitcomplement:function(){return this._applyCombination(iCe,arguments)},triad:function(){return this._applyCombination(s3,[3])},tetrad:function(){return this._applyCombination(s3,[4])}};ke.fromRatio=function(e,t){if(Nh(e)=="object"){var n={};for(var o in e)e.hasOwnProperty(o)&&(o==="a"?n[o]=e[o]:n[o]=Bu(e[o]));e=n}return ke(e,t)};function USe(e){var t={r:0,g:0,b:0},n=1,o=null,r=null,i=null,a=!1,l=!1;return typeof e=="string"&&(e=fCe(e)),Nh(e)=="object"&&(Ti(e.r)&&Ti(e.g)&&Ti(e.b)?(t=GSe(e.r,e.g,e.b),a=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Ti(e.h)&&Ti(e.s)&&Ti(e.v)?(o=Bu(e.s),r=Bu(e.v),t=YSe(e.h,o,r),a=!0,l="hsv"):Ti(e.h)&&Ti(e.s)&&Ti(e.l)&&(o=Bu(e.s),i=Bu(e.l),t=XSe(e.h,o,i),a=!0,l="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=sk(n),{ok:a,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function GSe(e,t,n){return{r:Zt(e,255)*255,g:Zt(t,255)*255,b:Zt(n,255)*255}}function r3(e,t,n){e=Zt(e,255),t=Zt(t,255),n=Zt(n,255);var o=Math.max(e,t,n),r=Math.min(e,t,n),i,a,l=(o+r)/2;if(o==r)i=a=0;else{var s=o-r;switch(a=l>.5?s/(2-o-r):s/(o+r),o){case e:i=(t-n)/s+(t1&&(d-=1),d<1/6?u+(c-u)*6*d:d<1/2?c:d<2/3?u+(c-u)*(2/3-d)*6:u}if(t===0)o=r=i=n;else{var l=n<.5?n*(1+t):n+t-n*t,s=2*n-l;o=a(s,l,e+1/3),r=a(s,l,e),i=a(s,l,e-1/3)}return{r:o*255,g:r*255,b:i*255}}function i3(e,t,n){e=Zt(e,255),t=Zt(t,255),n=Zt(n,255);var o=Math.max(e,t,n),r=Math.min(e,t,n),i,a,l=o,s=o-r;if(a=o===0?0:s/o,o==r)i=0;else{switch(o){case e:i=(t-n)/s+(t>1)+720)%360;--t;)o.h=(o.h+r)%360,i.push(ke(o));return i}function lCe(e,t){t=t||6;for(var n=ke(e).toHsv(),o=n.h,r=n.s,i=n.v,a=[],l=1/t;t--;)a.push(ke({h:o,s:r,v:i})),i=(i+l)%1;return a}ke.mix=function(e,t,n){n=n===0?0:n||50;var o=ke(e).toRgb(),r=ke(t).toRgb(),i=n/100,a={r:(r.r-o.r)*i+o.r,g:(r.g-o.g)*i+o.g,b:(r.b-o.b)*i+o.b,a:(r.a-o.a)*i+o.a};return ke(a)};ke.readability=function(e,t){var n=ke(e),o=ke(t);return(Math.max(n.getLuminance(),o.getLuminance())+.05)/(Math.min(n.getLuminance(),o.getLuminance())+.05)};ke.isReadable=function(e,t,n){var o=ke.readability(e,t),r,i;switch(i=!1,r=pCe(n),r.level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7;break}return i};ke.mostReadable=function(e,t,n){var o=null,r=0,i,a,l,s;n=n||{},a=n.includeFallbackColors,l=n.level,s=n.size;for(var u=0;ur&&(r=i,o=ke(t[u]));return ke.isReadable(e,o,{level:l,size:s})||!a?o:(n.includeFallbackColors=!1,ke.mostReadable(e,["#fff","#000"],n))};var J1=ke.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},sCe=ke.hexNames=cCe(J1);function cCe(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function sk(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Zt(e,t){uCe(e)&&(e="100%");var n=dCe(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Nm(e){return Math.min(1,Math.max(0,e))}function Wo(e){return parseInt(e,16)}function uCe(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function dCe(e){return typeof e=="string"&&e.indexOf("%")!=-1}function kr(e){return e.length==1?"0"+e:""+e}function Bu(e){return e<=1&&(e=e*100+"%"),e}function ck(e){return Math.round(parseFloat(e)*255).toString(16)}function c3(e){return Wo(e)/255}var Ar=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",o="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+o),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+o),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+o),hsva:new RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Ti(e){return!!Ar.CSS_UNIT.exec(e)}function fCe(e){e=e.replace(VSe,"").replace(KSe,"").toLowerCase();var t=!1;if(J1[e])e=J1[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=Ar.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=Ar.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Ar.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=Ar.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Ar.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=Ar.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Ar.hex8.exec(e))?{r:Wo(n[1]),g:Wo(n[2]),b:Wo(n[3]),a:c3(n[4]),format:t?"name":"hex8"}:(n=Ar.hex6.exec(e))?{r:Wo(n[1]),g:Wo(n[2]),b:Wo(n[3]),format:t?"name":"hex"}:(n=Ar.hex4.exec(e))?{r:Wo(n[1]+""+n[1]),g:Wo(n[2]+""+n[2]),b:Wo(n[3]+""+n[3]),a:c3(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=Ar.hex3.exec(e))?{r:Wo(n[1]+""+n[1]),g:Wo(n[2]+""+n[2]),b:Wo(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function pCe(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}var hs=hs||{};hs.stringify=function(){var e={"visit_linear-gradient":function(t){return e.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return e.visit_gradient(t)},"visit_radial-gradient":function(t){return e.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return e.visit_gradient(t)},visit_gradient:function(t){var n=e.visit(t.orientation);return n&&(n+=", "),t.type+"("+n+e.visit(t.colorStops)+")"},visit_shape:function(t){var n=t.value,o=e.visit(t.at),r=e.visit(t.style);return r&&(n+=" "+r),o&&(n+=" at "+o),n},"visit_default-radial":function(t){var n="",o=e.visit(t.at);return o&&(n+=o),n},"visit_extent-keyword":function(t){var n=t.value,o=e.visit(t.at);return o&&(n+=" at "+o),n},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return e.visit(t.value.x)+" "+e.visit(t.value.y)},"visit_%":function(t){return t.value+"%"},visit_em:function(t){return t.value+"em"},visit_px:function(t){return t.value+"px"},visit_calc:function(t){return"calc("+t.value+")"},visit_literal:function(t){return e.visit_color(t.value,t)},visit_hex:function(t){return e.visit_color("#"+t.value,t)},visit_rgb:function(t){return e.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return e.visit_color("rgba("+t.value.join(", ")+")",t)},visit_hsl:function(t){return e.visit_color("hsl("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%)",t)},visit_hsla:function(t){return e.visit_color("hsla("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%, "+t.value[3]+")",t)},visit_var:function(t){return e.visit_color("var("+t.value+")",t)},visit_color:function(t,n){var o=t,r=e.visit(n.length);return r&&(o+=" "+r),o},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var n="",o=t.length;return t.forEach(function(r,i){n+=e.visit(r),i0&&n("Invalid input not EOF"),z}function r(){return C(i)}function i(){return a("linear-gradient",e.linearGradient,s)||a("repeating-linear-gradient",e.repeatingLinearGradient,s)||a("radial-gradient",e.radialGradient,d)||a("repeating-radial-gradient",e.repeatingRadialGradient,d)}function a(z,G,Q){return l(G,function(Y){var oe=Q();return oe&&(B(e.comma)||n("Missing comma before color stops")),{type:z,orientation:oe,colorStops:C($)}})}function l(z,G){var Q=B(z);if(Q){B(e.startCall)||n("Missing (");var Y=G(Q);return B(e.endCall)||n("Missing )"),Y}}function s(){var z=u();if(z)return z;var G=F("position-keyword",e.positionKeywords,1);return G?{type:"directional",value:G.value}:c()}function u(){return F("directional",e.sideOrCorner,1)}function c(){return F("angular",e.angleValue,1)||F("angular",e.radianValue,1)}function d(){var z,G=f(),Q;return G&&(z=[],z.push(G),Q=t,B(e.comma)&&(G=f(),G?z.push(G):t=Q)),z}function f(){var z=p()||v();if(z)z.at=m();else{var G=h();if(G){z=G;var Q=m();Q&&(z.at=Q)}else{var Y=m();if(Y)z={type:"default-radial",at:Y};else{var oe=b();oe&&(z={type:"default-radial",at:oe})}}}return z}function p(){var z=F("shape",/^(circle)/i,0);return z&&(z.style=L()||h()),z}function v(){var z=F("shape",/^(ellipse)/i,0);return z&&(z.style=b()||M()||h()),z}function h(){return F("extent-keyword",e.extentKeywords,1)}function m(){if(F("position",/^at/,0)){var z=b();return z||n("Missing positioning value"),z}}function b(){var z=S();if(z.x||z.y)return{type:"position",value:z}}function S(){return{x:M(),y:M()}}function C(z){var G=z(),Q=[];if(G)for(Q.push(G);B(e.comma);)G=z(),G?Q.push(G):n("One extra comma");return Q}function $(){var z=x();return z||n("Expected color definition"),z.length=M(),z}function x(){return w()||A()||T()||I()||O()||_()||P()}function P(){return F("literal",e.literalColor,0)}function w(){return F("hex",e.hexColor,1)}function O(){return l(e.rgbColor,function(){return{type:"rgb",value:C(H)}})}function I(){return l(e.rgbaColor,function(){return{type:"rgba",value:C(H)}})}function _(){return l(e.varColor,function(){return{type:"var",value:R()}})}function T(){return l(e.hslColor,function(){var z=B(e.percentageValue);z&&n("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");var G=H();B(e.comma);var Q=B(e.percentageValue),Y=Q?Q[1]:null;B(e.comma),Q=B(e.percentageValue);var oe=Q?Q[1]:null;return(!Y||!oe)&&n("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[G,Y,oe]}})}function A(){return l(e.hslaColor,function(){var z=H();B(e.comma);var G=B(e.percentageValue),Q=G?G[1]:null;B(e.comma),G=B(e.percentageValue);var Y=G?G[1]:null;B(e.comma);var oe=H();return(!Q||!Y)&&n("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[z,Q,Y,oe]}})}function R(){return B(e.variableName)[1]}function H(){return B(e.number)[1]}function M(){return F("%",e.percentageValue,1)||D()||N()||L()}function D(){return F("position-keyword",e.positionKeywords,1)}function N(){return l(e.calcValue,function(){for(var z=1,G=0;z>0&&G0&&n("Missing closing parenthesis in calc() expression");var Y=t.substring(0,G-1);return j(G-1),{type:"calc",value:Y}})}function L(){return F("px",e.pixelValue,1)||F("em",e.emValue,1)}function F(z,G,Q){var Y=B(G);if(Y)return{type:z,value:Y[Q]}}function B(z){var G,Q;return Q=/^[\n\r\t\s]+/.exec(t),Q&&j(Q[0].length),G=z.exec(t),G&&j(G[0].length),G}function j(z){t=t.substr(z)}return function(z){return t=z.toString().trim(),t.endsWith(";")&&(t=t.slice(0,-1)),o()}}();var gCe=hs.parse,hCe=hs.stringify,Do="top",xr="bottom",$r="right",No="left",U$="auto",Nf=[Do,xr,$r,No],Rc="start",nf="end",vCe="clippingParents",uk="viewport",Tu="popper",mCe="reference",u3=Nf.reduce(function(e,t){return e.concat([t+"-"+Rc,t+"-"+nf])},[]),dk=[].concat(Nf,[U$]).reduce(function(e,t){return e.concat([t,t+"-"+Rc,t+"-"+nf])},[]),bCe="beforeRead",yCe="read",SCe="afterRead",CCe="beforeMain",xCe="main",$Ce="afterMain",wCe="beforeWrite",PCe="write",OCe="afterWrite",ICe=[bCe,yCe,SCe,CCe,xCe,$Ce,wCe,PCe,OCe];function bi(e){return e?(e.nodeName||"").toLowerCase():null}function Zo(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Jl(e){var t=Zo(e).Element;return e instanceof t||e instanceof Element}function hr(e){var t=Zo(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function G$(e){if(typeof ShadowRoot>"u")return!1;var t=Zo(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function TCe(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var o=t.styles[n]||{},r=t.attributes[n]||{},i=t.elements[n];!hr(i)||!bi(i)||(Object.assign(i.style,o),Object.keys(r).forEach(function(a){var l=r[a];l===!1?i.removeAttribute(a):i.setAttribute(a,l===!0?"":l)}))})}function ECe(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(o){var r=t.elements[o],i=t.attributes[o]||{},a=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:n[o]),l=a.reduce(function(s,u){return s[u]="",s},{});!hr(r)||!bi(r)||(Object.assign(r.style,l),Object.keys(i).forEach(function(s){r.removeAttribute(s)}))})}}const _Ce={name:"applyStyles",enabled:!0,phase:"write",fn:TCe,effect:ECe,requires:["computeStyles"]};function pi(e){return e.split("-")[0]}var Bl=Math.max,kh=Math.min,Dc=Math.round;function Z1(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function fk(){return!/^((?!chrome|android).)*safari/i.test(Z1())}function Nc(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&hr(e)&&(r=e.offsetWidth>0&&Dc(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Dc(o.height)/e.offsetHeight||1);var a=Jl(e)?Zo(e):window,l=a.visualViewport,s=!fk()&&n,u=(o.left+(s&&l?l.offsetLeft:0))/r,c=(o.top+(s&&l?l.offsetTop:0))/i,d=o.width/r,f=o.height/i;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function X$(e){var t=Nc(e),n=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function pk(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&G$(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function Qi(e){return Zo(e).getComputedStyle(e)}function MCe(e){return["table","td","th"].indexOf(bi(e))>=0}function nl(e){return((Jl(e)?e.ownerDocument:e.document)||window.document).documentElement}function km(e){return bi(e)==="html"?e:e.assignedSlot||e.parentNode||(G$(e)?e.host:null)||nl(e)}function d3(e){return!hr(e)||Qi(e).position==="fixed"?null:e.offsetParent}function ACe(e){var t=/firefox/i.test(Z1()),n=/Trident/i.test(Z1());if(n&&hr(e)){var o=Qi(e);if(o.position==="fixed")return null}var r=km(e);for(G$(r)&&(r=r.host);hr(r)&&["html","body"].indexOf(bi(r))<0;){var i=Qi(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function kf(e){for(var t=Zo(e),n=d3(e);n&&MCe(n)&&Qi(n).position==="static";)n=d3(n);return n&&(bi(n)==="html"||bi(n)==="body"&&Qi(n).position==="static")?t:n||ACe(e)||t}function Y$(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function gd(e,t,n){return Bl(e,kh(t,n))}function RCe(e,t,n){var o=gd(e,t,n);return o>n?n:o}function gk(){return{top:0,right:0,bottom:0,left:0}}function hk(e){return Object.assign({},gk(),e)}function vk(e,t){return t.reduce(function(n,o){return n[o]=e,n},{})}var DCe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,hk(typeof t!="number"?t:vk(t,Nf))};function NCe(e){var t,n=e.state,o=e.name,r=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,l=pi(n.placement),s=Y$(l),u=[No,$r].indexOf(l)>=0,c=u?"height":"width";if(!(!i||!a)){var d=DCe(r.padding,n),f=X$(i),p=s==="y"?Do:No,v=s==="y"?xr:$r,h=n.rects.reference[c]+n.rects.reference[s]-a[s]-n.rects.popper[c],m=a[s]-n.rects.reference[s],b=kf(i),S=b?s==="y"?b.clientHeight||0:b.clientWidth||0:0,C=h/2-m/2,$=d[p],x=S-f[c]-d[v],P=S/2-f[c]/2+C,w=gd($,P,x),O=s;n.modifiersData[o]=(t={},t[O]=w,t.centerOffset=w-P,t)}}function kCe(e){var t=e.state,n=e.options,o=n.element,r=o===void 0?"[data-popper-arrow]":o;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||pk(t.elements.popper,r)&&(t.elements.arrow=r))}const LCe={name:"arrow",enabled:!0,phase:"main",fn:NCe,effect:kCe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function kc(e){return e.split("-")[1]}var FCe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function BCe(e,t){var n=e.x,o=e.y,r=t.devicePixelRatio||1;return{x:Dc(n*r)/r||0,y:Dc(o*r)/r||0}}function f3(e){var t,n=e.popper,o=e.popperRect,r=e.placement,i=e.variation,a=e.offsets,l=e.position,s=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=a.x,p=f===void 0?0:f,v=a.y,h=v===void 0?0:v,m=typeof c=="function"?c({x:p,y:h}):{x:p,y:h};p=m.x,h=m.y;var b=a.hasOwnProperty("x"),S=a.hasOwnProperty("y"),C=No,$=Do,x=window;if(u){var P=kf(n),w="clientHeight",O="clientWidth";if(P===Zo(n)&&(P=nl(n),Qi(P).position!=="static"&&l==="absolute"&&(w="scrollHeight",O="scrollWidth")),P=P,r===Do||(r===No||r===$r)&&i===nf){$=xr;var I=d&&P===x&&x.visualViewport?x.visualViewport.height:P[w];h-=I-o.height,h*=s?1:-1}if(r===No||(r===Do||r===xr)&&i===nf){C=$r;var _=d&&P===x&&x.visualViewport?x.visualViewport.width:P[O];p-=_-o.width,p*=s?1:-1}}var T=Object.assign({position:l},u&&FCe),A=c===!0?BCe({x:p,y:h},Zo(n)):{x:p,y:h};if(p=A.x,h=A.y,s){var R;return Object.assign({},T,(R={},R[$]=S?"0":"",R[C]=b?"0":"",R.transform=(x.devicePixelRatio||1)<=1?"translate("+p+"px, "+h+"px)":"translate3d("+p+"px, "+h+"px, 0)",R))}return Object.assign({},T,(t={},t[$]=S?h+"px":"",t[C]=b?p+"px":"",t.transform="",t))}function HCe(e){var t=e.state,n=e.options,o=n.gpuAcceleration,r=o===void 0?!0:o,i=n.adaptive,a=i===void 0?!0:i,l=n.roundOffsets,s=l===void 0?!0:l,u={placement:pi(t.placement),variation:kc(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,f3(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:s})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,f3(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const zCe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:HCe,data:{}};var Tp={passive:!0};function jCe(e){var t=e.state,n=e.instance,o=e.options,r=o.scroll,i=r===void 0?!0:r,a=o.resize,l=a===void 0?!0:a,s=Zo(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(c){c.addEventListener("scroll",n.update,Tp)}),l&&s.addEventListener("resize",n.update,Tp),function(){i&&u.forEach(function(c){c.removeEventListener("scroll",n.update,Tp)}),l&&s.removeEventListener("resize",n.update,Tp)}}const WCe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:jCe,data:{}};var VCe={left:"right",right:"left",bottom:"top",top:"bottom"};function $g(e){return e.replace(/left|right|bottom|top/g,function(t){return VCe[t]})}var KCe={start:"end",end:"start"};function p3(e){return e.replace(/start|end/g,function(t){return KCe[t]})}function q$(e){var t=Zo(e),n=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:n,scrollTop:o}}function J$(e){return Nc(nl(e)).left+q$(e).scrollLeft}function UCe(e,t){var n=Zo(e),o=nl(e),r=n.visualViewport,i=o.clientWidth,a=o.clientHeight,l=0,s=0;if(r){i=r.width,a=r.height;var u=fk();(u||!u&&t==="fixed")&&(l=r.offsetLeft,s=r.offsetTop)}return{width:i,height:a,x:l+J$(e),y:s}}function GCe(e){var t,n=nl(e),o=q$(e),r=(t=e.ownerDocument)==null?void 0:t.body,i=Bl(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Bl(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-o.scrollLeft+J$(e),s=-o.scrollTop;return Qi(r||n).direction==="rtl"&&(l+=Bl(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:l,y:s}}function Z$(e){var t=Qi(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function mk(e){return["html","body","#document"].indexOf(bi(e))>=0?e.ownerDocument.body:hr(e)&&Z$(e)?e:mk(km(e))}function hd(e,t){var n;t===void 0&&(t=[]);var o=mk(e),r=o===((n=e.ownerDocument)==null?void 0:n.body),i=Zo(o),a=r?[i].concat(i.visualViewport||[],Z$(o)?o:[]):o,l=t.concat(a);return r?l:l.concat(hd(km(a)))}function Q1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function XCe(e,t){var n=Nc(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function g3(e,t,n){return t===uk?Q1(UCe(e,n)):Jl(t)?XCe(t,n):Q1(GCe(nl(e)))}function YCe(e){var t=hd(km(e)),n=["absolute","fixed"].indexOf(Qi(e).position)>=0,o=n&&hr(e)?kf(e):e;return Jl(o)?t.filter(function(r){return Jl(r)&&pk(r,o)&&bi(r)!=="body"}):[]}function qCe(e,t,n,o){var r=t==="clippingParents"?YCe(e):[].concat(t),i=[].concat(r,[n]),a=i[0],l=i.reduce(function(s,u){var c=g3(e,u,o);return s.top=Bl(c.top,s.top),s.right=kh(c.right,s.right),s.bottom=kh(c.bottom,s.bottom),s.left=Bl(c.left,s.left),s},g3(e,a,o));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function bk(e){var t=e.reference,n=e.element,o=e.placement,r=o?pi(o):null,i=o?kc(o):null,a=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,s;switch(r){case Do:s={x:a,y:t.y-n.height};break;case xr:s={x:a,y:t.y+t.height};break;case $r:s={x:t.x+t.width,y:l};break;case No:s={x:t.x-n.width,y:l};break;default:s={x:t.x,y:t.y}}var u=r?Y$(r):null;if(u!=null){var c=u==="y"?"height":"width";switch(i){case Rc:s[u]=s[u]-(t[c]/2-n[c]/2);break;case nf:s[u]=s[u]+(t[c]/2-n[c]/2);break}}return s}function of(e,t){t===void 0&&(t={});var n=t,o=n.placement,r=o===void 0?e.placement:o,i=n.strategy,a=i===void 0?e.strategy:i,l=n.boundary,s=l===void 0?vCe:l,u=n.rootBoundary,c=u===void 0?uk:u,d=n.elementContext,f=d===void 0?Tu:d,p=n.altBoundary,v=p===void 0?!1:p,h=n.padding,m=h===void 0?0:h,b=hk(typeof m!="number"?m:vk(m,Nf)),S=f===Tu?mCe:Tu,C=e.rects.popper,$=e.elements[v?S:f],x=qCe(Jl($)?$:$.contextElement||nl(e.elements.popper),s,c,a),P=Nc(e.elements.reference),w=bk({reference:P,element:C,placement:r}),O=Q1(Object.assign({},C,w)),I=f===Tu?O:P,_={top:x.top-I.top+b.top,bottom:I.bottom-x.bottom+b.bottom,left:x.left-I.left+b.left,right:I.right-x.right+b.right},T=e.modifiersData.offset;if(f===Tu&&T){var A=T[r];Object.keys(_).forEach(function(R){var H=[$r,xr].indexOf(R)>=0?1:-1,M=[Do,xr].indexOf(R)>=0?"y":"x";_[R]+=A[M]*H})}return _}function JCe(e,t){t===void 0&&(t={});var n=t,o=n.placement,r=n.boundary,i=n.rootBoundary,a=n.padding,l=n.flipVariations,s=n.allowedAutoPlacements,u=s===void 0?dk:s,c=kc(o),d=c?l?u3:u3.filter(function(v){return kc(v)===c}):Nf,f=d.filter(function(v){return u.indexOf(v)>=0});f.length===0&&(f=d);var p=f.reduce(function(v,h){return v[h]=of(e,{placement:h,boundary:r,rootBoundary:i,padding:a})[pi(h)],v},{});return Object.keys(p).sort(function(v,h){return p[v]-p[h]})}function ZCe(e){if(pi(e)===U$)return[];var t=$g(e);return[p3(e),t,p3(t)]}function QCe(e){var t=e.state,n=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var r=n.mainAxis,i=r===void 0?!0:r,a=n.altAxis,l=a===void 0?!0:a,s=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,v=p===void 0?!0:p,h=n.allowedAutoPlacements,m=t.options.placement,b=pi(m),S=b===m,C=s||(S||!v?[$g(m)]:ZCe(m)),$=[m].concat(C).reduce(function(Q,Y){return Q.concat(pi(Y)===U$?JCe(t,{placement:Y,boundary:c,rootBoundary:d,padding:u,flipVariations:v,allowedAutoPlacements:h}):Y)},[]),x=t.rects.reference,P=t.rects.popper,w=new Map,O=!0,I=$[0],_=0;_<$.length;_++){var T=$[_],A=pi(T),R=kc(T)===Rc,H=[Do,xr].indexOf(A)>=0,M=H?"width":"height",D=of(t,{placement:T,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),N=H?R?$r:No:R?xr:Do;x[M]>P[M]&&(N=$g(N));var L=$g(N),F=[];if(i&&F.push(D[A]<=0),l&&F.push(D[N]<=0,D[L]<=0),F.every(function(Q){return Q})){I=T,O=!1;break}w.set(T,F)}if(O)for(var B=v?3:1,j=function(Y){var oe=$.find(function(Z){var re=w.get(Z);if(re)return re.slice(0,Y).every(function(ne){return ne})});if(oe)return I=oe,"break"},z=B;z>0;z--){var G=j(z);if(G==="break")break}t.placement!==I&&(t.modifiersData[o]._skip=!0,t.placement=I,t.reset=!0)}}const exe={name:"flip",enabled:!0,phase:"main",fn:QCe,requiresIfExists:["offset"],data:{_skip:!1}};function h3(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function v3(e){return[Do,$r,xr,No].some(function(t){return e[t]>=0})}function txe(e){var t=e.state,n=e.name,o=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,a=of(t,{elementContext:"reference"}),l=of(t,{altBoundary:!0}),s=h3(a,o),u=h3(l,r,i),c=v3(s),d=v3(u);t.modifiersData[n]={referenceClippingOffsets:s,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const nxe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:txe};function oxe(e,t,n){var o=pi(e),r=[No,Do].indexOf(o)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=i[0],l=i[1];return a=a||0,l=(l||0)*r,[No,$r].indexOf(o)>=0?{x:l,y:a}:{x:a,y:l}}function rxe(e){var t=e.state,n=e.options,o=e.name,r=n.offset,i=r===void 0?[0,0]:r,a=dk.reduce(function(c,d){return c[d]=oxe(d,t.rects,i),c},{}),l=a[t.placement],s=l.x,u=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=u),t.modifiersData[o]=a}const ixe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:rxe};function axe(e){var t=e.state,n=e.name;t.modifiersData[n]=bk({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const lxe={name:"popperOffsets",enabled:!0,phase:"read",fn:axe,data:{}};function sxe(e){return e==="x"?"y":"x"}function cxe(e){var t=e.state,n=e.options,o=e.name,r=n.mainAxis,i=r===void 0?!0:r,a=n.altAxis,l=a===void 0?!1:a,s=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,v=n.tetherOffset,h=v===void 0?0:v,m=of(t,{boundary:s,rootBoundary:u,padding:d,altBoundary:c}),b=pi(t.placement),S=kc(t.placement),C=!S,$=Y$(b),x=sxe($),P=t.modifiersData.popperOffsets,w=t.rects.reference,O=t.rects.popper,I=typeof h=="function"?h(Object.assign({},t.rects,{placement:t.placement})):h,_=typeof I=="number"?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,A={x:0,y:0};if(P){if(i){var R,H=$==="y"?Do:No,M=$==="y"?xr:$r,D=$==="y"?"height":"width",N=P[$],L=N+m[H],F=N-m[M],B=p?-O[D]/2:0,j=S===Rc?w[D]:O[D],z=S===Rc?-O[D]:-w[D],G=t.elements.arrow,Q=p&&G?X$(G):{width:0,height:0},Y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:gk(),oe=Y[H],Z=Y[M],re=gd(0,w[D],Q[D]),ne=C?w[D]/2-B-re-oe-_.mainAxis:j-re-oe-_.mainAxis,X=C?-w[D]/2+B+re+Z+_.mainAxis:z+re+Z+_.mainAxis,te=t.elements.arrow&&kf(t.elements.arrow),W=te?$==="y"?te.clientTop||0:te.clientLeft||0:0,U=(R=T==null?void 0:T[$])!=null?R:0,J=N+ne-U-W,de=N+X-U,fe=gd(p?kh(L,J):L,N,p?Bl(F,de):F);P[$]=fe,A[$]=fe-N}if(l){var pe,ve=$==="x"?Do:No,he=$==="x"?xr:$r,V=P[x],q=x==="y"?"height":"width",ie=V+m[ve],me=V-m[he],Se=[Do,No].indexOf(b)!==-1,ce=(pe=T==null?void 0:T[x])!=null?pe:0,ee=Se?ie:V-w[q]-O[q]-ce+_.altAxis,ue=Se?V+w[q]+O[q]-ce-_.altAxis:me,xe=p&&Se?RCe(ee,V,ue):gd(p?ee:ie,V,p?ue:me);P[x]=xe,A[x]=xe-V}t.modifiersData[o]=A}}const uxe={name:"preventOverflow",enabled:!0,phase:"main",fn:cxe,requiresIfExists:["offset"]};function dxe(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function fxe(e){return e===Zo(e)||!hr(e)?q$(e):dxe(e)}function pxe(e){var t=e.getBoundingClientRect(),n=Dc(t.width)/e.offsetWidth||1,o=Dc(t.height)/e.offsetHeight||1;return n!==1||o!==1}function gxe(e,t,n){n===void 0&&(n=!1);var o=hr(t),r=hr(t)&&pxe(t),i=nl(t),a=Nc(e,r,n),l={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(o||!o&&!n)&&((bi(t)!=="body"||Z$(i))&&(l=fxe(t)),hr(t)?(s=Nc(t,!0),s.x+=t.clientLeft,s.y+=t.clientTop):i&&(s.x=J$(i))),{x:a.left+l.scrollLeft-s.x,y:a.top+l.scrollTop-s.y,width:a.width,height:a.height}}function hxe(e){var t=new Map,n=new Set,o=[];e.forEach(function(i){t.set(i.name,i)});function r(i){n.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(l){if(!n.has(l)){var s=t.get(l);s&&r(s)}}),o.push(i)}return e.forEach(function(i){n.has(i.name)||r(i)}),o}function vxe(e){var t=hxe(e);return ICe.reduce(function(n,o){return n.concat(t.filter(function(r){return r.phase===o}))},[])}function mxe(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function bxe(e){var t=e.reduce(function(n,o){var r=n[o.name];return n[o.name]=r?Object.assign({},r,o,{options:Object.assign({},r.options,o.options),data:Object.assign({},r.data,o.data)}):o,n},{});return Object.keys(t).map(function(n){return t[n]})}var m3={placement:"bottom",modifiers:[],strategy:"absolute"};function b3(){for(var e=arguments.length,t=new Array(e),n=0;n * * Copyright (c) 2014-2017, Jon Schlinkert. diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-DXRRTLTq.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-CuGql25I.js similarity index 99% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-DXRRTLTq.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-CuGql25I.js index f3082cd6c0..d6330edf37 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-DXRRTLTq.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-CuGql25I.js @@ -1 +1 @@ -import{d as q,u as T,r as f,c as A,o as I,L as R,a as u,b as c,e,f as m,g as k,t,n as g,w as p,v as y,h as z,i as b,j as h,k as U,T as K,F as P,l as E,m as F,p as O}from"./index-DA9oYm7y.js";import{L as j}from"./llm-check-BVkAKrj3.js";import{_ as B}from"./_plugin-vue_export-helper-DlAUqK2U.js";const H={class:"init-container"},J={class:"init-card"},G={class:"init-header"},W={class:"description"},Q={class:"step-indicator"},X={class:"step-label"},Y={class:"step-label"},Z={key:0,class:"init-form language-selection"},x={class:"form-group"},ee={class:"form-label"},se={class:"language-options"},ae={class:"language-content"},le={class:"language-text"},te={class:"form-actions single"},oe=["disabled"],ie={key:1,class:"init-form"},ne={class:"form-group"},de={class:"form-label"},re={class:"config-mode-selection"},ue={class:"radio-text"},ce={class:"radio-text"},pe={key:0,class:"form-group"},me={for:"apiKey",class:"form-label"},ve=["placeholder","disabled"],fe={class:"form-hint"},ge={href:"https://bailian.console.aliyun.com/?tab=model#/api-key",target:"_blank",class:"help-link"},be={key:1,class:"custom-config-section"},he={class:"form-group"},ye={for:"baseUrl",class:"form-label"},_e=["placeholder","disabled"],$e={class:"form-hint"},Ne={class:"form-group"},Me={for:"customApiKey",class:"form-label"},ke=["placeholder","disabled"],Ue={class:"form-group"},Ke={for:"modelName",class:"form-label"},Le=["placeholder","disabled"],Se={class:"form-hint"},we={class:"form-group"},Ce={for:"modelDisplayName",class:"form-label"},De=["placeholder","disabled"],Ve={class:"form-actions"},qe=["disabled"],Te=["disabled"],Ae={key:0,class:"loading-spinner"},Ie={key:0,class:"error-message"},Re={key:0,class:"success-message"},ze={class:"background-animation"},Pe=q({__name:"index",setup(Ee){const{t:v,locale:$}=T(),_=O(),n=f(1),d=f($.value||"en"),l=f({configMode:"dashscope",apiKey:"",baseUrl:"",modelName:"",modelDisplayName:""}),i=f(!1),r=f(""),N=f(!1),L=A(()=>l.value.apiKey.trim()?l.value.configMode==="custom"?l.value.baseUrl.trim()&&l.value.modelName.trim():!0:!1),S=async()=>{if(d.value)try{i.value=!0,await F(d.value),n.value=2}catch(s){console.warn("Failed to switch language:",s),n.value=2}finally{i.value=!1}},w=()=>{n.value=1},M=()=>{l.value.apiKey="",l.value.baseUrl="",l.value.modelName="",l.value.modelDisplayName="",r.value=""},C=()=>{if(!l.value.apiKey.trim())return r.value=v("init.apiKeyRequired"),!1;if(l.value.configMode==="custom"){if(!l.value.baseUrl.trim())return r.value=v("init.baseUrlRequired"),!1;if(!l.value.modelName.trim())return r.value=v("init.modelNameRequired"),!1}return!0},D=async()=>{if(C())try{i.value=!0,r.value="";const s={configMode:l.value.configMode,apiKey:l.value.apiKey.trim()};l.value.configMode==="custom"&&(s.baseUrl=l.value.baseUrl.trim(),s.modelName=l.value.modelName.trim(),s.modelDisplayName=l.value.modelDisplayName.trim()||l.value.modelName.trim());const o=await(await fetch("/api/init/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})).json();o.success?(N.value=!0,localStorage.setItem("hasInitialized","true"),localStorage.setItem("hasVisitedHome","true"),j.clearCache(),o.requiresRestart?setTimeout(()=>{confirm(v("init.restartRequired"))?window.location.reload():_.push("/home")},2e3):setTimeout(()=>{_.push("/home")},2e3)):r.value=o.error||v("init.saveFailed")}catch(s){console.error("Save config failed:",s),r.value=v("init.networkError")}finally{i.value=!1}},V=async()=>{try{const a=await(await fetch("/api/init/status")).json();a.success&&a.initialized&&(localStorage.setItem("hasInitialized","true"),_.push("/home"))}catch(s){console.error("Check init status failed:",s)}};return I(()=>{const s=localStorage.getItem(R);s&&(s==="zh"||s==="en")&&(d.value=s,$.value=s),V()}),(s,a)=>(c(),u("div",H,[e("div",J,[e("div",G,[a[9]||(a[9]=e("div",{class:"logo"},[e("h1",null,"🤖 JManus")],-1)),e("h2",null,t(n.value===1?s.$t("init.welcomeStep"):s.$t("init.welcome")),1),e("p",W,t(n.value===1?s.$t("init.languageStepDescription"):s.$t("init.description")),1)]),e("div",Q,[e("div",{class:g(["step",{active:n.value>=1,completed:n.value>1}])},[a[10]||(a[10]=e("span",{class:"step-number"},"1",-1)),e("span",X,t(s.$t("init.stepLanguage")),1)],2),a[12]||(a[12]=e("div",{class:"step-divider"},null,-1)),e("div",{class:g(["step",{active:n.value>=2,completed:n.value>2}])},[a[11]||(a[11]=e("span",{class:"step-number"},"2",-1)),e("span",Y,t(s.$t("init.stepModel")),1)],2)]),n.value===1?(c(),u("div",Z,[e("div",x,[e("label",ee,t(s.$t("init.selectLanguageLabel")),1),e("div",se,[e("label",{class:g(["language-option",{active:d.value==="zh"}])},[p(e("input",{type:"radio","onUpdate:modelValue":a[0]||(a[0]=o=>d.value=o),value:"zh"},null,512),[[y,d.value]]),e("span",ae,[a[13]||(a[13]=e("span",{class:"language-flag"},"🇨🇳",-1)),e("span",le,[e("strong",null,t(s.$t("language.zh")),1),e("small",null,t(s.$t("init.simplifiedChinese")),1)])])],2),e("label",{class:g(["language-option",{active:d.value==="en"}])},[p(e("input",{type:"radio","onUpdate:modelValue":a[1]||(a[1]=o=>d.value=o),value:"en"},null,512),[[y,d.value]]),a[14]||(a[14]=e("span",{class:"language-content"},[e("span",{class:"language-flag"},"🇺🇸"),e("span",{class:"language-text"},[e("strong",null,"English"),e("small",null,"English (US)")])],-1))],2)])]),e("div",te,[e("button",{type:"button",class:"submit-btn",disabled:!d.value,onClick:S},t(s.$t("init.continueToModel")),9,oe)])])):m("",!0),n.value===2?(c(),u("div",ie,[e("form",{onSubmit:z(D,["prevent"])},[e("div",ne,[e("label",de,t(s.$t("init.configModeLabel")),1),e("div",re,[e("label",{class:g(["radio-option",{active:l.value.configMode==="dashscope"}])},[p(e("input",{type:"radio","onUpdate:modelValue":a[2]||(a[2]=o=>l.value.configMode=o),value:"dashscope",onChange:M},null,544),[[y,l.value.configMode]]),e("span",ue,[e("strong",null,t(s.$t("init.dashscopeMode")),1),e("small",null,t(s.$t("init.dashscopeModeDesc")),1)])],2),e("label",{class:g(["radio-option",{active:l.value.configMode==="custom"}])},[p(e("input",{type:"radio","onUpdate:modelValue":a[3]||(a[3]=o=>l.value.configMode=o),value:"custom",onChange:M},null,544),[[y,l.value.configMode]]),e("span",ce,[e("strong",null,t(s.$t("init.customMode")),1),e("small",null,t(s.$t("init.customModeDesc")),1)])],2)])]),l.value.configMode==="dashscope"?(c(),u("div",pe,[e("label",me,[b(t(s.$t("init.apiKeyLabel"))+" ",1),a[15]||(a[15]=e("span",{class:"required"},"*",-1))]),p(e("input",{id:"apiKey","onUpdate:modelValue":a[4]||(a[4]=o=>l.value.apiKey=o),type:"password",class:"form-input",placeholder:s.$t("init.apiKeyPlaceholder"),disabled:i.value,required:""},null,8,ve),[[h,l.value.apiKey]]),e("div",fe,[b(t(s.$t("init.apiKeyHint"))+" ",1),e("a",ge,t(s.$t("init.getApiKey")),1)])])):m("",!0),l.value.configMode==="custom"?(c(),u("div",be,[e("div",he,[e("label",ye,[b(t(s.$t("init.baseUrlLabel"))+" ",1),a[16]||(a[16]=e("span",{class:"required"},"*",-1))]),p(e("input",{id:"baseUrl","onUpdate:modelValue":a[5]||(a[5]=o=>l.value.baseUrl=o),type:"url",class:"form-input",placeholder:s.$t("init.baseUrlPlaceholder"),disabled:i.value,required:""},null,8,_e),[[h,l.value.baseUrl]]),e("div",$e,t(s.$t("init.baseUrlHint")),1)]),e("div",Ne,[e("label",Me,[b(t(s.$t("init.customApiKeyLabel"))+" ",1),a[17]||(a[17]=e("span",{class:"required"},"*",-1))]),p(e("input",{id:"customApiKey","onUpdate:modelValue":a[6]||(a[6]=o=>l.value.apiKey=o),type:"password",class:"form-input",placeholder:s.$t("init.customApiKeyPlaceholder"),disabled:i.value,required:""},null,8,ke),[[h,l.value.apiKey]])]),e("div",Ue,[e("label",Ke,[b(t(s.$t("init.modelNameLabel"))+" ",1),a[18]||(a[18]=e("span",{class:"required"},"*",-1))]),p(e("input",{id:"modelName","onUpdate:modelValue":a[7]||(a[7]=o=>l.value.modelName=o),type:"text",class:"form-input",placeholder:s.$t("init.modelNamePlaceholder"),disabled:i.value,required:""},null,8,Le),[[h,l.value.modelName]]),e("div",Se,t(s.$t("init.modelNameHint")),1)]),e("div",we,[e("label",Ce,t(s.$t("init.modelDisplayNameLabel")),1),p(e("input",{id:"modelDisplayName","onUpdate:modelValue":a[8]||(a[8]=o=>l.value.modelDisplayName=o),type:"text",class:"form-input",placeholder:s.$t("init.modelDisplayNamePlaceholder"),disabled:i.value},null,8,De),[[h,l.value.modelDisplayName]])])])):m("",!0),e("div",Ve,[e("button",{type:"button",class:"back-btn",onClick:w,disabled:i.value},t(s.$t("init.back")),9,qe),e("button",{type:"submit",class:"submit-btn",disabled:i.value||!L.value},[i.value?(c(),u("span",Ae)):m("",!0),b(" "+t(i.value?s.$t("init.saving"):s.$t("init.saveAndContinue")),1)],8,Te)])],32)])):m("",!0),k(K,{name:"error-fade"},{default:U(()=>[r.value?(c(),u("div",Ie,t(r.value),1)):m("",!0)]),_:1}),k(K,{name:"success-fade"},{default:U(()=>[N.value?(c(),u("div",Re,t(s.$t("init.successMessage")),1)):m("",!0)]),_:1})]),e("div",ze,[(c(),u(P,null,E(6,o=>e("div",{class:"floating-shape",key:o})),64))]),a[19]||(a[19]=e("div",{class:"background-effects"},[e("div",{class:"gradient-orb orb-1"}),e("div",{class:"gradient-orb orb-2"}),e("div",{class:"gradient-orb orb-3"})],-1))]))}}),Be=B(Pe,[["__scopeId","data-v-e11ff624"]]);export{Be as default}; +import{d as q,u as T,r as f,c as A,o as I,L as R,a as u,b as c,e,f as m,g as k,t,n as g,w as p,v as y,h as z,i as b,j as h,k as U,T as K,F as P,l as E,m as F,p as O}from"./index-CNsQoPg8.js";import{L as j}from"./llm-check-BVkAKrj3.js";import{_ as B}from"./_plugin-vue_export-helper-DlAUqK2U.js";const H={class:"init-container"},J={class:"init-card"},G={class:"init-header"},W={class:"description"},Q={class:"step-indicator"},X={class:"step-label"},Y={class:"step-label"},Z={key:0,class:"init-form language-selection"},x={class:"form-group"},ee={class:"form-label"},se={class:"language-options"},ae={class:"language-content"},le={class:"language-text"},te={class:"form-actions single"},oe=["disabled"],ie={key:1,class:"init-form"},ne={class:"form-group"},de={class:"form-label"},re={class:"config-mode-selection"},ue={class:"radio-text"},ce={class:"radio-text"},pe={key:0,class:"form-group"},me={for:"apiKey",class:"form-label"},ve=["placeholder","disabled"],fe={class:"form-hint"},ge={href:"https://bailian.console.aliyun.com/?tab=model#/api-key",target:"_blank",class:"help-link"},be={key:1,class:"custom-config-section"},he={class:"form-group"},ye={for:"baseUrl",class:"form-label"},_e=["placeholder","disabled"],$e={class:"form-hint"},Ne={class:"form-group"},Me={for:"customApiKey",class:"form-label"},ke=["placeholder","disabled"],Ue={class:"form-group"},Ke={for:"modelName",class:"form-label"},Le=["placeholder","disabled"],Se={class:"form-hint"},we={class:"form-group"},Ce={for:"modelDisplayName",class:"form-label"},De=["placeholder","disabled"],Ve={class:"form-actions"},qe=["disabled"],Te=["disabled"],Ae={key:0,class:"loading-spinner"},Ie={key:0,class:"error-message"},Re={key:0,class:"success-message"},ze={class:"background-animation"},Pe=q({__name:"index",setup(Ee){const{t:v,locale:$}=T(),_=O(),n=f(1),d=f($.value||"en"),l=f({configMode:"dashscope",apiKey:"",baseUrl:"",modelName:"",modelDisplayName:""}),i=f(!1),r=f(""),N=f(!1),L=A(()=>l.value.apiKey.trim()?l.value.configMode==="custom"?l.value.baseUrl.trim()&&l.value.modelName.trim():!0:!1),S=async()=>{if(d.value)try{i.value=!0,await F(d.value),n.value=2}catch(s){console.warn("Failed to switch language:",s),n.value=2}finally{i.value=!1}},w=()=>{n.value=1},M=()=>{l.value.apiKey="",l.value.baseUrl="",l.value.modelName="",l.value.modelDisplayName="",r.value=""},C=()=>{if(!l.value.apiKey.trim())return r.value=v("init.apiKeyRequired"),!1;if(l.value.configMode==="custom"){if(!l.value.baseUrl.trim())return r.value=v("init.baseUrlRequired"),!1;if(!l.value.modelName.trim())return r.value=v("init.modelNameRequired"),!1}return!0},D=async()=>{if(C())try{i.value=!0,r.value="";const s={configMode:l.value.configMode,apiKey:l.value.apiKey.trim()};l.value.configMode==="custom"&&(s.baseUrl=l.value.baseUrl.trim(),s.modelName=l.value.modelName.trim(),s.modelDisplayName=l.value.modelDisplayName.trim()||l.value.modelName.trim());const o=await(await fetch("/api/init/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})).json();o.success?(N.value=!0,localStorage.setItem("hasInitialized","true"),localStorage.setItem("hasVisitedHome","true"),j.clearCache(),o.requiresRestart?setTimeout(()=>{confirm(v("init.restartRequired"))?window.location.reload():_.push("/home")},2e3):setTimeout(()=>{_.push("/home")},2e3)):r.value=o.error||v("init.saveFailed")}catch(s){console.error("Save config failed:",s),r.value=v("init.networkError")}finally{i.value=!1}},V=async()=>{try{const a=await(await fetch("/api/init/status")).json();a.success&&a.initialized&&(localStorage.setItem("hasInitialized","true"),_.push("/home"))}catch(s){console.error("Check init status failed:",s)}};return I(()=>{const s=localStorage.getItem(R);s&&(s==="zh"||s==="en")&&(d.value=s,$.value=s),V()}),(s,a)=>(c(),u("div",H,[e("div",J,[e("div",G,[a[9]||(a[9]=e("div",{class:"logo"},[e("h1",null,"🤖 JManus")],-1)),e("h2",null,t(n.value===1?s.$t("init.welcomeStep"):s.$t("init.welcome")),1),e("p",W,t(n.value===1?s.$t("init.languageStepDescription"):s.$t("init.description")),1)]),e("div",Q,[e("div",{class:g(["step",{active:n.value>=1,completed:n.value>1}])},[a[10]||(a[10]=e("span",{class:"step-number"},"1",-1)),e("span",X,t(s.$t("init.stepLanguage")),1)],2),a[12]||(a[12]=e("div",{class:"step-divider"},null,-1)),e("div",{class:g(["step",{active:n.value>=2,completed:n.value>2}])},[a[11]||(a[11]=e("span",{class:"step-number"},"2",-1)),e("span",Y,t(s.$t("init.stepModel")),1)],2)]),n.value===1?(c(),u("div",Z,[e("div",x,[e("label",ee,t(s.$t("init.selectLanguageLabel")),1),e("div",se,[e("label",{class:g(["language-option",{active:d.value==="zh"}])},[p(e("input",{type:"radio","onUpdate:modelValue":a[0]||(a[0]=o=>d.value=o),value:"zh"},null,512),[[y,d.value]]),e("span",ae,[a[13]||(a[13]=e("span",{class:"language-flag"},"🇨🇳",-1)),e("span",le,[e("strong",null,t(s.$t("language.zh")),1),e("small",null,t(s.$t("init.simplifiedChinese")),1)])])],2),e("label",{class:g(["language-option",{active:d.value==="en"}])},[p(e("input",{type:"radio","onUpdate:modelValue":a[1]||(a[1]=o=>d.value=o),value:"en"},null,512),[[y,d.value]]),a[14]||(a[14]=e("span",{class:"language-content"},[e("span",{class:"language-flag"},"🇺🇸"),e("span",{class:"language-text"},[e("strong",null,"English"),e("small",null,"English (US)")])],-1))],2)])]),e("div",te,[e("button",{type:"button",class:"submit-btn",disabled:!d.value,onClick:S},t(s.$t("init.continueToModel")),9,oe)])])):m("",!0),n.value===2?(c(),u("div",ie,[e("form",{onSubmit:z(D,["prevent"])},[e("div",ne,[e("label",de,t(s.$t("init.configModeLabel")),1),e("div",re,[e("label",{class:g(["radio-option",{active:l.value.configMode==="dashscope"}])},[p(e("input",{type:"radio","onUpdate:modelValue":a[2]||(a[2]=o=>l.value.configMode=o),value:"dashscope",onChange:M},null,544),[[y,l.value.configMode]]),e("span",ue,[e("strong",null,t(s.$t("init.dashscopeMode")),1),e("small",null,t(s.$t("init.dashscopeModeDesc")),1)])],2),e("label",{class:g(["radio-option",{active:l.value.configMode==="custom"}])},[p(e("input",{type:"radio","onUpdate:modelValue":a[3]||(a[3]=o=>l.value.configMode=o),value:"custom",onChange:M},null,544),[[y,l.value.configMode]]),e("span",ce,[e("strong",null,t(s.$t("init.customMode")),1),e("small",null,t(s.$t("init.customModeDesc")),1)])],2)])]),l.value.configMode==="dashscope"?(c(),u("div",pe,[e("label",me,[b(t(s.$t("init.apiKeyLabel"))+" ",1),a[15]||(a[15]=e("span",{class:"required"},"*",-1))]),p(e("input",{id:"apiKey","onUpdate:modelValue":a[4]||(a[4]=o=>l.value.apiKey=o),type:"password",class:"form-input",placeholder:s.$t("init.apiKeyPlaceholder"),disabled:i.value,required:""},null,8,ve),[[h,l.value.apiKey]]),e("div",fe,[b(t(s.$t("init.apiKeyHint"))+" ",1),e("a",ge,t(s.$t("init.getApiKey")),1)])])):m("",!0),l.value.configMode==="custom"?(c(),u("div",be,[e("div",he,[e("label",ye,[b(t(s.$t("init.baseUrlLabel"))+" ",1),a[16]||(a[16]=e("span",{class:"required"},"*",-1))]),p(e("input",{id:"baseUrl","onUpdate:modelValue":a[5]||(a[5]=o=>l.value.baseUrl=o),type:"url",class:"form-input",placeholder:s.$t("init.baseUrlPlaceholder"),disabled:i.value,required:""},null,8,_e),[[h,l.value.baseUrl]]),e("div",$e,t(s.$t("init.baseUrlHint")),1)]),e("div",Ne,[e("label",Me,[b(t(s.$t("init.customApiKeyLabel"))+" ",1),a[17]||(a[17]=e("span",{class:"required"},"*",-1))]),p(e("input",{id:"customApiKey","onUpdate:modelValue":a[6]||(a[6]=o=>l.value.apiKey=o),type:"password",class:"form-input",placeholder:s.$t("init.customApiKeyPlaceholder"),disabled:i.value,required:""},null,8,ke),[[h,l.value.apiKey]])]),e("div",Ue,[e("label",Ke,[b(t(s.$t("init.modelNameLabel"))+" ",1),a[18]||(a[18]=e("span",{class:"required"},"*",-1))]),p(e("input",{id:"modelName","onUpdate:modelValue":a[7]||(a[7]=o=>l.value.modelName=o),type:"text",class:"form-input",placeholder:s.$t("init.modelNamePlaceholder"),disabled:i.value,required:""},null,8,Le),[[h,l.value.modelName]]),e("div",Se,t(s.$t("init.modelNameHint")),1)]),e("div",we,[e("label",Ce,t(s.$t("init.modelDisplayNameLabel")),1),p(e("input",{id:"modelDisplayName","onUpdate:modelValue":a[8]||(a[8]=o=>l.value.modelDisplayName=o),type:"text",class:"form-input",placeholder:s.$t("init.modelDisplayNamePlaceholder"),disabled:i.value},null,8,De),[[h,l.value.modelDisplayName]])])])):m("",!0),e("div",Ve,[e("button",{type:"button",class:"back-btn",onClick:w,disabled:i.value},t(s.$t("init.back")),9,qe),e("button",{type:"submit",class:"submit-btn",disabled:i.value||!L.value},[i.value?(c(),u("span",Ae)):m("",!0),b(" "+t(i.value?s.$t("init.saving"):s.$t("init.saveAndContinue")),1)],8,Te)])],32)])):m("",!0),k(K,{name:"error-fade"},{default:U(()=>[r.value?(c(),u("div",Ie,t(r.value),1)):m("",!0)]),_:1}),k(K,{name:"success-fade"},{default:U(()=>[N.value?(c(),u("div",Re,t(s.$t("init.successMessage")),1)):m("",!0)]),_:1})]),e("div",ze,[(c(),u(P,null,E(6,o=>e("div",{class:"floating-shape",key:o})),64))]),a[19]||(a[19]=e("div",{class:"background-effects"},[e("div",{class:"gradient-orb orb-1"}),e("div",{class:"gradient-orb orb-2"}),e("div",{class:"gradient-orb orb-3"})],-1))]))}}),Be=B(Pe,[["__scopeId","data-v-e11ff624"]]);export{Be as default}; diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-CzTAyhzl.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-QLIAiQL6.js similarity index 99% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-CzTAyhzl.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-QLIAiQL6.js index 7ff042c837..26bf53d960 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-CzTAyhzl.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-QLIAiQL6.js @@ -1,3 +1,3 @@ -var ct=Object.defineProperty;var rt=(T,n,s)=>n in T?ct(T,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):T[n]=s;var he=(T,n,s)=>rt(T,typeof n!="symbol"?n+"":n,s);import{d as Ce,u as Ie,c as _e,o as Se,a as m,b as h,n as te,x as i,e,f as F,t as l,g as k,i as Y,F as ge,l as ve,h as ie,w as de,j as fe,z as at,r as D,y as ne,A as De,s as ue,T as xe,k as Re,B as $e,q as Ue,C as Ne,D as ut,E as dt,p as lt,G as pt}from"./index-DA9oYm7y.js";import{I as C}from"./iconify-CyasjfC7.js";import{s as f,P as Ae,u as it}from"./sidebar-BtIzguw3.js";import{_ as ye}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{L as ht}from"./llm-check-BVkAKrj3.js";import{L as gt}from"./index-D2fTT4wr.js";import{u as mt,a as vt}from"./useMessage-fgXJFj_8.js";const ft={class:"sidebar-content"},bt={class:"sidebar-content-header"},kt={class:"sidebar-content-title"},_t={class:"tab-switcher"},$t=["disabled"],Pt={key:0,class:"tab-content"},Ct={class:"new-task-section"},St={class:"sidebar-content-list"},yt={key:0,class:"loading-state"},Et={key:1,class:"error-state"},wt={key:2,class:"empty-state"},Tt=["onClick"],It={class:"task-icon"},Dt={class:"task-details"},xt={class:"task-title"},Rt={class:"task-preview"},At={class:"task-time"},Mt={class:"task-actions"},Nt=["title","onClick"],Ut={key:1,class:"tab-content config-tab"},Lt={key:0,class:"config-container"},qt={class:"template-info-header"},Ft={class:"template-info"},Vt={class:"template-id"},Ot={class:"config-section"},Bt={class:"section-header"},Wt={class:"generator-content"},jt=["placeholder"],Ht={class:"generator-actions"},zt=["disabled"],Jt=["disabled"],Gt={class:"config-section"},Xt={class:"section-header"},Kt={class:"section-actions"},Qt=["disabled","title"],Yt=["disabled","title"],Zt=["disabled"],en=["placeholder"],tn={class:"config-section"},nn={class:"section-header"},sn={class:"execution-content"},on={class:"params-input-group"},an={class:"params-help-text"},ln={class:"params-input-container"},cn=["placeholder"],rn=["title"],un={class:"api-url-display"},dn={class:"api-url-label"},pn={class:"api-url"},hn={class:"api-url-display"},gn={class:"api-url-label"},mn=["disabled"],vn=Ce({__name:"index",emits:["planExecutionRequested"],setup(T,{expose:n,emit:s}){const{t:d}=Ie(),E=["currentPlanId","userRequest","rootPlanId"],u=_e({get(){try{if(!f.jsonContent)return"";const g={...JSON.parse(f.jsonContent)};return E.forEach(S=>{delete g[S]}),JSON.stringify(g,null,2)}catch{return f.jsonContent}},set(o){try{if(!o.trim()){f.jsonContent="";return}const g=JSON.parse(o);let S={};try{S=JSON.parse(f.jsonContent||"{}")}catch{}const K={...g};E.forEach(U=>{S[U]!==void 0&&(K[U]=S[U])}),f.jsonContent=JSON.stringify(K)}catch{f.jsonContent=o}}}),$=s,x=async()=>{try{const o=await f.saveTemplate();o!=null&&o.duplicate?alert(d("sidebar.saveCompleted",{message:o.message,versionCount:o.versionCount})):o!=null&&o.saved?alert(d("sidebar.saveSuccess",{message:o.message,versionCount:o.versionCount})):o!=null&&o.message&&alert(d("sidebar.saveStatus",{message:o.message}))}catch(o){console.error("Failed to save plan modifications:",o),alert(o.message||d("sidebar.saveFailed"))}},O=async()=>{var o;try{await f.generatePlan(),alert(d("sidebar.generateSuccess",{templateId:((o=f.selectedTemplate)==null?void 0:o.id)??d("sidebar.unknown")}))}catch(g){console.error("Failed to generate plan:",g),alert(d("sidebar.generateFailed")+": "+g.message)}},P=async()=>{try{await f.updatePlan(),alert(d("sidebar.updateSuccess"))}catch(o){console.error("Failed to update plan:",o),alert(d("sidebar.updateFailed")+": "+o.message)}},B=async()=>{console.log("[Sidebar] handleExecutePlan called");try{const o=f.preparePlanExecution();if(!o){console.log("[Sidebar] No plan data available, returning");return}console.log("[Sidebar] Triggering plan execution request:",o),console.log("[Sidebar] Emitting planExecutionRequested event"),$("planExecutionRequested",o),console.log("[Sidebar] Event emitted")}catch(o){console.error("Error executing plan:",o),alert(d("sidebar.executeFailed")+": "+o.message)}finally{f.finishPlanExecution()}},X=o=>{if(isNaN(o.getTime()))return console.warn("Invalid date received:",o),d("time.unknown");const S=new Date().getTime()-o.getTime(),K=Math.floor(S/6e4),U=Math.floor(S/36e5),q=Math.floor(S/864e5);return K<1?d("time.now"):K<60?d("time.minuteAgo",{count:K}):U<24?d("time.hourAgo",{count:U}):q<30?d("time.dayAgo",{count:q}):o.toLocaleDateString("zh-CN")},G=(o,g)=>!o||o.length<=g?o:o.substring(0,g)+"...";return Se(()=>{f.loadPlanTemplateList()}),n({loadPlanTemplateList:f.loadPlanTemplateList,toggleSidebar:f.toggleSidebar,currentPlanTemplateId:f.currentPlanTemplateId}),(o,g)=>(h(),m("div",{class:te(["sidebar-wrapper",{"sidebar-wrapper-collapsed":i(f).isCollapsed}])},[e("div",ft,[e("div",bt,[e("div",kt,l(o.$t("sidebar.title")),1)]),e("div",_t,[e("button",{class:te(["tab-button",{active:i(f).currentTab==="list"}]),onClick:g[0]||(g[0]=S=>i(f).switchToTab("list"))},[k(i(C),{icon:"carbon:list",width:"16"}),Y(" "+l(o.$t("sidebar.templateList")),1)],2),e("button",{class:te(["tab-button",{active:i(f).currentTab==="config"}]),onClick:g[1]||(g[1]=S=>i(f).switchToTab("config")),disabled:!i(f).selectedTemplate},[k(i(C),{icon:"carbon:settings",width:"16"}),Y(" "+l(o.$t("sidebar.configuration")),1)],10,$t)]),i(f).currentTab==="list"?(h(),m("div",Pt,[e("div",Ct,[e("button",{class:"new-task-btn",onClick:g[2]||(g[2]=S=>i(f).createNewTemplate())},[k(i(C),{icon:"carbon:add",width:"16"}),Y(" "+l(o.$t("sidebar.newPlan"))+" ",1),g[11]||(g[11]=e("span",{class:"shortcut"},"⌘ K",-1))])]),e("div",St,[i(f).isLoading?(h(),m("div",yt,[k(i(C),{icon:"carbon:circle-dash",width:"20",class:"spinning"}),e("span",null,l(o.$t("sidebar.loading")),1)])):i(f).errorMessage?(h(),m("div",Et,[k(i(C),{icon:"carbon:warning",width:"20"}),e("span",null,l(i(f).errorMessage),1),e("button",{onClick:g[3]||(g[3]=(...S)=>i(f).loadPlanTemplateList&&i(f).loadPlanTemplateList(...S)),class:"retry-btn"},l(o.$t("sidebar.retry")),1)])):i(f).planTemplateList.length===0?(h(),m("div",wt,[k(i(C),{icon:"carbon:document",width:"32"}),e("span",null,l(o.$t("sidebar.noTemplates")),1)])):(h(!0),m(ge,{key:3},ve(i(f).sortedTemplates,S=>(h(),m("div",{key:S.id,class:te(["sidebar-content-list-item",{"sidebar-content-list-item-active":S.id===i(f).currentPlanTemplateId}]),onClick:K=>i(f).selectTemplate(S)},[e("div",It,[k(i(C),{icon:"carbon:document",width:"20"})]),e("div",Dt,[e("div",xt,l(S.title||o.$t("sidebar.unnamedPlan")),1),e("div",Rt,l(G(S.description||o.$t("sidebar.noDescription"),40)),1)]),e("div",At,l(X(i(f).parseDateTime(S.updateTime||S.createTime))),1),e("div",Mt,[e("button",{class:"delete-task-btn",title:o.$t("sidebar.deleteTemplate"),onClick:ie(K=>i(f).deleteTemplate(S),["stop"])},[k(i(C),{icon:"carbon:close",width:"16"})],8,Nt)])],10,Tt))),128))])])):i(f).currentTab==="config"?(h(),m("div",Ut,[i(f).selectedTemplate?(h(),m("div",Lt,[e("div",qt,[e("div",Ft,[e("h3",null,l(i(f).selectedTemplate.title||o.$t("sidebar.unnamedPlan")),1),e("span",Vt,"ID: "+l(i(f).selectedTemplate.id),1)]),e("button",{class:"back-to-list-btn",onClick:g[4]||(g[4]=S=>i(f).switchToTab("list"))},[k(i(C),{icon:"carbon:arrow-left",width:"16"})])]),e("div",Ot,[e("div",Bt,[k(i(C),{icon:"carbon:generate",width:"16"}),e("span",null,l(o.$t("sidebar.planGenerator")),1)]),e("div",Wt,[de(e("textarea",{"onUpdate:modelValue":g[5]||(g[5]=S=>i(f).generatorPrompt=S),class:"prompt-input",placeholder:o.$t("sidebar.generatorPlaceholder"),rows:"3"},null,8,jt),[[fe,i(f).generatorPrompt]]),e("div",Ht,[e("button",{class:"btn btn-primary btn-sm",onClick:O,disabled:i(f).isGenerating||!i(f).generatorPrompt.trim()},[k(i(C),{icon:i(f).isGenerating?"carbon:circle-dash":"carbon:generate",width:"14",class:te({spinning:i(f).isGenerating})},null,8,["icon","class"]),Y(" "+l(i(f).isGenerating?o.$t("sidebar.generating"):o.$t("sidebar.generatePlan")),1)],8,zt),e("button",{class:"btn btn-secondary btn-sm",onClick:P,disabled:i(f).isGenerating||!i(f).generatorPrompt.trim()||!i(f).jsonContent.trim()},[k(i(C),{icon:"carbon:edit",width:"14"}),Y(" "+l(o.$t("sidebar.updatePlan")),1)],8,Jt)])])]),e("div",Gt,[e("div",Xt,[k(i(C),{icon:"carbon:code",width:"16"}),e("span",null,l(o.$t("sidebar.jsonTemplate")),1),e("div",Kt,[e("button",{class:"btn btn-sm",onClick:g[6]||(g[6]=(...S)=>i(f).rollbackVersion&&i(f).rollbackVersion(...S)),disabled:!i(f).canRollback,title:o.$t("sidebar.rollback")},[k(i(C),{icon:"carbon:undo",width:"14"})],8,Qt),e("button",{class:"btn btn-sm",onClick:g[7]||(g[7]=(...S)=>i(f).restoreVersion&&i(f).restoreVersion(...S)),disabled:!i(f).canRestore,title:o.$t("sidebar.restore")},[k(i(C),{icon:"carbon:redo",width:"14"})],8,Yt),e("button",{class:"btn btn-primary btn-sm",onClick:x,disabled:i(f).isGenerating||i(f).isExecuting},[k(i(C),{icon:"carbon:save",width:"14"})],8,Zt)])]),de(e("textarea",{"onUpdate:modelValue":g[8]||(g[8]=S=>u.value=S),class:"json-editor",placeholder:o.$t("sidebar.jsonPlaceholder"),rows:"12"},null,8,en),[[fe,u.value]])]),e("div",tn,[e("div",nn,[k(i(C),{icon:"carbon:play",width:"16"}),e("span",null,l(o.$t("sidebar.executionController")),1)]),e("div",sn,[e("div",on,[e("label",null,l(o.$t("sidebar.executionParams")),1),e("div",an,l(o.$t("sidebar.executionParamsHelp")),1),e("div",ln,[de(e("input",{"onUpdate:modelValue":g[9]||(g[9]=S=>i(f).executionParams=S),class:"params-input",placeholder:o.$t("sidebar.executionParamsPlaceholder")},null,8,cn),[[fe,i(f).executionParams]]),e("button",{class:"clear-params-btn",onClick:g[10]||(g[10]=(...S)=>i(f).clearExecutionParams&&i(f).clearExecutionParams(...S)),title:o.$t("sidebar.clearParams")},[k(i(C),{icon:"carbon:close",width:"12"})],8,rn)])]),e("div",un,[e("span",dn,l(o.$t("sidebar.apiUrl"))+":",1),e("code",pn,l(i(f).computedApiUrl),1)]),e("div",hn,[e("span",gn,l(o.$t("sidebar.statusApiUrl"))+":",1),g[12]||(g[12]=e("code",{class:"api-url"},"/api/executor/details/{planId}",-1))]),e("button",{class:"btn btn-primary execute-btn",onClick:B,disabled:i(f).isExecuting||i(f).isGenerating},[k(i(C),{icon:i(f).isExecuting?"carbon:circle-dash":"carbon:play",width:"16",class:te({spinning:i(f).isExecuting})},null,8,["icon","class"]),Y(" "+l(i(f).isExecuting?o.$t("sidebar.executing"):o.$t("sidebar.executePlan")),1)],8,mn)])])])):F("",!0)])):F("",!0)])],2))}}),fn=ye(vn,[["__scopeId","data-v-3c0cf310"]]);class qe{static async sendMessage(n){return ht.withLlmCheck(async()=>{const s=await fetch(`${this.BASE_URL}/execute`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:n})});if(!s.ok)throw new Error(`API request failed: ${s.status}`);return await s.json()})}}he(qe,"BASE_URL","/api/executor");class Fe{static async getDetails(n){try{const s=await fetch(`${this.BASE_URL}/details/${n}`);if(s.status===404)return null;if(!s.ok){const u=await s.text();throw new Error(`Failed to get detailed information: ${s.status} - ${u}`)}const d=await s.text(),E=JSON.parse(d);return E&&typeof E=="object"&&!E.currentPlanId&&(E.currentPlanId=n),E}catch(s){return console.error("[CommonApiService] Failed to get plan details:",s),{currentPlanId:n,status:"failed",message:s instanceof Error?s.message:"Failed to save, please retry"}}}static async submitFormInput(n,s){const d=await fetch(`${this.BASE_URL}/submit-input/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!d.ok){let u;try{u=await d.json()}catch{u={message:`Failed to submit form input: ${d.status}`}}throw new Error(u.message||`Failed to submit form input: ${d.status}`)}const E=d.headers.get("content-type");return E&&E.indexOf("application/json")!==-1?await d.json():{success:!0}}static async getAllPrompts(){try{const n=await fetch(this.BASE_URL);return await(await this.handleResponse(n)).json()}catch(n){throw console.error("Failed to get Prompt list:",n),n}}static async handleResponse(n){if(!n.ok)try{const s=await n.json();throw new Error(s.message||`API request failed: ${n.status}`)}catch{throw new Error(`API request failed: ${n.status} ${n.statusText}`)}return n}}he(Fe,"BASE_URL","/api/executor");const Pe=class Pe{constructor(){he(this,"POLL_INTERVAL",5e3);he(this,"state",at({activePlanId:null,lastSequenceSize:0,isPolling:!1,pollTimer:null}));he(this,"callbacks",{});he(this,"planExecutionCache",new Map);he(this,"uiStateCache",new Map);console.log("[PlanExecutionManager] Initialized with callback-based event system")}getCachedPlanRecord(n){return this.planExecutionCache.get(n)}getCachedUIState(n){return this.uiStateCache.get(n)}setCachedUIState(n,s){this.uiStateCache.set(n,s),console.log(`[PlanExecutionManager] Cached UI state for rootPlanId: ${n}`)}getAllCachedRecords(){return new Map(this.planExecutionCache)}hasCachedPlanRecord(n){return this.planExecutionCache.has(n)}setCachedPlanRecord(n,s){this.planExecutionCache.set(n,s),console.log(`[PlanExecutionManager] Cached plan execution record for rootPlanId: ${n}`)}clearCachedPlanRecord(n){const s=this.planExecutionCache.delete(n);return s&&console.log(`[PlanExecutionManager] Cleared cached plan execution record for rootPlanId: ${n}`),s}clearAllCachedRecords(){const n=this.planExecutionCache.size,s=this.uiStateCache.size;this.planExecutionCache.clear(),this.uiStateCache.clear(),console.log(`[PlanExecutionManager] Cleared all caches - Plans: ${n}, UI States: ${s}`)}static getInstance(){return Pe.instance||(Pe.instance=new Pe),Pe.instance}getActivePlanId(){return this.state.activePlanId}getState(){return this.state}setEventCallbacks(n){this.callbacks={...this.callbacks,...n},console.log("[PlanExecutionManager] Event callbacks set:",Object.keys(n))}async handleUserMessageSendRequested(n){if(this.validateAndPrepareUIForNewRequest(n))try{if(await this.sendUserMessageAndSetPlanId(n),this.state.activePlanId)this.initiatePlanExecutionSequence(n,this.state.activePlanId);else throw new Error("Failed to get valid plan ID")}catch(s){console.error("[PlanExecutionManager] Failed to send user message:",s);const d=this.state.activePlanId??"error";this.setCachedUIState(d,{enabled:!0}),this.emitChatInputUpdateState(d),this.state.activePlanId=null}}handlePlanExecutionRequested(n,s){console.log("[PlanExecutionManager] Received plan execution request:",{planId:n,query:s}),n?(this.state.activePlanId=n,this.initiatePlanExecutionSequence(s??"Execute Plan",n)):console.error("[PlanExecutionManager] Invalid plan execution request: missing planId")}handleCachedPlanExecution(n,s){const d=this.getCachedPlanRecord(n);return d!=null&&d.currentPlanId?(console.log(`[PlanExecutionManager] Found cached plan execution record for rootPlanId: ${n}`),this.handlePlanExecutionRequested(d.currentPlanId,s),!0):(console.log(`[PlanExecutionManager] No cached plan execution record found for rootPlanId: ${n}`),!1)}validateAndPrepareUIForNewRequest(n){if(!n)return console.warn("[PlanExecutionManager] Query is empty"),!1;if(this.state.activePlanId)return!1;this.emitChatInputClear();const s=this.state.activePlanId??"ui-state";return this.setCachedUIState(s,{enabled:!1,placeholder:"Processing..."}),this.emitChatInputUpdateState(s),!0}async sendUserMessageAndSetPlanId(n){try{const s=await qe.sendMessage(n);if(s!=null&&s.planId)return this.state.activePlanId=s.planId,s;if(s!=null&&s.planTemplateId)return this.state.activePlanId=s.planTemplateId,{...s,planId:s.planTemplateId};throw console.error("[PlanExecutionManager] Failed to get planId from response:",s),new Error("Failed to get valid planId from API response")}catch(s){throw console.error("[PlanExecutionManager] API call failed:",s),s}}initiatePlanExecutionSequence(n,s){console.log(`[PlanExecutionManager] Starting plan execution sequence for query: "${n}", planId: ${s}`);const d=s;this.emitDialogRoundStart(d),this.startPolling()}handlePlanCompletion(n){this.emitPlanCompleted(n.rootPlanId??""),this.state.lastSequenceSize=0,this.stopPolling();try{setTimeout(async()=>{if(this.state.activePlanId)try{await Ae.deletePlanTemplate(this.state.activePlanId),console.log(`[PlanExecutionManager] Plan template ${this.state.activePlanId} deleted successfully`)}catch(s){console.log(`Delete plan execution record failed: ${s.message}`)}},5e3)}catch(s){console.log(`Delete plan execution record failed: ${s.message}`)}n.completed&&(this.state.activePlanId=null,this.emitChatInputUpdateState(n.rootPlanId??""))}handlePlanError(n){this.emitPlanError(n.message??""),this.state.lastSequenceSize=0,this.stopPolling();try{setTimeout(async()=>{if(this.state.activePlanId)try{await Ae.deletePlanTemplate(this.state.activePlanId),console.log(`[PlanExecutionManager] Plan template ${this.state.activePlanId} deleted successfully`)}catch(s){console.log(`Delete plan execution record failed: ${s.message}`)}},5e3)}catch(s){console.log(`Delete plan execution record failed: ${s.message}`)}}async pollPlanStatus(){if(this.state.activePlanId){if(this.state.isPolling){console.log("[PlanExecutionManager] Previous polling still in progress, skipping");return}try{this.state.isPolling=!0;const n=await this.getPlanDetails(this.state.activePlanId);if(!n){console.warn("[PlanExecutionManager] No details received from API");return}if(n.status&&n.status==="failed"){this.handlePlanError(n);return}if(n.rootPlanId&&this.setCachedPlanRecord(n.rootPlanId,n),!n.steps||n.steps.length===0){console.log("[PlanExecutionManager] Simple response without steps detected, handling as completed"),this.emitPlanUpdate(n.rootPlanId??""),this.handlePlanCompletion(n);return}this.emitPlanUpdate(n.rootPlanId??""),n.completed&&this.handlePlanCompletion(n)}catch(n){console.error("[PlanExecutionManager] Failed to poll plan status:",n)}finally{this.state.isPolling=!1}}}async getPlanDetails(n){try{const s=await Fe.getDetails(n);return s!=null&&s.rootPlanId&&(this.planExecutionCache.set(s.rootPlanId,s),console.log(`[PlanExecutionManager] Cached plan execution record for rootPlanId: ${s.rootPlanId}`)),s}catch(s){return console.error("[PlanExecutionManager] Failed to get plan details:",s),{currentPlanId:n,status:"failed",message:s instanceof Error?s.message:"Failed to get plan"}}}startPolling(){this.state.pollTimer&&clearInterval(this.state.pollTimer),this.state.pollTimer=window.setInterval(()=>{this.pollPlanStatus()},this.POLL_INTERVAL),console.log("[PlanExecutionManager] Started polling")}async pollPlanStatusImmediately(){console.log("[PlanExecutionManager] Polling plan status immediately"),await this.pollPlanStatus()}stopPolling(){this.state.pollTimer&&(clearInterval(this.state.pollTimer),this.state.pollTimer=null),console.log("[PlanExecutionManager] Stopped polling")}cleanup(){this.stopPolling(),this.state.activePlanId=null,this.state.lastSequenceSize=0,this.state.isPolling=!1,this.clearAllCachedRecords()}emitChatInputClear(){this.callbacks.onChatInputClear&&this.callbacks.onChatInputClear()}emitChatInputUpdateState(n){this.callbacks.onChatInputUpdateState&&this.callbacks.onChatInputUpdateState(n)}emitDialogRoundStart(n){this.callbacks.onDialogRoundStart&&this.callbacks.onDialogRoundStart(n)}emitPlanUpdate(n){this.callbacks.onPlanUpdate&&this.callbacks.onPlanUpdate(n)}emitPlanCompleted(n){this.callbacks.onPlanCompleted&&this.callbacks.onPlanCompleted(n)}emitPlanError(n){this.callbacks.onPlanError&&this.callbacks.onPlanError(n)}};he(Pe,"instance",null);let Le=Pe;const oe=Le.getInstance(),bn={class:"right-panel"},kn={class:"preview-header"},_n={class:"preview-tabs"},$n={class:"tab-button active"},Pn={class:"preview-content"},Cn={class:"step-details"},Sn={key:0,class:"step-info-fixed"},yn={key:0,class:"agent-info"},En={class:"info-item"},wn={class:"label"},Tn={class:"value"},In={class:"info-item"},Dn={class:"label"},xn={class:"value"},Rn={class:"info-item"},An={class:"label"},Mn={class:"value"},Nn={class:"info-item"},Un={class:"label"},Ln={class:"value"},qn={class:"info-item"},Fn={class:"label"},Vn={class:"execution-status"},On={class:"status-item"},Bn={class:"status-text"},Wn={key:0},jn={key:0,class:"think-act-steps"},Hn={class:"steps-container"},zn={class:"step-header"},Jn={class:"step-number"},Gn={class:"think-section"},Xn={class:"think-content"},Kn={class:"input"},Qn={class:"label"},Yn={class:"output"},Zn={class:"label"},es={key:0,class:"action-section"},ts={class:"action-content"},ns={class:"tool-info"},ss={class:"label"},os={class:"value"},as={class:"input"},ls={class:"label"},is={class:"output"},cs={class:"label"},rs={key:0,class:"sub-plan-section"},us={class:"sub-plan-content"},ds={class:"sub-plan-header"},ps={class:"sub-plan-info"},hs={class:"label"},gs={class:"value"},ms={key:0,class:"sub-plan-info"},vs={class:"label"},fs={class:"value"},bs={class:"sub-plan-status"},ks={class:"status-text"},_s={key:0,class:"no-steps-message"},$s={key:1,class:"no-execution-message"},Ps={class:"step-basic-info"},Cs={class:"info-item"},Ss={class:"label"},ys={class:"value"},Es={key:0,class:"info-item"},ws={class:"label"},Ts={class:"value"},Is={class:"info-item"},Ds={class:"label"},xs={class:"no-execution-hint"},Rs={key:2,class:"execution-indicator"},As={class:"execution-text"},Ms={key:1,class:"no-selection"},Ns=["title"],Us=Ce({__name:"index",setup(T,{expose:n}){const{t:s}=Ie(),d=D(),E=D(),u=D(),$=D(null),x=D(!1),O=D(!0),P=D(!0),B=_e(()=>u.value?u.value.completed?s("rightPanel.status.completed"):u.value.current?s("rightPanel.status.executing"):s("rightPanel.status.waiting"):""),X=v=>{var L;if(console.log(`[RightPanel] updateDisplayedPlanProgress called with rootPlanId: ${v}`),u.value&&$.value){const R=$.value.rootPlanId??E.value;if(R&&R!==v){console.log(`[RightPanel] Plan ID mismatch - skipping update. Current: ${R}, Requested: ${v}`);return}}console.log(`[RightPanel] Plan ID validation passed - proceeding with update for rootPlanId: ${v}`);const w=oe.getCachedPlanRecord(v);if(!w){console.warn(`[RightPanel] Plan data not found for rootPlanId: ${v}`);return}if(w.steps&&w.steps.length>0){const R=w.steps.length,y=(w.currentStepIndex??0)+1;console.log(`[RightPanel] Progress: ${y} / ${R}`)}if(u.value&&E.value&&(E.value===v||((L=$.value)==null?void 0:L.rootPlanId)===v)&&(console.log(`[RightPanel] Refreshing selected step details for plan: ${v}`),$.value)){const y=$.value,A=o(y.planId,y.rootPlanId,y.subPlanId);A?(g(A,y.stepIndex,y.planId,y.isSubPlan),V()):console.warn("[RightPanel] Could not find plan record for refresh:",y)}},G=(v,w,L,R,y)=>{console.log("[RightPanel] Step selected:",{planId:v,stepIndex:w,rootPlanId:L,subPlanId:R,subStepIndex:y});const A=!!(L&&R&&y!==void 0);$.value={planId:v,stepIndex:w,isSubPlan:A,...A&&{rootPlanId:L,subPlanId:R,subStepIndex:y}};const ee=o(v,L,R);if(!ee){console.warn("[RightPanel] Plan data not found:",{planId:v,rootPlanId:L,subPlanId:R}),u.value=null,$.value=null;return}g(ee,w,v,A)},o=(v,w,L)=>{var A;if(!w||!L)return oe.getCachedPlanRecord(v)??null;const R=oe.getCachedPlanRecord(v);if(R)return R;const y=oe.getCachedPlanRecord(w);if(!(y!=null&&y.agentExecutionSequence))return null;for(const ee of y.agentExecutionSequence)if(ee.thinkActSteps){for(const se of ee.thinkActSteps)if(((A=se.subPlanExecutionRecord)==null?void 0:A.currentPlanId)===L)return se.subPlanExecutionRecord}return null},g=(v,w,L,R)=>{var ke,re,b,c,_;if(!v.steps||w>=v.steps.length){u.value=null,$.value=null,console.warn("[RightPanel] Invalid step data:",{planId:L,stepIndex:w,hasSteps:!!v.steps,stepsLength:(ke=v.steps)==null?void 0:ke.length,message:"Invalid step index"});return}E.value=L;const y=v.steps[w],A=(re=v.agentExecutionSequence)==null?void 0:re[w];console.log("[RightPanel] Step data details:",{planId:L,stepIndex:w,step:y,hasAgentExecutionSequence:!!v.agentExecutionSequence,agentExecutionSequenceLength:(b=v.agentExecutionSequence)==null?void 0:b.length,agentExecution:A,hasThinkActSteps:!!(A!=null&&A.thinkActSteps),thinkActStepsLength:(c=A==null?void 0:A.thinkActSteps)==null?void 0:c.length,isSubPlan:R});const ee=(A==null?void 0:A.status)==="FINISHED",se=!ee&&w===v.currentStepIndex&&!v.completed,me={planId:L,index:w,title:typeof y=="string"?y:y.title||y.description||y.name||`${R?"Sub ":""}Step ${w+1}`,description:typeof y=="string"?y:y.description||y,completed:ee,current:se};A&&(me.agentExecution=A),u.value=me,console.log("[RightPanel] Step details updated:",{planId:L,stepIndex:w,stepTitle:u.value.title,hasAgentExecution:!!A,hasThinkActSteps:(((_=A==null?void 0:A.thinkActSteps)==null?void 0:_.length)??0)>0,completed:ee,current:se,planCurrentStep:v.currentStepIndex,planCompleted:v.completed,isSubPlan:R}),A!=null&&A.thinkActSteps&&A.thinkActSteps.forEach((I,t)=>{I.subPlanExecutionRecord&&console.log(`[RightPanel] Found sub-plan in thinkActStep ${t}:`,I.subPlanExecutionRecord)}),setTimeout(()=>{U()},100),V()},S=(v,w,L,R)=>{console.log("[RightPanel] Sub plan step selected (delegating to unified handler):",{rootPlanId:v,subPlanId:w,stepIndex:L,subStepIndex:R}),G(w,R,v,w,R)},K=v=>{d.value=v??void 0},U=()=>{if(!d.value)return;const{scrollTop:v,scrollHeight:w,clientHeight:L}=d.value,R=w-v-L<50,y=w>L;O.value=R,x.value=y&&!R,R?P.value=!0:w-v-L>100&&(P.value=!1),console.log("[RightPanel] Scroll state check:",{scrollTop:v,scrollHeight:w,clientHeight:L,isAtBottom:R,hasScrollableContent:y,showButton:x.value,shouldAutoScroll:P.value})},q=()=>{d.value&&(d.value.scrollTo({top:d.value.scrollHeight,behavior:"smooth"}),ne(()=>{P.value=!0,U()}))},V=()=>{!P.value||!d.value||ne(()=>{d.value&&(d.value.scrollTop=d.value.scrollHeight,console.log("[RightPanel] Auto scroll to bottom"))})},Q=v=>{if(v===null||typeof v>"u"||v==="")return"N/A";try{const w=typeof v=="object"?v:JSON.parse(v);return JSON.stringify(w,null,2)}catch{return String(v)}},ce=()=>{u.value=null,E.value=void 0,P.value=!0,d.value&&d.value.removeEventListener("scroll",U)},be=()=>{const v=()=>{const w=d.value;return w?(K(w),w.addEventListener("scroll",U),P.value=!0,U(),console.log("[RightPanel] Scroll listener initialized successfully"),!0):(console.log("[RightPanel] Scroll container not found, retrying..."),!1)};ne(()=>{v()||setTimeout(()=>{v()},100)})};return Se(()=>{console.log("[RightPanel] Component mounted"),ne(()=>{be()})}),De(()=>{console.log("[RightPanel] Component unmounting, cleaning up..."),$.value=null,ce()}),n({updateDisplayedPlanProgress:X,handleStepSelected:G,handleSubPlanStepSelected:S}),(v,w)=>{var L,R;return h(),m("div",bn,[e("div",kn,[e("div",_n,[e("button",$n,[k(i(C),{icon:"carbon:events"}),Y(" "+l(i(s)("rightPanel.stepExecutionDetails")),1)])])]),e("div",Pn,[e("div",Cn,[u.value?(h(),m("div",Sn,[e("h3",null,l(u.value.title||u.value.description||i(s)("rightPanel.defaultStepTitle",{number:u.value.index+1})),1),u.value.agentExecution?(h(),m("div",yn,[e("div",En,[e("span",wn,l(i(s)("rightPanel.executingAgent"))+":",1),e("span",Tn,l(u.value.agentExecution.agentName),1)]),e("div",In,[e("span",Dn,l(i(s)("rightPanel.description"))+":",1),e("span",xn,l(u.value.agentExecution.agentDescription||""),1)]),e("div",Rn,[e("span",An,l(i(s)("rightPanel.callingModel"))+":",1),e("span",Mn,l(u.value.agentExecution.modelName),1)]),e("div",Nn,[e("span",Un,l(i(s)("rightPanel.request"))+":",1),e("span",Ln,l(u.value.agentExecution.agentRequest||""),1)]),e("div",qn,[e("span",Fn,l(i(s)("rightPanel.executionResult"))+":",1),e("span",{class:te(["value",{success:u.value.agentExecution.status==="FINISHED"}])},l(u.value.agentExecution.status||i(s)("rightPanel.executing")),3)])])):F("",!0),e("div",Vn,[e("div",On,[u.value.completed?(h(),ue(i(C),{key:0,icon:"carbon:checkmark-filled",class:"status-icon success"})):u.value.current?(h(),ue(i(C),{key:1,icon:"carbon:in-progress",class:"status-icon progress"})):(h(),ue(i(C),{key:2,icon:"carbon:time",class:"status-icon pending"})),e("span",Bn,l(B.value),1)])])])):F("",!0),e("div",{ref_key:"scrollContainer",ref:d,class:"step-details-scroll-container",onScroll:U},[u.value?(h(),m("div",Wn,[(L=u.value.agentExecution)!=null&&L.thinkActSteps&&u.value.agentExecution.thinkActSteps.length>0?(h(),m("div",jn,[e("h4",null,l(i(s)("rightPanel.thinkAndActionSteps")),1),e("div",Hn,[(h(!0),m(ge,null,ve(u.value.agentExecution.thinkActSteps,(y,A)=>(h(),m("div",{key:A,class:"think-act-step"},[e("div",zn,[e("span",Jn,"#"+l(A+1),1),e("span",{class:te(["step-status",y.status])},l(y.status||i(s)("rightPanel.executing")),3)]),e("div",Gn,[e("h5",null,[k(i(C),{icon:"carbon:thinking"}),Y(" "+l(i(s)("rightPanel.thinking")),1)]),e("div",Xn,[e("div",Kn,[e("span",Qn,l(i(s)("rightPanel.input"))+":",1),e("pre",null,l(Q(y.thinkInput)),1)]),e("div",Yn,[e("span",Zn,l(i(s)("rightPanel.output"))+":",1),e("pre",null,l(Q(y.thinkOutput)),1)])])]),y.actionNeeded?(h(),m("div",es,[e("h5",null,[k(i(C),{icon:"carbon:play"}),Y(" "+l(i(s)("rightPanel.action")),1)]),e("div",ts,[(h(!0),m(ge,null,ve(y.actToolInfoList,(ee,se)=>(h(),m("div",{key:se},[e("div",ns,[e("span",ss,l(i(s)("rightPanel.tool"))+":",1),e("span",os,l(ee.name||""),1)]),e("div",as,[e("span",ls,l(i(s)("rightPanel.toolParameters"))+":",1),e("pre",null,l(Q(ee.parameters)),1)]),e("div",is,[e("span",cs,l(i(s)("rightPanel.executionResult"))+":",1),e("pre",null,l(Q(ee.result)),1)])]))),128))]),y.subPlanExecutionRecord?(h(),m("div",rs,[e("h5",null,[k(i(C),{icon:"carbon:tree-view"}),Y(" "+l(i(s)("rightPanel.subPlan")),1)]),e("div",us,[e("div",ds,[e("div",ps,[e("span",hs,l(v.$t("rightPanel.subPlanId"))+":",1),e("span",gs,l(y.subPlanExecutionRecord.currentPlanId),1)]),y.subPlanExecutionRecord.title?(h(),m("div",ms,[e("span",vs,l(v.$t("rightPanel.title"))+":",1),e("span",fs,l(y.subPlanExecutionRecord.title),1)])):F("",!0),e("div",bs,[y.subPlanExecutionRecord.completed?(h(),ue(i(C),{key:0,icon:"carbon:checkmark-filled",class:"status-icon success"})):(h(),ue(i(C),{key:1,icon:"carbon:in-progress",class:"status-icon progress"})),e("span",ks,l(y.subPlanExecutionRecord.completed?v.$t("rightPanel.status.completed"):v.$t("rightPanel.status.executing")),1)])])])])):F("",!0)])):F("",!0)]))),128))]),u.value.agentExecution&&!((R=u.value.agentExecution.thinkActSteps)!=null&&R.length)?(h(),m("div",_s,[e("p",null,l(i(s)("rightPanel.noStepDetails")),1)])):u.value.agentExecution?F("",!0):(h(),m("div",$s,[k(i(C),{icon:"carbon:information",class:"info-icon"}),e("h4",null,l(i(s)("rightPanel.stepInfo")),1),e("div",Ps,[e("div",Cs,[e("span",Ss,l(i(s)("rightPanel.stepName"))+":",1),e("span",ys,l(u.value.title||u.value.description||v.$t("rightPanel.stepNumber",{number:u.value.index+1})),1)]),u.value.description?(h(),m("div",Es,[e("span",ws,l(v.$t("rightPanel.description"))+":",1),e("span",Ts,l(u.value.description),1)])):F("",!0),e("div",Is,[e("span",Ds,l(v.$t("rightPanel.status.label"))+":",1),e("span",{class:te(["value",{"status-completed":u.value.completed,"status-current":u.value.current,"status-pending":!u.value.completed&&!u.value.current}])},l(u.value.completed?v.$t("rightPanel.status.completed"):u.value.current?v.$t("rightPanel.status.executing"):v.$t("rightPanel.status.pending")),3)])]),e("p",xs,l(i(s)("rightPanel.noExecutionInfo")),1)])),u.value.current&&!u.value.completed?(h(),m("div",Rs,[w[0]||(w[0]=e("div",{class:"execution-waves"},[e("div",{class:"wave wave-1"}),e("div",{class:"wave wave-2"}),e("div",{class:"wave wave-3"})],-1)),e("p",As,[k(i(C),{icon:"carbon:in-progress",class:"rotating-icon"}),Y(" "+l(i(s)("rightPanel.stepExecuting")),1)])])):F("",!0)])):(h(),m("div",Ms,[k(i(C),{icon:"carbon:events",class:"empty-icon"}),e("h3",null,l(i(s)("rightPanel.noStepSelected")),1),e("p",null,l(i(s)("rightPanel.selectStepHint")),1)]))])):F("",!0),k(xe,{name:"scroll-button"},{default:Re(()=>[x.value?(h(),m("button",{key:0,onClick:q,class:"scroll-to-bottom-btn",title:i(s)("rightPanel.scrollToBottom")},[k(i(C),{icon:"carbon:chevron-down"})],8,Ns)):F("",!0)]),_:1})],544)])])])}}}),Ls=ye(Us,[["__scopeId","data-v-3c3758b3"]]);function qs(){const T=oe,n=_e(()=>T.getActivePlanId()),s=_e(()=>T.getState()),d=_e(()=>s.value.isPolling),E=_e(()=>!!n.value),u=(P,B)=>{T.initiatePlanExecutionSequence(P,B)},$=()=>{T.stopPolling()},x=()=>{T.startPolling()},O=()=>{T.cleanup()};return De(()=>{O()}),{activePlanId:n,state:s,isPolling:d,hasActivePlan:E,startExecution:u,stopPolling:$,startPolling:x,cleanup:O}}const Fs={class:"chat-container"},Vs={class:"message-content"},Os={key:0,class:"user-message"},Bs={key:1,class:"assistant-message"},Ws={key:0,class:"thinking-section"},js={class:"thinking-header"},Hs={class:"thinking-avatar"},zs={class:"thinking-label"},Js={class:"thinking-content"},Gs={key:0,class:"thinking"},Xs={key:1,class:"progress"},Ks={class:"progress-bar"},Qs={class:"progress-text"},Ys={key:2,class:"steps-container"},Zs={class:"steps-title"},eo=["onClick"],to={class:"section-header"},no={class:"step-icon"},so={class:"step-title"},oo={key:0,class:"step-status current"},ao={key:1,class:"step-status completed"},lo={key:2,class:"step-status pending"},io={key:0,class:"action-info"},co={class:"action-description"},ro={class:"action-icon"},uo={key:0,class:"tool-params"},po={class:"param-label"},ho={class:"param-content"},go={key:1,class:"think-details"},mo={class:"think-header"},vo={class:"think-label"},fo={class:"think-output"},bo={class:"think-content"},ko={key:1,class:"sub-plan-steps"},_o={class:"sub-plan-header"},$o={class:"sub-plan-title"},Po={class:"sub-plan-step-list"},Co=["onClick"],So={class:"sub-step-indicator"},yo={class:"sub-step-icon"},Eo={class:"sub-step-number"},wo={class:"sub-step-content"},To={class:"sub-step-title"},Io={class:"sub-step-badge"},Do={key:2,class:"user-input-form-container"},xo={class:"user-input-message"},Ro={key:0,class:"form-description"},Ao=["onSubmit"],Mo=["for"],No=["id","name","onUpdate:modelValue"],Uo={key:1,class:"form-group"},Lo={for:"form-input-genericInput"},qo=["onUpdate:modelValue"],Fo={type:"submit",class:"submit-user-input-btn"},Vo={key:3,class:"default-processing"},Oo={class:"processing-indicator"},Bo={class:"response-section"},Wo={class:"response-header"},jo={class:"response-avatar"},Ho={class:"response-name"},zo={class:"response-content"},Jo={key:0,class:"final-response"},Go=["innerHTML"],Xo={key:1,class:"response-placeholder"},Ko={class:"typing-indicator"},Qo={class:"typing-text"},Yo={key:0,class:"message assistant"},Zo={class:"message-content"},ea={class:"assistant-message"},ta={class:"thinking-section"},na={class:"thinking-header"},sa={class:"thinking-avatar"},oa={class:"thinking-label"},aa={class:"thinking-content"},la={class:"default-processing"},ia={class:"processing-indicator"},ca={class:"response-section"},ra={class:"response-header"},ua={class:"response-avatar"},da={class:"response-name"},pa={class:"response-content"},ha={class:"response-placeholder"},ga={class:"typing-indicator"},ma={class:"typing-text"},va=["title"],fa=Ce({__name:"index",props:{mode:{default:"plan"},initialPrompt:{default:""}},emits:["step-selected","sub-plan-step-selected"],setup(T,{expose:n,emit:s}){const d=T,E=s,{t:u}=Ie(),$=qs(),x=D(),O=D(!1),P=D([]),B=D(),X=D(!1),G=at({}),o=(t,a,r)=>{const p={id:Date.now().toString(),type:t,content:a,timestamp:new Date,...r};return t==="assistant"&&!p.thinking&&!p.content&&(p.thinking=u("chat.thinking")),P.value.push(p),p},g=t=>{const a=P.value[P.value.length-1];a.type==="assistant"&&Object.assign(a,t)},S=async t=>{try{O.value=!0;const a=o("assistant","",{thinking:u("chat.thinkingProcessing")}),r=await qe.sendMessage(t);if(r.planId)console.log("[ChatComponent] Received planId from direct execution:",r.planId),a.planExecution||(a.planExecution={}),a.planExecution.currentPlanId=r.planId,oe.handlePlanExecutionRequested(r.planId,t),delete a.thinking,console.log("[ChatComponent] Started polling for plan execution updates");else{delete a.thinking;const p=K(r,t);a.content=p}}catch(a){console.error("Direct mode error:",a),g({content:U(a)})}finally{O.value=!1}},K=(t,a)=>t.result??t.message??t.content??"",U=t=>{const a=(t==null?void 0:t.message)??(t==null?void 0:t.toString())??u("chat.unknownError");return a.includes("network")||a.includes("timeout")?u("chat.networkError"):a.includes("auth")||a.includes("unauthorized")?u("chat.authError"):a.includes("invalid")||a.includes("format")||a.includes("parameter")?u("chat.formatError"):`${u("chat.unknownError")} (${a})`},q=(t=!1)=>{ne(()=>{if(x.value){const a=x.value;(t||a.scrollHeight-a.scrollTop-a.clientHeight<150)&&a.scrollTo({top:a.scrollHeight,behavior:t?"auto":"smooth"})}})},V=()=>{q(!0),X.value=!1},Q=()=>{if(x.value){const t=x.value,a=t.scrollHeight-t.scrollTop-t.clientHeight<150;X.value=!a&&P.value.length>0}},ce=()=>{x.value&&x.value.addEventListener("scroll",Q)},be=()=>{x.value&&x.value.removeEventListener("scroll",Q)},v=t=>{o("user",t),d.mode==="plan"?console.log("[ChatComponent] Plan mode message sent, parent should handle:",t):S(t)},w=(t,a)=>{var W;const r=((W=t.planExecution)==null?void 0:W.agentExecutionSequence)??[];return a<0||a>=r.length?"IDLE":r[a].status??"IDLE"},L=(t,a)=>{var r,p;if(!((r=t.planExecution)!=null&&r.currentPlanId)){console.warn("[ChatComponent] Cannot handle step click: missing currentPlanId");return}console.log("[ChatComponent] Step clicked:",{planId:t.planExecution.currentPlanId,stepIndex:a,stepTitle:(p=t.planExecution.steps)==null?void 0:p[a]}),E("step-selected",t.planExecution.currentPlanId,a)},R=(t,a)=>{var r;try{const p=(r=t.planExecution)==null?void 0:r.agentExecutionSequence;if(!(p!=null&&p.length))return console.log("[ChatComponent] No agentExecutionSequence found"),[];const W=p[a];if(!W)return console.log(`[ChatComponent] No agentExecution found for step ${a}`),[];if(!W.thinkActSteps)return console.log(`[ChatComponent] No thinkActSteps found for step ${a}`),[];for(const N of W.thinkActSteps)if(N.subPlanExecutionRecord)return console.log(`[ChatComponent] Found sub-plan for step ${a}:`,N.subPlanExecutionRecord),(N.subPlanExecutionRecord.steps??[]).map(j=>typeof j=="string"?j:typeof j=="object"&&j!==null&&(j.title||j.description)||u("rightPanel.subStep"));return[]}catch(p){return console.warn("[ChatComponent] Error getting sub-plan steps:",p),[]}},y=(t,a,r)=>{var p;try{const W=(p=t.planExecution)==null?void 0:p.agentExecutionSequence;if(!(W!=null&&W.length))return"pending";const N=W[a];if(!N||!N.thinkActSteps)return"pending";let Z=null;for(const H of N.thinkActSteps)if(H.subPlanExecutionRecord){Z=H.subPlanExecutionRecord;break}if(!Z)return"pending";const j=Z.currentStepIndex;return Z.completed?"completed":j==null?r===0?"current":"pending":r{var p,W;try{const N=(p=t.planExecution)==null?void 0:p.agentExecutionSequence;if(!(N!=null&&N.length)){console.warn("[ChatComponent] No agentExecutionSequence data for sub-plan step click");return}const Z=N[a];if(!Z){console.warn("[ChatComponent] No agentExecution found for step",a);return}if(!Z.thinkActSteps){console.warn("[ChatComponent] No thinkActSteps found for step",a);return}let j=null;for(const H of Z.thinkActSteps)if(H.subPlanExecutionRecord){j=H.subPlanExecutionRecord;break}if(!(j!=null&&j.currentPlanId)){console.warn("[ChatComponent] No sub-plan data for step click");return}E("sub-plan-step-selected",((W=t.planExecution)==null?void 0:W.currentPlanId)??"",j.currentPlanId,a,r)}catch(N){console.error("[ChatComponent] Error handling sub-plan step click:",N)}},ee=(t,a)=>{var p,W,N,Z;if(!((p=t.planExecution)!=null&&p.steps))return;console.log("[ChatComponent] Starting to update step actions, steps count:",t.planExecution.steps.length,"execution sequence:",((W=a.agentExecutionSequence)==null?void 0:W.length)??0);const r=new Array(t.planExecution.steps.length).fill(null);if((N=a.agentExecutionSequence)!=null&&N.length){const j=Math.min(a.agentExecutionSequence.length,t.planExecution.steps.length);for(let H=0;Hj==null?void 0:j.actionDescription))),ne(()=>{console.log("[ChatComponent] UI update completed via reactivity")})},se=t=>{console.log("[ChatComponent] Starting dialog round with planId:",t),t&&(P.value.findIndex(r=>{var p;return((p=r.planExecution)==null?void 0:p.currentPlanId)===t&&r.type==="assistant"})===-1?(o("assistant","",{planExecution:{currentPlanId:t},thinking:u("chat.preparingExecution")}),console.log("[ChatComponent] Created new assistant message for planId:",t)):console.log("[ChatComponent] Found existing assistant message for planId:",t))},me=t=>{var N,Z,j,H;console.log("[ChatComponent] Processing plan update with rootPlanId:",t);const a=oe.getCachedPlanRecord(t);if(!a){console.warn("[ChatComponent] No cached plan data found for rootPlanId:",t);return}if(console.log("[ChatComponent] Retrieved plan details from cache:",a),console.log("[ChatComponent] Plan steps:",a.steps),console.log("[ChatComponent] Plan completed:",a.completed),!a.currentPlanId){console.warn("[ChatComponent] Plan update missing currentPlanId");return}const r=P.value.findIndex(M=>{var z;return((z=M.planExecution)==null?void 0:z.currentPlanId)===a.currentPlanId&&M.type==="assistant"});let p;if(r!==-1)p=P.value[r],console.log("[ChatComponent] Found existing assistant message for currentPlanId:",a.currentPlanId);else{console.warn("[ChatComponent] No existing assistant message found for currentPlanId:",a.currentPlanId),console.log("[ChatComponent] Current messages:",P.value.map(z=>{var ae;return{type:z.type,planId:(ae=z.planExecution)==null?void 0:ae.currentPlanId,content:z.content.substring(0,50)}}));let M=-1;for(let z=P.value.length-1;z>=0;z--)if(P.value[z].type==="assistant"){M=z;break}if(M!==-1)p=P.value[M],p.planExecution||(p.planExecution={}),p.planExecution.currentPlanId=a.currentPlanId,console.log("[ChatComponent] Using last assistant message and updating planExecution.currentPlanId to:",a.currentPlanId);else{console.error("[ChatComponent] No assistant message found at all, this should not happen");return}}if(p.planExecution||(p.planExecution={}),p.planExecution=JSON.parse(JSON.stringify(a)),!a.steps||a.steps.length===0){if(console.log("[ChatComponent] Handling simple response without steps"),a.completed){delete p.thinking;const M=a.summary??a.result??a.message??u("chat.executionCompleted");p.content=ke(M),console.log("[ChatComponent] Set simple response content:",p.content)}else a.title&&(p.thinking=`${u("chat.thinkingExecuting",{title:a.title})}`);return}delete p.thinking;const W=a.steps.map(M=>typeof M=="string"?M:typeof M=="object"&&M!==null&&(M.title||M.description)||u("chat.step"));if(p.planExecution&&(p.planExecution.steps=W),a.agentExecutionSequence&&a.agentExecutionSequence.length>0){console.log("[ChatComponent] Found execution sequence data, count:",a.agentExecutionSequence.length),ee(p,a);const M=a.currentStepIndex??0;if(M>=0&&M0){const Ee=ae[ae.length-1];if(Ee.thinkOutput){const Me=Ee.thinkOutput.length>150?Ee.thinkOutput.substring(0,150)+"...":Ee.thinkOutput;p.thinking=`${u("chat.thinking")}: ${Me}`}}}}else if(p.planExecution){const M=p.planExecution.currentStepIndex??0,z=(N=p.planExecution.steps)==null?void 0:N[M],ae=typeof z=="string"?z:"";p.thinking=`${u("chat.thinkingExecuting",{title:ae})}`}if(a.userInputWaitState&&p.planExecution?(console.log("[ChatComponent] User input required:",a.userInputWaitState),p.planExecution.userInputWaitState||(p.planExecution.userInputWaitState={}),p.planExecution.userInputWaitState={message:a.userInputWaitState.message??"",formDescription:a.userInputWaitState.formDescription??"",formInputs:((Z=a.userInputWaitState.formInputs)==null?void 0:Z.map(M=>({label:M.label,value:M.value||""})))??[]},G[j=p.id]??(G[j]={}),p.thinking=u("input.waiting")):(H=p.planExecution)!=null&&H.userInputWaitState&&delete p.planExecution.userInputWaitState,a.completed??a.status==="completed"){console.log("[ChatComponent] Plan is completed, updating final response"),delete p.thinking;let M="";a.summary?M=a.summary:a.result?M=a.result:M=u("chat.executionCompleted"),p.content=re(M),console.log("[ChatComponent] Updated completed message:",p.content)}ne(()=>{console.log("[ChatComponent] Plan update UI refresh completed via reactivity")})},ke=t=>t?t.includes("I ")||t.includes("you")||t.includes("hello")||t.includes("can")||t.includes("I")||t.includes("you")||t.includes("can")?t:t.length<10?`${t}! ${u("chat.anythingElse")}`:t.length<50?`${u("chat.okayDone",{text:t})}. ${u("chat.ifOtherQuestions")}`:`${t} +var ct=Object.defineProperty;var rt=(T,n,s)=>n in T?ct(T,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):T[n]=s;var he=(T,n,s)=>rt(T,typeof n!="symbol"?n+"":n,s);import{d as Ce,u as Ie,c as _e,o as Se,a as m,b as h,n as te,x as i,e,f as F,t as l,g as k,i as Y,F as ge,l as ve,h as ie,w as de,j as fe,z as at,r as D,y as ne,A as De,s as ue,T as xe,k as Re,B as $e,q as Ue,C as Ne,D as ut,E as dt,p as lt,G as pt}from"./index-CNsQoPg8.js";import{I as C}from"./iconify-B3l7reUz.js";import{s as f,P as Ae,u as it}from"./sidebar-ON4PvQzg.js";import{_ as ye}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{L as ht}from"./llm-check-BVkAKrj3.js";import{L as gt}from"./index-rqS3tjXd.js";import{u as mt,a as vt}from"./useMessage-BR4qCw-P.js";const ft={class:"sidebar-content"},bt={class:"sidebar-content-header"},kt={class:"sidebar-content-title"},_t={class:"tab-switcher"},$t=["disabled"],Pt={key:0,class:"tab-content"},Ct={class:"new-task-section"},St={class:"sidebar-content-list"},yt={key:0,class:"loading-state"},Et={key:1,class:"error-state"},wt={key:2,class:"empty-state"},Tt=["onClick"],It={class:"task-icon"},Dt={class:"task-details"},xt={class:"task-title"},Rt={class:"task-preview"},At={class:"task-time"},Mt={class:"task-actions"},Nt=["title","onClick"],Ut={key:1,class:"tab-content config-tab"},Lt={key:0,class:"config-container"},qt={class:"template-info-header"},Ft={class:"template-info"},Vt={class:"template-id"},Ot={class:"config-section"},Bt={class:"section-header"},Wt={class:"generator-content"},jt=["placeholder"],Ht={class:"generator-actions"},zt=["disabled"],Jt=["disabled"],Gt={class:"config-section"},Xt={class:"section-header"},Kt={class:"section-actions"},Qt=["disabled","title"],Yt=["disabled","title"],Zt=["disabled"],en=["placeholder"],tn={class:"config-section"},nn={class:"section-header"},sn={class:"execution-content"},on={class:"params-input-group"},an={class:"params-help-text"},ln={class:"params-input-container"},cn=["placeholder"],rn=["title"],un={class:"api-url-display"},dn={class:"api-url-label"},pn={class:"api-url"},hn={class:"api-url-display"},gn={class:"api-url-label"},mn=["disabled"],vn=Ce({__name:"index",emits:["planExecutionRequested"],setup(T,{expose:n,emit:s}){const{t:d}=Ie(),E=["currentPlanId","userRequest","rootPlanId"],u=_e({get(){try{if(!f.jsonContent)return"";const g={...JSON.parse(f.jsonContent)};return E.forEach(S=>{delete g[S]}),JSON.stringify(g,null,2)}catch{return f.jsonContent}},set(o){try{if(!o.trim()){f.jsonContent="";return}const g=JSON.parse(o);let S={};try{S=JSON.parse(f.jsonContent||"{}")}catch{}const K={...g};E.forEach(U=>{S[U]!==void 0&&(K[U]=S[U])}),f.jsonContent=JSON.stringify(K)}catch{f.jsonContent=o}}}),$=s,x=async()=>{try{const o=await f.saveTemplate();o!=null&&o.duplicate?alert(d("sidebar.saveCompleted",{message:o.message,versionCount:o.versionCount})):o!=null&&o.saved?alert(d("sidebar.saveSuccess",{message:o.message,versionCount:o.versionCount})):o!=null&&o.message&&alert(d("sidebar.saveStatus",{message:o.message}))}catch(o){console.error("Failed to save plan modifications:",o),alert(o.message||d("sidebar.saveFailed"))}},O=async()=>{var o;try{await f.generatePlan(),alert(d("sidebar.generateSuccess",{templateId:((o=f.selectedTemplate)==null?void 0:o.id)??d("sidebar.unknown")}))}catch(g){console.error("Failed to generate plan:",g),alert(d("sidebar.generateFailed")+": "+g.message)}},P=async()=>{try{await f.updatePlan(),alert(d("sidebar.updateSuccess"))}catch(o){console.error("Failed to update plan:",o),alert(d("sidebar.updateFailed")+": "+o.message)}},B=async()=>{console.log("[Sidebar] handleExecutePlan called");try{const o=f.preparePlanExecution();if(!o){console.log("[Sidebar] No plan data available, returning");return}console.log("[Sidebar] Triggering plan execution request:",o),console.log("[Sidebar] Emitting planExecutionRequested event"),$("planExecutionRequested",o),console.log("[Sidebar] Event emitted")}catch(o){console.error("Error executing plan:",o),alert(d("sidebar.executeFailed")+": "+o.message)}finally{f.finishPlanExecution()}},X=o=>{if(isNaN(o.getTime()))return console.warn("Invalid date received:",o),d("time.unknown");const S=new Date().getTime()-o.getTime(),K=Math.floor(S/6e4),U=Math.floor(S/36e5),q=Math.floor(S/864e5);return K<1?d("time.now"):K<60?d("time.minuteAgo",{count:K}):U<24?d("time.hourAgo",{count:U}):q<30?d("time.dayAgo",{count:q}):o.toLocaleDateString("zh-CN")},G=(o,g)=>!o||o.length<=g?o:o.substring(0,g)+"...";return Se(()=>{f.loadPlanTemplateList()}),n({loadPlanTemplateList:f.loadPlanTemplateList,toggleSidebar:f.toggleSidebar,currentPlanTemplateId:f.currentPlanTemplateId}),(o,g)=>(h(),m("div",{class:te(["sidebar-wrapper",{"sidebar-wrapper-collapsed":i(f).isCollapsed}])},[e("div",ft,[e("div",bt,[e("div",kt,l(o.$t("sidebar.title")),1)]),e("div",_t,[e("button",{class:te(["tab-button",{active:i(f).currentTab==="list"}]),onClick:g[0]||(g[0]=S=>i(f).switchToTab("list"))},[k(i(C),{icon:"carbon:list",width:"16"}),Y(" "+l(o.$t("sidebar.templateList")),1)],2),e("button",{class:te(["tab-button",{active:i(f).currentTab==="config"}]),onClick:g[1]||(g[1]=S=>i(f).switchToTab("config")),disabled:!i(f).selectedTemplate},[k(i(C),{icon:"carbon:settings",width:"16"}),Y(" "+l(o.$t("sidebar.configuration")),1)],10,$t)]),i(f).currentTab==="list"?(h(),m("div",Pt,[e("div",Ct,[e("button",{class:"new-task-btn",onClick:g[2]||(g[2]=S=>i(f).createNewTemplate())},[k(i(C),{icon:"carbon:add",width:"16"}),Y(" "+l(o.$t("sidebar.newPlan"))+" ",1),g[11]||(g[11]=e("span",{class:"shortcut"},"⌘ K",-1))])]),e("div",St,[i(f).isLoading?(h(),m("div",yt,[k(i(C),{icon:"carbon:circle-dash",width:"20",class:"spinning"}),e("span",null,l(o.$t("sidebar.loading")),1)])):i(f).errorMessage?(h(),m("div",Et,[k(i(C),{icon:"carbon:warning",width:"20"}),e("span",null,l(i(f).errorMessage),1),e("button",{onClick:g[3]||(g[3]=(...S)=>i(f).loadPlanTemplateList&&i(f).loadPlanTemplateList(...S)),class:"retry-btn"},l(o.$t("sidebar.retry")),1)])):i(f).planTemplateList.length===0?(h(),m("div",wt,[k(i(C),{icon:"carbon:document",width:"32"}),e("span",null,l(o.$t("sidebar.noTemplates")),1)])):(h(!0),m(ge,{key:3},ve(i(f).sortedTemplates,S=>(h(),m("div",{key:S.id,class:te(["sidebar-content-list-item",{"sidebar-content-list-item-active":S.id===i(f).currentPlanTemplateId}]),onClick:K=>i(f).selectTemplate(S)},[e("div",It,[k(i(C),{icon:"carbon:document",width:"20"})]),e("div",Dt,[e("div",xt,l(S.title||o.$t("sidebar.unnamedPlan")),1),e("div",Rt,l(G(S.description||o.$t("sidebar.noDescription"),40)),1)]),e("div",At,l(X(i(f).parseDateTime(S.updateTime||S.createTime))),1),e("div",Mt,[e("button",{class:"delete-task-btn",title:o.$t("sidebar.deleteTemplate"),onClick:ie(K=>i(f).deleteTemplate(S),["stop"])},[k(i(C),{icon:"carbon:close",width:"16"})],8,Nt)])],10,Tt))),128))])])):i(f).currentTab==="config"?(h(),m("div",Ut,[i(f).selectedTemplate?(h(),m("div",Lt,[e("div",qt,[e("div",Ft,[e("h3",null,l(i(f).selectedTemplate.title||o.$t("sidebar.unnamedPlan")),1),e("span",Vt,"ID: "+l(i(f).selectedTemplate.id),1)]),e("button",{class:"back-to-list-btn",onClick:g[4]||(g[4]=S=>i(f).switchToTab("list"))},[k(i(C),{icon:"carbon:arrow-left",width:"16"})])]),e("div",Ot,[e("div",Bt,[k(i(C),{icon:"carbon:generate",width:"16"}),e("span",null,l(o.$t("sidebar.planGenerator")),1)]),e("div",Wt,[de(e("textarea",{"onUpdate:modelValue":g[5]||(g[5]=S=>i(f).generatorPrompt=S),class:"prompt-input",placeholder:o.$t("sidebar.generatorPlaceholder"),rows:"3"},null,8,jt),[[fe,i(f).generatorPrompt]]),e("div",Ht,[e("button",{class:"btn btn-primary btn-sm",onClick:O,disabled:i(f).isGenerating||!i(f).generatorPrompt.trim()},[k(i(C),{icon:i(f).isGenerating?"carbon:circle-dash":"carbon:generate",width:"14",class:te({spinning:i(f).isGenerating})},null,8,["icon","class"]),Y(" "+l(i(f).isGenerating?o.$t("sidebar.generating"):o.$t("sidebar.generatePlan")),1)],8,zt),e("button",{class:"btn btn-secondary btn-sm",onClick:P,disabled:i(f).isGenerating||!i(f).generatorPrompt.trim()||!i(f).jsonContent.trim()},[k(i(C),{icon:"carbon:edit",width:"14"}),Y(" "+l(o.$t("sidebar.updatePlan")),1)],8,Jt)])])]),e("div",Gt,[e("div",Xt,[k(i(C),{icon:"carbon:code",width:"16"}),e("span",null,l(o.$t("sidebar.jsonTemplate")),1),e("div",Kt,[e("button",{class:"btn btn-sm",onClick:g[6]||(g[6]=(...S)=>i(f).rollbackVersion&&i(f).rollbackVersion(...S)),disabled:!i(f).canRollback,title:o.$t("sidebar.rollback")},[k(i(C),{icon:"carbon:undo",width:"14"})],8,Qt),e("button",{class:"btn btn-sm",onClick:g[7]||(g[7]=(...S)=>i(f).restoreVersion&&i(f).restoreVersion(...S)),disabled:!i(f).canRestore,title:o.$t("sidebar.restore")},[k(i(C),{icon:"carbon:redo",width:"14"})],8,Yt),e("button",{class:"btn btn-primary btn-sm",onClick:x,disabled:i(f).isGenerating||i(f).isExecuting},[k(i(C),{icon:"carbon:save",width:"14"})],8,Zt)])]),de(e("textarea",{"onUpdate:modelValue":g[8]||(g[8]=S=>u.value=S),class:"json-editor",placeholder:o.$t("sidebar.jsonPlaceholder"),rows:"12"},null,8,en),[[fe,u.value]])]),e("div",tn,[e("div",nn,[k(i(C),{icon:"carbon:play",width:"16"}),e("span",null,l(o.$t("sidebar.executionController")),1)]),e("div",sn,[e("div",on,[e("label",null,l(o.$t("sidebar.executionParams")),1),e("div",an,l(o.$t("sidebar.executionParamsHelp")),1),e("div",ln,[de(e("input",{"onUpdate:modelValue":g[9]||(g[9]=S=>i(f).executionParams=S),class:"params-input",placeholder:o.$t("sidebar.executionParamsPlaceholder")},null,8,cn),[[fe,i(f).executionParams]]),e("button",{class:"clear-params-btn",onClick:g[10]||(g[10]=(...S)=>i(f).clearExecutionParams&&i(f).clearExecutionParams(...S)),title:o.$t("sidebar.clearParams")},[k(i(C),{icon:"carbon:close",width:"12"})],8,rn)])]),e("div",un,[e("span",dn,l(o.$t("sidebar.apiUrl"))+":",1),e("code",pn,l(i(f).computedApiUrl),1)]),e("div",hn,[e("span",gn,l(o.$t("sidebar.statusApiUrl"))+":",1),g[12]||(g[12]=e("code",{class:"api-url"},"/api/executor/details/{planId}",-1))]),e("button",{class:"btn btn-primary execute-btn",onClick:B,disabled:i(f).isExecuting||i(f).isGenerating},[k(i(C),{icon:i(f).isExecuting?"carbon:circle-dash":"carbon:play",width:"16",class:te({spinning:i(f).isExecuting})},null,8,["icon","class"]),Y(" "+l(i(f).isExecuting?o.$t("sidebar.executing"):o.$t("sidebar.executePlan")),1)],8,mn)])])])):F("",!0)])):F("",!0)])],2))}}),fn=ye(vn,[["__scopeId","data-v-3c0cf310"]]);class qe{static async sendMessage(n){return ht.withLlmCheck(async()=>{const s=await fetch(`${this.BASE_URL}/execute`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:n})});if(!s.ok)throw new Error(`API request failed: ${s.status}`);return await s.json()})}}he(qe,"BASE_URL","/api/executor");class Fe{static async getDetails(n){try{const s=await fetch(`${this.BASE_URL}/details/${n}`);if(s.status===404)return null;if(!s.ok){const u=await s.text();throw new Error(`Failed to get detailed information: ${s.status} - ${u}`)}const d=await s.text(),E=JSON.parse(d);return E&&typeof E=="object"&&!E.currentPlanId&&(E.currentPlanId=n),E}catch(s){return console.error("[CommonApiService] Failed to get plan details:",s),{currentPlanId:n,status:"failed",message:s instanceof Error?s.message:"Failed to save, please retry"}}}static async submitFormInput(n,s){const d=await fetch(`${this.BASE_URL}/submit-input/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!d.ok){let u;try{u=await d.json()}catch{u={message:`Failed to submit form input: ${d.status}`}}throw new Error(u.message||`Failed to submit form input: ${d.status}`)}const E=d.headers.get("content-type");return E&&E.indexOf("application/json")!==-1?await d.json():{success:!0}}static async getAllPrompts(){try{const n=await fetch(this.BASE_URL);return await(await this.handleResponse(n)).json()}catch(n){throw console.error("Failed to get Prompt list:",n),n}}static async handleResponse(n){if(!n.ok)try{const s=await n.json();throw new Error(s.message||`API request failed: ${n.status}`)}catch{throw new Error(`API request failed: ${n.status} ${n.statusText}`)}return n}}he(Fe,"BASE_URL","/api/executor");const Pe=class Pe{constructor(){he(this,"POLL_INTERVAL",5e3);he(this,"state",at({activePlanId:null,lastSequenceSize:0,isPolling:!1,pollTimer:null}));he(this,"callbacks",{});he(this,"planExecutionCache",new Map);he(this,"uiStateCache",new Map);console.log("[PlanExecutionManager] Initialized with callback-based event system")}getCachedPlanRecord(n){return this.planExecutionCache.get(n)}getCachedUIState(n){return this.uiStateCache.get(n)}setCachedUIState(n,s){this.uiStateCache.set(n,s),console.log(`[PlanExecutionManager] Cached UI state for rootPlanId: ${n}`)}getAllCachedRecords(){return new Map(this.planExecutionCache)}hasCachedPlanRecord(n){return this.planExecutionCache.has(n)}setCachedPlanRecord(n,s){this.planExecutionCache.set(n,s),console.log(`[PlanExecutionManager] Cached plan execution record for rootPlanId: ${n}`)}clearCachedPlanRecord(n){const s=this.planExecutionCache.delete(n);return s&&console.log(`[PlanExecutionManager] Cleared cached plan execution record for rootPlanId: ${n}`),s}clearAllCachedRecords(){const n=this.planExecutionCache.size,s=this.uiStateCache.size;this.planExecutionCache.clear(),this.uiStateCache.clear(),console.log(`[PlanExecutionManager] Cleared all caches - Plans: ${n}, UI States: ${s}`)}static getInstance(){return Pe.instance||(Pe.instance=new Pe),Pe.instance}getActivePlanId(){return this.state.activePlanId}getState(){return this.state}setEventCallbacks(n){this.callbacks={...this.callbacks,...n},console.log("[PlanExecutionManager] Event callbacks set:",Object.keys(n))}async handleUserMessageSendRequested(n){if(this.validateAndPrepareUIForNewRequest(n))try{if(await this.sendUserMessageAndSetPlanId(n),this.state.activePlanId)this.initiatePlanExecutionSequence(n,this.state.activePlanId);else throw new Error("Failed to get valid plan ID")}catch(s){console.error("[PlanExecutionManager] Failed to send user message:",s);const d=this.state.activePlanId??"error";this.setCachedUIState(d,{enabled:!0}),this.emitChatInputUpdateState(d),this.state.activePlanId=null}}handlePlanExecutionRequested(n,s){console.log("[PlanExecutionManager] Received plan execution request:",{planId:n,query:s}),n?(this.state.activePlanId=n,this.initiatePlanExecutionSequence(s??"Execute Plan",n)):console.error("[PlanExecutionManager] Invalid plan execution request: missing planId")}handleCachedPlanExecution(n,s){const d=this.getCachedPlanRecord(n);return d!=null&&d.currentPlanId?(console.log(`[PlanExecutionManager] Found cached plan execution record for rootPlanId: ${n}`),this.handlePlanExecutionRequested(d.currentPlanId,s),!0):(console.log(`[PlanExecutionManager] No cached plan execution record found for rootPlanId: ${n}`),!1)}validateAndPrepareUIForNewRequest(n){if(!n)return console.warn("[PlanExecutionManager] Query is empty"),!1;if(this.state.activePlanId)return!1;this.emitChatInputClear();const s=this.state.activePlanId??"ui-state";return this.setCachedUIState(s,{enabled:!1,placeholder:"Processing..."}),this.emitChatInputUpdateState(s),!0}async sendUserMessageAndSetPlanId(n){try{const s=await qe.sendMessage(n);if(s!=null&&s.planId)return this.state.activePlanId=s.planId,s;if(s!=null&&s.planTemplateId)return this.state.activePlanId=s.planTemplateId,{...s,planId:s.planTemplateId};throw console.error("[PlanExecutionManager] Failed to get planId from response:",s),new Error("Failed to get valid planId from API response")}catch(s){throw console.error("[PlanExecutionManager] API call failed:",s),s}}initiatePlanExecutionSequence(n,s){console.log(`[PlanExecutionManager] Starting plan execution sequence for query: "${n}", planId: ${s}`);const d=s;this.emitDialogRoundStart(d),this.startPolling()}handlePlanCompletion(n){this.emitPlanCompleted(n.rootPlanId??""),this.state.lastSequenceSize=0,this.stopPolling();try{setTimeout(async()=>{if(this.state.activePlanId)try{await Ae.deletePlanTemplate(this.state.activePlanId),console.log(`[PlanExecutionManager] Plan template ${this.state.activePlanId} deleted successfully`)}catch(s){console.log(`Delete plan execution record failed: ${s.message}`)}},5e3)}catch(s){console.log(`Delete plan execution record failed: ${s.message}`)}n.completed&&(this.state.activePlanId=null,this.emitChatInputUpdateState(n.rootPlanId??""))}handlePlanError(n){this.emitPlanError(n.message??""),this.state.lastSequenceSize=0,this.stopPolling();try{setTimeout(async()=>{if(this.state.activePlanId)try{await Ae.deletePlanTemplate(this.state.activePlanId),console.log(`[PlanExecutionManager] Plan template ${this.state.activePlanId} deleted successfully`)}catch(s){console.log(`Delete plan execution record failed: ${s.message}`)}},5e3)}catch(s){console.log(`Delete plan execution record failed: ${s.message}`)}}async pollPlanStatus(){if(this.state.activePlanId){if(this.state.isPolling){console.log("[PlanExecutionManager] Previous polling still in progress, skipping");return}try{this.state.isPolling=!0;const n=await this.getPlanDetails(this.state.activePlanId);if(!n){console.warn("[PlanExecutionManager] No details received from API");return}if(n.status&&n.status==="failed"){this.handlePlanError(n);return}if(n.rootPlanId&&this.setCachedPlanRecord(n.rootPlanId,n),!n.steps||n.steps.length===0){console.log("[PlanExecutionManager] Simple response without steps detected, handling as completed"),this.emitPlanUpdate(n.rootPlanId??""),this.handlePlanCompletion(n);return}this.emitPlanUpdate(n.rootPlanId??""),n.completed&&this.handlePlanCompletion(n)}catch(n){console.error("[PlanExecutionManager] Failed to poll plan status:",n)}finally{this.state.isPolling=!1}}}async getPlanDetails(n){try{const s=await Fe.getDetails(n);return s!=null&&s.rootPlanId&&(this.planExecutionCache.set(s.rootPlanId,s),console.log(`[PlanExecutionManager] Cached plan execution record for rootPlanId: ${s.rootPlanId}`)),s}catch(s){return console.error("[PlanExecutionManager] Failed to get plan details:",s),{currentPlanId:n,status:"failed",message:s instanceof Error?s.message:"Failed to get plan"}}}startPolling(){this.state.pollTimer&&clearInterval(this.state.pollTimer),this.state.pollTimer=window.setInterval(()=>{this.pollPlanStatus()},this.POLL_INTERVAL),console.log("[PlanExecutionManager] Started polling")}async pollPlanStatusImmediately(){console.log("[PlanExecutionManager] Polling plan status immediately"),await this.pollPlanStatus()}stopPolling(){this.state.pollTimer&&(clearInterval(this.state.pollTimer),this.state.pollTimer=null),console.log("[PlanExecutionManager] Stopped polling")}cleanup(){this.stopPolling(),this.state.activePlanId=null,this.state.lastSequenceSize=0,this.state.isPolling=!1,this.clearAllCachedRecords()}emitChatInputClear(){this.callbacks.onChatInputClear&&this.callbacks.onChatInputClear()}emitChatInputUpdateState(n){this.callbacks.onChatInputUpdateState&&this.callbacks.onChatInputUpdateState(n)}emitDialogRoundStart(n){this.callbacks.onDialogRoundStart&&this.callbacks.onDialogRoundStart(n)}emitPlanUpdate(n){this.callbacks.onPlanUpdate&&this.callbacks.onPlanUpdate(n)}emitPlanCompleted(n){this.callbacks.onPlanCompleted&&this.callbacks.onPlanCompleted(n)}emitPlanError(n){this.callbacks.onPlanError&&this.callbacks.onPlanError(n)}};he(Pe,"instance",null);let Le=Pe;const oe=Le.getInstance(),bn={class:"right-panel"},kn={class:"preview-header"},_n={class:"preview-tabs"},$n={class:"tab-button active"},Pn={class:"preview-content"},Cn={class:"step-details"},Sn={key:0,class:"step-info-fixed"},yn={key:0,class:"agent-info"},En={class:"info-item"},wn={class:"label"},Tn={class:"value"},In={class:"info-item"},Dn={class:"label"},xn={class:"value"},Rn={class:"info-item"},An={class:"label"},Mn={class:"value"},Nn={class:"info-item"},Un={class:"label"},Ln={class:"value"},qn={class:"info-item"},Fn={class:"label"},Vn={class:"execution-status"},On={class:"status-item"},Bn={class:"status-text"},Wn={key:0},jn={key:0,class:"think-act-steps"},Hn={class:"steps-container"},zn={class:"step-header"},Jn={class:"step-number"},Gn={class:"think-section"},Xn={class:"think-content"},Kn={class:"input"},Qn={class:"label"},Yn={class:"output"},Zn={class:"label"},es={key:0,class:"action-section"},ts={class:"action-content"},ns={class:"tool-info"},ss={class:"label"},os={class:"value"},as={class:"input"},ls={class:"label"},is={class:"output"},cs={class:"label"},rs={key:0,class:"sub-plan-section"},us={class:"sub-plan-content"},ds={class:"sub-plan-header"},ps={class:"sub-plan-info"},hs={class:"label"},gs={class:"value"},ms={key:0,class:"sub-plan-info"},vs={class:"label"},fs={class:"value"},bs={class:"sub-plan-status"},ks={class:"status-text"},_s={key:0,class:"no-steps-message"},$s={key:1,class:"no-execution-message"},Ps={class:"step-basic-info"},Cs={class:"info-item"},Ss={class:"label"},ys={class:"value"},Es={key:0,class:"info-item"},ws={class:"label"},Ts={class:"value"},Is={class:"info-item"},Ds={class:"label"},xs={class:"no-execution-hint"},Rs={key:2,class:"execution-indicator"},As={class:"execution-text"},Ms={key:1,class:"no-selection"},Ns=["title"],Us=Ce({__name:"index",setup(T,{expose:n}){const{t:s}=Ie(),d=D(),E=D(),u=D(),$=D(null),x=D(!1),O=D(!0),P=D(!0),B=_e(()=>u.value?u.value.completed?s("rightPanel.status.completed"):u.value.current?s("rightPanel.status.executing"):s("rightPanel.status.waiting"):""),X=v=>{var L;if(console.log(`[RightPanel] updateDisplayedPlanProgress called with rootPlanId: ${v}`),u.value&&$.value){const R=$.value.rootPlanId??E.value;if(R&&R!==v){console.log(`[RightPanel] Plan ID mismatch - skipping update. Current: ${R}, Requested: ${v}`);return}}console.log(`[RightPanel] Plan ID validation passed - proceeding with update for rootPlanId: ${v}`);const w=oe.getCachedPlanRecord(v);if(!w){console.warn(`[RightPanel] Plan data not found for rootPlanId: ${v}`);return}if(w.steps&&w.steps.length>0){const R=w.steps.length,y=(w.currentStepIndex??0)+1;console.log(`[RightPanel] Progress: ${y} / ${R}`)}if(u.value&&E.value&&(E.value===v||((L=$.value)==null?void 0:L.rootPlanId)===v)&&(console.log(`[RightPanel] Refreshing selected step details for plan: ${v}`),$.value)){const y=$.value,A=o(y.planId,y.rootPlanId,y.subPlanId);A?(g(A,y.stepIndex,y.planId,y.isSubPlan),V()):console.warn("[RightPanel] Could not find plan record for refresh:",y)}},G=(v,w,L,R,y)=>{console.log("[RightPanel] Step selected:",{planId:v,stepIndex:w,rootPlanId:L,subPlanId:R,subStepIndex:y});const A=!!(L&&R&&y!==void 0);$.value={planId:v,stepIndex:w,isSubPlan:A,...A&&{rootPlanId:L,subPlanId:R,subStepIndex:y}};const ee=o(v,L,R);if(!ee){console.warn("[RightPanel] Plan data not found:",{planId:v,rootPlanId:L,subPlanId:R}),u.value=null,$.value=null;return}g(ee,w,v,A)},o=(v,w,L)=>{var A;if(!w||!L)return oe.getCachedPlanRecord(v)??null;const R=oe.getCachedPlanRecord(v);if(R)return R;const y=oe.getCachedPlanRecord(w);if(!(y!=null&&y.agentExecutionSequence))return null;for(const ee of y.agentExecutionSequence)if(ee.thinkActSteps){for(const se of ee.thinkActSteps)if(((A=se.subPlanExecutionRecord)==null?void 0:A.currentPlanId)===L)return se.subPlanExecutionRecord}return null},g=(v,w,L,R)=>{var ke,re,b,c,_;if(!v.steps||w>=v.steps.length){u.value=null,$.value=null,console.warn("[RightPanel] Invalid step data:",{planId:L,stepIndex:w,hasSteps:!!v.steps,stepsLength:(ke=v.steps)==null?void 0:ke.length,message:"Invalid step index"});return}E.value=L;const y=v.steps[w],A=(re=v.agentExecutionSequence)==null?void 0:re[w];console.log("[RightPanel] Step data details:",{planId:L,stepIndex:w,step:y,hasAgentExecutionSequence:!!v.agentExecutionSequence,agentExecutionSequenceLength:(b=v.agentExecutionSequence)==null?void 0:b.length,agentExecution:A,hasThinkActSteps:!!(A!=null&&A.thinkActSteps),thinkActStepsLength:(c=A==null?void 0:A.thinkActSteps)==null?void 0:c.length,isSubPlan:R});const ee=(A==null?void 0:A.status)==="FINISHED",se=!ee&&w===v.currentStepIndex&&!v.completed,me={planId:L,index:w,title:typeof y=="string"?y:y.title||y.description||y.name||`${R?"Sub ":""}Step ${w+1}`,description:typeof y=="string"?y:y.description||y,completed:ee,current:se};A&&(me.agentExecution=A),u.value=me,console.log("[RightPanel] Step details updated:",{planId:L,stepIndex:w,stepTitle:u.value.title,hasAgentExecution:!!A,hasThinkActSteps:(((_=A==null?void 0:A.thinkActSteps)==null?void 0:_.length)??0)>0,completed:ee,current:se,planCurrentStep:v.currentStepIndex,planCompleted:v.completed,isSubPlan:R}),A!=null&&A.thinkActSteps&&A.thinkActSteps.forEach((I,t)=>{I.subPlanExecutionRecord&&console.log(`[RightPanel] Found sub-plan in thinkActStep ${t}:`,I.subPlanExecutionRecord)}),setTimeout(()=>{U()},100),V()},S=(v,w,L,R)=>{console.log("[RightPanel] Sub plan step selected (delegating to unified handler):",{rootPlanId:v,subPlanId:w,stepIndex:L,subStepIndex:R}),G(w,R,v,w,R)},K=v=>{d.value=v??void 0},U=()=>{if(!d.value)return;const{scrollTop:v,scrollHeight:w,clientHeight:L}=d.value,R=w-v-L<50,y=w>L;O.value=R,x.value=y&&!R,R?P.value=!0:w-v-L>100&&(P.value=!1),console.log("[RightPanel] Scroll state check:",{scrollTop:v,scrollHeight:w,clientHeight:L,isAtBottom:R,hasScrollableContent:y,showButton:x.value,shouldAutoScroll:P.value})},q=()=>{d.value&&(d.value.scrollTo({top:d.value.scrollHeight,behavior:"smooth"}),ne(()=>{P.value=!0,U()}))},V=()=>{!P.value||!d.value||ne(()=>{d.value&&(d.value.scrollTop=d.value.scrollHeight,console.log("[RightPanel] Auto scroll to bottom"))})},Q=v=>{if(v===null||typeof v>"u"||v==="")return"N/A";try{const w=typeof v=="object"?v:JSON.parse(v);return JSON.stringify(w,null,2)}catch{return String(v)}},ce=()=>{u.value=null,E.value=void 0,P.value=!0,d.value&&d.value.removeEventListener("scroll",U)},be=()=>{const v=()=>{const w=d.value;return w?(K(w),w.addEventListener("scroll",U),P.value=!0,U(),console.log("[RightPanel] Scroll listener initialized successfully"),!0):(console.log("[RightPanel] Scroll container not found, retrying..."),!1)};ne(()=>{v()||setTimeout(()=>{v()},100)})};return Se(()=>{console.log("[RightPanel] Component mounted"),ne(()=>{be()})}),De(()=>{console.log("[RightPanel] Component unmounting, cleaning up..."),$.value=null,ce()}),n({updateDisplayedPlanProgress:X,handleStepSelected:G,handleSubPlanStepSelected:S}),(v,w)=>{var L,R;return h(),m("div",bn,[e("div",kn,[e("div",_n,[e("button",$n,[k(i(C),{icon:"carbon:events"}),Y(" "+l(i(s)("rightPanel.stepExecutionDetails")),1)])])]),e("div",Pn,[e("div",Cn,[u.value?(h(),m("div",Sn,[e("h3",null,l(u.value.title||u.value.description||i(s)("rightPanel.defaultStepTitle",{number:u.value.index+1})),1),u.value.agentExecution?(h(),m("div",yn,[e("div",En,[e("span",wn,l(i(s)("rightPanel.executingAgent"))+":",1),e("span",Tn,l(u.value.agentExecution.agentName),1)]),e("div",In,[e("span",Dn,l(i(s)("rightPanel.description"))+":",1),e("span",xn,l(u.value.agentExecution.agentDescription||""),1)]),e("div",Rn,[e("span",An,l(i(s)("rightPanel.callingModel"))+":",1),e("span",Mn,l(u.value.agentExecution.modelName),1)]),e("div",Nn,[e("span",Un,l(i(s)("rightPanel.request"))+":",1),e("span",Ln,l(u.value.agentExecution.agentRequest||""),1)]),e("div",qn,[e("span",Fn,l(i(s)("rightPanel.executionResult"))+":",1),e("span",{class:te(["value",{success:u.value.agentExecution.status==="FINISHED"}])},l(u.value.agentExecution.status||i(s)("rightPanel.executing")),3)])])):F("",!0),e("div",Vn,[e("div",On,[u.value.completed?(h(),ue(i(C),{key:0,icon:"carbon:checkmark-filled",class:"status-icon success"})):u.value.current?(h(),ue(i(C),{key:1,icon:"carbon:in-progress",class:"status-icon progress"})):(h(),ue(i(C),{key:2,icon:"carbon:time",class:"status-icon pending"})),e("span",Bn,l(B.value),1)])])])):F("",!0),e("div",{ref_key:"scrollContainer",ref:d,class:"step-details-scroll-container",onScroll:U},[u.value?(h(),m("div",Wn,[(L=u.value.agentExecution)!=null&&L.thinkActSteps&&u.value.agentExecution.thinkActSteps.length>0?(h(),m("div",jn,[e("h4",null,l(i(s)("rightPanel.thinkAndActionSteps")),1),e("div",Hn,[(h(!0),m(ge,null,ve(u.value.agentExecution.thinkActSteps,(y,A)=>(h(),m("div",{key:A,class:"think-act-step"},[e("div",zn,[e("span",Jn,"#"+l(A+1),1),e("span",{class:te(["step-status",y.status])},l(y.status||i(s)("rightPanel.executing")),3)]),e("div",Gn,[e("h5",null,[k(i(C),{icon:"carbon:thinking"}),Y(" "+l(i(s)("rightPanel.thinking")),1)]),e("div",Xn,[e("div",Kn,[e("span",Qn,l(i(s)("rightPanel.input"))+":",1),e("pre",null,l(Q(y.thinkInput)),1)]),e("div",Yn,[e("span",Zn,l(i(s)("rightPanel.output"))+":",1),e("pre",null,l(Q(y.thinkOutput)),1)])])]),y.actionNeeded?(h(),m("div",es,[e("h5",null,[k(i(C),{icon:"carbon:play"}),Y(" "+l(i(s)("rightPanel.action")),1)]),e("div",ts,[(h(!0),m(ge,null,ve(y.actToolInfoList,(ee,se)=>(h(),m("div",{key:se},[e("div",ns,[e("span",ss,l(i(s)("rightPanel.tool"))+":",1),e("span",os,l(ee.name||""),1)]),e("div",as,[e("span",ls,l(i(s)("rightPanel.toolParameters"))+":",1),e("pre",null,l(Q(ee.parameters)),1)]),e("div",is,[e("span",cs,l(i(s)("rightPanel.executionResult"))+":",1),e("pre",null,l(Q(ee.result)),1)])]))),128))]),y.subPlanExecutionRecord?(h(),m("div",rs,[e("h5",null,[k(i(C),{icon:"carbon:tree-view"}),Y(" "+l(i(s)("rightPanel.subPlan")),1)]),e("div",us,[e("div",ds,[e("div",ps,[e("span",hs,l(v.$t("rightPanel.subPlanId"))+":",1),e("span",gs,l(y.subPlanExecutionRecord.currentPlanId),1)]),y.subPlanExecutionRecord.title?(h(),m("div",ms,[e("span",vs,l(v.$t("rightPanel.title"))+":",1),e("span",fs,l(y.subPlanExecutionRecord.title),1)])):F("",!0),e("div",bs,[y.subPlanExecutionRecord.completed?(h(),ue(i(C),{key:0,icon:"carbon:checkmark-filled",class:"status-icon success"})):(h(),ue(i(C),{key:1,icon:"carbon:in-progress",class:"status-icon progress"})),e("span",ks,l(y.subPlanExecutionRecord.completed?v.$t("rightPanel.status.completed"):v.$t("rightPanel.status.executing")),1)])])])])):F("",!0)])):F("",!0)]))),128))]),u.value.agentExecution&&!((R=u.value.agentExecution.thinkActSteps)!=null&&R.length)?(h(),m("div",_s,[e("p",null,l(i(s)("rightPanel.noStepDetails")),1)])):u.value.agentExecution?F("",!0):(h(),m("div",$s,[k(i(C),{icon:"carbon:information",class:"info-icon"}),e("h4",null,l(i(s)("rightPanel.stepInfo")),1),e("div",Ps,[e("div",Cs,[e("span",Ss,l(i(s)("rightPanel.stepName"))+":",1),e("span",ys,l(u.value.title||u.value.description||v.$t("rightPanel.stepNumber",{number:u.value.index+1})),1)]),u.value.description?(h(),m("div",Es,[e("span",ws,l(v.$t("rightPanel.description"))+":",1),e("span",Ts,l(u.value.description),1)])):F("",!0),e("div",Is,[e("span",Ds,l(v.$t("rightPanel.status.label"))+":",1),e("span",{class:te(["value",{"status-completed":u.value.completed,"status-current":u.value.current,"status-pending":!u.value.completed&&!u.value.current}])},l(u.value.completed?v.$t("rightPanel.status.completed"):u.value.current?v.$t("rightPanel.status.executing"):v.$t("rightPanel.status.pending")),3)])]),e("p",xs,l(i(s)("rightPanel.noExecutionInfo")),1)])),u.value.current&&!u.value.completed?(h(),m("div",Rs,[w[0]||(w[0]=e("div",{class:"execution-waves"},[e("div",{class:"wave wave-1"}),e("div",{class:"wave wave-2"}),e("div",{class:"wave wave-3"})],-1)),e("p",As,[k(i(C),{icon:"carbon:in-progress",class:"rotating-icon"}),Y(" "+l(i(s)("rightPanel.stepExecuting")),1)])])):F("",!0)])):(h(),m("div",Ms,[k(i(C),{icon:"carbon:events",class:"empty-icon"}),e("h3",null,l(i(s)("rightPanel.noStepSelected")),1),e("p",null,l(i(s)("rightPanel.selectStepHint")),1)]))])):F("",!0),k(xe,{name:"scroll-button"},{default:Re(()=>[x.value?(h(),m("button",{key:0,onClick:q,class:"scroll-to-bottom-btn",title:i(s)("rightPanel.scrollToBottom")},[k(i(C),{icon:"carbon:chevron-down"})],8,Ns)):F("",!0)]),_:1})],544)])])])}}}),Ls=ye(Us,[["__scopeId","data-v-3c3758b3"]]);function qs(){const T=oe,n=_e(()=>T.getActivePlanId()),s=_e(()=>T.getState()),d=_e(()=>s.value.isPolling),E=_e(()=>!!n.value),u=(P,B)=>{T.initiatePlanExecutionSequence(P,B)},$=()=>{T.stopPolling()},x=()=>{T.startPolling()},O=()=>{T.cleanup()};return De(()=>{O()}),{activePlanId:n,state:s,isPolling:d,hasActivePlan:E,startExecution:u,stopPolling:$,startPolling:x,cleanup:O}}const Fs={class:"chat-container"},Vs={class:"message-content"},Os={key:0,class:"user-message"},Bs={key:1,class:"assistant-message"},Ws={key:0,class:"thinking-section"},js={class:"thinking-header"},Hs={class:"thinking-avatar"},zs={class:"thinking-label"},Js={class:"thinking-content"},Gs={key:0,class:"thinking"},Xs={key:1,class:"progress"},Ks={class:"progress-bar"},Qs={class:"progress-text"},Ys={key:2,class:"steps-container"},Zs={class:"steps-title"},eo=["onClick"],to={class:"section-header"},no={class:"step-icon"},so={class:"step-title"},oo={key:0,class:"step-status current"},ao={key:1,class:"step-status completed"},lo={key:2,class:"step-status pending"},io={key:0,class:"action-info"},co={class:"action-description"},ro={class:"action-icon"},uo={key:0,class:"tool-params"},po={class:"param-label"},ho={class:"param-content"},go={key:1,class:"think-details"},mo={class:"think-header"},vo={class:"think-label"},fo={class:"think-output"},bo={class:"think-content"},ko={key:1,class:"sub-plan-steps"},_o={class:"sub-plan-header"},$o={class:"sub-plan-title"},Po={class:"sub-plan-step-list"},Co=["onClick"],So={class:"sub-step-indicator"},yo={class:"sub-step-icon"},Eo={class:"sub-step-number"},wo={class:"sub-step-content"},To={class:"sub-step-title"},Io={class:"sub-step-badge"},Do={key:2,class:"user-input-form-container"},xo={class:"user-input-message"},Ro={key:0,class:"form-description"},Ao=["onSubmit"],Mo=["for"],No=["id","name","onUpdate:modelValue"],Uo={key:1,class:"form-group"},Lo={for:"form-input-genericInput"},qo=["onUpdate:modelValue"],Fo={type:"submit",class:"submit-user-input-btn"},Vo={key:3,class:"default-processing"},Oo={class:"processing-indicator"},Bo={class:"response-section"},Wo={class:"response-header"},jo={class:"response-avatar"},Ho={class:"response-name"},zo={class:"response-content"},Jo={key:0,class:"final-response"},Go=["innerHTML"],Xo={key:1,class:"response-placeholder"},Ko={class:"typing-indicator"},Qo={class:"typing-text"},Yo={key:0,class:"message assistant"},Zo={class:"message-content"},ea={class:"assistant-message"},ta={class:"thinking-section"},na={class:"thinking-header"},sa={class:"thinking-avatar"},oa={class:"thinking-label"},aa={class:"thinking-content"},la={class:"default-processing"},ia={class:"processing-indicator"},ca={class:"response-section"},ra={class:"response-header"},ua={class:"response-avatar"},da={class:"response-name"},pa={class:"response-content"},ha={class:"response-placeholder"},ga={class:"typing-indicator"},ma={class:"typing-text"},va=["title"],fa=Ce({__name:"index",props:{mode:{default:"plan"},initialPrompt:{default:""}},emits:["step-selected","sub-plan-step-selected"],setup(T,{expose:n,emit:s}){const d=T,E=s,{t:u}=Ie(),$=qs(),x=D(),O=D(!1),P=D([]),B=D(),X=D(!1),G=at({}),o=(t,a,r)=>{const p={id:Date.now().toString(),type:t,content:a,timestamp:new Date,...r};return t==="assistant"&&!p.thinking&&!p.content&&(p.thinking=u("chat.thinking")),P.value.push(p),p},g=t=>{const a=P.value[P.value.length-1];a.type==="assistant"&&Object.assign(a,t)},S=async t=>{try{O.value=!0;const a=o("assistant","",{thinking:u("chat.thinkingProcessing")}),r=await qe.sendMessage(t);if(r.planId)console.log("[ChatComponent] Received planId from direct execution:",r.planId),a.planExecution||(a.planExecution={}),a.planExecution.currentPlanId=r.planId,oe.handlePlanExecutionRequested(r.planId,t),delete a.thinking,console.log("[ChatComponent] Started polling for plan execution updates");else{delete a.thinking;const p=K(r,t);a.content=p}}catch(a){console.error("Direct mode error:",a),g({content:U(a)})}finally{O.value=!1}},K=(t,a)=>t.result??t.message??t.content??"",U=t=>{const a=(t==null?void 0:t.message)??(t==null?void 0:t.toString())??u("chat.unknownError");return a.includes("network")||a.includes("timeout")?u("chat.networkError"):a.includes("auth")||a.includes("unauthorized")?u("chat.authError"):a.includes("invalid")||a.includes("format")||a.includes("parameter")?u("chat.formatError"):`${u("chat.unknownError")} (${a})`},q=(t=!1)=>{ne(()=>{if(x.value){const a=x.value;(t||a.scrollHeight-a.scrollTop-a.clientHeight<150)&&a.scrollTo({top:a.scrollHeight,behavior:t?"auto":"smooth"})}})},V=()=>{q(!0),X.value=!1},Q=()=>{if(x.value){const t=x.value,a=t.scrollHeight-t.scrollTop-t.clientHeight<150;X.value=!a&&P.value.length>0}},ce=()=>{x.value&&x.value.addEventListener("scroll",Q)},be=()=>{x.value&&x.value.removeEventListener("scroll",Q)},v=t=>{o("user",t),d.mode==="plan"?console.log("[ChatComponent] Plan mode message sent, parent should handle:",t):S(t)},w=(t,a)=>{var W;const r=((W=t.planExecution)==null?void 0:W.agentExecutionSequence)??[];return a<0||a>=r.length?"IDLE":r[a].status??"IDLE"},L=(t,a)=>{var r,p;if(!((r=t.planExecution)!=null&&r.currentPlanId)){console.warn("[ChatComponent] Cannot handle step click: missing currentPlanId");return}console.log("[ChatComponent] Step clicked:",{planId:t.planExecution.currentPlanId,stepIndex:a,stepTitle:(p=t.planExecution.steps)==null?void 0:p[a]}),E("step-selected",t.planExecution.currentPlanId,a)},R=(t,a)=>{var r;try{const p=(r=t.planExecution)==null?void 0:r.agentExecutionSequence;if(!(p!=null&&p.length))return console.log("[ChatComponent] No agentExecutionSequence found"),[];const W=p[a];if(!W)return console.log(`[ChatComponent] No agentExecution found for step ${a}`),[];if(!W.thinkActSteps)return console.log(`[ChatComponent] No thinkActSteps found for step ${a}`),[];for(const N of W.thinkActSteps)if(N.subPlanExecutionRecord)return console.log(`[ChatComponent] Found sub-plan for step ${a}:`,N.subPlanExecutionRecord),(N.subPlanExecutionRecord.steps??[]).map(j=>typeof j=="string"?j:typeof j=="object"&&j!==null&&(j.title||j.description)||u("rightPanel.subStep"));return[]}catch(p){return console.warn("[ChatComponent] Error getting sub-plan steps:",p),[]}},y=(t,a,r)=>{var p;try{const W=(p=t.planExecution)==null?void 0:p.agentExecutionSequence;if(!(W!=null&&W.length))return"pending";const N=W[a];if(!N||!N.thinkActSteps)return"pending";let Z=null;for(const H of N.thinkActSteps)if(H.subPlanExecutionRecord){Z=H.subPlanExecutionRecord;break}if(!Z)return"pending";const j=Z.currentStepIndex;return Z.completed?"completed":j==null?r===0?"current":"pending":r{var p,W;try{const N=(p=t.planExecution)==null?void 0:p.agentExecutionSequence;if(!(N!=null&&N.length)){console.warn("[ChatComponent] No agentExecutionSequence data for sub-plan step click");return}const Z=N[a];if(!Z){console.warn("[ChatComponent] No agentExecution found for step",a);return}if(!Z.thinkActSteps){console.warn("[ChatComponent] No thinkActSteps found for step",a);return}let j=null;for(const H of Z.thinkActSteps)if(H.subPlanExecutionRecord){j=H.subPlanExecutionRecord;break}if(!(j!=null&&j.currentPlanId)){console.warn("[ChatComponent] No sub-plan data for step click");return}E("sub-plan-step-selected",((W=t.planExecution)==null?void 0:W.currentPlanId)??"",j.currentPlanId,a,r)}catch(N){console.error("[ChatComponent] Error handling sub-plan step click:",N)}},ee=(t,a)=>{var p,W,N,Z;if(!((p=t.planExecution)!=null&&p.steps))return;console.log("[ChatComponent] Starting to update step actions, steps count:",t.planExecution.steps.length,"execution sequence:",((W=a.agentExecutionSequence)==null?void 0:W.length)??0);const r=new Array(t.planExecution.steps.length).fill(null);if((N=a.agentExecutionSequence)!=null&&N.length){const j=Math.min(a.agentExecutionSequence.length,t.planExecution.steps.length);for(let H=0;Hj==null?void 0:j.actionDescription))),ne(()=>{console.log("[ChatComponent] UI update completed via reactivity")})},se=t=>{console.log("[ChatComponent] Starting dialog round with planId:",t),t&&(P.value.findIndex(r=>{var p;return((p=r.planExecution)==null?void 0:p.currentPlanId)===t&&r.type==="assistant"})===-1?(o("assistant","",{planExecution:{currentPlanId:t},thinking:u("chat.preparingExecution")}),console.log("[ChatComponent] Created new assistant message for planId:",t)):console.log("[ChatComponent] Found existing assistant message for planId:",t))},me=t=>{var N,Z,j,H;console.log("[ChatComponent] Processing plan update with rootPlanId:",t);const a=oe.getCachedPlanRecord(t);if(!a){console.warn("[ChatComponent] No cached plan data found for rootPlanId:",t);return}if(console.log("[ChatComponent] Retrieved plan details from cache:",a),console.log("[ChatComponent] Plan steps:",a.steps),console.log("[ChatComponent] Plan completed:",a.completed),!a.currentPlanId){console.warn("[ChatComponent] Plan update missing currentPlanId");return}const r=P.value.findIndex(M=>{var z;return((z=M.planExecution)==null?void 0:z.currentPlanId)===a.currentPlanId&&M.type==="assistant"});let p;if(r!==-1)p=P.value[r],console.log("[ChatComponent] Found existing assistant message for currentPlanId:",a.currentPlanId);else{console.warn("[ChatComponent] No existing assistant message found for currentPlanId:",a.currentPlanId),console.log("[ChatComponent] Current messages:",P.value.map(z=>{var ae;return{type:z.type,planId:(ae=z.planExecution)==null?void 0:ae.currentPlanId,content:z.content.substring(0,50)}}));let M=-1;for(let z=P.value.length-1;z>=0;z--)if(P.value[z].type==="assistant"){M=z;break}if(M!==-1)p=P.value[M],p.planExecution||(p.planExecution={}),p.planExecution.currentPlanId=a.currentPlanId,console.log("[ChatComponent] Using last assistant message and updating planExecution.currentPlanId to:",a.currentPlanId);else{console.error("[ChatComponent] No assistant message found at all, this should not happen");return}}if(p.planExecution||(p.planExecution={}),p.planExecution=JSON.parse(JSON.stringify(a)),!a.steps||a.steps.length===0){if(console.log("[ChatComponent] Handling simple response without steps"),a.completed){delete p.thinking;const M=a.summary??a.result??a.message??u("chat.executionCompleted");p.content=ke(M),console.log("[ChatComponent] Set simple response content:",p.content)}else a.title&&(p.thinking=`${u("chat.thinkingExecuting",{title:a.title})}`);return}delete p.thinking;const W=a.steps.map(M=>typeof M=="string"?M:typeof M=="object"&&M!==null&&(M.title||M.description)||u("chat.step"));if(p.planExecution&&(p.planExecution.steps=W),a.agentExecutionSequence&&a.agentExecutionSequence.length>0){console.log("[ChatComponent] Found execution sequence data, count:",a.agentExecutionSequence.length),ee(p,a);const M=a.currentStepIndex??0;if(M>=0&&M0){const Ee=ae[ae.length-1];if(Ee.thinkOutput){const Me=Ee.thinkOutput.length>150?Ee.thinkOutput.substring(0,150)+"...":Ee.thinkOutput;p.thinking=`${u("chat.thinking")}: ${Me}`}}}}else if(p.planExecution){const M=p.planExecution.currentStepIndex??0,z=(N=p.planExecution.steps)==null?void 0:N[M],ae=typeof z=="string"?z:"";p.thinking=`${u("chat.thinkingExecuting",{title:ae})}`}if(a.userInputWaitState&&p.planExecution?(console.log("[ChatComponent] User input required:",a.userInputWaitState),p.planExecution.userInputWaitState||(p.planExecution.userInputWaitState={}),p.planExecution.userInputWaitState={message:a.userInputWaitState.message??"",formDescription:a.userInputWaitState.formDescription??"",formInputs:((Z=a.userInputWaitState.formInputs)==null?void 0:Z.map(M=>({label:M.label,value:M.value||""})))??[]},G[j=p.id]??(G[j]={}),p.thinking=u("input.waiting")):(H=p.planExecution)!=null&&H.userInputWaitState&&delete p.planExecution.userInputWaitState,a.completed??a.status==="completed"){console.log("[ChatComponent] Plan is completed, updating final response"),delete p.thinking;let M="";a.summary?M=a.summary:a.result?M=a.result:M=u("chat.executionCompleted"),p.content=re(M),console.log("[ChatComponent] Updated completed message:",p.content)}ne(()=>{console.log("[ChatComponent] Plan update UI refresh completed via reactivity")})},ke=t=>t?t.includes("I ")||t.includes("you")||t.includes("hello")||t.includes("can")||t.includes("I")||t.includes("you")||t.includes("can")?t:t.length<10?`${t}! ${u("chat.anythingElse")}`:t.length<50?`${u("chat.okayDone",{text:t})}. ${u("chat.ifOtherQuestions")}`:`${t} ${u("chat.hopeHelpful")} ${u("chat.anythingElse")}`:u("chat.defaultResponse"),re=t=>t?`${t}`:`${u("chat.executionCompleted")}! ${u("chat.anythingElse")}`,b=t=>{console.log("[ChatComponent] Plan completed with rootPlanId:",t);const a=oe.getCachedPlanRecord(t);if(!a){console.warn("[ChatComponent] No cached plan data found for rootPlanId:",t);return}if(console.log("[ChatComponent] Plan details:",a),a.rootPlanId){const r=P.value.findIndex(p=>{var W;return((W=p.planExecution)==null?void 0:W.currentPlanId)===a.rootPlanId});if(r!==-1){const p=P.value[r];delete p.thinking;let N=a.summary??a.result??u("chat.executionCompleted");!N.includes("I")&&!N.includes("you")&&(N.includes("success")||N.includes("complete")||N.includes("finished")?N=`${u("chat.great")}${N}. ${u("chat.ifOtherHelp")}`:N=`${u("chat.completedRequest",{result:N})}`),p.content=N,console.log("[ChatComponent] Updated completed message:",p.content)}else console.warn("[ChatComponent] No message found for completed rootPlanId:",a.rootPlanId)}},c=t=>{O.value=!1,P.value[P.value.length-1]={id:Date.now().toString(),type:"assistant",content:t,timestamp:new Date}},_=t=>{if(!t)return"";let a=t.replace(/\n\n/g,"

").replace(/\n/g,"
");return a=a.replace(/(

)/g,"

"),a.includes("

")&&(a=`

${a}

`),a},I=async t=>{var a;if(!((a=t.planExecution)!=null&&a.currentPlanId)||!t.planExecution.userInputWaitState){console.error("[ChatComponent] Missing planExecution.currentPlanId or userInputWaitState");return}try{const r={},p=t.planExecution.userInputWaitState.formInputs;p&&p.length>0?Object.entries(G[t.id]).forEach(([N,Z])=>{var M;const j=parseInt(N,10),H=((M=p[j])==null?void 0:M.label)||`input_${N}`;r[H]=Z}):r.genericInput=t.genericInput??"",console.log("[ChatComponent] Submitting user input:",r);const W=await Fe.submitFormInput(t.planExecution.currentPlanId,r);delete t.planExecution.userInputWaitState,delete t.genericInput,delete G[t.id],$.startPolling(),console.log("[ChatComponent] User input submitted successfully:",W)}catch(r){console.error("[ChatComponent] User input submission failed:",r),alert(`${u("common.submitFailed")}: ${(r==null?void 0:r.message)||u("common.unknownError")}`)}};return $e(()=>d.initialPrompt,(t,a)=>{console.log("[ChatComponent] initialPrompt changed from:",a,"to:",t),t&&typeof t=="string"&&t.trim()&&t!==a&&(console.log("[ChatComponent] Processing changed initial prompt:",t),ne(()=>{v(t)}))},{immediate:!1}),Se(()=>{console.log("[ChatComponent] Mounted, setting up event listeners"),oe.setEventCallbacks({onPlanUpdate:me,onPlanCompleted:b,onDialogRoundStart:se,onChatInputUpdateState:t=>{console.log("[ChatComponent] Chat input state update for rootPlanId:",t)},onChatInputClear:()=>{console.log("[ChatComponent] Chat input clear requested")},onPlanError:c}),ne(()=>{ce()}),d.initialPrompt&&typeof d.initialPrompt=="string"&&d.initialPrompt.trim()&&(console.log("[ChatComponent] Processing initial prompt:",d.initialPrompt),ne(()=>{v(d.initialPrompt)}))}),De(()=>{console.log("[ChatComponent] Unmounting, cleaning up resources"),be(),B.value&&clearInterval(B.value),$.cleanup(),Object.keys(G).forEach(t=>delete G[t])}),n({handleSendMessage:v,handlePlanUpdate:me,handlePlanCompleted:b,handleDialogRoundStart:se,addMessage:o,handlePlanError:c}),(t,a)=>(h(),m("div",Fs,[e("div",{class:"messages",ref_key:"messagesRef",ref:x},[(h(!0),m(ge,null,ve(P.value,r=>{var p,W,N,Z,j,H,M,z,ae;return h(),m("div",{key:r.id,class:te(["message",{user:r.type==="user",assistant:r.type==="assistant"}])},[e("div",Vs,[r.type==="user"?(h(),m("div",Os,l(r.content),1)):(h(),m("div",Bs,[r.thinking||((p=r.planExecution)==null?void 0:p.progress)!==void 0||(((N=(W=r.planExecution)==null?void 0:W.steps)==null?void 0:N.length)??0)>0?(h(),m("div",Ws,[e("div",js,[e("div",Hs,[k(i(C),{icon:"carbon:thinking",class:"thinking-icon"})]),e("div",zs,l(t.$t("chat.thinkingLabel")),1)]),e("div",Js,[r.thinking?(h(),m("div",Gs,[k(i(C),{icon:"carbon:thinking",class:"thinking-icon"}),e("span",null,l(r.thinking),1)])):F("",!0),((Z=r.planExecution)==null?void 0:Z.progress)!==void 0?(h(),m("div",Xs,[e("div",Ks,[e("div",{class:"progress-fill",style:Ue({width:r.planExecution.progress+"%"})},null,4)]),e("span",Qs,l(r.planExecution.progressText??t.$t("chat.processing")+"..."),1)])):F("",!0),(((H=(j=r.planExecution)==null?void 0:j.steps)==null?void 0:H.length)??0)>0?(h(),m("div",Ys,[e("h4",Zs,l(t.$t("chat.stepExecutionDetails")),1),(h(!0),m(ge,null,ve((M=r.planExecution)==null?void 0:M.steps,(Ee,J)=>{var Me,Ve,Oe,Be,We,je,He,ze,Je,Ge,Xe,Ke,Qe,Ye,Ze,et,tt,nt,st;return h(),m("div",{key:J,class:te(["ai-section",{running:w(r,J)==="RUNNING",completed:w(r,J)==="FINISHED",pending:w(r,J)==="IDLE"}]),onClick:ie(pe=>L(r,J),["stop"])},[e("div",to,[e("span",no,l(w(r,J)==="FINISHED"?"✓":w(r,J)==="RUNNING"?"▶":"○"),1),e("span",so,l(Ee||`${t.$t("chat.step")} ${J+1}`),1),w(r,J)==="RUNNING"?(h(),m("span",oo,l(t.$t("chat.status.executing")),1)):w(r,J)==="FINISHED"?(h(),m("span",ao,l(t.$t("chat.status.completed")),1)):(h(),m("span",lo,l(t.$t("chat.status.pending")),1))]),r.stepActions&&r.stepActions[J]?(h(),m("div",io,[e("div",co,[e("span",ro,l(((Me=r.stepActions[J])==null?void 0:Me.status)==="current"?"🔄":((Ve=r.stepActions[J])==null?void 0:Ve.status)==="completed"?"✓":"⏳"),1),e("strong",null,l((Oe=r.stepActions[J])==null?void 0:Oe.actionDescription),1)]),(Be=r.stepActions[J])!=null&&Be.toolParameters?(h(),m("div",uo,[a[0]||(a[0]=e("span",{class:"tool-icon"},"⚙️",-1)),e("span",po,l(t.$t("common.parameters"))+":",1),e("pre",ho,l((We=r.stepActions[J])==null?void 0:We.toolParameters),1)])):F("",!0),(je=r.stepActions[J])!=null&&je.thinkOutput?(h(),m("div",go,[e("div",mo,[a[1]||(a[1]=e("span",{class:"think-icon"},"💭",-1)),e("span",vo,l(t.$t("chat.thinkingOutput"))+":",1)]),e("div",fo,[e("pre",bo,l((He=r.stepActions[J])==null?void 0:He.thinkOutput),1)])])):F("",!0)])):F("",!0),((ze=R(r,J))==null?void 0:ze.length)>0?(h(),m("div",ko,[e("div",_o,[k(i(C),{icon:"carbon:tree-view",class:"sub-plan-icon"}),e("span",$o,l(t.$t("rightPanel.subPlan")),1)]),e("div",Po,[(h(!0),m(ge,null,ve(R(r,J),(pe,le)=>(h(),m("div",{key:`sub-${J}-${le}`,class:te(["sub-plan-step-item",{completed:y(r,J,le)==="completed",current:y(r,J,le)==="current",pending:y(r,J,le)==="pending"}]),onClick:ie(ot=>A(r,J,le),["stop"])},[e("div",So,[e("span",yo,l(y(r,J,le)==="completed"?"✓":y(r,J,le)==="current"?"▶":"○"),1),e("span",Eo,l(le+1),1)]),e("div",wo,[e("span",To,l(pe),1),e("span",Io,l(t.$t("rightPanel.subStep")),1)])],10,Co))),128))])])):F("",!0),(Je=r.planExecution)!=null&&Je.userInputWaitState&&w(r,J)==="RUNNING"?(h(),m("div",Do,[e("p",xo,l(((Xe=(Ge=r.planExecution)==null?void 0:Ge.userInputWaitState)==null?void 0:Xe.message)??t.$t("chat.userInput.message")),1),(Qe=(Ke=r.planExecution)==null?void 0:Ke.userInputWaitState)!=null&&Qe.formDescription?(h(),m("p",Ro,l((Ze=(Ye=r.planExecution)==null?void 0:Ye.userInputWaitState)==null?void 0:Ze.formDescription),1)):F("",!0),e("form",{onSubmit:ie(pe=>I(r),["prevent"]),class:"user-input-form"},[(tt=(et=r.planExecution)==null?void 0:et.userInputWaitState)!=null&&tt.formInputs&&r.planExecution.userInputWaitState.formInputs.length>0?(h(!0),m(ge,{key:0},ve((st=(nt=r.planExecution)==null?void 0:nt.userInputWaitState)==null?void 0:st.formInputs,(pe,le)=>(h(),m("div",{key:le,class:"form-group"},[e("label",{for:`form-input-${pe.label.replace(/\W+/g,"_")}`},l(pe.label)+": ",9,Mo),de(e("input",{type:"text",id:`form-input-${pe.label.replace(/\W+/g,"_")}`,name:pe.label,"onUpdate:modelValue":ot=>G[r.id][le]=ot,class:"form-input"},null,8,No),[[fe,G[r.id][le]]])]))),128)):(h(),m("div",Uo,[e("label",Lo,l(t.$t("common.input"))+":",1),de(e("input",{type:"text",id:"form-input-genericInput",name:"genericInput","onUpdate:modelValue":pe=>r.genericInput=pe,class:"form-input"},null,8,qo),[[fe,r.genericInput]])])),e("button",Fo,l(t.$t("chat.userInput.submit")),1)],40,Ao)])):F("",!0)],10,eo)}),128))])):!r.content&&(r.thinking||((z=r.planExecution)==null?void 0:z.progress)!==void 0&&(((ae=r.planExecution)==null?void 0:ae.progress)??0)<100)?(h(),m("div",Vo,[e("div",Oo,[a[2]||(a[2]=e("div",{class:"thinking-dots"},[e("span"),e("span"),e("span")],-1)),e("span",null,l(r.thinking??t.$t("chat.thinkingProcessing")),1)])])):F("",!0)])])):F("",!0),e("div",Bo,[e("div",Wo,[e("div",jo,[k(i(C),{icon:"carbon:bot",class:"bot-icon"})]),e("div",Ho,l(t.$t("chat.botName")),1)]),e("div",zo,[r.content?(h(),m("div",Jo,[e("div",{class:"response-text",innerHTML:_(r.content)},null,8,Go)])):(h(),m("div",Xo,[e("div",Ko,[a[3]||(a[3]=e("div",{class:"typing-dots"},[e("span"),e("span"),e("span")],-1)),e("span",Qo,l(t.$t("chat.thinkingResponse")),1)])]))])])]))])],2)}),128)),O.value?(h(),m("div",Yo,[e("div",Zo,[e("div",ea,[e("div",ta,[e("div",na,[e("div",sa,[k(i(C),{icon:"carbon:thinking",class:"thinking-icon"})]),e("div",oa,l(t.$t("chat.thinkingLabel")),1)]),e("div",aa,[e("div",la,[e("div",ia,[a[4]||(a[4]=e("div",{class:"thinking-dots"},[e("span"),e("span"),e("span")],-1)),e("span",null,l(t.$t("chat.thinking")),1)])])])]),e("div",ca,[e("div",ra,[e("div",ua,[k(i(C),{icon:"carbon:bot",class:"bot-icon"})]),e("div",da,l(t.$t("chat.botName")),1)]),e("div",pa,[e("div",ha,[e("div",ga,[a[5]||(a[5]=e("div",{class:"typing-dots"},[e("span"),e("span"),e("span")],-1)),e("span",ma,l(t.$t("chat.thinkingResponse")),1)])])])])])])])):F("",!0)],512),X.value?(h(),m("div",{key:0,class:"scroll-to-bottom-btn",onClick:V,title:t.$t("chat.scrollToBottom")},[k(i(C),{icon:"carbon:chevron-down"})],8,va)):F("",!0)]))}}),ba=ye(fa,[["__scopeId","data-v-99c33eb1"]]),ka={class:"input-area"},_a={class:"input-container"},$a=["title"],Pa=["placeholder","disabled"],Ca=["title"],Sa=["disabled","title"],ya=Ce({__name:"index",props:{placeholder:{default:""},disabled:{type:Boolean,default:!1},initialValue:{default:""}},emits:["send","clear","update-state","plan-mode-clicked"],setup(T,{expose:n,emit:s}){const{t:d}=Ie(),E=T,u=s,$=D(),x=D(""),O=_e(()=>E.placeholder||d("input.placeholder")),P=D(O.value),B=_e(()=>!!E.disabled),X=()=>{ne(()=>{$.value&&($.value.style.height="auto",$.value.style.height=Math.min($.value.scrollHeight,120)+"px")})},G=V=>{V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),o())},o=()=>{if(!x.value.trim()||B.value)return;const V=x.value.trim();u("send",V),S()},g=()=>{u("plan-mode-clicked")},S=()=>{x.value="",X(),u("clear")},K=(V,Q)=>{Q&&(P.value=V?Q:d("input.waiting")),u("update-state",V,Q)},U=V=>{x.value=V,X()},q=()=>x.value.trim();return $e(()=>E.initialValue,V=>{V&&V.trim()&&(x.value=V,X())},{immediate:!0}),n({clearInput:S,updateState:K,setInputValue:U,getQuery:q,focus:()=>{var V;return(V=$.value)==null?void 0:V.focus()}}),Se(()=>{}),De(()=>{}),(V,Q)=>(h(),m("div",ka,[e("div",_a,[e("button",{class:"attach-btn",title:V.$t("input.attachFile")},[k(i(C),{icon:"carbon:attachment"})],8,$a),de(e("textarea",{"onUpdate:modelValue":Q[0]||(Q[0]=ce=>x.value=ce),ref_key:"inputRef",ref:$,class:"chat-input",placeholder:P.value,disabled:B.value,onKeydown:G,onInput:X},null,40,Pa),[[fe,x.value]]),e("button",{class:"plan-mode-btn",title:V.$t("input.planMode"),onClick:g},[k(i(C),{icon:"carbon:document"}),Y(" "+l(V.$t("input.planMode")),1)],8,Ca),e("button",{class:"send-button",disabled:!x.value.trim()||B.value,onClick:o,title:V.$t("input.send")},[k(i(C),{icon:"carbon:send-alt"}),Y(" "+l(V.$t("input.send")),1)],8,Sa)])]))}}),Ea=ye(ya,[["__scopeId","data-v-4b2cba42"]]);class we{static async getAllCronTasks(){try{const n=await fetch(this.BASE_URL);return await(await this.handleResponse(n)).json()}catch(n){throw console.error("Failed to get cron tasks:",n),n}}static async getCronTaskById(n){try{const s=await fetch(`${this.BASE_URL}/${n}`);return await(await this.handleResponse(s)).json()}catch(s){throw console.error("Failed to get cron task by id:",s),s}}static async createCronTask(n){try{const s=await fetch(this.BASE_URL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});return await(await this.handleResponse(s)).json()}catch(s){throw console.error("Failed to create cron task:",s),s}}static async updateCronTask(n,s){try{const d=await fetch(`${this.BASE_URL}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});return await(await this.handleResponse(d)).json()}catch(d){throw console.error("Failed to update cron task:",d),d}}static async updateTaskStatus(n,s){try{const d=await fetch(`${this.BASE_URL}/${n}/status?status=${s}`,{method:"PUT"});await this.handleResponse(d)}catch(d){throw console.error("Failed to update task status:",d),d}}static async deleteCronTask(n){try{const s=await fetch(`${this.BASE_URL}/${n}`,{method:"DELETE"});await this.handleResponse(s)}catch(s){throw console.error("Failed to delete cron task:",s),s}}static async handleResponse(n){if(!n.ok)try{const s=await n.json();throw new Error(s.message||`API request failed: ${n.status}`)}catch{throw new Error(`API request failed: ${n.status} ${n.statusText}`)}return n}}he(we,"BASE_URL","/api/cron-tasks");const Te={validateCronExpression(T){const n=T.trim().split(/\s+/);return n.length>=5&&n.length<=6},formatTime(T){return new Date(T).toLocaleString()},async saveTask(T){try{let n;return T.id?n=await we.updateCronTask(Number(T.id),T):n=await we.createCronTask(T),n}catch(n){throw console.error("Failed to save cron task:",n),n}},async deleteTask(T){try{await we.deleteCronTask(String(T))}catch(n){throw console.error("Failed to delete cron task:",n),n}},async toggleTaskStatus(T){if(!T.id)throw new Error("Task ID is required");const n=T.status===0?1:0;return await we.updateCronTask(Number(T.id),{...T,status:n})},prepareTaskExecution(T){return T.planTemplateId?{useTemplate:!0,planData:{title:T.cronName||"Scheduled Task Execution",planData:{id:T.planTemplateId,planTemplateId:T.planTemplateId,planId:T.planTemplateId},params:T.executionParams||void 0}}:{useTemplate:!1,taskContent:T.planDesc||T.cronName||""}}},wa={class:"modal-header"},Ta={class:"header-actions"},Ia={class:"status-switch"},Da={class:"status-label"},xa={class:"toggle-switch"},Ra=["checked"],Aa={class:"modal-content"},Ma={class:"form-group"},Na={class:"form-label"},Ua=["placeholder"],La={class:"form-group"},qa={class:"form-label"},Fa=["placeholder"],Va={class:"form-help"},Oa={class:"form-group"},Ba={class:"form-label"},Wa=["placeholder"],ja={class:"form-group"},Ha={class:"form-label"},za={class:"template-toggle"},Ja={key:0,class:"template-selector"},Ga={value:""},Xa=["value"],Ka={class:"form-help"},Qa={key:0,class:"form-group"},Ya={class:"time-info"},Za={class:"time-label"},el={class:"time-value"},tl={key:1,class:"form-group"},nl={class:"time-info"},sl={class:"time-label"},ol={class:"time-value"},al={class:"modal-footer"},ll=["disabled"],il=Ce({__name:"TaskDetailModal",props:{modelValue:{type:Boolean},task:{}},emits:["update:modelValue","save"],setup(T,{emit:n}){const s=T,d=n,E=D(!1),u=D([]),$=D({cronName:"",cronTime:"",planDesc:"",status:1,linkTemplate:!1,templateId:"",planTemplateId:""});Se(async()=>{try{const o=await Ae.getAllPlanTemplates();o&&o.templates&&(u.value=o.templates.map(g=>({id:g.id,name:g.title||"Unnamed Template"})))}catch(o){console.error("Failed to get template list:",o)}});const O=o=>{o.target===o.currentTarget&&d("update:modelValue",!1)},P=()=>{$.value.linkTemplate=!1,$.value.templateId="",$.value.planTemplateId=""},B=()=>$.value.cronName.trim()?$.value.cronTime.trim()?Te.validateCronExpression($.value.cronTime)?$.value.planDesc.trim()?$.value.linkTemplate&&!$.value.templateId?(alert("Please select a plan template"),!1):!0:(alert("Task description cannot be empty"),!1):(alert("Invalid Cron expression format, should be 5-6 parts separated by spaces"),!1):(alert("Cron expression cannot be empty"),!1):(alert("Task name cannot be empty"),!1),X=o=>Te.formatTime(o),G=async()=>{var o;if(B()){E.value=!0;try{const g={...$.value,...((o=s.task)==null?void 0:o.id)!==void 0&&{id:s.task.id},cronName:$.value.cronName.trim(),cronTime:$.value.cronTime.trim(),planDesc:$.value.planDesc.trim(),status:$.value.status,planTemplateId:$.value.linkTemplate&&$.value.templateId||""};d("save",g)}finally{E.value=!1}}};return $e(()=>s.task,o=>{if(o){const g=o.templateId||o.planTemplateId||"";$.value={cronName:o.cronName||"",cronTime:o.cronTime||"",planDesc:o.planDesc||"",status:o.status??1,linkTemplate:!!g,templateId:g,planTemplateId:g}}else $.value={cronName:"",cronTime:"",planDesc:"",status:1,linkTemplate:!1,templateId:"",planTemplateId:""}},{immediate:!0}),$e(()=>s.modelValue,o=>{o||($.value={cronName:"",cronTime:"",planDesc:"",status:1,linkTemplate:!1,templateId:"",planTemplateId:""})}),(o,g)=>(h(),ue(Ne,{to:"body"},[k(xe,{name:"modal"},{default:Re(()=>{var S,K,U;return[o.modelValue?(h(),m("div",{key:0,class:"modal-overlay",onClick:O},[e("div",{class:"modal-container",onClick:g[8]||(g[8]=ie(()=>{},["stop"]))},[e("div",wa,[e("h3",null,l(o.$t("cronTask.taskDetail")),1),e("div",Ta,[e("div",Ia,[e("span",Da,l(o.$t("cronTask.taskStatus")),1),e("label",xa,[e("input",{type:"checkbox",checked:$.value.status===0,onChange:g[0]||(g[0]=q=>$.value.status=$.value.status===0?1:0)},null,40,Ra),g[9]||(g[9]=e("span",{class:"toggle-slider"},null,-1))])]),e("button",{class:"close-btn",onClick:g[1]||(g[1]=q=>o.$emit("update:modelValue",!1))},[k(i(C),{icon:"carbon:close"})])])]),e("div",Aa,[e("form",{onSubmit:ie(G,["prevent"]),class:"task-form"},[e("div",Ma,[e("label",Na,l(o.$t("cronTask.taskName")),1),de(e("input",{"onUpdate:modelValue":g[2]||(g[2]=q=>$.value.cronName=q),type:"text",class:"form-input",placeholder:o.$t("cronTask.taskNamePlaceholder"),required:""},null,8,Ua),[[fe,$.value.cronName]])]),e("div",La,[e("label",qa,l(o.$t("cronTask.cronExpression")),1),de(e("input",{"onUpdate:modelValue":g[3]||(g[3]=q=>$.value.cronTime=q),type:"text",class:"form-input",placeholder:o.$t("cronTask.cronExpressionPlaceholder"),required:""},null,8,Fa),[[fe,$.value.cronTime]]),e("div",Va,l(o.$t("cronTask.cronExpressionHelp")),1)]),e("div",Oa,[e("label",Ba,l(o.$t("cronTask.taskDescription")),1),de(e("textarea",{"onUpdate:modelValue":g[4]||(g[4]=q=>$.value.planDesc=q),class:"form-textarea",placeholder:o.$t("cronTask.taskDescriptionPlaceholder"),rows:"4",required:""},null,8,Wa),[[fe,$.value.planDesc]])]),e("div",ja,[e("label",Ha,l(o.$t("cronTask.planTemplate")),1),e("div",za,[e("button",{type:"button",class:te(["template-btn",$.value.linkTemplate?"active":""]),onClick:g[5]||(g[5]=q=>$.value.linkTemplate=!0)},[k(i(C),{icon:"carbon:checkmark"}),Y(" "+l(o.$t("cronTask.linkTemplate")),1)],2),e("button",{type:"button",class:te(["template-btn",$.value.linkTemplate?"":"active"]),onClick:P},[k(i(C),{icon:"carbon:close"}),Y(" "+l(o.$t("cronTask.noTemplate")),1)],2)]),$.value.linkTemplate?(h(),m("div",Ja,[de(e("select",{"onUpdate:modelValue":g[6]||(g[6]=q=>$.value.templateId=q),class:"form-select"},[e("option",Ga,l(o.$t("cronTask.selectTemplate")),1),(h(!0),m(ge,null,ve(u.value,q=>(h(),m("option",{key:q.id,value:q.id},l(q.name),9,Xa))),128))],512),[[ut,$.value.templateId]]),e("div",Ka,l(o.$t("cronTask.templateHelpText")),1)])):F("",!0)]),(S=o.task)!=null&&S.createTime?(h(),m("div",Qa,[e("div",Ya,[e("span",Za,l(o.$t("cronTask.createTime"))+":",1),e("span",el,l(X(o.task.createTime)),1)])])):F("",!0),(K=o.task)!=null&&K.updateTime?(h(),m("div",tl,[e("div",nl,[e("span",sl,l(o.$t("cronTask.updateTime"))+":",1),e("span",ol,l(X(o.task.updateTime)),1)])])):F("",!0)],32)]),e("div",al,[e("button",{type:"button",class:"cancel-btn",onClick:g[7]||(g[7]=q=>o.$emit("update:modelValue",!1))},l(o.$t("common.cancel")),1),e("button",{type:"button",class:"save-btn",onClick:G,disabled:E.value},[E.value?(h(),ue(i(C),{key:0,icon:"carbon:loading",class:"loading-icon"})):F("",!0),Y(" "+l((U=s.task)!=null&&U.id?o.$t("common.save"):o.$t("common.create")),1)],8,ll)])])])):F("",!0)]}),_:1})]))}}),cl=ye(il,[["__scopeId","data-v-5b32448e"]]),rl={class:"modal-header"},ul={class:"header-actions"},dl={class:"modal-content"},pl={key:0,class:"loading-container"},hl={key:1,class:"empty-container"},gl={key:2,class:"task-list"},ml=["onClick"],vl={class:"task-main"},fl={class:"task-info"},bl={class:"task-header"},kl={class:"task-name"},_l={class:"task-description"},$l={class:"task-time"},Pl=["onClick"],Cl=["onClick","disabled","title"],Sl=["onClick","title"],yl={class:"dropdown-menu"},El=["onClick"],wl=["onClick","disabled"],Tl=["onClick","disabled"],Il={class:"confirm-header"},Dl={class:"confirm-content"},xl={class:"confirm-actions"},Rl=["disabled"],Al={class:"confirm-header"},Ml={class:"confirm-content"},Nl={class:"create-options"},Ul={class:"option-content"},Ll={class:"option-title"},ql={class:"option-desc"},Fl={class:"option-content"},Vl={class:"option-title"},Ol={class:"option-desc"},Bl={class:"confirm-actions"},Wl=Ce({__name:"index",props:{modelValue:{type:Boolean,required:!0}},emits:["update:modelValue"],setup(T,{emit:n}){const s=lt(),d=it(),E=mt(),{t:u}=Ie(),$=T,x=n,O=D([]),P=D(!1),B=D(null),X=D(null),G=D(null),o=D(null),g=D(!1),S=D(null),K=D(!1),U=D(null),q=D(!1),V=c=>{c.target===c.currentTarget&&x("update:modelValue",!1)},Q=async()=>{P.value=!0;try{O.value=await we.getAllCronTasks()}catch(c){console.error("Failed to load cron tasks:",c),E.error(`Failed to load tasks: ${c instanceof Error?c.message:String(c)}`)}finally{P.value=!1}},ce=async c=>{B.value=c;try{const _=O.value.find(a=>a.id===c);if(!_){console.error("Task not found:",c);return}x("update:modelValue",!1);const I=Date.now().toString();await s.push({name:"direct",params:{id:I}}),await new Promise(a=>setTimeout(a,100));const t=Te.prepareTaskExecution(_);t.useTemplate&&t.planData?d.emitPlanExecutionRequested(t.planData):t.taskContent&&d.setTask(t.taskContent)}catch(_){console.error("Failed to execute task:",_),E.error(`Execution failed: ${_ instanceof Error?_.message:String(_)}`)}finally{B.value=null}},be=c=>{S.value={...c},g.value=!0,o.value=null},v=async c=>{try{await Te.saveTask(c),await Q(),g.value=!1,E.success("Task saved successfully")}catch(_){console.error("Failed to save task:",_),E.error(`Save failed: ${_ instanceof Error?_.message:String(_)}`)}},w=c=>{U.value=c,K.value=!0},L=async()=>{var c;if((c=U.value)!=null&&c.id){X.value=U.value.id;try{await Te.deleteTask(U.value.id),await Q(),K.value=!1,U.value=null,E.success("Task deleted successfully")}catch(_){console.error("Failed to delete task:",_),E.error(`Delete failed: ${_ instanceof Error?_.message:String(_)}`)}finally{X.value=null}}},R=()=>{K.value=!1,U.value=null},y=c=>{o.value=o.value===c?null:c},A=async c=>{if(c.id){G.value=c.id;try{await Te.toggleTaskStatus(c),await Q(),o.value=null,E.success(`Task ${c.status===0?"disabled":"enabled"} successfully`)}catch(_){console.error("Failed to toggle task status:",_),E.error(`Status toggle failed: ${_ instanceof Error?_.message:String(_)}`)}finally{G.value=null}}},ee=async c=>{try{await navigator.clipboard.writeText(c),E.success("Cron expression copied successfully")}catch(_){E.error(`Copy failed: ${_ instanceof Error?_.message:String(_)}`)}},se=()=>{q.value=!0},me=()=>{q.value=!1;try{x("update:modelValue",!1);const c=u("cronTask.template");d.setTaskToInput(c);const _=Date.now().toString();s.push({name:"direct",params:{id:_}})}catch(c){console.error("Error in createWithJmanus:",c),E.error(`Creation failed: ${c instanceof Error?c.message:String(c)}`)}},ke=()=>{q.value=!1,S.value={cronName:"",cronTime:"",planDesc:"",status:0,planTemplateId:""},g.value=!0},re=()=>{q.value=!1},b=c=>{const _=c.target;!_.closest(".action-dropdown")&&!_.closest(".dropdown-menu")&&(o.value=null)};return Se(()=>{document.addEventListener("click",b,!0)}),De(()=>{document.removeEventListener("click",b,!0)}),$e(()=>$.modelValue,c=>{c&&Q()}),(c,_)=>(h(),m(ge,null,[(h(),ue(Ne,{to:"body"},[k(xe,{name:"modal"},{default:Re(()=>[T.modelValue?(h(),m("div",{key:0,class:"modal-overlay",onClick:V},[e("div",{class:"modal-container",onClick:_[3]||(_[3]=ie(()=>{},["stop"]))},[e("div",rl,[e("h3",null,l(c.$t("cronTask.title")),1),e("div",ul,[e("button",{class:"add-task-btn",onClick:[se,_[0]||(_[0]=ie(()=>{},["stop"]))]},[k(i(C),{icon:"carbon:add"}),Y(" "+l(c.$t("cronTask.addTask")),1)]),e("button",{class:"close-btn",onClick:_[1]||(_[1]=I=>c.$emit("update:modelValue",!1))},[k(i(C),{icon:"carbon:close"})])])]),e("div",dl,[P.value?(h(),m("div",pl,[k(i(C),{icon:"carbon:loading",class:"loading-icon"}),e("span",null,l(c.$t("common.loading")),1)])):O.value.length===0?(h(),m("div",hl,[k(i(C),{icon:"carbon:time",class:"empty-icon"}),e("span",null,l(c.$t("cronTask.noTasks")),1)])):(h(),m("div",gl,[(h(!0),m(ge,null,ve(O.value,I=>(h(),m("div",{key:I.id||"",class:"task-item",onClick:t=>be(I)},[e("div",vl,[e("div",fl,[e("div",bl,[e("div",kl,l(I.cronName),1),e("div",{class:te(["task-status-badge",I.status===0?"active":"inactive"])},[k(i(C),{icon:I.status===0?"carbon:checkmark-filled":"carbon:pause-filled"},null,8,["icon"]),e("span",null,l(I.status===0?c.$t("cronTask.active"):c.$t("cronTask.inactive")),1)],2)]),e("div",_l,l(I.planDesc),1),e("div",$l,[k(i(C),{icon:"carbon:time"}),e("span",{class:"cron-readable",style:{cursor:"pointer"},onClick:ie(t=>ee(I.cronTime),["stop"])},l(I.cronTime),9,Pl)])])]),e("div",{class:"task-actions",onClick:_[2]||(_[2]=ie(()=>{},["stop"]))},[e("button",{class:"action-btn execute-btn",onClick:t=>ce(I.id),disabled:B.value===I.id,title:c.$t("cronTask.executeOnce")},[k(i(C),{icon:B.value===I.id?"carbon:loading":"carbon:play-filled"},null,8,["icon"]),Y(" "+l(c.$t("cronTask.executeOnce")),1)],8,Cl),e("div",{class:te(["action-dropdown",{active:o.value===I.id}])},[e("button",{class:"action-btn dropdown-btn",onClick:t=>y(I.id),title:c.$t("cronTask.operations")},[k(i(C),{icon:"carbon:overflow-menu-horizontal"}),Y(" "+l(c.$t("cronTask.operations")),1)],8,Sl),de(e("div",yl,[e("button",{class:"dropdown-item edit-btn",onClick:t=>be(I)},[k(i(C),{icon:"carbon:edit"}),Y(" "+l(c.$t("cronTask.edit")),1)],8,El),e("button",{class:"dropdown-item toggle-btn",onClick:t=>A(I),disabled:G.value===I.id},[k(i(C),{icon:G.value===I.id?"carbon:loading":I.status===0?"carbon:pause-filled":"carbon:play-filled"},null,8,["icon"]),Y(" "+l(I.status===0?c.$t("cronTask.disable"):c.$t("cronTask.enable")),1)],8,wl),e("button",{class:"dropdown-item delete-btn",onClick:t=>w(I),disabled:X.value===I.id},[k(i(C),{icon:X.value===I.id?"carbon:loading":"carbon:trash-can"},null,8,["icon"]),Y(" "+l(c.$t("cronTask.delete")),1)],8,Tl)],512),[[dt,o.value===I.id]])],2)])],8,ml))),128))]))])])])):F("",!0)]),_:1})])),k(cl,{modelValue:g.value,"onUpdate:modelValue":_[4]||(_[4]=I=>g.value=I),task:S.value,onSave:v},null,8,["modelValue","task"]),(h(),ue(Ne,{to:"body"},[k(xe,{name:"modal"},{default:Re(()=>{var I,t,a,r;return[K.value?(h(),m("div",{key:0,class:"modal-overlay",onClick:R},[e("div",{class:"confirm-modal",onClick:_[5]||(_[5]=ie(()=>{},["stop"]))},[e("div",Il,[k(i(C),{icon:"carbon:warning",class:"warning-icon"}),e("h3",null,l(c.$t("cronTask.deleteConfirm")),1)]),e("div",Dl,[e("p",null,l(c.$t("cronTask.deleteConfirmMessage",{taskName:((I=U.value)==null?void 0:I.cronName)||((t=U.value)==null?void 0:t.planDesc)||""})),1)]),e("div",xl,[e("button",{class:"confirm-btn cancel-btn",onClick:R},l(c.$t("common.cancel")),1),e("button",{class:"confirm-btn delete-btn",onClick:L,disabled:X.value===((a=U.value)==null?void 0:a.id)},[k(i(C),{icon:X.value===((r=U.value)==null?void 0:r.id)?"carbon:loading":"carbon:trash-can"},null,8,["icon"]),Y(" "+l(c.$t("cronTask.delete")),1)],8,Rl)])])])):F("",!0)]}),_:1})])),(h(),ue(Ne,{to:"body"},[k(xe,{name:"modal"},{default:Re(()=>[q.value?(h(),m("div",{key:0,class:"modal-overlay",onClick:re},[e("div",{class:"confirm-modal create-options-modal",onClick:_[6]||(_[6]=ie(()=>{},["stop"]))},[e("div",Al,[k(i(C),{icon:"carbon:time",class:"create-icon"}),e("h3",null,l(c.$t("cronTask.createTask")),1)]),e("div",Ml,[e("p",null,l(c.$t("cronTask.selectCreateMethod")),1),e("div",Nl,[e("button",{class:"create-option-btn jmanus-btn",onClick:me},[k(i(C),{icon:"carbon:ai-status"}),e("div",Ul,[e("span",Ll,l(c.$t("cronTask.createWithJmanus")),1),e("span",ql,l(c.$t("cronTask.createWithJmanusDesc")),1)])]),e("button",{class:"create-option-btn manual-btn",onClick:ke},[k(i(C),{icon:"carbon:edit"}),e("div",Fl,[e("span",Vl,l(c.$t("cronTask.createManually")),1),e("span",Ol,l(c.$t("cronTask.createManuallyDesc")),1)])])])]),e("div",Bl,[e("button",{class:"confirm-btn cancel-btn",onClick:re},l(c.$t("common.cancel")),1)])])])):F("",!0)]),_:1})]))],64))}}),jl=ye(Wl,[["__scopeId","data-v-837947df"]]),Hl={class:"direct-page"},zl={class:"direct-chat"},Jl={class:"chat-header"},Gl={class:"header-actions"},Xl=["title"],Kl=["title"],Ql={class:"chat-content"},Yl=["title"],Zl={class:"message-content"},ei=Ce({__name:"index",setup(T){const n=pt(),s=lt(),d=it(),{t:E}=Ie(),{message:u}=vt(),$=D(""),x=D(""),O=D(),P=D(),B=D(),X=D(!1),G=D(!1),o=D(null),g=D(!1),S=D(50),K=D(!1),U=D(0),q=D(0);Se(()=>{if(console.log("[Direct] onMounted called"),console.log("[Direct] taskStore.currentTask:",d.currentTask),console.log("[Direct] taskStore.hasUnprocessedTask():",d.hasUnprocessedTask()),oe.setEventCallbacks({onPlanUpdate:c=>{console.log("[Direct] Plan update event received for rootPlanId:",c),v(c)&&(console.log("[Direct] Processing plan update for current rootPlanId:",c),P.value&&typeof P.value.handlePlanUpdate=="function"?(console.log("[Direct] Calling chatRef.handlePlanUpdate with rootPlanId:",c),P.value.handlePlanUpdate(c)):console.warn("[Direct] chatRef.handlePlanUpdate method not available"),O.value&&typeof O.value.updateDisplayedPlanProgress=="function"?(console.log("[Direct] Calling rightPanelRef.updateDisplayedPlanProgress with rootPlanId:",c),O.value.updateDisplayedPlanProgress(c)):console.warn("[Direct] rightPanelRef.updateDisplayedPlanProgress method not available"))},onPlanCompleted:c=>{if(console.log("[Direct] Plan completed event received for rootPlanId:",c),!!v(c)){if(console.log("[Direct] Processing plan completion for current rootPlanId:",c),P.value&&typeof P.value.handlePlanCompleted=="function"){const _=oe.getCachedPlanRecord(c);console.log("[Direct] Calling chatRef.handlePlanCompleted with details:",_),P.value.handlePlanCompleted(_??{planId:c})}else console.warn("[Direct] chatRef.handlePlanCompleted method not available");o.value=null,console.log("[Direct] Cleared currentRootPlanId after plan completion")}},onDialogRoundStart:c=>{console.log("[Direct] Dialog round start event received for rootPlanId:",c),o.value=c,console.log("[Direct] Set currentRootPlanId to:",c),P.value&&typeof P.value.handleDialogRoundStart=="function"?(console.log("[Direct] Calling chatRef.handleDialogRoundStart with planId:",c),P.value.handleDialogRoundStart(c)):console.warn("[Direct] chatRef.handleDialogRoundStart method not available")},onChatInputClear:()=>{console.log("[Direct] Chat input clear event received"),L()},onChatInputUpdateState:c=>{if(console.log("[Direct] Chat input update state event received for rootPlanId:",c),!v(c,!0))return;const _=oe.getCachedUIState(c);_&&y(_.enabled,_.placeholder)},onPlanError:c=>{P.value.handlePlanError(c)}}),console.log("[Direct] Event callbacks registered to planExecutionManager"),f.loadPlanTemplateList(),d.hasUnprocessedTask()&&d.currentTask){const c=d.currentTask.prompt;console.log("[Direct] Found unprocessed task from store:",c),d.markTaskAsProcessed(),ne(()=>{P.value&&typeof P.value.handleSendMessage=="function"?(console.log("[Direct] Directly executing task via chatRef.handleSendMessage:",c),P.value.handleSendMessage(c)):(console.warn("[Direct] chatRef.handleSendMessage method not available, falling back to prompt"),$.value=c)})}else{const c=d.getAndClearTaskToInput();c?(x.value=c,console.log("[Direct] Setting inputOnlyContent for input only:",x.value)):($.value=n.query.prompt||"",console.log("[Direct] Received task from URL:",$.value),console.log("[Direct] No unprocessed task in store"))}const b=localStorage.getItem("directPanelWidth");b&&(S.value=parseFloat(b)),console.log("[Direct] Final prompt value:",$.value),x.value&&ne(()=>{B.value&&typeof B.value.setInputValue=="function"&&(B.value.setInputValue(x.value),console.log("[Direct] Set input value:",x.value),x.value="")}),window.addEventListener("plan-execution-requested",c=>{console.log("[DirectView] Received plan-execution-requested event:",c.detail),re(c.detail)})}),$e(()=>d.currentTask,b=>{if(console.log("[Direct] Watch taskStore.currentTask triggered, newTask:",b),b&&!b.processed){const c=b.prompt;d.markTaskAsProcessed(),console.log("[Direct] Received new task from store:",c),ne(()=>{P.value&&typeof P.value.handleSendMessage=="function"?(console.log("[Direct] Directly executing new task via chatRef.handleSendMessage:",c),P.value.handleSendMessage(c)):console.warn("[Direct] chatRef.handleSendMessage method not available for new task")})}else console.log("[Direct] Task is null or already processed, ignoring")},{immediate:!1}),$e(()=>$.value,(b,c)=>{console.log("[Direct] prompt value changed from:",c,"to:",b)},{immediate:!1}),$e(()=>d.taskToInput,b=>{console.log("[Direct] Watch taskStore.taskToInput triggered, newTaskToInput:",b),b&&b.trim()&&(console.log("[Direct] Setting input value from taskToInput:",b),ne(()=>{B.value&&typeof B.value.setInputValue=="function"&&(B.value.setInputValue(b.trim()),console.log("[Direct] Input value set from taskToInput watch:",b.trim()),d.getAndClearTaskToInput())}))},{immediate:!1}),De(()=>{console.log("[Direct] onUnmounted called, cleaning up resources"),o.value=null,oe.cleanup(),document.removeEventListener("mousemove",Q),document.removeEventListener("mouseup",ce),window.removeEventListener("plan-execution-requested",b=>{re(b.detail)})});const V=b=>{K.value=!0,U.value=b.clientX,q.value=S.value,document.addEventListener("mousemove",Q),document.addEventListener("mouseup",ce),document.body.style.cursor="col-resize",document.body.style.userSelect="none",b.preventDefault()},Q=b=>{if(!K.value)return;const c=window.innerWidth,I=(b.clientX-U.value)/c*100;let t=q.value+I;t=Math.max(20,Math.min(80,t)),S.value=t},ce=()=>{K.value=!1,document.removeEventListener("mousemove",Q),document.removeEventListener("mouseup",ce),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("directPanelWidth",S.value.toString())},be=()=>{S.value=50,localStorage.setItem("directPanelWidth","50")},v=(b,c=!1)=>!o.value||b===o.value||c&&(b==="ui-state"||b==="error")?!0:(console.log("[Direct] Ignoring event for non-current rootPlanId:",b,"current:",o.value),!1),w=b=>{console.log("[DirectView] Send message from input:",b),P.value&&typeof P.value.handleSendMessage=="function"?(console.log("[DirectView] Calling chatRef.handleSendMessage:",b),P.value.handleSendMessage(b)):console.warn("[DirectView] chatRef.handleSendMessage method not available")},L=()=>{console.log("[DirectView] Input cleared"),B.value&&typeof B.value.clear=="function"&&B.value.clear()},R=()=>{console.log("[DirectView] Input focused")},y=(b,c)=>{console.log("[DirectView] Input state updated:",b,c),G.value=!b},A=(b,c)=>{console.log("[DirectView] Step selected:",b,c),O.value&&typeof O.value.handleStepSelected=="function"?(console.log("[DirectView] Forwarding step selection to right panel:",b,c),O.value.handleStepSelected(b,c)):console.warn("[DirectView] rightPanelRef.handleStepSelected method not available")},ee=(b,c,_,I)=>{console.log("[DirectView] Sub plan step selected:",{parentPlanId:b,subPlanId:c,stepIndex:_,subStepIndex:I}),O.value&&typeof O.value.handleSubPlanStepSelected=="function"?(console.log("[DirectView] Forwarding sub plan step selection to right panel:",{parentPlanId:b,subPlanId:c,stepIndex:_,subStepIndex:I}),O.value.handleSubPlanStepSelected(b,c,_,I)):console.warn("[DirectView] rightPanelRef.handleSubPlanStepSelected method not available")},se=()=>{console.log("[DirectView] Plan mode button clicked"),f.toggleSidebar(),console.log("[DirectView] Sidebar toggled, isCollapsed:",f.isCollapsed)},me=()=>{s.push("/home")},ke=()=>{s.push("/configs")},re=async b=>{var _,I,t,a;if(console.log("[DirectView] Plan execution requested:",b),X.value){console.log("[DirectView] Plan execution already in progress, ignoring request");return}X.value=!0;let c=!1;P.value&&typeof P.value.addMessage=="function"?(console.log("[DirectView] Calling chatRef.addMessage for plan execution:",b.title),P.value.addMessage("user",b.title),c=!0):console.warn("[DirectView] chatRef.addMessage method not available");try{const r=((_=b.planData)==null?void 0:_.planTemplateId)||((I=b.planData)==null?void 0:I.id)||((t=b.planData)==null?void 0:t.planId);if(!r)throw new Error(E("direct.planTemplateIdNotFound"));console.log("[Direct] Executing plan with templateId:",r,"params:",b.params),console.log("[Direct] About to call PlanActApiService.executePlan");let p;if((a=b.params)!=null&&a.trim()?(console.log("[Direct] Calling executePlan with params:",b.params.trim()),p=await Ae.executePlan(r,b.params.trim())):(console.log("[Direct] Calling executePlan without params"),p=await Ae.executePlan(r)),console.log("[Direct] Plan execution API response:",p),p.planId)console.log("[Direct] Got planId from response:",p.planId,"starting plan execution"),o.value=p.planId,console.log("[Direct] Set currentRootPlanId to:",p.planId),console.log("[Direct] Delegating plan execution to planExecutionManager"),oe.handlePlanExecutionRequested(p.planId,b.title);else throw console.error("[Direct] No planId in response:",p),new Error(E("direct.executionFailedNoPlanId"))}catch(r){console.error("[Direct] Plan execution failed:",r),console.error("[Direct] Error details:",{message:r.message,stack:r.stack}),o.value=null,P.value&&typeof P.value.addMessage=="function"?(console.log("[Direct] Adding error messages to chat"),c||P.value.addMessage("user",b.title),P.value.addMessage("assistant",`${E("direct.executionFailed")}: ${r.message||E("common.unknownError")}`,{thinking:void 0})):(console.error("[Direct] Chat ref not available, showing alert"),alert(`${E("direct.executionFailed")}: ${r.message||E("common.unknownError")}`))}finally{console.log("[Direct] Plan execution finished, resetting isExecutingPlan flag"),X.value=!1}};return(b,c)=>(h(),m("div",Hl,[e("div",zl,[k(fn,{onPlanExecutionRequested:re}),e("div",{class:"left-panel",style:Ue({width:S.value+"%"})},[e("div",Jl,[e("button",{class:"back-button",onClick:me},[k(i(C),{icon:"carbon:arrow-left"})]),e("h2",null,l(b.$t("conversation")),1),e("div",Gl,[k(gt),e("button",{class:"config-button",onClick:ke,title:b.$t("direct.configuration")},[k(i(C),{icon:"carbon:settings-adjust",width:"20"})],8,Xl),e("button",{class:"cron-task-btn",onClick:c[0]||(c[0]=_=>g.value=!0),title:b.$t("cronTask.title")},[k(i(C),{icon:"carbon:alarm",width:"20"})],8,Kl)])]),e("div",Ql,[k(ba,{ref_key:"chatRef",ref:P,mode:"direct","initial-prompt":$.value||"",onStepSelected:A,onSubPlanStepSelected:ee},null,8,["initial-prompt"])]),(h(),ue(Ea,{key:b.$i18n.locale,ref_key:"inputRef",ref:B,disabled:G.value,placeholder:G.value?i(E)("input.waiting"):i(E)("input.placeholder"),"initial-value":$.value,onSend:w,onClear:L,onFocus:R,onUpdateState:y,onPlanModeClicked:se},null,8,["disabled","placeholder","initial-value"]))],4),e("div",{class:"panel-resizer",onMousedown:V,onDblclick:be,title:b.$t("direct.panelResizeHint")},c[2]||(c[2]=[e("div",{class:"resizer-line"},null,-1)]),40,Yl),k(Ls,{ref_key:"rightPanelRef",ref:O,style:Ue({width:100-S.value+"%"})},null,8,["style"])]),k(jl,{modelValue:g.value,"onUpdate:modelValue":c[1]||(c[1]=_=>g.value=_)},null,8,["modelValue"]),i(u).show?(h(),m("div",{key:0,class:te(["message-toast",i(u).type])},[e("div",Zl,[e("span",null,l(i(u).text),1)])],2)):F("",!0)]))}}),ri=ye(ei,[["__scopeId","data-v-eab98c50"]]);export{ri as default}; diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-D2fTT4wr.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-rqS3tjXd.js similarity index 94% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-D2fTT4wr.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-rqS3tjXd.js index 0f28e89e9b..acdbb4704a 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-D2fTT4wr.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-rqS3tjXd.js @@ -1 +1 @@ -import{d as L,u as E,r as p,c as v,P as $,o as B,A as I,a as r,b as l,e as t,f as g,g as h,x as u,t as d,h as x,F as D,l as F,n as N,s as w,Q as U}from"./index-DA9oYm7y.js";import{I as i}from"./iconify-CyasjfC7.js";import{_ as V}from"./_plugin-vue_export-helper-DlAUqK2U.js";const M={class:"language-switcher"},O=["title"],S={class:"current-lang"},z={class:"dropdown-header"},A={class:"language-options"},K=["disabled","onClick"],P={class:"lang-code"},Q={class:"lang-name"},j=L({__name:"index",setup(q){const{locale:_}=E(),a=p(!1),o=v(()=>_.value),f=v(()=>$.opts),b=v(()=>{const e=f.value.find(n=>n.value===o.value);return e?e.title:"Unknown"}),y=()=>{a.value=!a.value},c=p(!1),C=async e=>{if(!(c.value||o.value===e))try{c.value=!0,await U(e),a.value=!1}catch(n){console.error("Failed to change language:",n),a.value=!1}finally{c.value=!1}},k=e=>{e.target.closest(".language-switcher")||(a.value=!1)},m=e=>{e.key==="Escape"&&(a.value=!1)};return B(()=>{document.addEventListener("click",k),document.addEventListener("keydown",m)}),I(()=>{document.removeEventListener("click",k),document.removeEventListener("keydown",m)}),(e,n)=>(l(),r("div",M,[t("button",{class:"language-btn",onClick:y,title:e.$t("language.switch")},[h(u(i),{icon:"carbon:translate",width:"18"}),t("span",S,d(b.value),1),h(u(i),{icon:a.value?"carbon:chevron-up":"carbon:chevron-down",width:"14",class:"chevron"},null,8,["icon"])],8,O),a.value?(l(),r("div",{key:0,class:"language-dropdown",onClick:n[1]||(n[1]=x(()=>{},["stop"]))},[t("div",z,[t("span",null,d(e.$t("language.switch")),1),t("button",{class:"close-btn",onClick:n[0]||(n[0]=s=>a.value=!1)},[h(u(i),{icon:"carbon:close",width:"16"})])]),t("div",A,[(l(!0),r(D,null,F(f.value,s=>(l(),r("button",{key:s.value,class:N(["language-option",{active:o.value===s.value,loading:c.value&&o.value!==s.value}]),disabled:c.value,onClick:G=>C(s.value)},[t("span",P,d(s.value.toUpperCase()),1),t("span",Q,d(s.title),1),c.value&&o.value!==s.value?(l(),w(u(i),{key:0,icon:"carbon:circle-dash",width:"16",class:"loading-icon"})):o.value===s.value?(l(),w(u(i),{key:1,icon:"carbon:checkmark",width:"16",class:"check-icon"})):g("",!0)],10,K))),128))])])):g("",!0),a.value?(l(),r("div",{key:1,class:"backdrop",onClick:n[2]||(n[2]=s=>a.value=!1)})):g("",!0)]))}}),T=V(j,[["__scopeId","data-v-25f759dc"]]);export{T as L}; +import{d as L,u as E,r as p,c as v,P as $,o as B,A as I,a as r,b as l,e as t,f as g,g as h,x as u,t as d,h as x,F as D,l as F,n as N,s as w,Q as U}from"./index-CNsQoPg8.js";import{I as i}from"./iconify-B3l7reUz.js";import{_ as V}from"./_plugin-vue_export-helper-DlAUqK2U.js";const M={class:"language-switcher"},O=["title"],S={class:"current-lang"},z={class:"dropdown-header"},A={class:"language-options"},K=["disabled","onClick"],P={class:"lang-code"},Q={class:"lang-name"},j=L({__name:"index",setup(q){const{locale:_}=E(),a=p(!1),o=v(()=>_.value),f=v(()=>$.opts),b=v(()=>{const e=f.value.find(n=>n.value===o.value);return e?e.title:"Unknown"}),y=()=>{a.value=!a.value},c=p(!1),C=async e=>{if(!(c.value||o.value===e))try{c.value=!0,await U(e),a.value=!1}catch(n){console.error("Failed to change language:",n),a.value=!1}finally{c.value=!1}},k=e=>{e.target.closest(".language-switcher")||(a.value=!1)},m=e=>{e.key==="Escape"&&(a.value=!1)};return B(()=>{document.addEventListener("click",k),document.addEventListener("keydown",m)}),I(()=>{document.removeEventListener("click",k),document.removeEventListener("keydown",m)}),(e,n)=>(l(),r("div",M,[t("button",{class:"language-btn",onClick:y,title:e.$t("language.switch")},[h(u(i),{icon:"carbon:translate",width:"18"}),t("span",S,d(b.value),1),h(u(i),{icon:a.value?"carbon:chevron-up":"carbon:chevron-down",width:"14",class:"chevron"},null,8,["icon"])],8,O),a.value?(l(),r("div",{key:0,class:"language-dropdown",onClick:n[1]||(n[1]=x(()=>{},["stop"]))},[t("div",z,[t("span",null,d(e.$t("language.switch")),1),t("button",{class:"close-btn",onClick:n[0]||(n[0]=s=>a.value=!1)},[h(u(i),{icon:"carbon:close",width:"16"})])]),t("div",A,[(l(!0),r(D,null,F(f.value,s=>(l(),r("button",{key:s.value,class:N(["language-option",{active:o.value===s.value,loading:c.value&&o.value!==s.value}]),disabled:c.value,onClick:G=>C(s.value)},[t("span",P,d(s.value.toUpperCase()),1),t("span",Q,d(s.title),1),c.value&&o.value!==s.value?(l(),w(u(i),{key:0,icon:"carbon:circle-dash",width:"16",class:"loading-icon"})):o.value===s.value?(l(),w(u(i),{key:1,icon:"carbon:checkmark",width:"16",class:"check-icon"})):g("",!0)],10,K))),128))])])):g("",!0),a.value?(l(),r("div",{key:1,class:"backdrop",onClick:n[2]||(n[2]=s=>a.value=!1)})):g("",!0)]))}}),T=V(j,[["__scopeId","data-v-25f759dc"]]);export{T as L}; diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/javascript-DNnN4kEa.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/javascript-C0XxeR-n.js similarity index 81% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/javascript-DNnN4kEa.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/javascript-C0XxeR-n.js index af74578206..a3b6cd3ad6 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/javascript-DNnN4kEa.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/javascript-C0XxeR-n.js @@ -1,4 +1,4 @@ -import{conf as t,language as e}from"./typescript-BEZDUO2m.js";import"./index-Dqcw8yKQ.js";import"./index-DA9oYm7y.js";import"./iconify-CyasjfC7.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-fgXJFj_8.js";import"./index-D2fTT4wr.js";/*!----------------------------------------------------------------------------- +import{conf as t,language as e}from"./typescript-Cfb9k-qV.js";import"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/jsonMode-B8CiFQ0R.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/jsonMode-BNPGVg0I.js similarity index 99% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/jsonMode-B8CiFQ0R.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/jsonMode-BNPGVg0I.js index 24b418bf11..b5b40a88c5 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/jsonMode-B8CiFQ0R.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/jsonMode-BNPGVg0I.js @@ -1,4 +1,4 @@ -var $e=Object.defineProperty;var Ge=(e,n,i)=>n in e?$e(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var C=(e,n,i)=>Ge(e,typeof n!="symbol"?n+"":n,i);import{m as Qe}from"./index-Dqcw8yKQ.js";import"./index-DA9oYm7y.js";import"./iconify-CyasjfC7.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-fgXJFj_8.js";import"./index-D2fTT4wr.js";/*!----------------------------------------------------------------------------- +var $e=Object.defineProperty;var Ge=(e,n,i)=>n in e?$e(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var C=(e,n,i)=>Ge(e,typeof n!="symbol"?n+"":n,i);import{m as Qe}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/liquid-B5j_7Uvh.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/liquid-BFayS-os.js similarity index 94% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/liquid-B5j_7Uvh.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/liquid-BFayS-os.js index f32c4019a6..717b959387 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/liquid-B5j_7Uvh.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/liquid-BFayS-os.js @@ -1,4 +1,4 @@ -import{m as l}from"./index-Dqcw8yKQ.js";import"./index-DA9oYm7y.js";import"./iconify-CyasjfC7.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-fgXJFj_8.js";import"./index-D2fTT4wr.js";/*!----------------------------------------------------------------------------- +import{m as l}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/mdx-CDRD_3NO.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/mdx-DeQweMxo.js similarity index 95% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/mdx-CDRD_3NO.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/mdx-DeQweMxo.js index 7e765bf251..9f54af3306 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/mdx-CDRD_3NO.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/mdx-DeQweMxo.js @@ -1,4 +1,4 @@ -import{m as s}from"./index-Dqcw8yKQ.js";import"./index-DA9oYm7y.js";import"./iconify-CyasjfC7.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-fgXJFj_8.js";import"./index-D2fTT4wr.js";/*!----------------------------------------------------------------------------- +import{m as s}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/notFound-BSR8IgwZ.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/notFound-CVrU7YVW.js similarity index 84% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/notFound-BSR8IgwZ.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/notFound-CVrU7YVW.js index e366db31ee..389a5ec2c4 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/notFound-BSR8IgwZ.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/notFound-CVrU7YVW.js @@ -1 +1 @@ -import{_ as n}from"./Java-AI-BYpq8IxI.js";import{d as c,a as i,b as d,e as o,t as r,g as m,i as p,x as l,p as _}from"./index-DA9oYm7y.js";import{I as u}from"./iconify-CyasjfC7.js";import{_ as f}from"./_plugin-vue_export-helper-DlAUqK2U.js";const b={class:"not-found-page"},g={class:"error-container"},h={class:"error-message"},k=c({__name:"notFound",setup(v){const t=_(),a=()=>{t.push("/home")};return(e,s)=>(d(),i("div",b,[o("div",g,[s[0]||(s[0]=o("div",{class:"error-icon"},[o("img",{src:n,alt:"Java-AI",width:"96",height:"96",class:"java-logo"})],-1)),s[1]||(s[1]=o("h1",{class:"error-code"},"404",-1)),o("p",h,r(e.$t("error.notFound")),1),o("button",{class:"back-button",onClick:a},[m(l(u),{icon:"carbon:arrow-left"}),p(" "+r(e.$t("error.backToHome")),1)])])]))}}),N=f(k,[["__scopeId","data-v-57698550"]]);export{N as default}; +import{_ as n}from"./Java-AI-BYpq8IxI.js";import{d as c,a as i,b as d,e as o,t as r,g as m,i as p,x as l,p as _}from"./index-CNsQoPg8.js";import{I as u}from"./iconify-B3l7reUz.js";import{_ as f}from"./_plugin-vue_export-helper-DlAUqK2U.js";const b={class:"not-found-page"},g={class:"error-container"},h={class:"error-message"},k=c({__name:"notFound",setup(v){const t=_(),a=()=>{t.push("/home")};return(e,s)=>(d(),i("div",b,[o("div",g,[s[0]||(s[0]=o("div",{class:"error-icon"},[o("img",{src:n,alt:"Java-AI",width:"96",height:"96",class:"java-logo"})],-1)),s[1]||(s[1]=o("h1",{class:"error-code"},"404",-1)),o("p",h,r(e.$t("error.notFound")),1),o("button",{class:"back-button",onClick:a},[m(l(u),{icon:"carbon:arrow-left"}),p(" "+r(e.$t("error.backToHome")),1)])])]))}}),N=f(k,[["__scopeId","data-v-57698550"]]);export{N as default}; diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/python-CM3gi6vP.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/python-a9hcFcOH.js similarity index 93% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/python-CM3gi6vP.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/python-a9hcFcOH.js index 090125c037..3e51b60a37 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/python-CM3gi6vP.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/python-a9hcFcOH.js @@ -1,4 +1,4 @@ -import{m as i}from"./index-Dqcw8yKQ.js";import"./index-DA9oYm7y.js";import"./iconify-CyasjfC7.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-fgXJFj_8.js";import"./index-D2fTT4wr.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/razor-Bu5fGBlQ.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/razor-1sBWwWa2.js similarity index 97% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/razor-Bu5fGBlQ.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/razor-1sBWwWa2.js index 38a758e4da..2d68bbfda8 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/razor-Bu5fGBlQ.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/razor-1sBWwWa2.js @@ -1,4 +1,4 @@ -import{m}from"./index-Dqcw8yKQ.js";import"./index-DA9oYm7y.js";import"./iconify-CyasjfC7.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-fgXJFj_8.js";import"./index-D2fTT4wr.js";/*!----------------------------------------------------------------------------- +import{m}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/sidebar-BtIzguw3.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/sidebar-ON4PvQzg.js similarity index 99% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/sidebar-BtIzguw3.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/sidebar-ON4PvQzg.js index 8c0dc7d0f6..e4d7550940 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/sidebar-BtIzguw3.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/sidebar-ON4PvQzg.js @@ -1,2 +1,2 @@ -var m=Object.defineProperty;var T=(n,e,t)=>e in n?m(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>T(n,typeof e!="symbol"?e+"":e,t);import{H as g,r as h,z as P,I as p}from"./index-DA9oYm7y.js";import{L as d}from"./llm-check-BVkAKrj3.js";const V=g("task",()=>{const n=h(null),e=h(""),t=h(!1);return{currentTask:n,taskToInput:e,hasVisitedHome:t,setTask:o=>{console.log("[TaskStore] setTask called with prompt:",o);const u={prompt:o,timestamp:Date.now(),processed:!1};n.value=u,console.log("[TaskStore] Task set, currentTask.value:",n.value)},setTaskToInput:o=>{console.log("[TaskStore] setTaskToInput called with prompt:",o),e.value=o,console.log("[TaskStore] Task to input set:",e.value)},getAndClearTaskToInput:()=>{const o=e.value;return e.value="",console.log("[TaskStore] getAndClearTaskToInput returning:",o),o},markTaskAsProcessed:()=>{console.log("[TaskStore] markTaskAsProcessed called, current task:",n.value),n.value?(n.value.processed=!0,console.log("[TaskStore] Task marked as processed:",n.value)):console.log("[TaskStore] No current task to mark as processed")},clearTask:()=>{n.value=null},hasUnprocessedTask:()=>{const o=n.value&&!n.value.processed;return console.log("[TaskStore] hasUnprocessedTask check - currentTask:",n.value,"result:",o),o},markHomeVisited:()=>{t.value=!0,localStorage.setItem("hasVisitedHome","true")},checkHomeVisited:()=>{const o=localStorage.getItem("hasVisitedHome");return t.value=o==="true",t.value},resetHomeVisited:()=>{t.value=!1,localStorage.removeItem("hasVisitedHome")},emitPlanExecutionRequested:o=>{console.log("[TaskStore] emitPlanExecutionRequested called with payload:",o),window.dispatchEvent(new CustomEvent("plan-execution-requested",{detail:o}))}}});class c{static async generatePlan(e,t){return d.withLlmCheck(async()=>{const s={query:e};t&&(s.existingJson=t);const a=await fetch(`${this.PLAN_TEMPLATE_URL}/generate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!a.ok)throw new Error(`Failed to generate plan: ${a.status}`);const i=await a.json();if(i.planJson)try{i.plan=JSON.parse(i.planJson)}catch{i.plan={error:"Unable to parse plan data"}}return i})}static async executePlan(e,t){return d.withLlmCheck(async()=>{console.log("[PlanActApiService] executePlan called with:",{planTemplateId:e,rawParam:t});const s={planTemplateId:e};t&&(s.rawParam=t),console.log("[PlanActApiService] Making request to:",`${this.PLAN_TEMPLATE_URL}/executePlanByTemplateId`),console.log("[PlanActApiService] Request body:",s);const a=await fetch(`${this.PLAN_TEMPLATE_URL}/executePlanByTemplateId`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(console.log("[PlanActApiService] Response status:",a.status,a.ok),!a.ok){const l=await a.text();throw console.error("[PlanActApiService] Request failed:",l),new Error(`Failed to execute plan: ${a.status}`)}const i=await a.json();return console.log("[PlanActApiService] executePlan response:",i),i})}static async savePlanTemplate(e,t){const s=await fetch(`${this.PLAN_TEMPLATE_URL}/save`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,planJson:t})});if(!s.ok)throw new Error(`Failed to save plan: ${s.status}`);return await s.json()}static async getPlanVersions(e){const t=await fetch(`${this.PLAN_TEMPLATE_URL}/versions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});if(!t.ok)throw new Error(`Failed to get plan versions: ${t.status}`);return await t.json()}static async getVersionPlan(e,t){const s=await fetch(`${this.PLAN_TEMPLATE_URL}/get-version`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,versionIndex:t.toString()})});if(!s.ok)throw new Error(`Failed to get specific version plan: ${s.status}`);return await s.json()}static async getAllPlanTemplates(){const e=await fetch(`${this.PLAN_TEMPLATE_URL}/list`);if(!e.ok)throw new Error(`Failed to get plan template list: ${e.status}`);return await e.json()}static async updatePlanTemplate(e,t,s){return d.withLlmCheck(async()=>{const a={planId:e,query:t};s&&(a.existingJson=s);const i=await fetch(`${this.PLAN_TEMPLATE_URL}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok)throw new Error(`Failed to update plan template: ${i.status}`);const l=await i.json();if(l.planJson)try{l.plan=JSON.parse(l.planJson)}catch{l.plan={error:"Unable to parse plan data"}}return l})}static async deletePlanTemplate(e){const t=await fetch(`${this.PLAN_TEMPLATE_URL}/delete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});if(!t.ok)throw new Error(`Failed to delete plan template: ${t.status}`);return await t.json()}static async createCronTask(e){const t=await fetch(this.CRON_TASK_URL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)try{const s=await t.json();throw new Error(s.message||`Failed to create cron task: ${t.status}`)}catch{throw new Error(`Failed to create cron task: ${t.status}`)}return await t.json()}}r(c,"PLAN_TEMPLATE_URL","/api/plan-template"),r(c,"CRON_TASK_URL","/api/cron-tasks");class w{constructor(){r(this,"isCollapsed",!0);r(this,"currentTab","list");r(this,"currentPlanTemplateId",null);r(this,"planTemplateList",[]);r(this,"selectedTemplate",null);r(this,"isLoading",!1);r(this,"errorMessage","");r(this,"jsonContent","");r(this,"generatorPrompt","");r(this,"executionParams","");r(this,"isGenerating",!1);r(this,"isExecuting",!1);r(this,"planVersions",[]);r(this,"currentVersionIndex",-1)}parseDateTime(e){return e?Array.isArray(e)&&e.length>=6?new Date(e[0],e[1]-1,e[2],e[3],e[4],e[5],Math.floor(e[6]/1e6)):typeof e=="string"?new Date(e):new Date:new Date}get sortedTemplates(){return[...this.planTemplateList].sort((e,t)=>{const s=this.parseDateTime(e.updateTime??e.createTime);return this.parseDateTime(t.updateTime??t.createTime).getTime()-s.getTime()})}get canRollback(){return this.planVersions.length>1&&this.currentVersionIndex>0}get canRestore(){return this.planVersions.length>1&&this.currentVersionIndex0){const s=this.planVersions[this.planVersions.length-1];this.jsonContent=s,this.currentVersionIndex=this.planVersions.length-1;try{const a=JSON.parse(s);a.prompt&&(this.generatorPrompt=a.prompt),a.params&&(this.executionParams=a.params)}catch{console.warn("Unable to parse JSON content to get prompt information")}}else this.jsonContent="",this.generatorPrompt="",this.executionParams=""}catch(t){throw console.error("Failed to load template data:",t),t}}createNewTemplate(){const e={id:`new-${Date.now()}`,title:p.global.t("sidebar.newTemplateName"),description:p.global.t("sidebar.newTemplateDescription"),createTime:new Date().toISOString(),updateTime:new Date().toISOString()};this.selectedTemplate=e,this.currentPlanTemplateId=null,this.jsonContent="",this.generatorPrompt="",this.executionParams="",this.planVersions=[],this.currentVersionIndex=-1,this.currentTab="config",console.log("[SidebarStore] Created new empty plan template, switching to config tab")}async deleteTemplate(e){if(!e.id){console.warn("[SidebarStore] deleteTemplate: Invalid template object or ID");return}try{await c.deletePlanTemplate(e.id),this.currentPlanTemplateId===e.id&&this.clearSelection(),await this.loadPlanTemplateList(),console.log(`[SidebarStore] Plan template ${e.id} has been deleted`)}catch(t){throw console.error("Failed to delete plan template:",t),await this.loadPlanTemplateList(),t}}clearSelection(){this.currentPlanTemplateId=null,this.selectedTemplate=null,this.jsonContent="",this.generatorPrompt="",this.executionParams="",this.planVersions=[],this.currentVersionIndex=-1,this.currentTab="list"}clearExecutionParams(){this.executionParams=""}rollbackVersion(){this.canRollback&&(this.currentVersionIndex--,this.jsonContent=this.planVersions[this.currentVersionIndex])}restoreVersion(){this.canRestore&&(this.currentVersionIndex++,this.jsonContent=this.planVersions[this.currentVersionIndex])}async saveTemplate(){if(!this.selectedTemplate)return;const e=this.jsonContent.trim();if(!e)throw new Error("Content cannot be empty");try{JSON.parse(e)}catch(t){throw new Error(`Invalid format, please correct and save. +var m=Object.defineProperty;var T=(n,e,t)=>e in n?m(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>T(n,typeof e!="symbol"?e+"":e,t);import{H as g,r as h,z as P,I as p}from"./index-CNsQoPg8.js";import{L as d}from"./llm-check-BVkAKrj3.js";const V=g("task",()=>{const n=h(null),e=h(""),t=h(!1);return{currentTask:n,taskToInput:e,hasVisitedHome:t,setTask:o=>{console.log("[TaskStore] setTask called with prompt:",o);const u={prompt:o,timestamp:Date.now(),processed:!1};n.value=u,console.log("[TaskStore] Task set, currentTask.value:",n.value)},setTaskToInput:o=>{console.log("[TaskStore] setTaskToInput called with prompt:",o),e.value=o,console.log("[TaskStore] Task to input set:",e.value)},getAndClearTaskToInput:()=>{const o=e.value;return e.value="",console.log("[TaskStore] getAndClearTaskToInput returning:",o),o},markTaskAsProcessed:()=>{console.log("[TaskStore] markTaskAsProcessed called, current task:",n.value),n.value?(n.value.processed=!0,console.log("[TaskStore] Task marked as processed:",n.value)):console.log("[TaskStore] No current task to mark as processed")},clearTask:()=>{n.value=null},hasUnprocessedTask:()=>{const o=n.value&&!n.value.processed;return console.log("[TaskStore] hasUnprocessedTask check - currentTask:",n.value,"result:",o),o},markHomeVisited:()=>{t.value=!0,localStorage.setItem("hasVisitedHome","true")},checkHomeVisited:()=>{const o=localStorage.getItem("hasVisitedHome");return t.value=o==="true",t.value},resetHomeVisited:()=>{t.value=!1,localStorage.removeItem("hasVisitedHome")},emitPlanExecutionRequested:o=>{console.log("[TaskStore] emitPlanExecutionRequested called with payload:",o),window.dispatchEvent(new CustomEvent("plan-execution-requested",{detail:o}))}}});class c{static async generatePlan(e,t){return d.withLlmCheck(async()=>{const s={query:e};t&&(s.existingJson=t);const a=await fetch(`${this.PLAN_TEMPLATE_URL}/generate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!a.ok)throw new Error(`Failed to generate plan: ${a.status}`);const i=await a.json();if(i.planJson)try{i.plan=JSON.parse(i.planJson)}catch{i.plan={error:"Unable to parse plan data"}}return i})}static async executePlan(e,t){return d.withLlmCheck(async()=>{console.log("[PlanActApiService] executePlan called with:",{planTemplateId:e,rawParam:t});const s={planTemplateId:e};t&&(s.rawParam=t),console.log("[PlanActApiService] Making request to:",`${this.PLAN_TEMPLATE_URL}/executePlanByTemplateId`),console.log("[PlanActApiService] Request body:",s);const a=await fetch(`${this.PLAN_TEMPLATE_URL}/executePlanByTemplateId`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(console.log("[PlanActApiService] Response status:",a.status,a.ok),!a.ok){const l=await a.text();throw console.error("[PlanActApiService] Request failed:",l),new Error(`Failed to execute plan: ${a.status}`)}const i=await a.json();return console.log("[PlanActApiService] executePlan response:",i),i})}static async savePlanTemplate(e,t){const s=await fetch(`${this.PLAN_TEMPLATE_URL}/save`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,planJson:t})});if(!s.ok)throw new Error(`Failed to save plan: ${s.status}`);return await s.json()}static async getPlanVersions(e){const t=await fetch(`${this.PLAN_TEMPLATE_URL}/versions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});if(!t.ok)throw new Error(`Failed to get plan versions: ${t.status}`);return await t.json()}static async getVersionPlan(e,t){const s=await fetch(`${this.PLAN_TEMPLATE_URL}/get-version`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,versionIndex:t.toString()})});if(!s.ok)throw new Error(`Failed to get specific version plan: ${s.status}`);return await s.json()}static async getAllPlanTemplates(){const e=await fetch(`${this.PLAN_TEMPLATE_URL}/list`);if(!e.ok)throw new Error(`Failed to get plan template list: ${e.status}`);return await e.json()}static async updatePlanTemplate(e,t,s){return d.withLlmCheck(async()=>{const a={planId:e,query:t};s&&(a.existingJson=s);const i=await fetch(`${this.PLAN_TEMPLATE_URL}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok)throw new Error(`Failed to update plan template: ${i.status}`);const l=await i.json();if(l.planJson)try{l.plan=JSON.parse(l.planJson)}catch{l.plan={error:"Unable to parse plan data"}}return l})}static async deletePlanTemplate(e){const t=await fetch(`${this.PLAN_TEMPLATE_URL}/delete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});if(!t.ok)throw new Error(`Failed to delete plan template: ${t.status}`);return await t.json()}static async createCronTask(e){const t=await fetch(this.CRON_TASK_URL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)try{const s=await t.json();throw new Error(s.message||`Failed to create cron task: ${t.status}`)}catch{throw new Error(`Failed to create cron task: ${t.status}`)}return await t.json()}}r(c,"PLAN_TEMPLATE_URL","/api/plan-template"),r(c,"CRON_TASK_URL","/api/cron-tasks");class w{constructor(){r(this,"isCollapsed",!0);r(this,"currentTab","list");r(this,"currentPlanTemplateId",null);r(this,"planTemplateList",[]);r(this,"selectedTemplate",null);r(this,"isLoading",!1);r(this,"errorMessage","");r(this,"jsonContent","");r(this,"generatorPrompt","");r(this,"executionParams","");r(this,"isGenerating",!1);r(this,"isExecuting",!1);r(this,"planVersions",[]);r(this,"currentVersionIndex",-1)}parseDateTime(e){return e?Array.isArray(e)&&e.length>=6?new Date(e[0],e[1]-1,e[2],e[3],e[4],e[5],Math.floor(e[6]/1e6)):typeof e=="string"?new Date(e):new Date:new Date}get sortedTemplates(){return[...this.planTemplateList].sort((e,t)=>{const s=this.parseDateTime(e.updateTime??e.createTime);return this.parseDateTime(t.updateTime??t.createTime).getTime()-s.getTime()})}get canRollback(){return this.planVersions.length>1&&this.currentVersionIndex>0}get canRestore(){return this.planVersions.length>1&&this.currentVersionIndex0){const s=this.planVersions[this.planVersions.length-1];this.jsonContent=s,this.currentVersionIndex=this.planVersions.length-1;try{const a=JSON.parse(s);a.prompt&&(this.generatorPrompt=a.prompt),a.params&&(this.executionParams=a.params)}catch{console.warn("Unable to parse JSON content to get prompt information")}}else this.jsonContent="",this.generatorPrompt="",this.executionParams=""}catch(t){throw console.error("Failed to load template data:",t),t}}createNewTemplate(){const e={id:`new-${Date.now()}`,title:p.global.t("sidebar.newTemplateName"),description:p.global.t("sidebar.newTemplateDescription"),createTime:new Date().toISOString(),updateTime:new Date().toISOString()};this.selectedTemplate=e,this.currentPlanTemplateId=null,this.jsonContent="",this.generatorPrompt="",this.executionParams="",this.planVersions=[],this.currentVersionIndex=-1,this.currentTab="config",console.log("[SidebarStore] Created new empty plan template, switching to config tab")}async deleteTemplate(e){if(!e.id){console.warn("[SidebarStore] deleteTemplate: Invalid template object or ID");return}try{await c.deletePlanTemplate(e.id),this.currentPlanTemplateId===e.id&&this.clearSelection(),await this.loadPlanTemplateList(),console.log(`[SidebarStore] Plan template ${e.id} has been deleted`)}catch(t){throw console.error("Failed to delete plan template:",t),await this.loadPlanTemplateList(),t}}clearSelection(){this.currentPlanTemplateId=null,this.selectedTemplate=null,this.jsonContent="",this.generatorPrompt="",this.executionParams="",this.planVersions=[],this.currentVersionIndex=-1,this.currentTab="list"}clearExecutionParams(){this.executionParams=""}rollbackVersion(){this.canRollback&&(this.currentVersionIndex--,this.jsonContent=this.planVersions[this.currentVersionIndex])}restoreVersion(){this.canRestore&&(this.currentVersionIndex++,this.jsonContent=this.planVersions[this.currentVersionIndex])}async saveTemplate(){if(!this.selectedTemplate)return;const e=this.jsonContent.trim();if(!e)throw new Error("Content cannot be empty");try{JSON.parse(e)}catch(t){throw new Error(`Invalid format, please correct and save. Error: `+t.message)}try{const t=await c.savePlanTemplate(this.selectedTemplate.id,e);return this.currentVersionIndext in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _=(e,t,r)=>M(e,typeof t!="symbol"?t+"":t,r);import{t as R,m as K}from"./index-Dqcw8yKQ.js";import"./index-DA9oYm7y.js";import"./iconify-CyasjfC7.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-fgXJFj_8.js";import"./index-D2fTT4wr.js";/*!----------------------------------------------------------------------------- +var N=Object.defineProperty;var M=(e,t,r)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _=(e,t,r)=>M(e,typeof t!="symbol"?t+"":t,r);import{t as R,m as K}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/typescript-BEZDUO2m.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/typescript-Cfb9k-qV.js similarity index 95% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/typescript-BEZDUO2m.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/typescript-Cfb9k-qV.js index ec3c94fc35..ca9c0befa2 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/typescript-BEZDUO2m.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/typescript-Cfb9k-qV.js @@ -1,4 +1,4 @@ -import{m as s}from"./index-Dqcw8yKQ.js";import"./index-DA9oYm7y.js";import"./iconify-CyasjfC7.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-fgXJFj_8.js";import"./index-D2fTT4wr.js";/*!----------------------------------------------------------------------------- +import{m as s}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/useMessage-fgXJFj_8.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/useMessage-BR4qCw-P.js similarity index 95% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/useMessage-fgXJFj_8.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/useMessage-BR4qCw-P.js index 12a3592838..b06d7ad866 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/useMessage-fgXJFj_8.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/useMessage-BR4qCw-P.js @@ -1 +1 @@ -import{d as v,r as n,s as g,b as m,g as d,k as _,a as w,f as k,e as T,x as b,t as x,n as y,T as C,C as M,O as B,z as $}from"./index-DA9oYm7y.js";import{I as N}from"./iconify-CyasjfC7.js";import{_ as V}from"./_plugin-vue_export-helper-DlAUqK2U.js";const z=v({__name:"Toast",setup(e,{expose:s}){const a=n(!1),c=n(""),t=n("success"),l=n("carbon:checkmark"),u=n(3e3),p=(i,r="success",h=3e3)=>{c.value=i,t.value=r,l.value=r==="success"?"carbon:checkmark":"carbon:error",u.value=h,a.value=!0,setTimeout(()=>{a.value=!1},u.value)},f=()=>{a.value=!1};return s({show:p}),(i,r)=>(m(),g(M,{to:"body"},[d(C,{name:"slide"},{default:_(()=>[a.value?(m(),w("div",{key:0,class:y(["toast",`toast--${t.value}`]),onClick:f},[d(b(N),{icon:l.value,class:"toast-icon"},null,8,["icon"]),T("span",null,x(c.value),1)],2)):k("",!0)]),_:1})]))}}),E=V(z,[["__scopeId","data-v-581895ae"]]);let o=null;const O=()=>{if(!o){const e=B(E),s=document.createElement("div");document.body.appendChild(s),o=e.mount(s)}return{success:(e,s)=>{o==null||o.show(e,"success",s)},error:(e,s)=>{o==null||o.show(e,"error",s)}}};function j(){const e=$({show:!1,text:"",type:"success"});return{message:e,showMessage:(a,c="success")=>{console.log(`Showing message: ${a}, Type: ${c}`),e.text=a,e.type=c,e.show=!0;const t=c==="error"?5e3:3e3;console.log(`Message will be automatically hidden after ${t}ms`),setTimeout(()=>{e.show=!1,console.log("Message hidden")},t)}}}export{j as a,O as u}; +import{d as v,r as n,s as g,b as m,g as d,k as _,a as w,f as k,e as T,x as b,t as x,n as y,T as C,C as M,O as B,z as $}from"./index-CNsQoPg8.js";import{I as N}from"./iconify-B3l7reUz.js";import{_ as V}from"./_plugin-vue_export-helper-DlAUqK2U.js";const z=v({__name:"Toast",setup(e,{expose:s}){const a=n(!1),c=n(""),t=n("success"),l=n("carbon:checkmark"),u=n(3e3),p=(i,r="success",h=3e3)=>{c.value=i,t.value=r,l.value=r==="success"?"carbon:checkmark":"carbon:error",u.value=h,a.value=!0,setTimeout(()=>{a.value=!1},u.value)},f=()=>{a.value=!1};return s({show:p}),(i,r)=>(m(),g(M,{to:"body"},[d(C,{name:"slide"},{default:_(()=>[a.value?(m(),w("div",{key:0,class:y(["toast",`toast--${t.value}`]),onClick:f},[d(b(N),{icon:l.value,class:"toast-icon"},null,8,["icon"]),T("span",null,x(c.value),1)],2)):k("",!0)]),_:1})]))}}),E=V(z,[["__scopeId","data-v-581895ae"]]);let o=null;const O=()=>{if(!o){const e=B(E),s=document.createElement("div");document.body.appendChild(s),o=e.mount(s)}return{success:(e,s)=>{o==null||o.show(e,"success",s)},error:(e,s)=>{o==null||o.show(e,"error",s)}}};function j(){const e=$({show:!1,text:"",type:"success"});return{message:e,showMessage:(a,c="success")=>{console.log(`Showing message: ${a}, Type: ${c}`),e.text=a,e.type=c,e.show=!0;const t=c==="error"?5e3:3e3;console.log(`Message will be automatically hidden after ${t}ms`),setTimeout(()=>{e.show=!1,console.log("Message hidden")},t)}}}export{j as a,O as u}; diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/xml-IzzTFP6G.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/xml-CXoMhdUk.js similarity index 90% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/xml-IzzTFP6G.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/xml-CXoMhdUk.js index f0e2fb3ff6..938bc2887d 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/xml-IzzTFP6G.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/xml-CXoMhdUk.js @@ -1,4 +1,4 @@ -import{m as r}from"./index-Dqcw8yKQ.js";import"./index-DA9oYm7y.js";import"./iconify-CyasjfC7.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-fgXJFj_8.js";import"./index-D2fTT4wr.js";/*!----------------------------------------------------------------------------- +import{m as r}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/yaml-C27Xr4Pr.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/yaml-D4773nTm.js similarity index 94% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/yaml-C27Xr4Pr.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/yaml-D4773nTm.js index db1d345e08..ef1b046768 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/yaml-C27Xr4Pr.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/yaml-D4773nTm.js @@ -1,4 +1,4 @@ -import{m as i}from"./index-Dqcw8yKQ.js";import"./index-DA9oYm7y.js";import"./iconify-CyasjfC7.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-fgXJFj_8.js";import"./index-D2fTT4wr.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/index.html b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/index.html index abf26d89c1..caf055c6f7 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/index.html +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/index.html @@ -20,7 +20,7 @@ JTaskPoilt - + diff --git a/spring-ai-alibaba-jmanus/ui-vue3/src/base/i18n/index.ts b/spring-ai-alibaba-jmanus/ui-vue3/src/base/i18n/index.ts index 465fbd1187..7ff1e1e1a7 100644 --- a/spring-ai-alibaba-jmanus/ui-vue3/src/base/i18n/index.ts +++ b/spring-ai-alibaba-jmanus/ui-vue3/src/base/i18n/index.ts @@ -55,7 +55,7 @@ export const changeLanguage = async (locale: string) => { } /** - * Change language during initialization and reset all agents + * Change language during initialization and reset all agents and prompts * This function is used during the initial setup process */ export const changeLanguageWithAgentReset = async (locale: string) => { @@ -63,8 +63,24 @@ export const changeLanguageWithAgentReset = async (locale: string) => { await changeLanguage(locale) try { + // Reset prompts to the new language + const promptResponse = await fetch(`/admin/prompts/switch-language?language=${locale}`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }) + + if (promptResponse.ok) { + console.log(`Successfully reset prompts to language: ${locale}`) + } else { + const promptError = await promptResponse.text() + console.error(`Failed to reset prompts to language: ${locale}`, promptError) + // Continue with agent initialization even if prompt reset fails + } + // Initialize agents with the new language (used during initial setup) - const response = await fetch('/api/agent-management/initialize', { + const agentResponse = await fetch('/api/agent-management/initialize', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -72,16 +88,16 @@ export const changeLanguageWithAgentReset = async (locale: string) => { body: JSON.stringify({ language: locale }), }) - if (response.ok) { - const result = await response.json() + if (agentResponse.ok) { + const result = await agentResponse.json() console.log(`Successfully initialized agents with language: ${locale}`, result) } else { - const error = await response.json() + const error = await agentResponse.json() console.error(`Failed to initialize agents with language: ${locale}`, error) throw new Error(error.error || 'Failed to initialize agents') } } catch (error) { - console.error('Error initializing agents during language change:', error) + console.error('Error initializing agents and prompts during language change:', error) throw error } } From 5ab2da37a4640dd0efff62c83b2f3189404b75fe Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Fri, 1 Aug 2025 23:07:50 +0800 Subject: [PATCH 5/5] feat(jmanus): move tool parameter and description to resources --- .../manus/tool/BrowserUseToolSpringTest.java | 662 ------------------ .../example/manus/tool/TerminateToolTest.java | 236 ------- 2 files changed, 898 deletions(-) delete mode 100644 spring-ai-alibaba-jmanus/src/test/java/com/alibaba/cloud/ai/example/manus/tool/BrowserUseToolSpringTest.java delete mode 100644 spring-ai-alibaba-jmanus/src/test/java/com/alibaba/cloud/ai/example/manus/tool/TerminateToolTest.java diff --git a/spring-ai-alibaba-jmanus/src/test/java/com/alibaba/cloud/ai/example/manus/tool/BrowserUseToolSpringTest.java b/spring-ai-alibaba-jmanus/src/test/java/com/alibaba/cloud/ai/example/manus/tool/BrowserUseToolSpringTest.java deleted file mode 100644 index 966816d676..0000000000 --- a/spring-ai-alibaba-jmanus/src/test/java/com/alibaba/cloud/ai/example/manus/tool/BrowserUseToolSpringTest.java +++ /dev/null @@ -1,662 +0,0 @@ -/* - * Copyright 2025 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.alibaba.cloud.ai.example.manus.tool; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.alibaba.cloud.ai.example.manus.dynamic.prompt.service.PromptService; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.MethodOrderer; -import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestMethodOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.ai.chat.messages.Message; -import org.springframework.ai.tool.ToolCallback; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; - -import com.alibaba.cloud.ai.example.manus.OpenManusSpringBootApplication; -import com.alibaba.cloud.ai.example.manus.agent.AgentState; -import com.alibaba.cloud.ai.example.manus.agent.BaseAgent; -import com.alibaba.cloud.ai.example.manus.config.ManusProperties; -import com.alibaba.cloud.ai.example.manus.llm.LlmService; -import com.alibaba.cloud.ai.example.manus.recorder.PlanExecutionRecorder; -import com.alibaba.cloud.ai.example.manus.tool.browser.BrowserUseTool; -import com.alibaba.cloud.ai.example.manus.tool.browser.ChromeDriverService; -import com.alibaba.cloud.ai.example.manus.tool.browser.actions.BrowserRequestVO; -import com.alibaba.cloud.ai.example.manus.tool.browser.actions.GetElementPositionByNameAction; -import com.alibaba.cloud.ai.example.manus.tool.browser.actions.MoveToAndClickAction; -import com.alibaba.cloud.ai.example.manus.tool.code.ToolExecuteResult; -import com.alibaba.cloud.ai.example.manus.tool.innerStorage.SmartContentSavingService; -import com.alibaba.cloud.ai.example.manus.planning.PlanningFactory.ToolCallBackContext; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.core.type.TypeReference; -import com.microsoft.playwright.Page; - -/** - * Spring integration test class for BrowserUseTool using real Spring context to test - * BrowserUseTool functionality - */ -@SpringBootTest(classes = OpenManusSpringBootApplication.class) -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) -@Disabled("For local testing only, skip in CI environment") // Add this line -class BrowserUseToolSpringTest { - - private static final Logger log = LoggerFactory.getLogger(BrowserUseToolSpringTest.class); - - @Autowired - private ChromeDriverService chromeDriverService; - - @Autowired - private SmartContentSavingService innerStorageService; - - private BrowserUseTool browserUseTool; - - @Autowired - private LlmService llmService; - - @Autowired - private PlanExecutionRecorder planExecutionRecorder; - - @Autowired - private ManusProperties manusProperties; - - @Autowired - private PromptService promptService; - - @Autowired - private ObjectMapper objectMapper; - - @BeforeEach - void setUp() { - - manusProperties.setBrowserHeadless(false); - manusProperties.setDebugDetail(true); - chromeDriverService.setManusProperties(manusProperties); - browserUseTool = new BrowserUseTool(chromeDriverService, innerStorageService, objectMapper); - DummyBaseAgent agent = new DummyBaseAgent(llmService, planExecutionRecorder, manusProperties, promptService); - agent.setCurrentPlanId("plan_123123124124124"); - browserUseTool.setCurrentPlanId(agent.getCurrentPlanId()); - - } - - private static class DummyBaseAgent extends BaseAgent { - - public DummyBaseAgent(LlmService llmService, PlanExecutionRecorder planExecutionRecorder, - ManusProperties manusProperties, PromptService promptService) { - super(llmService, planExecutionRecorder, manusProperties, new HashMap<>(), promptService); - - } - - @Override - public String getName() { - return "DummyAgent"; - } - - @Override - public String getDescription() { - return "A dummy agent for testing"; - } - - @Override - protected Message getNextStepWithEnvMessage() { - return null; - } - - @Override - public List getToolCallList() { - return null; - } - - @Override - public ToolCallBackContext getToolCallBackContext(String toolKey) { - return null; - } - - @Override - protected AgentExecResult step() { - return new AgentExecResult("Dummy step executed", AgentState.COMPLETED); - } - - @Override - protected Message getThinkMessage() { - return null; - } - - @Override - public void clearUp(String planId) { - return; - } - - } - - @Test - @Order(1) - @DisplayName("Test browser search for 'Hello World'") - void testHelloWorldSearch() { - try { - // Step 1: Navigate to Baidu - log.info("Step 1: Navigate to Baidu"); - ToolExecuteResult navigateResult = executeAction("navigate", "https://www.baidu.com"); - Assertions.assertEquals("successfully navigated to https://www.baidu.com", navigateResult.getOutput(), - "Failed to navigate to Baidu"); - Page page = browserUseTool.getDriver().getCurrentPage(); - - // Step 2: Get and verify interactive elements - log.info("Step 2: Get interactive elements and analyze"); - Map state = browserUseTool.getCurrentState(page); - String elements = (String) state.get("interactive_elements"); - Assertions.assertNotNull(elements, "Failed to get interactive elements"); - log.info("Retrieved interactive elements: {}", elements); - - // Step 3: Find the search box - log.info("Step 3: Locate search box"); - int searchInputIndex = -1; - String[] elementLines = elements.split("\n"); - for (int i = 0; i < elementLines.length; i++) { - if (elementLines[i].contains("name=\"wd\"") || elementLines[i].contains("id=\"kw\"")) { // Baidu - // search - // box - // characteristics - searchInputIndex = i; - break; - } - } - Assertions.assertNotEquals(-1, searchInputIndex, "Search box not found"); - log.info("Found search box index: {}", searchInputIndex); - - // Step 4: Input text in the search box - log.info("Step 4: Input 'Hello World' in the search box"); - ToolExecuteResult inputResult = executeAction("input_text", null, searchInputIndex, "Hello World"); - Assertions.assertTrue(inputResult.getOutput().contains("Hello World"), - "Failed to input text in search box"); - - // Step 5: Re-get state and find search button - log.info("Step 5: Locate search button"); - - state = browserUseTool.getCurrentState(page); - elements = (String) state.get("interactive_elements"); - int searchButtonIndex = -1; - elementLines = elements.split("\n"); - for (int i = 0; i < elementLines.length; i++) { - if (elementLines[i].contains("value=\"百度一下\"") || elementLines[i].contains(">百度一下<")) { - searchButtonIndex = i; - break; - } - } - Assertions.assertNotEquals(-1, searchButtonIndex, "Search button not found"); - log.info("Found search button index: {}", searchButtonIndex); - - // Step 6: Click search button - log.info("Step 6: Click search button"); - ToolExecuteResult clickResult = executeAction("click", null, searchButtonIndex, null); - Assertions.assertTrue(clickResult.getOutput().contains("clicked"), - "Failed to click search button: " + clickResult.getOutput()); - - // Step 7: Wait and verify search results - log.info("Step 7: Wait for page load and get search results"); - Thread.sleep(2000); // Wait for page load - ToolExecuteResult textResult = executeAction("get_text", null); - String searchResults = textResult.getOutput(); - Assertions.assertTrue(searchResults.contains("Hello World"), - "Did not find 'Hello World' in search results"); - - state = browserUseTool.getCurrentState(page); - elements = (String) state.get("interactive_elements"); - searchButtonIndex = -1; - elementLines = elements.split("\n"); - for (int i = 0; i < elementLines.length; i++) { - if (elementLines[i].contains("hello world") && elementLines[i].contains("百度百科")) { - searchButtonIndex = i; - break; - } - } - clickResult = executeAction("click", null, searchButtonIndex, null); - Assertions.assertTrue(clickResult.getOutput().contains("clicked"), - "Failed to click search button: " + clickResult.getOutput()); - - log.info("Login success"); - - } - catch (Exception e) { - log.error("Error occurred during test", e); - Assertions.fail("Test execution failed: " + e.getMessage()); - } - } - - @Test - @Order(2) - @DisplayName("Test element positioning by name and click Baidu search button") - void testGetElementPositionAndMoveToClick() { - try { - // Step 1: Navigate to Baidu - log.info("Step 1: Navigate to Baidu"); - ToolExecuteResult navigateResult = executeAction("navigate", "https://www.baidu.com"); - Assertions.assertEquals("successfully navigated to https://www.baidu.com", navigateResult.getOutput(), - "Failed to navigate to Baidu"); - Page page = browserUseTool.getDriver().getCurrentPage(); - - // Step 2: Get and verify interactive elements - log.info("Step 2: Get interactive elements and analyze"); - Map state = browserUseTool.getCurrentState(page); - String elements = (String) state.get("interactive_elements"); - Assertions.assertNotNull(elements, "Failed to get interactive elements"); - log.info("Retrieved interactive elements: {}", elements); - - // Step 3: Find the search box - log.info("Step 3: Locate search box"); - int searchInputIndex = -1; - String[] elementLines = elements.split("\n"); - for (int i = 0; i < elementLines.length; i++) { - if (elementLines[i].contains("name=\"wd\"") || elementLines[i].contains("id=\"kw\"")) { // Baidu - // search - // box - // characteristics - searchInputIndex = i; - break; - } - } - Assertions.assertNotEquals(-1, searchInputIndex, "Search box not found"); - log.info("Found search box index: {}", searchInputIndex); - - // Step 4: Input text in search box - log.info("Step 4: Input 'Hello World' in search box"); - ToolExecuteResult inputResult = executeAction("input_text", null, searchInputIndex, "Hello World"); - Assertions.assertTrue(inputResult.getOutput().contains("Hello World"), - "Failed to input text in search box"); - - // Step 5: Use GetElementPositionByNameAction to find search button - log.info("Step 5: Use GetElementPositionByNameAction to find '百度一下' button"); - BrowserRequestVO positionRequest = new BrowserRequestVO(); - positionRequest.setElementName("百度一下"); - GetElementPositionByNameAction positionAction = new GetElementPositionByNameAction(browserUseTool, - objectMapper); - ToolExecuteResult positionResult = positionAction.execute(positionRequest); - log.info("Retrieved '百度一下' button position info: {}", positionResult.getOutput()); - - // Parse JSON result to get coordinates - List positionsList = objectMapper.readValue(positionResult.getOutput(), new TypeReference>() { - }); - Assertions.assertFalse(positionsList.isEmpty(), "'百度一下' button not found"); - Map elementPosition = (Map) positionsList.get(0); - Double xNumber = (Double) elementPosition.get("x"); - Double yNumber = (Double) elementPosition.get("y"); - Double x = xNumber.doubleValue(); - Double y = yNumber.doubleValue(); - log.info("'百度一下' button coordinates: x={}, y={}", x, y); - - // Step 6: Use MoveToAndClickAction to click search button - log.info("Step 6: Use MoveToAndClickAction to click '百度一下' button"); - BrowserRequestVO clickRequest = new BrowserRequestVO(); - clickRequest.setPositionX(x); - clickRequest.setPositionY(y); - MoveToAndClickAction clickAction = new MoveToAndClickAction(browserUseTool); - ToolExecuteResult clickResult = clickAction.execute(clickRequest); - log.info("Click result: {}", clickResult.getOutput()); - Assertions.assertTrue(clickResult.getOutput().contains("Clicked"), "Failed to click '百度一下' button"); - - // Step 7: Wait and verify search results - log.info("Step 7: Wait for page load and get search results"); - Thread.sleep(2000); // Wait for page load - ToolExecuteResult textResult = executeAction("get_text", null); - String searchResults = textResult.getOutput(); - Assertions.assertTrue(searchResults.contains("Hello World"), - "Did not find 'Hello World' in search results"); - - // Step 8: Use GetElementPositionByNameAction to find and click Baidu Baike - // link - log.info("Step 8: Use GetElementPositionByNameAction to find '百度百科' link"); - BrowserRequestVO baikePositionRequest = new BrowserRequestVO(); - baikePositionRequest.setElementName("百度百科"); - GetElementPositionByNameAction baikePositionAction = new GetElementPositionByNameAction(browserUseTool, - objectMapper); - ToolExecuteResult baikePositionResult = baikePositionAction.execute(baikePositionRequest); - log.info("Retrieved '百度百科' link position info: {}", baikePositionResult.getOutput()); - - // Parse JSON result to get Baidu Baike link coordinates - List baikePositionsList = objectMapper.readValue(baikePositionResult.getOutput(), - new TypeReference>() { - }); - - if (!baikePositionsList.isEmpty()) { - // Find Baidu Baike link containing "hello world" related content - Map targetPosition = null; - for (Object positionObj : baikePositionsList) { - Map position = (Map) positionObj; - String elementText = (String) position.get("elementText"); - if (elementText != null && elementText.toLowerCase().contains("hello world(程序代码调试常用文本) - 百度百科")) { - targetPosition = position; - break; - } - } - - if (targetPosition != null) { - Double baikeX = (Double) targetPosition.get("x"); - Double baikeY = (Double) targetPosition.get("y"); - log.info("'百度百科' link coordinates: x={}, y={}", baikeX, baikeY); - - // Use MoveToAndClickAction to click Baidu Baike link - log.info("Use MoveToAndClickAction to click '百度百科' link"); - BrowserRequestVO baikeClickRequest = new BrowserRequestVO(); - baikeClickRequest.setPositionX(baikeX); - baikeClickRequest.setPositionY(baikeY); - MoveToAndClickAction baikeClickAction = new MoveToAndClickAction(browserUseTool); - ToolExecuteResult baikeClickResult = baikeClickAction.execute(baikeClickRequest); - log.info("Baidu Baike link click result: {}", baikeClickResult.getOutput()); - Assertions.assertTrue(baikeClickResult.getOutput().contains("Clicked"), - "Failed to click '百度百科' link"); - log.info("Successfully clicked Baidu Baike link"); - } - else { - log.warn("Did not find Baidu Baike link containing 'hello world'"); - } - } - else { - log.warn("Did not find '百度百科' link"); - } - - log.info("Test completed successfully!"); - - } - catch (Exception e) { - log.error("Error occurred during test", e); - Assertions.fail("Test execution failed: " + e.getMessage()); - } - } - - /** - * Generic method to navigate to specified URL and verify interactive elements - * @param tool BrowserUseTool instance - * @param url Target URL - * @param expectedElements List of expected element keywords to appear on the page - * @return Retrieved interactive elements string - */ - private String navigateAndVerifyElements(BrowserUseTool tool, String url, List expectedElements) { - // Step 1: Navigate to specified URL - log.info("Step 1: Navigate to {}", url); - ToolExecuteResult navigateResult = executeAction("navigate", url); - Assertions.assertEquals("successfully navigated to " + url, navigateResult.getOutput(), "Navigation failed"); - - Page page = browserUseTool.getDriver().getCurrentPage(); - // Step 2: Get and verify interactive elements - log.info("Step 2: Get interactive elements"); - Map state = tool.getCurrentState(page); - String elements = (String) state.get("interactive_elements"); - Assertions.assertNotNull(elements, "Failed to get interactive elements"); - log.info("Retrieved interactive elements: {}", elements); - - // Step 3: Verify expected elements - log.info("Step 3: Verify expected elements"); - String[] elementLines = elements.split("\n"); - for (String expectedElement : expectedElements) { - boolean found = false; - for (String line : elementLines) { - if (line.contains(expectedElement)) { - found = true; - break; - } - } - log.info("Expected element '{}' found: {}", expectedElement, found); - } - return elements; - } - - @Test - @Order(4) - @DisplayName("Test navigate to specified URL and get interactive elements") - void testNavigateAndGetElements() { - // Test navigating to different pages and verify interactive elements - List baiduExpected = Arrays.asList("Baidu Search", "input"); - String baiduElements = navigateAndVerifyElements(browserUseTool, "https://www.baidu.com", baiduExpected); - Assertions.assertNotNull(baiduElements, "Failed to get Baidu interactive elements"); - - List githubExpected = Arrays.asList("search", "Sign"); - String githubElements = navigateAndVerifyElements(browserUseTool, "https://github.com", githubExpected); - Assertions.assertNotNull(githubElements, "Failed to get GitHub interactive elements"); - - log.info("All navigation tests passed!"); - } - - @Test - @Order(5) - @DisplayName("Test GitHub search page elements") - void testGitHubSearch() { - // Test simple GitHub page loading - ToolExecuteResult navigateResult = executeAction("navigate", "https://github.com"); - Assertions.assertEquals("successfully navigated to https://github.com", navigateResult.getOutput(), - "Failed to navigate to GitHub"); - - Page page = browserUseTool.getDriver().getCurrentPage(); - Map state = browserUseTool.getCurrentState(page); - String elements = (String) state.get("interactive_elements"); - Assertions.assertNotNull(elements, "Failed to get GitHub interactive elements"); - log.info("GitHub interactive elements: {}", elements); - } - - @Test - @Order(6) - @DisplayName("Test Nacos page elements") - void testNacosPageLink() { - // Test simple Nacos page loading - ToolExecuteResult navigateResult = executeAction("navigate", "https://nacos.io"); - Assertions.assertEquals("successfully navigated to https://nacos.io", navigateResult.getOutput(), - "Failed to navigate to Nacos"); - - Page page = browserUseTool.getDriver().getCurrentPage(); - Map state = browserUseTool.getCurrentState(page); - String elements = (String) state.get("interactive_elements"); - Assertions.assertNotNull(elements, "Failed to get Nacos interactive elements"); - log.info("Nacos interactive elements: {}", elements); - } - - @Test - @Order(6) - @DisplayName("Test Baidu homepage elements") - void testBaiduElements() { - // Test simple Baidu page loading - ToolExecuteResult navigateResult = executeAction("navigate", "https://www.baidu.com"); - Assertions.assertEquals("successfully navigated to https://www.baidu.com", navigateResult.getOutput(), - "Failed to navigate to Baidu"); - - Page page = browserUseTool.getDriver().getCurrentPage(); - Map state = browserUseTool.getCurrentState(page); - String elements = (String) state.get("interactive_elements"); - Assertions.assertNotNull(elements, "Failed to get Baidu interactive elements"); - log.info("Baidu interactive elements: {}", elements); - } - - @Test - @Order(7) - @DisplayName("Test CSDN website login functionality") - void testCsdnLogin() { - try { - // Step 1: Navigate to CSDN - log.info("Step 1: Navigate to CSDN"); - ToolExecuteResult navigateResult = executeAction("navigate", "https://passport.csdn.net/login"); - Assertions.assertEquals("successfully navigated to https://passport.csdn.net/login", - navigateResult.getOutput(), "Failed to navigate to CSDN login"); - Page page = browserUseTool.getDriver().getCurrentPage(); - - // Step 2: Get and verify interactive elements - log.info("Step 2: Get interactive elements and analyze"); - Map state = browserUseTool.getCurrentState(page); - String elements = (String) state.get("interactive_elements"); - Assertions.assertNotNull(elements, "Failed to get interactive elements"); - log.info("Retrieved interactive elements: {}", elements); - - // Step 3: Find username input field (not currently used but defined for - // potential future use) - log.info("Step 3: Locate username input box"); - @SuppressWarnings("unused") - int usernameInputIndex = -1; - String[] elementLines = elements.split("\n"); - int loginButtonIndex = -1; - - for (String line : elementLines) { - // 从每行开头提取元素的实际索引号,格式如 [195] positionsList = objectMapper.readValue(positionResult.getOutput(), new TypeReference>() { - }); - Assertions.assertFalse(positionsList.isEmpty(), "未找到'APP登录'元素"); - - // 获取第一个匹配元素的位置信息 - Map elementPosition = (Map) positionsList.get(0); - Double xNumber = (Double) elementPosition.get("x"); - Double yNumber = (Double) elementPosition.get("y"); - log.info("验证码登录元素坐标: x={}, y={}", xNumber, yNumber); - - // 使用MoveToAndClickAction通过坐标点击元素 - BrowserRequestVO clickRequest = new BrowserRequestVO(); - clickRequest.setPositionX(xNumber); - clickRequest.setPositionY(yNumber); - - MoveToAndClickAction clickAction = new MoveToAndClickAction(browserUseTool); - ToolExecuteResult clickResult = clickAction.execute(clickRequest); - log.info("点击结果: {}", clickResult.getOutput()); - Assertions.assertTrue(clickResult.getOutput().contains("Clicked"), "点击验证码登录元素失败"); - - // 等待密码登录表单加载 - log.info("等待密码登录表单加载..."); - Thread.sleep(1000); - - // 获取更新后的交互元素 - state = browserUseTool.getCurrentState(page); - elements = (String) state.get("interactive_elements"); - elementLines = elements.split("\n"); - - // 步骤5: 查找手机号输入框 - log.info("步骤5: 查找手机号输入框"); - int phoneInputIndex = -1; - int verifyCodeButtonIndex = -1; - - for (String line : elementLines) { - // 从每行开头提取元素的实际索引号,格式如 [195] testColumns = Arrays.asList("name", "age", "city"); - terminateTool = new TerminateTool("test-plan-123", testColumns); - } - - @Test - @DisplayName("测试 generateParametersJson 方法返回的 JSON 结构") - void testGenerateParametersJson() { - // 测试不同的列配置 - List columns1 = Arrays.asList("name", "age"); - List columns2 = Arrays.asList("id", "title", "description", "status"); - List emptyColumns = Arrays.asList(); - List nullColumns = null; - - System.out.println("=== generateParametersJson 测试结果 ==="); - - // 测试1: 普通列 - String json1 = getParametersJsonViaReflection(columns1); - System.out.println("测试1 - 普通列 [name, age]:"); - System.out.println(json1); - System.out.println(); - - // 测试2: 多列 - String json2 = getParametersJsonViaReflection(columns2); - System.out.println("测试2 - 多列 [id, title, description, status]:"); - System.out.println(json2); - System.out.println(); - - // 测试3: 空列表 - String json3 = getParametersJsonViaReflection(emptyColumns); - System.out.println("测试3 - 空列表 []:"); - System.out.println(json3); - System.out.println(); - - // 测试4: null列表 - String json4 = getParametersJsonViaReflection(nullColumns); - System.out.println("测试4 - null列表:"); - System.out.println(json4); - System.out.println(); - - // 验证JSON包含必要的结构 - assertTrue(json1.contains("\"type\": \"object\"")); - assertTrue(json1.contains("\"properties\"")); - assertTrue(json1.contains("\"columns\"")); - assertTrue(json1.contains("\"data\"")); - assertTrue(json1.contains("\"required\": [\"columns\", \"data\"]")); - } - - @Test - @DisplayName("测试 getCurrentToolStateString 方法在不同状态下的返回内容") - void testGetCurrentToolStateString() { - System.out.println("=== getCurrentToolStateString 测试结果 ==="); - - // 测试1: 初始状态 - String initialState = terminateTool.getCurrentToolStateString(); - System.out.println("测试1 - 初始状态:"); - System.out.println(initialState); - System.out.println(); - - // 测试2: 执行终止操作后的状态 - Map terminateInput = new HashMap<>(); - terminateInput.put("columns", Arrays.asList("name", "status")); - terminateInput.put("data", Arrays.asList(Arrays.asList("Alice", "completed"), Arrays.asList("Bob", "pending"))); - - terminateTool.run(terminateInput); - String terminatedState = terminateTool.getCurrentToolStateString(); - System.out.println("测试2 - 终止后状态:"); - System.out.println(terminatedState); - System.out.println(); - - // 验证状态变化 - assertFalse(initialState.contains("🛑 Terminated")); - assertTrue(initialState.contains("⚡ Active")); - - assertTrue(terminatedState.contains("🛑 Terminated")); - assertFalse(terminatedState.contains("⚡ Active")); - assertTrue(terminatedState.contains("test-plan-123")); - } - - @Test - @DisplayName("测试不同列配置下的 TerminateTool 行为") - void testDifferentColumnConfigurations() { - System.out.println("=== 不同列配置测试 ==="); - - // 测试1: 默认列(空列表) - TerminateTool tool1 = new TerminateTool("plan-1", Arrays.asList()); - String state1 = tool1.getCurrentToolStateString(); - System.out.println("测试1 - 默认列配置 (空列表):"); - System.out.println(state1); - System.out.println(); - - // 测试2: null列 - TerminateTool tool2 = new TerminateTool("plan-2", null); - String state2 = tool2.getCurrentToolStateString(); - System.out.println("测试2 - null列配置:"); - System.out.println(state2); - System.out.println(); - - // 测试3: 单列 - TerminateTool tool3 = new TerminateTool("plan-3", Arrays.asList("result")); - String state3 = tool3.getCurrentToolStateString(); - System.out.println("测试3 - 单列配置 [result]:"); - System.out.println(state3); - System.out.println(); - - // 验证默认行为 - assertTrue(state1.contains("message")); // 默认列应该是 "message" - assertTrue(state2.contains("message")); // null时也应该使用默认列 - assertTrue(state3.contains("result")); - } - - @Test - @DisplayName("测试工具定义生成") - void testToolDefinition() { - System.out.println("=== 工具定义测试 ==="); - - List testColumns = Arrays.asList("task_id", "result", "timestamp"); - var toolDefinition = TerminateTool.getToolDefinition(testColumns); - - // FunctionTool 是一个简单的包装类,我们通过反射来获取内部的 function 对象 - try { - var functionField = toolDefinition.getClass().getDeclaredField("function"); - functionField.setAccessible(true); - var function = functionField.get(toolDefinition); - - var nameField = function.getClass().getDeclaredField("name"); - nameField.setAccessible(true); - String name = (String) nameField.get(function); - - var descriptionField = function.getClass().getDeclaredField("description"); - descriptionField.setAccessible(true); - String description = (String) descriptionField.get(function); - - var parametersField = function.getClass().getDeclaredField("parameters"); - parametersField.setAccessible(true); - String parameters = (String) parametersField.get(function); - - System.out.println("工具名称: " + name); - System.out.println("工具描述: " + description); - System.out.println("参数结构:"); - System.out.println(parameters); - System.out.println(); - - assertEquals("terminate", name); - assertNotNull(description); - assertNotNull(parameters); - } - catch (Exception e) { - System.out.println("Failed to access FunctionTool fields via reflection: " + e.getMessage()); - // 简化测试,只验证工具定义不为null - assertNotNull(toolDefinition); - } - } - - @Test - @DisplayName("测试 JSON 输出的长度和格式") - void testJsonOutputCharacteristics() { - System.out.println("=== JSON 输出特征测试 ==="); - - // 测试不同规模的列配置 - List smallColumns = Arrays.asList("id"); - List mediumColumns = Arrays.asList("id", "name", "status", "created_at"); - List largeColumns = Arrays.asList("id", "name", "email", "phone", "address", "city", "state", "zip", - "country", "notes"); - - String smallJson = getParametersJsonViaReflection(smallColumns); - String mediumJson = getParametersJsonViaReflection(mediumColumns); - String largeJson = getParametersJsonViaReflection(largeColumns); - - System.out.println("小规模列 (1列) JSON长度: " + smallJson.length() + " 字符"); - System.out.println("中等规模列 (4列) JSON长度: " + mediumJson.length() + " 字符"); - System.out.println("大规模列 (10列) JSON长度: " + largeJson.length() + " 字符"); - System.out.println(); - - // 验证JSON格式正确性(简单验证) - assertTrue(smallJson.startsWith("{")); - assertTrue(smallJson.endsWith("}")); - assertTrue(mediumJson.contains("\"type\": \"object\"")); - assertTrue(largeJson.contains("\"items\": {\"type\": \"string\"}")); - - // 确保长度在合理范围内(避免过长导致解析问题) - assertTrue(smallJson.length() < 1000, "小规模JSON应该小于1000字符"); - assertTrue(mediumJson.length() < 1000, "中等规模JSON应该小于1000字符"); - assertTrue(largeJson.length() < 1000, "大规模JSON应该小于1000字符"); - } - - /** - * 通过反射调用私有静态方法 generateParametersJson - */ - private String getParametersJsonViaReflection(List columns) { - try { - var method = TerminateTool.class.getDeclaredMethod("generateParametersJson", List.class); - method.setAccessible(true); - return (String) method.invoke(null, columns); - } - catch (Exception e) { - throw new RuntimeException("Failed to invoke generateParametersJson", e); - } - } - -}